All files / roosterjs-content-model-core/lib/corePlugin createEditorCorePlugins.ts

100% Statements 11/11
100% Branches 0/0
100% Functions 1/1
100% Lines 11/11

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 331x 1x 1x 1x 1x 1x 1x 1x 1x               1x       104x                        
import { createCachePlugin } from './cache/CachePlugin';
import { createContextMenuPlugin } from './contextMenu/ContextMenuPlugin';
import { createCopyPastePlugin } from './copyPaste/CopyPastePlugin';
import { createDOMEventPlugin } from './domEvent/DOMEventPlugin';
import { createEntityPlugin } from './entity/EntityPlugin';
import { createFormatPlugin } from './format/FormatPlugin';
import { createLifecyclePlugin } from './lifecycle/LifecyclePlugin';
import { createSelectionPlugin } from './selection/SelectionPlugin';
import { createUndoPlugin } from './undo/UndoPlugin';
import type { EditorCorePlugins, EditorOptions } from 'roosterjs-content-model-types';
 
/**
 * @internal
 * Create core plugins for editor
 * @param options Options of editor
 */
export function createEditorCorePlugins(
    options: EditorOptions,
    contentDiv: HTMLDivElement
): EditorCorePlugins {
    return {
        cache: createCachePlugin(options, contentDiv),
        format: createFormatPlugin(options),
        copyPaste: createCopyPastePlugin(options),
        domEvent: createDOMEventPlugin(options, contentDiv),
        lifecycle: createLifecyclePlugin(options, contentDiv),
        entity: createEntityPlugin(),
        selection: createSelectionPlugin(options),
        contextMenu: createContextMenuPlugin(options),
        undo: createUndoPlugin(options),
    };
}