roosterjs 9.61.0 → 9.63.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.63.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
  */
@@ -3926,7 +3931,12 @@ type ExperimentalFeature = GraduatedExperimentalFeature
3926
3931
  /**
3927
3932
  * Handle the drop event for content that is dropped from the same editor instance.
3928
3933
  */
3929
- | 'HandleDropInternalContent';
3934
+ | 'HandleDropInternalContent'
3935
+ /**
3936
+ * Apply Word-like spacing to list items and their direct element children,
3937
+ * and default images without an explicit vertical alignment to middle.
3938
+ */
3939
+ | 'WordLikeStyles';
3930
3940
 
3931
3941
  /**
3932
3942
  * Predefined experiment features (Graduated, only keep them for backward compatibility)
@@ -4046,6 +4056,11 @@ interface ContentModelOptions {
4046
4056
  * Options for selection
4047
4057
  */
4048
4058
  interface SelectionOptions {
4059
+ /**
4060
+ * Background color of selected text. When unset, use the browser's default selection style.
4061
+ * The dark mode color is derived using getDarkColor.
4062
+ */
4063
+ textSelectionColor?: string;
4049
4064
  /**
4050
4065
  * Color of the border of a selectedImage. Default color: '#DB626C'
4051
4066
  */
@@ -4759,6 +4774,14 @@ interface SelectionPluginState {
4759
4774
  * When set to true, onFocus event will not trigger reselect cached range
4760
4775
  */
4761
4776
  skipReselectOnFocus?: boolean;
4777
+ /**
4778
+ * Background color of selected text. When unset, use the browser's default selection style.
4779
+ */
4780
+ textSelectionColor?: string;
4781
+ /**
4782
+ * Background color of selected text in dark mode. When unset, use the browser's default selection style.
4783
+ */
4784
+ textSelectionColorDark?: string;
4762
4785
  /**
4763
4786
  * Color of the border of a selectedImage. Default color: '#DB626C'
4764
4787
  */
@@ -6075,6 +6098,14 @@ interface MergeModelOption {
6075
6098
  * @default undefined
6076
6099
  */
6077
6100
  mergeFormat?: 'mergeAll' | 'keepSourceEmphasisFormat' | 'none' | 'preferSource' | 'preferTarget';
6101
+ /**
6102
+ * Preserve source paragraph decorators, including heading tags and sizes, when
6103
+ * using 'keepSourceEmphasisFormat'. Decorator formatting takes precedence over
6104
+ * target formatting on source segments.
6105
+ * Also include target paragraph decorator and segment formatting in the inherited format.
6106
+ * @default false
6107
+ */
6108
+ preserveParagraphDecorator?: boolean;
6078
6109
  /**
6079
6110
  * Whether to add a paragraph after the merged content.
6080
6111
  */
@@ -9270,6 +9301,13 @@ function setListStartNumber(editor: IEditor, value: number): void;
9270
9301
  */
9271
9302
  function setIndentation(editor: IEditor, indentation: 'indent' | 'outdent', length?: number): void;
9272
9303
 
9304
+ /**
9305
+ * Insert a horizontal line into editor at current selection, replacing selected content
9306
+ * @param editor The editor instance
9307
+ * @param format Optional divider format. Defaults to a thin solid line with 98% width
9308
+ */
9309
+ function insertHorizontalLine(editor: IEditor, format?: ContentModelDividerFormat): void;
9310
+
9273
9311
  /**
9274
9312
  * Set text alignment of selected paragraphs
9275
9313
  * @param editor The editor to set alignment
@@ -9324,6 +9362,14 @@ function setImageBorder(editor: IEditor, border: Border | null, borderRadius?: s
9324
9362
  */
9325
9363
  function setImageBoxShadow(editor: IEditor, boxShadow: string, margin?: string | null): void;
9326
9364
 
9365
+ /**
9366
+ * Set the width and height of all selected images.
9367
+ * @param editor The editor instance
9368
+ * @param width The image width as a CSS value (e.g. "200px" or "50%"). An empty string clears the explicit width.
9369
+ * @param height The image height as a CSS value (e.g. "100px" or "auto"). An empty string clears the explicit height.
9370
+ */
9371
+ function setImageSize(editor: IEditor, width: string, height: string): void;
9372
+
9327
9373
  /**
9328
9374
  * Change the selected image src
9329
9375
  * @param editor The editor instance
@@ -9554,6 +9600,11 @@ function findListItemsInSameThread(group: ReadonlyContentModelBlockGroup, curren
9554
9600
  */
9555
9601
  function setModelIndentation(model: ReadonlyContentModelDocument, indentation: 'indent' | 'outdent', length?: number, context?: FormatContentModelContext): boolean;
9556
9602
 
9603
+ /**
9604
+ * Insert a horizontal line into the model at current selection
9605
+ */
9606
+ function insertHorizontalLineIntoModel(model: ReadonlyContentModelDocument, context: FormatContentModelContext, format?: ContentModelDividerFormat): boolean;
9607
+
9557
9608
  /**
9558
9609
  * Determine text direction from the first strong directional character
9559
9610
  * @param text Text to scan
@@ -10668,6 +10719,10 @@ interface CustomReplace {
10668
10719
  * - Crop image
10669
10720
  * - Rotate image
10670
10721
  * - Flip image
10722
+ *
10723
+ * In crop mode, Tab focuses the top-left corner, bottom-right corner, then the
10724
+ * whole image. Arrow keys crop at corners or move the fixed-size crop viewport
10725
+ * by one pixel. Enter applies the crop; Escape cancels it.
10671
10726
  */
10672
10727
  class ImageEditPlugin implements ImageEditor, EditorPlugin {
10673
10728
  protected editor: IEditor | null;
@@ -10686,6 +10741,7 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
10686
10741
  private croppers;
10687
10742
  private zoomScale;
10688
10743
  private disposer;
10744
+ private cropKeyboardHelper;
10689
10745
  protected isEditing: boolean;
10690
10746
  protected options: ImageEditOptions;
10691
10747
  constructor(options?: ImageEditOptions);
@@ -10720,6 +10776,7 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
10720
10776
  private mouseDownHandler;
10721
10777
  private onDropHandler;
10722
10778
  private keyDownHandler;
10779
+ private focusCropHandle;
10723
10780
  private setContentHandler;
10724
10781
  private formatEventHandler;
10725
10782
  private contentChangedHandler;
@@ -10736,6 +10793,8 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
10736
10793
  isOperationAllowed(operation: ImageEditOperation): boolean;
10737
10794
  canRegenerateImage(image: HTMLImageElement): boolean;
10738
10795
  private startCropMode;
10796
+ private startCropWithKeyboard;
10797
+ private finishKeyboardCrop;
10739
10798
  cropImage(): void;
10740
10799
  private editImage;
10741
10800
  /**
@@ -10795,6 +10854,11 @@ interface ImageEditOptions {
10795
10854
  * Whether image crop is disabled. @default false
10796
10855
  */
10797
10856
  disableCrop?: boolean;
10857
+ /**
10858
+ * Optional localized crop accessibility text.
10859
+ * Omitted or empty values are not added to the crop controls.
10860
+ */
10861
+ cropLabels?: CropAccessibilityLabels;
10798
10862
  /**
10799
10863
  * Which operations will be executed when image is selected
10800
10864
  * @default resizeAndRotate
@@ -10820,6 +10884,29 @@ interface ImageEditOptions {
10820
10884
  resolveImageSource?: (src: string) => string | undefined;
10821
10885
  }
10822
10886
 
10887
+ /**
10888
+ * Localized accessibility text for image crop controls.
10889
+ */
10890
+ interface CropAccessibilityLabels {
10891
+ /**
10892
+ * Optional accessible crop corner label. Direction is top left (nw) or bottom right (se).
10893
+ * Falls back to "Top left" or "Bottom right" when omitted or empty.
10894
+ */
10895
+ handleLabel?: (direction: 'nw' | 'se') => string;
10896
+ /**
10897
+ * Optional accessible label for the whole-image focus target that moves the crop viewport.
10898
+ * Falls back to "Move Crop" when omitted or empty.
10899
+ */
10900
+ moveCropLabel?: string;
10901
+ /**
10902
+ * Optional localized keyboard cropping instructions. No instructions are added when
10903
+ * omitted or empty. Arrow keys move one pixel in screen
10904
+ * directions; Tab visits top left, bottom right, then the whole image.
10905
+ * Enter applies the crop and Escape cancels it.
10906
+ */
10907
+ instructions?: string;
10908
+ }
10909
+
10823
10910
  /**
10824
10911
  * HiddenPropertyPlugin helps editor to maintain hidden properties in DOM after editor content is reset using HTML
10825
10912
  */
@@ -11213,6 +11300,12 @@ interface MarkdownToModelOptions {
11213
11300
  * @default 'ltr'
11214
11301
  */
11215
11302
  direction?: 'ltr' | 'rtl' | undefined;
11303
+ /**
11304
+ * Specify the table styles to apply to tables converted from markdown.
11305
+ * When omitted, use plain markdown table styles with black borders and no header styling.
11306
+ * When specified, use the provided table metadata instead of the default markdown styles.
11307
+ */
11308
+ tableStyles?: TableMetadataFormat;
11216
11309
  }
11217
11310
 
11218
11311
  /**
@@ -11270,6 +11363,11 @@ interface MarkdownPasteOptions {
11270
11363
  * @default false
11271
11364
  */
11272
11365
  undoConversion: boolean;
11366
+ /**
11367
+ * Options for converting pasted markdown text into a content model.
11368
+ * An omitted or undefined emptyLine option defaults to 'merge'.
11369
+ */
11370
+ markdownToModelOptions?: MarkdownToModelOptions;
11273
11371
  }
11274
11372
 
11275
11373
  }