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.
@@ -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
 
@@ -557,6 +557,11 @@ export type SuperOrSubScriptFormat = {
557
557
  * e.g. sub super sub
558
558
  */
559
559
  superOrSubScriptSequence?: string;
560
+ /**
561
+ * Inherit the segment's font size instead of shrinking superscript/subscript wrappers.
562
+ * An empty value restores the default wrapper size.
563
+ */
564
+ superOrSubScriptFontSize?: 'inherit' | '';
560
565
  };
561
566
 
562
567
  /**
@@ -3917,7 +3922,7 @@ export type ExperimentalFeature = GraduatedExperimentalFeature
3917
3922
  */
3918
3923
  | 'ShadowDom'
3919
3924
  /**
3920
- * Strip invisible unicode characters (U+E0000 to U+EFFFF) from text segments during DOM to Model conversion.
3925
+ * Strip invisible unicode characters (U+E0000 to U+E007F) from text segments during DOM to Model conversion.
3921
3926
  * These characters can be used to hide text in HTML and may cause unexpected behavior.
3922
3927
  * @see https://embracethered.com/blog/posts/2024/hiding-and-finding-text-with-unicode-tags/
3923
3928
  */
@@ -4045,6 +4050,11 @@ export interface ContentModelOptions {
4045
4050
  * Options for selection
4046
4051
  */
4047
4052
  export interface SelectionOptions {
4053
+ /**
4054
+ * Background color of selected text. When unset, use the browser's default selection style.
4055
+ * The dark mode color is derived using getDarkColor.
4056
+ */
4057
+ textSelectionColor?: string;
4048
4058
  /**
4049
4059
  * Color of the border of a selectedImage. Default color: '#DB626C'
4050
4060
  */
@@ -4758,6 +4768,14 @@ export interface SelectionPluginState {
4758
4768
  * When set to true, onFocus event will not trigger reselect cached range
4759
4769
  */
4760
4770
  skipReselectOnFocus?: boolean;
4771
+ /**
4772
+ * Background color of selected text. When unset, use the browser's default selection style.
4773
+ */
4774
+ textSelectionColor?: string;
4775
+ /**
4776
+ * Background color of selected text in dark mode. When unset, use the browser's default selection style.
4777
+ */
4778
+ textSelectionColorDark?: string;
4761
4779
  /**
4762
4780
  * Color of the border of a selectedImage. Default color: '#DB626C'
4763
4781
  */
@@ -6074,6 +6092,14 @@ export interface MergeModelOption {
6074
6092
  * @default undefined
6075
6093
  */
6076
6094
  mergeFormat?: 'mergeAll' | 'keepSourceEmphasisFormat' | 'none' | 'preferSource' | 'preferTarget';
6095
+ /**
6096
+ * Preserve source paragraph decorators, including heading tags and sizes, when
6097
+ * using 'keepSourceEmphasisFormat'. Decorator formatting takes precedence over
6098
+ * target formatting on source segments.
6099
+ * Also include target paragraph decorator and segment formatting in the inherited format.
6100
+ * @default false
6101
+ */
6102
+ preserveParagraphDecorator?: boolean;
6077
6103
  /**
6078
6104
  * Whether to add a paragraph after the merged content.
6079
6105
  */
@@ -10667,6 +10693,10 @@ export interface CustomReplace {
10667
10693
  * - Crop image
10668
10694
  * - Rotate image
10669
10695
  * - Flip image
10696
+ *
10697
+ * In crop mode, Tab focuses the top-left corner, bottom-right corner, then the
10698
+ * whole image. Arrow keys crop at corners or move the fixed-size crop viewport
10699
+ * by one pixel. Enter applies the crop; Escape cancels it.
10670
10700
  */
10671
10701
  export class ImageEditPlugin implements ImageEditor, EditorPlugin {
10672
10702
  protected editor: IEditor | null;
@@ -10685,6 +10715,7 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
10685
10715
  private croppers;
10686
10716
  private zoomScale;
10687
10717
  private disposer;
10718
+ private cropKeyboardHelper;
10688
10719
  protected isEditing: boolean;
10689
10720
  protected options: ImageEditOptions;
10690
10721
  constructor(options?: ImageEditOptions);
@@ -10719,6 +10750,7 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
10719
10750
  private mouseDownHandler;
10720
10751
  private onDropHandler;
10721
10752
  private keyDownHandler;
10753
+ private focusCropHandle;
10722
10754
  private setContentHandler;
10723
10755
  private formatEventHandler;
10724
10756
  private contentChangedHandler;
@@ -10735,6 +10767,8 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
10735
10767
  isOperationAllowed(operation: ImageEditOperation): boolean;
10736
10768
  canRegenerateImage(image: HTMLImageElement): boolean;
10737
10769
  private startCropMode;
10770
+ private startCropWithKeyboard;
10771
+ private finishKeyboardCrop;
10738
10772
  cropImage(): void;
10739
10773
  private editImage;
10740
10774
  /**
@@ -10794,6 +10828,11 @@ export interface ImageEditOptions {
10794
10828
  * Whether image crop is disabled. @default false
10795
10829
  */
10796
10830
  disableCrop?: boolean;
10831
+ /**
10832
+ * Optional localized crop accessibility text.
10833
+ * Omitted or empty values are not added to the crop controls.
10834
+ */
10835
+ cropLabels?: CropAccessibilityLabels;
10797
10836
  /**
10798
10837
  * Which operations will be executed when image is selected
10799
10838
  * @default resizeAndRotate
@@ -10819,6 +10858,29 @@ export interface ImageEditOptions {
10819
10858
  resolveImageSource?: (src: string) => string | undefined;
10820
10859
  }
10821
10860
 
10861
+ /**
10862
+ * Localized accessibility text for image crop controls.
10863
+ */
10864
+ export interface CropAccessibilityLabels {
10865
+ /**
10866
+ * Optional accessible crop corner label. Direction is top left (nw) or bottom right (se).
10867
+ * Falls back to "Top left" or "Bottom right" when omitted or empty.
10868
+ */
10869
+ handleLabel?: (direction: 'nw' | 'se') => string;
10870
+ /**
10871
+ * Optional accessible label for the whole-image focus target that moves the crop viewport.
10872
+ * Falls back to "Move Crop" when omitted or empty.
10873
+ */
10874
+ moveCropLabel?: string;
10875
+ /**
10876
+ * Optional localized keyboard cropping instructions. No instructions are added when
10877
+ * omitted or empty. Arrow keys move one pixel in screen
10878
+ * directions; Tab visits top left, bottom right, then the whole image.
10879
+ * Enter applies the crop and Escape cancels it.
10880
+ */
10881
+ instructions?: string;
10882
+ }
10883
+
10822
10884
  /**
10823
10885
  * HiddenPropertyPlugin helps editor to maintain hidden properties in DOM after editor content is reset using HTML
10824
10886
  */
@@ -11212,6 +11274,12 @@ export interface MarkdownToModelOptions {
11212
11274
  * @default 'ltr'
11213
11275
  */
11214
11276
  direction?: 'ltr' | 'rtl' | undefined;
11277
+ /**
11278
+ * Specify the table styles to apply to tables converted from markdown.
11279
+ * When omitted, use plain markdown table styles with black borders and no header styling.
11280
+ * When specified, use the provided table metadata instead of the default markdown styles.
11281
+ */
11282
+ tableStyles?: TableMetadataFormat;
11215
11283
  }
11216
11284
 
11217
11285
  /**
@@ -11269,5 +11337,10 @@ export interface MarkdownPasteOptions {
11269
11337
  * @default false
11270
11338
  */
11271
11339
  undoConversion: boolean;
11340
+ /**
11341
+ * Options for converting pasted markdown text into a content model.
11342
+ * An omitted or undefined emptyLine option defaults to 'merge'.
11343
+ */
11344
+ markdownToModelOptions?: MarkdownToModelOptions;
11272
11345
  }
11273
11346