roosterjs 8.45.2 → 8.47.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 +207 -79
- package/dist/rooster-amd.js +2672 -2256
- 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 +207 -79
- package/dist/rooster.js +2672 -2256
- 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.47.0)
|
|
2
2
|
// Generated by dts tool from roosterjs
|
|
3
3
|
// Project: https://github.com/Microsoft/roosterjs
|
|
4
4
|
|
|
@@ -401,6 +401,19 @@ export function extractClipboardItems(items: DataTransferItem[], options?: Extra
|
|
|
401
401
|
*/
|
|
402
402
|
export function extractClipboardItemsForIE(dataTransfer: DataTransfer, callback: (data: ClipboardData) => void, options?: ExtractClipboardItemsForIEOptions): void;
|
|
403
403
|
|
|
404
|
+
/**
|
|
405
|
+
* Create a DocumentFragment for paste from a ClipboardData
|
|
406
|
+
* @param core The EditorCore object.
|
|
407
|
+
* @param clipboardData Clipboard data retrieved from clipboard
|
|
408
|
+
* @param position The position to paste to
|
|
409
|
+
* @param pasteAsText True to force use plain text as the content to paste, false to choose HTML or Image if any
|
|
410
|
+
* @param applyCurrentStyle True if apply format of current selection to the pasted content,
|
|
411
|
+
* @param pasteAsImage Whether to force paste as image
|
|
412
|
+
* @param event Event to trigger.
|
|
413
|
+
* false to keep original format
|
|
414
|
+
*/
|
|
415
|
+
export function createFragmentFromClipboardData(core: EditorCore, clipboardData: ClipboardData, position: NodePosition | null, pasteAsText: boolean, applyCurrentStyle: boolean, pasteAsImage: boolean, event: BeforePasteEvent): DocumentFragment;
|
|
416
|
+
|
|
404
417
|
/**
|
|
405
418
|
* Browser object contains browser and operating system information of current environment
|
|
406
419
|
*/
|
|
@@ -710,7 +723,8 @@ export function getInnerHTML(node: HTMLElement | DocumentFragment): string;
|
|
|
710
723
|
* @param isBackgroundColor Whether set background color or text color
|
|
711
724
|
* @param isDarkMode Whether current mode is dark mode. @default false
|
|
712
725
|
* @param shouldAdaptTheFontColor Whether the font color needs to be adapted to be visible in a dark or bright background color. @default false
|
|
713
|
-
* @param darkColorHandler
|
|
726
|
+
* @param darkColorHandler A dark color handler object. This is now required.
|
|
727
|
+
* We keep it optional only for backward compatibility. If it is not passed, color will not be set.
|
|
714
728
|
*/
|
|
715
729
|
export function setColor(element: HTMLElement, color: string | ModeIndependentColor, isBackgroundColor: boolean, isDarkMode?: boolean, shouldAdaptTheFontColor?: boolean, darkColorHandler?: DarkColorHandler | null): void;
|
|
716
730
|
|
|
@@ -1781,8 +1795,7 @@ export function removeImportantStyleRule(element: HTMLElement, styleProperties:
|
|
|
1781
1795
|
* Add global css styles
|
|
1782
1796
|
* @param doc The document object
|
|
1783
1797
|
* @param cssRule The css rule that must added to the selection
|
|
1784
|
-
* @param
|
|
1785
|
-
* @param styleId the ID of the style tag
|
|
1798
|
+
* @param styleId The id of the style tag
|
|
1786
1799
|
*/
|
|
1787
1800
|
export function setGlobalCssStyles(doc: Document, cssRule: string, styleId: string): void;
|
|
1788
1801
|
|
|
@@ -1945,6 +1958,14 @@ export function toArray<T extends Element>(collection: HTMLCollectionOf<T>): T[]
|
|
|
1945
1958
|
*/
|
|
1946
1959
|
export function toArray<T>(array: readonly T[]): T[];
|
|
1947
1960
|
|
|
1961
|
+
/**
|
|
1962
|
+
* This function tries to get the source of the Pasted content
|
|
1963
|
+
* @param event the before paste event
|
|
1964
|
+
* @param shouldConvertSingleImage Whether convert single image is enabled.
|
|
1965
|
+
* @returns The Type of pasted content, if no type found will return {KnownSourceType.Default}
|
|
1966
|
+
*/
|
|
1967
|
+
export function getPasteSource(event: BeforePasteEvent, shouldConvertSingleImage: boolean): KnownPasteSourceType;
|
|
1968
|
+
|
|
1948
1969
|
/**
|
|
1949
1970
|
* RoosterJs core editor class
|
|
1950
1971
|
*/
|
|
@@ -2093,7 +2114,7 @@ export class EditorBase<TEditorCore extends EditorCore, TEditorOptions extends E
|
|
|
2093
2114
|
* Focus to this editor, the selection was restored to where it was before, no unexpected scroll.
|
|
2094
2115
|
*/
|
|
2095
2116
|
focus(): void;
|
|
2096
|
-
select(arg1: Range | SelectionRangeEx | NodePosition | Node | SelectionPath | null, arg2?: NodePosition | number | PositionType | TableSelection, arg3?: Node, arg4?: number | PositionType): boolean;
|
|
2117
|
+
select(arg1: Range | SelectionRangeEx | NodePosition | Node | SelectionPath | null, arg2?: NodePosition | number | PositionType | TableSelection | null, arg3?: Node, arg4?: number | PositionType): boolean;
|
|
2097
2118
|
/**
|
|
2098
2119
|
* Get current focused position. Return null if editor doesn't have focus at this time.
|
|
2099
2120
|
*/
|
|
@@ -2282,9 +2303,9 @@ export class EditorBase<TEditorCore extends EditorCore, TEditorOptions extends E
|
|
|
2282
2303
|
*/
|
|
2283
2304
|
transformToDarkColor(node: Node): void;
|
|
2284
2305
|
/**
|
|
2285
|
-
* Get a darkColorHandler object for this editor.
|
|
2306
|
+
* Get a darkColorHandler object for this editor.
|
|
2286
2307
|
*/
|
|
2287
|
-
getDarkColorHandler(): DarkColorHandler
|
|
2308
|
+
getDarkColorHandler(): DarkColorHandler;
|
|
2288
2309
|
/**
|
|
2289
2310
|
* Make the editor in "Shadow Edit" mode.
|
|
2290
2311
|
* In Shadow Edit mode, all format change will finally be ignored.
|
|
@@ -2435,8 +2456,11 @@ export function getElementBasedFormatState(editor: IEditor, event?: PluginEvent)
|
|
|
2435
2456
|
* If isBlock is true, entity will be insert below this position
|
|
2436
2457
|
* @param insertToRegionRoot @optional When pass true, insert the entity at the root level of current region.
|
|
2437
2458
|
* Parent nodes will be split if need
|
|
2459
|
+
* @param focusAfterEntity @optional When pass true, focus will be moved next to the entity. For inline entity,
|
|
2460
|
+
* focus will be after right after the entity (and the delimiter if exist). For block entity, focus will be in
|
|
2461
|
+
* the new empty line below the entity
|
|
2438
2462
|
*/
|
|
2439
|
-
export function insertEntity(editor: IEditor, type: string, contentNode: Node, isBlock: boolean, isReadonly: boolean, position?: NodePosition | ContentPosition.Begin | ContentPosition.End | ContentPosition.DomEnd, insertToRegionRoot?: boolean): Entity;
|
|
2463
|
+
export function insertEntity(editor: IEditor, type: string, contentNode: Node, isBlock: boolean, isReadonly: boolean, position?: NodePosition | ContentPosition.Begin | ContentPosition.End | ContentPosition.DomEnd | CompatibleContentPosition.Begin | CompatibleContentPosition.End | CompatibleContentPosition.DomEnd, insertToRegionRoot?: boolean, focusAfterEntity?: boolean): Entity;
|
|
2440
2464
|
|
|
2441
2465
|
/**
|
|
2442
2466
|
* Insert an image to editor at current selection
|
|
@@ -3519,6 +3543,7 @@ export const enum ContentPosition {
|
|
|
3519
3543
|
}
|
|
3520
3544
|
|
|
3521
3545
|
/**
|
|
3546
|
+
* @deprecated
|
|
3522
3547
|
* Constants string for dataset names used by dark mode
|
|
3523
3548
|
*/
|
|
3524
3549
|
export const enum DarkModeDatasetNames {
|
|
@@ -3737,13 +3762,21 @@ export const enum ExperimentalFeatures {
|
|
|
3737
3762
|
*/
|
|
3738
3763
|
ImageSelection = "ImageSelection",
|
|
3739
3764
|
/**
|
|
3740
|
-
*
|
|
3765
|
+
* @deprecated this feature is always enabled
|
|
3766
|
+
* Use variable-based dark mode solution rather than dataset-based solution.
|
|
3767
|
+
* When enable this feature, need to pass in a DarkModelHandler object to each call of setColor and applyFormat
|
|
3768
|
+
* if you need them work for dark mode
|
|
3741
3769
|
*/
|
|
3742
|
-
|
|
3770
|
+
VariableBasedDarkColor = "VariableBasedDarkColor",
|
|
3743
3771
|
/**
|
|
3772
|
+
* @deprecated this feature is always enabled
|
|
3744
3773
|
* Align list elements elements to left, center and right using setAlignment API
|
|
3745
3774
|
*/
|
|
3746
3775
|
ListItemAlignment = "ListItemAlignment",
|
|
3776
|
+
/**
|
|
3777
|
+
* Provide additional Tab Key Features. Requires Text Features Content Editable Features
|
|
3778
|
+
*/
|
|
3779
|
+
TabKeyTextFeatures = "TabKeyTextFeatures",
|
|
3747
3780
|
/**
|
|
3748
3781
|
* Trigger formatting by a especial characters. Ex: (A), 1. i).
|
|
3749
3782
|
*/
|
|
@@ -3760,16 +3793,18 @@ export const enum ExperimentalFeatures {
|
|
|
3760
3793
|
* the block element (In most case, the DIV element) so keep the block element clean.
|
|
3761
3794
|
*/
|
|
3762
3795
|
DefaultFormatInSpan = "DefaultFormatInSpan",
|
|
3763
|
-
/**
|
|
3764
|
-
* Use variable-based dark mode solution rather than dataset-based solution.
|
|
3765
|
-
* When enable this feature, need to pass in a DarkModelHandler object to each call of setColor and applyFormat
|
|
3766
|
-
* if you need them work for dark mode
|
|
3767
|
-
*/
|
|
3768
|
-
VariableBasedDarkColor = "VariableBasedDarkColor",
|
|
3769
3796
|
/**
|
|
3770
3797
|
* Reuse existing DOM structure if possible when convert Content Model back to DOM tree
|
|
3771
3798
|
*/
|
|
3772
3799
|
ReusableContentModel = "ReusableContentModel",
|
|
3800
|
+
/**
|
|
3801
|
+
* Handle keyboard editing event with Content Model
|
|
3802
|
+
*/
|
|
3803
|
+
EditWithContentModel = "EditWithContentModel",
|
|
3804
|
+
/**
|
|
3805
|
+
* Apply default format on editor container
|
|
3806
|
+
*/
|
|
3807
|
+
DefaultFormatOnContainer = "DefaultFormatOnContainer",
|
|
3773
3808
|
/**
|
|
3774
3809
|
* Delete table with Backspace key with the whole was selected with table selector
|
|
3775
3810
|
*/
|
|
@@ -3777,7 +3812,11 @@ export const enum ExperimentalFeatures {
|
|
|
3777
3812
|
/**
|
|
3778
3813
|
* Add entities around a Read Only Inline entity to prevent cursor to be hidden when cursor is next of it.
|
|
3779
3814
|
*/
|
|
3780
|
-
InlineEntityReadOnlyDelimiters = "InlineEntityReadOnlyDelimiters"
|
|
3815
|
+
InlineEntityReadOnlyDelimiters = "InlineEntityReadOnlyDelimiters",
|
|
3816
|
+
/**
|
|
3817
|
+
* Paste with Content model
|
|
3818
|
+
*/
|
|
3819
|
+
ContentModelPaste = "ContentModelPaste"
|
|
3781
3820
|
}
|
|
3782
3821
|
|
|
3783
3822
|
/**
|
|
@@ -4151,6 +4190,20 @@ export const enum KnownCreateElementDataIndex {
|
|
|
4151
4190
|
EmptyLineFormatInSpan = 12
|
|
4152
4191
|
}
|
|
4153
4192
|
|
|
4193
|
+
/**
|
|
4194
|
+
* Represent the types of sources to handle in the Paste Plugin
|
|
4195
|
+
*/
|
|
4196
|
+
export const enum KnownPasteSourceType {
|
|
4197
|
+
WordDesktop = 0,
|
|
4198
|
+
ExcelDesktop = 1,
|
|
4199
|
+
ExcelOnline = 2,
|
|
4200
|
+
PowerPointDesktop = 3,
|
|
4201
|
+
GoogleSheets = 4,
|
|
4202
|
+
WacComponents = 5,
|
|
4203
|
+
Default = 6,
|
|
4204
|
+
SingleImage = 7
|
|
4205
|
+
}
|
|
4206
|
+
|
|
4154
4207
|
/**
|
|
4155
4208
|
* Table format border
|
|
4156
4209
|
*/
|
|
@@ -4325,7 +4378,13 @@ export const enum PluginEventType {
|
|
|
4325
4378
|
* EXPERIMENTAL FEATURE
|
|
4326
4379
|
* Editor changed the selection.
|
|
4327
4380
|
*/
|
|
4328
|
-
SelectionChanged = 22
|
|
4381
|
+
SelectionChanged = 22,
|
|
4382
|
+
/**
|
|
4383
|
+
* EXPERIMENTAL FEATURE
|
|
4384
|
+
* Editor content is about to be changed by keyboard event.
|
|
4385
|
+
* This is only used by Content Model editing
|
|
4386
|
+
*/
|
|
4387
|
+
BeforeKeyboardEditing = 23
|
|
4329
4388
|
}
|
|
4330
4389
|
|
|
4331
4390
|
/**
|
|
@@ -4520,6 +4579,28 @@ export const enum DefinitionType {
|
|
|
4520
4579
|
Customize = 5
|
|
4521
4580
|
}
|
|
4522
4581
|
|
|
4582
|
+
/**
|
|
4583
|
+
* Enum for paste options
|
|
4584
|
+
*/
|
|
4585
|
+
export const enum PasteType {
|
|
4586
|
+
/**
|
|
4587
|
+
* Default paste behavior
|
|
4588
|
+
*/
|
|
4589
|
+
Normal = 0,
|
|
4590
|
+
/**
|
|
4591
|
+
* Paste only the plain text
|
|
4592
|
+
*/
|
|
4593
|
+
AsPlainText = 1,
|
|
4594
|
+
/**
|
|
4595
|
+
* Apply the current style to pasted content
|
|
4596
|
+
*/
|
|
4597
|
+
MergeFormat = 2,
|
|
4598
|
+
/**
|
|
4599
|
+
* If there is a image uri in the clipboard, paste the content as image element
|
|
4600
|
+
*/
|
|
4601
|
+
AsImage = 3
|
|
4602
|
+
}
|
|
4603
|
+
|
|
4523
4604
|
/**
|
|
4524
4605
|
* Provides a chance for plugin to change the content before it is copied from editor.
|
|
4525
4606
|
*/
|
|
@@ -4618,6 +4699,10 @@ export interface BeforePasteEventData {
|
|
|
4618
4699
|
* Attributes of the root "HTML" tag
|
|
4619
4700
|
*/
|
|
4620
4701
|
htmlAttributes: Record<string, string>;
|
|
4702
|
+
/**
|
|
4703
|
+
* Paste type option (as plain text, merge format, normal, as image)
|
|
4704
|
+
*/
|
|
4705
|
+
readonly pasteType: PasteType | CompatiblePasteType;
|
|
4621
4706
|
}
|
|
4622
4707
|
|
|
4623
4708
|
/**
|
|
@@ -5008,7 +5093,7 @@ export interface PluginContextMenuEventData {
|
|
|
5008
5093
|
/**
|
|
5009
5094
|
* Editor plugin event interface
|
|
5010
5095
|
*/
|
|
5011
|
-
export type PluginEvent = BeforeCutCopyEvent | BeforePasteEvent | ContentChangedEvent | EntityOperationEvent | ExtractContentWithDomEvent | PluginDomEvent | EditorReadyEvent | BeforeDisposeEvent | PendingFormatStateChangedEvent | EnterShadowEditEvent | LeaveShadowEditEvent | EditImageEvent | BeforeSetContentEvent | ZoomChangedEvent | SelectionChangedEvent | CompatibleBeforeCutCopyEvent | CompatibleBeforeDisposeEvent | CompatibleBeforePasteEvent | CompatibleBeforeSetContentEvent | CompatibleContentChangedEvent | CompatibleEditImageEvent | CompatibleEditorReadyEvent | CompatibleEntityOperationEvent | CompatibleExtractContentWithDomEvent | CompatiblePendingFormatStateChangedEvent | CompatiblePluginDomEvent | CompatibleEnterShadowEditEvent | CompatibleLeaveShadowEditEvent | CompatibleZoomChangedEvent | CompatibleSelectionChangedEvent;
|
|
5096
|
+
export type PluginEvent = BeforeCutCopyEvent | BeforePasteEvent | ContentChangedEvent | EntityOperationEvent | ExtractContentWithDomEvent | PluginDomEvent | EditorReadyEvent | BeforeDisposeEvent | PendingFormatStateChangedEvent | EnterShadowEditEvent | LeaveShadowEditEvent | EditImageEvent | BeforeSetContentEvent | ZoomChangedEvent | SelectionChangedEvent | BeforeKeyboardEditingEvent | CompatibleBeforeCutCopyEvent | CompatibleBeforeDisposeEvent | CompatibleBeforePasteEvent | CompatibleBeforeSetContentEvent | CompatibleContentChangedEvent | CompatibleEditImageEvent | CompatibleEditorReadyEvent | CompatibleEntityOperationEvent | CompatibleExtractContentWithDomEvent | CompatiblePendingFormatStateChangedEvent | CompatiblePluginDomEvent | CompatibleEnterShadowEditEvent | CompatibleLeaveShadowEditEvent | CompatibleZoomChangedEvent | CompatibleSelectionChangedEvent | CompatibleBeforeKeyboardEditingEvent;
|
|
5012
5097
|
|
|
5013
5098
|
/**
|
|
5014
5099
|
* A type to extract data part of a plugin event type. Data part is the plugin event without eventType field.
|
|
@@ -5122,6 +5207,28 @@ export interface SelectionChangedEventData {
|
|
|
5122
5207
|
export interface CompatibleSelectionChangedEvent extends SelectionChangedEventData, BasePluginEvent<CompatiblePluginEventType.SelectionChanged> {
|
|
5123
5208
|
}
|
|
5124
5209
|
|
|
5210
|
+
/**
|
|
5211
|
+
* Provides a chance for plugin to change the content before it is copied from editor.
|
|
5212
|
+
*/
|
|
5213
|
+
export interface BeforeKeyboardEditingEvent extends BeforeKeyboardEditingData, BasePluginEvent<PluginEventType.BeforeKeyboardEditing> {
|
|
5214
|
+
}
|
|
5215
|
+
|
|
5216
|
+
/**
|
|
5217
|
+
* Data of BeforeKeyboardEditing
|
|
5218
|
+
*/
|
|
5219
|
+
export interface BeforeKeyboardEditingData {
|
|
5220
|
+
/**
|
|
5221
|
+
* Raw DOM event
|
|
5222
|
+
*/
|
|
5223
|
+
rawEvent: KeyboardEvent;
|
|
5224
|
+
}
|
|
5225
|
+
|
|
5226
|
+
/**
|
|
5227
|
+
* Provides a chance for plugin to change the content before it is copied from editor.
|
|
5228
|
+
*/
|
|
5229
|
+
export interface CompatibleBeforeKeyboardEditingEvent extends BeforeKeyboardEditingData, BasePluginEvent<CompatiblePluginEventType.BeforeKeyboardEditing> {
|
|
5230
|
+
}
|
|
5231
|
+
|
|
5125
5232
|
/**
|
|
5126
5233
|
* This refers to a "content block" in editor that serves as a content parsing boundary
|
|
5127
5234
|
* It is most those html block like tags, i.e. <p>, <div>, <li>, <td> etc.
|
|
@@ -5637,7 +5744,7 @@ export interface InsertOptionBase {
|
|
|
5637
5744
|
* The "basic" insertNode related ContentPositions that require no additional parameters to use.
|
|
5638
5745
|
*/
|
|
5639
5746
|
export interface InsertOptionBasic extends InsertOptionBase {
|
|
5640
|
-
position: ContentPosition.Begin | ContentPosition.End | ContentPosition.DomEnd | ContentPosition.Outside | ContentPosition.SelectionStart;
|
|
5747
|
+
position: ContentPosition.Begin | ContentPosition.End | ContentPosition.DomEnd | ContentPosition.Outside | ContentPosition.SelectionStart | CompatibleContentPosition.Begin | CompatibleContentPosition.End | CompatibleContentPosition.DomEnd | CompatibleContentPosition.Outside | CompatibleContentPosition.SelectionStart;
|
|
5641
5748
|
}
|
|
5642
5749
|
|
|
5643
5750
|
/**
|
|
@@ -6071,7 +6178,7 @@ export interface HtmlSanitizerOptions {
|
|
|
6071
6178
|
*
|
|
6072
6179
|
* For other unknown tags, we will respect the value of unknownTagReplacement with the same meaning
|
|
6073
6180
|
*/
|
|
6074
|
-
additionalTagReplacements?: Record<string, string>;
|
|
6181
|
+
additionalTagReplacements?: Record<string, string | null>;
|
|
6075
6182
|
/**
|
|
6076
6183
|
* Allowed HTML attributes in addition to default attributes, in lower case
|
|
6077
6184
|
*/
|
|
@@ -6453,9 +6560,9 @@ export interface IEditor {
|
|
|
6453
6560
|
/**
|
|
6454
6561
|
* Select content using the Table Selection
|
|
6455
6562
|
* @param table to select
|
|
6456
|
-
* @param coordinates first and last cell of the range
|
|
6563
|
+
* @param coordinates first and last cell of the range, if null is provided will remove the selection on the table
|
|
6457
6564
|
*/
|
|
6458
|
-
select(table: HTMLTableElement, coordinates: TableSelection): boolean;
|
|
6565
|
+
select(table: HTMLTableElement, coordinates: TableSelection | null): boolean;
|
|
6459
6566
|
/**
|
|
6460
6567
|
* Select content SelectionRangeEx
|
|
6461
6568
|
* @param rangeEx SelectionRangeEx object to specify what to select
|
|
@@ -6664,9 +6771,9 @@ export interface IEditor {
|
|
|
6664
6771
|
*/
|
|
6665
6772
|
transformToDarkColor(node: Node): void;
|
|
6666
6773
|
/**
|
|
6667
|
-
* Get a darkColorHandler object for this editor.
|
|
6774
|
+
* Get a darkColorHandler object for this editor.
|
|
6668
6775
|
*/
|
|
6669
|
-
getDarkColorHandler(): DarkColorHandler
|
|
6776
|
+
getDarkColorHandler(): DarkColorHandler;
|
|
6670
6777
|
/**
|
|
6671
6778
|
* Make the editor in "Shadow Edit" mode.
|
|
6672
6779
|
* In Shadow Edit mode, all format change will finally be ignored.
|
|
@@ -6999,7 +7106,7 @@ export interface EditorCore extends PluginState {
|
|
|
6999
7106
|
* Dark model handler for the editor, used for variable-based solution.
|
|
7000
7107
|
* If keep it null, editor will still use original dataset-based dark mode solution.
|
|
7001
7108
|
*/
|
|
7002
|
-
darkColorHandler
|
|
7109
|
+
darkColorHandler: DarkColorHandler;
|
|
7003
7110
|
}
|
|
7004
7111
|
|
|
7005
7112
|
/**
|
|
@@ -7123,7 +7230,7 @@ export interface CoreApiMap {
|
|
|
7123
7230
|
* There are a bunch of allowed combination of parameters. See IEditor.select for more details
|
|
7124
7231
|
* @param core The editor core object
|
|
7125
7232
|
* @param arg1 A DOM Range, or SelectionRangeEx, or NodePosition, or Node, or Selection Path
|
|
7126
|
-
* @param arg2 (optional) A NodePosition, or an offset number, or a PositionType, or a TableSelection
|
|
7233
|
+
* @param arg2 (optional) A NodePosition, or an offset number, or a PositionType, or a TableSelection, or null
|
|
7127
7234
|
* @param arg3 (optional) A Node
|
|
7128
7235
|
* @param arg4 (optional) An offset number, or a PositionType
|
|
7129
7236
|
*/
|
|
@@ -7281,11 +7388,11 @@ export type RestoreUndoSnapshot = (core: EditorCore, step: number) => void;
|
|
|
7281
7388
|
* There are a bunch of allowed combination of parameters. See IEditor.select for more details
|
|
7282
7389
|
* @param core The editor core object
|
|
7283
7390
|
* @param arg1 A DOM Range, or SelectionRangeEx, or NodePosition, or Node, or Selection Path
|
|
7284
|
-
* @param arg2 (optional) A NodePosition, or an offset number, or a PositionType, or a TableSelection
|
|
7391
|
+
* @param arg2 (optional) A NodePosition, or an offset number, or a PositionType, or a TableSelection, or null
|
|
7285
7392
|
* @param arg3 (optional) A Node
|
|
7286
7393
|
* @param arg4 (optional) An offset number, or a PositionType
|
|
7287
7394
|
*/
|
|
7288
|
-
export type Select = (core: EditorCore, arg1: Range | SelectionRangeEx | NodePosition | Node | SelectionPath | null, arg2?: NodePosition | number | PositionType | TableSelection, arg3?: Node, arg4?: number | PositionType) => boolean;
|
|
7395
|
+
export type Select = (core: EditorCore, arg1: Range | SelectionRangeEx | NodePosition | Node | SelectionPath | null, arg2?: NodePosition | number | PositionType | TableSelection | null, arg3?: Node, arg4?: number | PositionType) => boolean;
|
|
7289
7396
|
|
|
7290
7397
|
/**
|
|
7291
7398
|
* Change the editor selection to the given range
|
|
@@ -8375,13 +8482,21 @@ export enum CompatibleExperimentalFeatures {
|
|
|
8375
8482
|
*/
|
|
8376
8483
|
ImageSelection = "ImageSelection",
|
|
8377
8484
|
/**
|
|
8378
|
-
*
|
|
8485
|
+
* @deprecated this feature is always enabled
|
|
8486
|
+
* Use variable-based dark mode solution rather than dataset-based solution.
|
|
8487
|
+
* When enable this feature, need to pass in a DarkModelHandler object to each call of setColor and applyFormat
|
|
8488
|
+
* if you need them work for dark mode
|
|
8379
8489
|
*/
|
|
8380
|
-
|
|
8490
|
+
VariableBasedDarkColor = "VariableBasedDarkColor",
|
|
8381
8491
|
/**
|
|
8492
|
+
* @deprecated this feature is always enabled
|
|
8382
8493
|
* Align list elements elements to left, center and right using setAlignment API
|
|
8383
8494
|
*/
|
|
8384
8495
|
ListItemAlignment = "ListItemAlignment",
|
|
8496
|
+
/**
|
|
8497
|
+
* Provide additional Tab Key Features. Requires Text Features Content Editable Features
|
|
8498
|
+
*/
|
|
8499
|
+
TabKeyTextFeatures = "TabKeyTextFeatures",
|
|
8385
8500
|
/**
|
|
8386
8501
|
* Trigger formatting by a especial characters. Ex: (A), 1. i).
|
|
8387
8502
|
*/
|
|
@@ -8398,16 +8513,18 @@ export enum CompatibleExperimentalFeatures {
|
|
|
8398
8513
|
* the block element (In most case, the DIV element) so keep the block element clean.
|
|
8399
8514
|
*/
|
|
8400
8515
|
DefaultFormatInSpan = "DefaultFormatInSpan",
|
|
8401
|
-
/**
|
|
8402
|
-
* Use variable-based dark mode solution rather than dataset-based solution.
|
|
8403
|
-
* When enable this feature, need to pass in a DarkModelHandler object to each call of setColor and applyFormat
|
|
8404
|
-
* if you need them work for dark mode
|
|
8405
|
-
*/
|
|
8406
|
-
VariableBasedDarkColor = "VariableBasedDarkColor",
|
|
8407
8516
|
/**
|
|
8408
8517
|
* Reuse existing DOM structure if possible when convert Content Model back to DOM tree
|
|
8409
8518
|
*/
|
|
8410
8519
|
ReusableContentModel = "ReusableContentModel",
|
|
8520
|
+
/**
|
|
8521
|
+
* Handle keyboard editing event with Content Model
|
|
8522
|
+
*/
|
|
8523
|
+
EditWithContentModel = "EditWithContentModel",
|
|
8524
|
+
/**
|
|
8525
|
+
* Apply default format on editor container
|
|
8526
|
+
*/
|
|
8527
|
+
DefaultFormatOnContainer = "DefaultFormatOnContainer",
|
|
8411
8528
|
/**
|
|
8412
8529
|
* Delete table with Backspace key with the whole was selected with table selector
|
|
8413
8530
|
*/
|
|
@@ -8415,7 +8532,11 @@ export enum CompatibleExperimentalFeatures {
|
|
|
8415
8532
|
/**
|
|
8416
8533
|
* Add entities around a Read Only Inline entity to prevent cursor to be hidden when cursor is next of it.
|
|
8417
8534
|
*/
|
|
8418
|
-
InlineEntityReadOnlyDelimiters = "InlineEntityReadOnlyDelimiters"
|
|
8535
|
+
InlineEntityReadOnlyDelimiters = "InlineEntityReadOnlyDelimiters",
|
|
8536
|
+
/**
|
|
8537
|
+
* Paste with Content model
|
|
8538
|
+
*/
|
|
8539
|
+
ContentModelPaste = "ContentModelPaste"
|
|
8419
8540
|
}
|
|
8420
8541
|
|
|
8421
8542
|
/**
|
|
@@ -8518,7 +8639,35 @@ export enum CompatiblePluginEventType {
|
|
|
8518
8639
|
* EXPERIMENTAL FEATURE
|
|
8519
8640
|
* Editor changed the selection.
|
|
8520
8641
|
*/
|
|
8521
|
-
SelectionChanged = 22
|
|
8642
|
+
SelectionChanged = 22,
|
|
8643
|
+
/**
|
|
8644
|
+
* EXPERIMENTAL FEATURE
|
|
8645
|
+
* Editor content is about to be changed by keyboard event.
|
|
8646
|
+
* This is only used by Content Model editing
|
|
8647
|
+
*/
|
|
8648
|
+
BeforeKeyboardEditing = 23
|
|
8649
|
+
}
|
|
8650
|
+
|
|
8651
|
+
/**
|
|
8652
|
+
* Enum for paste options
|
|
8653
|
+
*/
|
|
8654
|
+
export enum CompatiblePasteType {
|
|
8655
|
+
/**
|
|
8656
|
+
* Default paste behavior
|
|
8657
|
+
*/
|
|
8658
|
+
Normal = 0,
|
|
8659
|
+
/**
|
|
8660
|
+
* Paste only the plain text
|
|
8661
|
+
*/
|
|
8662
|
+
AsPlainText = 1,
|
|
8663
|
+
/**
|
|
8664
|
+
* Apply the current style to pasted content
|
|
8665
|
+
*/
|
|
8666
|
+
MergeFormat = 2,
|
|
8667
|
+
/**
|
|
8668
|
+
* If there is a image uri in the clipboard, paste the content as image element
|
|
8669
|
+
*/
|
|
8670
|
+
AsImage = 3
|
|
8522
8671
|
}
|
|
8523
8672
|
|
|
8524
8673
|
/**
|
|
@@ -9051,6 +9200,7 @@ export enum CompatibleContentType {
|
|
|
9051
9200
|
}
|
|
9052
9201
|
|
|
9053
9202
|
/**
|
|
9203
|
+
* @deprecated
|
|
9054
9204
|
* Constants string for dataset names used by dark mode
|
|
9055
9205
|
*/
|
|
9056
9206
|
export enum CompatibleDarkModeDatasetNames {
|
|
@@ -9509,6 +9659,20 @@ export enum CompatibleKnownCreateElementDataIndex {
|
|
|
9509
9659
|
EmptyLineFormatInSpan = 12
|
|
9510
9660
|
}
|
|
9511
9661
|
|
|
9662
|
+
/**
|
|
9663
|
+
* Represent the types of sources to handle in the Paste Plugin
|
|
9664
|
+
*/
|
|
9665
|
+
export enum CompatibleKnownPasteSourceType {
|
|
9666
|
+
WordDesktop = 0,
|
|
9667
|
+
ExcelDesktop = 1,
|
|
9668
|
+
ExcelOnline = 2,
|
|
9669
|
+
PowerPointDesktop = 3,
|
|
9670
|
+
GoogleSheets = 4,
|
|
9671
|
+
WacComponents = 5,
|
|
9672
|
+
Default = 6,
|
|
9673
|
+
SingleImage = 7
|
|
9674
|
+
}
|
|
9675
|
+
|
|
9512
9676
|
/**
|
|
9513
9677
|
* Type of list (numbering or bullet)
|
|
9514
9678
|
*/
|
|
@@ -10404,15 +10568,8 @@ export class Watermark implements EditorPlugin {
|
|
|
10404
10568
|
*/
|
|
10405
10569
|
export class TableCellSelection implements EditorPlugin {
|
|
10406
10570
|
private editor;
|
|
10407
|
-
private
|
|
10408
|
-
private
|
|
10409
|
-
private tableRange;
|
|
10410
|
-
private tableSelection;
|
|
10411
|
-
private startedSelection;
|
|
10412
|
-
private vTable;
|
|
10413
|
-
private firstTable;
|
|
10414
|
-
private targetTable;
|
|
10415
|
-
private preventKeyUp;
|
|
10571
|
+
private state;
|
|
10572
|
+
private shadowEditCoordinatesBackup;
|
|
10416
10573
|
constructor();
|
|
10417
10574
|
/**
|
|
10418
10575
|
* Get a friendly name of this plugin
|
|
@@ -10432,37 +10589,8 @@ export class TableCellSelection implements EditorPlugin {
|
|
|
10432
10589
|
* @param event PluginEvent object
|
|
10433
10590
|
*/
|
|
10434
10591
|
onPluginEvent(event: PluginEvent): void;
|
|
10435
|
-
|
|
10436
|
-
|
|
10437
|
-
* Since when we scroll the cursor does not trigger the on Mouse Move event
|
|
10438
|
-
* The table selection gets removed.
|
|
10439
|
-
*/
|
|
10440
|
-
private handleScrollEvent;
|
|
10441
|
-
/**
|
|
10442
|
-
* Handles the on key event.
|
|
10443
|
-
* @param event the plugin event
|
|
10444
|
-
*/
|
|
10445
|
-
private handleKeyDownEvent;
|
|
10446
|
-
private handleKeyUpEvent;
|
|
10447
|
-
private handleKeySelectionInsideTable;
|
|
10448
|
-
private handleMouseDownEvent;
|
|
10449
|
-
private onMouseMove;
|
|
10450
|
-
private onMouseUp;
|
|
10451
|
-
private restoreSelection;
|
|
10452
|
-
/**
|
|
10453
|
-
* @internal
|
|
10454
|
-
* Public only for unit testing
|
|
10455
|
-
* @param event mouse event
|
|
10456
|
-
*/
|
|
10457
|
-
selectionInsideTableMouseMove(event: MouseEvent): void;
|
|
10458
|
-
private removeMouseUpEventListener;
|
|
10459
|
-
private clearState;
|
|
10460
|
-
private getNextTD;
|
|
10461
|
-
private prepareSelection;
|
|
10462
|
-
private setData;
|
|
10463
|
-
private isAfter;
|
|
10464
|
-
private shouldConvertToTableSelection;
|
|
10465
|
-
selectTable(): void;
|
|
10592
|
+
private handleLeavingShadowEdit;
|
|
10593
|
+
private handleEnteredShadowEdit;
|
|
10466
10594
|
}
|
|
10467
10595
|
|
|
10468
10596
|
/**
|