roosterjs-content-model-types 0.24.0 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/context/TextMutationObserver.d.ts +17 -0
- package/lib/context/TextMutationObserver.js +3 -0
- package/lib/context/TextMutationObserver.js.map +1 -0
- package/lib/editor/IStandaloneEditor.d.ts +16 -34
- package/lib/editor/IStandaloneEditor.js.map +1 -1
- package/lib/editor/StandaloneEditorCore.d.ts +8 -8
- package/lib/editor/StandaloneEditorCore.js.map +1 -1
- package/lib/editor/StandaloneEditorCorePlugins.d.ts +5 -0
- package/lib/editor/StandaloneEditorCorePlugins.js.map +1 -1
- package/lib/editor/StandaloneEditorOptions.d.ts +0 -7
- package/lib/editor/StandaloneEditorOptions.js.map +1 -1
- package/lib/event/ZoomChangedEvent.d.ts +0 -4
- package/lib/event/ZoomChangedEvent.js.map +1 -1
- package/lib/format/formatParts/MarginFormat.d.ts +0 -8
- package/lib/format/formatParts/MarginFormat.js.map +1 -1
- package/lib/index.d.ts +3 -0
- package/lib/index.js.map +1 -1
- package/lib/parameter/ContentModelFormatState.d.ts +0 -4
- package/lib/parameter/ContentModelFormatState.js.map +1 -1
- package/lib/parameter/DOMHelper.d.ts +28 -0
- package/lib/parameter/DOMHelper.js +3 -0
- package/lib/parameter/DOMHelper.js.map +1 -0
- package/lib/parameter/Snapshot.d.ts +5 -0
- package/lib/parameter/Snapshot.js.map +1 -1
- package/lib/pluginState/ContentModelCachePluginState.d.ts +5 -0
- package/lib/pluginState/ContentModelCachePluginState.js.map +1 -1
- package/lib/pluginState/ContextMenuPluginState.d.ts +10 -0
- package/lib/pluginState/ContextMenuPluginState.js +3 -0
- package/lib/pluginState/ContextMenuPluginState.js.map +1 -0
- package/lib/selection/DOMSelection.d.ts +5 -0
- package/lib/selection/DOMSelection.js.map +1 -1
- package/lib-amd/context/TextMutationObserver.d.ts +17 -0
- package/lib-amd/context/TextMutationObserver.js +5 -0
- package/lib-amd/context/TextMutationObserver.js.map +1 -0
- package/lib-amd/editor/IStandaloneEditor.d.ts +16 -34
- package/lib-amd/editor/IStandaloneEditor.js.map +1 -1
- package/lib-amd/editor/StandaloneEditorCore.d.ts +8 -8
- package/lib-amd/editor/StandaloneEditorCore.js.map +1 -1
- package/lib-amd/editor/StandaloneEditorCorePlugins.d.ts +5 -0
- package/lib-amd/editor/StandaloneEditorCorePlugins.js.map +1 -1
- package/lib-amd/editor/StandaloneEditorOptions.d.ts +0 -7
- package/lib-amd/editor/StandaloneEditorOptions.js.map +1 -1
- package/lib-amd/event/ZoomChangedEvent.d.ts +0 -4
- package/lib-amd/event/ZoomChangedEvent.js.map +1 -1
- package/lib-amd/format/formatParts/MarginFormat.d.ts +0 -8
- package/lib-amd/format/formatParts/MarginFormat.js.map +1 -1
- package/lib-amd/index.d.ts +3 -0
- package/lib-amd/index.js.map +1 -1
- package/lib-amd/parameter/ContentModelFormatState.d.ts +0 -4
- package/lib-amd/parameter/ContentModelFormatState.js.map +1 -1
- package/lib-amd/parameter/DOMHelper.d.ts +28 -0
- package/lib-amd/parameter/DOMHelper.js +5 -0
- package/lib-amd/parameter/DOMHelper.js.map +1 -0
- package/lib-amd/parameter/Snapshot.d.ts +5 -0
- package/lib-amd/parameter/Snapshot.js.map +1 -1
- package/lib-amd/pluginState/ContentModelCachePluginState.d.ts +5 -0
- package/lib-amd/pluginState/ContentModelCachePluginState.js.map +1 -1
- package/lib-amd/pluginState/ContextMenuPluginState.d.ts +10 -0
- package/lib-amd/pluginState/ContextMenuPluginState.js +5 -0
- package/lib-amd/pluginState/ContextMenuPluginState.js.map +1 -0
- package/lib-amd/selection/DOMSelection.d.ts +5 -0
- package/lib-amd/selection/DOMSelection.js.map +1 -1
- package/lib-mjs/context/TextMutationObserver.d.ts +17 -0
- package/lib-mjs/context/TextMutationObserver.js +2 -0
- package/lib-mjs/context/TextMutationObserver.js.map +1 -0
- package/lib-mjs/editor/IStandaloneEditor.d.ts +16 -34
- package/lib-mjs/editor/IStandaloneEditor.js.map +1 -1
- package/lib-mjs/editor/StandaloneEditorCore.d.ts +8 -8
- package/lib-mjs/editor/StandaloneEditorCore.js.map +1 -1
- package/lib-mjs/editor/StandaloneEditorCorePlugins.d.ts +5 -0
- package/lib-mjs/editor/StandaloneEditorCorePlugins.js.map +1 -1
- package/lib-mjs/editor/StandaloneEditorOptions.d.ts +0 -7
- package/lib-mjs/editor/StandaloneEditorOptions.js.map +1 -1
- package/lib-mjs/event/ZoomChangedEvent.d.ts +0 -4
- package/lib-mjs/event/ZoomChangedEvent.js.map +1 -1
- package/lib-mjs/format/formatParts/MarginFormat.d.ts +0 -8
- package/lib-mjs/format/formatParts/MarginFormat.js.map +1 -1
- package/lib-mjs/index.d.ts +3 -0
- package/lib-mjs/index.js.map +1 -1
- package/lib-mjs/parameter/ContentModelFormatState.d.ts +0 -4
- package/lib-mjs/parameter/ContentModelFormatState.js.map +1 -1
- package/lib-mjs/parameter/DOMHelper.d.ts +28 -0
- package/lib-mjs/parameter/DOMHelper.js +2 -0
- package/lib-mjs/parameter/DOMHelper.js.map +1 -0
- package/lib-mjs/parameter/Snapshot.d.ts +5 -0
- package/lib-mjs/parameter/Snapshot.js.map +1 -1
- package/lib-mjs/pluginState/ContentModelCachePluginState.d.ts +5 -0
- package/lib-mjs/pluginState/ContentModelCachePluginState.js.map +1 -1
- package/lib-mjs/pluginState/ContextMenuPluginState.d.ts +10 -0
- package/lib-mjs/pluginState/ContextMenuPluginState.js +2 -0
- package/lib-mjs/pluginState/ContextMenuPluginState.js.map +1 -0
- package/lib-mjs/selection/DOMSelection.d.ts +5 -0
- package/lib-mjs/selection/DOMSelection.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A wrapper of MutationObserver to observe text change from editor
|
|
3
|
+
*/
|
|
4
|
+
export interface TextMutationObserver {
|
|
5
|
+
/**
|
|
6
|
+
* Start observing mutations from editor
|
|
7
|
+
*/
|
|
8
|
+
startObserving(): void;
|
|
9
|
+
/**
|
|
10
|
+
* Stop observing mutations from editor
|
|
11
|
+
*/
|
|
12
|
+
stopObserving(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Flush all pending mutations that have not be handled in order to ignore them
|
|
15
|
+
*/
|
|
16
|
+
flushMutations(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TextMutationObserver.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/context/TextMutationObserver.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A wrapper of MutationObserver to observe text change from editor\n */\nexport interface TextMutationObserver {\n /**\n * Start observing mutations from editor\n */\n startObserving(): void;\n\n /**\n * Stop observing mutations from editor\n */\n stopObserving(): void;\n\n /**\n * Flush all pending mutations that have not be handled in order to ignore them\n */\n flushMutations(): void;\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DOMHelper } from '../parameter/DOMHelper';
|
|
1
2
|
import type { PluginEventData, PluginEventFromType } from '../event/PluginEventData';
|
|
2
3
|
import type { PluginEventType } from '../event/PluginEventType';
|
|
3
4
|
import type { PasteType } from '../enum/PasteType';
|
|
@@ -8,10 +9,7 @@ import type { Snapshot } from '../parameter/Snapshot';
|
|
|
8
9
|
import type { ContentModelDocument } from '../group/ContentModelDocument';
|
|
9
10
|
import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';
|
|
10
11
|
import type { DOMSelection } from '../selection/DOMSelection';
|
|
11
|
-
import type { DomToModelOption } from '../context/DomToModelOption';
|
|
12
12
|
import type { EditorEnvironment } from '../parameter/EditorEnvironment';
|
|
13
|
-
import type { ModelToDomOption } from '../context/ModelToDomOption';
|
|
14
|
-
import type { OnNodeCreated } from '../context/ModelToDomSettings';
|
|
15
13
|
import type { ContentModelFormatter, FormatWithContentModelOptions } from '../parameter/FormatWithContentModelOptions';
|
|
16
14
|
import type { DarkColorHandler } from '../context/DarkColorHandler';
|
|
17
15
|
import type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';
|
|
@@ -22,19 +20,17 @@ import type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';
|
|
|
22
20
|
export interface IStandaloneEditor {
|
|
23
21
|
/**
|
|
24
22
|
* Create Content Model from DOM tree in this editor
|
|
25
|
-
* @param
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*/
|
|
37
|
-
setContentModel(model: ContentModelDocument, option?: ModelToDomOption, onNodeCreated?: OnNodeCreated): DOMSelection | null;
|
|
23
|
+
* @param mode What kind of Content Model we want. Currently we support the following values:
|
|
24
|
+
* - connected: Returns a connect Content Model object. "Connected" means if there is any entity inside editor, the returned Content Model will
|
|
25
|
+
* contain the same wrapper element for entity. This option should only be used in some special cases. In most cases we should use "disconnected"
|
|
26
|
+
* to get a fully disconnected Content Model so that any change to the model will not impact editor content.
|
|
27
|
+
* - disconnected: Returns a disconnected clone of Content Model from editor which you can do any change on it and it won't impact the editor content.
|
|
28
|
+
* If there is any entity in editor, the returned object will contain cloned copy of entity wrapper element.
|
|
29
|
+
* If editor is in dark mode, the cloned entity will be converted back to light mode.
|
|
30
|
+
* - reduced: Returns a reduced Content Model that only contains the model of current selection. If there is already a up-to-date cached model, use it
|
|
31
|
+
* instead to improve performance. This is mostly used for retrieve current format state.
|
|
32
|
+
*/
|
|
33
|
+
getContentModelCopy(mode: 'connected' | 'disconnected' | 'reduced'): ContentModelDocument;
|
|
38
34
|
/**
|
|
39
35
|
* Get current running environment, such as if editor is running on Mac
|
|
40
36
|
*/
|
|
@@ -68,6 +64,10 @@ export interface IStandaloneEditor {
|
|
|
68
64
|
* @returns True if editor is disposed, otherwise false
|
|
69
65
|
*/
|
|
70
66
|
isDisposed(): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Get a DOM Helper object to help access DOM tree in editor
|
|
69
|
+
*/
|
|
70
|
+
getDOMHelper(): DOMHelper;
|
|
71
71
|
/**
|
|
72
72
|
* Get document which contains this editor
|
|
73
73
|
* @returns The HTML document which contains this editor
|
|
@@ -101,19 +101,6 @@ export interface IStandaloneEditor {
|
|
|
101
101
|
* @param isDarkMode The next status of dark mode. True if the editor should be in dark mode, false if not.
|
|
102
102
|
*/
|
|
103
103
|
setDarkModeState(isDarkMode?: boolean): void;
|
|
104
|
-
/**
|
|
105
|
-
* Get current zoom scale, default value is 1
|
|
106
|
-
* When editor is put under a zoomed container, need to pass the zoom scale number using EditorOptions.zoomScale
|
|
107
|
-
* to let editor behave correctly especially for those mouse drag/drop behaviors
|
|
108
|
-
* @returns current zoom scale number
|
|
109
|
-
*/
|
|
110
|
-
getZoomScale(): number;
|
|
111
|
-
/**
|
|
112
|
-
* Set current zoom scale, default value is 1
|
|
113
|
-
* When editor is put under a zoomed container, need to pass the zoom scale number using EditorOptions.zoomScale
|
|
114
|
-
* to let editor behave correctly especially for those mouse drag/drop behaviors
|
|
115
|
-
*/
|
|
116
|
-
setZoomScale(scale: number): void;
|
|
117
104
|
/**
|
|
118
105
|
* Add a single undo snapshot to undo stack
|
|
119
106
|
*/
|
|
@@ -150,11 +137,6 @@ export interface IStandaloneEditor {
|
|
|
150
137
|
* Leave "Shadow Edit" mode, all changes made during shadow edit will be discarded
|
|
151
138
|
*/
|
|
152
139
|
stopShadowEdit(): void;
|
|
153
|
-
/**
|
|
154
|
-
* Check if the given DOM node is in editor
|
|
155
|
-
* @param node The node to check
|
|
156
|
-
*/
|
|
157
|
-
isNodeInEditor(node: Node): boolean;
|
|
158
140
|
/**
|
|
159
141
|
* Paste into editor using a clipboardData object
|
|
160
142
|
* @param clipboardData Clipboard data retrieved from clipboard
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IStandaloneEditor.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/editor/IStandaloneEditor.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginEventData, PluginEventFromType } from '../event/PluginEventData';\nimport type { PluginEventType } from '../event/PluginEventType';\nimport type { PasteType } from '../enum/PasteType';\nimport type { ClipboardData } from '../parameter/ClipboardData';\nimport type { DOMEventRecord } from '../parameter/DOMEventRecord';\nimport type { SnapshotsManager } from '../parameter/SnapshotsManager';\nimport type { Snapshot } from '../parameter/Snapshot';\nimport type { ContentModelDocument } from '../group/ContentModelDocument';\nimport type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';\nimport type { DOMSelection } from '../selection/DOMSelection';\nimport type {
|
|
1
|
+
{"version":3,"file":"IStandaloneEditor.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/editor/IStandaloneEditor.ts"],"names":[],"mappings":"","sourcesContent":["import type { DOMHelper } from '../parameter/DOMHelper';\nimport type { PluginEventData, PluginEventFromType } from '../event/PluginEventData';\nimport type { PluginEventType } from '../event/PluginEventType';\nimport type { PasteType } from '../enum/PasteType';\nimport type { ClipboardData } from '../parameter/ClipboardData';\nimport type { DOMEventRecord } from '../parameter/DOMEventRecord';\nimport type { SnapshotsManager } from '../parameter/SnapshotsManager';\nimport type { Snapshot } from '../parameter/Snapshot';\nimport type { ContentModelDocument } from '../group/ContentModelDocument';\nimport type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';\nimport type { DOMSelection } from '../selection/DOMSelection';\nimport type { EditorEnvironment } from '../parameter/EditorEnvironment';\nimport type {\n ContentModelFormatter,\n FormatWithContentModelOptions,\n} from '../parameter/FormatWithContentModelOptions';\nimport type { DarkColorHandler } from '../context/DarkColorHandler';\nimport type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';\n\n/**\n * An interface of standalone Content Model editor.\n * (This interface is still under development, and may still be changed in the future with some breaking changes)\n */\nexport interface IStandaloneEditor {\n /**\n * Create Content Model from DOM tree in this editor\n * @param mode What kind of Content Model we want. Currently we support the following values:\n * - connected: Returns a connect Content Model object. \"Connected\" means if there is any entity inside editor, the returned Content Model will\n * contain the same wrapper element for entity. This option should only be used in some special cases. In most cases we should use \"disconnected\"\n * to get a fully disconnected Content Model so that any change to the model will not impact editor content.\n * - disconnected: Returns a disconnected clone of Content Model from editor which you can do any change on it and it won't impact the editor content.\n * If there is any entity in editor, the returned object will contain cloned copy of entity wrapper element.\n * If editor is in dark mode, the cloned entity will be converted back to light mode.\n * - reduced: Returns a reduced Content Model that only contains the model of current selection. If there is already a up-to-date cached model, use it\n * instead to improve performance. This is mostly used for retrieve current format state.\n */\n getContentModelCopy(mode: 'connected' | 'disconnected' | 'reduced'): ContentModelDocument;\n\n /**\n * Get current running environment, such as if editor is running on Mac\n */\n getEnvironment(): EditorEnvironment;\n\n /**\n * Get current DOM selection.\n * This is the replacement of IEditor.getSelectionRangeEx.\n */\n getDOMSelection(): DOMSelection | null;\n\n /**\n * Set DOMSelection into editor content.\n * This is the replacement of IEditor.select.\n * @param selection The selection to set\n */\n setDOMSelection(selection: DOMSelection | null): void;\n\n /**\n * The general API to do format change with Content Model\n * It will grab a Content Model for current editor content, and invoke a callback function\n * to do format change. Then according to the return value, write back the modified content model into editor.\n * If there is cached model, it will be used and updated.\n * @param formatter Formatter function, see ContentModelFormatter\n * @param options More options, see FormatWithContentModelOptions\n */\n formatContentModel(\n formatter: ContentModelFormatter,\n options?: FormatWithContentModelOptions\n ): void;\n\n /**\n * Get pending format of editor if any, or return null\n */\n getPendingFormat(): ContentModelSegmentFormat | null;\n\n /**\n * Get whether this editor is disposed\n * @returns True if editor is disposed, otherwise false\n */\n isDisposed(): boolean;\n\n /**\n * Get a DOM Helper object to help access DOM tree in editor\n */\n getDOMHelper(): DOMHelper;\n\n /**\n * Get document which contains this editor\n * @returns The HTML document which contains this editor\n */\n getDocument(): Document;\n\n /**\n * Focus to this editor, the selection was restored to where it was before, no unexpected scroll.\n */\n focus(): void;\n\n /**\n * Trigger an event to be dispatched to all plugins\n * @param eventType Type of the event\n * @param data data of the event with given type, this is the rest part of PluginEvent with the given type\n * @param broadcast indicates if the event needs to be dispatched to all plugins\n * True means to all, false means to allow exclusive handling from one plugin unless no one wants that\n * @returns the event object which is really passed into plugins. Some plugin may modify the event object so\n * the result of this function provides a chance to read the modified result\n */\n triggerEvent<T extends PluginEventType>(\n eventType: T,\n data: PluginEventData<T>,\n broadcast?: boolean\n ): PluginEventFromType<T>;\n\n /**\n * Get undo snapshots manager\n */\n getSnapshotsManager(): SnapshotsManager;\n\n /**\n * Check if the editor is in dark mode\n * @returns True if the editor is in dark mode, otherwise false\n */\n isDarkMode(): boolean;\n\n /**\n * Set the dark mode state and transforms the content to match the new state.\n * @param isDarkMode The next status of dark mode. True if the editor should be in dark mode, false if not.\n */\n setDarkModeState(isDarkMode?: boolean): void;\n\n /**\n * Add a single undo snapshot to undo stack\n */\n takeSnapshot(): Snapshot | null;\n\n /**\n * Restore an undo snapshot into editor\n * @param snapshot The snapshot to restore\n */\n restoreSnapshot(snapshot: Snapshot): void;\n\n /**\n * Check if editor is in IME input sequence\n * @returns True if editor is in IME input sequence, otherwise false\n */\n isInIME(): boolean;\n\n /**\n * Attach a DOM event to the editor content DIV\n * @param eventMap A map from event name to its handler\n */\n attachDomEvent(eventMap: Record<string, DOMEventRecord>): () => void;\n\n /**\n * Check if editor is in Shadow Edit mode\n */\n isInShadowEdit(): boolean;\n\n /**\n * Make the editor in \"Shadow Edit\" mode.\n * In Shadow Edit mode, all format change will finally be ignored.\n * This can be used for building a live preview feature for format button, to allow user\n * see format result without really apply it.\n * This function can be called repeated. If editor is already in shadow edit mode, we can still\n * use this function to do more shadow edit operation.\n */\n startShadowEdit(): void;\n\n /**\n * Leave \"Shadow Edit\" mode, all changes made during shadow edit will be discarded\n */\n stopShadowEdit(): void;\n\n /**\n * Paste into editor using a clipboardData object\n * @param clipboardData Clipboard data retrieved from clipboard\n * @param pasteType Type of paste\n */\n pasteFromClipboard(clipboardData: ClipboardData, pasteType?: PasteType): void;\n\n /**\n * Get a darkColorHandler object for this editor.\n */\n getColorManager(): DarkColorHandler;\n\n /**\n * Dispose this editor, dispose all plugins and custom data\n */\n dispose(): void;\n\n /**\n * Check if focus is in editor now\n * @returns true if focus is in editor, otherwise false\n */\n hasFocus(): boolean;\n\n /**\n * Get a function to convert HTML string to trusted HTML string.\n * By default it will just return the input HTML directly. To override this behavior,\n * pass your own trusted HTML handler to EditorOptions.trustedHTMLHandler\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types\n */\n getTrustedHTMLHandler(): TrustedHTMLHandler;\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DOMHelper } from '../parameter/DOMHelper';
|
|
1
2
|
import type { PluginEvent } from '../event/PluginEvent';
|
|
2
3
|
import type { PluginState } from '../pluginState/PluginState';
|
|
3
4
|
import type { EditorPlugin } from './EditorPlugin';
|
|
@@ -21,8 +22,9 @@ import type { ContentModelFormatter, FormatWithContentModelOptions } from '../pa
|
|
|
21
22
|
/**
|
|
22
23
|
* Create a EditorContext object used by ContentModel API
|
|
23
24
|
* @param core The StandaloneEditorCore object
|
|
25
|
+
* @param saveIndex True to allow saving index info into node using domIndexer, otherwise false
|
|
24
26
|
*/
|
|
25
|
-
export declare type CreateEditorContext = (core: StandaloneEditorCore) => EditorContext;
|
|
27
|
+
export declare type CreateEditorContext = (core: StandaloneEditorCore, saveIndex: boolean) => EditorContext;
|
|
26
28
|
/**
|
|
27
29
|
* Create Content Model from DOM tree in this editor
|
|
28
30
|
* @param core The StandaloneEditorCore object
|
|
@@ -125,6 +127,7 @@ export interface StandaloneCoreApiMap {
|
|
|
125
127
|
/**
|
|
126
128
|
* Create a EditorContext object used by ContentModel API
|
|
127
129
|
* @param core The StandaloneEditorCore object
|
|
130
|
+
* @param saveIndex True to allow saving index info into node using domIndexer, otherwise false
|
|
128
131
|
*/
|
|
129
132
|
createEditorContext: CreateEditorContext;
|
|
130
133
|
/**
|
|
@@ -263,19 +266,16 @@ export interface StandaloneEditorCore extends PluginState {
|
|
|
263
266
|
* To override, pass your own trusted HTML handler to EditorOptions.trustedHTMLHandler
|
|
264
267
|
*/
|
|
265
268
|
readonly trustedHTMLHandler: TrustedHTMLHandler;
|
|
269
|
+
/**
|
|
270
|
+
* A helper class to provide DOM access APIs
|
|
271
|
+
*/
|
|
272
|
+
readonly domHelper: DOMHelper;
|
|
266
273
|
/**
|
|
267
274
|
* A callback to be invoked when any exception is thrown during disposing editor
|
|
268
275
|
* @param plugin The plugin that causes exception
|
|
269
276
|
* @param error The error object we got
|
|
270
277
|
*/
|
|
271
278
|
readonly disposeErrorHandler?: (plugin: EditorPlugin, error: Error) => void;
|
|
272
|
-
/**
|
|
273
|
-
* @deprecated Will be removed soon.
|
|
274
|
-
* Current zoom scale, default value is 1
|
|
275
|
-
* When editor is put under a zoomed container, need to pass the zoom scale number using this property
|
|
276
|
-
* to let editor behave correctly especially for those mouse drag/drop behaviors
|
|
277
|
-
*/
|
|
278
|
-
zoomScale: number;
|
|
279
279
|
}
|
|
280
280
|
/**
|
|
281
281
|
* Default DOM and Content Model conversion settings for an editor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandaloneEditorCore.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/editor/StandaloneEditorCore.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginEvent } from '../event/PluginEvent';\nimport type { PluginState } from '../pluginState/PluginState';\nimport type { EditorPlugin } from './EditorPlugin';\nimport type { ClipboardData } from '../parameter/ClipboardData';\nimport type { PasteType } from '../enum/PasteType';\nimport type { DOMEventRecord } from '../parameter/DOMEventRecord';\nimport type { Snapshot } from '../parameter/Snapshot';\nimport type { EntityState } from '../parameter/FormatWithContentModelContext';\nimport type { DarkColorHandler } from '../context/DarkColorHandler';\nimport type { ContentModelDocument } from '../group/ContentModelDocument';\nimport type { DOMSelection } from '../selection/DOMSelection';\nimport type { DomToModelOption } from '../context/DomToModelOption';\nimport type { DomToModelSettings } from '../context/DomToModelSettings';\nimport type { EditorContext } from '../context/EditorContext';\nimport type { EditorEnvironment } from '../parameter/EditorEnvironment';\nimport type { ModelToDomOption } from '../context/ModelToDomOption';\nimport type { ModelToDomSettings, OnNodeCreated } from '../context/ModelToDomSettings';\nimport type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';\nimport type { Rect } from '../parameter/Rect';\nimport type {\n ContentModelFormatter,\n FormatWithContentModelOptions,\n} from '../parameter/FormatWithContentModelOptions';\n\n/**\n * Create a EditorContext object used by ContentModel API\n * @param core The StandaloneEditorCore object\n */\nexport type CreateEditorContext = (core: StandaloneEditorCore) => EditorContext;\n\n/**\n * Create Content Model from DOM tree in this editor\n * @param core The StandaloneEditorCore object\n * @param option The option to customize the behavior of DOM to Content Model conversion\n * @param selectionOverride When passed, use this selection range instead of current selection in editor\n */\nexport type CreateContentModel = (\n core: StandaloneEditorCore,\n option?: DomToModelOption,\n selectionOverride?: DOMSelection\n) => ContentModelDocument;\n\n/**\n * Get current DOM selection from editor\n * @param core The StandaloneEditorCore object\n */\nexport type GetDOMSelection = (core: StandaloneEditorCore) => DOMSelection | null;\n\n/**\n * Set content with content model. This is the replacement of core API getSelectionRangeEx\n * @param core The StandaloneEditorCore object\n * @param model The content model to set\n * @param option Additional options to customize the behavior of Content Model to DOM conversion\n * @param onNodeCreated An optional callback that will be called when a DOM node is created\n */\nexport type SetContentModel = (\n core: StandaloneEditorCore,\n model: ContentModelDocument,\n option?: ModelToDomOption,\n onNodeCreated?: OnNodeCreated\n) => DOMSelection | null;\n\n/**\n * Set current DOM selection from editor. This is the replacement of core API select\n * @param core The StandaloneEditorCore object\n * @param selection The selection to set\n * @param skipSelectionChangedEvent @param Pass true to skip triggering a SelectionChangedEvent\n */\nexport type SetDOMSelection = (\n core: StandaloneEditorCore,\n selection: DOMSelection | null,\n skipSelectionChangedEvent?: boolean\n) => void;\n\n/**\n * The general API to do format change with Content Model\n * It will grab a Content Model for current editor content, and invoke a callback function\n * to do format change. Then according to the return value, write back the modified content model into editor.\n * If there is cached model, it will be used and updated.\n * @param core The StandaloneEditorCore object\n * @param formatter Formatter function, see ContentModelFormatter\n * @param options More options, see FormatWithContentModelOptions\n */\nexport type FormatContentModel = (\n core: StandaloneEditorCore,\n formatter: ContentModelFormatter,\n options?: FormatWithContentModelOptions\n) => void;\n\n/**\n * Switch the Shadow Edit mode of editor On/Off\n * @param core The StandaloneEditorCore object\n * @param isOn True to switch On, False to switch Off\n */\nexport type SwitchShadowEdit = (core: StandaloneEditorCore, isOn: boolean) => void;\n\n/**\n * Trigger a plugin event\n * @param core The StandaloneEditorCore object\n * @param pluginEvent The event object to trigger\n * @param broadcast Set to true to skip the shouldHandleEventExclusively check\n */\nexport type TriggerEvent = (\n core: StandaloneEditorCore,\n pluginEvent: PluginEvent,\n broadcast: boolean\n) => void;\n\n/**\n * Add an undo snapshot to current undo snapshot stack\n * @param core The StandaloneEditorCore object\n * @param canUndoByBackspace True if this action can be undone when user press Backspace key (aka Auto Complete).\n * @param entityStates @optional Entity states related to this snapshot.\n * Each entity state will cause an EntityOperation event with operation = EntityOperation.UpdateEntityState\n * when undo/redo to this snapshot\n */\nexport type AddUndoSnapshot = (\n core: StandaloneEditorCore,\n canUndoByBackspace: boolean,\n entityStates?: EntityState[]\n) => Snapshot | null;\n\n/**\n * Retrieves the rect of the visible viewport of the editor.\n * @param core The StandaloneEditorCore object\n */\nexport type GetVisibleViewport = (core: StandaloneEditorCore) => Rect | null;\n\n/**\n * Check if the editor has focus now\n * @param core The StandaloneEditorCore object\n * @returns True if the editor has focus, otherwise false\n */\nexport type HasFocus = (core: StandaloneEditorCore) => boolean;\n\n/**\n * Focus to editor. If there is a cached selection range, use it as current selection\n * @param core The StandaloneEditorCore object\n */\nexport type Focus = (core: StandaloneEditorCore) => void;\n\n/**\n * Attach a DOM event to the editor content DIV\n * @param core The StandaloneEditorCore object\n * @param eventMap A map from event name to its handler\n */\nexport type AttachDomEvent = (\n core: StandaloneEditorCore,\n eventMap: Record<string, DOMEventRecord>\n) => () => void;\n\n/**\n * Restore an undo snapshot into editor\n * @param core The StandaloneEditorCore object\n * @param step Steps to move, can be 0, positive or negative\n */\nexport type RestoreUndoSnapshot = (core: StandaloneEditorCore, snapshot: Snapshot) => void;\n\n/**\n * Paste into editor using a clipboardData object\n * @param core The StandaloneEditorCore object.\n * @param clipboardData Clipboard data retrieved from clipboard\n * @param pasteType Type of content to paste. @default normal\n */\nexport type Paste = (\n core: StandaloneEditorCore,\n clipboardData: ClipboardData,\n pasteType: PasteType\n) => void;\n\n/**\n * The interface for the map of core API for Content Model editor.\n * Editor can call call API from this map under StandaloneEditorCore object\n */\nexport interface StandaloneCoreApiMap {\n /**\n * Create a EditorContext object used by ContentModel API\n * @param core The StandaloneEditorCore object\n */\n createEditorContext: CreateEditorContext;\n\n /**\n * Create Content Model from DOM tree in this editor\n * @param core The StandaloneEditorCore object\n * @param option The option to customize the behavior of DOM to Content Model conversion\n */\n createContentModel: CreateContentModel;\n\n /**\n * Get current DOM selection from editor\n * @param core The StandaloneEditorCore object\n */\n getDOMSelection: GetDOMSelection;\n\n /**\n * Set content with content model\n * @param core The StandaloneEditorCore object\n * @param model The content model to set\n * @param option Additional options to customize the behavior of Content Model to DOM conversion\n */\n setContentModel: SetContentModel;\n\n /**\n * Set current DOM selection from editor. This is the replacement of core API select\n * @param core The StandaloneEditorCore object\n * @param selection The selection to set\n * @param skipSelectionChangedEvent @param Pass true to skip triggering a SelectionChangedEvent\n */\n setDOMSelection: SetDOMSelection;\n\n /**\n * The general API to do format change with Content Model\n * It will grab a Content Model for current editor content, and invoke a callback function\n * to do format change. Then according to the return value, write back the modified content model into editor.\n * If there is cached model, it will be used and updated.\n * @param core The StandaloneEditorCore object\n * @param formatter Formatter function, see ContentModelFormatter\n * @param options More options, see FormatWithContentModelOptions\n */\n formatContentModel: FormatContentModel;\n\n /**\n * Switch the Shadow Edit mode of editor On/Off\n * @param core The StandaloneEditorCore object\n * @param isOn True to switch On, False to switch Off\n */\n switchShadowEdit: SwitchShadowEdit;\n\n /**\n * Retrieves the rect of the visible viewport of the editor.\n * @param core The StandaloneEditorCore object\n */\n getVisibleViewport: GetVisibleViewport;\n\n /**\n * Check if the editor has focus now\n * @param core The StandaloneEditorCore object\n * @returns True if the editor has focus, otherwise false\n */\n hasFocus: HasFocus;\n\n /**\n * Focus to editor. If there is a cached selection range, use it as current selection\n * @param core The StandaloneEditorCore object\n */\n focus: Focus;\n\n /**\n * Add an undo snapshot to current undo snapshot stack\n * @param core The StandaloneEditorCore object\n * @param canUndoByBackspace True if this action can be undone when user press Backspace key (aka Auto Complete).\n * @param entityStates @optional Entity states related to this snapshot.\n * Each entity state will cause an EntityOperation event with operation = EntityOperation.UpdateEntityState\n * when undo/redo to this snapshot\n */\n addUndoSnapshot: AddUndoSnapshot;\n\n /**\n * Restore an undo snapshot into editor\n * @param core The editor core object\n * @param step Steps to move, can be 0, positive or negative\n */\n restoreUndoSnapshot: RestoreUndoSnapshot;\n\n /**\n * Attach a DOM event to the editor content DIV\n * @param core The StandaloneEditorCore object\n * @param eventMap A map from event name to its handler\n */\n attachDomEvent: AttachDomEvent;\n\n /**\n * Trigger a plugin event\n * @param core The StandaloneEditorCore object\n * @param pluginEvent The event object to trigger\n * @param broadcast Set to true to skip the shouldHandleEventExclusively check\n */\n triggerEvent: TriggerEvent;\n\n /**\n * Paste into editor using a clipboardData object\n * @param editor The editor to paste content into\n * @param clipboardData Clipboard data retrieved from clipboard\n * @param pasteType Type of content to paste. @default normal\n */\n paste: Paste;\n}\n\n/**\n * Represents the core data structure of a Content Model editor\n */\nexport interface StandaloneEditorCore extends PluginState {\n /**\n * The content DIV element of this editor\n */\n readonly contentDiv: HTMLDivElement;\n\n /**\n * Core API map of this editor\n */\n readonly api: StandaloneCoreApiMap;\n\n /**\n * Original API map of this editor. Overridden core API can use API from this map to call the original version of core API.\n */\n readonly originalApi: StandaloneCoreApiMap;\n\n /**\n * An array of editor plugins.\n */\n readonly plugins: EditorPlugin[];\n\n /**\n * Settings used by DOM to Content Model conversion\n */\n readonly domToModelSettings: ContentModelSettings<DomToModelOption, DomToModelSettings>;\n\n /**\n * Settings used by Content Model to DOM conversion\n */\n readonly modelToDomSettings: ContentModelSettings<ModelToDomOption, ModelToDomSettings>;\n\n /**\n * Editor running environment\n */\n readonly environment: EditorEnvironment;\n\n /**\n * Dark model handler for the editor, used for variable-based solution.\n * If keep it null, editor will still use original dataset-based dark mode solution.\n */\n readonly darkColorHandler: DarkColorHandler;\n\n /**\n * A handler to convert HTML string to a trust HTML string.\n * By default it will just return the original HTML string directly.\n * To override, pass your own trusted HTML handler to EditorOptions.trustedHTMLHandler\n */\n readonly trustedHTMLHandler: TrustedHTMLHandler;\n\n /**\n * A callback to be invoked when any exception is thrown during disposing editor\n * @param plugin The plugin that causes exception\n * @param error The error object we got\n */\n readonly disposeErrorHandler?: (plugin: EditorPlugin, error: Error) => void;\n\n /**\n * @deprecated Will be removed soon.\n * Current zoom scale, default value is 1\n * When editor is put under a zoomed container, need to pass the zoom scale number using this property\n * to let editor behave correctly especially for those mouse drag/drop behaviors\n */\n zoomScale: number;\n}\n\n/**\n * Default DOM and Content Model conversion settings for an editor\n */\nexport interface ContentModelSettings<OptionType, ConfigType> {\n /**\n * Built in options used by editor\n */\n builtIn: OptionType;\n\n /**\n * Customize options passed in from Editor Options, used for overwrite default option.\n * This will also be used by copy/paste\n */\n customized: OptionType;\n\n /**\n * Configuration calculated from default and customized options.\n * This is a cached object so that we don't need to cache it every time when we use Content Model\n */\n calculated: ConfigType;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StandaloneEditorCore.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/editor/StandaloneEditorCore.ts"],"names":[],"mappings":"","sourcesContent":["import type { DOMHelper } from '../parameter/DOMHelper';\nimport type { PluginEvent } from '../event/PluginEvent';\nimport type { PluginState } from '../pluginState/PluginState';\nimport type { EditorPlugin } from './EditorPlugin';\nimport type { ClipboardData } from '../parameter/ClipboardData';\nimport type { PasteType } from '../enum/PasteType';\nimport type { DOMEventRecord } from '../parameter/DOMEventRecord';\nimport type { Snapshot } from '../parameter/Snapshot';\nimport type { EntityState } from '../parameter/FormatWithContentModelContext';\nimport type { DarkColorHandler } from '../context/DarkColorHandler';\nimport type { ContentModelDocument } from '../group/ContentModelDocument';\nimport type { DOMSelection } from '../selection/DOMSelection';\nimport type { DomToModelOption } from '../context/DomToModelOption';\nimport type { DomToModelSettings } from '../context/DomToModelSettings';\nimport type { EditorContext } from '../context/EditorContext';\nimport type { EditorEnvironment } from '../parameter/EditorEnvironment';\nimport type { ModelToDomOption } from '../context/ModelToDomOption';\nimport type { ModelToDomSettings, OnNodeCreated } from '../context/ModelToDomSettings';\nimport type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';\nimport type { Rect } from '../parameter/Rect';\nimport type {\n ContentModelFormatter,\n FormatWithContentModelOptions,\n} from '../parameter/FormatWithContentModelOptions';\n\n/**\n * Create a EditorContext object used by ContentModel API\n * @param core The StandaloneEditorCore object\n * @param saveIndex True to allow saving index info into node using domIndexer, otherwise false\n */\nexport type CreateEditorContext = (core: StandaloneEditorCore, saveIndex: boolean) => EditorContext;\n\n/**\n * Create Content Model from DOM tree in this editor\n * @param core The StandaloneEditorCore object\n * @param option The option to customize the behavior of DOM to Content Model conversion\n * @param selectionOverride When passed, use this selection range instead of current selection in editor\n */\nexport type CreateContentModel = (\n core: StandaloneEditorCore,\n option?: DomToModelOption,\n selectionOverride?: DOMSelection\n) => ContentModelDocument;\n\n/**\n * Get current DOM selection from editor\n * @param core The StandaloneEditorCore object\n */\nexport type GetDOMSelection = (core: StandaloneEditorCore) => DOMSelection | null;\n\n/**\n * Set content with content model. This is the replacement of core API getSelectionRangeEx\n * @param core The StandaloneEditorCore object\n * @param model The content model to set\n * @param option Additional options to customize the behavior of Content Model to DOM conversion\n * @param onNodeCreated An optional callback that will be called when a DOM node is created\n */\nexport type SetContentModel = (\n core: StandaloneEditorCore,\n model: ContentModelDocument,\n option?: ModelToDomOption,\n onNodeCreated?: OnNodeCreated\n) => DOMSelection | null;\n\n/**\n * Set current DOM selection from editor. This is the replacement of core API select\n * @param core The StandaloneEditorCore object\n * @param selection The selection to set\n * @param skipSelectionChangedEvent @param Pass true to skip triggering a SelectionChangedEvent\n */\nexport type SetDOMSelection = (\n core: StandaloneEditorCore,\n selection: DOMSelection | null,\n skipSelectionChangedEvent?: boolean\n) => void;\n\n/**\n * The general API to do format change with Content Model\n * It will grab a Content Model for current editor content, and invoke a callback function\n * to do format change. Then according to the return value, write back the modified content model into editor.\n * If there is cached model, it will be used and updated.\n * @param core The StandaloneEditorCore object\n * @param formatter Formatter function, see ContentModelFormatter\n * @param options More options, see FormatWithContentModelOptions\n */\nexport type FormatContentModel = (\n core: StandaloneEditorCore,\n formatter: ContentModelFormatter,\n options?: FormatWithContentModelOptions\n) => void;\n\n/**\n * Switch the Shadow Edit mode of editor On/Off\n * @param core The StandaloneEditorCore object\n * @param isOn True to switch On, False to switch Off\n */\nexport type SwitchShadowEdit = (core: StandaloneEditorCore, isOn: boolean) => void;\n\n/**\n * Trigger a plugin event\n * @param core The StandaloneEditorCore object\n * @param pluginEvent The event object to trigger\n * @param broadcast Set to true to skip the shouldHandleEventExclusively check\n */\nexport type TriggerEvent = (\n core: StandaloneEditorCore,\n pluginEvent: PluginEvent,\n broadcast: boolean\n) => void;\n\n/**\n * Add an undo snapshot to current undo snapshot stack\n * @param core The StandaloneEditorCore object\n * @param canUndoByBackspace True if this action can be undone when user press Backspace key (aka Auto Complete).\n * @param entityStates @optional Entity states related to this snapshot.\n * Each entity state will cause an EntityOperation event with operation = EntityOperation.UpdateEntityState\n * when undo/redo to this snapshot\n */\nexport type AddUndoSnapshot = (\n core: StandaloneEditorCore,\n canUndoByBackspace: boolean,\n entityStates?: EntityState[]\n) => Snapshot | null;\n\n/**\n * Retrieves the rect of the visible viewport of the editor.\n * @param core The StandaloneEditorCore object\n */\nexport type GetVisibleViewport = (core: StandaloneEditorCore) => Rect | null;\n\n/**\n * Check if the editor has focus now\n * @param core The StandaloneEditorCore object\n * @returns True if the editor has focus, otherwise false\n */\nexport type HasFocus = (core: StandaloneEditorCore) => boolean;\n\n/**\n * Focus to editor. If there is a cached selection range, use it as current selection\n * @param core The StandaloneEditorCore object\n */\nexport type Focus = (core: StandaloneEditorCore) => void;\n\n/**\n * Attach a DOM event to the editor content DIV\n * @param core The StandaloneEditorCore object\n * @param eventMap A map from event name to its handler\n */\nexport type AttachDomEvent = (\n core: StandaloneEditorCore,\n eventMap: Record<string, DOMEventRecord>\n) => () => void;\n\n/**\n * Restore an undo snapshot into editor\n * @param core The StandaloneEditorCore object\n * @param step Steps to move, can be 0, positive or negative\n */\nexport type RestoreUndoSnapshot = (core: StandaloneEditorCore, snapshot: Snapshot) => void;\n\n/**\n * Paste into editor using a clipboardData object\n * @param core The StandaloneEditorCore object.\n * @param clipboardData Clipboard data retrieved from clipboard\n * @param pasteType Type of content to paste. @default normal\n */\nexport type Paste = (\n core: StandaloneEditorCore,\n clipboardData: ClipboardData,\n pasteType: PasteType\n) => void;\n\n/**\n * The interface for the map of core API for Content Model editor.\n * Editor can call call API from this map under StandaloneEditorCore object\n */\nexport interface StandaloneCoreApiMap {\n /**\n * Create a EditorContext object used by ContentModel API\n * @param core The StandaloneEditorCore object\n * @param saveIndex True to allow saving index info into node using domIndexer, otherwise false\n */\n createEditorContext: CreateEditorContext;\n\n /**\n * Create Content Model from DOM tree in this editor\n * @param core The StandaloneEditorCore object\n * @param option The option to customize the behavior of DOM to Content Model conversion\n */\n createContentModel: CreateContentModel;\n\n /**\n * Get current DOM selection from editor\n * @param core The StandaloneEditorCore object\n */\n getDOMSelection: GetDOMSelection;\n\n /**\n * Set content with content model\n * @param core The StandaloneEditorCore object\n * @param model The content model to set\n * @param option Additional options to customize the behavior of Content Model to DOM conversion\n */\n setContentModel: SetContentModel;\n\n /**\n * Set current DOM selection from editor. This is the replacement of core API select\n * @param core The StandaloneEditorCore object\n * @param selection The selection to set\n * @param skipSelectionChangedEvent @param Pass true to skip triggering a SelectionChangedEvent\n */\n setDOMSelection: SetDOMSelection;\n\n /**\n * The general API to do format change with Content Model\n * It will grab a Content Model for current editor content, and invoke a callback function\n * to do format change. Then according to the return value, write back the modified content model into editor.\n * If there is cached model, it will be used and updated.\n * @param core The StandaloneEditorCore object\n * @param formatter Formatter function, see ContentModelFormatter\n * @param options More options, see FormatWithContentModelOptions\n */\n formatContentModel: FormatContentModel;\n\n /**\n * Switch the Shadow Edit mode of editor On/Off\n * @param core The StandaloneEditorCore object\n * @param isOn True to switch On, False to switch Off\n */\n switchShadowEdit: SwitchShadowEdit;\n\n /**\n * Retrieves the rect of the visible viewport of the editor.\n * @param core The StandaloneEditorCore object\n */\n getVisibleViewport: GetVisibleViewport;\n\n /**\n * Check if the editor has focus now\n * @param core The StandaloneEditorCore object\n * @returns True if the editor has focus, otherwise false\n */\n hasFocus: HasFocus;\n\n /**\n * Focus to editor. If there is a cached selection range, use it as current selection\n * @param core The StandaloneEditorCore object\n */\n focus: Focus;\n\n /**\n * Add an undo snapshot to current undo snapshot stack\n * @param core The StandaloneEditorCore object\n * @param canUndoByBackspace True if this action can be undone when user press Backspace key (aka Auto Complete).\n * @param entityStates @optional Entity states related to this snapshot.\n * Each entity state will cause an EntityOperation event with operation = EntityOperation.UpdateEntityState\n * when undo/redo to this snapshot\n */\n addUndoSnapshot: AddUndoSnapshot;\n\n /**\n * Restore an undo snapshot into editor\n * @param core The editor core object\n * @param step Steps to move, can be 0, positive or negative\n */\n restoreUndoSnapshot: RestoreUndoSnapshot;\n\n /**\n * Attach a DOM event to the editor content DIV\n * @param core The StandaloneEditorCore object\n * @param eventMap A map from event name to its handler\n */\n attachDomEvent: AttachDomEvent;\n\n /**\n * Trigger a plugin event\n * @param core The StandaloneEditorCore object\n * @param pluginEvent The event object to trigger\n * @param broadcast Set to true to skip the shouldHandleEventExclusively check\n */\n triggerEvent: TriggerEvent;\n\n /**\n * Paste into editor using a clipboardData object\n * @param editor The editor to paste content into\n * @param clipboardData Clipboard data retrieved from clipboard\n * @param pasteType Type of content to paste. @default normal\n */\n paste: Paste;\n}\n\n/**\n * Represents the core data structure of a Content Model editor\n */\nexport interface StandaloneEditorCore extends PluginState {\n /**\n * The content DIV element of this editor\n */\n readonly contentDiv: HTMLDivElement;\n\n /**\n * Core API map of this editor\n */\n readonly api: StandaloneCoreApiMap;\n\n /**\n * Original API map of this editor. Overridden core API can use API from this map to call the original version of core API.\n */\n readonly originalApi: StandaloneCoreApiMap;\n\n /**\n * An array of editor plugins.\n */\n readonly plugins: EditorPlugin[];\n\n /**\n * Settings used by DOM to Content Model conversion\n */\n readonly domToModelSettings: ContentModelSettings<DomToModelOption, DomToModelSettings>;\n\n /**\n * Settings used by Content Model to DOM conversion\n */\n readonly modelToDomSettings: ContentModelSettings<ModelToDomOption, ModelToDomSettings>;\n\n /**\n * Editor running environment\n */\n readonly environment: EditorEnvironment;\n\n /**\n * Dark model handler for the editor, used for variable-based solution.\n * If keep it null, editor will still use original dataset-based dark mode solution.\n */\n readonly darkColorHandler: DarkColorHandler;\n\n /**\n * A handler to convert HTML string to a trust HTML string.\n * By default it will just return the original HTML string directly.\n * To override, pass your own trusted HTML handler to EditorOptions.trustedHTMLHandler\n */\n readonly trustedHTMLHandler: TrustedHTMLHandler;\n\n /**\n * A helper class to provide DOM access APIs\n */\n readonly domHelper: DOMHelper;\n\n /**\n * A callback to be invoked when any exception is thrown during disposing editor\n * @param plugin The plugin that causes exception\n * @param error The error object we got\n */\n readonly disposeErrorHandler?: (plugin: EditorPlugin, error: Error) => void;\n}\n\n/**\n * Default DOM and Content Model conversion settings for an editor\n */\nexport interface ContentModelSettings<OptionType, ConfigType> {\n /**\n * Built in options used by editor\n */\n builtIn: OptionType;\n\n /**\n * Customize options passed in from Editor Options, used for overwrite default option.\n * This will also be used by copy/paste\n */\n customized: OptionType;\n\n /**\n * Configuration calculated from default and customized options.\n * This is a cached object so that we don't need to cache it every time when we use Content Model\n */\n calculated: ConfigType;\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ContextMenuPluginState } from '../pluginState/ContextMenuPluginState';
|
|
1
2
|
import type { PluginWithState } from './PluginWithState';
|
|
2
3
|
import type { CopyPastePluginState } from '../pluginState/CopyPastePluginState';
|
|
3
4
|
import type { UndoPluginState } from '../pluginState/UndoPluginState';
|
|
@@ -39,6 +40,10 @@ export interface StandaloneEditorCorePlugins {
|
|
|
39
40
|
* Undo plugin provides the ability to undo/redo
|
|
40
41
|
*/
|
|
41
42
|
readonly undo: PluginWithState<UndoPluginState>;
|
|
43
|
+
/**
|
|
44
|
+
* Undo plugin provides the ability get context menu items and trigger ContextMenu event
|
|
45
|
+
*/
|
|
46
|
+
readonly contextMenu: PluginWithState<ContextMenuPluginState>;
|
|
42
47
|
/**
|
|
43
48
|
* Lifecycle plugin handles editor initialization and disposing
|
|
44
49
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandaloneEditorCorePlugins.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/editor/StandaloneEditorCorePlugins.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginWithState } from './PluginWithState';\nimport type { CopyPastePluginState } from '../pluginState/CopyPastePluginState';\nimport type { UndoPluginState } from '../pluginState/UndoPluginState';\nimport type { SelectionPluginState } from '../pluginState/SelectionPluginState';\nimport type { EntityPluginState } from '../pluginState/EntityPluginState';\nimport type { LifecyclePluginState } from '../pluginState/LifecyclePluginState';\nimport type { DOMEventPluginState } from '../pluginState/DOMEventPluginState';\nimport type { ContentModelCachePluginState } from '../pluginState/ContentModelCachePluginState';\nimport type { ContentModelFormatPluginState } from '../pluginState/ContentModelFormatPluginState';\n\n/**\n * Core plugins for standalone editor\n */\nexport interface StandaloneEditorCorePlugins {\n /**\n * ContentModel cache plugin manages cached Content Model, and refresh the cache when necessary\n */\n readonly cache: PluginWithState<ContentModelCachePluginState>;\n\n /**\n * ContentModelFormat plugins helps editor to do formatting on top of content model.\n */\n readonly format: PluginWithState<ContentModelFormatPluginState>;\n\n /**\n * Copy and paste plugin for handling onCopy and onPaste event\n */\n readonly copyPaste: PluginWithState<CopyPastePluginState>;\n\n /**\n * DomEvent plugin helps handle additional DOM events such as IME composition, cut, drop.\n */\n readonly domEvent: PluginWithState<DOMEventPluginState>;\n\n /**\n * Selection plugin handles selection, including range selection, table selection, and image selection\n */\n readonly selection: PluginWithState<SelectionPluginState>;\n\n /**\n * Entity Plugin handles all operations related to an entity and generate entity specified events\n */\n readonly entity: PluginWithState<EntityPluginState>;\n\n /**\n * Undo plugin provides the ability to undo/redo\n */\n readonly undo: PluginWithState<UndoPluginState>;\n\n /**\n * Lifecycle plugin handles editor initialization and disposing\n */\n readonly lifecycle: PluginWithState<LifecyclePluginState>;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StandaloneEditorCorePlugins.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/editor/StandaloneEditorCorePlugins.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContextMenuPluginState } from '../pluginState/ContextMenuPluginState';\nimport type { PluginWithState } from './PluginWithState';\nimport type { CopyPastePluginState } from '../pluginState/CopyPastePluginState';\nimport type { UndoPluginState } from '../pluginState/UndoPluginState';\nimport type { SelectionPluginState } from '../pluginState/SelectionPluginState';\nimport type { EntityPluginState } from '../pluginState/EntityPluginState';\nimport type { LifecyclePluginState } from '../pluginState/LifecyclePluginState';\nimport type { DOMEventPluginState } from '../pluginState/DOMEventPluginState';\nimport type { ContentModelCachePluginState } from '../pluginState/ContentModelCachePluginState';\nimport type { ContentModelFormatPluginState } from '../pluginState/ContentModelFormatPluginState';\n\n/**\n * Core plugins for standalone editor\n */\nexport interface StandaloneEditorCorePlugins {\n /**\n * ContentModel cache plugin manages cached Content Model, and refresh the cache when necessary\n */\n readonly cache: PluginWithState<ContentModelCachePluginState>;\n\n /**\n * ContentModelFormat plugins helps editor to do formatting on top of content model.\n */\n readonly format: PluginWithState<ContentModelFormatPluginState>;\n\n /**\n * Copy and paste plugin for handling onCopy and onPaste event\n */\n readonly copyPaste: PluginWithState<CopyPastePluginState>;\n\n /**\n * DomEvent plugin helps handle additional DOM events such as IME composition, cut, drop.\n */\n readonly domEvent: PluginWithState<DOMEventPluginState>;\n\n /**\n * Selection plugin handles selection, including range selection, table selection, and image selection\n */\n readonly selection: PluginWithState<SelectionPluginState>;\n\n /**\n * Entity Plugin handles all operations related to an entity and generate entity specified events\n */\n readonly entity: PluginWithState<EntityPluginState>;\n\n /**\n * Undo plugin provides the ability to undo/redo\n */\n readonly undo: PluginWithState<UndoPluginState>;\n\n /**\n * Undo plugin provides the ability get context menu items and trigger ContextMenu event\n */\n readonly contextMenu: PluginWithState<ContextMenuPluginState>;\n\n /**\n * Lifecycle plugin handles editor initialization and disposing\n */\n readonly lifecycle: PluginWithState<LifecyclePluginState>;\n}\n"]}
|
|
@@ -92,11 +92,4 @@ export interface StandaloneEditorOptions {
|
|
|
92
92
|
* @param error The error object we got
|
|
93
93
|
*/
|
|
94
94
|
disposeErrorHandler?: (plugin: EditorPlugin, error: Error) => void;
|
|
95
|
-
/**
|
|
96
|
-
* @deprecated
|
|
97
|
-
* Current zoom scale, @default value is 1
|
|
98
|
-
* When editor is put under a zoomed container, need to pass the zoom scale number using this property
|
|
99
|
-
* to let editor behave correctly especially for those mouse drag/drop behaviors
|
|
100
|
-
*/
|
|
101
|
-
zoomScale?: number;
|
|
102
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandaloneEditorOptions.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/editor/StandaloneEditorOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { Colors, ColorTransformFunction } from '../context/DarkColorHandler';\nimport type { EditorPlugin } from './EditorPlugin';\nimport type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';\nimport type { StandaloneCoreApiMap } from './StandaloneEditorCore';\nimport type { DomToModelOption } from '../context/DomToModelOption';\nimport type { ModelToDomOption } from '../context/ModelToDomOption';\nimport type { ContentModelDocument } from '../group/ContentModelDocument';\nimport type { Snapshots } from '../parameter/Snapshot';\nimport type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';\n\n/**\n * Options for Content Model editor\n */\nexport interface StandaloneEditorOptions {\n /**\n * Default options used for DOM to Content Model conversion\n */\n defaultDomToModelOptions?: DomToModelOption;\n\n /**\n * Default options used for Content Model to DOM conversion\n */\n defaultModelToDomOptions?: ModelToDomOption;\n\n /**\n * Reuse existing DOM structure if possible, and update the model when content or selection is changed\n */\n cacheModel?: boolean;\n\n /**\n * List of plugins.\n * The order of plugins here determines in what order each event will be dispatched.\n * Plugins not appear in this list will not be added to editor, including built-in plugins.\n * Default value is empty array.\n */\n plugins?: EditorPlugin[];\n\n /**\n * Default format of editor content. This will be applied to empty content.\n * If there is already content inside editor, format of existing content will not be changed.\n * Default value is the computed style of editor content DIV\n */\n defaultSegmentFormat?: ContentModelSegmentFormat;\n\n /**\n * Allowed custom content type when paste besides text/plain, text/html and images\n * Only text types are supported, and do not add \"text/\" prefix to the type values\n */\n allowedCustomPasteType?: string[];\n\n /**\n * The scroll container to get scroll event from.\n * By default, the scroll container will be the same with editor content DIV\n */\n scrollContainer?: HTMLElement;\n\n /**\n * A util function to transform light mode color to dark mode color\n * Default value is to return the original light color\n */\n getDarkColor?: ColorTransformFunction;\n\n /**\n * Existing known color pairs\n */\n knownColors?: Record<string, Colors>;\n\n /**\n * Customized trusted type handler used for sanitizing HTML string before assign to DOM tree\n * This is required when trusted-type Content-Security-Policy (CSP) is enabled.\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types\n */\n trustedHTMLHandler?: TrustedHTMLHandler;\n\n /**\n * A function map to override default core API implementation\n * Default value is null\n */\n coreApiOverride?: Partial<StandaloneCoreApiMap>;\n\n /**\n * Color of the border of a selectedImage. Default color: '#DB626C'\n */\n imageSelectionBorderColor?: string;\n\n /**\n * Initial Content Model\n */\n initialModel?: ContentModelDocument;\n\n /**\n * Whether to skip the adjust editor process when for light/dark mode\n */\n doNotAdjustEditorColor?: boolean;\n\n /**\n * If the editor is currently in dark mode\n */\n inDarkMode?: boolean;\n\n /**\n * Undo snapshot. Use this parameter to provide an external storage of undo snapshots\n */\n snapshots?: Snapshots;\n\n /**\n * A callback to be invoked when any exception is thrown during disposing editor\n * @param plugin The plugin that causes exception\n * @param error The error object we got\n */\n disposeErrorHandler?: (plugin: EditorPlugin, error: Error) => void;\n
|
|
1
|
+
{"version":3,"file":"StandaloneEditorOptions.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/editor/StandaloneEditorOptions.ts"],"names":[],"mappings":"","sourcesContent":["import type { Colors, ColorTransformFunction } from '../context/DarkColorHandler';\nimport type { EditorPlugin } from './EditorPlugin';\nimport type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';\nimport type { StandaloneCoreApiMap } from './StandaloneEditorCore';\nimport type { DomToModelOption } from '../context/DomToModelOption';\nimport type { ModelToDomOption } from '../context/ModelToDomOption';\nimport type { ContentModelDocument } from '../group/ContentModelDocument';\nimport type { Snapshots } from '../parameter/Snapshot';\nimport type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';\n\n/**\n * Options for Content Model editor\n */\nexport interface StandaloneEditorOptions {\n /**\n * Default options used for DOM to Content Model conversion\n */\n defaultDomToModelOptions?: DomToModelOption;\n\n /**\n * Default options used for Content Model to DOM conversion\n */\n defaultModelToDomOptions?: ModelToDomOption;\n\n /**\n * Reuse existing DOM structure if possible, and update the model when content or selection is changed\n */\n cacheModel?: boolean;\n\n /**\n * List of plugins.\n * The order of plugins here determines in what order each event will be dispatched.\n * Plugins not appear in this list will not be added to editor, including built-in plugins.\n * Default value is empty array.\n */\n plugins?: EditorPlugin[];\n\n /**\n * Default format of editor content. This will be applied to empty content.\n * If there is already content inside editor, format of existing content will not be changed.\n * Default value is the computed style of editor content DIV\n */\n defaultSegmentFormat?: ContentModelSegmentFormat;\n\n /**\n * Allowed custom content type when paste besides text/plain, text/html and images\n * Only text types are supported, and do not add \"text/\" prefix to the type values\n */\n allowedCustomPasteType?: string[];\n\n /**\n * The scroll container to get scroll event from.\n * By default, the scroll container will be the same with editor content DIV\n */\n scrollContainer?: HTMLElement;\n\n /**\n * A util function to transform light mode color to dark mode color\n * Default value is to return the original light color\n */\n getDarkColor?: ColorTransformFunction;\n\n /**\n * Existing known color pairs\n */\n knownColors?: Record<string, Colors>;\n\n /**\n * Customized trusted type handler used for sanitizing HTML string before assign to DOM tree\n * This is required when trusted-type Content-Security-Policy (CSP) is enabled.\n * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types\n */\n trustedHTMLHandler?: TrustedHTMLHandler;\n\n /**\n * A function map to override default core API implementation\n * Default value is null\n */\n coreApiOverride?: Partial<StandaloneCoreApiMap>;\n\n /**\n * Color of the border of a selectedImage. Default color: '#DB626C'\n */\n imageSelectionBorderColor?: string;\n\n /**\n * Initial Content Model\n */\n initialModel?: ContentModelDocument;\n\n /**\n * Whether to skip the adjust editor process when for light/dark mode\n */\n doNotAdjustEditorColor?: boolean;\n\n /**\n * If the editor is currently in dark mode\n */\n inDarkMode?: boolean;\n\n /**\n * Undo snapshot. Use this parameter to provide an external storage of undo snapshots\n */\n snapshots?: Snapshots;\n\n /**\n * A callback to be invoked when any exception is thrown during disposing editor\n * @param plugin The plugin that causes exception\n * @param error The error object we got\n */\n disposeErrorHandler?: (plugin: EditorPlugin, error: Error) => void;\n}\n"]}
|
|
@@ -5,10 +5,6 @@ import type { BasePluginEvent } from './BasePluginEvent';
|
|
|
5
5
|
*
|
|
6
6
|
*/
|
|
7
7
|
export interface ZoomChangedEvent extends BasePluginEvent<'zoomChanged'> {
|
|
8
|
-
/**
|
|
9
|
-
* Zoom scale value before this change
|
|
10
|
-
*/
|
|
11
|
-
oldZoomScale: number;
|
|
12
8
|
/**
|
|
13
9
|
* Zoom scale value after this change
|
|
14
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoomChangedEvent.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/event/ZoomChangedEvent.ts"],"names":[],"mappings":"","sourcesContent":["import type { BasePluginEvent } from './BasePluginEvent';\n\n/**\n * Represents an event object triggered from Editor.setZoomScale() API.\n * Plugins can handle this event when they need to do something for zoom changing.\n *\n */\nexport interface ZoomChangedEvent extends BasePluginEvent<'zoomChanged'> {\n /**\n * Zoom scale value
|
|
1
|
+
{"version":3,"file":"ZoomChangedEvent.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/event/ZoomChangedEvent.ts"],"names":[],"mappings":"","sourcesContent":["import type { BasePluginEvent } from './BasePluginEvent';\n\n/**\n * Represents an event object triggered from Editor.setZoomScale() API.\n * Plugins can handle this event when they need to do something for zoom changing.\n *\n */\nexport interface ZoomChangedEvent extends BasePluginEvent<'zoomChanged'> {\n /**\n * Zoom scale value after this change\n */\n newZoomScale: number;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MarginFormat.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-types/lib/format/formatParts/MarginFormat.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Format of margin\n */\nexport type MarginFormat = {\n /**\n * Margin top value\n */\n marginTop?: string;\n\n /**\n * Margin right value\n */\n marginRight?: string;\n\n /**\n * Margin bottom value\n */\n marginBottom?: string;\n\n /**\n * Margin left value\n */\n marginLeft?: string;\n
|
|
1
|
+
{"version":3,"file":"MarginFormat.js","sourceRoot":"","sources":["../../../../../packages-content-model/roosterjs-content-model-types/lib/format/formatParts/MarginFormat.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Format of margin\n */\nexport type MarginFormat = {\n /**\n * Margin top value\n */\n marginTop?: string;\n\n /**\n * Margin right value\n */\n marginRight?: string;\n\n /**\n * Margin bottom value\n */\n marginBottom?: string;\n\n /**\n * Margin left value\n */\n marginLeft?: string;\n};\n"]}
|
package/lib/index.d.ts
CHANGED
|
@@ -108,6 +108,7 @@ export { ContentModelHandler, ContentModelSegmentHandler, ContentModelBlockHandl
|
|
|
108
108
|
export { DomToModelOption } from './context/DomToModelOption';
|
|
109
109
|
export { ModelToDomOption } from './context/ModelToDomOption';
|
|
110
110
|
export { ContentModelDomIndexer } from './context/ContentModelDomIndexer';
|
|
111
|
+
export { TextMutationObserver } from './context/TextMutationObserver';
|
|
111
112
|
export { DefinitionType } from './metadata/DefinitionType';
|
|
112
113
|
export { ArrayItemType, DefinitionBase, StringDefinition, NumberDefinition, BooleanDefinition, ArrayDefinition, ObjectPropertyDefinition, ObjectDefinition, Definition, } from './metadata/Definition';
|
|
113
114
|
export { DarkColorHandler, Colors, ColorTransformFunction } from './context/DarkColorHandler';
|
|
@@ -127,6 +128,7 @@ export { EntityPluginState, KnownEntityItem } from './pluginState/EntityPluginSt
|
|
|
127
128
|
export { SelectionPluginState } from './pluginState/SelectionPluginState';
|
|
128
129
|
export { UndoPluginState } from './pluginState/UndoPluginState';
|
|
129
130
|
export { PluginKey, KeyOfStatePlugin, TypeOfStatePlugin, StatePluginKeys, GenericPluginState, PluginState, } from './pluginState/PluginState';
|
|
131
|
+
export { ContextMenuPluginState } from './pluginState/ContextMenuPluginState';
|
|
130
132
|
export { EditorEnvironment } from './parameter/EditorEnvironment';
|
|
131
133
|
export { EntityState, DeletedEntity, FormatWithContentModelContext, } from './parameter/FormatWithContentModelContext';
|
|
132
134
|
export { FormatWithContentModelOptions, ContentModelFormatter, } from './parameter/FormatWithContentModelOptions';
|
|
@@ -144,6 +146,7 @@ export { AnnounceData, KnownAnnounceStrings } from './parameter/AnnounceData';
|
|
|
144
146
|
export { TrustedHTMLHandler } from './parameter/TrustedHTMLHandler';
|
|
145
147
|
export { Rect } from './parameter/Rect';
|
|
146
148
|
export { ValueSanitizer } from './parameter/ValueSanitizer';
|
|
149
|
+
export { DOMHelper } from './parameter/DOMHelper';
|
|
147
150
|
export { BasePluginEvent, BasePluginDomEvent } from './event/BasePluginEvent';
|
|
148
151
|
export { BeforeCutCopyEvent } from './event/BeforeCutCopyEvent';
|
|
149
152
|
export { BeforeDisposeEvent } from './event/BeforeDisposeEvent';
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages-content-model/roosterjs-content-model-types/lib/index.ts"],"names":[],"mappings":"","sourcesContent":["export { ContentModelSegmentFormat } from './format/ContentModelSegmentFormat';\nexport { ContentModelWithFormat } from './format/ContentModelWithFormat';\nexport { ContentModelTableFormat } from './format/ContentModelTableFormat';\nexport { ContentModelWithDataset } from './format/ContentModelWithDataset';\nexport { ContentModelBlockFormat } from './format/ContentModelBlockFormat';\nexport { ContentModelTableCellFormat } from './format/ContentModelTableCellFormat';\nexport { ContentModelListItemFormat } from './format/ContentModelListItemFormat';\nexport { ContentModelListItemLevelFormat } from './format/ContentModelListItemLevelFormat';\nexport { ContentModelHyperLinkFormat } from './format/ContentModelHyperLinkFormat';\nexport { ContentModelCodeFormat } from './format/ContentModelCodeFormat';\nexport { ContentModelFormatContainerFormat } from './format/ContentModelFormatContainerFormat';\nexport { ContentModelDividerFormat } from './format/ContentModelDividerFormat';\nexport { ContentModelFormatBase } from './format/ContentModelFormatBase';\nexport { ContentModelFormatMap } from './format/ContentModelFormatMap';\nexport { ContentModelImageFormat } from './format/ContentModelImageFormat';\nexport { ContentModelEntityFormat } from './format/ContentModelEntityFormat';\nexport { FormatHandlerTypeMap, FormatKey } from './format/FormatHandlerTypeMap';\n\nexport { BackgroundColorFormat } from './format/formatParts/BackgroundColorFormat';\nexport { BoldFormat } from './format/formatParts/BoldFormat';\nexport { FontFamilyFormat } from './format/formatParts/FontFamilyFormat';\nexport { FontSizeFormat } from './format/formatParts/FontSizeFormat';\nexport { ItalicFormat } from './format/formatParts/ItalicFormat';\nexport { LetterSpacingFormat } from './format/formatParts/LetterSpacingFormat';\nexport { LineHeightFormat } from './format/formatParts/LineHeightFormat';\nexport { StrikeFormat } from './format/formatParts/StrikeFormat';\nexport { SuperOrSubScriptFormat } from './format/formatParts/SuperOrSubScriptFormat';\nexport { TextColorFormat } from './format/formatParts/TextColorFormat';\nexport { UnderlineFormat } from './format/formatParts/UnderlineFormat';\nexport { BorderBoxFormat } from './format/formatParts/BorderBoxFormat';\nexport { VerticalAlignFormat } from './format/formatParts/VerticalAlignFormat';\nexport { WordBreakFormat } from './format/formatParts/WordBreakFormat';\nexport { BorderFormat } from './format/formatParts/BorderFormat';\nexport { DirectionFormat } from './format/formatParts/DirectionFormat';\nexport { HtmlAlignFormat } from './format/formatParts/HtmlAlignFormat';\nexport { MarginFormat } from './format/formatParts/MarginFormat';\nexport { PaddingFormat } from './format/formatParts/PaddingFormat';\nexport { TextAlignFormat } from './format/formatParts/TextAlignFormat';\nexport { TextIndentFormat } from './format/formatParts/TextIndentFormat';\nexport { WhiteSpaceFormat } from './format/formatParts/WhiteSpaceFormat';\nexport { DisplayFormat } from './format/formatParts/DisplayFormat';\nexport { IdFormat } from './format/formatParts/IdFormat';\nexport { SpacingFormat } from './format/formatParts/SpacingFormat';\nexport { TableLayoutFormat } from './format/formatParts/TableLayoutFormat';\nexport { LinkFormat } from './format/formatParts/LinkFormat';\nexport { SizeFormat } from './format/formatParts/SizeFormat';\nexport { BoxShadowFormat } from './format/formatParts/BoxShadowFormat';\nexport { ListThreadFormat } from './format/formatParts/ListThreadFormat';\nexport { ListStyleFormat } from './format/formatParts/ListStyleFormat';\nexport { FloatFormat } from './format/formatParts/FloatFormat';\nexport { EntityInfoFormat } from './format/formatParts/EntityInfoFormat';\n\nexport { DatasetFormat } from './format/metadata/DatasetFormat';\nexport { TableMetadataFormat } from './format/metadata/TableMetadataFormat';\nexport { ListMetadataFormat } from './format/metadata/ListMetadataFormat';\nexport {\n ImageResizeMetadataFormat,\n ImageCropMetadataFormat,\n ImageMetadataFormat,\n ImageRotateMetadataFormat,\n} from './format/metadata/ImageMetadataFormat';\nexport { TableCellMetadataFormat } from './format/metadata/TableCellMetadataFormat';\n\nexport { ContentModelBlockGroupType } from './enum/BlockGroupType';\nexport { ContentModelBlockType } from './enum/BlockType';\nexport { ContentModelSegmentType } from './enum/SegmentType';\nexport {\n EntityLifecycleOperation,\n EntityOperation,\n EntityRemovalOperation,\n} from './enum/EntityOperation';\nexport {\n TableOperation,\n TableVerticalInsertOperation,\n TableHorizontalInsertOperation,\n TableDeleteOperation,\n TableVerticalMergeOperation,\n TableHorizontalMergeOperation,\n TableCellMergeOperation,\n TableSplitOperation,\n TableAlignOperation,\n TableCellHorizontalAlignOperation,\n TableCellVerticalAlignOperation,\n} from './enum/TableOperation';\nexport { PasteType } from './enum/PasteType';\nexport { BorderOperations } from './enum/BorderOperations';\nexport { DeleteResult } from './enum/DeleteResult';\nexport { InsertEntityPosition } from './enum/InsertEntityPosition';\n\nexport { ContentModelBlock } from './block/ContentModelBlock';\nexport { ContentModelParagraph } from './block/ContentModelParagraph';\nexport { ContentModelTable } from './block/ContentModelTable';\nexport { ContentModelDivider } from './block/ContentModelDivider';\nexport { ContentModelBlockBase } from './block/ContentModelBlockBase';\nexport { ContentModelBlockWithCache } from './block/ContentModelBlockWithCache';\nexport { ContentModelTableRow } from './block/ContentModelTableRow';\n\nexport { ContentModelEntity } from './entity/ContentModelEntity';\n\nexport { ContentModelDocument } from './group/ContentModelDocument';\nexport { ContentModelBlockGroupBase } from './group/ContentModelBlockGroupBase';\nexport { ContentModelFormatContainer } from './group/ContentModelFormatContainer';\nexport { ContentModelGeneralBlock } from './group/ContentModelGeneralBlock';\nexport { ContentModelListItem } from './group/ContentModelListItem';\nexport { ContentModelTableCell } from './group/ContentModelTableCell';\nexport { ContentModelBlockGroup } from './group/ContentModelBlockGroup';\n\nexport { ContentModelBr } from './segment/ContentModelBr';\nexport { ContentModelGeneralSegment } from './segment/ContentModelGeneralSegment';\nexport { ContentModelImage } from './segment/ContentModelImage';\nexport { ContentModelText } from './segment/ContentModelText';\nexport { ContentModelSelectionMarker } from './segment/ContentModelSelectionMarker';\nexport { ContentModelSegmentBase } from './segment/ContentModelSegmentBase';\nexport { ContentModelSegment } from './segment/ContentModelSegment';\n\nexport { ContentModelCode } from './decorator/ContentModelCode';\nexport { ContentModelLink } from './decorator/ContentModelLink';\nexport { ContentModelParagraphDecorator } from './decorator/ContentModelParagraphDecorator';\nexport { ContentModelDecorator } from './decorator/ContentModelDecorator';\nexport { ContentModelListLevel } from './decorator/ContentModelListLevel';\n\nexport { Selectable } from './selection/Selectable';\nexport {\n DOMSelection,\n SelectionType,\n SelectionBase,\n ImageSelection,\n RangeSelection,\n TableSelection,\n} from './selection/DOMSelection';\nexport { InsertPoint } from './selection/InsertPoint';\nexport { TableSelectionContext } from './selection/TableSelectionContext';\nexport { TableSelectionCoordinates } from './selection/TableSelectionCoordinates';\n\nexport {\n ContentModelHandlerMap,\n DefaultImplicitFormatMap,\n FormatAppliers,\n FormatAppliersPerCategory,\n OnNodeCreated,\n ModelToDomSettings,\n FormatApplier,\n ApplyMetadata,\n MetadataApplier,\n MetadataAppliers,\n TextFormatApplier,\n ElementFormatAppliersPerCategory,\n} from './context/ModelToDomSettings';\nexport {\n DefaultStyleMap,\n ElementProcessorMap,\n FormatParsers,\n FormatParsersPerCategory,\n DomToModelSettings,\n FormatParser,\n TextFormatParser,\n ElementFormatParserPerCategory,\n} from './context/DomToModelSettings';\nexport { DomToModelContext } from './context/DomToModelContext';\nexport { ElementProcessor } from './context/ElementProcessor';\nexport { DomToModelSelectionContext } from './context/DomToModelSelectionContext';\nexport { EditorContext } from './context/EditorContext';\nexport {\n DomToModelFormatContext,\n DomToModelDecoratorContext,\n DomToModelListFormat,\n} from './context/DomToModelFormatContext';\nexport { ModelToDomContext } from './context/ModelToDomContext';\nexport {\n ModelToDomBlockAndSegmentNode,\n ModelToDomRegularSelection,\n ModelToDomSelectionContext,\n} from './context/ModelToDomSelectionContext';\nexport {\n ModelToDomListStackItem,\n ModelToDomListContext,\n ModelToDomFormatContext,\n} from './context/ModelToDomFormatContext';\nexport {\n ContentModelHandler,\n ContentModelSegmentHandler,\n ContentModelBlockHandler,\n} from './context/ContentModelHandler';\nexport { DomToModelOption } from './context/DomToModelOption';\nexport { ModelToDomOption } from './context/ModelToDomOption';\nexport { ContentModelDomIndexer } from './context/ContentModelDomIndexer';\n\nexport { DefinitionType } from './metadata/DefinitionType';\nexport {\n ArrayItemType,\n DefinitionBase,\n StringDefinition,\n NumberDefinition,\n BooleanDefinition,\n ArrayDefinition,\n ObjectPropertyDefinition,\n ObjectDefinition,\n Definition,\n} from './metadata/Definition';\nexport { DarkColorHandler, Colors, ColorTransformFunction } from './context/DarkColorHandler';\n\nexport { IStandaloneEditor } from './editor/IStandaloneEditor';\nexport { StandaloneEditorOptions } from './editor/StandaloneEditorOptions';\nexport {\n CreateContentModel,\n CreateEditorContext,\n GetDOMSelection,\n SetContentModel,\n SetDOMSelection,\n FormatContentModel,\n StandaloneCoreApiMap,\n StandaloneEditorCore,\n ContentModelSettings,\n SwitchShadowEdit,\n TriggerEvent,\n AddUndoSnapshot,\n HasFocus,\n Focus,\n AttachDomEvent,\n RestoreUndoSnapshot,\n GetVisibleViewport,\n Paste,\n} from './editor/StandaloneEditorCore';\nexport { StandaloneEditorCorePlugins } from './editor/StandaloneEditorCorePlugins';\nexport { EditorPlugin } from './editor/EditorPlugin';\nexport { PluginWithState } from './editor/PluginWithState';\nexport { ContextMenuProvider } from './editor/ContextMenuProvider';\n\nexport { ContentModelCachePluginState } from './pluginState/ContentModelCachePluginState';\nexport {\n ContentModelFormatPluginState,\n PendingFormat,\n} from './pluginState/ContentModelFormatPluginState';\nexport { CopyPastePluginState } from './pluginState/CopyPastePluginState';\nexport { DOMEventPluginState } from './pluginState/DOMEventPluginState';\nexport { LifecyclePluginState } from './pluginState/LifecyclePluginState';\nexport { EntityPluginState, KnownEntityItem } from './pluginState/EntityPluginState';\nexport { SelectionPluginState } from './pluginState/SelectionPluginState';\nexport { UndoPluginState } from './pluginState/UndoPluginState';\nexport {\n PluginKey,\n KeyOfStatePlugin,\n TypeOfStatePlugin,\n StatePluginKeys,\n GenericPluginState,\n PluginState,\n} from './pluginState/PluginState';\n\nexport { EditorEnvironment } from './parameter/EditorEnvironment';\nexport {\n EntityState,\n DeletedEntity,\n FormatWithContentModelContext,\n} from './parameter/FormatWithContentModelContext';\nexport {\n FormatWithContentModelOptions,\n ContentModelFormatter,\n} from './parameter/FormatWithContentModelOptions';\nexport { ContentModelFormatState } from './parameter/ContentModelFormatState';\nexport { ImageFormatState } from './parameter/ImageFormatState';\nexport { Border } from './parameter/Border';\nexport { InsertEntityOptions } from './parameter/InsertEntityOptions';\nexport {\n DeleteSelectionContext,\n DeleteSelectionResult,\n DeleteSelectionStep,\n ValidDeleteSelectionContext,\n} from './parameter/DeleteSelectionStep';\nexport {\n SnapshotSelectionBase,\n RangeSnapshotSelection,\n ImageSnapshotSelection,\n TableSnapshotSelection,\n SnapshotSelection,\n Snapshot,\n Snapshots,\n} from './parameter/Snapshot';\nexport { SnapshotsManager } from './parameter/SnapshotsManager';\nexport { DOMEventHandlerFunction, DOMEventRecord } from './parameter/DOMEventRecord';\nexport { EdgeLinkPreview } from './parameter/EdgeLinkPreview';\nexport { ClipboardData } from './parameter/ClipboardData';\nexport { AnnounceData, KnownAnnounceStrings } from './parameter/AnnounceData';\nexport { TrustedHTMLHandler } from './parameter/TrustedHTMLHandler';\nexport { Rect } from './parameter/Rect';\nexport { ValueSanitizer } from './parameter/ValueSanitizer';\n\nexport { BasePluginEvent, BasePluginDomEvent } from './event/BasePluginEvent';\nexport { BeforeCutCopyEvent } from './event/BeforeCutCopyEvent';\nexport { BeforeDisposeEvent } from './event/BeforeDisposeEvent';\nexport { BeforeKeyboardEditingEvent } from './event/BeforeKeyboardEditingEvent';\nexport {\n BeforePasteEvent,\n DomToModelOptionForPaste,\n MergePastedContentFunc,\n} from './event/BeforePasteEvent';\nexport { BeforeSetContentEvent } from './event/BeforeSetContentEvent';\nexport { ContentChangedEvent, ChangedEntity } from './event/ContentChangedEvent';\nexport { ContextMenuEvent } from './event/ContextMenuEvent';\nexport { EditImageEvent } from './event/EditImageEvent';\nexport { EditorReadyEvent } from './event/EditorReadyEvent';\nexport { EntityOperationEvent, Entity } from './event/EntityOperationEvent';\nexport { ExtractContentWithDomEvent } from './event/ExtractContentWithDomEvent';\nexport { EditorInputEvent } from './event/EditorInputEvent';\nexport {\n KeyDownEvent,\n KeyPressEvent,\n KeyUpEvent,\n CompositionEndEvent,\n} from './event/KeyboardEvent';\nexport { MouseDownEvent, MouseUpEvent } from './event/MouseEvent';\nexport { PluginEvent } from './event/PluginEvent';\nexport {\n PluginEventData,\n PluginEventFromTypeGeneric,\n PluginEventFromType,\n PluginEventDataGeneric,\n} from './event/PluginEventData';\nexport { PluginEventType } from './event/PluginEventType';\nexport { ScrollEvent } from './event/ScrollEvent';\nexport { SelectionChangedEvent } from './event/SelectionChangedEvent';\nexport { EnterShadowEditEvent, LeaveShadowEditEvent } from './event/ShadowEditEvent';\nexport { ZoomChangedEvent } from './event/ZoomChangedEvent';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages-content-model/roosterjs-content-model-types/lib/index.ts"],"names":[],"mappings":"","sourcesContent":["export { ContentModelSegmentFormat } from './format/ContentModelSegmentFormat';\nexport { ContentModelWithFormat } from './format/ContentModelWithFormat';\nexport { ContentModelTableFormat } from './format/ContentModelTableFormat';\nexport { ContentModelWithDataset } from './format/ContentModelWithDataset';\nexport { ContentModelBlockFormat } from './format/ContentModelBlockFormat';\nexport { ContentModelTableCellFormat } from './format/ContentModelTableCellFormat';\nexport { ContentModelListItemFormat } from './format/ContentModelListItemFormat';\nexport { ContentModelListItemLevelFormat } from './format/ContentModelListItemLevelFormat';\nexport { ContentModelHyperLinkFormat } from './format/ContentModelHyperLinkFormat';\nexport { ContentModelCodeFormat } from './format/ContentModelCodeFormat';\nexport { ContentModelFormatContainerFormat } from './format/ContentModelFormatContainerFormat';\nexport { ContentModelDividerFormat } from './format/ContentModelDividerFormat';\nexport { ContentModelFormatBase } from './format/ContentModelFormatBase';\nexport { ContentModelFormatMap } from './format/ContentModelFormatMap';\nexport { ContentModelImageFormat } from './format/ContentModelImageFormat';\nexport { ContentModelEntityFormat } from './format/ContentModelEntityFormat';\nexport { FormatHandlerTypeMap, FormatKey } from './format/FormatHandlerTypeMap';\n\nexport { BackgroundColorFormat } from './format/formatParts/BackgroundColorFormat';\nexport { BoldFormat } from './format/formatParts/BoldFormat';\nexport { FontFamilyFormat } from './format/formatParts/FontFamilyFormat';\nexport { FontSizeFormat } from './format/formatParts/FontSizeFormat';\nexport { ItalicFormat } from './format/formatParts/ItalicFormat';\nexport { LetterSpacingFormat } from './format/formatParts/LetterSpacingFormat';\nexport { LineHeightFormat } from './format/formatParts/LineHeightFormat';\nexport { StrikeFormat } from './format/formatParts/StrikeFormat';\nexport { SuperOrSubScriptFormat } from './format/formatParts/SuperOrSubScriptFormat';\nexport { TextColorFormat } from './format/formatParts/TextColorFormat';\nexport { UnderlineFormat } from './format/formatParts/UnderlineFormat';\nexport { BorderBoxFormat } from './format/formatParts/BorderBoxFormat';\nexport { VerticalAlignFormat } from './format/formatParts/VerticalAlignFormat';\nexport { WordBreakFormat } from './format/formatParts/WordBreakFormat';\nexport { BorderFormat } from './format/formatParts/BorderFormat';\nexport { DirectionFormat } from './format/formatParts/DirectionFormat';\nexport { HtmlAlignFormat } from './format/formatParts/HtmlAlignFormat';\nexport { MarginFormat } from './format/formatParts/MarginFormat';\nexport { PaddingFormat } from './format/formatParts/PaddingFormat';\nexport { TextAlignFormat } from './format/formatParts/TextAlignFormat';\nexport { TextIndentFormat } from './format/formatParts/TextIndentFormat';\nexport { WhiteSpaceFormat } from './format/formatParts/WhiteSpaceFormat';\nexport { DisplayFormat } from './format/formatParts/DisplayFormat';\nexport { IdFormat } from './format/formatParts/IdFormat';\nexport { SpacingFormat } from './format/formatParts/SpacingFormat';\nexport { TableLayoutFormat } from './format/formatParts/TableLayoutFormat';\nexport { LinkFormat } from './format/formatParts/LinkFormat';\nexport { SizeFormat } from './format/formatParts/SizeFormat';\nexport { BoxShadowFormat } from './format/formatParts/BoxShadowFormat';\nexport { ListThreadFormat } from './format/formatParts/ListThreadFormat';\nexport { ListStyleFormat } from './format/formatParts/ListStyleFormat';\nexport { FloatFormat } from './format/formatParts/FloatFormat';\nexport { EntityInfoFormat } from './format/formatParts/EntityInfoFormat';\n\nexport { DatasetFormat } from './format/metadata/DatasetFormat';\nexport { TableMetadataFormat } from './format/metadata/TableMetadataFormat';\nexport { ListMetadataFormat } from './format/metadata/ListMetadataFormat';\nexport {\n ImageResizeMetadataFormat,\n ImageCropMetadataFormat,\n ImageMetadataFormat,\n ImageRotateMetadataFormat,\n} from './format/metadata/ImageMetadataFormat';\nexport { TableCellMetadataFormat } from './format/metadata/TableCellMetadataFormat';\n\nexport { ContentModelBlockGroupType } from './enum/BlockGroupType';\nexport { ContentModelBlockType } from './enum/BlockType';\nexport { ContentModelSegmentType } from './enum/SegmentType';\nexport {\n EntityLifecycleOperation,\n EntityOperation,\n EntityRemovalOperation,\n} from './enum/EntityOperation';\nexport {\n TableOperation,\n TableVerticalInsertOperation,\n TableHorizontalInsertOperation,\n TableDeleteOperation,\n TableVerticalMergeOperation,\n TableHorizontalMergeOperation,\n TableCellMergeOperation,\n TableSplitOperation,\n TableAlignOperation,\n TableCellHorizontalAlignOperation,\n TableCellVerticalAlignOperation,\n} from './enum/TableOperation';\nexport { PasteType } from './enum/PasteType';\nexport { BorderOperations } from './enum/BorderOperations';\nexport { DeleteResult } from './enum/DeleteResult';\nexport { InsertEntityPosition } from './enum/InsertEntityPosition';\n\nexport { ContentModelBlock } from './block/ContentModelBlock';\nexport { ContentModelParagraph } from './block/ContentModelParagraph';\nexport { ContentModelTable } from './block/ContentModelTable';\nexport { ContentModelDivider } from './block/ContentModelDivider';\nexport { ContentModelBlockBase } from './block/ContentModelBlockBase';\nexport { ContentModelBlockWithCache } from './block/ContentModelBlockWithCache';\nexport { ContentModelTableRow } from './block/ContentModelTableRow';\n\nexport { ContentModelEntity } from './entity/ContentModelEntity';\n\nexport { ContentModelDocument } from './group/ContentModelDocument';\nexport { ContentModelBlockGroupBase } from './group/ContentModelBlockGroupBase';\nexport { ContentModelFormatContainer } from './group/ContentModelFormatContainer';\nexport { ContentModelGeneralBlock } from './group/ContentModelGeneralBlock';\nexport { ContentModelListItem } from './group/ContentModelListItem';\nexport { ContentModelTableCell } from './group/ContentModelTableCell';\nexport { ContentModelBlockGroup } from './group/ContentModelBlockGroup';\n\nexport { ContentModelBr } from './segment/ContentModelBr';\nexport { ContentModelGeneralSegment } from './segment/ContentModelGeneralSegment';\nexport { ContentModelImage } from './segment/ContentModelImage';\nexport { ContentModelText } from './segment/ContentModelText';\nexport { ContentModelSelectionMarker } from './segment/ContentModelSelectionMarker';\nexport { ContentModelSegmentBase } from './segment/ContentModelSegmentBase';\nexport { ContentModelSegment } from './segment/ContentModelSegment';\n\nexport { ContentModelCode } from './decorator/ContentModelCode';\nexport { ContentModelLink } from './decorator/ContentModelLink';\nexport { ContentModelParagraphDecorator } from './decorator/ContentModelParagraphDecorator';\nexport { ContentModelDecorator } from './decorator/ContentModelDecorator';\nexport { ContentModelListLevel } from './decorator/ContentModelListLevel';\n\nexport { Selectable } from './selection/Selectable';\nexport {\n DOMSelection,\n SelectionType,\n SelectionBase,\n ImageSelection,\n RangeSelection,\n TableSelection,\n} from './selection/DOMSelection';\nexport { InsertPoint } from './selection/InsertPoint';\nexport { TableSelectionContext } from './selection/TableSelectionContext';\nexport { TableSelectionCoordinates } from './selection/TableSelectionCoordinates';\n\nexport {\n ContentModelHandlerMap,\n DefaultImplicitFormatMap,\n FormatAppliers,\n FormatAppliersPerCategory,\n OnNodeCreated,\n ModelToDomSettings,\n FormatApplier,\n ApplyMetadata,\n MetadataApplier,\n MetadataAppliers,\n TextFormatApplier,\n ElementFormatAppliersPerCategory,\n} from './context/ModelToDomSettings';\nexport {\n DefaultStyleMap,\n ElementProcessorMap,\n FormatParsers,\n FormatParsersPerCategory,\n DomToModelSettings,\n FormatParser,\n TextFormatParser,\n ElementFormatParserPerCategory,\n} from './context/DomToModelSettings';\nexport { DomToModelContext } from './context/DomToModelContext';\nexport { ElementProcessor } from './context/ElementProcessor';\nexport { DomToModelSelectionContext } from './context/DomToModelSelectionContext';\nexport { EditorContext } from './context/EditorContext';\nexport {\n DomToModelFormatContext,\n DomToModelDecoratorContext,\n DomToModelListFormat,\n} from './context/DomToModelFormatContext';\nexport { ModelToDomContext } from './context/ModelToDomContext';\nexport {\n ModelToDomBlockAndSegmentNode,\n ModelToDomRegularSelection,\n ModelToDomSelectionContext,\n} from './context/ModelToDomSelectionContext';\nexport {\n ModelToDomListStackItem,\n ModelToDomListContext,\n ModelToDomFormatContext,\n} from './context/ModelToDomFormatContext';\nexport {\n ContentModelHandler,\n ContentModelSegmentHandler,\n ContentModelBlockHandler,\n} from './context/ContentModelHandler';\nexport { DomToModelOption } from './context/DomToModelOption';\nexport { ModelToDomOption } from './context/ModelToDomOption';\nexport { ContentModelDomIndexer } from './context/ContentModelDomIndexer';\nexport { TextMutationObserver } from './context/TextMutationObserver';\n\nexport { DefinitionType } from './metadata/DefinitionType';\nexport {\n ArrayItemType,\n DefinitionBase,\n StringDefinition,\n NumberDefinition,\n BooleanDefinition,\n ArrayDefinition,\n ObjectPropertyDefinition,\n ObjectDefinition,\n Definition,\n} from './metadata/Definition';\nexport { DarkColorHandler, Colors, ColorTransformFunction } from './context/DarkColorHandler';\n\nexport { IStandaloneEditor } from './editor/IStandaloneEditor';\nexport { StandaloneEditorOptions } from './editor/StandaloneEditorOptions';\nexport {\n CreateContentModel,\n CreateEditorContext,\n GetDOMSelection,\n SetContentModel,\n SetDOMSelection,\n FormatContentModel,\n StandaloneCoreApiMap,\n StandaloneEditorCore,\n ContentModelSettings,\n SwitchShadowEdit,\n TriggerEvent,\n AddUndoSnapshot,\n HasFocus,\n Focus,\n AttachDomEvent,\n RestoreUndoSnapshot,\n GetVisibleViewport,\n Paste,\n} from './editor/StandaloneEditorCore';\nexport { StandaloneEditorCorePlugins } from './editor/StandaloneEditorCorePlugins';\nexport { EditorPlugin } from './editor/EditorPlugin';\nexport { PluginWithState } from './editor/PluginWithState';\nexport { ContextMenuProvider } from './editor/ContextMenuProvider';\n\nexport { ContentModelCachePluginState } from './pluginState/ContentModelCachePluginState';\nexport {\n ContentModelFormatPluginState,\n PendingFormat,\n} from './pluginState/ContentModelFormatPluginState';\nexport { CopyPastePluginState } from './pluginState/CopyPastePluginState';\nexport { DOMEventPluginState } from './pluginState/DOMEventPluginState';\nexport { LifecyclePluginState } from './pluginState/LifecyclePluginState';\nexport { EntityPluginState, KnownEntityItem } from './pluginState/EntityPluginState';\nexport { SelectionPluginState } from './pluginState/SelectionPluginState';\nexport { UndoPluginState } from './pluginState/UndoPluginState';\nexport {\n PluginKey,\n KeyOfStatePlugin,\n TypeOfStatePlugin,\n StatePluginKeys,\n GenericPluginState,\n PluginState,\n} from './pluginState/PluginState';\nexport { ContextMenuPluginState } from './pluginState/ContextMenuPluginState';\n\nexport { EditorEnvironment } from './parameter/EditorEnvironment';\nexport {\n EntityState,\n DeletedEntity,\n FormatWithContentModelContext,\n} from './parameter/FormatWithContentModelContext';\nexport {\n FormatWithContentModelOptions,\n ContentModelFormatter,\n} from './parameter/FormatWithContentModelOptions';\nexport { ContentModelFormatState } from './parameter/ContentModelFormatState';\nexport { ImageFormatState } from './parameter/ImageFormatState';\nexport { Border } from './parameter/Border';\nexport { InsertEntityOptions } from './parameter/InsertEntityOptions';\nexport {\n DeleteSelectionContext,\n DeleteSelectionResult,\n DeleteSelectionStep,\n ValidDeleteSelectionContext,\n} from './parameter/DeleteSelectionStep';\nexport {\n SnapshotSelectionBase,\n RangeSnapshotSelection,\n ImageSnapshotSelection,\n TableSnapshotSelection,\n SnapshotSelection,\n Snapshot,\n Snapshots,\n} from './parameter/Snapshot';\nexport { SnapshotsManager } from './parameter/SnapshotsManager';\nexport { DOMEventHandlerFunction, DOMEventRecord } from './parameter/DOMEventRecord';\nexport { EdgeLinkPreview } from './parameter/EdgeLinkPreview';\nexport { ClipboardData } from './parameter/ClipboardData';\nexport { AnnounceData, KnownAnnounceStrings } from './parameter/AnnounceData';\nexport { TrustedHTMLHandler } from './parameter/TrustedHTMLHandler';\nexport { Rect } from './parameter/Rect';\nexport { ValueSanitizer } from './parameter/ValueSanitizer';\nexport { DOMHelper } from './parameter/DOMHelper';\n\nexport { BasePluginEvent, BasePluginDomEvent } from './event/BasePluginEvent';\nexport { BeforeCutCopyEvent } from './event/BeforeCutCopyEvent';\nexport { BeforeDisposeEvent } from './event/BeforeDisposeEvent';\nexport { BeforeKeyboardEditingEvent } from './event/BeforeKeyboardEditingEvent';\nexport {\n BeforePasteEvent,\n DomToModelOptionForPaste,\n MergePastedContentFunc,\n} from './event/BeforePasteEvent';\nexport { BeforeSetContentEvent } from './event/BeforeSetContentEvent';\nexport { ContentChangedEvent, ChangedEntity } from './event/ContentChangedEvent';\nexport { ContextMenuEvent } from './event/ContextMenuEvent';\nexport { EditImageEvent } from './event/EditImageEvent';\nexport { EditorReadyEvent } from './event/EditorReadyEvent';\nexport { EntityOperationEvent, Entity } from './event/EntityOperationEvent';\nexport { ExtractContentWithDomEvent } from './event/ExtractContentWithDomEvent';\nexport { EditorInputEvent } from './event/EditorInputEvent';\nexport {\n KeyDownEvent,\n KeyPressEvent,\n KeyUpEvent,\n CompositionEndEvent,\n} from './event/KeyboardEvent';\nexport { MouseDownEvent, MouseUpEvent } from './event/MouseEvent';\nexport { PluginEvent } from './event/PluginEvent';\nexport {\n PluginEventData,\n PluginEventFromTypeGeneric,\n PluginEventFromType,\n PluginEventDataGeneric,\n} from './event/PluginEventData';\nexport { PluginEventType } from './event/PluginEventType';\nexport { ScrollEvent } from './event/ScrollEvent';\nexport { SelectionChangedEvent } from './event/SelectionChangedEvent';\nexport { EnterShadowEditEvent, LeaveShadowEditEvent } from './event/ShadowEditEvent';\nexport { ZoomChangedEvent } from './event/ZoomChangedEvent';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentModelFormatState.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/parameter/ContentModelFormatState.ts"],"names":[],"mappings":"","sourcesContent":["import type { TableMetadataFormat } from '../format/metadata/TableMetadataFormat';\nimport type { ImageFormatState } from './ImageFormatState';\n\n/**\n * The format object state in Content Model\n */\nexport interface ContentModelFormatState {\n /**\n * Whether the text is bolded\n */\n isBold?: boolean;\n\n /**\n * Whether the text is italic\n */\n isItalic?: boolean;\n\n /**\n * Whether the text has underline\n */\n isUnderline?: boolean;\n\n /**\n * Whether the text has strike through line\n */\n isStrikeThrough?: boolean;\n\n /**\n * Whether the text is in subscript mode\n */\n isSubscript?: boolean;\n\n /**\n * Whether the text is in superscript mode\n */\n isSuperscript?: boolean;\n\n /**\n * Whether the text is in bullet mode\n */\n isBullet?: boolean;\n\n /**\n * Whether the text is in numbering mode\n */\n isNumbering?: boolean;\n\n /**\n * Whether the text is in block quote\n */\n isBlockQuote?: boolean;\n\n /**\n * Whether the text is in Code element\n */\n isCodeInline?: boolean;\n\n /**\n * Whether the text is in Code block\n */\n isCodeBlock?: boolean;\n\n /**\n * Whether unlink command can be called to the text\n */\n canUnlink?: boolean;\n\n /**\n * Whether the selected text is multiline\n */\n isMultilineSelection?: boolean;\n\n /**\n * Whether add image alt text command can be called to the text\n */\n canAddImageAltText?: boolean;\n\n /**\n * Heading level (0-6, 0 means no heading)\n */\n headingLevel?: number;\n\n /**\n * Whether the cursor is in table\n */\n isInTable?: boolean;\n\n /**\n * Format of table, if there is table at cursor position\n */\n tableFormat?: TableMetadataFormat;\n\n /**\n * If there is a table, whether the table has header row\n */\n tableHasHeader?: boolean;\n\n /**\n * Whether we can execute table cell merge operation\n */\n canMergeTableCell?: boolean;\n\n /**\n * Font name\n */\n fontName?: string;\n\n /**\n * Font size\n */\n fontSize?: string;\n\n /**\n * Background color\n */\n backgroundColor?: string;\n\n /**\n * Text color\n */\n textColor?: string;\n\n /**\n * Line height\n */\n lineHeight?: string;\n\n /**\n * Margin Top\n */\n marginTop?: string;\n\n /**\n * Margin Bottom\n */\n marginBottom?: string;\n\n /**\n * Text Align\n */\n textAlign?: string;\n\n /**\n * Direction of the element ('ltr' or 'rtl')\n */\n direction?: string;\n\n /**\n * Font weight\n */\n fontWeight?: string;\n\n /**\n * Format of image, if there is table at cursor position\n */\n imageFormat?: ImageFormatState;\n\n /**\n * Letter spacing\n */\n letterSpacing?: string;\n\n /**\n * Whether the content can be undone\n */\n canUndo?: boolean;\n\n /**\n * Whether the content ca nbe redone\n */\n canRedo?: boolean;\n\n /**\n * Whether editor is in dark mode\n */\n isDarkMode?: boolean;\n
|
|
1
|
+
{"version":3,"file":"ContentModelFormatState.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/parameter/ContentModelFormatState.ts"],"names":[],"mappings":"","sourcesContent":["import type { TableMetadataFormat } from '../format/metadata/TableMetadataFormat';\nimport type { ImageFormatState } from './ImageFormatState';\n\n/**\n * The format object state in Content Model\n */\nexport interface ContentModelFormatState {\n /**\n * Whether the text is bolded\n */\n isBold?: boolean;\n\n /**\n * Whether the text is italic\n */\n isItalic?: boolean;\n\n /**\n * Whether the text has underline\n */\n isUnderline?: boolean;\n\n /**\n * Whether the text has strike through line\n */\n isStrikeThrough?: boolean;\n\n /**\n * Whether the text is in subscript mode\n */\n isSubscript?: boolean;\n\n /**\n * Whether the text is in superscript mode\n */\n isSuperscript?: boolean;\n\n /**\n * Whether the text is in bullet mode\n */\n isBullet?: boolean;\n\n /**\n * Whether the text is in numbering mode\n */\n isNumbering?: boolean;\n\n /**\n * Whether the text is in block quote\n */\n isBlockQuote?: boolean;\n\n /**\n * Whether the text is in Code element\n */\n isCodeInline?: boolean;\n\n /**\n * Whether the text is in Code block\n */\n isCodeBlock?: boolean;\n\n /**\n * Whether unlink command can be called to the text\n */\n canUnlink?: boolean;\n\n /**\n * Whether the selected text is multiline\n */\n isMultilineSelection?: boolean;\n\n /**\n * Whether add image alt text command can be called to the text\n */\n canAddImageAltText?: boolean;\n\n /**\n * Heading level (0-6, 0 means no heading)\n */\n headingLevel?: number;\n\n /**\n * Whether the cursor is in table\n */\n isInTable?: boolean;\n\n /**\n * Format of table, if there is table at cursor position\n */\n tableFormat?: TableMetadataFormat;\n\n /**\n * If there is a table, whether the table has header row\n */\n tableHasHeader?: boolean;\n\n /**\n * Whether we can execute table cell merge operation\n */\n canMergeTableCell?: boolean;\n\n /**\n * Font name\n */\n fontName?: string;\n\n /**\n * Font size\n */\n fontSize?: string;\n\n /**\n * Background color\n */\n backgroundColor?: string;\n\n /**\n * Text color\n */\n textColor?: string;\n\n /**\n * Line height\n */\n lineHeight?: string;\n\n /**\n * Margin Top\n */\n marginTop?: string;\n\n /**\n * Margin Bottom\n */\n marginBottom?: string;\n\n /**\n * Text Align\n */\n textAlign?: string;\n\n /**\n * Direction of the element ('ltr' or 'rtl')\n */\n direction?: string;\n\n /**\n * Font weight\n */\n fontWeight?: string;\n\n /**\n * Format of image, if there is table at cursor position\n */\n imageFormat?: ImageFormatState;\n\n /**\n * Letter spacing\n */\n letterSpacing?: string;\n\n /**\n * Whether the content can be undone\n */\n canUndo?: boolean;\n\n /**\n * Whether the content ca nbe redone\n */\n canRedo?: boolean;\n\n /**\n * Whether editor is in dark mode\n */\n isDarkMode?: boolean;\n}\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A helper class to provide DOM access APIs
|
|
3
|
+
*/
|
|
4
|
+
export interface DOMHelper {
|
|
5
|
+
/**
|
|
6
|
+
* Check if the given DOM node is in editor
|
|
7
|
+
* @param node The node to check
|
|
8
|
+
*/
|
|
9
|
+
isNodeInEditor(node: Node): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Query HTML elements in editor by tag name.
|
|
12
|
+
* Be careful of this function since it will also return element under entity.
|
|
13
|
+
* @param tag Tag name of the element to query
|
|
14
|
+
* @returns HTML Element array of the query result
|
|
15
|
+
*/
|
|
16
|
+
queryElements<TTag extends keyof HTMLElementTagNameMap>(tag: TTag): HTMLElementTagNameMap[TTag][];
|
|
17
|
+
/**
|
|
18
|
+
* Query HTML elements in editor by a selector string
|
|
19
|
+
* Be careful of this function since it will also return element under entity.
|
|
20
|
+
* @param selector Selector string to query
|
|
21
|
+
* @returns HTML Element array of the query result
|
|
22
|
+
*/
|
|
23
|
+
queryElements(selector: string): HTMLElement[];
|
|
24
|
+
/**
|
|
25
|
+
* Calculate current zoom scale of editor
|
|
26
|
+
*/
|
|
27
|
+
calculateZoomScale(): number;
|
|
28
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DOMHelper.js","sourceRoot":"","sources":["../../../../packages-content-model/roosterjs-content-model-types/lib/parameter/DOMHelper.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * A helper class to provide DOM access APIs\n */\nexport interface DOMHelper {\n /**\n * Check if the given DOM node is in editor\n * @param node The node to check\n */\n isNodeInEditor(node: Node): boolean;\n\n /**\n * Query HTML elements in editor by tag name.\n * Be careful of this function since it will also return element under entity.\n * @param tag Tag name of the element to query\n * @returns HTML Element array of the query result\n */\n queryElements<TTag extends keyof HTMLElementTagNameMap>(\n tag: TTag\n ): HTMLElementTagNameMap[TTag][];\n\n /**\n * Query HTML elements in editor by a selector string\n * Be careful of this function since it will also return element under entity.\n * @param selector Selector string to query\n * @returns HTML Element array of the query result\n */\n queryElements(selector: string): HTMLElement[];\n\n /**\n * Calculate current zoom scale of editor\n */\n calculateZoomScale(): number;\n}\n"]}
|
|
@@ -22,6 +22,11 @@ export interface RangeSnapshotSelection extends SnapshotSelectionBase<'range'> {
|
|
|
22
22
|
* End path of selection
|
|
23
23
|
*/
|
|
24
24
|
end: number[];
|
|
25
|
+
/**
|
|
26
|
+
* Whether the selection was from left to right (in document order) or
|
|
27
|
+
* right to left (reverse of document order)
|
|
28
|
+
*/
|
|
29
|
+
isReverted: boolean;
|
|
25
30
|
}
|
|
26
31
|
/**
|
|
27
32
|
* Undo snapshot selection from table
|