roosterjs-content-model-types 9.43.0 → 9.44.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.
@@ -40,6 +40,10 @@ export interface EditorContext {
40
40
  * When pass true, this cached element will be used to create DOM tree back when convert Content Model to DOM
41
41
  */
42
42
  allowCacheElement?: boolean;
43
+ /**
44
+ * Whether to allow caching list item elements separately.
45
+ */
46
+ allowCacheListItem?: boolean;
43
47
  /**
44
48
  * @optional Indexer for content model, to help build backward relationship from DOM node to Content Model
45
49
  */
@@ -1 +1 @@
1
- {"version":3,"file":"EditorContext.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/context/EditorContext.ts"],"names":[],"mappings":"","sourcesContent":["import type { DarkColorHandler } from './DarkColorHandler';\nimport type { DomIndexer } from './DomIndexer';\nimport type { ContentModelSegmentFormat } from '../contentModel/format/ContentModelSegmentFormat';\nimport type { PendingFormat } from '../pluginState/FormatPluginState';\nimport type { ParagraphMap } from '../parameter/ParagraphMap';\n\n/**\n * An editor context interface used by ContentModel PAI\n */\nexport interface EditorContext {\n /**\n * Whether current content is in dark mode\n */\n isDarkMode?: boolean;\n\n /**\n * Default format of editor\n */\n defaultFormat?: ContentModelSegmentFormat;\n\n /**\n * Pending format if any\n */\n pendingFormat?: PendingFormat;\n\n /**\n * Color manager, to help manager color in dark mode\n */\n darkColorHandler?: DarkColorHandler;\n\n /**\n * Whether to handle delimiters in Content Model\n */\n addDelimiterForEntity?: boolean;\n\n /**\n * Zoom scale number\n */\n zoomScale?: number;\n\n /**\n * Whether the content is in Right-to-left from root level\n */\n isRootRtl?: boolean;\n\n /**\n * Whether put the source element into Content Model when possible.\n * When pass true, this cached element will be used to create DOM tree back when convert Content Model to DOM\n */\n allowCacheElement?: boolean;\n\n /**\n * @optional Indexer for content model, to help build backward relationship from DOM node to Content Model\n */\n domIndexer?: DomIndexer;\n\n /**\n * Root Font size in Px.\n */\n rootFontSize?: number;\n\n /**\n * Enabled experimental features\n */\n experimentalFeatures?: ReadonlyArray<string>;\n\n /**\n * A helper class that manages a mapping from paragraph marker to paragraph object.\n */\n paragraphMap?: ParagraphMap;\n\n /**\n * When set to true, size of table will be recalculated when converting from DOM to Content Model.\n */\n recalculateTableSize?: boolean | 'all' | 'selected' | 'none';\n\n /**\n * Width of the editor's editable area in pixels, excluding padding.\n * This value is typically used for layout calculations such as constraining pasted image sizes.\n */\n editorViewWidth?: number;\n}\n"]}
1
+ {"version":3,"file":"EditorContext.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/context/EditorContext.ts"],"names":[],"mappings":"","sourcesContent":["import type { DarkColorHandler } from './DarkColorHandler';\nimport type { DomIndexer } from './DomIndexer';\nimport type { ContentModelSegmentFormat } from '../contentModel/format/ContentModelSegmentFormat';\nimport type { PendingFormat } from '../pluginState/FormatPluginState';\nimport type { ParagraphMap } from '../parameter/ParagraphMap';\n\n/**\n * An editor context interface used by ContentModel PAI\n */\nexport interface EditorContext {\n /**\n * Whether current content is in dark mode\n */\n isDarkMode?: boolean;\n\n /**\n * Default format of editor\n */\n defaultFormat?: ContentModelSegmentFormat;\n\n /**\n * Pending format if any\n */\n pendingFormat?: PendingFormat;\n\n /**\n * Color manager, to help manager color in dark mode\n */\n darkColorHandler?: DarkColorHandler;\n\n /**\n * Whether to handle delimiters in Content Model\n */\n addDelimiterForEntity?: boolean;\n\n /**\n * Zoom scale number\n */\n zoomScale?: number;\n\n /**\n * Whether the content is in Right-to-left from root level\n */\n isRootRtl?: boolean;\n\n /**\n * Whether put the source element into Content Model when possible.\n * When pass true, this cached element will be used to create DOM tree back when convert Content Model to DOM\n */\n allowCacheElement?: boolean;\n\n /**\n * Whether to allow caching list item elements separately.\n */\n allowCacheListItem?: boolean;\n\n /**\n * @optional Indexer for content model, to help build backward relationship from DOM node to Content Model\n */\n domIndexer?: DomIndexer;\n\n /**\n * Root Font size in Px.\n */\n rootFontSize?: number;\n\n /**\n * Enabled experimental features\n */\n experimentalFeatures?: ReadonlyArray<string>;\n\n /**\n * A helper class that manages a mapping from paragraph marker to paragraph object.\n */\n paragraphMap?: ParagraphMap;\n\n /**\n * When set to true, size of table will be recalculated when converting from DOM to Content Model.\n */\n recalculateTableSize?: boolean | 'all' | 'selected' | 'none';\n\n /**\n * Width of the editor's editable area in pixels, excluding padding.\n * This value is typically used for layout calculations such as constraining pasted image sizes.\n */\n editorViewWidth?: number;\n}\n"]}
@@ -9,6 +9,10 @@ export interface ModelToDomListStackItem extends Partial<ContentModelListLevel>
9
9
  * DOM node of this list stack
10
10
  */
11
11
  node: Node;
12
+ /**
13
+ * Reference node to insert next list item under this list
14
+ */
15
+ refNode: Node | null;
12
16
  }
13
17
  /**
14
18
  * Represents context for list handling
@@ -1 +1 @@
1
- {"version":3,"file":"ModelToDomFormatContext.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/context/ModelToDomFormatContext.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContentModelBlockFormat } from '../contentModel/format/ContentModelBlockFormat';\nimport type { ContentModelListLevel } from '../contentModel/decorator/ContentModelListLevel';\nimport type { ContentModelSegmentFormat } from '../contentModel/format/ContentModelSegmentFormat';\n\n/**\n * Represents a list stack item used by Content Model to DOM conversion\n */\nexport interface ModelToDomListStackItem extends Partial<ContentModelListLevel> {\n /**\n * DOM node of this list stack\n */\n node: Node;\n}\n\n/**\n * Represents context for list handling\n */\nexport interface ModelToDomListContext {\n /**\n * Current number of each level of current thread\n */\n threadItemCounts: number[];\n\n /**\n * A stack of current list element chain, start from the parent node of top level list\n */\n nodeStack: ModelToDomListStackItem[];\n}\n\n/**\n * Represents format context used by Content Model to DOM conversion\n */\nexport interface ModelToDomFormatContext {\n /**\n * Context for list handling\n */\n listFormat: ModelToDomListContext;\n\n /**\n * Existing format implicitly applied from parent element\n */\n implicitFormat: ContentModelSegmentFormat & ContentModelBlockFormat;\n}\n"]}
1
+ {"version":3,"file":"ModelToDomFormatContext.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/context/ModelToDomFormatContext.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContentModelBlockFormat } from '../contentModel/format/ContentModelBlockFormat';\nimport type { ContentModelListLevel } from '../contentModel/decorator/ContentModelListLevel';\nimport type { ContentModelSegmentFormat } from '../contentModel/format/ContentModelSegmentFormat';\n\n/**\n * Represents a list stack item used by Content Model to DOM conversion\n */\nexport interface ModelToDomListStackItem extends Partial<ContentModelListLevel> {\n /**\n * DOM node of this list stack\n */\n node: Node;\n\n /**\n * Reference node to insert next list item under this list\n */\n refNode: Node | null;\n}\n\n/**\n * Represents context for list handling\n */\nexport interface ModelToDomListContext {\n /**\n * Current number of each level of current thread\n */\n threadItemCounts: number[];\n\n /**\n * A stack of current list element chain, start from the parent node of top level list\n */\n nodeStack: ModelToDomListStackItem[];\n}\n\n/**\n * Represents format context used by Content Model to DOM conversion\n */\nexport interface ModelToDomFormatContext {\n /**\n * Context for list handling\n */\n listFormat: ModelToDomListContext;\n\n /**\n * Existing format implicitly applied from parent element\n */\n implicitFormat: ContentModelSegmentFormat & ContentModelBlockFormat;\n}\n"]}
@@ -44,4 +44,8 @@ export declare type ExperimentalFeature = GraduatedExperimentalFeature
44
44
  * Get cloned root element from an independent HTML document instead of current document.
45
45
  * So any operation to the cloned root won't trigger network request for resources like images
46
46
  */
47
- | 'CloneIndependentRoot';
47
+ | 'CloneIndependentRoot'
48
+ /**
49
+ * Allow caching list item elements.
50
+ */
51
+ | 'CacheList';
@@ -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 (Graduated, only keep them for backward compatibility)\n */\nexport type GraduatedExperimentalFeature =\n /**\n * @deprecated 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 /**\n * @deprecated\n * Prevent default browser behavior for copy/cut event,\n * and set the clipboard data with custom implementation.\n */\n | 'CustomCopyCut';\n\n/**\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 | GraduatedExperimentalFeature\n\n /**\n * @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options\n * Use Content Model handle ENTER key\n */\n | 'HandleEnterKey'\n\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\n /**\n * Get cloned root element from an independent HTML document instead of current document.\n * So any operation to the cloned root won't trigger network request for resources like images\n */\n | 'CloneIndependentRoot';\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 (Graduated, only keep them for backward compatibility)\n */\nexport type GraduatedExperimentalFeature =\n /**\n * @deprecated 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 /**\n * @deprecated\n * Prevent default browser behavior for copy/cut event,\n * and set the clipboard data with custom implementation.\n */\n | 'CustomCopyCut';\n\n/**\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 | GraduatedExperimentalFeature\n\n /**\n * @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options\n * Use Content Model handle ENTER key\n */\n | 'HandleEnterKey'\n\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\n /**\n * Get cloned root element from an independent HTML document instead of current document.\n * So any operation to the cloned root won't trigger network request for resources like images\n */\n | 'CloneIndependentRoot'\n\n /**\n * Allow caching list item elements.\n */\n | 'CacheList';\n"]}
@@ -40,6 +40,10 @@ export interface EditorContext {
40
40
  * When pass true, this cached element will be used to create DOM tree back when convert Content Model to DOM
41
41
  */
42
42
  allowCacheElement?: boolean;
43
+ /**
44
+ * Whether to allow caching list item elements separately.
45
+ */
46
+ allowCacheListItem?: boolean;
43
47
  /**
44
48
  * @optional Indexer for content model, to help build backward relationship from DOM node to Content Model
45
49
  */
@@ -1 +1 @@
1
- {"version":3,"file":"EditorContext.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/context/EditorContext.ts"],"names":[],"mappings":"","sourcesContent":["import type { DarkColorHandler } from './DarkColorHandler';\nimport type { DomIndexer } from './DomIndexer';\nimport type { ContentModelSegmentFormat } from '../contentModel/format/ContentModelSegmentFormat';\nimport type { PendingFormat } from '../pluginState/FormatPluginState';\nimport type { ParagraphMap } from '../parameter/ParagraphMap';\n\n/**\n * An editor context interface used by ContentModel PAI\n */\nexport interface EditorContext {\n /**\n * Whether current content is in dark mode\n */\n isDarkMode?: boolean;\n\n /**\n * Default format of editor\n */\n defaultFormat?: ContentModelSegmentFormat;\n\n /**\n * Pending format if any\n */\n pendingFormat?: PendingFormat;\n\n /**\n * Color manager, to help manager color in dark mode\n */\n darkColorHandler?: DarkColorHandler;\n\n /**\n * Whether to handle delimiters in Content Model\n */\n addDelimiterForEntity?: boolean;\n\n /**\n * Zoom scale number\n */\n zoomScale?: number;\n\n /**\n * Whether the content is in Right-to-left from root level\n */\n isRootRtl?: boolean;\n\n /**\n * Whether put the source element into Content Model when possible.\n * When pass true, this cached element will be used to create DOM tree back when convert Content Model to DOM\n */\n allowCacheElement?: boolean;\n\n /**\n * @optional Indexer for content model, to help build backward relationship from DOM node to Content Model\n */\n domIndexer?: DomIndexer;\n\n /**\n * Root Font size in Px.\n */\n rootFontSize?: number;\n\n /**\n * Enabled experimental features\n */\n experimentalFeatures?: ReadonlyArray<string>;\n\n /**\n * A helper class that manages a mapping from paragraph marker to paragraph object.\n */\n paragraphMap?: ParagraphMap;\n\n /**\n * When set to true, size of table will be recalculated when converting from DOM to Content Model.\n */\n recalculateTableSize?: boolean | 'all' | 'selected' | 'none';\n\n /**\n * Width of the editor's editable area in pixels, excluding padding.\n * This value is typically used for layout calculations such as constraining pasted image sizes.\n */\n editorViewWidth?: number;\n}\n"]}
1
+ {"version":3,"file":"EditorContext.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/context/EditorContext.ts"],"names":[],"mappings":"","sourcesContent":["import type { DarkColorHandler } from './DarkColorHandler';\nimport type { DomIndexer } from './DomIndexer';\nimport type { ContentModelSegmentFormat } from '../contentModel/format/ContentModelSegmentFormat';\nimport type { PendingFormat } from '../pluginState/FormatPluginState';\nimport type { ParagraphMap } from '../parameter/ParagraphMap';\n\n/**\n * An editor context interface used by ContentModel PAI\n */\nexport interface EditorContext {\n /**\n * Whether current content is in dark mode\n */\n isDarkMode?: boolean;\n\n /**\n * Default format of editor\n */\n defaultFormat?: ContentModelSegmentFormat;\n\n /**\n * Pending format if any\n */\n pendingFormat?: PendingFormat;\n\n /**\n * Color manager, to help manager color in dark mode\n */\n darkColorHandler?: DarkColorHandler;\n\n /**\n * Whether to handle delimiters in Content Model\n */\n addDelimiterForEntity?: boolean;\n\n /**\n * Zoom scale number\n */\n zoomScale?: number;\n\n /**\n * Whether the content is in Right-to-left from root level\n */\n isRootRtl?: boolean;\n\n /**\n * Whether put the source element into Content Model when possible.\n * When pass true, this cached element will be used to create DOM tree back when convert Content Model to DOM\n */\n allowCacheElement?: boolean;\n\n /**\n * Whether to allow caching list item elements separately.\n */\n allowCacheListItem?: boolean;\n\n /**\n * @optional Indexer for content model, to help build backward relationship from DOM node to Content Model\n */\n domIndexer?: DomIndexer;\n\n /**\n * Root Font size in Px.\n */\n rootFontSize?: number;\n\n /**\n * Enabled experimental features\n */\n experimentalFeatures?: ReadonlyArray<string>;\n\n /**\n * A helper class that manages a mapping from paragraph marker to paragraph object.\n */\n paragraphMap?: ParagraphMap;\n\n /**\n * When set to true, size of table will be recalculated when converting from DOM to Content Model.\n */\n recalculateTableSize?: boolean | 'all' | 'selected' | 'none';\n\n /**\n * Width of the editor's editable area in pixels, excluding padding.\n * This value is typically used for layout calculations such as constraining pasted image sizes.\n */\n editorViewWidth?: number;\n}\n"]}
@@ -9,6 +9,10 @@ export interface ModelToDomListStackItem extends Partial<ContentModelListLevel>
9
9
  * DOM node of this list stack
10
10
  */
11
11
  node: Node;
12
+ /**
13
+ * Reference node to insert next list item under this list
14
+ */
15
+ refNode: Node | null;
12
16
  }
13
17
  /**
14
18
  * Represents context for list handling
@@ -1 +1 @@
1
- {"version":3,"file":"ModelToDomFormatContext.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/context/ModelToDomFormatContext.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContentModelBlockFormat } from '../contentModel/format/ContentModelBlockFormat';\nimport type { ContentModelListLevel } from '../contentModel/decorator/ContentModelListLevel';\nimport type { ContentModelSegmentFormat } from '../contentModel/format/ContentModelSegmentFormat';\n\n/**\n * Represents a list stack item used by Content Model to DOM conversion\n */\nexport interface ModelToDomListStackItem extends Partial<ContentModelListLevel> {\n /**\n * DOM node of this list stack\n */\n node: Node;\n}\n\n/**\n * Represents context for list handling\n */\nexport interface ModelToDomListContext {\n /**\n * Current number of each level of current thread\n */\n threadItemCounts: number[];\n\n /**\n * A stack of current list element chain, start from the parent node of top level list\n */\n nodeStack: ModelToDomListStackItem[];\n}\n\n/**\n * Represents format context used by Content Model to DOM conversion\n */\nexport interface ModelToDomFormatContext {\n /**\n * Context for list handling\n */\n listFormat: ModelToDomListContext;\n\n /**\n * Existing format implicitly applied from parent element\n */\n implicitFormat: ContentModelSegmentFormat & ContentModelBlockFormat;\n}\n"]}
1
+ {"version":3,"file":"ModelToDomFormatContext.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/context/ModelToDomFormatContext.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContentModelBlockFormat } from '../contentModel/format/ContentModelBlockFormat';\nimport type { ContentModelListLevel } from '../contentModel/decorator/ContentModelListLevel';\nimport type { ContentModelSegmentFormat } from '../contentModel/format/ContentModelSegmentFormat';\n\n/**\n * Represents a list stack item used by Content Model to DOM conversion\n */\nexport interface ModelToDomListStackItem extends Partial<ContentModelListLevel> {\n /**\n * DOM node of this list stack\n */\n node: Node;\n\n /**\n * Reference node to insert next list item under this list\n */\n refNode: Node | null;\n}\n\n/**\n * Represents context for list handling\n */\nexport interface ModelToDomListContext {\n /**\n * Current number of each level of current thread\n */\n threadItemCounts: number[];\n\n /**\n * A stack of current list element chain, start from the parent node of top level list\n */\n nodeStack: ModelToDomListStackItem[];\n}\n\n/**\n * Represents format context used by Content Model to DOM conversion\n */\nexport interface ModelToDomFormatContext {\n /**\n * Context for list handling\n */\n listFormat: ModelToDomListContext;\n\n /**\n * Existing format implicitly applied from parent element\n */\n implicitFormat: ContentModelSegmentFormat & ContentModelBlockFormat;\n}\n"]}
@@ -44,4 +44,8 @@ export declare type ExperimentalFeature = GraduatedExperimentalFeature
44
44
  * Get cloned root element from an independent HTML document instead of current document.
45
45
  * So any operation to the cloned root won't trigger network request for resources like images
46
46
  */
47
- | 'CloneIndependentRoot';
47
+ | 'CloneIndependentRoot'
48
+ /**
49
+ * Allow caching list item elements.
50
+ */
51
+ | 'CacheList';
@@ -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 (Graduated, only keep them for backward compatibility)\n */\nexport type GraduatedExperimentalFeature =\n /**\n * @deprecated 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 /**\n * @deprecated\n * Prevent default browser behavior for copy/cut event,\n * and set the clipboard data with custom implementation.\n */\n | 'CustomCopyCut';\n\n/**\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 | GraduatedExperimentalFeature\n\n /**\n * @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options\n * Use Content Model handle ENTER key\n */\n | 'HandleEnterKey'\n\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\n /**\n * Get cloned root element from an independent HTML document instead of current document.\n * So any operation to the cloned root won't trigger network request for resources like images\n */\n | 'CloneIndependentRoot';\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 (Graduated, only keep them for backward compatibility)\n */\nexport type GraduatedExperimentalFeature =\n /**\n * @deprecated 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 /**\n * @deprecated\n * Prevent default browser behavior for copy/cut event,\n * and set the clipboard data with custom implementation.\n */\n | 'CustomCopyCut';\n\n/**\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 | GraduatedExperimentalFeature\n\n /**\n * @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options\n * Use Content Model handle ENTER key\n */\n | 'HandleEnterKey'\n\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\n /**\n * Get cloned root element from an independent HTML document instead of current document.\n * So any operation to the cloned root won't trigger network request for resources like images\n */\n | 'CloneIndependentRoot'\n\n /**\n * Allow caching list item elements.\n */\n | 'CacheList';\n"]}
@@ -40,6 +40,10 @@ export interface EditorContext {
40
40
  * When pass true, this cached element will be used to create DOM tree back when convert Content Model to DOM
41
41
  */
42
42
  allowCacheElement?: boolean;
43
+ /**
44
+ * Whether to allow caching list item elements separately.
45
+ */
46
+ allowCacheListItem?: boolean;
43
47
  /**
44
48
  * @optional Indexer for content model, to help build backward relationship from DOM node to Content Model
45
49
  */
@@ -1 +1 @@
1
- {"version":3,"file":"EditorContext.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/context/EditorContext.ts"],"names":[],"mappings":"","sourcesContent":["import type { DarkColorHandler } from './DarkColorHandler';\nimport type { DomIndexer } from './DomIndexer';\nimport type { ContentModelSegmentFormat } from '../contentModel/format/ContentModelSegmentFormat';\nimport type { PendingFormat } from '../pluginState/FormatPluginState';\nimport type { ParagraphMap } from '../parameter/ParagraphMap';\n\n/**\n * An editor context interface used by ContentModel PAI\n */\nexport interface EditorContext {\n /**\n * Whether current content is in dark mode\n */\n isDarkMode?: boolean;\n\n /**\n * Default format of editor\n */\n defaultFormat?: ContentModelSegmentFormat;\n\n /**\n * Pending format if any\n */\n pendingFormat?: PendingFormat;\n\n /**\n * Color manager, to help manager color in dark mode\n */\n darkColorHandler?: DarkColorHandler;\n\n /**\n * Whether to handle delimiters in Content Model\n */\n addDelimiterForEntity?: boolean;\n\n /**\n * Zoom scale number\n */\n zoomScale?: number;\n\n /**\n * Whether the content is in Right-to-left from root level\n */\n isRootRtl?: boolean;\n\n /**\n * Whether put the source element into Content Model when possible.\n * When pass true, this cached element will be used to create DOM tree back when convert Content Model to DOM\n */\n allowCacheElement?: boolean;\n\n /**\n * @optional Indexer for content model, to help build backward relationship from DOM node to Content Model\n */\n domIndexer?: DomIndexer;\n\n /**\n * Root Font size in Px.\n */\n rootFontSize?: number;\n\n /**\n * Enabled experimental features\n */\n experimentalFeatures?: ReadonlyArray<string>;\n\n /**\n * A helper class that manages a mapping from paragraph marker to paragraph object.\n */\n paragraphMap?: ParagraphMap;\n\n /**\n * When set to true, size of table will be recalculated when converting from DOM to Content Model.\n */\n recalculateTableSize?: boolean | 'all' | 'selected' | 'none';\n\n /**\n * Width of the editor's editable area in pixels, excluding padding.\n * This value is typically used for layout calculations such as constraining pasted image sizes.\n */\n editorViewWidth?: number;\n}\n"]}
1
+ {"version":3,"file":"EditorContext.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/context/EditorContext.ts"],"names":[],"mappings":"","sourcesContent":["import type { DarkColorHandler } from './DarkColorHandler';\nimport type { DomIndexer } from './DomIndexer';\nimport type { ContentModelSegmentFormat } from '../contentModel/format/ContentModelSegmentFormat';\nimport type { PendingFormat } from '../pluginState/FormatPluginState';\nimport type { ParagraphMap } from '../parameter/ParagraphMap';\n\n/**\n * An editor context interface used by ContentModel PAI\n */\nexport interface EditorContext {\n /**\n * Whether current content is in dark mode\n */\n isDarkMode?: boolean;\n\n /**\n * Default format of editor\n */\n defaultFormat?: ContentModelSegmentFormat;\n\n /**\n * Pending format if any\n */\n pendingFormat?: PendingFormat;\n\n /**\n * Color manager, to help manager color in dark mode\n */\n darkColorHandler?: DarkColorHandler;\n\n /**\n * Whether to handle delimiters in Content Model\n */\n addDelimiterForEntity?: boolean;\n\n /**\n * Zoom scale number\n */\n zoomScale?: number;\n\n /**\n * Whether the content is in Right-to-left from root level\n */\n isRootRtl?: boolean;\n\n /**\n * Whether put the source element into Content Model when possible.\n * When pass true, this cached element will be used to create DOM tree back when convert Content Model to DOM\n */\n allowCacheElement?: boolean;\n\n /**\n * Whether to allow caching list item elements separately.\n */\n allowCacheListItem?: boolean;\n\n /**\n * @optional Indexer for content model, to help build backward relationship from DOM node to Content Model\n */\n domIndexer?: DomIndexer;\n\n /**\n * Root Font size in Px.\n */\n rootFontSize?: number;\n\n /**\n * Enabled experimental features\n */\n experimentalFeatures?: ReadonlyArray<string>;\n\n /**\n * A helper class that manages a mapping from paragraph marker to paragraph object.\n */\n paragraphMap?: ParagraphMap;\n\n /**\n * When set to true, size of table will be recalculated when converting from DOM to Content Model.\n */\n recalculateTableSize?: boolean | 'all' | 'selected' | 'none';\n\n /**\n * Width of the editor's editable area in pixels, excluding padding.\n * This value is typically used for layout calculations such as constraining pasted image sizes.\n */\n editorViewWidth?: number;\n}\n"]}
@@ -9,6 +9,10 @@ export interface ModelToDomListStackItem extends Partial<ContentModelListLevel>
9
9
  * DOM node of this list stack
10
10
  */
11
11
  node: Node;
12
+ /**
13
+ * Reference node to insert next list item under this list
14
+ */
15
+ refNode: Node | null;
12
16
  }
13
17
  /**
14
18
  * Represents context for list handling
@@ -1 +1 @@
1
- {"version":3,"file":"ModelToDomFormatContext.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/context/ModelToDomFormatContext.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContentModelBlockFormat } from '../contentModel/format/ContentModelBlockFormat';\nimport type { ContentModelListLevel } from '../contentModel/decorator/ContentModelListLevel';\nimport type { ContentModelSegmentFormat } from '../contentModel/format/ContentModelSegmentFormat';\n\n/**\n * Represents a list stack item used by Content Model to DOM conversion\n */\nexport interface ModelToDomListStackItem extends Partial<ContentModelListLevel> {\n /**\n * DOM node of this list stack\n */\n node: Node;\n}\n\n/**\n * Represents context for list handling\n */\nexport interface ModelToDomListContext {\n /**\n * Current number of each level of current thread\n */\n threadItemCounts: number[];\n\n /**\n * A stack of current list element chain, start from the parent node of top level list\n */\n nodeStack: ModelToDomListStackItem[];\n}\n\n/**\n * Represents format context used by Content Model to DOM conversion\n */\nexport interface ModelToDomFormatContext {\n /**\n * Context for list handling\n */\n listFormat: ModelToDomListContext;\n\n /**\n * Existing format implicitly applied from parent element\n */\n implicitFormat: ContentModelSegmentFormat & ContentModelBlockFormat;\n}\n"]}
1
+ {"version":3,"file":"ModelToDomFormatContext.js","sourceRoot":"","sources":["../../../../packages/roosterjs-content-model-types/lib/context/ModelToDomFormatContext.ts"],"names":[],"mappings":"","sourcesContent":["import type { ContentModelBlockFormat } from '../contentModel/format/ContentModelBlockFormat';\nimport type { ContentModelListLevel } from '../contentModel/decorator/ContentModelListLevel';\nimport type { ContentModelSegmentFormat } from '../contentModel/format/ContentModelSegmentFormat';\n\n/**\n * Represents a list stack item used by Content Model to DOM conversion\n */\nexport interface ModelToDomListStackItem extends Partial<ContentModelListLevel> {\n /**\n * DOM node of this list stack\n */\n node: Node;\n\n /**\n * Reference node to insert next list item under this list\n */\n refNode: Node | null;\n}\n\n/**\n * Represents context for list handling\n */\nexport interface ModelToDomListContext {\n /**\n * Current number of each level of current thread\n */\n threadItemCounts: number[];\n\n /**\n * A stack of current list element chain, start from the parent node of top level list\n */\n nodeStack: ModelToDomListStackItem[];\n}\n\n/**\n * Represents format context used by Content Model to DOM conversion\n */\nexport interface ModelToDomFormatContext {\n /**\n * Context for list handling\n */\n listFormat: ModelToDomListContext;\n\n /**\n * Existing format implicitly applied from parent element\n */\n implicitFormat: ContentModelSegmentFormat & ContentModelBlockFormat;\n}\n"]}
@@ -44,4 +44,8 @@ export declare type ExperimentalFeature = GraduatedExperimentalFeature
44
44
  * Get cloned root element from an independent HTML document instead of current document.
45
45
  * So any operation to the cloned root won't trigger network request for resources like images
46
46
  */
47
- | 'CloneIndependentRoot';
47
+ | 'CloneIndependentRoot'
48
+ /**
49
+ * Allow caching list item elements.
50
+ */
51
+ | 'CacheList';
@@ -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 (Graduated, only keep them for backward compatibility)\n */\nexport type GraduatedExperimentalFeature =\n /**\n * @deprecated 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 /**\n * @deprecated\n * Prevent default browser behavior for copy/cut event,\n * and set the clipboard data with custom implementation.\n */\n | 'CustomCopyCut';\n\n/**\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 | GraduatedExperimentalFeature\n\n /**\n * @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options\n * Use Content Model handle ENTER key\n */\n | 'HandleEnterKey'\n\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\n /**\n * Get cloned root element from an independent HTML document instead of current document.\n * So any operation to the cloned root won't trigger network request for resources like images\n */\n | 'CloneIndependentRoot';\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 (Graduated, only keep them for backward compatibility)\n */\nexport type GraduatedExperimentalFeature =\n /**\n * @deprecated 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 /**\n * @deprecated\n * Prevent default browser behavior for copy/cut event,\n * and set the clipboard data with custom implementation.\n */\n | 'CustomCopyCut';\n\n/**\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 | GraduatedExperimentalFeature\n\n /**\n * @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options\n * Use Content Model handle ENTER key\n */\n | 'HandleEnterKey'\n\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\n /**\n * Get cloned root element from an independent HTML document instead of current document.\n * So any operation to the cloned root won't trigger network request for resources like images\n */\n | 'CloneIndependentRoot'\n\n /**\n * Allow caching list item elements.\n */\n | 'CacheList';\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.43.0",
5
+ "version": "9.44.0",
6
6
  "main": "./lib/index.js",
7
7
  "typings": "./lib/index.d.ts",
8
8
  "module": "./lib-mjs/index.js",