0&&void 0!==arguments[0]?arguments[0]:null,r=this.get('StorageManager');this.get('toLoad').forEach((function(t){return t.onLoad()}));var i=function(){t.get('modules').forEach((function(e){return e.postLoad&&e.postLoad(t)})),t.set('readyLoad',1),e&&e()};r&&r.canAutoload()?this.load(i):setTimeout(i);var o=new n({noticeOnUnload:!1,storageManager:!1,undoManager:!1});['PageManager','Canvas'].forEach((function(t){return o.get(t).onLoad()})),this.set('shallow',o)}},{key:"updateChanges",value:function(){var t=this,e=this.get('StorageManager'),n=this.get('changesCount');D&&clearTimeout(D),D=setTimeout((function(){return t.trigger('update')})),this.config.noticeOnUnload&&(window.onbeforeunload=n?function(t){return 1}:null),e.isAutosave()&&n>=e.getStepsBeforeSave()&&this.store()}},{key:"loadModule",value:function(t){var e=this.config,n=new(t.default||t),r=n.name.charAt(0).toLowerCase()+n.name.slice(1),i=Object(o["isUndefined"])(e[r])?e[n.name]:e[r],a=!0===i?{}:i||{},s=this.get('StorageManager');if(a.pStylePrefix=e.pStylePrefix||'',Object(o["isUndefined"])(i)||i||(a._disable=1),n.storageKey&&n.store&&n.load&&s){a.stm=s;var c='domComponents'==r?'unshift':'push';this.get('storables')[c](n)}return a.em=this,n.init(_({},a)),!n.private&&this.set(n.name,n),n.onLoad&&this.get('toLoad').push(n),this.get('modules').push(n),this}},{key:"init",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.destroyed&&(this.initialize(e),this.destroyed=0),this.set('Editor',t)}},{key:"getEditor",value:function(){return this.get('Editor')}},{key:"handleUpdates",value:function(t,e){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.__skip||r.temporary||r.noCount||r.avoidStore||!this.get('ready')||(E&&clearTimeout(E),E=setTimeout((function(){var t=n.get('changesCount')||0,e=(r.unset,l()(r,j));n.set('changesCount',t+1,e)}),0))}},{key:"changesUp",value:function(t){this.handleUpdates(0,0,t)}},{key:"componentHovered",value:function(t,e,n){var r=this.previous('componentHovered');r&&this.trigger('component:unhovered',r,n),e&&this.trigger('component:hovered',e,n)}},{key:"getSelected",value:function(){return this.get('selected').lastComponent()}},{key:"getSelectedAll",value:function(){return this.get('selected').allComponents()}},{key:"setSelected",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.event,i=r&&(r.ctrlKey||r.metaKey),s=r||{},c=s.shiftKey,l=Object(o["isArray"])(t),u=(l?t:[t]).map((function(t){return Object(x["getModel"])(t,a["default"])})),f=this.getSelectedAll(),h=this.getConfig('multipleSelection');l&&this.removeSelected(f.filter((function(t){return!Object(o["contains"])(u,t)}))),u.forEach((function(t){var r=Object(x["getModel"])(t);if(r&&(e.trigger('component:select:before',r,n),!r.get('selectable')||n.abort)){if(!n.useValid)return;for(var a=r.parent();a&&!a.get('selectable');)a=a.parent();r=a}if(i&&h)return e.toggleSelected(r);if(c&&h){e.clearSelection(e.get('Canvas').getWindow());var s,u,d=r.collection,p=r.index();if(e.getSelectedAll().forEach((function(t){var e=t.collection,n=t.index();e===d&&(np&&(u=Object(o["isUndefined"])(u)?n:Math.min(u,n)))})),!Object(o["isUndefined"])(s))for(;s!==p;)e.addSelected(d.at(s)),s++;if(!Object(o["isUndefined"])(u))for(;u!==p;)e.addSelected(d.at(u)),u--;return e.addSelected(r)}!l&&e.removeSelected(f.filter((function(t){return t!==r}))),e.addSelected(r,n),r}))}},{key:"addSelected",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(x["getModel"])(t,a["default"]),i=Object(o["isArray"])(r)?r:[r];i.forEach((function(t){if(!t||t.get('selectable')){var r=e.get('selected');n.forceChange&&e.removeSelected(t,n),r.addComponent(t,n),t&&e.trigger('component:select',t,n)}}))}},{key:"removeSelected",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.get('selected').removeComponent(Object(x["getModel"])(t,a["default"]),e)}},{key:"toggleSelected",value:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(x["getModel"])(t,a["default"]),i=Object(o["isArray"])(r)?r:[r];i.forEach((function(t){e.get('selected').hasComponent(t)?e.removeSelected(t,n):e.addSelected(t,n)}))}},{key:"setHovered",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return this.set('componentHovered','');var n='component:hover',r=Object(x["getModel"])(t);if(r){if(e.forceChange&&this.set('componentHovered',''),this.trigger("".concat(n,":before"),r,e),!r.get('hoverable')){if(!e.useValid||e.abort)return;for(var i=r&&r.parent();i&&!i.get('hoverable');)i=i.parent();r=i}e.abort||(this.set('componentHovered',r,e),this.trigger(n,r,e))}}},{key:"getHovered",value:function(){return this.get('componentHovered')}},{key:"setComponents",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.get('DomComponents').setComponents(t,e)}},{key:"getComponents",value:function(){var t=this.get('DomComponents'),e=this.get('CodeManager');if(t&&e){var n=t.getComponents();return e.getCode(n,'json')}}},{key:"setStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.get('CssComposer');return n.clear(e),n.getAll().add(t,e),this}},{key:"addStyle",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.getStyle().add(t,e);return Object(o["isArray"])(n)?n:[n]}},{key:"getStyle",value:function(){return this.get('CssComposer').getAll()}},{key:"setState",value:function(t){return this.set('state',t),this}},{key:"getState",value:function(){return this.get('state')||''}},{key:"getHtml",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.config,n=e.optsHtml,r=e.exportWrapper,i=e.wrapperIsBody,o=e.jsInHtml?this.getJs(t):'',a=t.component||this.get('DomComponents').getComponent(),s=a?this.get('CodeManager').getCode(a,'html',_(_({exportWrapper:r,wrapperIsBody:i},n),t)):'';return s+=o?"` : '';\n return html;\n }\n\n /**\n * Returns CSS built inside canvas\n * @param {Object} [opts={}] Options\n * @returns {string} CSS string\n * @private\n */\n getCss(opts = {}) {\n const config = this.config;\n const { optsCss, wrapperIsBody } = config;\n const avoidProt = opts.avoidProtected;\n const keepUnusedStyles = !isUndefined(opts.keepUnusedStyles) ? opts.keepUnusedStyles : config.keepUnusedStyles;\n const cssc = this.get('CssComposer');\n const wrp = opts.component || this.get('DomComponents').getComponent();\n const protCss = !avoidProt ? config.protectedCss : '';\n const css =\n wrp &&\n this.get('CodeManager').getCode(wrp, 'css', {\n cssc,\n wrapperIsBody,\n keepUnusedStyles,\n ...optsCss,\n ...opts,\n });\n return wrp ? (opts.json ? css : protCss + css) : '';\n }\n\n /**\n * Returns JS of all components\n * @return {string} JS string\n * @private\n */\n getJs(opts = {}) {\n var wrp = opts.component || this.get('DomComponents').getWrapper();\n return wrp ? this.get('CodeManager').getCode(wrp, 'js').trim() : '';\n }\n\n /**\n * Store data to the current storage\n * @param {Function} clb Callback function\n * @return {Object} Stored data\n * @private\n */\n store(clb) {\n const sm = this.get('StorageManager');\n if (!sm) return;\n\n const store = this.storeData();\n sm.store(store, res => {\n clb && clb(res, store);\n this.set('changesCount', 0);\n this.trigger('storage:store', store);\n });\n\n return store;\n }\n\n storeData() {\n let result = {};\n // Sync content if there is an active RTE\n const editingCmp = this.getEditing();\n editingCmp && editingCmp.trigger('sync:content', { noCount: true });\n\n this.get('storables').forEach(m => {\n result = { ...result, ...m.store(1) };\n });\n return result;\n }\n\n /**\n * Load data from the current storage\n * @param {Function} clb Callback function\n * @private\n */\n load(clb = null) {\n this.getCacheLoad(1, res => {\n this.loadData(res);\n clb && clb(res);\n });\n }\n\n loadData(data = {}) {\n const sm = this.get('StorageManager');\n const result = sm.__clearKeys(data);\n\n this.get('storables').forEach(module => {\n module.load(result);\n module.postLoad && module.postLoad(this);\n });\n\n return result;\n }\n\n /**\n * Returns cached load\n * @param {Boolean} force Force to reload\n * @param {Function} clb Callback function\n * @return {Object}\n * @private\n */\n getCacheLoad(force, clb) {\n if (this.cacheLoad && !force) return this.cacheLoad;\n const sm = this.get('StorageManager');\n const load = [];\n\n if (!sm) return {};\n\n this.get('storables').forEach(m => {\n let key = m.storageKey;\n key = isFunction(key) ? key() : key;\n const keys = isArray(key) ? key : [key];\n keys.forEach(k => load.push(k));\n });\n\n sm.load(load, res => {\n this.cacheLoad = res;\n clb && clb(res);\n setTimeout(() => this.trigger('storage:load', res));\n });\n }\n\n /**\n * Returns device model by name\n * @return {Device|null}\n * @private\n */\n getDeviceModel() {\n var name = this.get('device');\n return this.get('DeviceManager').get(name);\n }\n\n /**\n * Run default command if setted\n * @param {Object} [opts={}] Options\n * @private\n */\n runDefault(opts = {}) {\n var command = this.get('Commands').get(this.config.defaultCommand);\n if (!command || this.defaultRunning) return;\n command.stop(this, this, opts);\n command.run(this, this, opts);\n this.defaultRunning = 1;\n }\n\n /**\n * Stop default command\n * @param {Object} [opts={}] Options\n * @private\n */\n stopDefault(opts = {}) {\n const commands = this.get('Commands');\n const command = commands.get(this.config.defaultCommand);\n if (!command || !this.defaultRunning) return;\n command.stop(this, this, opts);\n this.defaultRunning = 0;\n }\n\n /**\n * Update canvas dimensions and refresh data useful for tools positioning\n * @private\n */\n refreshCanvas(opts = {}) {\n this.set('canvasOffset', null);\n this.set('canvasOffset', this.get('Canvas').getOffset());\n opts.tools && this.trigger('canvas:updateTools');\n }\n\n /**\n * Clear all selected stuf inside the window, sometimes is useful to call before\n * doing some dragging opearation\n * @param {Window} win If not passed the current one will be used\n * @private\n */\n clearSelection(win) {\n var w = win || window;\n w.getSelection().removeAllRanges();\n }\n\n /**\n * Get the current media text\n * @return {string}\n */\n getCurrentMedia() {\n const config = this.config;\n const device = this.getDeviceModel();\n const condition = config.mediaCondition;\n const preview = config.devicePreviewMode;\n const width = device && device.get('widthMedia');\n return device && width && !preview ? `(${condition}: ${width})` : '';\n }\n\n /**\n * Return the component wrapper\n * @return {Component}\n */\n getWrapper() {\n return this.get('DomComponents').getWrapper();\n }\n\n setCurrentFrame(frameView) {\n return this.set('currentFrame', frameView);\n }\n\n getCurrentFrame() {\n return this.get('currentFrame');\n }\n\n getCurrentFrameModel() {\n return (this.getCurrentFrame() || {}).model;\n }\n\n /**\n * Return the count of changes made to the content and not yet stored.\n * This count resets at any `store()`\n * @return {number}\n */\n getDirtyCount() {\n return this.get('changesCount');\n }\n\n getZoomDecimal() {\n return this.get('Canvas').getZoomDecimal();\n }\n\n getZoomMultiplier() {\n return this.get('Canvas').getZoomMultiplier();\n }\n\n setDragMode(value) {\n return this.set('dmode', value);\n }\n\n t(...args) {\n const i18n = this.get('I18n');\n return i18n?.t(...args);\n }\n\n /**\n * Returns true if the editor is in absolute mode\n * @returns {Boolean}\n */\n inAbsoluteMode() {\n return this.get('dmode') === 'absolute';\n }\n\n /**\n * Destroy editor\n */\n destroyAll() {\n const { config, view } = this;\n const editor = this.getEditor();\n const { editors = [] } = config.grapesjs || {};\n const shallow = this.get('shallow');\n shallow?.destroyAll();\n this.stopListening();\n this.stopDefault();\n this.get('modules')\n .slice()\n .reverse()\n .forEach(mod => mod.destroy());\n view && view.remove();\n this.clear({ silent: true });\n this.destroyed = 1;\n ['config', 'view', '_previousAttributes', '_events', '_listeners'].forEach(i => (this[i] = {}));\n editors.splice(editors.indexOf(editor), 1);\n hasWin() && $(config.el).empty().attr(this.attrsOrig);\n }\n\n getEditing() {\n const res = this.get('editing');\n return (res && res.model) || null;\n }\n\n setEditing(value) {\n this.set('editing', value);\n return this;\n }\n\n isEditing() {\n return !!this.get('editing');\n }\n\n log(msg, opts = {}) {\n const { ns, level = 'debug' } = opts;\n this.trigger('log', msg, opts);\n level && this.trigger(`log:${level}`, msg, opts);\n\n if (ns) {\n const logNs = `log-${ns}`;\n this.trigger(logNs, msg, opts);\n level && this.trigger(`${logNs}:${level}`, msg, opts);\n }\n }\n\n logInfo(msg, opts) {\n this.log(msg, { ...opts, level: 'info' });\n }\n\n logWarning(msg, opts) {\n this.log(msg, { ...opts, level: 'warning' });\n }\n\n logError(msg, opts) {\n this.log(msg, { ...opts, level: 'error' });\n }\n\n initBaseColorPicker(el, opts = {}) {\n const config = this.getConfig();\n const { colorPicker = {} } = config;\n const elToAppend = config.el;\n const ppfx = config.stylePrefix;\n\n return $(el).spectrum({\n containerClassName: `${ppfx}one-bg ${ppfx}two-color`,\n appendTo: elToAppend || 'body',\n maxSelectionSize: 8,\n showPalette: true,\n palette: [],\n showAlpha: true,\n chooseText: 'Ok',\n cancelText: '⨯',\n ...opts,\n ...colorPicker,\n });\n }\n\n /**\n * Execute actions without triggering the storage and undo manager.\n * @param {Function} clb\n * @private\n */\n skip(clb) {\n this.__skip = true;\n const um = this.get('UndoManager');\n um ? um.skip(clb) : clb();\n this.__skip = false;\n }\n\n /**\n * Set/get data from the HTMLElement\n * @param {HTMLElement} el\n * @param {string} name Data name\n * @param {any} value Date value\n * @return {any}\n * @private\n */\n data(el, name, value) {\n const varName = '_gjs-data';\n\n if (!el[varName]) {\n el[varName] = {};\n }\n\n if (isUndefined(value)) {\n return el[varName][name];\n } else {\n el[varName][name] = value;\n }\n }\n}\n","import { isObject, isString, each, isUndefined } from 'underscore';\n\nexport default ({ $ }) => {\n if ($ && $.prototype && $.prototype.constructor.name !== 'jQuery') {\n const fn = $.fn;\n\n // Additional helpers\n\n fn.hide = function() {\n return this.css('display', 'none');\n };\n\n fn.show = function() {\n return this.css('display', 'block');\n };\n\n fn.focus = function() {\n const el = this.get(0);\n el && el.focus();\n return this;\n };\n\n // For SVGs in IE\n // (fn.removeClass = function(c) {\n // if (!arguments.length) {\n // return this.attr('class', '');\n // }\n // const classes = isString(c) && c.match(/\\S+/g);\n // return classes\n // ? this.each(function(el) {\n // each(classes, function(c) {\n // if (el.classList) {\n // el.classList.remove(c);\n // } else {\n // const val = el.className;\n // const bval = el.className.baseVal;\n\n // if (!isUndefined(bval)) {\n // val.baseVal = bval.replace(c, '');\n // } else {\n // el.className = val.replace(c, '');\n // }\n // }\n // });\n // })\n // : this;\n // }),\n // (fn.remove = function() {\n // return this.each(node => {\n // return node.parentNode && node.parentNode.removeChild(node);\n // });\n // }),\n\n // For spectrum compatibility\n\n fn.bind = function(ev, h) {\n return this.on(ev, h);\n };\n\n fn.unbind = function(ev, h) {\n if (isObject(ev)) {\n for (let name in ev) {\n ev.hasOwnProperty(name) && this.off(name, ev[name]);\n }\n\n return this;\n } else {\n return this.off(ev, h);\n }\n };\n\n fn.click = function(h) {\n return h ? this.on('click', h) : this.trigger('click');\n };\n\n fn.change = function(h) {\n return h ? this.on('change', h) : this.trigger('change');\n };\n\n fn.keydown = function(h) {\n return h ? this.on('keydown', h) : this.trigger('keydown');\n };\n\n fn.delegate = function(selector, events, data, handler) {\n if (!handler) {\n handler = data;\n }\n\n return this.on(events, selector, function(e) {\n e.data = data;\n handler(e);\n });\n };\n\n fn.scrollLeft = function() {\n let el = this.get(0);\n el = el.nodeType == 9 ? el.defaultView : el;\n let win = el instanceof Window ? el : null;\n return win ? win.pageXOffset : el.scrollLeft || 0;\n };\n\n fn.scrollTop = function() {\n let el = this.get(0);\n el = el.nodeType == 9 ? el.defaultView : el;\n let win = el instanceof Window ? el : null;\n return win ? win.pageYOffset : el.scrollTop || 0;\n };\n\n const offset = $.prototype.offset;\n fn.offset = function(coords) {\n let top, left;\n\n if (coords) {\n top = coords.top;\n left = coords.left;\n }\n\n if (typeof top != 'undefined') {\n this.css('top', `${top}px`);\n }\n if (typeof left != 'undefined') {\n this.css('left', `${left}px`);\n }\n\n return offset.call(this);\n };\n\n $.map = function(items, clb) {\n const ar = [];\n\n for (var i = 0; i < items.length; i++) {\n ar.push(clb(items[i], i));\n }\n\n return ar;\n };\n\n const indexOf = Array.prototype.indexOf;\n\n $.inArray = function(val, arr, i) {\n return arr == null ? -1 : indexOf.call(arr, val, i);\n };\n\n $.Event = function(src, props) {\n if (!(this instanceof $.Event)) {\n return new $.Event(src, props);\n }\n\n this.type = src;\n this.isDefaultPrevented = () => false;\n };\n }\n};\n","import Backbone from 'backbone';\nimport { View } from 'common';\nimport { appendStyles } from 'utils/mixins';\n\nconst $ = Backbone.$;\n\nexport default class EditorView extends View {\n initialize() {\n const { model } = this;\n model.view = this;\n this.conf = model.config;\n this.pn = model.get('Panels');\n this.cv = model.get('Canvas');\n model.once('change:ready', () => {\n this.pn.active();\n this.pn.disableButtons();\n setTimeout(() => {\n model.trigger('load', model.get('Editor'));\n model.set('changesCount', 0);\n });\n });\n }\n\n render() {\n const { $el, conf, model } = this;\n const pfx = conf.stylePrefix;\n const contEl = $(conf.el || `body ${conf.container}`);\n appendStyles(conf.cssIcons, { unique: 1, prepand: 1 });\n $el.empty();\n\n if (conf.width) contEl.css('width', conf.width);\n if (conf.height) contEl.css('height', conf.height);\n\n $el.append(this.cv.render());\n $el.append(this.pn.render());\n\n // Load shallow editor\n const shallow = model.get('shallow');\n const shallowCanvasEl = shallow.get('Canvas').render();\n shallowCanvasEl.style.display = 'none';\n $el.append(shallowCanvasEl);\n\n $el.attr('class', `${pfx}editor ${pfx}one-bg ${pfx}two-color`);\n contEl.addClass(`${pfx}editor-cont`).empty().append($el);\n\n return this;\n }\n}\n","/**\n * Editor contains the top level API which you'll probably use to customize the editor or extend it with plugins.\n * You get the Editor instance on init method and you can pass options via its [Configuration Object](https://github.com/artf/grapesjs/blob/master/src/editor/config/config.js)\n *\n * ```js\n * const editor = grapesjs.init({\n * // options\n * });\n * ```\n *\n * ## Available Events\n *\n * You can make use of available events in this way\n * ```js\n * editor.on('EVENT-NAME', (some, argument) => {\n * // do something\n * })\n * ```\n *\n * * `update` - The structure of the template is updated (its HTML/CSS)\n * * `undo` - Undo executed\n * * `redo` - Redo executed\n * * `load` - Editor is loaded\n *\n * ### Components\n * Check the [Components](/api/components.html) module.\n * ### Keymaps\n * Check the [Keymaps](/api/keymaps.html) module.\n * ### Style Manager\n * Check the [Style Manager](/api/style_manager.html) module.\n * ### Storage\n * Check the [Storage](/api/storage_manager.html) module.\n * ### Canvas\n * Check the [Canvas](/api/canvas.html) module.\n * ### RTE\n * Check the [Rich Text Editor](/api/rich_text_editor.html) module.\n * ### Commands\n * Check the [Commands](/api/commands.html) module.\n * ### Selectors\n * Check the [Selectors](/api/selector_manager.html) module.\n * ### Blocks\n * Check the [Blocks](/api/block_manager.html) module.\n * ### Assets\n * Check the [Assets](/api/assets.html) module.\n * ### Modal\n * Check the [Modal](/api/modal_dialog.html) module.\n * ### Devices\n * Check the [Devices](/api/device_manager.html) module.\n * ### Parser\n * Check the [Parser](/api/parser.html) module.\n * ### Pages\n * Check the [Pages](/api/pages.html) module.\n *\n * ## Methods\n * @module Editor\n */\nimport defaults from './config/config';\nimport EditorModel from './model/Editor';\nimport EditorView from './view/EditorView';\nimport html from 'utils/html';\n\nexport default (config = {}, opts = {}) => {\n const { $ } = opts;\n let c = {\n ...defaults,\n ...config,\n };\n\n c.pStylePrefix = c.stylePrefix;\n let em = new EditorModel(c);\n let editorView;\n\n return {\n $,\n\n /**\n * @property {EditorModel}\n * @private\n */\n editor: em,\n\n modules: [],\n\n /**\n * Initialize editor model\n * @return {this}\n * @private\n */\n init(opts = {}) {\n em.init(this, { ...c, ...opts });\n\n this.modules = [\n 'I18n',\n 'Utils',\n 'Config',\n 'Commands',\n 'Keymaps',\n 'Modal',\n 'Panels',\n 'Canvas',\n 'Parser',\n 'CodeManager',\n 'UndoManager',\n 'RichTextEditor',\n ['Pages', 'PageManager'],\n 'DomComponents',\n ['Components', 'DomComponents'],\n 'LayerManager',\n ['Layers', 'LayerManager'],\n 'CssComposer',\n ['Css', 'CssComposer'],\n 'StorageManager',\n ['Storage', 'StorageManager'],\n 'AssetManager',\n ['Assets', 'AssetManager'],\n 'BlockManager',\n ['Blocks', 'BlockManager'],\n 'TraitManager',\n ['Traits', 'TraitManager'],\n 'SelectorManager',\n ['Selectors', 'SelectorManager'],\n 'StyleManager',\n ['Styles', 'StyleManager'],\n 'DeviceManager',\n ['Devices', 'DeviceManager'],\n ];\n\n this.modules.forEach(prop => {\n if (Array.isArray(prop)) {\n this[prop[0]] = em.get(prop[1]);\n } else {\n this[prop] = em.get(prop);\n }\n });\n\n // Do post render stuff after the iframe is loaded otherwise it'll\n // be empty during tests\n em.once('change:ready', () => {\n this.UndoManager.clear();\n em.get('modules').forEach(module => {\n module.postRender && module.postRender(editorView);\n });\n });\n\n return this;\n },\n\n /**\n * Returns configuration object\n * @param {string} [prop] Property name\n * @returns {any} Returns the configuration object or\n * the value of the specified property\n */\n getConfig(prop) {\n return em.getConfig(prop);\n },\n\n /**\n * Returns HTML built inside canvas\n * @param {Object} [opts={}] Options\n * @param {Component} [opts.component] Return the HTML of a specific Component\n * @param {Boolean} [opts.cleanId=false] Remove unnecessary IDs (eg. those created automatically)\n * @returns {string} HTML string\n */\n getHtml(opts) {\n return em.getHtml(opts);\n },\n\n /**\n * Returns CSS built inside canvas\n * @param {Object} [opts={}] Options\n * @param {Component} [opts.component] Return the CSS of a specific Component\n * @param {Boolean} [opts.json=false] Return an array of CssRules instead of the CSS string\n * @param {Boolean} [opts.avoidProtected=false] Don't include protected CSS\n * @param {Boolean} [opts.onlyMatched=false] Return only rules matched by the passed component.\n * @param {Boolean} [opts.keepUnusedStyles=false] Force keep all defined rules. Toggle on in case output looks different inside/outside of the editor.\n * @returns {String|Array} CSS string or array of CssRules\n */\n getCss(opts) {\n return em.getCss(opts);\n },\n\n /**\n * Returns JS of all components\n * @param {Object} [opts={}] Options\n * @param {Component} [opts.component] Get the JS of a specific component\n * @returns {String} JS string\n */\n getJs(opts) {\n return em.getJs(opts);\n },\n\n /**\n * Return the complete tree of components. Use `getWrapper` to include also the wrapper\n * @return {Components}\n */\n getComponents() {\n return em.get('DomComponents').getComponents();\n },\n\n /**\n * Return the wrapper and its all components\n * @return {Component}\n */\n getWrapper() {\n return em.get('DomComponents').getWrapper();\n },\n\n /**\n * Set components inside editor's canvas. This method overrides actual components\n * @param {Array