roosterjs
Version:
A simple facade for all roosterjs code
29 lines • 1.33 kB
JavaScript
import { __read, __spreadArray } from "tslib";
import { Editor } from 'roosterjs-content-model-core';
import { EditPlugin, PastePlugin, ShortcutPlugin } from '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
*/
export function createEditor(contentDiv, additionalPlugins, initialModel) {
var plugins = __spreadArray([
new PastePlugin(),
new EditPlugin(),
new ShortcutPlugin()
], __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 Editor(contentDiv, options);
}
//# sourceMappingURL=createEditor.js.map