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