roosterjs 8.23.1 → 8.26.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 +459 -128
- package/dist/rooster-amd.js +886 -461
- 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 +459 -128
- package/dist/rooster.js +886 -461
- 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.26.0)
|
|
2
2
|
// Generated by dts tool from roosterjs
|
|
3
3
|
// Project: https://github.com/Microsoft/roosterjs
|
|
4
4
|
|
|
@@ -338,6 +338,7 @@ function applyTextStyle(container: Node, styler: (node: HTMLElement, isInnerNode
|
|
|
338
338
|
* @param event The paste event
|
|
339
339
|
* @param callback Callback function when data is ready
|
|
340
340
|
* @param options Options to retrieve more items from the event, including HTML string and other customized items
|
|
341
|
+
* @param rangeBeforePaste Optional range to be removed when pasting in Android
|
|
341
342
|
* @returns An object with the following properties:
|
|
342
343
|
* types: Available types from the clipboard event
|
|
343
344
|
* text: Plain text from the clipboard event
|
|
@@ -346,7 +347,7 @@ function applyTextStyle(container: Node, styler: (node: HTMLElement, isInnerNode
|
|
|
346
347
|
* When set to undefined, it means can't retrieve HTML string, there may be HTML string but direct retrieving is
|
|
347
348
|
* not supported by browser.
|
|
348
349
|
*/
|
|
349
|
-
function extractClipboardEvent(event: ClipboardEvent, callback: (clipboardData: ClipboardData) => void, options?: ExtractClipboardEventOption): void;
|
|
350
|
+
function extractClipboardEvent(event: ClipboardEvent, callback: (clipboardData: ClipboardData) => void, options?: ExtractClipboardEventOption, rangeBeforePaste?: Range): void;
|
|
350
351
|
|
|
351
352
|
/**
|
|
352
353
|
* Extract clipboard items to be a ClipboardData object for IE
|
|
@@ -376,13 +377,6 @@ function extractClipboardItems(items: DataTransferItem[], options?: ExtractClipb
|
|
|
376
377
|
*/
|
|
377
378
|
function extractClipboardItemsForIE(dataTransfer: DataTransfer, callback: (data: ClipboardData) => void, options?: ExtractClipboardItemsForIEOptions): void;
|
|
378
379
|
|
|
379
|
-
/**
|
|
380
|
-
* A type-safe wrapper for Array.prototype.push.apply()
|
|
381
|
-
* @param mainArray The main array to push items into
|
|
382
|
-
* @param itemsArray The items to push to main array
|
|
383
|
-
*/
|
|
384
|
-
function arrayPush<T>(mainArray: T[], itemsArray: T[]): void;
|
|
385
|
-
|
|
386
380
|
/**
|
|
387
381
|
* Browser object contains browser and operating system information of current environment
|
|
388
382
|
*/
|
|
@@ -529,7 +523,7 @@ function isBlockElement(node: Node): node is HTMLElement;
|
|
|
529
523
|
* Default value is false
|
|
530
524
|
* @returns True if there isn't any visible element inside node, otherwise false
|
|
531
525
|
*/
|
|
532
|
-
function isNodeEmpty(node: Node, trimContent?: boolean): boolean;
|
|
526
|
+
function isNodeEmpty(node: Node, trimContent?: boolean, shouldCountBrAsVisible?: boolean): boolean;
|
|
533
527
|
|
|
534
528
|
/**
|
|
535
529
|
* Check if the given node is html void element. Void element cannot have children
|
|
@@ -662,38 +656,6 @@ function splitTextNode(textNode: Text, offset: number, returnFirstPart: boolean)
|
|
|
662
656
|
*/
|
|
663
657
|
function normalizeRect(clientRect: DOMRect): Rect | null;
|
|
664
658
|
|
|
665
|
-
/**
|
|
666
|
-
* Convert a named node map to an array
|
|
667
|
-
* @param collection The map to convert
|
|
668
|
-
*/
|
|
669
|
-
function toArray(collection: NamedNodeMap): Attr[];
|
|
670
|
-
|
|
671
|
-
/**
|
|
672
|
-
* Convert a named node map to an array
|
|
673
|
-
* @param collection The map to convert
|
|
674
|
-
*/
|
|
675
|
-
function toArray(collection: DataTransferItemList): DataTransferItem[];
|
|
676
|
-
|
|
677
|
-
/**
|
|
678
|
-
* Convert a collection to an array
|
|
679
|
-
* @param collection The collection to convert
|
|
680
|
-
*/
|
|
681
|
-
function toArray<T extends Node>(collection: NodeListOf<T>): T[];
|
|
682
|
-
|
|
683
|
-
/**
|
|
684
|
-
* Convert a collection to an array
|
|
685
|
-
* @param collection The collection to convert
|
|
686
|
-
*/
|
|
687
|
-
function toArray<T extends Element>(collection: HTMLCollectionOf<T>): T[];
|
|
688
|
-
|
|
689
|
-
/**
|
|
690
|
-
* Convert an array to an array.
|
|
691
|
-
* This is to satisfy typescript compiler. For some cases the object can be a collection at runtime,
|
|
692
|
-
* but the declaration is an array. e.g. ClipboardData.types
|
|
693
|
-
* @param array The array to convert
|
|
694
|
-
*/
|
|
695
|
-
function toArray<T>(array: readonly T[]): T[];
|
|
696
|
-
|
|
697
659
|
/**
|
|
698
660
|
* Check if the given object is instance of the target type
|
|
699
661
|
* @param obj Object to check
|
|
@@ -990,9 +952,10 @@ class VList {
|
|
|
990
952
|
/**
|
|
991
953
|
* Change list style of the given range of this list.
|
|
992
954
|
* If some of the items are not real list item yet, this will make them to be list item with given style
|
|
993
|
-
* @param
|
|
955
|
+
* @param orderedStyle The style of ordered list
|
|
956
|
+
* @param unorderedStyle The style of unordered list
|
|
994
957
|
*/
|
|
995
|
-
setListStyleType(
|
|
958
|
+
setListStyleType(orderedStyle?: NumberingListType | CompatibleNumberingListType, unorderedStyle?: BulletListType | CompatibleBulletListType): void;
|
|
996
959
|
/**
|
|
997
960
|
* Append a new item to this VList
|
|
998
961
|
* @param node node of the item to append. If it is not wrapped with LI tag, it will be wrapped
|
|
@@ -1793,6 +1756,52 @@ function setMetadata<T>(element: HTMLElement, metadata: T, def?: Definition<T>):
|
|
|
1793
1756
|
*/
|
|
1794
1757
|
function removeMetadata(element: HTMLElement): void;
|
|
1795
1758
|
|
|
1759
|
+
/**
|
|
1760
|
+
* A type-safe wrapper for Array.prototype.push.apply()
|
|
1761
|
+
* @param mainArray The main array to push items into
|
|
1762
|
+
* @param itemsArray The items to push to main array
|
|
1763
|
+
*/
|
|
1764
|
+
function arrayPush<T>(mainArray: T[], itemsArray: T[]): void;
|
|
1765
|
+
|
|
1766
|
+
/**
|
|
1767
|
+
* Provide a strong-typed version of Object.keys()
|
|
1768
|
+
* @param obj The source object
|
|
1769
|
+
* @returns Array of keys
|
|
1770
|
+
*/
|
|
1771
|
+
function getObjectKeys<T extends string | number | symbol>(obj: Record<T, any> | Partial<Record<T, any>>): T[];
|
|
1772
|
+
|
|
1773
|
+
/**
|
|
1774
|
+
* Convert a named node map to an array
|
|
1775
|
+
* @param collection The map to convert
|
|
1776
|
+
*/
|
|
1777
|
+
function toArray(collection: NamedNodeMap): Attr[];
|
|
1778
|
+
|
|
1779
|
+
/**
|
|
1780
|
+
* Convert a named node map to an array
|
|
1781
|
+
* @param collection The map to convert
|
|
1782
|
+
*/
|
|
1783
|
+
function toArray(collection: DataTransferItemList): DataTransferItem[];
|
|
1784
|
+
|
|
1785
|
+
/**
|
|
1786
|
+
* Convert a collection to an array
|
|
1787
|
+
* @param collection The collection to convert
|
|
1788
|
+
*/
|
|
1789
|
+
function toArray<T extends Node>(collection: NodeListOf<T>): T[];
|
|
1790
|
+
|
|
1791
|
+
/**
|
|
1792
|
+
* Convert a collection to an array
|
|
1793
|
+
* @param collection The collection to convert
|
|
1794
|
+
*/
|
|
1795
|
+
function toArray<T extends Element>(collection: HTMLCollectionOf<T>): T[];
|
|
1796
|
+
|
|
1797
|
+
/**
|
|
1798
|
+
* Convert an array to an array.
|
|
1799
|
+
* This is to satisfy typescript compiler. For some cases the object can be a collection at runtime,
|
|
1800
|
+
* but the declaration is an array. e.g. ClipboardData.types
|
|
1801
|
+
* @param array The array to convert
|
|
1802
|
+
*/
|
|
1803
|
+
function toArray<T>(array: readonly T[]): T[];
|
|
1804
|
+
|
|
1796
1805
|
/**
|
|
1797
1806
|
* RoosterJs core editor class
|
|
1798
1807
|
*/
|
|
@@ -2545,14 +2554,15 @@ function applyCellShading(editor: IEditor, color: string | ModeIndependentColor)
|
|
|
2545
2554
|
* @param listType The list type to toggle
|
|
2546
2555
|
* @param startNumber (Optional) Start number of the list
|
|
2547
2556
|
* @param includeSiblingLists Sets wether the operation should include Sibling Lists, by default true
|
|
2548
|
-
* @param
|
|
2557
|
+
* @param orderedStyle (Optional) the style of an ordered. If not defined, the style will be set to decimal.
|
|
2558
|
+
* @param unorderedStyle (Optional) the style of an unordered list. If not defined, the style will be set to disc.
|
|
2549
2559
|
*/
|
|
2550
|
-
function toggleListType(editor: IEditor, listType: ListType | CompatibleListType, startNumber?: number, includeSiblingLists?: boolean,
|
|
2560
|
+
function toggleListType(editor: IEditor, listType: ListType | CompatibleListType, startNumber?: number, includeSiblingLists?: boolean, orderedStyle?: NumberingListType | CompatibleNumberingListType, unorderedStyle?: BulletListType | CompatibleBulletListType): void;
|
|
2551
2561
|
|
|
2552
2562
|
/**
|
|
2553
2563
|
* Split selection into regions, and perform a block-wise formatting action for each region.
|
|
2554
2564
|
*/
|
|
2555
|
-
function blockFormat(editor: IEditor, callback: (region: Region, start: NodePosition, end: NodePosition, chains: VListChain[]) => void, beforeRunCallback?: () => boolean): void;
|
|
2565
|
+
function blockFormat(editor: IEditor, callback: (region: Region, start: NodePosition, end: NodePosition, chains: VListChain[]) => void, beforeRunCallback?: () => boolean, apiName?: string): void;
|
|
2556
2566
|
|
|
2557
2567
|
/**
|
|
2558
2568
|
* Commit changes of all list changes when experiment features are allowed
|
|
@@ -3475,6 +3485,7 @@ const enum ExperimentalFeatures {
|
|
|
3475
3485
|
*/
|
|
3476
3486
|
AutoFormatList = "AutoFormatList",
|
|
3477
3487
|
/**
|
|
3488
|
+
* @deprecated this feature is always disabled
|
|
3478
3489
|
* Automatically transform -- into hyphen, if typed between two words.
|
|
3479
3490
|
*/
|
|
3480
3491
|
AutoHyphen = "AutoHyphen"
|
|
@@ -4033,116 +4044,136 @@ const enum SelectionRangeTypes {
|
|
|
4033
4044
|
* Enum used to control the different types of numbering list
|
|
4034
4045
|
*/
|
|
4035
4046
|
const enum NumberingListType {
|
|
4047
|
+
/**
|
|
4048
|
+
* Minimum value of the enum
|
|
4049
|
+
*/
|
|
4050
|
+
Min = 1,
|
|
4036
4051
|
/**
|
|
4037
4052
|
* Numbering triggered by 1.
|
|
4038
4053
|
*/
|
|
4039
|
-
Decimal =
|
|
4054
|
+
Decimal = 1,
|
|
4040
4055
|
/**
|
|
4041
4056
|
* Numbering triggered by 1-
|
|
4042
4057
|
*/
|
|
4043
|
-
DecimalDash =
|
|
4058
|
+
DecimalDash = 2,
|
|
4044
4059
|
/**
|
|
4045
4060
|
* Numbering triggered by 1)
|
|
4046
4061
|
*/
|
|
4047
|
-
DecimalParenthesis =
|
|
4062
|
+
DecimalParenthesis = 3,
|
|
4048
4063
|
/**
|
|
4049
4064
|
* Numbering triggered by (1)
|
|
4050
4065
|
*/
|
|
4051
|
-
DecimalDoubleParenthesis =
|
|
4066
|
+
DecimalDoubleParenthesis = 4,
|
|
4052
4067
|
/**
|
|
4053
4068
|
* Numbering triggered by a.
|
|
4054
4069
|
*/
|
|
4055
|
-
LowerAlpha =
|
|
4070
|
+
LowerAlpha = 5,
|
|
4056
4071
|
/**
|
|
4057
4072
|
* Numbering triggered by a)
|
|
4058
4073
|
*/
|
|
4059
|
-
LowerAlphaParenthesis =
|
|
4074
|
+
LowerAlphaParenthesis = 6,
|
|
4060
4075
|
/**
|
|
4061
4076
|
* Numbering triggered by (a)
|
|
4062
4077
|
*/
|
|
4063
|
-
LowerAlphaDoubleParenthesis =
|
|
4078
|
+
LowerAlphaDoubleParenthesis = 7,
|
|
4064
4079
|
/**
|
|
4065
4080
|
* Numbering triggered by a-
|
|
4066
4081
|
*/
|
|
4067
|
-
LowerAlphaDash =
|
|
4082
|
+
LowerAlphaDash = 8,
|
|
4068
4083
|
/**
|
|
4069
4084
|
* Numbering triggered by A.
|
|
4070
4085
|
*/
|
|
4071
|
-
UpperAlpha =
|
|
4086
|
+
UpperAlpha = 9,
|
|
4072
4087
|
/**
|
|
4073
4088
|
* Numbering triggered by A)
|
|
4074
4089
|
*/
|
|
4075
|
-
UpperAlphaParenthesis =
|
|
4090
|
+
UpperAlphaParenthesis = 10,
|
|
4076
4091
|
/**
|
|
4077
4092
|
* Numbering triggered by (A)
|
|
4078
4093
|
*/
|
|
4079
|
-
UpperAlphaDoubleParenthesis =
|
|
4094
|
+
UpperAlphaDoubleParenthesis = 11,
|
|
4080
4095
|
/**
|
|
4081
4096
|
* Numbering triggered by A-
|
|
4082
4097
|
*/
|
|
4083
|
-
UpperAlphaDash =
|
|
4098
|
+
UpperAlphaDash = 12,
|
|
4084
4099
|
/**
|
|
4085
4100
|
* Numbering triggered by i.
|
|
4086
4101
|
*/
|
|
4087
|
-
LowerRoman =
|
|
4102
|
+
LowerRoman = 13,
|
|
4088
4103
|
/**
|
|
4089
4104
|
* Numbering triggered by i)
|
|
4090
4105
|
*/
|
|
4091
|
-
LowerRomanParenthesis =
|
|
4106
|
+
LowerRomanParenthesis = 14,
|
|
4092
4107
|
/**
|
|
4093
4108
|
* Numbering triggered by (i)
|
|
4094
4109
|
*/
|
|
4095
|
-
LowerRomanDoubleParenthesis =
|
|
4110
|
+
LowerRomanDoubleParenthesis = 15,
|
|
4096
4111
|
/**
|
|
4097
4112
|
* Numbering triggered by i-
|
|
4098
4113
|
*/
|
|
4099
|
-
LowerRomanDash =
|
|
4114
|
+
LowerRomanDash = 16,
|
|
4100
4115
|
/**
|
|
4101
4116
|
* Numbering triggered by I.
|
|
4102
4117
|
*/
|
|
4103
|
-
UpperRoman =
|
|
4118
|
+
UpperRoman = 17,
|
|
4104
4119
|
/**
|
|
4105
4120
|
* Numbering triggered by I)
|
|
4106
4121
|
*/
|
|
4107
|
-
UpperRomanParenthesis =
|
|
4122
|
+
UpperRomanParenthesis = 18,
|
|
4108
4123
|
/**
|
|
4109
4124
|
* Numbering triggered by (I)
|
|
4110
4125
|
*/
|
|
4111
|
-
UpperRomanDoubleParenthesis =
|
|
4126
|
+
UpperRomanDoubleParenthesis = 19,
|
|
4112
4127
|
/**
|
|
4113
4128
|
* Numbering triggered by I-
|
|
4114
4129
|
*/
|
|
4115
|
-
UpperRomanDash =
|
|
4130
|
+
UpperRomanDash = 20,
|
|
4131
|
+
/**
|
|
4132
|
+
* Maximum value of the enum
|
|
4133
|
+
*/
|
|
4134
|
+
Max = 20
|
|
4116
4135
|
}
|
|
4117
4136
|
|
|
4118
4137
|
/**
|
|
4119
4138
|
* Enum used to control the different types of bullet list
|
|
4120
4139
|
*/
|
|
4121
4140
|
const enum BulletListType {
|
|
4141
|
+
/**
|
|
4142
|
+
* Minimum value of the enum
|
|
4143
|
+
*/
|
|
4144
|
+
Min = 1,
|
|
4122
4145
|
/**
|
|
4123
4146
|
* Bullet triggered by *
|
|
4124
4147
|
*/
|
|
4125
|
-
Disc =
|
|
4148
|
+
Disc = 1,
|
|
4126
4149
|
/**
|
|
4127
4150
|
* Bullet triggered by -
|
|
4128
4151
|
*/
|
|
4129
|
-
Dash =
|
|
4152
|
+
Dash = 2,
|
|
4130
4153
|
/**
|
|
4131
4154
|
* Bullet triggered by --
|
|
4132
4155
|
*/
|
|
4133
|
-
Square =
|
|
4156
|
+
Square = 3,
|
|
4134
4157
|
/**
|
|
4135
4158
|
* Bullet triggered by >
|
|
4136
4159
|
*/
|
|
4137
|
-
ShortArrow =
|
|
4160
|
+
ShortArrow = 4,
|
|
4138
4161
|
/**
|
|
4139
4162
|
* Bullet triggered by -> or -->
|
|
4140
4163
|
*/
|
|
4141
|
-
LongArrow =
|
|
4164
|
+
LongArrow = 5,
|
|
4142
4165
|
/**
|
|
4143
4166
|
* Bullet triggered by =>
|
|
4144
4167
|
*/
|
|
4145
|
-
UnfilledArrow =
|
|
4168
|
+
UnfilledArrow = 6,
|
|
4169
|
+
/**
|
|
4170
|
+
* Bullet triggered by —
|
|
4171
|
+
*/
|
|
4172
|
+
Hyphen = 7,
|
|
4173
|
+
/**
|
|
4174
|
+
* Maximum value of the enum
|
|
4175
|
+
*/
|
|
4176
|
+
Max = 7
|
|
4146
4177
|
}
|
|
4147
4178
|
|
|
4148
4179
|
/**
|
|
@@ -4178,7 +4209,13 @@ const enum DefinitionType {
|
|
|
4178
4209
|
/**
|
|
4179
4210
|
* Provides a chance for plugin to change the content before it is copied from editor.
|
|
4180
4211
|
*/
|
|
4181
|
-
interface BeforeCutCopyEvent extends BasePluginEvent<PluginEventType.BeforeCutCopy> {
|
|
4212
|
+
interface BeforeCutCopyEvent extends BeforeCutCopyEventData, BasePluginEvent<PluginEventType.BeforeCutCopy> {
|
|
4213
|
+
}
|
|
4214
|
+
|
|
4215
|
+
/**
|
|
4216
|
+
* Data of BeforeCutCopyEvent
|
|
4217
|
+
*/
|
|
4218
|
+
interface BeforeCutCopyEventData {
|
|
4182
4219
|
/**
|
|
4183
4220
|
* Raw DOM event
|
|
4184
4221
|
*/
|
|
@@ -4197,6 +4234,12 @@ interface BeforeCutCopyEvent extends BasePluginEvent<PluginEventType.BeforeCutCo
|
|
|
4197
4234
|
isCut: boolean;
|
|
4198
4235
|
}
|
|
4199
4236
|
|
|
4237
|
+
/**
|
|
4238
|
+
* Provides a chance for plugin to change the content before it is copied from editor.
|
|
4239
|
+
*/
|
|
4240
|
+
interface CompatibleBeforeCutCopyEvent extends BeforeCutCopyEventData, BasePluginEvent<CompatiblePluginEventType.BeforeCutCopy> {
|
|
4241
|
+
}
|
|
4242
|
+
|
|
4200
4243
|
/**
|
|
4201
4244
|
* Editor plugin event interface
|
|
4202
4245
|
*/
|
|
@@ -4224,7 +4267,19 @@ interface BeforeDisposeEvent extends BasePluginEvent<PluginEventType.BeforeDispo
|
|
|
4224
4267
|
/**
|
|
4225
4268
|
* Provides a chance for plugin to change the content before it is pasted into editor.
|
|
4226
4269
|
*/
|
|
4227
|
-
interface
|
|
4270
|
+
interface CompatibleBeforeDisposeEvent extends BasePluginEvent<CompatiblePluginEventType.BeforeDispose> {
|
|
4271
|
+
}
|
|
4272
|
+
|
|
4273
|
+
/**
|
|
4274
|
+
* Provides a chance for plugin to change the content before it is pasted into editor.
|
|
4275
|
+
*/
|
|
4276
|
+
interface BeforePasteEvent extends BeforePasteEventData, BasePluginEvent<PluginEventType.BeforePaste> {
|
|
4277
|
+
}
|
|
4278
|
+
|
|
4279
|
+
/**
|
|
4280
|
+
* Data of BeforePasteEvent
|
|
4281
|
+
*/
|
|
4282
|
+
interface BeforePasteEventData {
|
|
4228
4283
|
/**
|
|
4229
4284
|
* An object contains all related data for pasting
|
|
4230
4285
|
*/
|
|
@@ -4251,21 +4306,46 @@ interface BeforePasteEvent extends BasePluginEvent<PluginEventType.BeforePaste>
|
|
|
4251
4306
|
htmlAttributes: Record<string, string>;
|
|
4252
4307
|
}
|
|
4253
4308
|
|
|
4309
|
+
/**
|
|
4310
|
+
* Provides a chance for plugin to change the content before it is pasted into editor.
|
|
4311
|
+
*/
|
|
4312
|
+
interface CompatibleBeforePasteEvent extends BeforePasteEventData, BasePluginEvent<CompatiblePluginEventType.BeforePaste> {
|
|
4313
|
+
}
|
|
4314
|
+
|
|
4254
4315
|
/**
|
|
4255
4316
|
* The event to be triggered before SetContent API is called.
|
|
4256
4317
|
* Handle this event to cache anything you need from editor before it is gone.
|
|
4257
4318
|
*/
|
|
4258
|
-
interface BeforeSetContentEvent extends BasePluginEvent<PluginEventType.BeforeSetContent> {
|
|
4319
|
+
interface BeforeSetContentEvent extends BeforeSetContentEventData, BasePluginEvent<PluginEventType.BeforeSetContent> {
|
|
4320
|
+
}
|
|
4321
|
+
|
|
4322
|
+
/**
|
|
4323
|
+
* Data of BeforeSetContentEvent
|
|
4324
|
+
*/
|
|
4325
|
+
interface BeforeSetContentEventData {
|
|
4259
4326
|
/**
|
|
4260
4327
|
* New content HTML that is about to set to editor
|
|
4261
4328
|
*/
|
|
4262
4329
|
newContent: string;
|
|
4263
4330
|
}
|
|
4264
4331
|
|
|
4332
|
+
/**
|
|
4333
|
+
* The event to be triggered before SetContent API is called.
|
|
4334
|
+
* Handle this event to cache anything you need from editor before it is gone.
|
|
4335
|
+
*/
|
|
4336
|
+
interface CompatibleBeforeSetContentEvent extends BeforeSetContentEventData, BasePluginEvent<CompatiblePluginEventType.BeforeSetContent> {
|
|
4337
|
+
}
|
|
4338
|
+
|
|
4265
4339
|
/**
|
|
4266
4340
|
* Represents a change to the editor made by another plugin
|
|
4267
4341
|
*/
|
|
4268
|
-
interface ContentChangedEvent extends BasePluginEvent<PluginEventType.ContentChanged> {
|
|
4342
|
+
interface ContentChangedEvent extends ContentChangedEventData, BasePluginEvent<PluginEventType.ContentChanged> {
|
|
4343
|
+
}
|
|
4344
|
+
|
|
4345
|
+
/**
|
|
4346
|
+
* Data of ContentChangedEvent
|
|
4347
|
+
*/
|
|
4348
|
+
interface ContentChangedEventData {
|
|
4269
4349
|
/**
|
|
4270
4350
|
* Source of the change
|
|
4271
4351
|
*/
|
|
@@ -4274,13 +4354,26 @@ interface ContentChangedEvent extends BasePluginEvent<PluginEventType.ContentCha
|
|
|
4274
4354
|
* Optional related data
|
|
4275
4355
|
*/
|
|
4276
4356
|
data?: any;
|
|
4357
|
+
additionalData?: ContentChangedData;
|
|
4358
|
+
}
|
|
4359
|
+
|
|
4360
|
+
/**
|
|
4361
|
+
* Represents a change to the editor made by another plugin
|
|
4362
|
+
*/
|
|
4363
|
+
interface CompatibleContentChangedEvent extends ContentChangedEventData, BasePluginEvent<CompatiblePluginEventType.ContentChanged> {
|
|
4277
4364
|
}
|
|
4278
4365
|
|
|
4279
4366
|
/**
|
|
4280
4367
|
* Represents an event that will be fired when an inline image is edited by user, and the src
|
|
4281
4368
|
* attribute of the image is about to be changed
|
|
4282
4369
|
*/
|
|
4283
|
-
interface EditImageEvent extends BasePluginEvent<PluginEventType.EditImage> {
|
|
4370
|
+
interface EditImageEvent extends EditImageEventData, BasePluginEvent<PluginEventType.EditImage> {
|
|
4371
|
+
}
|
|
4372
|
+
|
|
4373
|
+
/**
|
|
4374
|
+
* Data of EditImageEvent
|
|
4375
|
+
*/
|
|
4376
|
+
interface EditImageEventData {
|
|
4284
4377
|
/**
|
|
4285
4378
|
* The image element that is being changed
|
|
4286
4379
|
*/
|
|
@@ -4301,17 +4394,36 @@ interface EditImageEvent extends BasePluginEvent<PluginEventType.EditImage> {
|
|
|
4301
4394
|
newSrc: string;
|
|
4302
4395
|
}
|
|
4303
4396
|
|
|
4397
|
+
/**
|
|
4398
|
+
* Represents an event that will be fired when an inline image is edited by user, and the src
|
|
4399
|
+
* attribute of the image is about to be changed
|
|
4400
|
+
*/
|
|
4401
|
+
interface CompatibleEditImageEvent extends EditImageEventData, BasePluginEvent<CompatiblePluginEventType.EditImage> {
|
|
4402
|
+
}
|
|
4403
|
+
|
|
4304
4404
|
/**
|
|
4305
4405
|
* Provides a chance for plugin to change the content before it is pasted into editor.
|
|
4306
4406
|
*/
|
|
4307
4407
|
interface EditorReadyEvent extends BasePluginEvent<PluginEventType.EditorReady> {
|
|
4408
|
+
}
|
|
4409
|
+
|
|
4410
|
+
/**
|
|
4411
|
+
* Provides a chance for plugin to change the content before it is pasted into editor.
|
|
4412
|
+
*/
|
|
4413
|
+
interface CompatibleEditorReadyEvent extends BasePluginEvent<CompatiblePluginEventType.EditorReady> {
|
|
4308
4414
|
}
|
|
4309
4415
|
|
|
4310
4416
|
/**
|
|
4311
4417
|
* Provide a chance for plugins to handle entity related events.
|
|
4312
4418
|
* See enum EntityOperation for more details about each operation
|
|
4313
4419
|
*/
|
|
4314
|
-
interface EntityOperationEvent extends BasePluginEvent<PluginEventType.EntityOperation> {
|
|
4420
|
+
interface EntityOperationEvent extends EntityOperationEventData, BasePluginEvent<PluginEventType.EntityOperation> {
|
|
4421
|
+
}
|
|
4422
|
+
|
|
4423
|
+
/**
|
|
4424
|
+
* Data of EntityOperationEvent
|
|
4425
|
+
*/
|
|
4426
|
+
interface EntityOperationEventData {
|
|
4315
4427
|
/**
|
|
4316
4428
|
* Operation to this entity
|
|
4317
4429
|
*/
|
|
@@ -4338,13 +4450,26 @@ interface EntityOperationEvent extends BasePluginEvent<PluginEventType.EntityOpe
|
|
|
4338
4450
|
contentForShadowEntity?: DocumentFragment;
|
|
4339
4451
|
}
|
|
4340
4452
|
|
|
4453
|
+
/**
|
|
4454
|
+
* Provide a chance for plugins to handle entity related events.
|
|
4455
|
+
* See enum EntityOperation for more details about each operation
|
|
4456
|
+
*/
|
|
4457
|
+
interface CompatibleEntityOperationEvent extends EntityOperationEventData, BasePluginEvent<CompatiblePluginEventType.EntityOperation> {
|
|
4458
|
+
}
|
|
4459
|
+
|
|
4341
4460
|
/**
|
|
4342
4461
|
* Extract Content with a DOM tree event
|
|
4343
4462
|
* This event is triggered when getContent() is called with triggerExtractContentEvent = true
|
|
4344
4463
|
* Plugin can handle this event to remove the UI only markups to return clean HTML
|
|
4345
4464
|
* by operating on a cloned DOM tree
|
|
4346
4465
|
*/
|
|
4347
|
-
interface ExtractContentWithDomEvent extends BasePluginEvent<PluginEventType.ExtractContentWithDom> {
|
|
4466
|
+
interface ExtractContentWithDomEvent extends ExtractContentWithDomEventData, BasePluginEvent<PluginEventType.ExtractContentWithDom> {
|
|
4467
|
+
}
|
|
4468
|
+
|
|
4469
|
+
/**
|
|
4470
|
+
* Data of ExtractContentWithDomEvent
|
|
4471
|
+
*/
|
|
4472
|
+
interface ExtractContentWithDomEventData {
|
|
4348
4473
|
/**
|
|
4349
4474
|
* Cloned root element of editor
|
|
4350
4475
|
* Plugin can change this DOM tree to clean up the markups it added before
|
|
@@ -4352,6 +4477,15 @@ interface ExtractContentWithDomEvent extends BasePluginEvent<PluginEventType.Ext
|
|
|
4352
4477
|
clonedRoot: HTMLElement;
|
|
4353
4478
|
}
|
|
4354
4479
|
|
|
4480
|
+
/**
|
|
4481
|
+
* Extract Content with a DOM tree event
|
|
4482
|
+
* This event is triggered when getContent() is called with triggerExtractContentEvent = true
|
|
4483
|
+
* Plugin can handle this event to remove the UI only markups to return clean HTML
|
|
4484
|
+
* by operating on a cloned DOM tree
|
|
4485
|
+
*/
|
|
4486
|
+
interface CompatibleExtractContentWithDomEvent extends ExtractContentWithDomEventData, BasePluginEvent<CompatiblePluginEventType.ExtractContentWithDom> {
|
|
4487
|
+
}
|
|
4488
|
+
|
|
4355
4489
|
/**
|
|
4356
4490
|
* An event fired when pending format state (bold, italic, underline, ... with collapsed selection) is changed
|
|
4357
4491
|
*/
|
|
@@ -4359,6 +4493,13 @@ interface PendingFormatStateChangedEvent extends BasePluginEvent<PluginEventType
|
|
|
4359
4493
|
formatState: PendableFormatState;
|
|
4360
4494
|
}
|
|
4361
4495
|
|
|
4496
|
+
/**
|
|
4497
|
+
* An event fired when pending format state (bold, italic, underline, ... with collapsed selection) is changed
|
|
4498
|
+
*/
|
|
4499
|
+
interface CompatiblePendingFormatStateChangedEvent extends BasePluginEvent<CompatiblePluginEventType.PendingFormatStateChanged> {
|
|
4500
|
+
formatState: PendableFormatState;
|
|
4501
|
+
}
|
|
4502
|
+
|
|
4362
4503
|
/**
|
|
4363
4504
|
* This represents a PluginEvent wrapping native browser event
|
|
4364
4505
|
*/
|
|
@@ -4380,13 +4521,7 @@ interface PluginCompositionEvent extends PluginDomEventBase<PluginEventType.Comp
|
|
|
4380
4521
|
/**
|
|
4381
4522
|
* This interface represents a PluginEvent wrapping native ContextMenu event
|
|
4382
4523
|
*/
|
|
4383
|
-
interface PluginContextMenuEvent extends PluginDomEventBase<PluginEventType.ContextMenu, MouseEvent> {
|
|
4384
|
-
/**
|
|
4385
|
-
* A callback array to let editor retrieve context menu item related to this event.
|
|
4386
|
-
* Plugins can add their own getter callback to this array,
|
|
4387
|
-
* items from each getter will be separated by a splitter item represented by null
|
|
4388
|
-
*/
|
|
4389
|
-
items: any[];
|
|
4524
|
+
interface PluginContextMenuEvent extends PluginContextMenuEventData, PluginDomEventBase<PluginEventType.ContextMenu, MouseEvent> {
|
|
4390
4525
|
}
|
|
4391
4526
|
|
|
4392
4527
|
/**
|
|
@@ -4426,11 +4561,7 @@ interface PluginMouseDownEvent extends PluginDomEventBase<PluginEventType.MouseD
|
|
|
4426
4561
|
/**
|
|
4427
4562
|
* This interface represents a PluginEvent wrapping native MouseUp event
|
|
4428
4563
|
*/
|
|
4429
|
-
interface PluginMouseUpEvent extends PluginDomEventBase<PluginEventType.MouseUp, MouseEvent> {
|
|
4430
|
-
/**
|
|
4431
|
-
* Whether this is a mouse click event (mouse up and down on the same position)
|
|
4432
|
-
*/
|
|
4433
|
-
isClicking?: boolean;
|
|
4564
|
+
interface PluginMouseUpEvent extends PluginMouseUpEventData, PluginDomEventBase<PluginEventType.MouseUp, MouseEvent> {
|
|
4434
4565
|
}
|
|
4435
4566
|
|
|
4436
4567
|
/**
|
|
@@ -4442,14 +4573,114 @@ interface PluginInputEvent extends PluginDomEventBase<PluginEventType.Input, Inp
|
|
|
4442
4573
|
/**
|
|
4443
4574
|
* This interface represents a PluginEvent wrapping native scroll event
|
|
4444
4575
|
*/
|
|
4445
|
-
interface PluginScrollEvent extends PluginDomEventBase<PluginEventType.Scroll, UIEvent> {
|
|
4576
|
+
interface PluginScrollEvent extends PluginScrollEventData, PluginDomEventBase<PluginEventType.Scroll, UIEvent> {
|
|
4577
|
+
}
|
|
4578
|
+
|
|
4579
|
+
/**
|
|
4580
|
+
* This represents a PluginEvent wrapping native browser event
|
|
4581
|
+
*/
|
|
4582
|
+
type CompatiblePluginDomEvent = CompatiblePluginCompositionEvent | CompatiblePluginMouseEvent | CompatiblePluginKeyboardEvent | CompatiblePluginInputEvent | CompatiblePluginScrollEvent;
|
|
4583
|
+
|
|
4584
|
+
/**
|
|
4585
|
+
* This interface represents a PluginEvent wrapping native CompositionEnd event
|
|
4586
|
+
*/
|
|
4587
|
+
interface CompatiblePluginCompositionEvent extends PluginDomEventBase<CompatiblePluginEventType.CompositionEnd, CompositionEvent> {
|
|
4588
|
+
}
|
|
4589
|
+
|
|
4590
|
+
/**
|
|
4591
|
+
* This interface represents a PluginEvent wrapping native ContextMenu event
|
|
4592
|
+
*/
|
|
4593
|
+
interface CompatiblePluginContextMenuEvent extends PluginContextMenuEventData, PluginDomEventBase<CompatiblePluginEventType.ContextMenu, MouseEvent> {
|
|
4594
|
+
}
|
|
4595
|
+
|
|
4596
|
+
/**
|
|
4597
|
+
* The interface represents a PluginEvent wrapping native Keyboard event
|
|
4598
|
+
*/
|
|
4599
|
+
type CompatiblePluginKeyboardEvent = CompatiblePluginKeyDownEvent | CompatiblePluginKeyPressEvent | CompatiblePluginKeyUpEvent;
|
|
4600
|
+
|
|
4601
|
+
/**
|
|
4602
|
+
* This interface represents a PluginEvent wrapping native KeyDown event
|
|
4603
|
+
*/
|
|
4604
|
+
interface CompatiblePluginKeyDownEvent extends PluginDomEventBase<CompatiblePluginEventType.KeyDown, KeyboardEvent> {
|
|
4605
|
+
}
|
|
4606
|
+
|
|
4607
|
+
/**
|
|
4608
|
+
* This interface represents a PluginEvent wrapping native KeyPress event
|
|
4609
|
+
*/
|
|
4610
|
+
interface CompatiblePluginKeyPressEvent extends PluginDomEventBase<CompatiblePluginEventType.KeyPress, KeyboardEvent> {
|
|
4611
|
+
}
|
|
4612
|
+
|
|
4613
|
+
/**
|
|
4614
|
+
* This interface represents a PluginEvent wrapping native KeyUp event
|
|
4615
|
+
*/
|
|
4616
|
+
interface CompatiblePluginKeyUpEvent extends PluginDomEventBase<CompatiblePluginEventType.KeyUp, KeyboardEvent> {
|
|
4617
|
+
}
|
|
4618
|
+
|
|
4619
|
+
/**
|
|
4620
|
+
* This interface represents a PluginEvent wrapping native Mouse event
|
|
4621
|
+
*/
|
|
4622
|
+
type CompatiblePluginMouseEvent = CompatiblePluginMouseDownEvent | CompatiblePluginMouseUpEvent | CompatiblePluginContextMenuEvent;
|
|
4623
|
+
|
|
4624
|
+
/**
|
|
4625
|
+
* This interface represents a PluginEvent wrapping native MouseDown event
|
|
4626
|
+
*/
|
|
4627
|
+
interface CompatiblePluginMouseDownEvent extends PluginDomEventBase<CompatiblePluginEventType.MouseDown, MouseEvent> {
|
|
4628
|
+
}
|
|
4629
|
+
|
|
4630
|
+
/**
|
|
4631
|
+
* This interface represents a PluginEvent wrapping native MouseUp event
|
|
4632
|
+
*/
|
|
4633
|
+
interface CompatiblePluginMouseUpEvent extends PluginMouseUpEventData, PluginDomEventBase<CompatiblePluginEventType.MouseUp, MouseEvent> {
|
|
4634
|
+
}
|
|
4635
|
+
|
|
4636
|
+
/**
|
|
4637
|
+
* This interface represents a PluginEvent wrapping native input / textinput event
|
|
4638
|
+
*/
|
|
4639
|
+
interface CompatiblePluginInputEvent extends PluginDomEventBase<CompatiblePluginEventType.Input, InputEvent> {
|
|
4640
|
+
}
|
|
4641
|
+
|
|
4642
|
+
/**
|
|
4643
|
+
* This interface represents a PluginEvent wrapping native scroll event
|
|
4644
|
+
*/
|
|
4645
|
+
interface CompatiblePluginScrollEvent extends PluginScrollEventData, PluginDomEventBase<CompatiblePluginEventType.Scroll, UIEvent> {
|
|
4646
|
+
}
|
|
4647
|
+
|
|
4648
|
+
/**
|
|
4649
|
+
* Data of PluginScrollEvent
|
|
4650
|
+
*/
|
|
4651
|
+
interface PluginScrollEventData {
|
|
4652
|
+
/**
|
|
4653
|
+
* Current scroll container that triggers this scroll event
|
|
4654
|
+
*/
|
|
4446
4655
|
scrollContainer: HTMLElement;
|
|
4447
4656
|
}
|
|
4448
4657
|
|
|
4658
|
+
/**
|
|
4659
|
+
* Data of PluginMouseUpEvent
|
|
4660
|
+
*/
|
|
4661
|
+
interface PluginMouseUpEventData {
|
|
4662
|
+
/**
|
|
4663
|
+
* Whether this is a mouse click event (mouse up and down on the same position)
|
|
4664
|
+
*/
|
|
4665
|
+
isClicking?: boolean;
|
|
4666
|
+
}
|
|
4667
|
+
|
|
4668
|
+
/**
|
|
4669
|
+
* Data of PluginContextMenuEvent
|
|
4670
|
+
*/
|
|
4671
|
+
interface PluginContextMenuEventData {
|
|
4672
|
+
/**
|
|
4673
|
+
* A callback array to let editor retrieve context menu item related to this event.
|
|
4674
|
+
* Plugins can add their own getter callback to this array,
|
|
4675
|
+
* items from each getter will be separated by a splitter item represented by null
|
|
4676
|
+
*/
|
|
4677
|
+
items: any[];
|
|
4678
|
+
}
|
|
4679
|
+
|
|
4449
4680
|
/**
|
|
4450
4681
|
* Editor plugin event interface
|
|
4451
4682
|
*/
|
|
4452
|
-
type PluginEvent = BeforeCutCopyEvent | BeforePasteEvent | ContentChangedEvent | EntityOperationEvent | ExtractContentWithDomEvent | PluginDomEvent | EditorReadyEvent | BeforeDisposeEvent | PendingFormatStateChangedEvent | EnterShadowEditEvent | LeaveShadowEditEvent | EditImageEvent | BeforeSetContentEvent | ZoomChangedEvent;
|
|
4683
|
+
type PluginEvent = BeforeCutCopyEvent | BeforePasteEvent | ContentChangedEvent | EntityOperationEvent | ExtractContentWithDomEvent | PluginDomEvent | EditorReadyEvent | BeforeDisposeEvent | PendingFormatStateChangedEvent | EnterShadowEditEvent | LeaveShadowEditEvent | EditImageEvent | BeforeSetContentEvent | ZoomChangedEvent | CompatibleBeforeCutCopyEvent | CompatibleBeforeDisposeEvent | CompatibleBeforePasteEvent | CompatibleBeforeSetContentEvent | CompatibleContentChangedEvent | CompatibleEditImageEvent | CompatibleEditorReadyEvent | CompatibleEntityOperationEvent | CompatibleExtractContentWithDomEvent | CompatiblePendingFormatStateChangedEvent | CompatiblePluginDomEvent | CompatibleEnterShadowEditEvent | CompatibleLeaveShadowEditEvent | CompatibleZoomChangedEvent;
|
|
4453
4684
|
|
|
4454
4685
|
/**
|
|
4455
4686
|
* A type to extract data part of a plugin event type. Data part is the plugin event without eventType field.
|
|
@@ -4476,7 +4707,19 @@ type PluginEventFromTypeGeneric<E extends PluginEvent, T extends PluginEventType
|
|
|
4476
4707
|
/**
|
|
4477
4708
|
* A plugin triggered right after editor has entered Shadow Edit mode
|
|
4478
4709
|
*/
|
|
4479
|
-
interface EnterShadowEditEvent extends BasePluginEvent<PluginEventType.EnteredShadowEdit> {
|
|
4710
|
+
interface EnterShadowEditEvent extends EnterShadowEditEventData, BasePluginEvent<PluginEventType.EnteredShadowEdit> {
|
|
4711
|
+
}
|
|
4712
|
+
|
|
4713
|
+
/**
|
|
4714
|
+
* A plugin triggered right before editor leave Shadow Edit mode
|
|
4715
|
+
*/
|
|
4716
|
+
interface LeaveShadowEditEvent extends BasePluginEvent<PluginEventType.LeavingShadowEdit> {
|
|
4717
|
+
}
|
|
4718
|
+
|
|
4719
|
+
/**
|
|
4720
|
+
* Data of EnterShadowEditEvent
|
|
4721
|
+
*/
|
|
4722
|
+
interface EnterShadowEditEventData {
|
|
4480
4723
|
/**
|
|
4481
4724
|
* The document fragment of original editor content
|
|
4482
4725
|
*/
|
|
@@ -4487,10 +4730,16 @@ interface EnterShadowEditEvent extends BasePluginEvent<PluginEventType.EnteredSh
|
|
|
4487
4730
|
selectionPath: SelectionPath;
|
|
4488
4731
|
}
|
|
4489
4732
|
|
|
4733
|
+
/**
|
|
4734
|
+
* A plugin triggered right after editor has entered Shadow Edit mode
|
|
4735
|
+
*/
|
|
4736
|
+
interface CompatibleEnterShadowEditEvent extends EnterShadowEditEventData, BasePluginEvent<CompatiblePluginEventType.EnteredShadowEdit> {
|
|
4737
|
+
}
|
|
4738
|
+
|
|
4490
4739
|
/**
|
|
4491
4740
|
* A plugin triggered right before editor leave Shadow Edit mode
|
|
4492
4741
|
*/
|
|
4493
|
-
interface
|
|
4742
|
+
interface CompatibleLeaveShadowEditEvent extends BasePluginEvent<CompatiblePluginEventType.LeavingShadowEdit> {
|
|
4494
4743
|
}
|
|
4495
4744
|
|
|
4496
4745
|
/**
|
|
@@ -4498,7 +4747,13 @@ interface LeaveShadowEditEvent extends BasePluginEvent<PluginEventType.LeavingSh
|
|
|
4498
4747
|
* Plugins can handle this event when they need to do something for zoom changing.
|
|
4499
4748
|
*
|
|
4500
4749
|
*/
|
|
4501
|
-
interface ZoomChangedEvent extends BasePluginEvent<PluginEventType.ZoomChanged> {
|
|
4750
|
+
interface ZoomChangedEvent extends ZoomChangedEventData, BasePluginEvent<PluginEventType.ZoomChanged> {
|
|
4751
|
+
}
|
|
4752
|
+
|
|
4753
|
+
/**
|
|
4754
|
+
* Data of ZoomChangedEvent
|
|
4755
|
+
*/
|
|
4756
|
+
interface ZoomChangedEventData {
|
|
4502
4757
|
/**
|
|
4503
4758
|
* Zoom scale value before this change
|
|
4504
4759
|
*/
|
|
@@ -4509,6 +4764,14 @@ interface ZoomChangedEvent extends BasePluginEvent<PluginEventType.ZoomChanged>
|
|
|
4509
4764
|
newZoomScale: number;
|
|
4510
4765
|
}
|
|
4511
4766
|
|
|
4767
|
+
/**
|
|
4768
|
+
* Represents an event object triggered from Editor.setZoomScale() API.
|
|
4769
|
+
* Plugins can handle this event when they need to do something for zoom changing.
|
|
4770
|
+
*
|
|
4771
|
+
*/
|
|
4772
|
+
interface CompatibleZoomChangedEvent extends ZoomChangedEventData, BasePluginEvent<CompatiblePluginEventType.ZoomChanged> {
|
|
4773
|
+
}
|
|
4774
|
+
|
|
4512
4775
|
/**
|
|
4513
4776
|
* This refers to a "content block" in editor that serves as a content parsing boundary
|
|
4514
4777
|
* It is most those html block like tags, i.e. <p>, <div>, <li>, <td> etc.
|
|
@@ -4621,6 +4884,16 @@ interface CustomData {
|
|
|
4621
4884
|
disposer?: (value: any) => void;
|
|
4622
4885
|
}
|
|
4623
4886
|
|
|
4887
|
+
/**
|
|
4888
|
+
* Property that is going to store additional data related to the Content Changed Event
|
|
4889
|
+
*/
|
|
4890
|
+
interface ContentChangedData {
|
|
4891
|
+
/**
|
|
4892
|
+
* Optional property to store the format api name when using ChangeSource.Format
|
|
4893
|
+
*/
|
|
4894
|
+
formatApiName?: string;
|
|
4895
|
+
}
|
|
4896
|
+
|
|
4624
4897
|
/**
|
|
4625
4898
|
* Default format settings
|
|
4626
4899
|
*/
|
|
@@ -5832,8 +6105,9 @@ interface IEditor {
|
|
|
5832
6105
|
* @param changeSource The change source to use when fire ContentChangedEvent. When the value is not null,
|
|
5833
6106
|
* a ContentChangedEvent will be fired with change source equal to this value
|
|
5834
6107
|
* @param canUndoByBackspace True if this action can be undone when user presses Backspace key (aka Auto Complete).
|
|
6108
|
+
* @param additionalData Optional parameter to provide additional data related to the ContentChanged Event.
|
|
5835
6109
|
*/
|
|
5836
|
-
addUndoSnapshot(callback?: (start: NodePosition, end: NodePosition) => any, changeSource?: ChangeSource | CompatibleChangeSource | string, canUndoByBackspace?: boolean): void;
|
|
6110
|
+
addUndoSnapshot(callback?: (start: NodePosition, end: NodePosition) => any, changeSource?: ChangeSource | CompatibleChangeSource | string, canUndoByBackspace?: boolean, additionalData?: ContentChangedData): void;
|
|
5837
6111
|
/**
|
|
5838
6112
|
* Whether there is an available undo/redo snapshot
|
|
5839
6113
|
*/
|
|
@@ -6215,8 +6489,9 @@ interface EditorCore extends PluginState {
|
|
|
6215
6489
|
* @param callback The editing callback, accepting current selection start and end position, returns an optional object used as the data field of ContentChangedEvent.
|
|
6216
6490
|
* @param changeSource The ChangeSource string of ContentChangedEvent. @default ChangeSource.Format. Set to null to avoid triggering ContentChangedEvent
|
|
6217
6491
|
* @param canUndoByBackspace True if this action can be undone when user press Backspace key (aka Auto Complete).
|
|
6492
|
+
* @param additionalData Optional parameter to provide additional data related to the ContentChanged Event.
|
|
6218
6493
|
*/
|
|
6219
|
-
type AddUndoSnapshot = (core: EditorCore, callback: (start: NodePosition, end: NodePosition) => any, changeSource: ChangeSource | CompatibleChangeSource | string, canUndoByBackspace: boolean) => void;
|
|
6494
|
+
type AddUndoSnapshot = (core: EditorCore, callback: (start: NodePosition, end: NodePosition) => any, changeSource: ChangeSource | CompatibleChangeSource | string, canUndoByBackspace: boolean, additionalData?: ContentChangedData) => void;
|
|
6220
6495
|
|
|
6221
6496
|
/**
|
|
6222
6497
|
* Attach a DOM event to the editor content DIV
|
|
@@ -6726,6 +7001,16 @@ interface ListFeatureSettings {
|
|
|
6726
7001
|
* When delete key is pressed before the first item, indent the correct list of numbers
|
|
6727
7002
|
*/
|
|
6728
7003
|
maintainListChainWhenDelete: boolean;
|
|
7004
|
+
/**
|
|
7005
|
+
* When press space after *, -, --, ->, -->, >, => in an empty line, toggle bullet
|
|
7006
|
+
* @default true
|
|
7007
|
+
*/
|
|
7008
|
+
autoBulletList: boolean;
|
|
7009
|
+
/**
|
|
7010
|
+
* When press space after an number, a letter or roman number followed by ), ., -, or between parenthesis in an empty line, toggle numbering
|
|
7011
|
+
* @default true
|
|
7012
|
+
*/
|
|
7013
|
+
autoNumberingList: boolean;
|
|
6729
7014
|
}
|
|
6730
7015
|
|
|
6731
7016
|
/**
|
|
@@ -6833,6 +7118,7 @@ interface TextFeatureSettings {
|
|
|
6833
7118
|
*/
|
|
6834
7119
|
outdentWhenTabText: boolean;
|
|
6835
7120
|
/**
|
|
7121
|
+
* @deprecated
|
|
6836
7122
|
* Requires @see ExperimentalFeatures.AutoHyphen to be enabled
|
|
6837
7123
|
* Automatically transform -- into hyphen, if typed between two words.
|
|
6838
7124
|
*/
|
|
@@ -7036,7 +7322,7 @@ interface ImageEditOptions {
|
|
|
7036
7322
|
* Color of resize/rotate border, handle and icon
|
|
7037
7323
|
* @default #DB626C
|
|
7038
7324
|
*/
|
|
7039
|
-
borderColor?: string;
|
|
7325
|
+
borderColor?: string | ModeIndependentColor;
|
|
7040
7326
|
/**
|
|
7041
7327
|
* Minimum resize/crop width
|
|
7042
7328
|
* @default 10
|
|
@@ -7425,6 +7711,7 @@ enum CompatibleExperimentalFeatures {
|
|
|
7425
7711
|
*/
|
|
7426
7712
|
AutoFormatList = "AutoFormatList",
|
|
7427
7713
|
/**
|
|
7714
|
+
* @deprecated this feature is always disabled
|
|
7428
7715
|
* Automatically transform -- into hyphen, if typed between two words.
|
|
7429
7716
|
*/
|
|
7430
7717
|
AutoHyphen = "AutoHyphen"
|
|
@@ -7890,30 +8177,42 @@ enum CompatibleAlignment {
|
|
|
7890
8177
|
* Enum used to control the different types of bullet list
|
|
7891
8178
|
*/
|
|
7892
8179
|
enum CompatibleBulletListType {
|
|
8180
|
+
/**
|
|
8181
|
+
* Minimum value of the enum
|
|
8182
|
+
*/
|
|
8183
|
+
Min = 1,
|
|
7893
8184
|
/**
|
|
7894
8185
|
* Bullet triggered by *
|
|
7895
8186
|
*/
|
|
7896
|
-
Disc =
|
|
8187
|
+
Disc = 1,
|
|
7897
8188
|
/**
|
|
7898
8189
|
* Bullet triggered by -
|
|
7899
8190
|
*/
|
|
7900
|
-
Dash =
|
|
8191
|
+
Dash = 2,
|
|
7901
8192
|
/**
|
|
7902
8193
|
* Bullet triggered by --
|
|
7903
8194
|
*/
|
|
7904
|
-
Square =
|
|
8195
|
+
Square = 3,
|
|
7905
8196
|
/**
|
|
7906
8197
|
* Bullet triggered by >
|
|
7907
8198
|
*/
|
|
7908
|
-
ShortArrow =
|
|
8199
|
+
ShortArrow = 4,
|
|
7909
8200
|
/**
|
|
7910
8201
|
* Bullet triggered by -> or -->
|
|
7911
8202
|
*/
|
|
7912
|
-
LongArrow =
|
|
8203
|
+
LongArrow = 5,
|
|
7913
8204
|
/**
|
|
7914
8205
|
* Bullet triggered by =>
|
|
7915
8206
|
*/
|
|
7916
|
-
UnfilledArrow =
|
|
8207
|
+
UnfilledArrow = 6,
|
|
8208
|
+
/**
|
|
8209
|
+
* Bullet triggered by —
|
|
8210
|
+
*/
|
|
8211
|
+
Hyphen = 7,
|
|
8212
|
+
/**
|
|
8213
|
+
* Maximum value of the enum
|
|
8214
|
+
*/
|
|
8215
|
+
Max = 7
|
|
7917
8216
|
}
|
|
7918
8217
|
|
|
7919
8218
|
/**
|
|
@@ -8524,86 +8823,94 @@ enum CompatibleNodeType {
|
|
|
8524
8823
|
* Enum used to control the different types of numbering list
|
|
8525
8824
|
*/
|
|
8526
8825
|
enum CompatibleNumberingListType {
|
|
8826
|
+
/**
|
|
8827
|
+
* Minimum value of the enum
|
|
8828
|
+
*/
|
|
8829
|
+
Min = 1,
|
|
8527
8830
|
/**
|
|
8528
8831
|
* Numbering triggered by 1.
|
|
8529
8832
|
*/
|
|
8530
|
-
Decimal =
|
|
8833
|
+
Decimal = 1,
|
|
8531
8834
|
/**
|
|
8532
8835
|
* Numbering triggered by 1-
|
|
8533
8836
|
*/
|
|
8534
|
-
DecimalDash =
|
|
8837
|
+
DecimalDash = 2,
|
|
8535
8838
|
/**
|
|
8536
8839
|
* Numbering triggered by 1)
|
|
8537
8840
|
*/
|
|
8538
|
-
DecimalParenthesis =
|
|
8841
|
+
DecimalParenthesis = 3,
|
|
8539
8842
|
/**
|
|
8540
8843
|
* Numbering triggered by (1)
|
|
8541
8844
|
*/
|
|
8542
|
-
DecimalDoubleParenthesis =
|
|
8845
|
+
DecimalDoubleParenthesis = 4,
|
|
8543
8846
|
/**
|
|
8544
8847
|
* Numbering triggered by a.
|
|
8545
8848
|
*/
|
|
8546
|
-
LowerAlpha =
|
|
8849
|
+
LowerAlpha = 5,
|
|
8547
8850
|
/**
|
|
8548
8851
|
* Numbering triggered by a)
|
|
8549
8852
|
*/
|
|
8550
|
-
LowerAlphaParenthesis =
|
|
8853
|
+
LowerAlphaParenthesis = 6,
|
|
8551
8854
|
/**
|
|
8552
8855
|
* Numbering triggered by (a)
|
|
8553
8856
|
*/
|
|
8554
|
-
LowerAlphaDoubleParenthesis =
|
|
8857
|
+
LowerAlphaDoubleParenthesis = 7,
|
|
8555
8858
|
/**
|
|
8556
8859
|
* Numbering triggered by a-
|
|
8557
8860
|
*/
|
|
8558
|
-
LowerAlphaDash =
|
|
8861
|
+
LowerAlphaDash = 8,
|
|
8559
8862
|
/**
|
|
8560
8863
|
* Numbering triggered by A.
|
|
8561
8864
|
*/
|
|
8562
|
-
UpperAlpha =
|
|
8865
|
+
UpperAlpha = 9,
|
|
8563
8866
|
/**
|
|
8564
8867
|
* Numbering triggered by A)
|
|
8565
8868
|
*/
|
|
8566
|
-
UpperAlphaParenthesis =
|
|
8869
|
+
UpperAlphaParenthesis = 10,
|
|
8567
8870
|
/**
|
|
8568
8871
|
* Numbering triggered by (A)
|
|
8569
8872
|
*/
|
|
8570
|
-
UpperAlphaDoubleParenthesis =
|
|
8873
|
+
UpperAlphaDoubleParenthesis = 11,
|
|
8571
8874
|
/**
|
|
8572
8875
|
* Numbering triggered by A-
|
|
8573
8876
|
*/
|
|
8574
|
-
UpperAlphaDash =
|
|
8877
|
+
UpperAlphaDash = 12,
|
|
8575
8878
|
/**
|
|
8576
8879
|
* Numbering triggered by i.
|
|
8577
8880
|
*/
|
|
8578
|
-
LowerRoman =
|
|
8881
|
+
LowerRoman = 13,
|
|
8579
8882
|
/**
|
|
8580
8883
|
* Numbering triggered by i)
|
|
8581
8884
|
*/
|
|
8582
|
-
LowerRomanParenthesis =
|
|
8885
|
+
LowerRomanParenthesis = 14,
|
|
8583
8886
|
/**
|
|
8584
8887
|
* Numbering triggered by (i)
|
|
8585
8888
|
*/
|
|
8586
|
-
LowerRomanDoubleParenthesis =
|
|
8889
|
+
LowerRomanDoubleParenthesis = 15,
|
|
8587
8890
|
/**
|
|
8588
8891
|
* Numbering triggered by i-
|
|
8589
8892
|
*/
|
|
8590
|
-
LowerRomanDash =
|
|
8893
|
+
LowerRomanDash = 16,
|
|
8591
8894
|
/**
|
|
8592
8895
|
* Numbering triggered by I.
|
|
8593
8896
|
*/
|
|
8594
|
-
UpperRoman =
|
|
8897
|
+
UpperRoman = 17,
|
|
8595
8898
|
/**
|
|
8596
8899
|
* Numbering triggered by I)
|
|
8597
8900
|
*/
|
|
8598
|
-
UpperRomanParenthesis =
|
|
8901
|
+
UpperRomanParenthesis = 18,
|
|
8599
8902
|
/**
|
|
8600
8903
|
* Numbering triggered by (I)
|
|
8601
8904
|
*/
|
|
8602
|
-
UpperRomanDoubleParenthesis =
|
|
8905
|
+
UpperRomanDoubleParenthesis = 19,
|
|
8603
8906
|
/**
|
|
8604
8907
|
* Numbering triggered by I-
|
|
8605
8908
|
*/
|
|
8606
|
-
UpperRomanDash =
|
|
8909
|
+
UpperRomanDash = 20,
|
|
8910
|
+
/**
|
|
8911
|
+
* Maximum value of the enum
|
|
8912
|
+
*/
|
|
8913
|
+
Max = 20
|
|
8607
8914
|
}
|
|
8608
8915
|
|
|
8609
8916
|
/**
|
|
@@ -9174,8 +9481,6 @@ class Paste implements EditorPlugin {
|
|
|
9174
9481
|
* - Apply selected item in picker
|
|
9175
9482
|
*
|
|
9176
9483
|
* PickerPlugin doesn't provide any UI, it just wraps related DOM events and invoke callback functions.
|
|
9177
|
-
* To show a picker UI, you need to build your own UI component. Please reference to
|
|
9178
|
-
* https://github.com/microsoft/roosterjs/tree/master/demo/scripts/controls/samplepicker
|
|
9179
9484
|
*/
|
|
9180
9485
|
class PickerPlugin<T extends PickerDataProvider = PickerDataProvider> implements EditorPlugin {
|
|
9181
9486
|
readonly dataProvider: T;
|
|
@@ -9388,4 +9693,30 @@ class TableCellSelection implements EditorPlugin {
|
|
|
9388
9693
|
selectTable(): void;
|
|
9389
9694
|
}
|
|
9390
9695
|
|
|
9696
|
+
/**
|
|
9697
|
+
* Automatically transform -- into hyphen, if typed between two words.
|
|
9698
|
+
*/
|
|
9699
|
+
class AutoFormat implements EditorPlugin {
|
|
9700
|
+
private editor;
|
|
9701
|
+
private lastKeyTyped;
|
|
9702
|
+
/**
|
|
9703
|
+
* Get a friendly name of this plugin
|
|
9704
|
+
*/
|
|
9705
|
+
getName(): string;
|
|
9706
|
+
/**
|
|
9707
|
+
* Initialize this plugin
|
|
9708
|
+
* @param editor The editor instance
|
|
9709
|
+
*/
|
|
9710
|
+
initialize(editor: IEditor): void;
|
|
9711
|
+
/**
|
|
9712
|
+
* Dispose this plugin
|
|
9713
|
+
*/
|
|
9714
|
+
dispose(): void;
|
|
9715
|
+
/**
|
|
9716
|
+
* Handle events triggered from editor
|
|
9717
|
+
* @param event PluginEvent object
|
|
9718
|
+
*/
|
|
9719
|
+
onPluginEvent(event: PluginEvent): void;
|
|
9720
|
+
}
|
|
9721
|
+
|
|
9391
9722
|
}
|