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