roosterjs 8.30.2 → 8.31.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 +77 -56
- package/dist/rooster-amd.js +902 -406
- 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 +77 -56
- package/dist/rooster.js +902 -406
- package/dist/rooster.js.map +1 -1
- package/package.json +7 -7
- package/tsconfig.child.tsbuildinfo +1 -1
package/dist/rooster.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Type definitions for roosterjs (Version 8.
|
|
1
|
+
// Type definitions for roosterjs (Version 8.31.0)
|
|
2
2
|
// Generated by dts tool from roosterjs
|
|
3
3
|
// Project: https://github.com/Microsoft/roosterjs
|
|
4
4
|
|
|
@@ -736,15 +736,12 @@ class VTable {
|
|
|
736
736
|
* Current column index
|
|
737
737
|
*/
|
|
738
738
|
col: number | undefined;
|
|
739
|
-
/**
|
|
740
|
-
* Selected range of cells with the coordinates of the first and last cell selected.
|
|
741
|
-
*/
|
|
742
|
-
selection: TableSelection | null;
|
|
743
739
|
/**
|
|
744
740
|
* Current format of the table
|
|
745
741
|
*/
|
|
746
742
|
formatInfo: Required<TableFormat> | null;
|
|
747
743
|
private trs;
|
|
744
|
+
private tableSelection;
|
|
748
745
|
/**
|
|
749
746
|
* Create a new instance of VTable object using HTML TABLE or TD node
|
|
750
747
|
* @param node The HTML Table or TD node
|
|
@@ -752,12 +749,18 @@ class VTable {
|
|
|
752
749
|
* @param zoomScale When the table is under a zoomed container, pass in the zoom scale here
|
|
753
750
|
*/
|
|
754
751
|
constructor(node: HTMLTableElement | HTMLTableCellElement, normalizeSize?: boolean, zoomScale?: number | SizeTransformer);
|
|
752
|
+
/**
|
|
753
|
+
* Selected range of cells with the coordinates of the first and last cell selected.
|
|
754
|
+
*/
|
|
755
|
+
get selection(): TableSelection | null;
|
|
756
|
+
set selection(value: TableSelection | null);
|
|
755
757
|
/**
|
|
756
758
|
* Write the virtual table back to DOM tree to represent the change of VTable
|
|
757
759
|
* @param skipApplyFormat Do not reapply table format when write back.
|
|
758
760
|
* Only use this parameter when you are pretty sure there is no format or table structure change during the process.
|
|
759
761
|
*/
|
|
760
762
|
writeBack(skipApplyFormat?: boolean): void;
|
|
763
|
+
private recalculateCellHeight;
|
|
761
764
|
/**
|
|
762
765
|
* Apply the given table format to this virtual table
|
|
763
766
|
* @param format Table format to apply
|
|
@@ -775,6 +778,8 @@ class VTable {
|
|
|
775
778
|
edit(operation: TableOperation | CompatibleTableOperation): void;
|
|
776
779
|
setAlignmentToSelectedCells(firstRow: number, lastRow: number, firstColumn: number, lastColumn: number, alignmentType: string, isVertical?: boolean): void;
|
|
777
780
|
private mergeCells;
|
|
781
|
+
private isEmptyCell;
|
|
782
|
+
private mergeCellContents;
|
|
778
783
|
/**
|
|
779
784
|
* Loop each cell of current column and invoke a callback function
|
|
780
785
|
* @param callback The callback function to invoke
|
|
@@ -1613,7 +1618,7 @@ function getEntitySelector(type?: string, id?: string): string;
|
|
|
1613
1618
|
* @param key Cache key string, need to be unique
|
|
1614
1619
|
* @param getter Getter function to get the object when it is not in cache yet
|
|
1615
1620
|
*/
|
|
1616
|
-
function cacheGetEventData<T>(event: PluginEvent, key: string, getter: () => T): T;
|
|
1621
|
+
function cacheGetEventData<T>(event: PluginEvent | null, key: string, getter: () => T): T;
|
|
1617
1622
|
|
|
1618
1623
|
/**
|
|
1619
1624
|
* Clear a cached object by its key from an event object
|
|
@@ -1672,7 +1677,7 @@ function adjustInsertPosition(root: HTMLElement, nodeToInsert: Node, position: N
|
|
|
1672
1677
|
* @param core The EditorCore object.
|
|
1673
1678
|
* @param range The range to delete
|
|
1674
1679
|
*/
|
|
1675
|
-
function deleteSelectedContent(root: HTMLElement, range: Range): null;
|
|
1680
|
+
function deleteSelectedContent(root: HTMLElement, range: Range): NodePosition | null;
|
|
1676
1681
|
|
|
1677
1682
|
/**
|
|
1678
1683
|
* get block element's text content.
|
|
@@ -1859,7 +1864,7 @@ class Editor implements IEditor {
|
|
|
1859
1864
|
* @param node The node to create InlineElement
|
|
1860
1865
|
* @returns The BlockElement result
|
|
1861
1866
|
*/
|
|
1862
|
-
getBlockElementAtNode(node: Node): BlockElement;
|
|
1867
|
+
getBlockElementAtNode(node: Node): BlockElement | null;
|
|
1863
1868
|
contains(arg: Node | Range): boolean;
|
|
1864
1869
|
queryElements(selector: string, scopeOrCallback?: QueryScope | CompatibleQueryScope | ((node: Node) => any), callback?: (node: Node) => any): HTMLElement[];
|
|
1865
1870
|
/**
|
|
@@ -1905,7 +1910,7 @@ class Editor implements IEditor {
|
|
|
1905
1910
|
/**
|
|
1906
1911
|
* Delete selected content
|
|
1907
1912
|
*/
|
|
1908
|
-
deleteSelectedContent(): NodePosition;
|
|
1913
|
+
deleteSelectedContent(): NodePosition | null;
|
|
1909
1914
|
/**
|
|
1910
1915
|
* Paste into editor using a clipboardData object
|
|
1911
1916
|
* @param clipboardData Clipboard data retrieved from clipboard
|
|
@@ -1921,7 +1926,7 @@ class Editor implements IEditor {
|
|
|
1921
1926
|
* Default value is true
|
|
1922
1927
|
* @returns current selection range, or null if editor never got focus before
|
|
1923
1928
|
*/
|
|
1924
|
-
getSelectionRange(tryGetFromCache?: boolean): Range;
|
|
1929
|
+
getSelectionRange(tryGetFromCache?: boolean): Range | null;
|
|
1925
1930
|
/**
|
|
1926
1931
|
* Get current selection range from Editor.
|
|
1927
1932
|
* It does a live pull on the selection, if nothing retrieved, return whatever we have in cache.
|
|
@@ -1935,7 +1940,7 @@ class Editor implements IEditor {
|
|
|
1935
1940
|
* It does a live pull on the selection, if nothing retrieved, return whatever we have in cache.
|
|
1936
1941
|
* @returns current selection path, or null if editor never got focus before
|
|
1937
1942
|
*/
|
|
1938
|
-
getSelectionPath(): SelectionPath;
|
|
1943
|
+
getSelectionPath(): SelectionPath | null;
|
|
1939
1944
|
/**
|
|
1940
1945
|
* Check if focus is in editor now
|
|
1941
1946
|
* @returns true if focus is in editor, otherwise false
|
|
@@ -1945,11 +1950,11 @@ class Editor implements IEditor {
|
|
|
1945
1950
|
* Focus to this editor, the selection was restored to where it was before, no unexpected scroll.
|
|
1946
1951
|
*/
|
|
1947
1952
|
focus(): void;
|
|
1948
|
-
select(arg1:
|
|
1953
|
+
select(arg1: Range | NodePosition | Node | SelectionPath | HTMLTableElement | null, arg2?: NodePosition | number | PositionType | TableSelection, arg3?: Node, arg4?: number | PositionType): boolean;
|
|
1949
1954
|
/**
|
|
1950
1955
|
* Get current focused position. Return null if editor doesn't have focus at this time.
|
|
1951
1956
|
*/
|
|
1952
|
-
getFocusedPosition(): NodePosition;
|
|
1957
|
+
getFocusedPosition(): NodePosition | null;
|
|
1953
1958
|
/**
|
|
1954
1959
|
* Get an HTML element from current cursor position.
|
|
1955
1960
|
* When expectedTags is not specified, return value is the current node (if it is HTML element)
|
|
@@ -1962,7 +1967,7 @@ class Editor implements IEditor {
|
|
|
1962
1967
|
* @param event Optional, if specified, editor will try to get cached result from the event object first.
|
|
1963
1968
|
* If it is not cached before, query from DOM and cache the result into the event object
|
|
1964
1969
|
*/
|
|
1965
|
-
getElementAtCursor(selector?: string, startFrom?: Node, event?: PluginEvent): HTMLElement;
|
|
1970
|
+
getElementAtCursor(selector?: string, startFrom?: Node, event?: PluginEvent): HTMLElement | null;
|
|
1966
1971
|
/**
|
|
1967
1972
|
* Check if this position is at beginning of the editor.
|
|
1968
1973
|
* This will return true if all nodes between the beginning of target node and the position are empty.
|
|
@@ -2009,7 +2014,7 @@ class Editor implements IEditor {
|
|
|
2009
2014
|
* a ContentChangedEvent will be fired with change source equal to this value
|
|
2010
2015
|
* @param canUndoByBackspace True if this action can be undone when user press Backspace key (aka Auto Complete).
|
|
2011
2016
|
*/
|
|
2012
|
-
addUndoSnapshot(callback?: (start: NodePosition, end: NodePosition) => any, changeSource?: ChangeSource | CompatibleChangeSource | string, canUndoByBackspace?: boolean, additionalData?: ContentChangedData): void;
|
|
2017
|
+
addUndoSnapshot(callback?: (start: NodePosition | null, end: NodePosition | null) => any, changeSource?: ChangeSource | CompatibleChangeSource | string, canUndoByBackspace?: boolean, additionalData?: ContentChangedData): void;
|
|
2013
2018
|
/**
|
|
2014
2019
|
* Whether there is an available undo/redo snapshot
|
|
2015
2020
|
*/
|
|
@@ -2049,19 +2054,22 @@ class Editor implements IEditor {
|
|
|
2049
2054
|
getBodyTraverser(startNode?: Node): IContentTraverser;
|
|
2050
2055
|
/**
|
|
2051
2056
|
* Get a content traverser for current selection
|
|
2057
|
+
* @returns A content traverser, or null if editor never got focus before
|
|
2052
2058
|
*/
|
|
2053
|
-
getSelectionTraverser(range?: Range): IContentTraverser;
|
|
2059
|
+
getSelectionTraverser(range?: Range): IContentTraverser | null;
|
|
2054
2060
|
/**
|
|
2055
2061
|
* Get a content traverser for current block element start from specified position
|
|
2056
2062
|
* @param startFrom Start position of the traverser. Default value is ContentPosition.SelectionStart
|
|
2063
|
+
* @returns A content traverser, or null if editor never got focus before
|
|
2057
2064
|
*/
|
|
2058
|
-
getBlockTraverser(startFrom?: ContentPosition | CompatibleContentPosition): IContentTraverser;
|
|
2065
|
+
getBlockTraverser(startFrom?: ContentPosition | CompatibleContentPosition): IContentTraverser | null;
|
|
2059
2066
|
/**
|
|
2060
2067
|
* Get a text traverser of current selection
|
|
2061
2068
|
* @param event Optional, if specified, editor will try to get cached result from the event object first.
|
|
2062
2069
|
* If it is not cached before, query from DOM and cache the result into the event object
|
|
2070
|
+
* @returns A content traverser, or null if editor never got focus before
|
|
2063
2071
|
*/
|
|
2064
|
-
getContentSearcherOfCursor(event?: PluginEvent): IPositionContentSearcher;
|
|
2072
|
+
getContentSearcherOfCursor(event?: PluginEvent): IPositionContentSearcher | null;
|
|
2065
2073
|
/**
|
|
2066
2074
|
* Run a callback function asynchronously
|
|
2067
2075
|
* @param callback The callback function to run
|
|
@@ -2075,10 +2083,10 @@ class Editor implements IEditor {
|
|
|
2075
2083
|
*/
|
|
2076
2084
|
setEditorDomAttribute(name: string, value: string): void;
|
|
2077
2085
|
/**
|
|
2078
|
-
*
|
|
2086
|
+
* Get DOM attribute of editor content DIV, null if there is no such attribute.
|
|
2079
2087
|
* @param name Name of the attribute
|
|
2080
2088
|
*/
|
|
2081
|
-
getEditorDomAttribute(name: string): string;
|
|
2089
|
+
getEditorDomAttribute(name: string): string | null;
|
|
2082
2090
|
/**
|
|
2083
2091
|
* Get current relative distance from top-left corner of the given element to top-left corner of editor content DIV.
|
|
2084
2092
|
* @param element The element to calculate from. If the given element is not in editor, return value will be null
|
|
@@ -2086,7 +2094,7 @@ class Editor implements IEditor {
|
|
|
2086
2094
|
* may be different than what user is seeing from the view. When pass false, scroll position will be ignored.
|
|
2087
2095
|
* @returns An [x, y] array which contains the left and top distances, or null if the given element is not in editor.
|
|
2088
2096
|
*/
|
|
2089
|
-
getRelativeDistanceToEditor(element: HTMLElement, addScroll?: boolean): number[];
|
|
2097
|
+
getRelativeDistanceToEditor(element: HTMLElement, addScroll?: boolean): number[] | null;
|
|
2090
2098
|
/**
|
|
2091
2099
|
* Add a Content Edit feature.
|
|
2092
2100
|
* @param feature The feature to add
|
|
@@ -2170,6 +2178,11 @@ class Editor implements IEditor {
|
|
|
2170
2178
|
* @param scale The new scale number to set. It should be positive number and no greater than 10, otherwise it will be ignored.
|
|
2171
2179
|
*/
|
|
2172
2180
|
setZoomScale(scale: number): void;
|
|
2181
|
+
/**
|
|
2182
|
+
* @returns the current EditorCore object
|
|
2183
|
+
* @throws a standard Error if there's no core object
|
|
2184
|
+
*/
|
|
2185
|
+
private getCore;
|
|
2173
2186
|
}
|
|
2174
2187
|
|
|
2175
2188
|
/**
|
|
@@ -2579,7 +2592,13 @@ function blockFormat(editor: IEditor, callback: (region: Region, start: NodePosi
|
|
|
2579
2592
|
* @param editor The Editor object
|
|
2580
2593
|
* @param chains List chains to commit
|
|
2581
2594
|
*/
|
|
2582
|
-
function
|
|
2595
|
+
function commitListChains(editor: IEditor, chains: VListChain[]): void;
|
|
2596
|
+
|
|
2597
|
+
/**
|
|
2598
|
+
* @deprecated
|
|
2599
|
+
* Same with commitListChains, keep this export just for backward compatibility
|
|
2600
|
+
*/
|
|
2601
|
+
const experimentCommitListChains: typeof commitListChains;
|
|
2583
2602
|
|
|
2584
2603
|
/**
|
|
2585
2604
|
* Get dark mode color for a given color
|
|
@@ -3471,7 +3490,7 @@ const enum ExperimentalFeatures {
|
|
|
3471
3490
|
*/
|
|
3472
3491
|
ImageRotate = "ImageRotate",
|
|
3473
3492
|
/**
|
|
3474
|
-
*
|
|
3493
|
+
* @deprecated This feature is always enabled
|
|
3475
3494
|
*/
|
|
3476
3495
|
ImageCrop = "ImageCrop",
|
|
3477
3496
|
/**
|
|
@@ -4193,7 +4212,7 @@ const enum BulletListType {
|
|
|
4193
4212
|
*/
|
|
4194
4213
|
ShortArrow = 4,
|
|
4195
4214
|
/**
|
|
4196
|
-
* Bullet triggered by ->
|
|
4215
|
+
* Bullet triggered by ->
|
|
4197
4216
|
*/
|
|
4198
4217
|
LongArrow = 5,
|
|
4199
4218
|
/**
|
|
@@ -4204,10 +4223,14 @@ const enum BulletListType {
|
|
|
4204
4223
|
* Bullet triggered by —
|
|
4205
4224
|
*/
|
|
4206
4225
|
Hyphen = 7,
|
|
4226
|
+
/**
|
|
4227
|
+
* Bullet triggered by -->
|
|
4228
|
+
*/
|
|
4229
|
+
DoubleLongArrow = 8,
|
|
4207
4230
|
/**
|
|
4208
4231
|
* Maximum value of the enum
|
|
4209
4232
|
*/
|
|
4210
|
-
Max =
|
|
4233
|
+
Max = 8
|
|
4211
4234
|
}
|
|
4212
4235
|
|
|
4213
4236
|
/**
|
|
@@ -5912,7 +5935,7 @@ interface IEditor {
|
|
|
5912
5935
|
* @param node The node to create InlineElement
|
|
5913
5936
|
* @returns The BlockElement result
|
|
5914
5937
|
*/
|
|
5915
|
-
getBlockElementAtNode(node: Node): BlockElement;
|
|
5938
|
+
getBlockElementAtNode(node: Node): BlockElement | null;
|
|
5916
5939
|
/**
|
|
5917
5940
|
* Check if the node falls in the editor content
|
|
5918
5941
|
* @param node The node to check
|
|
@@ -5998,7 +6021,7 @@ interface IEditor {
|
|
|
5998
6021
|
/**
|
|
5999
6022
|
* Delete selected content
|
|
6000
6023
|
*/
|
|
6001
|
-
deleteSelectedContent(): NodePosition;
|
|
6024
|
+
deleteSelectedContent(): NodePosition | null;
|
|
6002
6025
|
/**
|
|
6003
6026
|
* Paste into editor using a clipboardData object
|
|
6004
6027
|
* @param clipboardData Clipboard data retrieved from clipboard
|
|
@@ -6014,7 +6037,7 @@ interface IEditor {
|
|
|
6014
6037
|
* Default value is true
|
|
6015
6038
|
* @returns current selection range, or null if editor never got focus before
|
|
6016
6039
|
*/
|
|
6017
|
-
getSelectionRange(tryGetFromCache?: boolean): Range;
|
|
6040
|
+
getSelectionRange(tryGetFromCache?: boolean): Range | null;
|
|
6018
6041
|
/**
|
|
6019
6042
|
* Get current selection range from Editor.
|
|
6020
6043
|
* It does a live pull on the selection.
|
|
@@ -6026,7 +6049,7 @@ interface IEditor {
|
|
|
6026
6049
|
* It does a live pull on the selection, if nothing retrieved, return whatever we have in cache.
|
|
6027
6050
|
* @returns current selection path, or null if editor never got focus before
|
|
6028
6051
|
*/
|
|
6029
|
-
getSelectionPath(): SelectionPath;
|
|
6052
|
+
getSelectionPath(): SelectionPath | null;
|
|
6030
6053
|
/**
|
|
6031
6054
|
* Check if focus is in editor now
|
|
6032
6055
|
* @returns true if focus is in editor, otherwise false
|
|
@@ -6092,7 +6115,7 @@ interface IEditor {
|
|
|
6092
6115
|
/**
|
|
6093
6116
|
* Get current focused position. Return null if editor doesn't have focus at this time.
|
|
6094
6117
|
*/
|
|
6095
|
-
getFocusedPosition(): NodePosition;
|
|
6118
|
+
getFocusedPosition(): NodePosition | null;
|
|
6096
6119
|
/**
|
|
6097
6120
|
* Get an HTML element from current cursor position.
|
|
6098
6121
|
* When expectedTags is not specified, return value is the current node (if it is HTML element)
|
|
@@ -6105,7 +6128,7 @@ interface IEditor {
|
|
|
6105
6128
|
* @param event Optional, if specified, editor will try to get cached result from the event object first.
|
|
6106
6129
|
* If it is not cached before, query from DOM and cache the result into the event object
|
|
6107
6130
|
*/
|
|
6108
|
-
getElementAtCursor(selector?: string, startFrom?: Node, event?: PluginEvent): HTMLElement;
|
|
6131
|
+
getElementAtCursor(selector?: string, startFrom?: Node, event?: PluginEvent): HTMLElement | null;
|
|
6109
6132
|
/**
|
|
6110
6133
|
* Check if this position is at beginning of the editor.
|
|
6111
6134
|
* This will return true if all nodes between the beginning of target node and the position are empty.
|
|
@@ -6207,19 +6230,22 @@ interface IEditor {
|
|
|
6207
6230
|
getBodyTraverser(startNode?: Node): IContentTraverser;
|
|
6208
6231
|
/**
|
|
6209
6232
|
* Get a content traverser for current selection
|
|
6233
|
+
* @returns A content traverser, or null if editor never got focus before and no range is provided
|
|
6210
6234
|
*/
|
|
6211
|
-
getSelectionTraverser(range?: Range): IContentTraverser;
|
|
6235
|
+
getSelectionTraverser(range?: Range): IContentTraverser | null;
|
|
6212
6236
|
/**
|
|
6213
6237
|
* Get a content traverser for current block element start from specified position
|
|
6214
6238
|
* @param startFrom Start position of the traverser. Default value is ContentPosition.SelectionStart
|
|
6239
|
+
* @returns A content traverser, or null if editor never got focus before
|
|
6215
6240
|
*/
|
|
6216
|
-
getBlockTraverser(startFrom?: ContentPosition | CompatibleContentPosition): IContentTraverser;
|
|
6241
|
+
getBlockTraverser(startFrom?: ContentPosition | CompatibleContentPosition): IContentTraverser | null;
|
|
6217
6242
|
/**
|
|
6218
6243
|
* Get a text traverser of current selection
|
|
6219
6244
|
* @param event Optional, if specified, editor will try to get cached result from the event object first.
|
|
6220
6245
|
* If it is not cached before, query from DOM and cache the result into the event object
|
|
6246
|
+
* @returns A content traverser, or null if editor never got focus before
|
|
6221
6247
|
*/
|
|
6222
|
-
getContentSearcherOfCursor(event?: PluginEvent): IPositionContentSearcher;
|
|
6248
|
+
getContentSearcherOfCursor(event?: PluginEvent): IPositionContentSearcher | null;
|
|
6223
6249
|
/**
|
|
6224
6250
|
* Run a callback function asynchronously
|
|
6225
6251
|
* @param callback The callback function to run
|
|
@@ -6233,10 +6259,10 @@ interface IEditor {
|
|
|
6233
6259
|
*/
|
|
6234
6260
|
setEditorDomAttribute(name: string, value: string): void;
|
|
6235
6261
|
/**
|
|
6236
|
-
* Get DOM attribute of editor content DIV
|
|
6262
|
+
* Get DOM attribute of editor content DIV, null if there is no such attribute.
|
|
6237
6263
|
* @param name Name of the attribute
|
|
6238
6264
|
*/
|
|
6239
|
-
getEditorDomAttribute(name: string): string;
|
|
6265
|
+
getEditorDomAttribute(name: string): string | null;
|
|
6240
6266
|
/**
|
|
6241
6267
|
* Get current relative distance from top-left corner of the given element to top-left corner of editor content DIV.
|
|
6242
6268
|
* @param element The element to calculate from. If the given element is not in editor, return value will be null
|
|
@@ -6244,7 +6270,7 @@ interface IEditor {
|
|
|
6244
6270
|
* may be different than what user is seeing from the view. When pass false, scroll position will be ignored.
|
|
6245
6271
|
* @returns An [x, y] array which contains the left and top distances, or null if the given element is not in editor.
|
|
6246
6272
|
*/
|
|
6247
|
-
getRelativeDistanceToEditor(element: HTMLElement, addScroll?: boolean): number[];
|
|
6273
|
+
getRelativeDistanceToEditor(element: HTMLElement, addScroll?: boolean): number[] | null;
|
|
6248
6274
|
/**
|
|
6249
6275
|
* Add a Content Edit feature.
|
|
6250
6276
|
* @param feature The feature to add
|
|
@@ -6718,7 +6744,7 @@ interface CoreApiMap {
|
|
|
6718
6744
|
* @param applyCurrentStyle True if apply format of current selection to the pasted content,
|
|
6719
6745
|
* false to keep original format
|
|
6720
6746
|
*/
|
|
6721
|
-
type CreatePasteFragment = (core: EditorCore, clipboardData: ClipboardData, position: NodePosition, pasteAsText: boolean, applyCurrentStyle: boolean) => DocumentFragment | null;
|
|
6747
|
+
type CreatePasteFragment = (core: EditorCore, clipboardData: ClipboardData, position: NodePosition | null, pasteAsText: boolean, applyCurrentStyle: boolean) => DocumentFragment | null;
|
|
6722
6748
|
|
|
6723
6749
|
/**
|
|
6724
6750
|
* Ensure user will type into a container element rather than into the editor content DIV directly
|
|
@@ -6762,7 +6788,7 @@ type GetSelectionRangeEx = (core: EditorCore) => SelectionRangeEx;
|
|
|
6762
6788
|
* @param core The EditorCore objects
|
|
6763
6789
|
* @param node The node to get style from
|
|
6764
6790
|
*/
|
|
6765
|
-
type GetStyleBasedFormatState = (core: EditorCore, node: Node) => StyleBasedFormatState;
|
|
6791
|
+
type GetStyleBasedFormatState = (core: EditorCore, node: Node | null) => StyleBasedFormatState;
|
|
6766
6792
|
|
|
6767
6793
|
/**
|
|
6768
6794
|
* Get the pendable format such as underline and bold
|
|
@@ -6784,7 +6810,7 @@ type HasFocus = (core: EditorCore) => boolean;
|
|
|
6784
6810
|
* @param core The EditorCore object. No op if null.
|
|
6785
6811
|
* @param option An insert option object to specify how to insert the node
|
|
6786
6812
|
*/
|
|
6787
|
-
type InsertNode = (core: EditorCore, node: Node, option: InsertOption) => boolean;
|
|
6813
|
+
type InsertNode = (core: EditorCore, node: Node, option: InsertOption | null) => boolean;
|
|
6788
6814
|
|
|
6789
6815
|
/**
|
|
6790
6816
|
* Restore an undo snapshot into editor
|
|
@@ -6829,7 +6855,7 @@ type SwitchShadowEdit = (core: EditorCore, isOn: boolean) => void;
|
|
|
6829
6855
|
* @param forceTransform By default this function will only work when editor core is in dark mode.
|
|
6830
6856
|
* Pass true to this value to force do color transformation even editor core is in light mode
|
|
6831
6857
|
*/
|
|
6832
|
-
type TransformColor = (core: EditorCore, rootNode: Node, includeSelf: boolean, callback: (() => void) | null, direction: ColorTransformDirection | CompatibleColorTransformDirection, forceTransform?: boolean) => void;
|
|
6858
|
+
type TransformColor = (core: EditorCore, rootNode: Node | null, includeSelf: boolean, callback: (() => void) | null, direction: ColorTransformDirection | CompatibleColorTransformDirection, forceTransform?: boolean) => void;
|
|
6833
6859
|
|
|
6834
6860
|
/**
|
|
6835
6861
|
* Trigger a plugin event
|
|
@@ -6847,7 +6873,7 @@ type TriggerEvent = (core: EditorCore, pluginEvent: PluginEvent, broadcast: bool
|
|
|
6847
6873
|
* selecting, will unselect the table.
|
|
6848
6874
|
* @returns true if successful
|
|
6849
6875
|
*/
|
|
6850
|
-
type SelectTable = (core: EditorCore, table: HTMLTableElement, coordinates?: TableSelection) => TableSelectionRange | null;
|
|
6876
|
+
type SelectTable = (core: EditorCore, table: HTMLTableElement | null, coordinates?: TableSelection) => TableSelectionRange | null;
|
|
6851
6877
|
|
|
6852
6878
|
/**
|
|
6853
6879
|
* The options to specify parameters customizing an editor, used by ctor of Editor class
|
|
@@ -7751,7 +7777,7 @@ enum CompatibleExperimentalFeatures {
|
|
|
7751
7777
|
*/
|
|
7752
7778
|
ImageRotate = "ImageRotate",
|
|
7753
7779
|
/**
|
|
7754
|
-
*
|
|
7780
|
+
* @deprecated This feature is always enabled
|
|
7755
7781
|
*/
|
|
7756
7782
|
ImageCrop = "ImageCrop",
|
|
7757
7783
|
/**
|
|
@@ -8286,7 +8312,7 @@ enum CompatibleBulletListType {
|
|
|
8286
8312
|
*/
|
|
8287
8313
|
ShortArrow = 4,
|
|
8288
8314
|
/**
|
|
8289
|
-
* Bullet triggered by ->
|
|
8315
|
+
* Bullet triggered by ->
|
|
8290
8316
|
*/
|
|
8291
8317
|
LongArrow = 5,
|
|
8292
8318
|
/**
|
|
@@ -8297,10 +8323,14 @@ enum CompatibleBulletListType {
|
|
|
8297
8323
|
* Bullet triggered by —
|
|
8298
8324
|
*/
|
|
8299
8325
|
Hyphen = 7,
|
|
8326
|
+
/**
|
|
8327
|
+
* Bullet triggered by -->
|
|
8328
|
+
*/
|
|
8329
|
+
DoubleLongArrow = 8,
|
|
8300
8330
|
/**
|
|
8301
8331
|
* Maximum value of the enum
|
|
8302
8332
|
*/
|
|
8303
|
-
Max =
|
|
8333
|
+
Max = 8
|
|
8304
8334
|
}
|
|
8305
8335
|
|
|
8306
8336
|
/**
|
|
@@ -9687,13 +9717,14 @@ class TableResize implements EditorPlugin {
|
|
|
9687
9717
|
class Watermark implements EditorPlugin {
|
|
9688
9718
|
private watermark;
|
|
9689
9719
|
private format?;
|
|
9720
|
+
private customClass?;
|
|
9690
9721
|
private editor;
|
|
9691
9722
|
private disposer;
|
|
9692
9723
|
/**
|
|
9693
9724
|
* Create an instance of Watermark plugin
|
|
9694
9725
|
* @param watermark The watermark string
|
|
9695
9726
|
*/
|
|
9696
|
-
constructor(watermark: string, format?: DefaultFormat);
|
|
9727
|
+
constructor(watermark: string, format?: DefaultFormat, customClass?: string);
|
|
9697
9728
|
/**
|
|
9698
9729
|
* Get a friendly name of this plugin
|
|
9699
9730
|
*/
|
|
@@ -9755,12 +9786,6 @@ class TableCellSelection implements EditorPlugin {
|
|
|
9755
9786
|
* The table selection gets removed.
|
|
9756
9787
|
*/
|
|
9757
9788
|
private handleScrollEvent;
|
|
9758
|
-
/**
|
|
9759
|
-
* Handles the Before Copy Event.
|
|
9760
|
-
* Clear the selection range from the cloned Root.
|
|
9761
|
-
* @param event plugin event
|
|
9762
|
-
*/
|
|
9763
|
-
private handleBeforeCutCopy;
|
|
9764
9789
|
/**
|
|
9765
9790
|
* Handles the on key event.
|
|
9766
9791
|
* @param event the plugin event
|
|
@@ -9779,10 +9804,6 @@ class TableCellSelection implements EditorPlugin {
|
|
|
9779
9804
|
*/
|
|
9780
9805
|
selectionInsideTableMouseMove(event: MouseEvent): void;
|
|
9781
9806
|
private removeMouseUpEventListener;
|
|
9782
|
-
/**
|
|
9783
|
-
* When press Backspace, delete the contents inside of the selection, if it is Table Selection
|
|
9784
|
-
*/
|
|
9785
|
-
DeleteTableContents: BuildInEditFeature<PluginKeyboardEvent>;
|
|
9786
9807
|
private clearState;
|
|
9787
9808
|
private getNextTD;
|
|
9788
9809
|
private prepareSelection;
|