roosterjs 8.35.2 → 8.36.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 8.35.2)
1
+ // Type definitions for roosterjs (Version 8.36.0)
2
2
  // Generated by dts tool from roosterjs
3
3
  // Project: https://github.com/Microsoft/roosterjs
4
4
 
@@ -1715,6 +1715,22 @@ function setStyles(element: HTMLElement, styles: Record<string, string>): void;
1715
1715
  */
1716
1716
  function removeImportantStyleRule(element: HTMLElement, styleProperties: string[]): void;
1717
1717
 
1718
+ /**
1719
+ * Add global css styles
1720
+ * @param doc The document object
1721
+ * @param cssRule The css rule that must added to the selection
1722
+ * @param editorId Te id of the editor
1723
+ * @param styleId the ID of the style tag
1724
+ */
1725
+ function setGlobalCssStyles(doc: Document, cssRule: string, styleId: string): void;
1726
+
1727
+ /**
1728
+ * Remove a css rule style from a style sheet
1729
+ * @param doc The document object
1730
+ * @param styleId the ID of the style tag
1731
+ */
1732
+ function removeGlobalCssStyle(doc: Document, styleId: string): void;
1733
+
1718
1734
  /**
1719
1735
  *
1720
1736
  * @param root the contentDiv of the ditor
@@ -2669,8 +2685,9 @@ const experimentCommitListChains: typeof commitListChains;
2669
2685
  /**
2670
2686
  * Get dark mode color for a given color
2671
2687
  * @param color The color to calculate from
2688
+ * @param baseLValue The Light value for base dark color in LAB format. @default the Light value for #333333
2672
2689
  */
2673
- function getDarkColor(color: string): string;
2690
+ function getDarkColor(color: string, baseLValue?: number): string;
2674
2691
 
2675
2692
  /**
2676
2693
  * Information of current OS and web browser
@@ -3579,6 +3596,7 @@ const enum ExperimentalFeatures {
3579
3596
  */
3580
3597
  ConvertSingleImageBody = "ConvertSingleImageBody",
3581
3598
  /**
3599
+ * @deprecated This feature is always enabled
3582
3600
  * Align table elements to left, center and right using setAlignment API
3583
3601
  */
3584
3602
  TableAlignment = "TableAlignment",
@@ -3587,6 +3605,7 @@ const enum ExperimentalFeatures {
3587
3605
  */
3588
3606
  TabKeyTextFeatures = "TabKeyTextFeatures",
3589
3607
  /**
3608
+ * @deprecated this feature is always enabled
3590
3609
  * Provide a circular resize handles that adaptive the number od handles to the size of the image
3591
3610
  */
3592
3611
  AdaptiveHandlesResizer = "AdaptiveHandlesResizer",
@@ -3615,6 +3634,7 @@ const enum ExperimentalFeatures {
3615
3634
  */
3616
3635
  NormalizeList = "NormalizeList",
3617
3636
  /**
3637
+ * @deprecated this feature is always enabled
3618
3638
  * When a html image is selected, the selected image data will be stored by editor core.
3619
3639
  */
3620
3640
  ImageSelection = "ImageSelection",
@@ -3624,7 +3644,12 @@ const enum ExperimentalFeatures {
3624
3644
  * listTypes array for that item. The only list that we will ensure is correct
3625
3645
  * is the one closest to the item.
3626
3646
  */
3627
- ReuseAllAncestorListElements = "ReuseAllAncestorListElements"
3647
+ ReuseAllAncestorListElements = "ReuseAllAncestorListElements",
3648
+ /**
3649
+ * When apply default format when initialize or user type, apply the format on a SPAN element rather than
3650
+ * the block element (In most case, the DIV element) so keep the block element clean.
3651
+ */
3652
+ DefaultFormatInSpan = "DefaultFormatInSpan"
3628
3653
  }
3629
3654
 
3630
3655
  /**
@@ -6658,6 +6683,10 @@ interface CorePlugins {
6658
6683
  * Entity Plugin handles all operations related to an entity and generate entity specified events
6659
6684
  */
6660
6685
  readonly entity: PluginWithState<EntityPluginState>;
6686
+ /**
6687
+ * Image selection Plugin detects image selection and help highlight the image
6688
+ */
6689
+ readonly imageSelection: EditorPlugin;
6661
6690
  /**
6662
6691
  * NormalizeTable plugin makes sure each table in editor has TBODY/THEAD/TFOOT tag around TR tags
6663
6692
  */
@@ -6798,6 +6827,8 @@ interface CoreApiMap {
6798
6827
  * @param core The EditorCore object.
6799
6828
  * @param position The position that user is about to type to
6800
6829
  * @param keyboardEvent Optional keyboard event object
6830
+ * @param applyFormatToSpan Optional When set to true, default format (if any) will be applied to
6831
+ * a SPAN element inside the block element instead of the block element itself.
6801
6832
  */
6802
6833
  ensureTypeInContainer: EnsureTypeInContainer;
6803
6834
  /**
@@ -6934,8 +6965,10 @@ type CreatePasteFragment = (core: EditorCore, clipboardData: ClipboardData, posi
6934
6965
  * @param core The EditorCore object.
6935
6966
  * @param position The position that user is about to type to
6936
6967
  * @param keyboardEvent Optional keyboard event object
6968
+ * @param applyFormatToSpan Optional When set to true, default format (if any) will be applied to
6969
+ * a SPAN element inside the block element instead of the block element itself.
6937
6970
  */
6938
- type EnsureTypeInContainer = (core: EditorCore, position: NodePosition, keyboardEvent?: KeyboardEvent) => void;
6971
+ type EnsureTypeInContainer = (core: EditorCore, position: NodePosition, keyboardEvent?: KeyboardEvent, applyFormatToSpan?: boolean) => void;
6939
6972
 
6940
6973
  /**
6941
6974
  * Focus to editor. If there is a cached selection range, use it as current selection
@@ -7296,6 +7329,11 @@ interface ListFeatureSettings {
7296
7329
  * @default true
7297
7330
  */
7298
7331
  autoNumberingList: boolean;
7332
+ /**
7333
+ * MergeListOnBackspaceAfterList edit feature, provides the ability to merge list on backspace on block after a list.
7334
+ * @default true
7335
+ */
7336
+ mergeListOnBackspaceAfterList: boolean;
7299
7337
  }
7300
7338
 
7301
7339
  /**
@@ -7999,6 +8037,7 @@ enum CompatibleExperimentalFeatures {
7999
8037
  */
8000
8038
  ConvertSingleImageBody = "ConvertSingleImageBody",
8001
8039
  /**
8040
+ * @deprecated This feature is always enabled
8002
8041
  * Align table elements to left, center and right using setAlignment API
8003
8042
  */
8004
8043
  TableAlignment = "TableAlignment",
@@ -8007,6 +8046,7 @@ enum CompatibleExperimentalFeatures {
8007
8046
  */
8008
8047
  TabKeyTextFeatures = "TabKeyTextFeatures",
8009
8048
  /**
8049
+ * @deprecated this feature is always enabled
8010
8050
  * Provide a circular resize handles that adaptive the number od handles to the size of the image
8011
8051
  */
8012
8052
  AdaptiveHandlesResizer = "AdaptiveHandlesResizer",
@@ -8035,6 +8075,7 @@ enum CompatibleExperimentalFeatures {
8035
8075
  */
8036
8076
  NormalizeList = "NormalizeList",
8037
8077
  /**
8078
+ * @deprecated this feature is always enabled
8038
8079
  * When a html image is selected, the selected image data will be stored by editor core.
8039
8080
  */
8040
8081
  ImageSelection = "ImageSelection",
@@ -8044,7 +8085,12 @@ enum CompatibleExperimentalFeatures {
8044
8085
  * listTypes array for that item. The only list that we will ensure is correct
8045
8086
  * is the one closest to the item.
8046
8087
  */
8047
- ReuseAllAncestorListElements = "ReuseAllAncestorListElements"
8088
+ ReuseAllAncestorListElements = "ReuseAllAncestorListElements",
8089
+ /**
8090
+ * When apply default format when initialize or user type, apply the format on a SPAN element rather than
8091
+ * the block element (In most case, the DIV element) so keep the block element clean.
8092
+ */
8093
+ DefaultFormatInSpan = "DefaultFormatInSpan"
8048
8094
  }
8049
8095
 
8050
8096
  /**
@@ -9640,6 +9686,8 @@ class ImageEdit implements EditorPlugin {
9640
9686
  private disposer;
9641
9687
  private allowedOperations;
9642
9688
  private image;
9689
+ private clonedImage;
9690
+ private wrapper;
9643
9691
  private editInfo;
9644
9692
  private lastSrc;
9645
9693
  private dndHelpers;
@@ -9647,6 +9695,10 @@ class ImageEdit implements EditorPlugin {
9647
9695
  * Identify if the image was resized by the user.
9648
9696
  */
9649
9697
  private wasResized;
9698
+ /**
9699
+ * Editor zoom scale
9700
+ */
9701
+ private zoomWrapper;
9650
9702
  /**
9651
9703
  * Create a new instance of ImageEdit
9652
9704
  * @param options Image editing options
@@ -9670,11 +9722,11 @@ class ImageEdit implements EditorPlugin {
9670
9722
  dispose(): void;
9671
9723
  /**
9672
9724
  * Handle events triggered from editor
9673
- * @param event PluginEvent object
9725
+ * @param e PluginEvent object
9674
9726
  */
9675
9727
  onPluginEvent(e: PluginEvent): void;
9676
9728
  /**
9677
- * Check if the given image edit operation is allowed by this pluign
9729
+ * Check if the given image edit operation is allowed by this plugin
9678
9730
  * @param operation The image edit operation to check
9679
9731
  * @returns True means it is allowed, otherwise false
9680
9732
  */
@@ -9701,14 +9753,13 @@ class ImageEdit implements EditorPlugin {
9701
9753
  * Create editing wrapper for the image
9702
9754
  */
9703
9755
  private createWrapper;
9704
- /**
9705
- * Get image wrapper from image
9706
- * @param image The image to get wrapper from
9707
- */
9708
- private getImageWrapper;
9756
+ private toggleImageVisibility;
9757
+ private createZoomWrapper;
9758
+ private copyImageSize;
9759
+ private insertImageWrapper;
9760
+ private getStylePropertyValue;
9709
9761
  /**
9710
9762
  * Remove the temp wrapper of the image
9711
- * @param wrapper The wrapper object to remove. If not specified, remove all existing wrappers.
9712
9763
  */
9713
9764
  private removeWrapper;
9714
9765
  /**
@@ -10077,27 +10128,4 @@ class AutoFormat implements EditorPlugin {
10077
10128
  onPluginEvent(event: PluginEvent): void;
10078
10129
  }
10079
10130
 
10080
- /**
10081
- * Requires @see ExperimentalFeatures.ImageSelection to be enabled.
10082
- * Detect image selection and help highlight the image
10083
- */
10084
- class ImageSelection implements EditorPlugin {
10085
- private editor;
10086
- constructor();
10087
- /**
10088
- * Get a friendly name of this plugin
10089
- */
10090
- getName(): string;
10091
- /**
10092
- * Initialize this plugin. This should only be called from Editor
10093
- * @param editor Editor instance
10094
- */
10095
- initialize(editor: IEditor): void;
10096
- /**
10097
- * Dispose this plugin
10098
- */
10099
- dispose(): void;
10100
- onPluginEvent(event: PluginEvent): void;
10101
- }
10102
-
10103
10131
  }