roosterjs 9.51.0 → 9.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/rooster.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for roosterjs (Version 9.51.0)
1
+ // Type definitions for roosterjs (Version 9.53.0)
2
2
  // Generated by dts tool from roosterjs
3
3
  // Project: https://github.com/Microsoft/roosterjs
4
4
 
@@ -3828,7 +3828,19 @@ type ExperimentalFeature = GraduatedExperimentalFeature
3828
3828
  /**
3829
3829
  * Transform the table border colors when switching from light to dark mode
3830
3830
  */
3831
- | 'TransformTableBorderColors';
3831
+ | 'TransformTableBorderColors'
3832
+ /**
3833
+ * When the editor content div is inside a Shadow DOM, enable shadow root detection
3834
+ * in DOMHelper so that selection, focus, and element appending work correctly within
3835
+ * the shadow boundary.
3836
+ */
3837
+ | 'ShadowDom'
3838
+ /**
3839
+ * Strip invisible unicode characters (U+E0000 to U+EFFFF) from text segments during DOM to Model conversion.
3840
+ * These characters can be used to hide text in HTML and may cause unexpected behavior.
3841
+ * @see https://embracethered.com/blog/posts/2024/hiding-and-finding-text-with-unicode-tags/
3842
+ */
3843
+ | 'FilterInvisibleUnicode';
3832
3844
 
3833
3845
  /**
3834
3846
  * Predefined experiment features (Graduated, only keep them for backward compatibility)
@@ -5805,6 +5817,22 @@ interface DOMHelper {
5805
5817
  * @returns An array of Ranges that match the search criteria
5806
5818
  */
5807
5819
  getRangesByText(text: string, matchCase: boolean, wholeWord: boolean): Range[];
5820
+ /**
5821
+ * Get the current selection range, handling shadow DOM StaticRange conversion.
5822
+ * Returns a live Range in all browsers.
5823
+ */
5824
+ getSelectionRange(): Range | null;
5825
+ /**
5826
+ * Set the selection to the given range, handling browser differences for shadow DOM.
5827
+ * @param range The range to set
5828
+ * @param isReverted Whether the selection is reverted (focus before anchor)
5829
+ */
5830
+ setSelectionRange(range: Range, isReverted?: boolean): void;
5831
+ /**
5832
+ * Append an element to the correct root container (shadow root or document.body)
5833
+ * @param element The element to append
5834
+ */
5835
+ appendToRoot(element: HTMLElement): void;
5808
5836
  }
5809
5837
 
5810
5838
  /**
@@ -6323,6 +6351,18 @@ interface BeforePasteEvent extends BasePluginEvent<'beforePaste'> {
6323
6351
  * Whether the current clipboard contains at least a block element.
6324
6352
  */
6325
6353
  readonly containsBlockElements?: boolean;
6354
+ /**
6355
+ * Global CSS rules extracted from the pasted document's style sheets
6356
+ */
6357
+ readonly globalCssRules?: CssRule[];
6358
+ }
6359
+
6360
+ /**
6361
+ * Represents a single CSS rule parsed from a pasted document's style sheets
6362
+ */
6363
+ interface CssRule {
6364
+ selectors: string[];
6365
+ text: string;
6326
6366
  }
6327
6367
 
6328
6368
  /**
@@ -9543,7 +9583,6 @@ type EditOptions = {
9543
9583
  */
9544
9584
  handleExpandedSelectionOnDelete?: boolean;
9545
9585
  /**
9546
- * @deprecated This is always treated as true now
9547
9586
  * Callback function to determine whether the Rooster should handle the Enter key press.
9548
9587
  * If the function returns true, the Rooster will handle the Enter key press instead of the browser.
9549
9588
  * @param editor - The editor instance.