roosterjs 9.60.0 → 9.62.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.60.0)
1
+ // Type definitions for roosterjs (Version 9.62.0)
2
2
  // Generated by dts tool from roosterjs
3
3
  // Project: https://github.com/Microsoft/roosterjs
4
4
 
@@ -558,6 +558,11 @@ type SuperOrSubScriptFormat = {
558
558
  * e.g. sub super sub
559
559
  */
560
560
  superOrSubScriptSequence?: string;
561
+ /**
562
+ * Inherit the segment's font size instead of shrinking superscript/subscript wrappers.
563
+ * An empty value restores the default wrapper size.
564
+ */
565
+ superOrSubScriptFontSize?: 'inherit' | '';
561
566
  };
562
567
 
563
568
  /**
@@ -3918,7 +3923,7 @@ type ExperimentalFeature = GraduatedExperimentalFeature
3918
3923
  */
3919
3924
  | 'ShadowDom'
3920
3925
  /**
3921
- * Strip invisible unicode characters (U+E0000 to U+EFFFF) from text segments during DOM to Model conversion.
3926
+ * Strip invisible unicode characters (U+E0000 to U+E007F) from text segments during DOM to Model conversion.
3922
3927
  * These characters can be used to hide text in HTML and may cause unexpected behavior.
3923
3928
  * @see https://embracethered.com/blog/posts/2024/hiding-and-finding-text-with-unicode-tags/
3924
3929
  */
@@ -4046,6 +4051,11 @@ interface ContentModelOptions {
4046
4051
  * Options for selection
4047
4052
  */
4048
4053
  interface SelectionOptions {
4054
+ /**
4055
+ * Background color of selected text. When unset, use the browser's default selection style.
4056
+ * The dark mode color is derived using getDarkColor.
4057
+ */
4058
+ textSelectionColor?: string;
4049
4059
  /**
4050
4060
  * Color of the border of a selectedImage. Default color: '#DB626C'
4051
4061
  */
@@ -4759,6 +4769,14 @@ interface SelectionPluginState {
4759
4769
  * When set to true, onFocus event will not trigger reselect cached range
4760
4770
  */
4761
4771
  skipReselectOnFocus?: boolean;
4772
+ /**
4773
+ * Background color of selected text. When unset, use the browser's default selection style.
4774
+ */
4775
+ textSelectionColor?: string;
4776
+ /**
4777
+ * Background color of selected text in dark mode. When unset, use the browser's default selection style.
4778
+ */
4779
+ textSelectionColorDark?: string;
4762
4780
  /**
4763
4781
  * Color of the border of a selectedImage. Default color: '#DB626C'
4764
4782
  */
@@ -6075,6 +6093,14 @@ interface MergeModelOption {
6075
6093
  * @default undefined
6076
6094
  */
6077
6095
  mergeFormat?: 'mergeAll' | 'keepSourceEmphasisFormat' | 'none' | 'preferSource' | 'preferTarget';
6096
+ /**
6097
+ * Preserve source paragraph decorators, including heading tags and sizes, when
6098
+ * using 'keepSourceEmphasisFormat'. Decorator formatting takes precedence over
6099
+ * target formatting on source segments.
6100
+ * Also include target paragraph decorator and segment formatting in the inherited format.
6101
+ * @default false
6102
+ */
6103
+ preserveParagraphDecorator?: boolean;
6078
6104
  /**
6079
6105
  * Whether to add a paragraph after the merged content.
6080
6106
  */
@@ -7252,6 +7278,17 @@ function isNodeOfType<T extends keyof NodeTypeMap>(node: Node | null | undefined
7252
7278
  */
7253
7279
  function isElementOfType<Tag extends keyof HTMLElementTagNameMap>(element: HTMLElement, tag: Tag): element is HTMLElementTagNameMap[Tag];
7254
7280
 
7281
+ /**
7282
+ * Check whether the given URL uses a protocol that can execute script, such as "javascript:"
7283
+ * @param url The URL to check
7284
+ * @returns True if the URL can execute script when navigated to, otherwise false
7285
+ * @remarks Browsers remove every TAB, LF and CR character from a URL and ignore any leading control
7286
+ * character or space before they resolve its protocol. Those characters must be removed before the
7287
+ * protocol is checked here, otherwise a value such as "java&#9;script:" or "javascr&#13;ipt:" would
7288
+ * be treated as safe but still executed by the browser.
7289
+ */
7290
+ function isUnsafeUrl(url: string | null | undefined): boolean;
7291
+
7255
7292
  /**
7256
7293
  * Provide a strong-typed version of Object.keys()
7257
7294
  * @param obj The source object
@@ -10657,6 +10694,10 @@ interface CustomReplace {
10657
10694
  * - Crop image
10658
10695
  * - Rotate image
10659
10696
  * - Flip image
10697
+ *
10698
+ * In crop mode, Tab focuses the top-left corner, bottom-right corner, then the
10699
+ * whole image. Arrow keys crop at corners or move the fixed-size crop viewport
10700
+ * by one pixel. Enter applies the crop; Escape cancels it.
10660
10701
  */
10661
10702
  class ImageEditPlugin implements ImageEditor, EditorPlugin {
10662
10703
  protected editor: IEditor | null;
@@ -10675,6 +10716,7 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
10675
10716
  private croppers;
10676
10717
  private zoomScale;
10677
10718
  private disposer;
10719
+ private cropKeyboardHelper;
10678
10720
  protected isEditing: boolean;
10679
10721
  protected options: ImageEditOptions;
10680
10722
  constructor(options?: ImageEditOptions);
@@ -10709,6 +10751,7 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
10709
10751
  private mouseDownHandler;
10710
10752
  private onDropHandler;
10711
10753
  private keyDownHandler;
10754
+ private focusCropHandle;
10712
10755
  private setContentHandler;
10713
10756
  private formatEventHandler;
10714
10757
  private contentChangedHandler;
@@ -10725,6 +10768,8 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
10725
10768
  isOperationAllowed(operation: ImageEditOperation): boolean;
10726
10769
  canRegenerateImage(image: HTMLImageElement): boolean;
10727
10770
  private startCropMode;
10771
+ private startCropWithKeyboard;
10772
+ private finishKeyboardCrop;
10728
10773
  cropImage(): void;
10729
10774
  private editImage;
10730
10775
  /**
@@ -10784,6 +10829,11 @@ interface ImageEditOptions {
10784
10829
  * Whether image crop is disabled. @default false
10785
10830
  */
10786
10831
  disableCrop?: boolean;
10832
+ /**
10833
+ * Optional localized crop accessibility text.
10834
+ * Omitted or empty values are not added to the crop controls.
10835
+ */
10836
+ cropLabels?: CropAccessibilityLabels;
10787
10837
  /**
10788
10838
  * Which operations will be executed when image is selected
10789
10839
  * @default resizeAndRotate
@@ -10809,6 +10859,29 @@ interface ImageEditOptions {
10809
10859
  resolveImageSource?: (src: string) => string | undefined;
10810
10860
  }
10811
10861
 
10862
+ /**
10863
+ * Localized accessibility text for image crop controls.
10864
+ */
10865
+ interface CropAccessibilityLabels {
10866
+ /**
10867
+ * Optional accessible crop corner label. Direction is top left (nw) or bottom right (se).
10868
+ * Falls back to "Top left" or "Bottom right" when omitted or empty.
10869
+ */
10870
+ handleLabel?: (direction: 'nw' | 'se') => string;
10871
+ /**
10872
+ * Optional accessible label for the whole-image focus target that moves the crop viewport.
10873
+ * Falls back to "Move Crop" when omitted or empty.
10874
+ */
10875
+ moveCropLabel?: string;
10876
+ /**
10877
+ * Optional localized keyboard cropping instructions. No instructions are added when
10878
+ * omitted or empty. Arrow keys move one pixel in screen
10879
+ * directions; Tab visits top left, bottom right, then the whole image.
10880
+ * Enter applies the crop and Escape cancels it.
10881
+ */
10882
+ instructions?: string;
10883
+ }
10884
+
10812
10885
  /**
10813
10886
  * HiddenPropertyPlugin helps editor to maintain hidden properties in DOM after editor content is reset using HTML
10814
10887
  */
@@ -11202,6 +11275,12 @@ interface MarkdownToModelOptions {
11202
11275
  * @default 'ltr'
11203
11276
  */
11204
11277
  direction?: 'ltr' | 'rtl' | undefined;
11278
+ /**
11279
+ * Specify the table styles to apply to tables converted from markdown.
11280
+ * When omitted, use plain markdown table styles with black borders and no header styling.
11281
+ * When specified, use the provided table metadata instead of the default markdown styles.
11282
+ */
11283
+ tableStyles?: TableMetadataFormat;
11205
11284
  }
11206
11285
 
11207
11286
  /**
@@ -11259,6 +11338,11 @@ interface MarkdownPasteOptions {
11259
11338
  * @default false
11260
11339
  */
11261
11340
  undoConversion: boolean;
11341
+ /**
11342
+ * Options for converting pasted markdown text into a content model.
11343
+ * An omitted or undefined emptyLine option defaults to 'merge'.
11344
+ */
11345
+ markdownToModelOptions?: MarkdownToModelOptions;
11262
11346
  }
11263
11347
 
11264
11348
  }