UNPKG

roosterjs

Version:

A simple facade for all roosterjs code

33 lines 1.63 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createEditor = void 0; var tslib_1 = require("tslib"); var roosterjs_content_model_core_1 = require("roosterjs-content-model-core"); var roosterjs_content_model_plugins_1 = require("roosterjs-content-model-plugins"); /** * Create a new Editor instance using the given options * @param contentDiv The html div element needed for creating the editor * @param additionalPlugins The additional user defined plugins. Currently the default plugins that are already included are * PastePlugin, EditPlugin, user don't need to add those. * @param initialModel The initial content model to show in editor. It can't be removed by undo, user need to manually remove it if needed. * @returns The Editor instance */ function createEditor(contentDiv, additionalPlugins, initialModel) { var plugins = (0, tslib_1.__spreadArray)([ new roosterjs_content_model_plugins_1.PastePlugin(), new roosterjs_content_model_plugins_1.EditPlugin(), new roosterjs_content_model_plugins_1.ShortcutPlugin() ], (0, tslib_1.__read)((additionalPlugins !== null && additionalPlugins !== void 0 ? additionalPlugins : [])), false); var options = { plugins: plugins, initialModel: initialModel, defaultSegmentFormat: { fontFamily: 'Calibri,Arial,Helvetica,sans-serif', fontSize: '11pt', textColor: '#000000', }, }; return new roosterjs_content_model_core_1.Editor(contentDiv, options); } exports.createEditor = createEditor; //# sourceMappingURL=createEditor.js.map