UNPKG

roosterjs

Version:

A simple facade for all roosterjs code

32 lines 1.77 kB
define(["require", "exports", "tslib", "roosterjs-content-model-core", "roosterjs-content-model-plugins"], function (require, exports, tslib_1, roosterjs_content_model_core_1, roosterjs_content_model_plugins_1) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createEditor = void 0; /** * 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