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