|
|
|
@ -131,148 +131,6 @@ export default (config = {}) => { |
|
|
|
*/ |
|
|
|
editor: em, |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {I18n} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
I18n: em.get('I18n'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {DomComponents} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
DomComponents: em.get('DomComponents'), |
|
|
|
Components: em.get('DomComponents'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {LayerManager} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
LayerManager: em.get('LayerManager'), |
|
|
|
Layers: em.get('LayerManager'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {CssComposer} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
CssComposer: em.get('CssComposer'), |
|
|
|
Css: em.get('CssComposer'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {StorageManager} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
StorageManager: em.get('StorageManager'), |
|
|
|
Storage: em.get('StorageManager'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {AssetManager} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
AssetManager: em.get('AssetManager'), |
|
|
|
Assets: em.get('AssetManager'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {BlockManager} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
BlockManager: em.get('BlockManager'), |
|
|
|
Blocks: em.get('BlockManager'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {TraitManager} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
TraitManager: em.get('TraitManager'), |
|
|
|
Traits: em.get('TraitManager'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {SelectorManager} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
SelectorManager: em.get('SelectorManager'), |
|
|
|
Selectors: em.get('SelectorManager'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {CodeManager} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
CodeManager: em.get('CodeManager'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {Commands} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
Commands: em.get('Commands'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {Keymaps} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
Keymaps: em.get('Keymaps'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {Modal} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
Modal: em.get('Modal'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {Panels} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
Panels: em.get('Panels'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {StyleManager} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
StyleManager: em.get('StyleManager'), |
|
|
|
Styles: em.get('StyleManager'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {Canvas} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
Canvas: em.get('Canvas'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {UndoManager} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
UndoManager: em.get('UndoManager'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {DeviceManager} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
DeviceManager: em.get('DeviceManager'), |
|
|
|
Devices: em.get('DeviceManager'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {RichTextEditor} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
RichTextEditor: em.get('RichTextEditor'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {Parser} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
Parser: em.get('Parser'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {Utils} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
Utils: em.get('Utils'), |
|
|
|
|
|
|
|
/** |
|
|
|
* @property {Utils} |
|
|
|
* @private |
|
|
|
*/ |
|
|
|
Config: em.get('Config'), |
|
|
|
|
|
|
|
/** |
|
|
|
* Initialize editor model |
|
|
|
* @return {this} |
|
|
|
@ -281,6 +139,47 @@ export default (config = {}) => { |
|
|
|
init(opts = {}) { |
|
|
|
em.init(this, { ...c, ...opts }); |
|
|
|
|
|
|
|
[ |
|
|
|
'I18n', |
|
|
|
'Utils', |
|
|
|
'Config', |
|
|
|
'Commands', |
|
|
|
'Keymaps', |
|
|
|
'Modal', |
|
|
|
'Panels', |
|
|
|
'Canvas', |
|
|
|
'Parser', |
|
|
|
'CodeManager', |
|
|
|
'UndoManager', |
|
|
|
'RichTextEditor', |
|
|
|
'DomComponents', |
|
|
|
['Components', 'DomComponents'], |
|
|
|
'LayerManager', |
|
|
|
['Layers', 'LayerManager'], |
|
|
|
'CssComposer', |
|
|
|
['Css', 'CssComposer'], |
|
|
|
'StorageManager', |
|
|
|
['Storage', 'StorageManager'], |
|
|
|
'AssetManager', |
|
|
|
['Assets', 'AssetManager'], |
|
|
|
'BlockManager', |
|
|
|
['Blocks', 'BlockManager'], |
|
|
|
'TraitManager', |
|
|
|
['Traits', 'TraitManager'], |
|
|
|
'SelectorManager', |
|
|
|
['Selectors', 'SelectorManager'], |
|
|
|
'StyleManager', |
|
|
|
['Styles', 'StyleManager'], |
|
|
|
'DeviceManager', |
|
|
|
['Devices', 'DeviceManager'] |
|
|
|
].forEach(prop => { |
|
|
|
if (Array.isArray(prop)) { |
|
|
|
this[prop[0]] = em.get(prop[1]); |
|
|
|
} else { |
|
|
|
this[prop] = em.get(prop); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
// Do post render stuff after the iframe is loaded otherwise it'll
|
|
|
|
// be empty during tests
|
|
|
|
em.on('loaded', () => { |
|
|
|
|