|
|
|
@ -1,13 +1,15 @@ |
|
|
|
import $ from 'cash-dom'; |
|
|
|
import Editor from './editor'; |
|
|
|
import { isElement, isFunction } from 'underscore'; |
|
|
|
import polyfills from 'utils/polyfills'; |
|
|
|
import PluginManager from './plugin_manager'; |
|
|
|
import { hasWin } from 'utils/mixins'; |
|
|
|
|
|
|
|
polyfills(); |
|
|
|
|
|
|
|
const plugins = new PluginManager(); |
|
|
|
const editors = []; |
|
|
|
const cash = hasWin() ? require('cash-dom') : null; |
|
|
|
const $ = (cash && cash.default) || cash; |
|
|
|
const defaultConfig = { |
|
|
|
// If true renders editor on init
|
|
|
|
autorender: 1, |
|
|
|
@ -27,7 +29,7 @@ export default { |
|
|
|
plugins, |
|
|
|
|
|
|
|
// Will be replaced on build
|
|
|
|
version: '<# VERSION #>', |
|
|
|
version: __GJS_VERSION__, |
|
|
|
|
|
|
|
/** |
|
|
|
* Initialize the editor with passed options |
|
|
|
@ -52,7 +54,7 @@ export default { |
|
|
|
config = { ...defaultConfig, ...config, grapesjs: this }; |
|
|
|
config.el = |
|
|
|
!headless && (isElement(els) ? els : document.querySelector(els)); |
|
|
|
const editor = new Editor(config).init(); |
|
|
|
const editor = new Editor(config, { $ }).init(); |
|
|
|
const em = editor.getModel(); |
|
|
|
|
|
|
|
// Load plugins
|
|
|
|
|