roosterjs 8.35.2 → 8.37.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-amd-min.js +1 -1
- package/dist/rooster-amd-min.js.map +1 -1
- package/dist/rooster-amd.d.ts +99 -37
- package/dist/rooster-amd.js +623 -373
- package/dist/rooster-amd.js.map +1 -1
- package/dist/rooster-min.js +1 -1
- package/dist/rooster-min.js.map +1 -1
- package/dist/rooster.d.ts +99 -37
- package/dist/rooster.js +623 -373
- package/dist/rooster.js.map +1 -1
- package/package.json +8 -8
- package/tsconfig.child.tsbuildinfo +1 -1
package/dist/rooster-amd.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for roosterjs (Version 8.
|
|
1
|
+
// Type definitions for roosterjs (Version 8.37.0)
|
|
2
2
|
// Generated by dts tool from roosterjs
|
|
3
3
|
// Project: https://github.com/Microsoft/roosterjs
|
|
4
4
|
|
|
@@ -1236,8 +1236,9 @@ export class VListChain {
|
|
|
1236
1236
|
* If the child inline elements have different styles, it will not modify the styles of the list item
|
|
1237
1237
|
* @param element the LI Element to set the styles
|
|
1238
1238
|
* @param styles The styles that should be applied to the element.
|
|
1239
|
+
* @param isCssStyle True means the given styles are CSS style names, false means they are HTML attributes @default true
|
|
1239
1240
|
*/
|
|
1240
|
-
export function setListItemStyle(element: HTMLLIElement, styles: string[]): void;
|
|
1241
|
+
export function setListItemStyle(element: HTMLLIElement, styles: string[], isCssStyle?: boolean): void;
|
|
1241
1242
|
|
|
1242
1243
|
/**
|
|
1243
1244
|
* Get the format info of a table
|
|
@@ -1656,6 +1657,35 @@ export function getEntityFromElement(element: HTMLElement): Entity | null;
|
|
|
1656
1657
|
*/
|
|
1657
1658
|
export function getEntitySelector(type?: string, id?: string): string;
|
|
1658
1659
|
|
|
1660
|
+
/**
|
|
1661
|
+
* Create a placeholder comment node for entity
|
|
1662
|
+
* @param entity The entity to create placeholder from
|
|
1663
|
+
* @returns A placeholder comment node as
|
|
1664
|
+
*/
|
|
1665
|
+
export function createEntityPlaceholder(entity: Entity): HTMLElement;
|
|
1666
|
+
|
|
1667
|
+
/**
|
|
1668
|
+
* Move content from a container into a new Document fragment, and try keep entities to be reusable by creating placeholder
|
|
1669
|
+
* for them in the document fragment.
|
|
1670
|
+
* If an entity is directly under root container, the whole entity can be reused and no need to move it at all.
|
|
1671
|
+
* If an entity is not directly under root container, it is still reusable, but it may need some movement.
|
|
1672
|
+
* In any case, entities will be replaced with a placeholder in the target document fragment.
|
|
1673
|
+
* We will use an entity map (the "entities" parameter) to save the map from entity id to its wrapper element.
|
|
1674
|
+
* @param root The root element
|
|
1675
|
+
* @param entities A map from entity id to entity wrapper element
|
|
1676
|
+
* @returns A new document fragment contains all the content and entity placeholders
|
|
1677
|
+
*/
|
|
1678
|
+
export function moveContentWithEntityPlaceholders(root: HTMLDivElement, entities: Record<string, HTMLElement>): DocumentFragment;
|
|
1679
|
+
|
|
1680
|
+
/**
|
|
1681
|
+
* Restore HTML content from a document fragment that may contain entity placeholders.
|
|
1682
|
+
* @param source Source document fragment that contains HTML content and entity placeholders
|
|
1683
|
+
* @param target Target container, usually to be editor root container
|
|
1684
|
+
* @param entities A map from entity id to entity wrapper, used for reusing existing DOM structure for entity
|
|
1685
|
+
* @param insertClonedNode When pass true, merge with a cloned copy of the nodes from source fragment rather than the nodes themselves @default false
|
|
1686
|
+
*/
|
|
1687
|
+
export function restoreContentWithEntityPlaceholder(source: DocumentFragment, target: HTMLElement, entities: Record<string, HTMLElement> | null, insertClonedNode?: boolean): void;
|
|
1688
|
+
|
|
1659
1689
|
/**
|
|
1660
1690
|
* Gets the cached event data by cache key from event object if there is already one.
|
|
1661
1691
|
* Otherwise, call getter function to create one, and cache it.
|
|
@@ -1714,6 +1744,22 @@ export function setStyles(element: HTMLElement, styles: Record<string, string>):
|
|
|
1714
1744
|
*/
|
|
1715
1745
|
export function removeImportantStyleRule(element: HTMLElement, styleProperties: string[]): void;
|
|
1716
1746
|
|
|
1747
|
+
/**
|
|
1748
|
+
* Add global css styles
|
|
1749
|
+
* @param doc The document object
|
|
1750
|
+
* @param cssRule The css rule that must added to the selection
|
|
1751
|
+
* @param editorId Te id of the editor
|
|
1752
|
+
* @param styleId the ID of the style tag
|
|
1753
|
+
*/
|
|
1754
|
+
export function setGlobalCssStyles(doc: Document, cssRule: string, styleId: string): void;
|
|
1755
|
+
|
|
1756
|
+
/**
|
|
1757
|
+
* Remove a css rule style from a style sheet
|
|
1758
|
+
* @param doc The document object
|
|
1759
|
+
* @param styleId the ID of the style tag
|
|
1760
|
+
*/
|
|
1761
|
+
export function removeGlobalCssStyle(doc: Document, styleId: string): void;
|
|
1762
|
+
|
|
1717
1763
|
/**
|
|
1718
1764
|
*
|
|
1719
1765
|
* @param root the contentDiv of the ditor
|
|
@@ -2668,8 +2714,9 @@ export const experimentCommitListChains: typeof commitListChains;
|
|
|
2668
2714
|
/**
|
|
2669
2715
|
* Get dark mode color for a given color
|
|
2670
2716
|
* @param color The color to calculate from
|
|
2717
|
+
* @param baseLValue The Light value for base dark color in LAB format. @default the Light value for #333333
|
|
2671
2718
|
*/
|
|
2672
|
-
export function getDarkColor(color: string): string;
|
|
2719
|
+
export function getDarkColor(color: string, baseLValue?: number): string;
|
|
2673
2720
|
|
|
2674
2721
|
/**
|
|
2675
2722
|
* Information of current OS and web browser
|
|
@@ -2851,6 +2898,10 @@ export interface LifecyclePluginState {
|
|
|
2851
2898
|
* Cached document fragment for original content
|
|
2852
2899
|
*/
|
|
2853
2900
|
shadowEditFragment: DocumentFragment | null;
|
|
2901
|
+
/**
|
|
2902
|
+
* Cached entity pairs for original content
|
|
2903
|
+
*/
|
|
2904
|
+
shadowEditEntities: Record<string, HTMLElement> | null;
|
|
2854
2905
|
/**
|
|
2855
2906
|
* Cached selection path for original content
|
|
2856
2907
|
*/
|
|
@@ -3578,6 +3629,7 @@ export const enum ExperimentalFeatures {
|
|
|
3578
3629
|
*/
|
|
3579
3630
|
ConvertSingleImageBody = "ConvertSingleImageBody",
|
|
3580
3631
|
/**
|
|
3632
|
+
* @deprecated This feature is always enabled
|
|
3581
3633
|
* Align table elements to left, center and right using setAlignment API
|
|
3582
3634
|
*/
|
|
3583
3635
|
TableAlignment = "TableAlignment",
|
|
@@ -3586,6 +3638,7 @@ export const enum ExperimentalFeatures {
|
|
|
3586
3638
|
*/
|
|
3587
3639
|
TabKeyTextFeatures = "TabKeyTextFeatures",
|
|
3588
3640
|
/**
|
|
3641
|
+
* @deprecated this feature is always enabled
|
|
3589
3642
|
* Provide a circular resize handles that adaptive the number od handles to the size of the image
|
|
3590
3643
|
*/
|
|
3591
3644
|
AdaptiveHandlesResizer = "AdaptiveHandlesResizer",
|
|
@@ -3614,6 +3667,7 @@ export const enum ExperimentalFeatures {
|
|
|
3614
3667
|
*/
|
|
3615
3668
|
NormalizeList = "NormalizeList",
|
|
3616
3669
|
/**
|
|
3670
|
+
* @deprecated this feature is always enabled
|
|
3617
3671
|
* When a html image is selected, the selected image data will be stored by editor core.
|
|
3618
3672
|
*/
|
|
3619
3673
|
ImageSelection = "ImageSelection",
|
|
@@ -3623,7 +3677,12 @@ export const enum ExperimentalFeatures {
|
|
|
3623
3677
|
* listTypes array for that item. The only list that we will ensure is correct
|
|
3624
3678
|
* is the one closest to the item.
|
|
3625
3679
|
*/
|
|
3626
|
-
ReuseAllAncestorListElements = "ReuseAllAncestorListElements"
|
|
3680
|
+
ReuseAllAncestorListElements = "ReuseAllAncestorListElements",
|
|
3681
|
+
/**
|
|
3682
|
+
* When apply default format when initialize or user type, apply the format on a SPAN element rather than
|
|
3683
|
+
* the block element (In most case, the DIV element) so keep the block element clean.
|
|
3684
|
+
*/
|
|
3685
|
+
DefaultFormatInSpan = "DefaultFormatInSpan"
|
|
3627
3686
|
}
|
|
3628
3687
|
|
|
3629
3688
|
/**
|
|
@@ -6657,6 +6716,10 @@ export interface CorePlugins {
|
|
|
6657
6716
|
* Entity Plugin handles all operations related to an entity and generate entity specified events
|
|
6658
6717
|
*/
|
|
6659
6718
|
readonly entity: PluginWithState<EntityPluginState>;
|
|
6719
|
+
/**
|
|
6720
|
+
* Image selection Plugin detects image selection and help highlight the image
|
|
6721
|
+
*/
|
|
6722
|
+
readonly imageSelection: EditorPlugin;
|
|
6660
6723
|
/**
|
|
6661
6724
|
* NormalizeTable plugin makes sure each table in editor has TBODY/THEAD/TFOOT tag around TR tags
|
|
6662
6725
|
*/
|
|
@@ -6797,6 +6860,8 @@ export interface CoreApiMap {
|
|
|
6797
6860
|
* @param core The EditorCore object.
|
|
6798
6861
|
* @param position The position that user is about to type to
|
|
6799
6862
|
* @param keyboardEvent Optional keyboard event object
|
|
6863
|
+
* @param applyFormatToSpan Optional When set to true, default format (if any) will be applied to
|
|
6864
|
+
* a SPAN element inside the block element instead of the block element itself.
|
|
6800
6865
|
*/
|
|
6801
6866
|
ensureTypeInContainer: EnsureTypeInContainer;
|
|
6802
6867
|
/**
|
|
@@ -6933,8 +6998,10 @@ export type CreatePasteFragment = (core: EditorCore, clipboardData: ClipboardDat
|
|
|
6933
6998
|
* @param core The EditorCore object.
|
|
6934
6999
|
* @param position The position that user is about to type to
|
|
6935
7000
|
* @param keyboardEvent Optional keyboard event object
|
|
7001
|
+
* @param applyFormatToSpan Optional When set to true, default format (if any) will be applied to
|
|
7002
|
+
* a SPAN element inside the block element instead of the block element itself.
|
|
6936
7003
|
*/
|
|
6937
|
-
export type EnsureTypeInContainer = (core: EditorCore, position: NodePosition, keyboardEvent?: KeyboardEvent) => void;
|
|
7004
|
+
export type EnsureTypeInContainer = (core: EditorCore, position: NodePosition, keyboardEvent?: KeyboardEvent, applyFormatToSpan?: boolean) => void;
|
|
6938
7005
|
|
|
6939
7006
|
/**
|
|
6940
7007
|
* Focus to editor. If there is a cached selection range, use it as current selection
|
|
@@ -7295,6 +7362,11 @@ export interface ListFeatureSettings {
|
|
|
7295
7362
|
* @default true
|
|
7296
7363
|
*/
|
|
7297
7364
|
autoNumberingList: boolean;
|
|
7365
|
+
/**
|
|
7366
|
+
* MergeListOnBackspaceAfterList edit feature, provides the ability to merge list on backspace on block after a list.
|
|
7367
|
+
* @default true
|
|
7368
|
+
*/
|
|
7369
|
+
mergeListOnBackspaceAfterList: boolean;
|
|
7298
7370
|
}
|
|
7299
7371
|
|
|
7300
7372
|
/**
|
|
@@ -7998,6 +8070,7 @@ export enum CompatibleExperimentalFeatures {
|
|
|
7998
8070
|
*/
|
|
7999
8071
|
ConvertSingleImageBody = "ConvertSingleImageBody",
|
|
8000
8072
|
/**
|
|
8073
|
+
* @deprecated This feature is always enabled
|
|
8001
8074
|
* Align table elements to left, center and right using setAlignment API
|
|
8002
8075
|
*/
|
|
8003
8076
|
TableAlignment = "TableAlignment",
|
|
@@ -8006,6 +8079,7 @@ export enum CompatibleExperimentalFeatures {
|
|
|
8006
8079
|
*/
|
|
8007
8080
|
TabKeyTextFeatures = "TabKeyTextFeatures",
|
|
8008
8081
|
/**
|
|
8082
|
+
* @deprecated this feature is always enabled
|
|
8009
8083
|
* Provide a circular resize handles that adaptive the number od handles to the size of the image
|
|
8010
8084
|
*/
|
|
8011
8085
|
AdaptiveHandlesResizer = "AdaptiveHandlesResizer",
|
|
@@ -8034,6 +8108,7 @@ export enum CompatibleExperimentalFeatures {
|
|
|
8034
8108
|
*/
|
|
8035
8109
|
NormalizeList = "NormalizeList",
|
|
8036
8110
|
/**
|
|
8111
|
+
* @deprecated this feature is always enabled
|
|
8037
8112
|
* When a html image is selected, the selected image data will be stored by editor core.
|
|
8038
8113
|
*/
|
|
8039
8114
|
ImageSelection = "ImageSelection",
|
|
@@ -8043,7 +8118,12 @@ export enum CompatibleExperimentalFeatures {
|
|
|
8043
8118
|
* listTypes array for that item. The only list that we will ensure is correct
|
|
8044
8119
|
* is the one closest to the item.
|
|
8045
8120
|
*/
|
|
8046
|
-
ReuseAllAncestorListElements = "ReuseAllAncestorListElements"
|
|
8121
|
+
ReuseAllAncestorListElements = "ReuseAllAncestorListElements",
|
|
8122
|
+
/**
|
|
8123
|
+
* When apply default format when initialize or user type, apply the format on a SPAN element rather than
|
|
8124
|
+
* the block element (In most case, the DIV element) so keep the block element clean.
|
|
8125
|
+
*/
|
|
8126
|
+
DefaultFormatInSpan = "DefaultFormatInSpan"
|
|
8047
8127
|
}
|
|
8048
8128
|
|
|
8049
8129
|
/**
|
|
@@ -9639,6 +9719,8 @@ export class ImageEdit implements EditorPlugin {
|
|
|
9639
9719
|
private disposer;
|
|
9640
9720
|
private allowedOperations;
|
|
9641
9721
|
private image;
|
|
9722
|
+
private clonedImage;
|
|
9723
|
+
private wrapper;
|
|
9642
9724
|
private editInfo;
|
|
9643
9725
|
private lastSrc;
|
|
9644
9726
|
private dndHelpers;
|
|
@@ -9646,6 +9728,10 @@ export class ImageEdit implements EditorPlugin {
|
|
|
9646
9728
|
* Identify if the image was resized by the user.
|
|
9647
9729
|
*/
|
|
9648
9730
|
private wasResized;
|
|
9731
|
+
/**
|
|
9732
|
+
* Editor zoom scale
|
|
9733
|
+
*/
|
|
9734
|
+
private zoomWrapper;
|
|
9649
9735
|
/**
|
|
9650
9736
|
* Create a new instance of ImageEdit
|
|
9651
9737
|
* @param options Image editing options
|
|
@@ -9669,11 +9755,11 @@ export class ImageEdit implements EditorPlugin {
|
|
|
9669
9755
|
dispose(): void;
|
|
9670
9756
|
/**
|
|
9671
9757
|
* Handle events triggered from editor
|
|
9672
|
-
* @param
|
|
9758
|
+
* @param e PluginEvent object
|
|
9673
9759
|
*/
|
|
9674
9760
|
onPluginEvent(e: PluginEvent): void;
|
|
9675
9761
|
/**
|
|
9676
|
-
* Check if the given image edit operation is allowed by this
|
|
9762
|
+
* Check if the given image edit operation is allowed by this plugin
|
|
9677
9763
|
* @param operation The image edit operation to check
|
|
9678
9764
|
* @returns True means it is allowed, otherwise false
|
|
9679
9765
|
*/
|
|
@@ -9700,14 +9786,13 @@ export class ImageEdit implements EditorPlugin {
|
|
|
9700
9786
|
* Create editing wrapper for the image
|
|
9701
9787
|
*/
|
|
9702
9788
|
private createWrapper;
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
private
|
|
9789
|
+
private toggleImageVisibility;
|
|
9790
|
+
private createZoomWrapper;
|
|
9791
|
+
private copyImageSize;
|
|
9792
|
+
private insertImageWrapper;
|
|
9793
|
+
private getStylePropertyValue;
|
|
9708
9794
|
/**
|
|
9709
9795
|
* Remove the temp wrapper of the image
|
|
9710
|
-
* @param wrapper The wrapper object to remove. If not specified, remove all existing wrappers.
|
|
9711
9796
|
*/
|
|
9712
9797
|
private removeWrapper;
|
|
9713
9798
|
/**
|
|
@@ -10076,26 +10161,3 @@ export class AutoFormat implements EditorPlugin {
|
|
|
10076
10161
|
onPluginEvent(event: PluginEvent): void;
|
|
10077
10162
|
}
|
|
10078
10163
|
|
|
10079
|
-
/**
|
|
10080
|
-
* Requires @see ExperimentalFeatures.ImageSelection to be enabled.
|
|
10081
|
-
* Detect image selection and help highlight the image
|
|
10082
|
-
*/
|
|
10083
|
-
export class ImageSelection implements EditorPlugin {
|
|
10084
|
-
private editor;
|
|
10085
|
-
constructor();
|
|
10086
|
-
/**
|
|
10087
|
-
* Get a friendly name of this plugin
|
|
10088
|
-
*/
|
|
10089
|
-
getName(): string;
|
|
10090
|
-
/**
|
|
10091
|
-
* Initialize this plugin. This should only be called from Editor
|
|
10092
|
-
* @param editor Editor instance
|
|
10093
|
-
*/
|
|
10094
|
-
initialize(editor: IEditor): void;
|
|
10095
|
-
/**
|
|
10096
|
-
* Dispose this plugin
|
|
10097
|
-
*/
|
|
10098
|
-
dispose(): void;
|
|
10099
|
-
onPluginEvent(event: PluginEvent): void;
|
|
10100
|
-
}
|
|
10101
|
-
|