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.
@@ -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
 
@@ -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
  */
@@ -7251,6 +7277,17 @@ export function isNodeOfType<T extends keyof NodeTypeMap>(node: Node | null | un
7251
7277
  */
7252
7278
  export function isElementOfType<Tag extends keyof HTMLElementTagNameMap>(element: HTMLElement, tag: Tag): element is HTMLElementTagNameMap[Tag];
7253
7279
 
7280
+ /**
7281
+ * Check whether the given URL uses a protocol that can execute script, such as "javascript:"
7282
+ * @param url The URL to check
7283
+ * @returns True if the URL can execute script when navigated to, otherwise false
7284
+ * @remarks Browsers remove every TAB, LF and CR character from a URL and ignore any leading control
7285
+ * character or space before they resolve its protocol. Those characters must be removed before the
7286
+ * protocol is checked here, otherwise a value such as "java&#9;script:" or "javascr&#13;ipt:" would
7287
+ * be treated as safe but still executed by the browser.
7288
+ */
7289
+ export function isUnsafeUrl(url: string | null | undefined): boolean;
7290
+
7254
7291
  /**
7255
7292
  * Provide a strong-typed version of Object.keys()
7256
7293
  * @param obj The source object
@@ -10656,6 +10693,10 @@ export interface CustomReplace {
10656
10693
  * - Crop image
10657
10694
  * - Rotate image
10658
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.
10659
10700
  */
10660
10701
  export class ImageEditPlugin implements ImageEditor, EditorPlugin {
10661
10702
  protected editor: IEditor | null;
@@ -10674,6 +10715,7 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
10674
10715
  private croppers;
10675
10716
  private zoomScale;
10676
10717
  private disposer;
10718
+ private cropKeyboardHelper;
10677
10719
  protected isEditing: boolean;
10678
10720
  protected options: ImageEditOptions;
10679
10721
  constructor(options?: ImageEditOptions);
@@ -10708,6 +10750,7 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
10708
10750
  private mouseDownHandler;
10709
10751
  private onDropHandler;
10710
10752
  private keyDownHandler;
10753
+ private focusCropHandle;
10711
10754
  private setContentHandler;
10712
10755
  private formatEventHandler;
10713
10756
  private contentChangedHandler;
@@ -10724,6 +10767,8 @@ export class ImageEditPlugin implements ImageEditor, EditorPlugin {
10724
10767
  isOperationAllowed(operation: ImageEditOperation): boolean;
10725
10768
  canRegenerateImage(image: HTMLImageElement): boolean;
10726
10769
  private startCropMode;
10770
+ private startCropWithKeyboard;
10771
+ private finishKeyboardCrop;
10727
10772
  cropImage(): void;
10728
10773
  private editImage;
10729
10774
  /**
@@ -10783,6 +10828,11 @@ export interface ImageEditOptions {
10783
10828
  * Whether image crop is disabled. @default false
10784
10829
  */
10785
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;
10786
10836
  /**
10787
10837
  * Which operations will be executed when image is selected
10788
10838
  * @default resizeAndRotate
@@ -10808,6 +10858,29 @@ export interface ImageEditOptions {
10808
10858
  resolveImageSource?: (src: string) => string | undefined;
10809
10859
  }
10810
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
+
10811
10884
  /**
10812
10885
  * HiddenPropertyPlugin helps editor to maintain hidden properties in DOM after editor content is reset using HTML
10813
10886
  */
@@ -11201,6 +11274,12 @@ export interface MarkdownToModelOptions {
11201
11274
  * @default 'ltr'
11202
11275
  */
11203
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;
11204
11283
  }
11205
11284
 
11206
11285
  /**
@@ -11258,5 +11337,10 @@ export interface MarkdownPasteOptions {
11258
11337
  * @default false
11259
11338
  */
11260
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;
11261
11345
  }
11262
11346