roosterjs 9.6.0 → 9.8.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.6.0)
1
+ // Type definitions for roosterjs (Version 9.8.0)
2
2
  // Generated by dts tool from roosterjs
3
3
  // Project: https://github.com/Microsoft/roosterjs
4
4
 
@@ -3093,9 +3093,11 @@ interface TextMutationObserver {
3093
3093
  */
3094
3094
  stopObserving(): void;
3095
3095
  /**
3096
- * Flush all pending mutations that have not be handled in order to ignore them
3096
+ * Flush all pending mutations and update cached model if need
3097
+ * @param ignoreMutations When pass true, all mutations will be ignored and do not update content model.
3098
+ * This should only be used when we already have a up-to-date content model and will set it as latest cache
3097
3099
  */
3098
- flushMutations(newModel?: ContentModelDocument): void;
3100
+ flushMutations(ignoreMutations?: boolean): void;
3099
3101
  }
3100
3102
 
3101
3103
  /**
@@ -7889,6 +7891,16 @@ function applySegmentFormat(editor: IEditor, newFormat: Readonly<ContentModelSeg
7889
7891
  */
7890
7892
  function changeCapitalization(editor: IEditor, capitalization: 'sentence' | 'lowerCase' | 'upperCase' | 'capitalize', language?: string): void;
7891
7893
 
7894
+ /**
7895
+ * Split given text segments from the given range
7896
+ * @param textSegment segment to split
7897
+ * @param parent parent paragraph the text segment exist in
7898
+ * @param start starting point of the split
7899
+ * @param end ending point of the split
7900
+ * @returns text segment from the indicated split.
7901
+ */
7902
+ function splitTextSegment(textSegment: ContentModelText, parent: ShallowMutableContentModelParagraph, start: number, end: number): ContentModelText;
7903
+
7892
7904
  /**
7893
7905
  * Insert an image into current selected position
7894
7906
  * @param editor The editor to operate on
@@ -8317,6 +8329,11 @@ class PastePlugin implements EditorPlugin {
8317
8329
  private setEventSanitizers;
8318
8330
  }
8319
8331
 
8332
+ /**
8333
+ * Default style sanitizers for PastePlugin.
8334
+ */
8335
+ const DefaultSanitizers: Record<string, ValueSanitizer>;
8336
+
8320
8337
  /**
8321
8338
  * Edit plugins helps editor to do editing operation on top of content model.
8322
8339
  * This includes:
@@ -8325,11 +8342,17 @@ class PastePlugin implements EditorPlugin {
8325
8342
  * 3. Tab Key
8326
8343
  */
8327
8344
  class EditPlugin implements EditorPlugin {
8345
+ private options;
8328
8346
  private editor;
8329
8347
  private disposer;
8330
8348
  private shouldHandleNextInputEvent;
8331
8349
  private selectionAfterDelete;
8332
8350
  private handleNormalEnter;
8351
+ /**
8352
+ * @param options An optional parameter that takes in an object of type EditOptions, which includes the following properties:
8353
+ * handleTabKey: A boolean that enables or disables Tab key handling. Defaults to true.
8354
+ */
8355
+ constructor(options?: EditOptions);
8333
8356
  /**
8334
8357
  * Get name of this plugin
8335
8358
  */
@@ -8367,6 +8390,16 @@ class EditPlugin implements EditorPlugin {
8367
8390
  private handleBeforeInputEvent;
8368
8391
  }
8369
8392
 
8393
+ /**
8394
+ * Options to customize the keyboard handling behavior of Edit plugin
8395
+ */
8396
+ type EditOptions = {
8397
+ /**
8398
+ * Whether to handle Tab key in keyboard. @default true
8399
+ */
8400
+ handleTabKey?: boolean;
8401
+ };
8402
+
8370
8403
  /**
8371
8404
  * Auto Format plugin handles auto formatting, such as transforming * characters into a bullet list.
8372
8405
  * It can be customized with options to enable or disable auto list features.
@@ -8716,6 +8749,7 @@ class WatermarkPlugin implements EditorPlugin {
8716
8749
  private editor;
8717
8750
  private format;
8718
8751
  private isShowing;
8752
+ private darkTextColor;
8719
8753
  /**
8720
8754
  * Create an instance of Watermark plugin
8721
8755
  * @param watermark The watermark string
@@ -8741,6 +8775,7 @@ class WatermarkPlugin implements EditorPlugin {
8741
8775
  onPluginEvent(event: PluginEvent): void;
8742
8776
  private showHide;
8743
8777
  protected show(editor: IEditor): void;
8778
+ private applyWatermarkStyle;
8744
8779
  protected hide(editor: IEditor): void;
8745
8780
  }
8746
8781
 
@@ -9129,7 +9164,7 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
9129
9164
  protected editor: IEditor | null;
9130
9165
  private shadowSpan;
9131
9166
  private selectedImage;
9132
- wrapper: HTMLSpanElement | null;
9167
+ protected wrapper: HTMLSpanElement | null;
9133
9168
  private imageEditInfo;
9134
9169
  private imageHTMLOptions;
9135
9170
  private dndHelpers;
@@ -9142,6 +9177,7 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
9142
9177
  private croppers;
9143
9178
  private zoomScale;
9144
9179
  private disposer;
9180
+ protected isEditing: boolean;
9145
9181
  constructor(options?: ImageEditOptions);
9146
9182
  /**
9147
9183
  * Get name of this plugin
@@ -9166,20 +9202,25 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
9166
9202
  * exclusively by another plugin.
9167
9203
  * @param event The event to handle:
9168
9204
  */
9169
- onPluginEvent(_event: PluginEvent): void;
9205
+ onPluginEvent(event: PluginEvent): void;
9206
+ private isImageSelection;
9207
+ private mouseUpHandler;
9208
+ private selectBeforeEditingImage;
9209
+ private keyDownHandler;
9210
+ private applyFormatWithContentModel;
9170
9211
  private startEditing;
9171
- startRotateAndResize(editor: IEditor, image: HTMLImageElement, apiOperation?: 'resize' | 'rotate'): void;
9212
+ startRotateAndResize(editor: IEditor, image: HTMLImageElement): void;
9172
9213
  private updateRotateHandleState;
9173
9214
  isOperationAllowed(operation: ImageEditOperation): boolean;
9174
9215
  canRegenerateImage(image: HTMLImageElement): boolean;
9216
+ private startCropMode;
9175
9217
  cropImage(): void;
9176
9218
  private editImage;
9177
9219
  private cleanInfo;
9178
- private formatImageWithContentModel;
9179
9220
  private removeImageWrapper;
9180
9221
  flipImage(direction: 'horizontal' | 'vertical'): void;
9181
9222
  rotateImage(angleRad: number): void;
9182
- getWrapper(): HTMLSpanElement | null;
9223
+ get isEditingImage(): boolean;
9183
9224
  }
9184
9225
 
9185
9226
  /**
@@ -9234,7 +9275,7 @@ interface ImageEditOptions {
9234
9275
  * Which operations will be executed when image is selected
9235
9276
  * @default resizeAndRotate
9236
9277
  */
9237
- onSelectState?: ImageEditOperation;
9278
+ onSelectState?: ImageEditOperation[];
9238
9279
  }
9239
9280
 
9240
9281
  /**