diff --git a/dist/blocks.js b/dist/blocks.js
index 450ce13..258f4ec 100644
--- a/dist/blocks.js
+++ b/dist/blocks.js
@@ -6,12 +6,13 @@ export default ((editor, opts = {}) => {
const bm = editor.BlockManager;
const blocks = bm.getAll();
const mode = ContentService.getMode(editor);
+
if (mode === ContentService.modeEmailMjml) {
const blockMjml = new BlocksMjml(editor);
blockMjml.addBlocks();
- }
+ } // a add button block for landing page
+
- // a add button block for landing page
if (mode === ContentService.modePageHtml) {
const buttonBlock = new ButtonBlock(editor);
buttonBlock.addButtonBlock();
@@ -19,96 +20,104 @@ export default ((editor, opts = {}) => {
// Add Dynamic Content block only for email modes
const dcb = new DynamicContentBlocks(editor, opts);
dcb.addDynamciContentBlock();
- }
+ } // Add icon to mj-hero
+
- // Add icon to mj-hero
if (typeof bm.get('mj-hero') !== 'undefined') {
bm.get('mj-hero').set({
attributes: {
class: 'gjs-fonts gjs-f-hero'
}
});
- }
+ } // Delete mj-wrapper
+
- // Delete mj-wrapper
if (typeof bm.get('mj-wrapper') !== 'undefined') {
bm.remove('mj-wrapper');
- }
+ } // All block inside Blocks category
+
- // All block inside Blocks category
blocks.forEach(block => {
block.set({
category: Mautic.translate('grapesjsbuilder.categoryBlockLabel')
});
});
-
/*
* Custom block inside Sections category
*/
-
// MJML columns
+
if (typeof bm.get('mj-1-column') !== 'undefined') {
bm.get('mj-1-column').set({
label: Mautic.translate('grapesjsbuilder.components.names.oneColumn'),
category: Mautic.translate('grapesjsbuilder.categorySectionLabel')
});
}
+
if (typeof bm.get('mj-2-columns') !== 'undefined') {
bm.get('mj-2-columns').set({
label: Mautic.translate('grapesjsbuilder.components.names.twoColumn'),
category: Mautic.translate('grapesjsbuilder.categorySectionLabel')
});
}
+
if (typeof bm.get('mj-3-columns') !== 'undefined') {
bm.get('mj-3-columns').set({
label: Mautic.translate('grapesjsbuilder.components.names.threeColumn'),
category: Mautic.translate('grapesjsbuilder.categorySectionLabel')
});
}
+
if (typeof bm.get('mj-37-columns') !== 'undefined') {
bm.get('mj-37-columns').set({
category: Mautic.translate('grapesjsbuilder.categorySectionLabel')
});
- }
+ } // Newsletter columns
+
- // Newsletter columns
if (typeof bm.get('sect100') !== 'undefined') {
bm.get('sect100').set({
category: Mautic.translate('grapesjsbuilder.categorySectionLabel')
});
}
+
if (typeof bm.get('sect50') !== 'undefined') {
bm.get('sect50').set({
category: Mautic.translate('grapesjsbuilder.categorySectionLabel')
});
}
+
if (typeof bm.get('sect30') !== 'undefined') {
bm.get('sect30').set({
category: Mautic.translate('grapesjsbuilder.categorySectionLabel')
});
}
+
if (typeof bm.get('sect37') !== 'undefined') {
bm.get('sect37').set({
category: Mautic.translate('grapesjsbuilder.categorySectionLabel')
});
- }
+ } // Webpage columns
+
- // Webpage columns
if (typeof bm.get('column1') !== 'undefined') {
bm.get('column1').set({
category: Mautic.translate('grapesjsbuilder.categorySectionLabel')
});
}
+
if (typeof bm.get('column2') !== 'undefined') {
bm.get('column2').set({
category: Mautic.translate('grapesjsbuilder.categorySectionLabel')
});
}
+
if (typeof bm.get('column3') !== 'undefined') {
bm.get('column3').set({
category: Mautic.translate('grapesjsbuilder.categorySectionLabel')
});
}
+
if (typeof bm.get('column3-7') !== 'undefined') {
bm.get('column3-7').set({
category: Mautic.translate('grapesjsbuilder.categorySectionLabel')
diff --git a/dist/blocks/blocks.mjml.js b/dist/blocks/blocks.mjml.js
index 59a1b99..ddec8d7 100644
--- a/dist/blocks/blocks.mjml.js
+++ b/dist/blocks/blocks.mjml.js
@@ -1,13 +1,15 @@
-function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
-function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
+function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+
export default class BlocksMjml {
constructor(editor) {
_defineProperty(this, "blockManager", void 0);
+
_defineProperty(this, "editor", void 0);
+
this.editor = editor;
this.blockManager = editor.BlockManager;
}
+
addBlocks() {
const sections37 = `Content 1
Content 2`;
@@ -85,4 +87,5 @@ export default class BlocksMjml {
content: `${listItem}`
});
}
+
}
\ No newline at end of file
diff --git a/dist/buttonBlock.js b/dist/buttonBlock.js
index 038850b..8bf9266 100644
--- a/dist/buttonBlock.js
+++ b/dist/buttonBlock.js
@@ -1,11 +1,12 @@
-function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
-function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
+function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
+
export default class ButtonBlock {
constructor(editor) {
_defineProperty(this, "blockManager", void 0);
+
this.blockManager = editor.BlockManager;
}
+
addButtonBlock() {
const style = `