@silexlabs/grapesjs-symbols
Version:
Symbols for GrapesJS
27 lines • 974 B
JavaScript
import Storage from './storage';
import { Symbols } from './model/Symbols';
import SymbolsView from './view/SymbolsView';
import initCommands from './SymbolsCommands';
import initTraits from './view/traits';
export default (editor, opts = {}) => {
const options = { ...{
appendTo: '#symbols',
emptyText: 'No symbol yet.',
primaryColor: '#b9a5a6',
secondaryColor: '#463a3c',
highlightColor: '#d97aa6',
}, ...opts };
// store the symbols data with the site
Storage(editor);
// keep track of symbols and changes
editor.Symbols = new Symbols([], { options, editor });
editor.on('load', () => {
// Display symbols
new SymbolsView({ ...options, editor, model: editor.Symbols, });
// Commands to create/delete symbols
initCommands(editor);
// Add traits like a plugin
initTraits(editor, options);
});
};
//# sourceMappingURL=index.js.map