roosterjs 9.50.0 → 9.51.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.
@@ -1,4 +1,4 @@
1
- // Type definitions for roosterjs (Version 9.50.0)
1
+ // Type definitions for roosterjs (Version 9.51.0)
2
2
  // Generated by dts tool from roosterjs
3
3
  // Project: https://github.com/Microsoft/roosterjs
4
4
 
@@ -2975,6 +2975,7 @@ export interface EditorContext {
2975
2975
  */
2976
2976
  allowCacheElement?: boolean;
2977
2977
  /**
2978
+ * @deprecated This is now always be treated as true
2978
2979
  * Whether to allow caching list item elements separately.
2979
2980
  */
2980
2981
  allowCacheListItem?: boolean;
@@ -3057,6 +3058,11 @@ export interface DomToModelListFormat {
3057
3058
  * Current list type stack
3058
3059
  */
3059
3060
  levels: ContentModelListLevel[];
3061
+ /**
3062
+ * This is used for handling an abnormal case where list items are not inside a ul or ol tag
3063
+ * It is not common and against the HTML specification, but we need to handle it for robustness
3064
+ */
3065
+ potentialListType?: 'OL' | 'UL';
3060
3066
  }
3061
3067
 
3062
3068
  /**
@@ -3811,11 +3817,6 @@ export interface IEditor {
3811
3817
  * when create editor
3812
3818
  */
3813
3819
  export type ExperimentalFeature = GraduatedExperimentalFeature
3814
- /**
3815
- * @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options
3816
- * Use Content Model handle ENTER key
3817
- */
3818
- | 'HandleEnterKey'
3819
3820
  /**
3820
3821
  * For CJK keyboard input on mobile, if the user toggles bold/italic/underline on an empty div,
3821
3822
  * the pending format will be applied on the selection marker. When typing text, the selection moves to the text node and the
@@ -3823,19 +3824,6 @@ export type ExperimentalFeature = GraduatedExperimentalFeature
3823
3824
  * the original formatting of the selection marker is kept to match the pending format.
3824
3825
  */
3825
3826
  | 'KeepSelectionMarkerWhenEnteringTextNode'
3826
- /**
3827
- * Export editor content as HTML using HTMLFast option
3828
- */
3829
- | 'ExportHTMLFast'
3830
- /**
3831
- * Get cloned root element from an independent HTML document instead of current document.
3832
- * So any operation to the cloned root won't trigger network request for resources like images
3833
- */
3834
- | 'CloneIndependentRoot'
3835
- /**
3836
- * Allow caching list item elements.
3837
- */
3838
- | 'CacheList'
3839
3827
  /**
3840
3828
  * Transform the table border colors when switching from light to dark mode
3841
3829
  */
@@ -3859,7 +3847,28 @@ export type GraduatedExperimentalFeature = /**
3859
3847
  * Prevent default browser behavior for copy/cut event,
3860
3848
  * and set the clipboard data with custom implementation.
3861
3849
  */
3862
- | 'CustomCopyCut';
3850
+ | 'CustomCopyCut'
3851
+ /**
3852
+ * @deprecated
3853
+ * Export editor content as HTML using HTMLFast option
3854
+ */
3855
+ | 'ExportHTMLFast'
3856
+ /**
3857
+ * @deprecated Please use the shouldHandleEnterKey option of the EditPlugin Options
3858
+ * Use Content Model handle ENTER key
3859
+ */
3860
+ | 'HandleEnterKey'
3861
+ /**
3862
+ * @deprecated
3863
+ * Get cloned root element from an independent HTML document instead of current document.
3864
+ * So any operation to the cloned root won't trigger network request for resources like images
3865
+ */
3866
+ | 'CloneIndependentRoot'
3867
+ /**
3868
+ * @deprecated
3869
+ * Allow caching list item elements.
3870
+ */
3871
+ | 'CacheList';
3863
3872
 
3864
3873
  /**
3865
3874
  * Options for editor
@@ -7424,15 +7433,6 @@ export function normalizeParagraph(paragraph: ReadonlyContentModelParagraph): vo
7424
7433
  */
7425
7434
  export function normalizeContentModel(group: ReadonlyContentModelBlockGroup): void;
7426
7435
 
7427
- /**
7428
- * Strip invisible Unicode characters from all text and link hrefs in a content model.
7429
- * This sanitizes the model at initialization time to prevent hidden content in links
7430
- * or text (e.g. zero-width chars, bidirectional marks, Unicode Tags).
7431
- * For General segments, all Text nodes under the element are also sanitized.
7432
- * @param model The content model document to sanitize in-place
7433
- */
7434
- export function sanitizeInvisibleUnicode(model: ContentModelDocument): void;
7435
-
7436
7436
  /**
7437
7437
  * Check if the given block group is a general segment
7438
7438
  * @param group The group to check
@@ -7750,19 +7750,6 @@ export function isSpace(char: string): boolean;
7750
7750
  */
7751
7751
  export function normalizeText(txt: string, isForward: boolean): string;
7752
7752
 
7753
- /**
7754
- * Strip invisible Unicode characters from a string.
7755
- * This removes zero-width characters, bidirectional marks, Unicode Tags (U+E0001-U+E00FF),
7756
- * interlinear annotation anchors, Mongolian free variation selectors,
7757
- * and other invisible formatting characters that can be used to hide content in links.
7758
- *
7759
- * @remarks This function strips ZWJ (U+200D) which may affect emoji sequences.
7760
- * It should only be applied to href attributes, not to visible text content.
7761
- * @param value The string to strip invisible characters from
7762
- * @returns The string with invisible characters removed
7763
- */
7764
- export function stripInvisibleUnicode(value: string): string;
7765
-
7766
7753
  /**
7767
7754
  * Parse a table into a two dimensions array of TD elements. For those merged cells, the value will be null.
7768
7755
  * @param table Input HTML Table element
@@ -8766,7 +8753,7 @@ export function createModelFromHtml(html: string, options?: Partial<DomToModelOp
8766
8753
  /**
8767
8754
  * Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity
8768
8755
  * @param editor The editor to get content from
8769
- * @param mode Specify HTML to get HTML. This is the default option
8756
+ * @param mode Specify HTML to get HTML.
8770
8757
  * @param options @optional Options for Model to DOM conversion
8771
8758
  */
8772
8759
  export function exportContent(editor: IEditor, mode?: 'HTML', options?: ModelToDomOption): string;
@@ -8775,9 +8762,9 @@ export function exportContent(editor: IEditor, mode?: 'HTML', options?: ModelToD
8775
8762
  * Export HTML content. If there are entities, this will cause EntityOperation event with option = 'replaceTemporaryContent' to get a dehydrated entity.
8776
8763
  * This is a fast version, it retrieve HTML content directly from editor without going through content model conversion.
8777
8764
  * @param editor The editor to get content from
8778
- * @param mode Specify HTMLFast to get HTML result.
8765
+ * @param mode Specify HTMLFast to get HTML result. This is the default option
8779
8766
  */
8780
- export function exportContent(editor: IEditor, mode: 'HTMLFast'): string;
8767
+ export function exportContent(editor: IEditor, mode?: 'HTMLFast'): string;
8781
8768
 
8782
8769
  /**
8783
8770
  * Export plain text content
@@ -9494,15 +9481,12 @@ export class EditPlugin implements EditorPlugin {
9494
9481
  private disposer;
9495
9482
  private shouldHandleNextInputEvent;
9496
9483
  private selectionAfterDelete;
9497
- private handleNormalEnter;
9498
9484
  private options;
9499
9485
  /**
9500
9486
  * @param options An optional parameter that takes in an object of type EditOptions, which includes the following properties:
9501
9487
  * handleTabKey: A boolean or HandleTabOptions object that controls Tab key handling. When a boolean, true enables all features and false disables all. When an object, individual features can be controlled. Defaults to all enabled.
9502
9488
  */
9503
9489
  constructor(options?: EditOptions);
9504
- private createNormalEnterChecker;
9505
- private getHandleNormalEnter;
9506
9490
  /**
9507
9491
  * Get name of this plugin
9508
9492
  */
@@ -9558,6 +9542,7 @@ export type EditOptions = {
9558
9542
  */
9559
9543
  handleExpandedSelectionOnDelete?: boolean;
9560
9544
  /**
9545
+ * @deprecated This is always treated as true now
9561
9546
  * Callback function to determine whether the Rooster should handle the Enter key press.
9562
9547
  * If the function returns true, the Rooster will handle the Enter key press instead of the browser.
9563
9548
  * @param editor - The editor instance.