roosterjs-content-model-types 9.33.0 → 9.35.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.
@@ -30,4 +30,8 @@ export declare type ExperimentalFeature =
30
30
  * selection marker may be recreated during reconciliation, potentially losing its original formatting. This feature ensures
31
31
  * the original formatting of the selection marker is kept to match the pending format.
32
32
  */
33
- | 'KeepSelectionMarkerWhenEnteringTextNode';
33
+ | 'KeepSelectionMarkerWhenEnteringTextNode'
34
+ /**
35
+ * Export editor content as HTML using HTMLFast option
36
+ */
37
+ | 'ExportHTMLFast';
@@ -1 +1 @@
1
- {"version":3,"file":"ExperimentalFeature.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/editor/ExperimentalFeature.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Predefined experiment features\n * By default these features are not enabled. To enable them, pass the feature name into EditorOptions.experimentalFeatures\n * when create editor\n */\nexport type ExperimentalFeature =\n /**\n * When this feature is enabled, we will persist a content model in memory as long as we can,\n * and use cached element when write back if it is not changed.\n */\n | 'PersistCache'\n /**\n * @deprecated\n * Workaround for the Legacy Image Edit\n */\n | 'LegacyImageSelection'\n /**\n * @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options\n * Use Content Model handle ENTER key\n */\n | 'HandleEnterKey'\n /**\n * Prevent default browser behavior for copy/cut event,\n * and set the clipboard data with custom implementation.\n */\n | 'CustomCopyCut'\n /**\n * For CJK keyboard input on mobile, if the user toggles bold/italic/underline on an empty div,\n * the pending format will be applied on the selection marker. When typing text, the selection moves to the text node and the\n * selection marker may be recreated during reconciliation, potentially losing its original formatting. This feature ensures\n * the original formatting of the selection marker is kept to match the pending format.\n */\n | 'KeepSelectionMarkerWhenEnteringTextNode';\n"]}
1
+ {"version":3,"file":"ExperimentalFeature.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/editor/ExperimentalFeature.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Predefined experiment features\n * By default these features are not enabled. To enable them, pass the feature name into EditorOptions.experimentalFeatures\n * when create editor\n */\nexport type ExperimentalFeature =\n /**\n * When this feature is enabled, we will persist a content model in memory as long as we can,\n * and use cached element when write back if it is not changed.\n */\n | 'PersistCache'\n /**\n * @deprecated\n * Workaround for the Legacy Image Edit\n */\n | 'LegacyImageSelection'\n /**\n * @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options\n * Use Content Model handle ENTER key\n */\n | 'HandleEnterKey'\n /**\n * Prevent default browser behavior for copy/cut event,\n * and set the clipboard data with custom implementation.\n */\n | 'CustomCopyCut'\n /**\n * For CJK keyboard input on mobile, if the user toggles bold/italic/underline on an empty div,\n * the pending format will be applied on the selection marker. When typing text, the selection moves to the text node and the\n * selection marker may be recreated during reconciliation, potentially losing its original formatting. This feature ensures\n * the original formatting of the selection marker is kept to match the pending format.\n */\n | 'KeepSelectionMarkerWhenEnteringTextNode'\n\n /**\n * Export editor content as HTML using HTMLFast option\n */\n | 'ExportHTMLFast';\n"]}
@@ -61,7 +61,11 @@ export interface ContentChangedEvent extends BasePluginEvent<'contentChanged'> {
61
61
  */
62
62
  readonly formatApiName?: string;
63
63
  /**
64
- * @deprecated Call editor.announce(announceData) directly insteaad
64
+ * When set to true, the change will not be added to the undo stack
65
+ */
66
+ readonly skipUndo?: boolean;
67
+ /**
68
+ * @deprecated Call editor.announce(announceData) directly instead
65
69
  */
66
70
  readonly announceData?: AnnounceData;
67
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContentChangedEvent.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/event/ContentChangedEvent.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnnounceData } from '../parameter/AnnounceData';\nimport type { BasePluginEvent } from './BasePluginEvent';\nimport type { EntityState } from '../parameter/FormatContentModelContext';\nimport type { ContentModelEntity } from '../contentModel/entity/ContentModelEntity';\nimport type { EntityRemovalOperation } from '../enum/EntityOperation';\nimport type { ContentModelDocument } from '../contentModel/blockGroup/ContentModelDocument';\nimport type { DOMSelection } from '../selection/DOMSelection';\n\n/**\n * Represents an entity that has been changed during a content change process\n */\nexport interface ChangedEntity {\n /**\n * The changed entity\n */\n entity: ContentModelEntity;\n\n /**\n * Operation that causes the change\n */\n operation: EntityRemovalOperation | 'newEntity';\n\n /**\n * @optional Raw DOM event that causes the change\n */\n rawEvent?: Event;\n}\n\n/**\n * Represents a change to the editor made by another plugin with content model inside\n */\nexport interface ContentChangedEvent extends BasePluginEvent<'contentChanged'> {\n /**\n * The content model that is applied which causes this content changed event\n */\n readonly contentModel?: ContentModelDocument;\n\n /**\n * Selection range applied to the document\n */\n readonly selection?: DOMSelection;\n\n /**\n * Entities got changed (added or removed) during the content change process\n */\n readonly changedEntities?: ChangedEntity[];\n\n /**\n * Additional state added to the snapshot by plugins\n */\n readonly additionalState?: { [key: string]: string };\n\n /**\n * Entity states related to this event\n */\n readonly entityStates?: EntityState[];\n\n /**\n * Source of the change\n */\n readonly source: string;\n\n /**\n * Optional related data\n */\n readonly data?: any;\n\n /**\n * Optional property to store the format api name when using ChangeSource.Format\n */\n readonly formatApiName?: string;\n\n /**\n * @deprecated Call editor.announce(announceData) directly insteaad\n */\n readonly announceData?: AnnounceData;\n}\n"]}
1
+ {"version":3,"file":"ContentChangedEvent.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/event/ContentChangedEvent.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnnounceData } from '../parameter/AnnounceData';\nimport type { BasePluginEvent } from './BasePluginEvent';\nimport type { EntityState } from '../parameter/FormatContentModelContext';\nimport type { ContentModelEntity } from '../contentModel/entity/ContentModelEntity';\nimport type { EntityRemovalOperation } from '../enum/EntityOperation';\nimport type { ContentModelDocument } from '../contentModel/blockGroup/ContentModelDocument';\nimport type { DOMSelection } from '../selection/DOMSelection';\n\n/**\n * Represents an entity that has been changed during a content change process\n */\nexport interface ChangedEntity {\n /**\n * The changed entity\n */\n entity: ContentModelEntity;\n\n /**\n * Operation that causes the change\n */\n operation: EntityRemovalOperation | 'newEntity';\n\n /**\n * @optional Raw DOM event that causes the change\n */\n rawEvent?: Event;\n}\n\n/**\n * Represents a change to the editor made by another plugin with content model inside\n */\nexport interface ContentChangedEvent extends BasePluginEvent<'contentChanged'> {\n /**\n * The content model that is applied which causes this content changed event\n */\n readonly contentModel?: ContentModelDocument;\n\n /**\n * Selection range applied to the document\n */\n readonly selection?: DOMSelection;\n\n /**\n * Entities got changed (added or removed) during the content change process\n */\n readonly changedEntities?: ChangedEntity[];\n\n /**\n * Additional state added to the snapshot by plugins\n */\n readonly additionalState?: { [key: string]: string };\n\n /**\n * Entity states related to this event\n */\n readonly entityStates?: EntityState[];\n\n /**\n * Source of the change\n */\n readonly source: string;\n\n /**\n * Optional related data\n */\n readonly data?: any;\n\n /**\n * Optional property to store the format api name when using ChangeSource.Format\n */\n readonly formatApiName?: string;\n\n /**\n * When set to true, the change will not be added to the undo stack\n */\n readonly skipUndo?: boolean;\n\n /**\n * @deprecated Call editor.announce(announceData) directly instead\n */\n readonly announceData?: AnnounceData;\n}\n"]}
@@ -16,4 +16,8 @@ export interface DOMEventRecord<E = Event> {
16
16
  * when correlated DOM event is fired
17
17
  */
18
18
  beforeDispatch?: DOMEventHandlerFunction<E> | null;
19
+ /**
20
+ * Whether the event should be captured in the capturing phase.
21
+ */
22
+ capture?: boolean;
19
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DOMEventRecord.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/parameter/DOMEventRecord.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginEventType } from '../event/PluginEventType';\n\n/**\n * Handler function type of DOM event\n */\nexport type DOMEventHandlerFunction<E = Event> = (event: E) => void;\n\n/**\n * DOM event handler object with mapped plugin event type and handler function\n */\nexport interface DOMEventRecord<E = Event> {\n /**\n * Type of plugin event. The DOM event will be mapped with this plugin event type\n */\n pluginEventType?: PluginEventType | null;\n\n /**\n * Handler function. Besides the mapped plugin event type, this function will also be triggered\n * when correlated DOM event is fired\n */\n beforeDispatch?: DOMEventHandlerFunction<E> | null;\n}\n"]}
1
+ {"version":3,"file":"DOMEventRecord.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/parameter/DOMEventRecord.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginEventType } from '../event/PluginEventType';\n\n/**\n * Handler function type of DOM event\n */\nexport type DOMEventHandlerFunction<E = Event> = (event: E) => void;\n\n/**\n * DOM event handler object with mapped plugin event type and handler function\n */\nexport interface DOMEventRecord<E = Event> {\n /**\n * Type of plugin event. The DOM event will be mapped with this plugin event type\n */\n pluginEventType?: PluginEventType | null;\n\n /**\n * Handler function. Besides the mapped plugin event type, this function will also be triggered\n * when correlated DOM event is fired\n */\n beforeDispatch?: DOMEventHandlerFunction<E> | null;\n\n /**\n * Whether the event should be captured in the capturing phase.\n */\n capture?: boolean;\n}\n"]}
@@ -43,11 +43,11 @@ export interface CachePluginState {
43
43
  */
44
44
  paragraphMap?: ParagraphMap & ParagraphIndexer;
45
45
  /**
46
- * @optional Indexer for CachePlugin, to help build backward relationship from DOM node to Content Model
46
+ * Indexer for CachePlugin, to help build backward relationship from DOM node to Content Model
47
47
  */
48
- domIndexer?: DomIndexer;
48
+ domIndexer: DomIndexer;
49
49
  /**
50
- * @optional A wrapper of MutationObserver to help detect text changes in editor
50
+ * A wrapper of MutationObserver to help detect text changes in editor
51
51
  */
52
- textMutationObserver?: TextMutationObserver;
52
+ textMutationObserver: TextMutationObserver;
53
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CachePluginState.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/pluginState/CachePluginState.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextMutationObserver } from '../context/TextMutationObserver';\nimport type { ContentModelDocument } from '../contentModel/blockGroup/ContentModelDocument';\nimport type { DomIndexer } from '../context/DomIndexer';\nimport type {\n DOMInsertPoint,\n ImageSelection,\n SelectionBase,\n TableSelection,\n} from '../selection/DOMSelection';\nimport type { ParagraphIndexer, ParagraphMap } from '../parameter/ParagraphMap';\n\n/**\n * Represents a range selection used for cache. We store the start and end insert point here instead of range itself\n * to prevent range got automatically modified by browser\n */\nexport interface RangeSelectionForCache extends SelectionBase<'range'> {\n /**\n * Start insert point\n */\n start: DOMInsertPoint;\n\n /**\n * End inset point\n */\n end: DOMInsertPoint;\n\n /**\n * Whether the selection was from left to right (in document order) or\n * right to left (reverse of document order)\n */\n isReverted: boolean;\n}\n\n/**\n * Represents a selection used for cache\n */\nexport type CacheSelection = RangeSelectionForCache | ImageSelection | TableSelection;\n\n/**\n * Plugin state for CacheEditPlugin\n */\nexport interface CachePluginState {\n /**\n * Cached selection\n */\n cachedSelection?: CacheSelection | undefined;\n\n /**\n * When reuse Content Model is allowed, we cache the Content Model object here after created\n */\n cachedModel?: ContentModelDocument;\n\n /**\n * A helper class that manages a mapping from paragraph marker to paragraph object.\n */\n paragraphMap?: ParagraphMap & ParagraphIndexer;\n\n /**\n * @optional Indexer for CachePlugin, to help build backward relationship from DOM node to Content Model\n */\n domIndexer?: DomIndexer;\n\n /**\n * @optional A wrapper of MutationObserver to help detect text changes in editor\n */\n textMutationObserver?: TextMutationObserver;\n}\n"]}
1
+ {"version":3,"file":"CachePluginState.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/pluginState/CachePluginState.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextMutationObserver } from '../context/TextMutationObserver';\nimport type { ContentModelDocument } from '../contentModel/blockGroup/ContentModelDocument';\nimport type { DomIndexer } from '../context/DomIndexer';\nimport type {\n DOMInsertPoint,\n ImageSelection,\n SelectionBase,\n TableSelection,\n} from '../selection/DOMSelection';\nimport type { ParagraphIndexer, ParagraphMap } from '../parameter/ParagraphMap';\n\n/**\n * Represents a range selection used for cache. We store the start and end insert point here instead of range itself\n * to prevent range got automatically modified by browser\n */\nexport interface RangeSelectionForCache extends SelectionBase<'range'> {\n /**\n * Start insert point\n */\n start: DOMInsertPoint;\n\n /**\n * End inset point\n */\n end: DOMInsertPoint;\n\n /**\n * Whether the selection was from left to right (in document order) or\n * right to left (reverse of document order)\n */\n isReverted: boolean;\n}\n\n/**\n * Represents a selection used for cache\n */\nexport type CacheSelection = RangeSelectionForCache | ImageSelection | TableSelection;\n\n/**\n * Plugin state for CacheEditPlugin\n */\nexport interface CachePluginState {\n /**\n * Cached selection\n */\n cachedSelection?: CacheSelection | undefined;\n\n /**\n * When reuse Content Model is allowed, we cache the Content Model object here after created\n */\n cachedModel?: ContentModelDocument;\n\n /**\n * A helper class that manages a mapping from paragraph marker to paragraph object.\n */\n paragraphMap?: ParagraphMap & ParagraphIndexer;\n\n /**\n * Indexer for CachePlugin, to help build backward relationship from DOM node to Content Model\n */\n domIndexer: DomIndexer;\n\n /**\n * A wrapper of MutationObserver to help detect text changes in editor\n */\n textMutationObserver: TextMutationObserver;\n}\n"]}
@@ -30,4 +30,8 @@ export declare type ExperimentalFeature =
30
30
  * selection marker may be recreated during reconciliation, potentially losing its original formatting. This feature ensures
31
31
  * the original formatting of the selection marker is kept to match the pending format.
32
32
  */
33
- | 'KeepSelectionMarkerWhenEnteringTextNode';
33
+ | 'KeepSelectionMarkerWhenEnteringTextNode'
34
+ /**
35
+ * Export editor content as HTML using HTMLFast option
36
+ */
37
+ | 'ExportHTMLFast';
@@ -1 +1 @@
1
- {"version":3,"file":"ExperimentalFeature.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/editor/ExperimentalFeature.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Predefined experiment features\n * By default these features are not enabled. To enable them, pass the feature name into EditorOptions.experimentalFeatures\n * when create editor\n */\nexport type ExperimentalFeature =\n /**\n * When this feature is enabled, we will persist a content model in memory as long as we can,\n * and use cached element when write back if it is not changed.\n */\n | 'PersistCache'\n /**\n * @deprecated\n * Workaround for the Legacy Image Edit\n */\n | 'LegacyImageSelection'\n /**\n * @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options\n * Use Content Model handle ENTER key\n */\n | 'HandleEnterKey'\n /**\n * Prevent default browser behavior for copy/cut event,\n * and set the clipboard data with custom implementation.\n */\n | 'CustomCopyCut'\n /**\n * For CJK keyboard input on mobile, if the user toggles bold/italic/underline on an empty div,\n * the pending format will be applied on the selection marker. When typing text, the selection moves to the text node and the\n * selection marker may be recreated during reconciliation, potentially losing its original formatting. This feature ensures\n * the original formatting of the selection marker is kept to match the pending format.\n */\n | 'KeepSelectionMarkerWhenEnteringTextNode';\n"]}
1
+ {"version":3,"file":"ExperimentalFeature.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/editor/ExperimentalFeature.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Predefined experiment features\n * By default these features are not enabled. To enable them, pass the feature name into EditorOptions.experimentalFeatures\n * when create editor\n */\nexport type ExperimentalFeature =\n /**\n * When this feature is enabled, we will persist a content model in memory as long as we can,\n * and use cached element when write back if it is not changed.\n */\n | 'PersistCache'\n /**\n * @deprecated\n * Workaround for the Legacy Image Edit\n */\n | 'LegacyImageSelection'\n /**\n * @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options\n * Use Content Model handle ENTER key\n */\n | 'HandleEnterKey'\n /**\n * Prevent default browser behavior for copy/cut event,\n * and set the clipboard data with custom implementation.\n */\n | 'CustomCopyCut'\n /**\n * For CJK keyboard input on mobile, if the user toggles bold/italic/underline on an empty div,\n * the pending format will be applied on the selection marker. When typing text, the selection moves to the text node and the\n * selection marker may be recreated during reconciliation, potentially losing its original formatting. This feature ensures\n * the original formatting of the selection marker is kept to match the pending format.\n */\n | 'KeepSelectionMarkerWhenEnteringTextNode'\n\n /**\n * Export editor content as HTML using HTMLFast option\n */\n | 'ExportHTMLFast';\n"]}
@@ -61,7 +61,11 @@ export interface ContentChangedEvent extends BasePluginEvent<'contentChanged'> {
61
61
  */
62
62
  readonly formatApiName?: string;
63
63
  /**
64
- * @deprecated Call editor.announce(announceData) directly insteaad
64
+ * When set to true, the change will not be added to the undo stack
65
+ */
66
+ readonly skipUndo?: boolean;
67
+ /**
68
+ * @deprecated Call editor.announce(announceData) directly instead
65
69
  */
66
70
  readonly announceData?: AnnounceData;
67
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContentChangedEvent.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/event/ContentChangedEvent.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnnounceData } from '../parameter/AnnounceData';\nimport type { BasePluginEvent } from './BasePluginEvent';\nimport type { EntityState } from '../parameter/FormatContentModelContext';\nimport type { ContentModelEntity } from '../contentModel/entity/ContentModelEntity';\nimport type { EntityRemovalOperation } from '../enum/EntityOperation';\nimport type { ContentModelDocument } from '../contentModel/blockGroup/ContentModelDocument';\nimport type { DOMSelection } from '../selection/DOMSelection';\n\n/**\n * Represents an entity that has been changed during a content change process\n */\nexport interface ChangedEntity {\n /**\n * The changed entity\n */\n entity: ContentModelEntity;\n\n /**\n * Operation that causes the change\n */\n operation: EntityRemovalOperation | 'newEntity';\n\n /**\n * @optional Raw DOM event that causes the change\n */\n rawEvent?: Event;\n}\n\n/**\n * Represents a change to the editor made by another plugin with content model inside\n */\nexport interface ContentChangedEvent extends BasePluginEvent<'contentChanged'> {\n /**\n * The content model that is applied which causes this content changed event\n */\n readonly contentModel?: ContentModelDocument;\n\n /**\n * Selection range applied to the document\n */\n readonly selection?: DOMSelection;\n\n /**\n * Entities got changed (added or removed) during the content change process\n */\n readonly changedEntities?: ChangedEntity[];\n\n /**\n * Additional state added to the snapshot by plugins\n */\n readonly additionalState?: { [key: string]: string };\n\n /**\n * Entity states related to this event\n */\n readonly entityStates?: EntityState[];\n\n /**\n * Source of the change\n */\n readonly source: string;\n\n /**\n * Optional related data\n */\n readonly data?: any;\n\n /**\n * Optional property to store the format api name when using ChangeSource.Format\n */\n readonly formatApiName?: string;\n\n /**\n * @deprecated Call editor.announce(announceData) directly insteaad\n */\n readonly announceData?: AnnounceData;\n}\n"]}
1
+ {"version":3,"file":"ContentChangedEvent.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/event/ContentChangedEvent.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnnounceData } from '../parameter/AnnounceData';\nimport type { BasePluginEvent } from './BasePluginEvent';\nimport type { EntityState } from '../parameter/FormatContentModelContext';\nimport type { ContentModelEntity } from '../contentModel/entity/ContentModelEntity';\nimport type { EntityRemovalOperation } from '../enum/EntityOperation';\nimport type { ContentModelDocument } from '../contentModel/blockGroup/ContentModelDocument';\nimport type { DOMSelection } from '../selection/DOMSelection';\n\n/**\n * Represents an entity that has been changed during a content change process\n */\nexport interface ChangedEntity {\n /**\n * The changed entity\n */\n entity: ContentModelEntity;\n\n /**\n * Operation that causes the change\n */\n operation: EntityRemovalOperation | 'newEntity';\n\n /**\n * @optional Raw DOM event that causes the change\n */\n rawEvent?: Event;\n}\n\n/**\n * Represents a change to the editor made by another plugin with content model inside\n */\nexport interface ContentChangedEvent extends BasePluginEvent<'contentChanged'> {\n /**\n * The content model that is applied which causes this content changed event\n */\n readonly contentModel?: ContentModelDocument;\n\n /**\n * Selection range applied to the document\n */\n readonly selection?: DOMSelection;\n\n /**\n * Entities got changed (added or removed) during the content change process\n */\n readonly changedEntities?: ChangedEntity[];\n\n /**\n * Additional state added to the snapshot by plugins\n */\n readonly additionalState?: { [key: string]: string };\n\n /**\n * Entity states related to this event\n */\n readonly entityStates?: EntityState[];\n\n /**\n * Source of the change\n */\n readonly source: string;\n\n /**\n * Optional related data\n */\n readonly data?: any;\n\n /**\n * Optional property to store the format api name when using ChangeSource.Format\n */\n readonly formatApiName?: string;\n\n /**\n * When set to true, the change will not be added to the undo stack\n */\n readonly skipUndo?: boolean;\n\n /**\n * @deprecated Call editor.announce(announceData) directly instead\n */\n readonly announceData?: AnnounceData;\n}\n"]}
@@ -16,4 +16,8 @@ export interface DOMEventRecord<E = Event> {
16
16
  * when correlated DOM event is fired
17
17
  */
18
18
  beforeDispatch?: DOMEventHandlerFunction<E> | null;
19
+ /**
20
+ * Whether the event should be captured in the capturing phase.
21
+ */
22
+ capture?: boolean;
19
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DOMEventRecord.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/parameter/DOMEventRecord.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginEventType } from '../event/PluginEventType';\n\n/**\n * Handler function type of DOM event\n */\nexport type DOMEventHandlerFunction<E = Event> = (event: E) => void;\n\n/**\n * DOM event handler object with mapped plugin event type and handler function\n */\nexport interface DOMEventRecord<E = Event> {\n /**\n * Type of plugin event. The DOM event will be mapped with this plugin event type\n */\n pluginEventType?: PluginEventType | null;\n\n /**\n * Handler function. Besides the mapped plugin event type, this function will also be triggered\n * when correlated DOM event is fired\n */\n beforeDispatch?: DOMEventHandlerFunction<E> | null;\n}\n"]}
1
+ {"version":3,"file":"DOMEventRecord.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/parameter/DOMEventRecord.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginEventType } from '../event/PluginEventType';\n\n/**\n * Handler function type of DOM event\n */\nexport type DOMEventHandlerFunction<E = Event> = (event: E) => void;\n\n/**\n * DOM event handler object with mapped plugin event type and handler function\n */\nexport interface DOMEventRecord<E = Event> {\n /**\n * Type of plugin event. The DOM event will be mapped with this plugin event type\n */\n pluginEventType?: PluginEventType | null;\n\n /**\n * Handler function. Besides the mapped plugin event type, this function will also be triggered\n * when correlated DOM event is fired\n */\n beforeDispatch?: DOMEventHandlerFunction<E> | null;\n\n /**\n * Whether the event should be captured in the capturing phase.\n */\n capture?: boolean;\n}\n"]}
@@ -43,11 +43,11 @@ export interface CachePluginState {
43
43
  */
44
44
  paragraphMap?: ParagraphMap & ParagraphIndexer;
45
45
  /**
46
- * @optional Indexer for CachePlugin, to help build backward relationship from DOM node to Content Model
46
+ * Indexer for CachePlugin, to help build backward relationship from DOM node to Content Model
47
47
  */
48
- domIndexer?: DomIndexer;
48
+ domIndexer: DomIndexer;
49
49
  /**
50
- * @optional A wrapper of MutationObserver to help detect text changes in editor
50
+ * A wrapper of MutationObserver to help detect text changes in editor
51
51
  */
52
- textMutationObserver?: TextMutationObserver;
52
+ textMutationObserver: TextMutationObserver;
53
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CachePluginState.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/pluginState/CachePluginState.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextMutationObserver } from '../context/TextMutationObserver';\nimport type { ContentModelDocument } from '../contentModel/blockGroup/ContentModelDocument';\nimport type { DomIndexer } from '../context/DomIndexer';\nimport type {\n DOMInsertPoint,\n ImageSelection,\n SelectionBase,\n TableSelection,\n} from '../selection/DOMSelection';\nimport type { ParagraphIndexer, ParagraphMap } from '../parameter/ParagraphMap';\n\n/**\n * Represents a range selection used for cache. We store the start and end insert point here instead of range itself\n * to prevent range got automatically modified by browser\n */\nexport interface RangeSelectionForCache extends SelectionBase<'range'> {\n /**\n * Start insert point\n */\n start: DOMInsertPoint;\n\n /**\n * End inset point\n */\n end: DOMInsertPoint;\n\n /**\n * Whether the selection was from left to right (in document order) or\n * right to left (reverse of document order)\n */\n isReverted: boolean;\n}\n\n/**\n * Represents a selection used for cache\n */\nexport type CacheSelection = RangeSelectionForCache | ImageSelection | TableSelection;\n\n/**\n * Plugin state for CacheEditPlugin\n */\nexport interface CachePluginState {\n /**\n * Cached selection\n */\n cachedSelection?: CacheSelection | undefined;\n\n /**\n * When reuse Content Model is allowed, we cache the Content Model object here after created\n */\n cachedModel?: ContentModelDocument;\n\n /**\n * A helper class that manages a mapping from paragraph marker to paragraph object.\n */\n paragraphMap?: ParagraphMap & ParagraphIndexer;\n\n /**\n * @optional Indexer for CachePlugin, to help build backward relationship from DOM node to Content Model\n */\n domIndexer?: DomIndexer;\n\n /**\n * @optional A wrapper of MutationObserver to help detect text changes in editor\n */\n textMutationObserver?: TextMutationObserver;\n}\n"]}
1
+ {"version":3,"file":"CachePluginState.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/pluginState/CachePluginState.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextMutationObserver } from '../context/TextMutationObserver';\nimport type { ContentModelDocument } from '../contentModel/blockGroup/ContentModelDocument';\nimport type { DomIndexer } from '../context/DomIndexer';\nimport type {\n DOMInsertPoint,\n ImageSelection,\n SelectionBase,\n TableSelection,\n} from '../selection/DOMSelection';\nimport type { ParagraphIndexer, ParagraphMap } from '../parameter/ParagraphMap';\n\n/**\n * Represents a range selection used for cache. We store the start and end insert point here instead of range itself\n * to prevent range got automatically modified by browser\n */\nexport interface RangeSelectionForCache extends SelectionBase<'range'> {\n /**\n * Start insert point\n */\n start: DOMInsertPoint;\n\n /**\n * End inset point\n */\n end: DOMInsertPoint;\n\n /**\n * Whether the selection was from left to right (in document order) or\n * right to left (reverse of document order)\n */\n isReverted: boolean;\n}\n\n/**\n * Represents a selection used for cache\n */\nexport type CacheSelection = RangeSelectionForCache | ImageSelection | TableSelection;\n\n/**\n * Plugin state for CacheEditPlugin\n */\nexport interface CachePluginState {\n /**\n * Cached selection\n */\n cachedSelection?: CacheSelection | undefined;\n\n /**\n * When reuse Content Model is allowed, we cache the Content Model object here after created\n */\n cachedModel?: ContentModelDocument;\n\n /**\n * A helper class that manages a mapping from paragraph marker to paragraph object.\n */\n paragraphMap?: ParagraphMap & ParagraphIndexer;\n\n /**\n * Indexer for CachePlugin, to help build backward relationship from DOM node to Content Model\n */\n domIndexer: DomIndexer;\n\n /**\n * A wrapper of MutationObserver to help detect text changes in editor\n */\n textMutationObserver: TextMutationObserver;\n}\n"]}
@@ -30,4 +30,8 @@ export declare type ExperimentalFeature =
30
30
  * selection marker may be recreated during reconciliation, potentially losing its original formatting. This feature ensures
31
31
  * the original formatting of the selection marker is kept to match the pending format.
32
32
  */
33
- | 'KeepSelectionMarkerWhenEnteringTextNode';
33
+ | 'KeepSelectionMarkerWhenEnteringTextNode'
34
+ /**
35
+ * Export editor content as HTML using HTMLFast option
36
+ */
37
+ | 'ExportHTMLFast';
@@ -1 +1 @@
1
- {"version":3,"file":"ExperimentalFeature.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/editor/ExperimentalFeature.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Predefined experiment features\n * By default these features are not enabled. To enable them, pass the feature name into EditorOptions.experimentalFeatures\n * when create editor\n */\nexport type ExperimentalFeature =\n /**\n * When this feature is enabled, we will persist a content model in memory as long as we can,\n * and use cached element when write back if it is not changed.\n */\n | 'PersistCache'\n /**\n * @deprecated\n * Workaround for the Legacy Image Edit\n */\n | 'LegacyImageSelection'\n /**\n * @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options\n * Use Content Model handle ENTER key\n */\n | 'HandleEnterKey'\n /**\n * Prevent default browser behavior for copy/cut event,\n * and set the clipboard data with custom implementation.\n */\n | 'CustomCopyCut'\n /**\n * For CJK keyboard input on mobile, if the user toggles bold/italic/underline on an empty div,\n * the pending format will be applied on the selection marker. When typing text, the selection moves to the text node and the\n * selection marker may be recreated during reconciliation, potentially losing its original formatting. This feature ensures\n * the original formatting of the selection marker is kept to match the pending format.\n */\n | 'KeepSelectionMarkerWhenEnteringTextNode';\n"]}
1
+ {"version":3,"file":"ExperimentalFeature.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/editor/ExperimentalFeature.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Predefined experiment features\n * By default these features are not enabled. To enable them, pass the feature name into EditorOptions.experimentalFeatures\n * when create editor\n */\nexport type ExperimentalFeature =\n /**\n * When this feature is enabled, we will persist a content model in memory as long as we can,\n * and use cached element when write back if it is not changed.\n */\n | 'PersistCache'\n /**\n * @deprecated\n * Workaround for the Legacy Image Edit\n */\n | 'LegacyImageSelection'\n /**\n * @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options\n * Use Content Model handle ENTER key\n */\n | 'HandleEnterKey'\n /**\n * Prevent default browser behavior for copy/cut event,\n * and set the clipboard data with custom implementation.\n */\n | 'CustomCopyCut'\n /**\n * For CJK keyboard input on mobile, if the user toggles bold/italic/underline on an empty div,\n * the pending format will be applied on the selection marker. When typing text, the selection moves to the text node and the\n * selection marker may be recreated during reconciliation, potentially losing its original formatting. This feature ensures\n * the original formatting of the selection marker is kept to match the pending format.\n */\n | 'KeepSelectionMarkerWhenEnteringTextNode'\n\n /**\n * Export editor content as HTML using HTMLFast option\n */\n | 'ExportHTMLFast';\n"]}
@@ -61,7 +61,11 @@ export interface ContentChangedEvent extends BasePluginEvent<'contentChanged'> {
61
61
  */
62
62
  readonly formatApiName?: string;
63
63
  /**
64
- * @deprecated Call editor.announce(announceData) directly insteaad
64
+ * When set to true, the change will not be added to the undo stack
65
+ */
66
+ readonly skipUndo?: boolean;
67
+ /**
68
+ * @deprecated Call editor.announce(announceData) directly instead
65
69
  */
66
70
  readonly announceData?: AnnounceData;
67
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ContentChangedEvent.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/event/ContentChangedEvent.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnnounceData } from '../parameter/AnnounceData';\nimport type { BasePluginEvent } from './BasePluginEvent';\nimport type { EntityState } from '../parameter/FormatContentModelContext';\nimport type { ContentModelEntity } from '../contentModel/entity/ContentModelEntity';\nimport type { EntityRemovalOperation } from '../enum/EntityOperation';\nimport type { ContentModelDocument } from '../contentModel/blockGroup/ContentModelDocument';\nimport type { DOMSelection } from '../selection/DOMSelection';\n\n/**\n * Represents an entity that has been changed during a content change process\n */\nexport interface ChangedEntity {\n /**\n * The changed entity\n */\n entity: ContentModelEntity;\n\n /**\n * Operation that causes the change\n */\n operation: EntityRemovalOperation | 'newEntity';\n\n /**\n * @optional Raw DOM event that causes the change\n */\n rawEvent?: Event;\n}\n\n/**\n * Represents a change to the editor made by another plugin with content model inside\n */\nexport interface ContentChangedEvent extends BasePluginEvent<'contentChanged'> {\n /**\n * The content model that is applied which causes this content changed event\n */\n readonly contentModel?: ContentModelDocument;\n\n /**\n * Selection range applied to the document\n */\n readonly selection?: DOMSelection;\n\n /**\n * Entities got changed (added or removed) during the content change process\n */\n readonly changedEntities?: ChangedEntity[];\n\n /**\n * Additional state added to the snapshot by plugins\n */\n readonly additionalState?: { [key: string]: string };\n\n /**\n * Entity states related to this event\n */\n readonly entityStates?: EntityState[];\n\n /**\n * Source of the change\n */\n readonly source: string;\n\n /**\n * Optional related data\n */\n readonly data?: any;\n\n /**\n * Optional property to store the format api name when using ChangeSource.Format\n */\n readonly formatApiName?: string;\n\n /**\n * @deprecated Call editor.announce(announceData) directly insteaad\n */\n readonly announceData?: AnnounceData;\n}\n"]}
1
+ {"version":3,"file":"ContentChangedEvent.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/event/ContentChangedEvent.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnnounceData } from '../parameter/AnnounceData';\nimport type { BasePluginEvent } from './BasePluginEvent';\nimport type { EntityState } from '../parameter/FormatContentModelContext';\nimport type { ContentModelEntity } from '../contentModel/entity/ContentModelEntity';\nimport type { EntityRemovalOperation } from '../enum/EntityOperation';\nimport type { ContentModelDocument } from '../contentModel/blockGroup/ContentModelDocument';\nimport type { DOMSelection } from '../selection/DOMSelection';\n\n/**\n * Represents an entity that has been changed during a content change process\n */\nexport interface ChangedEntity {\n /**\n * The changed entity\n */\n entity: ContentModelEntity;\n\n /**\n * Operation that causes the change\n */\n operation: EntityRemovalOperation | 'newEntity';\n\n /**\n * @optional Raw DOM event that causes the change\n */\n rawEvent?: Event;\n}\n\n/**\n * Represents a change to the editor made by another plugin with content model inside\n */\nexport interface ContentChangedEvent extends BasePluginEvent<'contentChanged'> {\n /**\n * The content model that is applied which causes this content changed event\n */\n readonly contentModel?: ContentModelDocument;\n\n /**\n * Selection range applied to the document\n */\n readonly selection?: DOMSelection;\n\n /**\n * Entities got changed (added or removed) during the content change process\n */\n readonly changedEntities?: ChangedEntity[];\n\n /**\n * Additional state added to the snapshot by plugins\n */\n readonly additionalState?: { [key: string]: string };\n\n /**\n * Entity states related to this event\n */\n readonly entityStates?: EntityState[];\n\n /**\n * Source of the change\n */\n readonly source: string;\n\n /**\n * Optional related data\n */\n readonly data?: any;\n\n /**\n * Optional property to store the format api name when using ChangeSource.Format\n */\n readonly formatApiName?: string;\n\n /**\n * When set to true, the change will not be added to the undo stack\n */\n readonly skipUndo?: boolean;\n\n /**\n * @deprecated Call editor.announce(announceData) directly instead\n */\n readonly announceData?: AnnounceData;\n}\n"]}
@@ -16,4 +16,8 @@ export interface DOMEventRecord<E = Event> {
16
16
  * when correlated DOM event is fired
17
17
  */
18
18
  beforeDispatch?: DOMEventHandlerFunction<E> | null;
19
+ /**
20
+ * Whether the event should be captured in the capturing phase.
21
+ */
22
+ capture?: boolean;
19
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"DOMEventRecord.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/parameter/DOMEventRecord.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginEventType } from '../event/PluginEventType';\n\n/**\n * Handler function type of DOM event\n */\nexport type DOMEventHandlerFunction<E = Event> = (event: E) => void;\n\n/**\n * DOM event handler object with mapped plugin event type and handler function\n */\nexport interface DOMEventRecord<E = Event> {\n /**\n * Type of plugin event. The DOM event will be mapped with this plugin event type\n */\n pluginEventType?: PluginEventType | null;\n\n /**\n * Handler function. Besides the mapped plugin event type, this function will also be triggered\n * when correlated DOM event is fired\n */\n beforeDispatch?: DOMEventHandlerFunction<E> | null;\n}\n"]}
1
+ {"version":3,"file":"DOMEventRecord.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/parameter/DOMEventRecord.ts"],"names":[],"mappings":"","sourcesContent":["import type { PluginEventType } from '../event/PluginEventType';\n\n/**\n * Handler function type of DOM event\n */\nexport type DOMEventHandlerFunction<E = Event> = (event: E) => void;\n\n/**\n * DOM event handler object with mapped plugin event type and handler function\n */\nexport interface DOMEventRecord<E = Event> {\n /**\n * Type of plugin event. The DOM event will be mapped with this plugin event type\n */\n pluginEventType?: PluginEventType | null;\n\n /**\n * Handler function. Besides the mapped plugin event type, this function will also be triggered\n * when correlated DOM event is fired\n */\n beforeDispatch?: DOMEventHandlerFunction<E> | null;\n\n /**\n * Whether the event should be captured in the capturing phase.\n */\n capture?: boolean;\n}\n"]}
@@ -43,11 +43,11 @@ export interface CachePluginState {
43
43
  */
44
44
  paragraphMap?: ParagraphMap & ParagraphIndexer;
45
45
  /**
46
- * @optional Indexer for CachePlugin, to help build backward relationship from DOM node to Content Model
46
+ * Indexer for CachePlugin, to help build backward relationship from DOM node to Content Model
47
47
  */
48
- domIndexer?: DomIndexer;
48
+ domIndexer: DomIndexer;
49
49
  /**
50
- * @optional A wrapper of MutationObserver to help detect text changes in editor
50
+ * A wrapper of MutationObserver to help detect text changes in editor
51
51
  */
52
- textMutationObserver?: TextMutationObserver;
52
+ textMutationObserver: TextMutationObserver;
53
53
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CachePluginState.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/pluginState/CachePluginState.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextMutationObserver } from '../context/TextMutationObserver';\nimport type { ContentModelDocument } from '../contentModel/blockGroup/ContentModelDocument';\nimport type { DomIndexer } from '../context/DomIndexer';\nimport type {\n DOMInsertPoint,\n ImageSelection,\n SelectionBase,\n TableSelection,\n} from '../selection/DOMSelection';\nimport type { ParagraphIndexer, ParagraphMap } from '../parameter/ParagraphMap';\n\n/**\n * Represents a range selection used for cache. We store the start and end insert point here instead of range itself\n * to prevent range got automatically modified by browser\n */\nexport interface RangeSelectionForCache extends SelectionBase<'range'> {\n /**\n * Start insert point\n */\n start: DOMInsertPoint;\n\n /**\n * End inset point\n */\n end: DOMInsertPoint;\n\n /**\n * Whether the selection was from left to right (in document order) or\n * right to left (reverse of document order)\n */\n isReverted: boolean;\n}\n\n/**\n * Represents a selection used for cache\n */\nexport type CacheSelection = RangeSelectionForCache | ImageSelection | TableSelection;\n\n/**\n * Plugin state for CacheEditPlugin\n */\nexport interface CachePluginState {\n /**\n * Cached selection\n */\n cachedSelection?: CacheSelection | undefined;\n\n /**\n * When reuse Content Model is allowed, we cache the Content Model object here after created\n */\n cachedModel?: ContentModelDocument;\n\n /**\n * A helper class that manages a mapping from paragraph marker to paragraph object.\n */\n paragraphMap?: ParagraphMap & ParagraphIndexer;\n\n /**\n * @optional Indexer for CachePlugin, to help build backward relationship from DOM node to Content Model\n */\n domIndexer?: DomIndexer;\n\n /**\n * @optional A wrapper of MutationObserver to help detect text changes in editor\n */\n textMutationObserver?: TextMutationObserver;\n}\n"]}
1
+ {"version":3,"file":"CachePluginState.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/pluginState/CachePluginState.ts"],"names":[],"mappings":"","sourcesContent":["import type { TextMutationObserver } from '../context/TextMutationObserver';\nimport type { ContentModelDocument } from '../contentModel/blockGroup/ContentModelDocument';\nimport type { DomIndexer } from '../context/DomIndexer';\nimport type {\n DOMInsertPoint,\n ImageSelection,\n SelectionBase,\n TableSelection,\n} from '../selection/DOMSelection';\nimport type { ParagraphIndexer, ParagraphMap } from '../parameter/ParagraphMap';\n\n/**\n * Represents a range selection used for cache. We store the start and end insert point here instead of range itself\n * to prevent range got automatically modified by browser\n */\nexport interface RangeSelectionForCache extends SelectionBase<'range'> {\n /**\n * Start insert point\n */\n start: DOMInsertPoint;\n\n /**\n * End inset point\n */\n end: DOMInsertPoint;\n\n /**\n * Whether the selection was from left to right (in document order) or\n * right to left (reverse of document order)\n */\n isReverted: boolean;\n}\n\n/**\n * Represents a selection used for cache\n */\nexport type CacheSelection = RangeSelectionForCache | ImageSelection | TableSelection;\n\n/**\n * Plugin state for CacheEditPlugin\n */\nexport interface CachePluginState {\n /**\n * Cached selection\n */\n cachedSelection?: CacheSelection | undefined;\n\n /**\n * When reuse Content Model is allowed, we cache the Content Model object here after created\n */\n cachedModel?: ContentModelDocument;\n\n /**\n * A helper class that manages a mapping from paragraph marker to paragraph object.\n */\n paragraphMap?: ParagraphMap & ParagraphIndexer;\n\n /**\n * Indexer for CachePlugin, to help build backward relationship from DOM node to Content Model\n */\n domIndexer: DomIndexer;\n\n /**\n * A wrapper of MutationObserver to help detect text changes in editor\n */\n textMutationObserver: TextMutationObserver;\n}\n"]}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "roosterjs-content-model-types",
3
3
  "description": "Types for roosterjs",
4
4
  "dependencies": {},
5
- "version": "9.33.0",
5
+ "version": "9.35.0",
6
6
  "main": "./lib/index.js",
7
7
  "typings": "./lib/index.d.ts",
8
8
  "module": "./lib-mjs/index.js",