roosterjs 9.10.0 → 9.11.2

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.10.0)
1
+ // Type definitions for roosterjs (Version 9.11.2)
2
2
  // Generated by dts tool from roosterjs
3
3
  // Project: https://github.com/Microsoft/roosterjs
4
4
 
@@ -3483,7 +3483,11 @@ type ExperimentalFeature = /**
3483
3483
  /**
3484
3484
  * Workaround for the Legacy Image Edit
3485
3485
  */
3486
- | 'LegacyImageSelection';
3486
+ | 'LegacyImageSelection'
3487
+ /**
3488
+ * Use Content Model handle ENTER key
3489
+ */
3490
+ | 'HandleEnterKey';
3487
3491
 
3488
3492
  /**
3489
3493
  * Options for editor
@@ -5212,6 +5216,10 @@ interface DOMHelper {
5212
5216
  * Get the width of the editable area of the editor content div
5213
5217
  */
5214
5218
  getClientWidth(): number;
5219
+ /**
5220
+ * Get a deep cloned root element
5221
+ */
5222
+ getClonedRoot(): HTMLElement;
5215
5223
  }
5216
5224
 
5217
5225
  /**
@@ -8456,11 +8464,13 @@ class AutoFormatPlugin implements EditorPlugin {
8456
8464
  * @param options An optional parameter that takes in an object of type AutoFormatOptions, which includes the following properties:
8457
8465
  * - autoBullet: A boolean that enables or disables automatic bullet list formatting. Defaults to false.
8458
8466
  * - autoNumbering: A boolean that enables or disables automatic numbering formatting. Defaults to false.
8459
- * - autoLink: A boolean that enables or disables automatic hyperlink creation when pasting or typing content. Defaults to false.
8460
- * - autoUnlink: A boolean that enables or disables automatic hyperlink removal when pressing backspace. Defaults to false.
8461
8467
  * - autoHyphen: A boolean that enables or disables automatic hyphen transformation. Defaults to false.
8462
8468
  * - autoFraction: A boolean that enables or disables automatic fraction transformation. Defaults to false.
8463
8469
  * - autoOrdinals: A boolean that enables or disables automatic ordinal number transformation. Defaults to false.
8470
+ * - autoLink: A boolean that enables or disables automatic hyperlink url address creation when pasting or typing content. Defaults to false.
8471
+ * - autoUnlink: A boolean that enables or disables automatic hyperlink removal when pressing backspace. Defaults to false.
8472
+ * - autoTel: A boolean that enables or disables automatic hyperlink telephone numbers transformation. Defaults to false.
8473
+ * - autoMailto: A boolean that enables or disables automatic hyperlink email address transformation. Defaults to false.
8464
8474
  */
8465
8475
  constructor(options?: AutoFormatOptions);
8466
8476
  /**
@@ -8495,23 +8505,15 @@ class AutoFormatPlugin implements EditorPlugin {
8495
8505
  /**
8496
8506
  * Options to customize the Content Model Auto Format Plugin
8497
8507
  */
8498
- type AutoFormatOptions = {
8508
+ interface AutoFormatOptions extends AutoLinkOptions {
8499
8509
  /**
8500
- * When true, after type *, ->, -, --, => , —, > and space key a type of bullet list will be triggered. @default true
8510
+ * When true, after type *, ->, -, --, => , —, > and space key a type of bullet list will be triggered.
8501
8511
  */
8502
8512
  autoBullet?: boolean;
8503
8513
  /**
8504
- * When true, after type 1, A, a, i, I followed by ., ), - or between () and space key a type of numbering list will be triggered. @default true
8514
+ * When true, after type 1, A, a, i, I followed by ., ), - or between () and space key a type of numbering list will be triggered.
8505
8515
  */
8506
8516
  autoNumbering?: boolean;
8507
- /**
8508
- * When press backspace before a link, remove the hyperlink
8509
- */
8510
- autoUnlink?: boolean;
8511
- /**
8512
- * When paste content, create hyperlink for the pasted link
8513
- */
8514
- autoLink?: boolean;
8515
8517
  /**
8516
8518
  * Transform -- into hyphen, if typed between two words
8517
8519
  */
@@ -8524,7 +8526,29 @@ type AutoFormatOptions = {
8524
8526
  * Transform ordinal numbers into superscript
8525
8527
  */
8526
8528
  autoOrdinals?: boolean;
8527
- };
8529
+ }
8530
+
8531
+ /**
8532
+ * Options to customize the Auto link options in Auto Format Plugin
8533
+ */
8534
+ interface AutoLinkOptions {
8535
+ /**
8536
+ * When press backspace before a link, remove the hyperlink
8537
+ */
8538
+ autoUnlink?: boolean;
8539
+ /**
8540
+ * When paste or type content with a link, create hyperlink for the link
8541
+ */
8542
+ autoLink?: boolean;
8543
+ /**
8544
+ * When paste content or type content with telephone, create hyperlink for the telephone number
8545
+ */
8546
+ autoTel?: boolean;
8547
+ /**
8548
+ * When paste or type a content with mailto, create hyperlink for the content
8549
+ */
8550
+ autoMailto?: boolean;
8551
+ }
8528
8552
 
8529
8553
  /**
8530
8554
  * Shortcut command for Bold
@@ -9210,7 +9234,7 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
9210
9234
  private shadowSpan;
9211
9235
  private selectedImage;
9212
9236
  protected wrapper: HTMLSpanElement | null;
9213
- private imageEditInfo;
9237
+ protected imageEditInfo: ImageMetadataFormat | null;
9214
9238
  private imageHTMLOptions;
9215
9239
  private dndHelpers;
9216
9240
  private clonedImage;
@@ -9253,7 +9277,10 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
9253
9277
  private mouseDownHandler;
9254
9278
  private onDropHandler;
9255
9279
  private keyDownHandler;
9256
- private applyFormatWithContentModel;
9280
+ /**
9281
+ * EXPOSED FOR TESTING PURPOSE ONLY
9282
+ */
9283
+ protected applyFormatWithContentModel(editor: IEditor, isCropMode: boolean, shouldSelectImage: boolean, isApiOperation?: boolean): void;
9257
9284
  private startEditing;
9258
9285
  startRotateAndResize(editor: IEditor, image: HTMLImageElement): void;
9259
9286
  private updateRotateHandleState;
@@ -9262,7 +9289,10 @@ class ImageEditPlugin implements ImageEditor, EditorPlugin {
9262
9289
  private startCropMode;
9263
9290
  cropImage(): void;
9264
9291
  private editImage;
9265
- private cleanInfo;
9292
+ /**
9293
+ * Exported for testing purpose only
9294
+ */
9295
+ cleanInfo(): void;
9266
9296
  private removeImageWrapper;
9267
9297
  flipImage(direction: 'horizontal' | 'vertical'): void;
9268
9298
  rotateImage(angleRad: number): void;