roosterjs 9.61.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.61.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
  */
@@ -10668,6 +10694,10 @@ interface CustomReplace {
10668
10694
  * - Crop image
10669
10695
  * - Rotate image
10670
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.
10671
10701
  */
10672
10702
  class ImageEditPlugin implements ImageEditor, EditorPlugin {
10673
10703
  protected editor: IEditor | null;
@@ -10686,6 +10716,7 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
10686
10716
  private croppers;
10687
10717
  private zoomScale;
10688
10718
  private disposer;
10719
+ private cropKeyboardHelper;
10689
10720
  protected isEditing: boolean;
10690
10721
  protected options: ImageEditOptions;
10691
10722
  constructor(options?: ImageEditOptions);
@@ -10720,6 +10751,7 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
10720
10751
  private mouseDownHandler;
10721
10752
  private onDropHandler;
10722
10753
  private keyDownHandler;
10754
+ private focusCropHandle;
10723
10755
  private setContentHandler;
10724
10756
  private formatEventHandler;
10725
10757
  private contentChangedHandler;
@@ -10736,6 +10768,8 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
10736
10768
  isOperationAllowed(operation: ImageEditOperation): boolean;
10737
10769
  canRegenerateImage(image: HTMLImageElement): boolean;
10738
10770
  private startCropMode;
10771
+ private startCropWithKeyboard;
10772
+ private finishKeyboardCrop;
10739
10773
  cropImage(): void;
10740
10774
  private editImage;
10741
10775
  /**
@@ -10795,6 +10829,11 @@ interface ImageEditOptions {
10795
10829
  * Whether image crop is disabled. @default false
10796
10830
  */
10797
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;
10798
10837
  /**
10799
10838
  * Which operations will be executed when image is selected
10800
10839
  * @default resizeAndRotate
@@ -10820,6 +10859,29 @@ interface ImageEditOptions {
10820
10859
  resolveImageSource?: (src: string) => string | undefined;
10821
10860
  }
10822
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
+
10823
10885
  /**
10824
10886
  * HiddenPropertyPlugin helps editor to maintain hidden properties in DOM after editor content is reset using HTML
10825
10887
  */
@@ -11213,6 +11275,12 @@ interface MarkdownToModelOptions {
11213
11275
  * @default 'ltr'
11214
11276
  */
11215
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;
11216
11284
  }
11217
11285
 
11218
11286
  /**
@@ -11270,6 +11338,11 @@ interface MarkdownPasteOptions {
11270
11338
  * @default false
11271
11339
  */
11272
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;
11273
11346
  }
11274
11347
 
11275
11348
  }