tinymce-rails 5.10.7.1 → 6.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -19
  3. data/Rakefile +1 -2
  4. data/app/assets/javascripts/tinymce/rails.js +1 -1
  5. data/app/assets/source/tinymce/tinymce.js +17821 -18858
  6. data/lib/tinymce/rails/asset_installer/compile.rb +2 -2
  7. data/lib/tinymce/rails/asset_installer.rb +1 -1
  8. data/lib/tinymce/rails/asset_manifest.rb +1 -1
  9. data/lib/tinymce/rails/configuration.rb +2 -2
  10. data/lib/tinymce/rails/configuration_file.rb +3 -4
  11. data/lib/tinymce/rails/version.rb +2 -2
  12. data/vendor/assets/javascripts/tinymce/license.txt +21 -504
  13. data/vendor/assets/javascripts/tinymce/models/dom/model.js +4 -0
  14. data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +2 -7
  15. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +2 -7
  16. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +2 -7
  17. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +2 -7
  18. data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +2 -7
  19. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +2 -7
  20. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +2 -7
  21. data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +2 -7
  22. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +2 -7
  23. data/vendor/assets/javascripts/tinymce/plugins/emoticons/js/emojiimages.js +1 -1
  24. data/vendor/assets/javascripts/tinymce/plugins/emoticons/js/emojis.js +1 -1
  25. data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +2 -7
  26. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +2 -7
  27. data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +2 -7
  28. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +2 -7
  29. data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +2 -7
  30. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +2 -7
  31. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +2 -7
  32. data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +2 -7
  33. data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +2 -7
  34. data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +2 -7
  35. data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +2 -7
  36. data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +2 -7
  37. data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +2 -7
  38. data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +2 -7
  39. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +2 -7
  40. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +2 -7
  41. data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +2 -7
  42. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +2 -7
  43. data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +2 -7
  44. data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +2 -7
  45. data/vendor/assets/javascripts/tinymce/skins/content/dark/content.css +1 -7
  46. data/vendor/assets/javascripts/tinymce/skins/content/dark/content.min.css +1 -7
  47. data/vendor/assets/javascripts/tinymce/skins/content/default/content.css +0 -6
  48. data/vendor/assets/javascripts/tinymce/skins/content/default/content.min.css +0 -6
  49. data/vendor/assets/javascripts/tinymce/skins/content/document/content.css +0 -6
  50. data/vendor/assets/javascripts/tinymce/skins/content/document/content.min.css +0 -6
  51. data/vendor/assets/javascripts/tinymce/skins/content/tinymce-5/content.css +1 -0
  52. data/vendor/assets/javascripts/tinymce/skins/content/tinymce-5/content.min.css +1 -0
  53. data/vendor/assets/javascripts/tinymce/skins/content/tinymce-5-dark/content.css +1 -0
  54. data/vendor/assets/javascripts/tinymce/skins/content/tinymce-5-dark/content.min.css +1 -0
  55. data/vendor/assets/javascripts/tinymce/skins/content/writer/content.css +0 -6
  56. data/vendor/assets/javascripts/tinymce/skins/content/writer/content.min.css +0 -6
  57. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.css +1 -7
  58. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.css +1 -7
  59. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.min.css +1 -7
  60. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.min.css +1 -7
  61. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.css +1 -7
  62. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +1 -7
  63. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.shadowdom.css +1 -7
  64. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.shadowdom.min.css +1 -7
  65. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.css +1 -7
  66. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.css +1 -7
  67. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -7
  68. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.min.css +1 -7
  69. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.css +1 -7
  70. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +1 -7
  71. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +1 -7
  72. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +1 -7
  73. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.css +1 -0
  74. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.inline.css +1 -0
  75. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.inline.min.css +1 -0
  76. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.min.css +1 -0
  77. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.css +1 -0
  78. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.min.css +1 -0
  79. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.shadowdom.css +1 -0
  80. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.shadowdom.min.css +1 -0
  81. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.css +1 -0
  82. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.inline.css +1 -0
  83. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +1 -0
  84. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.min.css +1 -0
  85. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.css +1 -0
  86. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -0
  87. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.css +1 -0
  88. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.min.css +1 -0
  89. data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +2 -7
  90. data/vendor/assets/javascripts/tinymce/tinymce.d.ts +967 -1130
  91. data/vendor/assets/javascripts/tinymce/tinymce.js +2 -7
  92. metadata +24 -32
  93. data/app/assets/javascripts/tinymce-jquery.js +0 -2
  94. data/vendor/assets/config/tinymce-rails.manifest.js +0 -3
  95. data/vendor/assets/javascripts/tinymce/jquery.tinymce.js +0 -91
  96. data/vendor/assets/javascripts/tinymce/plugins/bbcode/plugin.js +0 -9
  97. data/vendor/assets/javascripts/tinymce/plugins/colorpicker/plugin.js +0 -9
  98. data/vendor/assets/javascripts/tinymce/plugins/contextmenu/plugin.js +0 -9
  99. data/vendor/assets/javascripts/tinymce/plugins/fullpage/plugin.js +0 -9
  100. data/vendor/assets/javascripts/tinymce/plugins/hr/plugin.js +0 -9
  101. data/vendor/assets/javascripts/tinymce/plugins/imagetools/plugin.js +0 -9
  102. data/vendor/assets/javascripts/tinymce/plugins/legacyoutput/plugin.js +0 -9
  103. data/vendor/assets/javascripts/tinymce/plugins/noneditable/plugin.js +0 -9
  104. data/vendor/assets/javascripts/tinymce/plugins/paste/plugin.js +0 -9
  105. data/vendor/assets/javascripts/tinymce/plugins/print/plugin.js +0 -9
  106. data/vendor/assets/javascripts/tinymce/plugins/spellchecker/plugin.js +0 -9
  107. data/vendor/assets/javascripts/tinymce/plugins/tabfocus/plugin.js +0 -9
  108. data/vendor/assets/javascripts/tinymce/plugins/textcolor/plugin.js +0 -9
  109. data/vendor/assets/javascripts/tinymce/plugins/textpattern/plugin.js +0 -9
  110. data/vendor/assets/javascripts/tinymce/plugins/toc/plugin.js +0 -9
  111. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.mobile.css +0 -7
  112. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.mobile.min.css +0 -7
  113. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
  114. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.mobile.css +0 -7
  115. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.mobile.min.css +0 -7
  116. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.mobile.css +0 -7
  117. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.mobile.min.css +0 -7
  118. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
  119. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.mobile.css +0 -7
  120. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +0 -7
  121. data/vendor/assets/javascripts/tinymce/themes/mobile/theme.js +0 -9
@@ -91,6 +91,7 @@ declare class EventDispatcher<T> {
91
91
  private bindings;
92
92
  constructor(settings?: Record<string, any>);
93
93
  fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>;
94
+ dispatch<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>;
94
95
  on<K extends string>(name: K, callback: false | ((event: EditorEvent<MappedEvent<T, K>>) => void), prepend?: boolean, extra?: {}): this;
95
96
  off<K extends string>(name?: K, callback?: (event: EditorEvent<MappedEvent<T, K>>) => void): this;
96
97
  once<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): this;
@@ -122,214 +123,24 @@ interface UndoManager {
122
123
  ignore: (callback: () => void) => void;
123
124
  extra: (callback1: () => void, callback2: () => void) => void;
124
125
  }
125
- declare type ArrayCallback$1<T, R> = (x: T, i: number, xs: ReadonlyArray<T>) => R;
126
- declare type ObjCallback$1<T, R> = (value: T, key: string, obj: Record<string, T>) => R;
127
- declare type ArrayCallback<T, R> = ArrayCallback$1<T, R>;
128
- declare type ObjCallback<T, R> = ObjCallback$1<T, R>;
129
- interface Tools {
130
- is: (obj: any, type: string) => boolean;
131
- isArray: <T>(arr: any) => arr is Array<T>;
132
- inArray: <T>(arr: ArrayLike<T>, value: T) => number;
133
- grep: {
134
- <T>(arr: ArrayLike<T> | null | undefined, pred?: ArrayCallback<T, boolean>): T[];
135
- <T>(arr: Record<string, T> | null | undefined, pred?: ObjCallback<T, boolean>): T[];
136
- };
137
- trim: (str: string) => string;
138
- toArray: <T>(obj: ArrayLike<T>) => T[];
139
- hasOwn: (obj: any, name: string) => boolean;
140
- makeMap: <T>(items: ArrayLike<T> | string, delim?: string | RegExp, map?: Record<string, T | string>) => Record<string, T | string>;
141
- each: {
142
- <T>(arr: ArrayLike<T> | null | undefined, cb: ArrayCallback<T, void | boolean>, scope?: any): boolean;
143
- <T>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, void | boolean>, scope?: any): boolean;
144
- };
145
- map: {
146
- <T, R>(arr: ArrayLike<T> | null | undefined, cb: ArrayCallback<T, R>): R[];
147
- <T, R>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, R>): R[];
148
- };
149
- extend: (obj: Object, ext: Object, ...objs: Object[]) => any;
150
- create: (name: string, p: Object, root?: Object) => void;
151
- walk: <T = any>(obj: T, f: Function, n?: keyof T, scope?: any) => void;
152
- createNS: (name: string, o?: Object) => any;
153
- resolve: (path: string, o?: Object) => any;
154
- explode: (s: string, d?: string | RegExp) => string[];
155
- _addCacheSuffix: (url: string) => string;
156
- }
157
- declare type EventUtilsCallback<T> = (event: EventUtilsEvent<T>) => void;
158
- declare type EventUtilsEvent<T> = NormalizedEvent<T> & {
159
- metaKey: boolean;
160
- };
161
- interface EventUtilsConstructor {
162
- readonly prototype: EventUtils;
163
- new (): EventUtils;
164
- Event: EventUtils;
165
- }
166
- declare class EventUtils {
167
- static Event: EventUtils;
168
- domLoaded: boolean;
169
- events: Record<string, any>;
170
- private readonly expando;
171
- private hasFocusIn;
172
- private hasMouseEnterLeave;
173
- private mouseEnterLeave;
174
- private count;
175
- constructor();
176
- bind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback: EventUtilsCallback<HTMLElementEventMap[K]>, scope?: any): EventUtilsCallback<HTMLElementEventMap[K]>;
177
- bind<T = any>(target: any, names: string, callback: EventUtilsCallback<T>, scope?: any): EventUtilsCallback<T>;
178
- unbind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback?: EventUtilsCallback<HTMLElementEventMap[K]>): this;
179
- unbind<T = any>(target: any, names: string, callback?: EventUtilsCallback<T>): this;
180
- unbind(target: any): this;
181
- fire(target: any, name: string, args?: {}): this;
182
- clean(target: any): this;
183
- destroy(): void;
184
- cancel<T = any>(e: EventUtilsEvent<T>): boolean;
185
- private executeHandlers;
186
- }
187
- declare type DomQuerySelector<T extends Node> = string | T | T[] | DomQuery<T>;
188
- declare type DomQueryInitSelector<T extends Node> = DomQuerySelector<T> | Window;
189
- interface Hook {
190
- get: <T extends Node>(elm: T) => string;
191
- set: <T extends Node>($elm: DomQuery<T>, value: string | null) => void;
192
- }
193
- interface DomQueryConstructor {
194
- readonly prototype: DomQuery;
195
- attrHooks: Record<string, Hook>;
196
- cssHooks: Record<string, Hook>;
197
- fn: DomQuery;
198
- find: any;
199
- expr: {
200
- cacheLength: number;
201
- createPseudo: Function;
202
- match: Record<string, RegExp>;
203
- attrHandle: {};
204
- find: Record<string, Function>;
205
- relative: Record<string, {
206
- dir: string;
207
- first?: boolean;
208
- }>;
209
- preFilter: Record<string, Function>;
210
- filter: Record<string, Function>;
211
- pseudos: Record<string, Function>;
212
- };
213
- extend: Tools['extend'];
214
- isArray: Tools['isArray'];
215
- new <T extends Node = Node>(selector?: DomQueryInitSelector<T>, context?: Node): DomQuery<T>;
216
- <T extends Node = Node>(selector?: DomQueryInitSelector<T>, context?: Node): DomQuery<T>;
217
- overrideDefaults(callback: () => {
218
- context: Node;
219
- element: Element;
220
- }): DomQueryConstructor;
221
- makeArray<T>(object: T): T[];
222
- inArray<T>(item: {}, array: T[]): number;
223
- each<T>(obj: T[], callback: (i: number, value: T) => void): void;
224
- each<T>(obj: T, callback: (key: string, obj: T[keyof T]) => void): void;
225
- trim(str: string): string;
226
- grep<T>(array: T[], callback: (item: any, i: number) => boolean): T[];
227
- unique<T>(results: T[]): T[];
228
- text(elem: Node): string;
229
- contains(context: any, elem: Node): boolean;
230
- filter(expr: string, elems: Node[], not?: boolean): any;
231
- }
232
- interface DomQuery<T extends Node = Node> extends ArrayLike<T> {
233
- init: (selector?: DomQueryInitSelector<T>, context?: Node) => void;
234
- context: T;
235
- length: number;
236
- selector: string;
237
- add(items: Array<string | T> | DomQuery<T>, sort?: boolean): this;
238
- addClass(className: string): this;
239
- after(content: DomQuerySelector<T>): this;
240
- append(content: DomQuerySelector<T>): this;
241
- appendTo(val: DomQuerySelector<T>): this;
242
- attr(name: string, value: string | boolean | number | null): this;
243
- attr(attrs: Record<string, string | boolean | number | null>): this;
244
- attr(name: string): string;
245
- before(content: DomQuerySelector<T>): this;
246
- children(selector?: string): DomQuery<Node & ChildNode>;
247
- clone(): this;
248
- closest(selector: DomQuerySelector<T>): this;
249
- contents(selector?: string): DomQuery<Node & ChildNode>;
250
- css(name: string, value: string | number | null): this;
251
- css(styles: Record<string, string | number | null>): this;
252
- css(name: string): string;
253
- each(callback: (i: number, value: T) => void): this;
254
- empty(): this;
255
- eq(index: number): this;
256
- filter(selector: string | ((i: number, item: any) => boolean)): this;
257
- find<K extends keyof HTMLElementTagNameMap>(selector: K): DomQuery<HTMLElementTagNameMap[K]>;
258
- find<T extends Node>(selector: string): DomQuery<T>;
259
- first(): this;
260
- hasClass(className: string): boolean;
261
- hide(): this;
262
- html(value: string): this;
263
- html(): string;
264
- is(selector: string | ((i: number, item: any) => boolean)): boolean;
265
- last(): this;
266
- next(selector?: string): DomQuery<Node & ChildNode>;
267
- nextUntil(selector: DomQuerySelector<T>, until?: string): DomQuery<Node & ChildNode>;
268
- off<K extends keyof HTMLElementEventMap>(name: K, callback?: EventUtilsCallback<HTMLElementEventMap[K]>): this;
269
- off<U>(name?: string, callback?: EventUtilsCallback<U>): this;
270
- offset(offset?: {}): {} | this;
271
- on<K extends keyof HTMLElementEventMap>(name: K, callback: EventUtilsCallback<HTMLElementEventMap[K]>): this;
272
- on<U>(name: string, callback: EventUtilsCallback<U>): this;
273
- parent(selector?: string): DomQuery<Node>;
274
- parents(selector?: string): DomQuery<Node>;
275
- parentsUntil(selector: DomQuerySelector<T>, filter?: string): DomQuery<Node>;
276
- prepend(content: DomQuerySelector<T>): this;
277
- prependTo(val: DomQuerySelector<T>): this;
278
- prev(selector?: string): DomQuery<Node & ChildNode>;
279
- prevUntil(selector: DomQuerySelector<T>, filter?: string): DomQuery<Node & ChildNode>;
280
- prop(name: string, value: string): this;
281
- prop(props: Record<string, string | number>): this;
282
- prop(name: string): string;
283
- push(...items: T[]): number;
284
- remove(): this;
285
- removeAttr(name: string): this;
286
- removeClass(className: string): this;
287
- replaceWith(content: DomQuerySelector<T>): this;
288
- show(): this;
289
- slice(start: number, end?: number): this;
290
- splice(start: number, deleteCount?: number): T[];
291
- sort(compareFn?: (a: T, b: T) => number): T[];
292
- text(value: string): DomQuery;
293
- text(): string;
294
- toArray(): T[];
295
- toggleClass(className: string, state?: boolean): this;
296
- trigger(name: string | {
297
- type: string;
298
- }): this;
299
- unwrap(): this;
300
- wrap(content: DomQuerySelector<T>): this;
301
- wrapAll(content: DomQuerySelector<T>): this;
302
- wrapInner(content: string): this;
303
- }
304
126
  declare type SchemaType = 'html4' | 'html5' | 'html5-strict';
305
127
  interface SchemaSettings {
306
- block_elements?: string;
307
- boolean_attributes?: string;
308
128
  custom_elements?: string;
309
129
  extended_valid_elements?: string;
310
130
  invalid_elements?: string;
311
131
  invalid_styles?: string | Record<string, string>;
312
- move_caret_before_on_enter_elements?: string;
313
- non_empty_elements?: string;
314
132
  schema?: SchemaType;
315
- self_closing_elements?: string;
316
- short_ended_elements?: string;
317
- special?: string;
318
- text_block_elements?: string;
319
- text_inline_elements?: string;
320
133
  valid_children?: string;
321
134
  valid_classes?: string | Record<string, string>;
322
135
  valid_elements?: string;
323
136
  valid_styles?: string | Record<string, string>;
324
137
  verify_html?: boolean;
325
- whitespace_elements?: string;
326
- padd_empty_block_inline_children?: boolean;
327
138
  }
328
139
  interface Attribute {
329
140
  required?: boolean;
330
141
  defaultValue?: string;
331
142
  forcedValue?: string;
332
- validValues?: any;
143
+ validValues?: Record<string, {}>;
333
144
  }
334
145
  interface DefaultAttribute {
335
146
  name: string;
@@ -340,7 +151,7 @@ interface AttributePattern {
340
151
  forcedValue?: string;
341
152
  pattern: RegExp;
342
153
  required?: boolean;
343
- validValues?: Record<string, string>;
154
+ validValues?: Record<string, {}>;
344
155
  }
345
156
  interface ElementRule {
346
157
  attributes: Record<string, Attribute>;
@@ -352,7 +163,6 @@ interface ElementRule {
352
163
  paddEmpty?: boolean;
353
164
  removeEmpty?: boolean;
354
165
  removeEmptyAttrs?: boolean;
355
- paddInEmptyBlock?: boolean;
356
166
  }
357
167
  interface SchemaElement extends ElementRule {
358
168
  outputName?: string;
@@ -366,13 +176,14 @@ interface SchemaRegExpMap {
366
176
  [name: string]: RegExp;
367
177
  }
368
178
  interface Schema {
179
+ type: SchemaType;
369
180
  children: Record<string, SchemaMap>;
370
181
  elements: Record<string, SchemaElement>;
371
182
  getValidStyles: () => Record<string, string[]> | undefined;
372
183
  getValidClasses: () => Record<string, SchemaMap> | undefined;
373
184
  getBlockElements: () => SchemaMap;
374
185
  getInvalidStyles: () => Record<string, SchemaMap> | undefined;
375
- getShortEndedElements: () => SchemaMap;
186
+ getVoidElements: () => SchemaMap;
376
187
  getTextBlockElements: () => SchemaMap;
377
188
  getTextInlineElements: () => SchemaMap;
378
189
  getBoolAttrs: () => SchemaMap;
@@ -380,7 +191,7 @@ interface Schema {
380
191
  getSelfClosingElements: () => SchemaMap;
381
192
  getNonEmptyElements: () => SchemaMap;
382
193
  getMoveCaretBeforeOnEnterElements: () => SchemaMap;
383
- getWhiteSpaceElements: () => SchemaMap;
194
+ getWhitespaceElements: () => SchemaMap;
384
195
  getSpecialElements: () => SchemaRegExpMap;
385
196
  isValidChild: (name: string, child: string) => boolean;
386
197
  isValid: (name: string, attr?: string) => boolean;
@@ -407,14 +218,12 @@ declare class AstNode {
407
218
  type: number;
408
219
  attributes?: Attributes$1;
409
220
  value?: string;
410
- shortEnded?: boolean;
411
221
  parent?: AstNode;
412
222
  firstChild?: AstNode;
413
223
  lastChild?: AstNode;
414
224
  next?: AstNode;
415
225
  prev?: AstNode;
416
226
  raw?: boolean;
417
- fixed?: boolean;
418
227
  constructor(name: string, type: number);
419
228
  replace(node: AstNode): AstNode;
420
229
  attr(name: string, value: string | null): AstNode | undefined;
@@ -435,19 +244,29 @@ declare class AstNode {
435
244
  declare type Content = string | AstNode;
436
245
  declare type ContentFormat = 'raw' | 'text' | 'html' | 'tree';
437
246
  interface GetContentArgs {
438
- format?: ContentFormat;
439
- get?: boolean;
440
- content?: string;
441
- getInner?: boolean;
247
+ format: ContentFormat;
248
+ get: boolean;
249
+ getInner: boolean;
442
250
  no_events?: boolean;
251
+ save?: boolean;
252
+ source_view?: boolean;
443
253
  [key: string]: any;
444
254
  }
445
255
  interface SetContentArgs {
446
- format?: string;
447
- set?: boolean;
448
- content?: string;
256
+ format: string;
257
+ set: boolean;
258
+ content: Content;
449
259
  no_events?: boolean;
450
260
  no_selection?: boolean;
261
+ paste?: boolean;
262
+ }
263
+ interface GetSelectionContentArgs extends GetContentArgs {
264
+ selection?: boolean;
265
+ contextual?: boolean;
266
+ }
267
+ interface SetSelectionContentArgs extends SetContentArgs {
268
+ content: string;
269
+ selection?: boolean;
451
270
  }
452
271
  interface BlobInfoData {
453
272
  id?: string;
@@ -477,10 +296,67 @@ interface BlobCache {
477
296
  removeByUri: (blobUri: string) => void;
478
297
  destroy: () => void;
479
298
  }
299
+ interface BlobInfoImagePair {
300
+ image: HTMLImageElement;
301
+ blobInfo: BlobInfo;
302
+ }
303
+ declare class NodeChange {
304
+ private readonly editor;
305
+ private lastPath;
306
+ constructor(editor: Editor);
307
+ nodeChanged(args?: any): void;
308
+ private isSameElementPath;
309
+ }
310
+ interface SelectionOverrides {
311
+ showCaret: (direction: number, node: Element, before: boolean, scrollIntoView?: boolean) => Range | null;
312
+ showBlockCaretContainer: (blockCaretContainer: Element) => void;
313
+ hideFakeCaret: () => void;
314
+ destroy: () => void;
315
+ }
316
+ interface Quirks {
317
+ refreshContentEditable(): void;
318
+ isHidden(): boolean;
319
+ }
320
+ declare type DecoratorData = Record<string, any>;
321
+ declare type Decorator = (uid: string, data: DecoratorData) => {
322
+ attributes?: {};
323
+ classes?: string[];
324
+ };
325
+ declare type AnnotationListener = (state: boolean, name: string, data?: {
326
+ uid: string;
327
+ nodes: any[];
328
+ }) => void;
329
+ declare type AnnotationListenerApi = AnnotationListener;
330
+ interface AnnotatorSettings {
331
+ decorate: Decorator;
332
+ persistent?: boolean;
333
+ }
334
+ interface Annotator {
335
+ register: (name: string, settings: AnnotatorSettings) => void;
336
+ annotate: (name: string, data: DecoratorData) => void;
337
+ annotationChanged: (name: string, f: AnnotationListenerApi) => void;
338
+ remove: (name: string) => void;
339
+ removeAll: (name: string) => void;
340
+ getAll: (name: string) => Record<string, Element[]>;
341
+ }
342
+ interface GeomRect {
343
+ readonly x: number;
344
+ readonly y: number;
345
+ readonly w: number;
346
+ readonly h: number;
347
+ }
348
+ interface Rect {
349
+ inflate: (rect: GeomRect, w: number, h: number) => GeomRect;
350
+ relativePosition: (rect: GeomRect, targetRect: GeomRect, rel: string) => GeomRect;
351
+ findBestRelativePosition: (rect: GeomRect, targetRect: GeomRect, constrainRect: GeomRect, rels: string[]) => string | null;
352
+ intersect: (rect: GeomRect, cropRect: GeomRect) => GeomRect | null;
353
+ clamp: (rect: GeomRect, clampRect: GeomRect, fixedSize?: boolean) => GeomRect;
354
+ create: (x: number, y: number, w: number, h: number) => GeomRect;
355
+ fromClientRect: (clientRect: DOMRect) => GeomRect;
356
+ }
480
357
  interface NotificationManagerImpl {
481
358
  open: (spec: NotificationSpec, closeCallback?: () => void) => NotificationApi;
482
359
  close: <T extends NotificationApi>(notification: T) => void;
483
- reposition: <T extends NotificationApi>(notifications: T[]) => void;
484
360
  getArgs: <T extends NotificationApi>(notification: T) => NotificationSpec;
485
361
  }
486
362
  interface NotificationSpec {
@@ -497,8 +373,7 @@ interface NotificationApi {
497
373
  value: (percent: number) => void;
498
374
  };
499
375
  text: (text: string) => void;
500
- moveTo: (x: number, y: number) => void;
501
- moveRel: (element: Element, rel: 'tc-tc' | 'bc-bc' | 'bc-tc' | 'tc-bc' | 'banner') => void;
376
+ reposition: () => void;
502
377
  getEl: () => HTMLElement;
503
378
  settings: NotificationSpec;
504
379
  }
@@ -507,124 +382,54 @@ interface NotificationManager {
507
382
  close: () => void;
508
383
  getNotifications: () => NotificationApi[];
509
384
  }
510
- interface UploadFailureOptions {
385
+ interface UploadFailure {
386
+ message: string;
511
387
  remove?: boolean;
512
388
  }
513
- declare type UploadHandler = (blobInfo: BlobInfo, success: (url: string) => void, failure: (err: string, options?: UploadFailureOptions) => void, progress?: (percent: number) => void) => void;
389
+ declare type ProgressFn = (percent: number) => void;
390
+ declare type UploadHandler = (blobInfo: BlobInfo, progress: ProgressFn) => Promise<string>;
514
391
  interface UploadResult$2 {
515
392
  url: string;
516
393
  blobInfo: BlobInfo;
517
394
  status: boolean;
518
- error?: {
519
- options: UploadFailureOptions;
520
- message: string;
521
- };
522
- }
523
- interface RangeLikeObject {
524
- startContainer: Node;
525
- startOffset: number;
526
- endContainer: Node;
527
- endOffset: number;
528
- }
529
- declare type ApplyFormat = BlockFormat | InlineFormat | SelectorFormat;
530
- declare type RemoveFormat = RemoveBlockFormat | RemoveInlineFormat | RemoveSelectorFormat;
531
- declare type Format = ApplyFormat | RemoveFormat;
532
- declare type Formats = Record<string, Format | Format[]>;
533
- declare type FormatAttrOrStyleValue = string | ((vars?: FormatVars) => string);
534
- declare type FormatVars = Record<string, string | null>;
535
- interface BaseFormat<T> {
536
- ceFalseOverride?: boolean;
537
- classes?: string | string[];
538
- collapsed?: boolean;
539
- exact?: boolean;
540
- expand?: boolean;
541
- links?: boolean;
542
- mixed?: boolean;
543
- block_expand?: boolean;
544
- onmatch?: (node: Node, fmt: T, itemName: string) => boolean;
545
- remove?: 'none' | 'empty' | 'all';
546
- remove_similar?: boolean;
547
- split?: boolean;
548
- deep?: boolean;
549
- preserve_attributes?: string[];
550
- }
551
- interface Block {
552
- block: string;
553
- list_block?: string;
554
- wrapper?: boolean;
555
- }
556
- interface Inline {
557
- inline: string;
558
- }
559
- interface Selector {
560
- selector: string;
561
- inherit?: boolean;
562
- }
563
- interface CommonFormat<T> extends BaseFormat<T> {
564
- attributes?: Record<string, FormatAttrOrStyleValue>;
565
- styles?: Record<string, FormatAttrOrStyleValue>;
566
- toggle?: boolean;
567
- preview?: string | false;
568
- onformat?: (elm: Node, fmt: T, vars?: FormatVars, node?: Node | RangeLikeObject) => void;
569
- clear_child_styles?: boolean;
570
- merge_siblings?: boolean;
571
- merge_with_parents?: boolean;
572
- defaultBlock?: string;
573
- }
574
- interface BlockFormat extends Block, CommonFormat<BlockFormat> {
575
- }
576
- interface InlineFormat extends Inline, CommonFormat<InlineFormat> {
577
- }
578
- interface SelectorFormat extends Selector, CommonFormat<SelectorFormat> {
395
+ error?: UploadFailure;
579
396
  }
580
- interface CommonRemoveFormat<T> extends BaseFormat<T> {
581
- attributes?: string[] | Record<string, FormatAttrOrStyleValue>;
582
- styles?: string[] | Record<string, FormatAttrOrStyleValue>;
583
- }
584
- interface RemoveBlockFormat extends Block, CommonRemoveFormat<RemoveBlockFormat> {
585
- }
586
- interface RemoveInlineFormat extends Inline, CommonRemoveFormat<RemoveInlineFormat> {
587
- }
588
- interface RemoveSelectorFormat extends Selector, CommonRemoveFormat<RemoveSelectorFormat> {
589
- }
590
- type Format_d_Formats = Formats;
591
- type Format_d_Format = Format;
592
- type Format_d_ApplyFormat = ApplyFormat;
593
- type Format_d_BlockFormat = BlockFormat;
594
- type Format_d_InlineFormat = InlineFormat;
595
- type Format_d_SelectorFormat = SelectorFormat;
596
- type Format_d_RemoveFormat = RemoveFormat;
597
- type Format_d_RemoveBlockFormat = RemoveBlockFormat;
598
- type Format_d_RemoveInlineFormat = RemoveInlineFormat;
599
- type Format_d_RemoveSelectorFormat = RemoveSelectorFormat;
600
- declare namespace Format_d {
601
- export { Format_d_Formats as Formats, Format_d_Format as Format, Format_d_ApplyFormat as ApplyFormat, Format_d_BlockFormat as BlockFormat, Format_d_InlineFormat as InlineFormat, Format_d_SelectorFormat as SelectorFormat, Format_d_RemoveFormat as RemoveFormat, Format_d_RemoveBlockFormat as RemoveBlockFormat, Format_d_RemoveInlineFormat as RemoveInlineFormat, Format_d_RemoveSelectorFormat as RemoveSelectorFormat, };
602
- }
603
- declare type StyleFormat = BlockStyleFormat | InlineStyleFormat | SelectorStyleFormat;
604
- declare type AllowedFormat = Separator | FormatReference | StyleFormat | NestedFormatting;
605
- interface Separator {
606
- title: string;
397
+ interface RawPattern {
398
+ start?: any;
399
+ end?: any;
400
+ format?: any;
401
+ cmd?: any;
402
+ value?: any;
403
+ replacement?: any;
607
404
  }
608
- interface FormatReference {
609
- title: string;
610
- format: string;
611
- icon?: string;
405
+ interface InlineBasePattern {
406
+ readonly start: string;
407
+ readonly end: string;
612
408
  }
613
- interface NestedFormatting {
614
- title: string;
615
- items: Array<FormatReference | StyleFormat>;
409
+ interface InlineFormatPattern extends InlineBasePattern {
410
+ readonly type: 'inline-format';
411
+ readonly format: string[];
616
412
  }
617
- interface CommonStyleFormat {
618
- name?: string;
619
- title: string;
620
- icon?: string;
413
+ interface InlineCmdPattern extends InlineBasePattern {
414
+ readonly type: 'inline-command';
415
+ readonly cmd: string;
416
+ readonly value?: any;
621
417
  }
622
- interface BlockStyleFormat extends BlockFormat, CommonStyleFormat {
418
+ declare type InlinePattern = InlineFormatPattern | InlineCmdPattern;
419
+ interface BlockBasePattern {
420
+ readonly start: string;
623
421
  }
624
- interface InlineStyleFormat extends InlineFormat, CommonStyleFormat {
422
+ interface BlockFormatPattern extends BlockBasePattern {
423
+ readonly type: 'block-format';
424
+ readonly format: string;
625
425
  }
626
- interface SelectorStyleFormat extends SelectorFormat, CommonStyleFormat {
426
+ interface BlockCmdPattern extends BlockBasePattern {
427
+ readonly type: 'block-command';
428
+ readonly cmd: string;
429
+ readonly value?: any;
627
430
  }
431
+ declare type BlockPattern = BlockFormatPattern | BlockCmdPattern;
432
+ declare type Pattern = InlinePattern | BlockPattern;
628
433
  interface AlertBannerSpec {
629
434
  type: 'alertbanner';
630
435
  level: 'info' | 'warn' | 'error' | 'success';
@@ -635,17 +440,12 @@ interface AlertBannerSpec {
635
440
  interface ButtonSpec {
636
441
  type: 'button';
637
442
  text: string;
638
- disabled?: boolean;
443
+ enabled?: boolean;
639
444
  primary?: boolean;
640
445
  name?: string;
641
446
  icon?: string;
642
447
  borderless?: boolean;
643
- }
644
- interface CheckboxSpec {
645
- name: string;
646
- type: 'checkbox';
647
- label: string;
648
- disabled?: boolean;
448
+ buttonType?: 'primary' | 'secondary' | 'toolbar';
649
449
  }
650
450
  interface FormComponentSpec {
651
451
  type: string;
@@ -654,9 +454,19 @@ interface FormComponentSpec {
654
454
  interface FormComponentWithLabelSpec extends FormComponentSpec {
655
455
  label?: string;
656
456
  }
457
+ interface CheckboxSpec extends FormComponentSpec {
458
+ type: 'checkbox';
459
+ label: string;
460
+ enabled?: boolean;
461
+ }
657
462
  interface CollectionSpec extends FormComponentWithLabelSpec {
658
463
  type: 'collection';
659
464
  }
465
+ interface CollectionItem {
466
+ value: string;
467
+ text: string;
468
+ icon: string;
469
+ }
660
470
  interface ColorInputSpec extends FormComponentWithLabelSpec {
661
471
  type: 'colorinput';
662
472
  }
@@ -699,20 +509,16 @@ interface IframeSpec extends FormComponentWithLabelSpec {
699
509
  type: 'iframe';
700
510
  sandboxed?: boolean;
701
511
  }
702
- interface ImageToolsState {
703
- blob: Blob;
704
- url: string;
705
- }
706
- interface ImageToolsSpec extends FormComponentWithLabelSpec {
707
- type: 'imagetools';
708
- currentState: ImageToolsState;
512
+ interface ImagePreviewSpec extends FormComponentSpec {
513
+ type: 'imagepreview';
514
+ height?: string;
709
515
  }
710
516
  interface InputSpec extends FormComponentWithLabelSpec {
711
517
  type: 'input';
712
518
  inputMode?: string;
713
519
  placeholder?: string;
714
520
  maximized?: boolean;
715
- disabled?: boolean;
521
+ enabled?: boolean;
716
522
  }
717
523
  interface LabelSpec {
718
524
  type: 'label';
@@ -746,12 +552,18 @@ interface SelectBoxSpec extends FormComponentWithLabelSpec {
746
552
  type: 'selectbox';
747
553
  items: SelectBoxItemSpec[];
748
554
  size?: number;
749
- disabled?: boolean;
555
+ enabled?: boolean;
750
556
  }
751
557
  interface SizeInputSpec extends FormComponentWithLabelSpec {
752
558
  type: 'sizeinput';
753
559
  constrain?: boolean;
754
- disabled?: boolean;
560
+ enabled?: boolean;
561
+ }
562
+ interface SliderSpec extends FormComponentSpec {
563
+ type: 'slider';
564
+ label: string;
565
+ min?: number;
566
+ max?: number;
755
567
  }
756
568
  interface TableSpec {
757
569
  type: 'table';
@@ -762,28 +574,34 @@ interface TextAreaSpec extends FormComponentWithLabelSpec {
762
574
  type: 'textarea';
763
575
  placeholder?: string;
764
576
  maximized?: boolean;
765
- disabled?: boolean;
577
+ enabled?: boolean;
766
578
  }
767
579
  interface UrlInputSpec extends FormComponentWithLabelSpec {
768
580
  type: 'urlinput';
769
581
  filetype?: 'image' | 'media' | 'file';
770
- disabled?: boolean;
582
+ enabled?: boolean;
583
+ }
584
+ interface UrlInputData {
585
+ value: string;
586
+ meta: {
587
+ text?: string;
588
+ };
771
589
  }
772
- declare type BodyComponentSpec = BarSpec | ButtonSpec | CheckboxSpec | TextAreaSpec | InputSpec | ListBoxSpec | SelectBoxSpec | SizeInputSpec | IframeSpec | HtmlPanelSpec | UrlInputSpec | DropZoneSpec | ColorInputSpec | GridSpec | ColorPickerSpec | ImageToolsSpec | AlertBannerSpec | CollectionSpec | LabelSpec | TableSpec | PanelSpec | CustomEditorSpec;
590
+ declare type BodyComponentSpec = BarSpec | ButtonSpec | CheckboxSpec | TextAreaSpec | InputSpec | ListBoxSpec | SelectBoxSpec | SizeInputSpec | SliderSpec | IframeSpec | HtmlPanelSpec | UrlInputSpec | DropZoneSpec | ColorInputSpec | GridSpec | ColorPickerSpec | ImagePreviewSpec | AlertBannerSpec | CollectionSpec | LabelSpec | TableSpec | PanelSpec | CustomEditorSpec;
773
591
  interface BarSpec {
774
592
  type: 'bar';
775
593
  items: BodyComponentSpec[];
776
594
  }
777
595
  interface CommonMenuItemSpec {
778
- disabled?: boolean;
596
+ enabled?: boolean;
779
597
  text?: string;
780
598
  value?: string;
781
599
  meta?: Record<string, any>;
782
600
  shortcut?: string;
783
601
  }
784
602
  interface CommonMenuItemInstanceApi {
785
- isDisabled: () => boolean;
786
- setDisabled: (state: boolean) => void;
603
+ isEnabled: () => boolean;
604
+ setEnabled: (state: boolean) => void;
787
605
  }
788
606
  interface DialogToggleMenuItemSpec extends CommonMenuItemSpec {
789
607
  type?: 'togglemenuitem';
@@ -794,8 +612,9 @@ interface BaseDialogFooterButtonSpec {
794
612
  name?: string;
795
613
  align?: 'start' | 'end';
796
614
  primary?: boolean;
797
- disabled?: boolean;
615
+ enabled?: boolean;
798
616
  icon?: string;
617
+ buttonType?: 'primary' | 'secondary';
799
618
  }
800
619
  interface DialogFooterNormalButtonSpec extends BaseDialogFooterButtonSpec {
801
620
  type: 'submit' | 'cancel' | 'custom';
@@ -823,11 +642,10 @@ declare type DialogData = Record<string, DialogDataItem>;
823
642
  interface DialogInstanceApi<T extends DialogData> {
824
643
  getData: () => T;
825
644
  setData: (data: Partial<T>) => void;
826
- disable: (name: string) => void;
645
+ setEnabled: (name: string, state: boolean) => void;
827
646
  focus: (name: string) => void;
828
647
  showTab: (name: string) => void;
829
648
  redial: (nu: DialogSpec<T>) => void;
830
- enable: (name: string) => void;
831
649
  block: (msg: string) => void;
832
650
  unblock: () => void;
833
651
  close: () => void;
@@ -855,7 +673,7 @@ interface DialogSpec<T extends DialogData> {
855
673
  size?: DialogSize;
856
674
  body: TabPanelSpec | PanelSpec;
857
675
  buttons: DialogFooterButtonSpec[];
858
- initialData?: T;
676
+ initialData?: Partial<T>;
859
677
  onAction?: DialogActionHandler<T>;
860
678
  onChange?: DialogChangeHandler<T>;
861
679
  onSubmit?: DialogSubmitHandler<T>;
@@ -964,15 +782,15 @@ interface ContextBarSpec {
964
782
  scope?: ContextScope;
965
783
  }
966
784
  interface BaseToolbarButtonSpec<I extends BaseToolbarButtonInstanceApi> {
967
- disabled?: boolean;
785
+ enabled?: boolean;
968
786
  tooltip?: string;
969
787
  icon?: string;
970
788
  text?: string;
971
789
  onSetup?: (api: I) => (api: I) => void;
972
790
  }
973
791
  interface BaseToolbarButtonInstanceApi {
974
- isDisabled: () => boolean;
975
- setDisabled: (state: boolean) => void;
792
+ isEnabled: () => boolean;
793
+ setEnabled: (state: boolean) => void;
976
794
  }
977
795
  interface ToolbarButtonSpec extends BaseToolbarButtonSpec<ToolbarButtonInstanceApi> {
978
796
  type?: 'button';
@@ -1112,6 +930,7 @@ type PublicDialog_d_BarSpec = BarSpec;
1112
930
  type PublicDialog_d_BodyComponentSpec = BodyComponentSpec;
1113
931
  type PublicDialog_d_ButtonSpec = ButtonSpec;
1114
932
  type PublicDialog_d_CheckboxSpec = CheckboxSpec;
933
+ type PublicDialog_d_CollectionItem = CollectionItem;
1115
934
  type PublicDialog_d_CollectionSpec = CollectionSpec;
1116
935
  type PublicDialog_d_ColorInputSpec = ColorInputSpec;
1117
936
  type PublicDialog_d_ColorPickerSpec = ColorPickerSpec;
@@ -1130,7 +949,7 @@ type PublicDialog_d_DropZoneSpec = DropZoneSpec;
1130
949
  type PublicDialog_d_GridSpec = GridSpec;
1131
950
  type PublicDialog_d_HtmlPanelSpec = HtmlPanelSpec;
1132
951
  type PublicDialog_d_IframeSpec = IframeSpec;
1133
- type PublicDialog_d_ImageToolsSpec = ImageToolsSpec;
952
+ type PublicDialog_d_ImagePreviewSpec = ImagePreviewSpec;
1134
953
  type PublicDialog_d_InputSpec = InputSpec;
1135
954
  type PublicDialog_d_LabelSpec = LabelSpec;
1136
955
  type PublicDialog_d_ListBoxSpec = ListBoxSpec;
@@ -1141,10 +960,12 @@ type PublicDialog_d_PanelSpec = PanelSpec;
1141
960
  type PublicDialog_d_SelectBoxSpec = SelectBoxSpec;
1142
961
  type PublicDialog_d_SelectBoxItemSpec = SelectBoxItemSpec;
1143
962
  type PublicDialog_d_SizeInputSpec = SizeInputSpec;
963
+ type PublicDialog_d_SliderSpec = SliderSpec;
1144
964
  type PublicDialog_d_TableSpec = TableSpec;
1145
965
  type PublicDialog_d_TabSpec = TabSpec;
1146
966
  type PublicDialog_d_TabPanelSpec = TabPanelSpec;
1147
967
  type PublicDialog_d_TextAreaSpec = TextAreaSpec;
968
+ type PublicDialog_d_UrlInputData = UrlInputData;
1148
969
  type PublicDialog_d_UrlInputSpec = UrlInputSpec;
1149
970
  type PublicDialog_d_UrlDialogSpec = UrlDialogSpec;
1150
971
  type PublicDialog_d_UrlDialogFooterButtonSpec = UrlDialogFooterButtonSpec;
@@ -1152,7 +973,7 @@ type PublicDialog_d_UrlDialogInstanceApi = UrlDialogInstanceApi;
1152
973
  type PublicDialog_d_UrlDialogActionDetails = UrlDialogActionDetails;
1153
974
  type PublicDialog_d_UrlDialogMessage = UrlDialogMessage;
1154
975
  declare namespace PublicDialog_d {
1155
- export { PublicDialog_d_AlertBannerSpec as AlertBannerSpec, PublicDialog_d_BarSpec as BarSpec, PublicDialog_d_BodyComponentSpec as BodyComponentSpec, PublicDialog_d_ButtonSpec as ButtonSpec, PublicDialog_d_CheckboxSpec as CheckboxSpec, PublicDialog_d_CollectionSpec as CollectionSpec, PublicDialog_d_ColorInputSpec as ColorInputSpec, PublicDialog_d_ColorPickerSpec as ColorPickerSpec, PublicDialog_d_CustomEditorSpec as CustomEditorSpec, PublicDialog_d_CustomEditorInit as CustomEditorInit, PublicDialog_d_CustomEditorInitFn as CustomEditorInitFn, PublicDialog_d_DialogData as DialogData, PublicDialog_d_DialogSize as DialogSize, PublicDialog_d_DialogSpec as DialogSpec, PublicDialog_d_DialogInstanceApi as DialogInstanceApi, PublicDialog_d_DialogFooterButtonSpec as DialogFooterButtonSpec, PublicDialog_d_DialogActionDetails as DialogActionDetails, PublicDialog_d_DialogChangeDetails as DialogChangeDetails, PublicDialog_d_DialogTabChangeDetails as DialogTabChangeDetails, PublicDialog_d_DropZoneSpec as DropZoneSpec, PublicDialog_d_GridSpec as GridSpec, PublicDialog_d_HtmlPanelSpec as HtmlPanelSpec, PublicDialog_d_IframeSpec as IframeSpec, PublicDialog_d_ImageToolsSpec as ImageToolsSpec, PublicDialog_d_InputSpec as InputSpec, PublicDialog_d_LabelSpec as LabelSpec, PublicDialog_d_ListBoxSpec as ListBoxSpec, PublicDialog_d_ListBoxItemSpec as ListBoxItemSpec, PublicDialog_d_ListBoxNestedItemSpec as ListBoxNestedItemSpec, PublicDialog_d_ListBoxSingleItemSpec as ListBoxSingleItemSpec, PublicDialog_d_PanelSpec as PanelSpec, PublicDialog_d_SelectBoxSpec as SelectBoxSpec, PublicDialog_d_SelectBoxItemSpec as SelectBoxItemSpec, PublicDialog_d_SizeInputSpec as SizeInputSpec, PublicDialog_d_TableSpec as TableSpec, PublicDialog_d_TabSpec as TabSpec, PublicDialog_d_TabPanelSpec as TabPanelSpec, PublicDialog_d_TextAreaSpec as TextAreaSpec, PublicDialog_d_UrlInputSpec as UrlInputSpec, PublicDialog_d_UrlDialogSpec as UrlDialogSpec, PublicDialog_d_UrlDialogFooterButtonSpec as UrlDialogFooterButtonSpec, PublicDialog_d_UrlDialogInstanceApi as UrlDialogInstanceApi, PublicDialog_d_UrlDialogActionDetails as UrlDialogActionDetails, PublicDialog_d_UrlDialogMessage as UrlDialogMessage, };
976
+ export { PublicDialog_d_AlertBannerSpec as AlertBannerSpec, PublicDialog_d_BarSpec as BarSpec, PublicDialog_d_BodyComponentSpec as BodyComponentSpec, PublicDialog_d_ButtonSpec as ButtonSpec, PublicDialog_d_CheckboxSpec as CheckboxSpec, PublicDialog_d_CollectionItem as CollectionItem, PublicDialog_d_CollectionSpec as CollectionSpec, PublicDialog_d_ColorInputSpec as ColorInputSpec, PublicDialog_d_ColorPickerSpec as ColorPickerSpec, PublicDialog_d_CustomEditorSpec as CustomEditorSpec, PublicDialog_d_CustomEditorInit as CustomEditorInit, PublicDialog_d_CustomEditorInitFn as CustomEditorInitFn, PublicDialog_d_DialogData as DialogData, PublicDialog_d_DialogSize as DialogSize, PublicDialog_d_DialogSpec as DialogSpec, PublicDialog_d_DialogInstanceApi as DialogInstanceApi, PublicDialog_d_DialogFooterButtonSpec as DialogFooterButtonSpec, PublicDialog_d_DialogActionDetails as DialogActionDetails, PublicDialog_d_DialogChangeDetails as DialogChangeDetails, PublicDialog_d_DialogTabChangeDetails as DialogTabChangeDetails, PublicDialog_d_DropZoneSpec as DropZoneSpec, PublicDialog_d_GridSpec as GridSpec, PublicDialog_d_HtmlPanelSpec as HtmlPanelSpec, PublicDialog_d_IframeSpec as IframeSpec, PublicDialog_d_ImagePreviewSpec as ImagePreviewSpec, PublicDialog_d_InputSpec as InputSpec, PublicDialog_d_LabelSpec as LabelSpec, PublicDialog_d_ListBoxSpec as ListBoxSpec, PublicDialog_d_ListBoxItemSpec as ListBoxItemSpec, PublicDialog_d_ListBoxNestedItemSpec as ListBoxNestedItemSpec, PublicDialog_d_ListBoxSingleItemSpec as ListBoxSingleItemSpec, PublicDialog_d_PanelSpec as PanelSpec, PublicDialog_d_SelectBoxSpec as SelectBoxSpec, PublicDialog_d_SelectBoxItemSpec as SelectBoxItemSpec, PublicDialog_d_SizeInputSpec as SizeInputSpec, PublicDialog_d_SliderSpec as SliderSpec, PublicDialog_d_TableSpec as TableSpec, PublicDialog_d_TabSpec as TabSpec, PublicDialog_d_TabPanelSpec as TabPanelSpec, PublicDialog_d_TextAreaSpec as TextAreaSpec, PublicDialog_d_UrlInputData as UrlInputData, PublicDialog_d_UrlInputSpec as UrlInputSpec, PublicDialog_d_UrlDialogSpec as UrlDialogSpec, PublicDialog_d_UrlDialogFooterButtonSpec as UrlDialogFooterButtonSpec, PublicDialog_d_UrlDialogInstanceApi as UrlDialogInstanceApi, PublicDialog_d_UrlDialogActionDetails as UrlDialogActionDetails, PublicDialog_d_UrlDialogMessage as UrlDialogMessage, };
1156
977
  }
1157
978
  type PublicInlineContent_d_AutocompleterSpec = AutocompleterSpec;
1158
979
  type PublicInlineContent_d_AutocompleterItemSpec = AutocompleterItemSpec;
@@ -1233,8 +1054,8 @@ interface BaseMenuButtonSpec {
1233
1054
  onSetup?: (api: BaseMenuButtonInstanceApi) => (api: BaseMenuButtonInstanceApi) => void;
1234
1055
  }
1235
1056
  interface BaseMenuButtonInstanceApi {
1236
- isDisabled: () => boolean;
1237
- setDisabled: (state: boolean) => void;
1057
+ isEnabled: () => boolean;
1058
+ setEnabled: (state: boolean) => void;
1238
1059
  isActive: () => boolean;
1239
1060
  setActive: (state: boolean) => void;
1240
1061
  }
@@ -1263,10 +1084,9 @@ interface ToolbarSplitButtonSpec {
1263
1084
  onItemAction: (api: ToolbarSplitButtonInstanceApi, value: string) => void;
1264
1085
  }
1265
1086
  interface ToolbarSplitButtonInstanceApi {
1266
- isDisabled: () => boolean;
1267
- setDisabled: (state: boolean) => void;
1087
+ isEnabled: () => boolean;
1088
+ setEnabled: (state: boolean) => void;
1268
1089
  setIconFill: (id: string, value: string) => void;
1269
- setIconStroke: (id: string, value: string) => void;
1270
1090
  isActive: () => boolean;
1271
1091
  setActive: (state: boolean) => void;
1272
1092
  }
@@ -1308,14 +1128,133 @@ interface Registry$1 {
1308
1128
  sidebars: Record<string, SidebarSpec>;
1309
1129
  };
1310
1130
  }
1131
+ interface AutocompleteLookupData {
1132
+ readonly matchText: string;
1133
+ readonly items: AutocompleterContents[];
1134
+ readonly columns: ColumnTypes$1;
1135
+ readonly onAction: (autoApi: AutocompleterInstanceApi, rng: Range, value: string, meta: Record<string, any>) => void;
1136
+ readonly highlightOn: string[];
1137
+ }
1138
+ interface AutocompleterEventArgs {
1139
+ readonly lookupData: AutocompleteLookupData[];
1140
+ }
1141
+ interface RangeLikeObject {
1142
+ startContainer: Node;
1143
+ startOffset: number;
1144
+ endContainer: Node;
1145
+ endOffset: number;
1146
+ }
1147
+ declare type ApplyFormat = BlockFormat | InlineFormat | SelectorFormat;
1148
+ declare type RemoveFormat = RemoveBlockFormat | RemoveInlineFormat | RemoveSelectorFormat;
1149
+ declare type Format = ApplyFormat | RemoveFormat;
1150
+ declare type Formats = Record<string, Format | Format[]>;
1151
+ declare type FormatAttrOrStyleValue = string | ((vars?: FormatVars) => string);
1152
+ declare type FormatVars = Record<string, string | null>;
1153
+ interface BaseFormat<T> {
1154
+ ceFalseOverride?: boolean;
1155
+ classes?: string | string[];
1156
+ collapsed?: boolean;
1157
+ exact?: boolean;
1158
+ expand?: boolean;
1159
+ links?: boolean;
1160
+ mixed?: boolean;
1161
+ block_expand?: boolean;
1162
+ onmatch?: (node: Node, fmt: T, itemName: string) => boolean;
1163
+ remove?: 'none' | 'empty' | 'all';
1164
+ remove_similar?: boolean;
1165
+ split?: boolean;
1166
+ deep?: boolean;
1167
+ preserve_attributes?: string[];
1168
+ }
1169
+ interface Block {
1170
+ block: string;
1171
+ list_block?: string;
1172
+ wrapper?: boolean;
1173
+ }
1174
+ interface Inline {
1175
+ inline: string;
1176
+ }
1177
+ interface Selector {
1178
+ selector: string;
1179
+ inherit?: boolean;
1180
+ }
1181
+ interface CommonFormat<T> extends BaseFormat<T> {
1182
+ attributes?: Record<string, FormatAttrOrStyleValue>;
1183
+ styles?: Record<string, FormatAttrOrStyleValue>;
1184
+ toggle?: boolean;
1185
+ preview?: string | false;
1186
+ onformat?: (elm: Node, fmt: T, vars?: FormatVars, node?: Node | RangeLikeObject) => void;
1187
+ clear_child_styles?: boolean;
1188
+ merge_siblings?: boolean;
1189
+ merge_with_parents?: boolean;
1190
+ }
1191
+ interface BlockFormat extends Block, CommonFormat<BlockFormat> {
1192
+ }
1193
+ interface InlineFormat extends Inline, CommonFormat<InlineFormat> {
1194
+ }
1195
+ interface SelectorFormat extends Selector, CommonFormat<SelectorFormat> {
1196
+ }
1197
+ interface CommonRemoveFormat<T> extends BaseFormat<T> {
1198
+ attributes?: string[] | Record<string, FormatAttrOrStyleValue>;
1199
+ styles?: string[] | Record<string, FormatAttrOrStyleValue>;
1200
+ }
1201
+ interface RemoveBlockFormat extends Block, CommonRemoveFormat<RemoveBlockFormat> {
1202
+ }
1203
+ interface RemoveInlineFormat extends Inline, CommonRemoveFormat<RemoveInlineFormat> {
1204
+ }
1205
+ interface RemoveSelectorFormat extends Selector, CommonRemoveFormat<RemoveSelectorFormat> {
1206
+ }
1207
+ interface ParserArgs {
1208
+ getInner?: boolean | number;
1209
+ forced_root_block?: boolean | string;
1210
+ context?: string;
1211
+ isRootContent?: boolean;
1212
+ format?: string;
1213
+ invalid?: boolean;
1214
+ no_events?: boolean;
1215
+ [key: string]: any;
1216
+ }
1217
+ declare type ParserFilterCallback = (nodes: AstNode[], name: string, args: ParserArgs) => void;
1218
+ interface ParserFilter {
1219
+ name: string;
1220
+ callbacks: ParserFilterCallback[];
1221
+ }
1222
+ interface DomParserSettings {
1223
+ allow_html_data_urls?: boolean;
1224
+ allow_svg_data_urls?: boolean;
1225
+ allow_conditional_comments?: boolean;
1226
+ allow_html_in_named_anchor?: boolean;
1227
+ allow_script_urls?: boolean;
1228
+ allow_unsafe_link_target?: boolean;
1229
+ convert_fonts_to_spans?: boolean;
1230
+ fix_list_elements?: boolean;
1231
+ font_size_legacy_values?: string;
1232
+ forced_root_block?: boolean | string;
1233
+ forced_root_block_attrs?: Record<string, string>;
1234
+ preserve_cdata?: boolean;
1235
+ remove_trailing_brs?: boolean;
1236
+ root_name?: string;
1237
+ validate?: boolean;
1238
+ inline_styles?: boolean;
1239
+ blob_cache?: BlobCache;
1240
+ document?: Document;
1241
+ }
1242
+ interface DomParser {
1243
+ schema: Schema;
1244
+ addAttributeFilter: (name: string, callback: (nodes: AstNode[], name: string, args: ParserArgs) => void) => void;
1245
+ getAttributeFilters: () => ParserFilter[];
1246
+ addNodeFilter: (name: string, callback: (nodes: AstNode[], name: string, args: ParserArgs) => void) => void;
1247
+ getNodeFilters: () => ParserFilter[];
1248
+ parse: (html: string, args?: ParserArgs) => AstNode;
1249
+ }
1311
1250
  interface StyleSheetLoaderSettings {
1312
1251
  maxLoadTime?: number;
1313
1252
  contentCssCors?: boolean;
1314
1253
  referrerPolicy?: ReferrerPolicy;
1315
1254
  }
1316
1255
  interface StyleSheetLoader {
1317
- load: (url: string, success: () => void, failure?: () => void) => void;
1318
- loadAll: (urls: string[], success: (urls: string[]) => void, failure: (urls: string[]) => void) => void;
1256
+ load: (url: string) => Promise<void>;
1257
+ loadAll: (urls: string[]) => Promise<string[]>;
1319
1258
  unload: (url: string) => void;
1320
1259
  unloadAll: (urls: string[]) => void;
1321
1260
  _setReferrerPolicy: (referrerPolicy: ReferrerPolicy) => void;
@@ -1324,9 +1263,8 @@ declare type Registry = Registry$1;
1324
1263
  interface EditorUiApi {
1325
1264
  show: () => void;
1326
1265
  hide: () => void;
1327
- enable: () => void;
1328
- disable: () => void;
1329
- isDisabled: () => boolean;
1266
+ setEnabled: (state: boolean) => void;
1267
+ isEnabled: () => boolean;
1330
1268
  }
1331
1269
  interface EditorUi extends EditorUiApi {
1332
1270
  registry: Registry;
@@ -1338,55 +1276,356 @@ type Ui_d_EditorUi = EditorUi;
1338
1276
  declare namespace Ui_d {
1339
1277
  export { Ui_d_Registry as Registry, PublicDialog_d as Dialog, PublicInlineContent_d as InlineContent, PublicMenu_d as Menu, PublicSidebar_d as Sidebar, PublicToolbar_d as Toolbar, Ui_d_EditorUiApi as EditorUiApi, Ui_d_EditorUi as EditorUi, };
1340
1278
  }
1341
- declare type EntityEncoding = 'named' | 'numeric' | 'raw' | 'named,numeric' | 'named+numeric' | 'numeric,named' | 'numeric+named';
1342
- interface ContentLanguage {
1343
- readonly title: string;
1344
- readonly code: string;
1345
- readonly customCode?: string;
1279
+ interface WindowParams {
1280
+ readonly inline?: 'cursor' | 'toolbar';
1281
+ readonly ariaAttrs?: boolean;
1346
1282
  }
1347
- declare type ThemeInitFunc = (editor: Editor, elm: HTMLElement) => {
1348
- editorContainer: HTMLElement;
1349
- iframeContainer: HTMLElement;
1350
- height?: number;
1351
- iframeHeight?: number;
1352
- api?: EditorUiApi;
1353
- };
1354
- declare type SetupCallback = (editor: Editor) => void;
1355
- declare type FilePickerCallback = (callback: Function, value: any, meta: Record<string, any>) => void;
1356
- declare type FilePickerValidationStatus = 'valid' | 'unknown' | 'invalid' | 'none';
1357
- declare type FilePickerValidationCallback = (info: {
1358
- type: string;
1359
- url: string;
1360
- }, callback: (validation: {
1361
- status: FilePickerValidationStatus;
1283
+ declare type InstanceApi<T> = UrlDialogInstanceApi | DialogInstanceApi<T>;
1284
+ interface WindowManagerImpl {
1285
+ open: <T>(config: DialogSpec<T>, params: WindowParams, closeWindow: (dialog: DialogInstanceApi<T>) => void) => DialogInstanceApi<T>;
1286
+ openUrl: (config: UrlDialogSpec, closeWindow: (dialog: UrlDialogInstanceApi) => void) => UrlDialogInstanceApi;
1287
+ alert: (message: string, callback: () => void) => void;
1288
+ confirm: (message: string, callback: (state: boolean) => void) => void;
1289
+ close: (dialog: InstanceApi<any>) => void;
1290
+ }
1291
+ interface WindowManager {
1292
+ open: <T>(config: DialogSpec<T>, params?: WindowParams) => DialogInstanceApi<T>;
1293
+ openUrl: (config: UrlDialogSpec) => UrlDialogInstanceApi;
1294
+ alert: (message: string, callback?: () => void, scope?: any) => void;
1295
+ confirm: (message: string, callback?: (state: boolean) => void, scope?: any) => void;
1296
+ close: () => void;
1297
+ }
1298
+ interface ExecCommandEvent {
1299
+ command: string;
1300
+ ui?: boolean;
1301
+ value?: any;
1302
+ }
1303
+ interface BeforeGetContentEvent extends GetContentArgs {
1304
+ selection?: boolean;
1305
+ }
1306
+ interface GetContentEvent extends BeforeGetContentEvent {
1307
+ content: string;
1308
+ }
1309
+ interface BeforeSetContentEvent extends SetContentArgs {
1310
+ content: string;
1311
+ selection?: boolean;
1312
+ }
1313
+ interface SetContentEvent extends BeforeSetContentEvent {
1314
+ content: string;
1315
+ }
1316
+ interface NewBlockEvent {
1317
+ newBlock: Element;
1318
+ }
1319
+ interface NodeChangeEvent {
1320
+ element: Element;
1321
+ parents: Node[];
1322
+ selectionChange?: boolean;
1323
+ initial?: boolean;
1324
+ }
1325
+ interface FormatEvent {
1326
+ format: string;
1327
+ vars?: FormatVars;
1328
+ node?: Node | RangeLikeObject;
1329
+ }
1330
+ interface ObjectResizeEvent {
1331
+ target: HTMLElement;
1332
+ width: number;
1333
+ height: number;
1334
+ origin: string;
1335
+ }
1336
+ interface ObjectSelectedEvent {
1337
+ target: Node;
1338
+ targetClone?: Node;
1339
+ }
1340
+ interface ScrollIntoViewEvent {
1341
+ elm: HTMLElement;
1342
+ alignToTop: boolean;
1343
+ }
1344
+ interface SetSelectionRangeEvent {
1345
+ range: Range;
1346
+ forward: boolean;
1347
+ }
1348
+ interface ShowCaretEvent {
1349
+ target: Node;
1350
+ direction: number;
1351
+ before: boolean;
1352
+ }
1353
+ interface SwitchModeEvent {
1354
+ mode: string;
1355
+ }
1356
+ interface AddUndoEvent {
1357
+ level: UndoLevel;
1358
+ lastLevel: UndoLevel;
1359
+ originalEvent: Event;
1360
+ }
1361
+ interface UndoRedoEvent {
1362
+ level: UndoLevel;
1363
+ }
1364
+ interface WindowEvent<T extends DialogData> {
1365
+ dialog: InstanceApi<T>;
1366
+ }
1367
+ interface ProgressStateEvent {
1368
+ state: boolean;
1369
+ time?: number;
1370
+ }
1371
+ interface AfterProgressStateEvent {
1372
+ state: boolean;
1373
+ }
1374
+ interface PlaceholderToggleEvent {
1375
+ state: boolean;
1376
+ }
1377
+ interface LoadErrorEvent {
1362
1378
  message: string;
1363
- }) => void) => void;
1364
- declare type URLConverter = (url: string, name: string, elm?: HTMLElement) => string;
1365
- declare type URLConverterCallback = (url: string, node: Node, on_save: boolean, name: string) => void;
1366
- interface ToolbarGroup {
1367
- name?: string;
1368
- items: string[];
1369
1379
  }
1370
- declare type ToolbarMode = 'floating' | 'sliding' | 'scrolling' | 'wrap';
1371
- interface BaseEditorSettings {
1372
- add_form_submit_trigger?: boolean;
1373
- add_unload_trigger?: boolean;
1374
- allow_conditional_comments?: boolean;
1375
- allow_html_data_urls?: boolean;
1376
- allow_html_in_named_anchor?: boolean;
1377
- allow_script_urls?: boolean;
1378
- allow_svg_data_urls?: boolean;
1379
- allow_unsafe_link_target?: boolean;
1380
- anchor_bottom?: false | string;
1381
- anchor_top?: false | string;
1382
- auto_focus?: string | true;
1383
- automatic_uploads?: boolean;
1384
- base_url?: string;
1385
- block_formats?: string;
1386
- block_unsupported_drop?: boolean;
1387
- body_id?: string;
1388
- body_class?: string;
1389
- br_in_pre?: boolean;
1380
+ interface PreProcessEvent extends ParserArgs {
1381
+ node: Element;
1382
+ }
1383
+ interface PostProcessEvent extends ParserArgs {
1384
+ content: string;
1385
+ }
1386
+ interface PastePlainTextToggleEvent {
1387
+ state: boolean;
1388
+ }
1389
+ interface PastePreProcessEvent {
1390
+ content: string;
1391
+ readonly internal: boolean;
1392
+ }
1393
+ interface PastePostProcessEvent {
1394
+ node: HTMLElement;
1395
+ readonly internal: boolean;
1396
+ }
1397
+ interface NewTableRowEvent {
1398
+ node: HTMLTableRowElement;
1399
+ }
1400
+ interface NewTableCellEvent {
1401
+ node: HTMLTableCellElement;
1402
+ }
1403
+ interface TableEventData {
1404
+ readonly structure: boolean;
1405
+ readonly style: boolean;
1406
+ }
1407
+ interface TableModifiedEvent extends TableEventData {
1408
+ readonly table: HTMLTableElement;
1409
+ }
1410
+ interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> {
1411
+ 'activate': {
1412
+ relatedTarget: Editor;
1413
+ };
1414
+ 'deactivate': {
1415
+ relatedTarget: Editor;
1416
+ };
1417
+ 'focus': {
1418
+ blurredEditor: Editor;
1419
+ };
1420
+ 'blur': {
1421
+ focusedEditor: Editor;
1422
+ };
1423
+ 'resize': UIEvent;
1424
+ 'scroll': UIEvent;
1425
+ 'detach': {};
1426
+ 'remove': {};
1427
+ 'init': {};
1428
+ 'ScrollIntoView': ScrollIntoViewEvent;
1429
+ 'AfterScrollIntoView': ScrollIntoViewEvent;
1430
+ 'ObjectResized': ObjectResizeEvent;
1431
+ 'ObjectResizeStart': ObjectResizeEvent;
1432
+ 'SwitchMode': SwitchModeEvent;
1433
+ 'ScrollWindow': UIEvent;
1434
+ 'ResizeWindow': UIEvent;
1435
+ 'SkinLoaded': {};
1436
+ 'SkinLoadError': LoadErrorEvent;
1437
+ 'PluginLoadError': LoadErrorEvent;
1438
+ 'ModelLoadError': LoadErrorEvent;
1439
+ 'IconsLoadError': LoadErrorEvent;
1440
+ 'ThemeLoadError': LoadErrorEvent;
1441
+ 'LanguageLoadError': LoadErrorEvent;
1442
+ 'BeforeExecCommand': ExecCommandEvent;
1443
+ 'ExecCommand': ExecCommandEvent;
1444
+ 'NodeChange': NodeChangeEvent;
1445
+ 'FormatApply': FormatEvent;
1446
+ 'FormatRemove': FormatEvent;
1447
+ 'ShowCaret': ShowCaretEvent;
1448
+ 'SelectionChange': {};
1449
+ 'ObjectSelected': ObjectSelectedEvent;
1450
+ 'BeforeObjectSelected': ObjectSelectedEvent;
1451
+ 'GetSelectionRange': {
1452
+ range: Range;
1453
+ };
1454
+ 'SetSelectionRange': SetSelectionRangeEvent;
1455
+ 'AfterSetSelectionRange': SetSelectionRangeEvent;
1456
+ 'BeforeGetContent': BeforeGetContentEvent;
1457
+ 'GetContent': GetContentEvent;
1458
+ 'BeforeSetContent': BeforeSetContentEvent;
1459
+ 'SetContent': SetContentEvent;
1460
+ 'LoadContent': {};
1461
+ 'PreviewFormats': {};
1462
+ 'AfterPreviewFormats': {};
1463
+ 'ScriptsLoaded': {};
1464
+ 'PreInit': {};
1465
+ 'PostRender': {};
1466
+ 'NewBlock': NewBlockEvent;
1467
+ 'ClearUndos': {};
1468
+ 'TypingUndo': {};
1469
+ 'Redo': UndoRedoEvent;
1470
+ 'Undo': UndoRedoEvent;
1471
+ 'BeforeAddUndo': AddUndoEvent;
1472
+ 'AddUndo': AddUndoEvent;
1473
+ 'CloseWindow': WindowEvent<any>;
1474
+ 'OpenWindow': WindowEvent<any>;
1475
+ 'ProgressState': ProgressStateEvent;
1476
+ 'AfterProgressState': AfterProgressStateEvent;
1477
+ 'PlaceholderToggle': PlaceholderToggleEvent;
1478
+ 'tap': TouchEvent;
1479
+ 'longpress': TouchEvent;
1480
+ 'longpresscancel': {};
1481
+ 'PreProcess': PreProcessEvent;
1482
+ 'PostProcess': PostProcessEvent;
1483
+ 'AutocompleterStart': AutocompleterEventArgs;
1484
+ 'AutocompleterUpdate': AutocompleterEventArgs;
1485
+ 'AutocompleterEnd': {};
1486
+ 'PastePlainTextToggle': PastePlainTextToggleEvent;
1487
+ 'PastePreProcess': PastePreProcessEvent;
1488
+ 'PastePostProcess': PastePostProcessEvent;
1489
+ 'TableModified': TableModifiedEvent;
1490
+ 'NewRow': NewTableRowEvent;
1491
+ 'NewCell': NewTableCellEvent;
1492
+ }
1493
+ interface EditorManagerEventMap {
1494
+ 'AddEditor': {
1495
+ editor: Editor;
1496
+ };
1497
+ 'RemoveEditor': {
1498
+ editor: Editor;
1499
+ };
1500
+ 'BeforeUnload': {
1501
+ returnValue: any;
1502
+ };
1503
+ }
1504
+ type EventTypes_d_ExecCommandEvent = ExecCommandEvent;
1505
+ type EventTypes_d_BeforeGetContentEvent = BeforeGetContentEvent;
1506
+ type EventTypes_d_GetContentEvent = GetContentEvent;
1507
+ type EventTypes_d_BeforeSetContentEvent = BeforeSetContentEvent;
1508
+ type EventTypes_d_SetContentEvent = SetContentEvent;
1509
+ type EventTypes_d_NewBlockEvent = NewBlockEvent;
1510
+ type EventTypes_d_NodeChangeEvent = NodeChangeEvent;
1511
+ type EventTypes_d_FormatEvent = FormatEvent;
1512
+ type EventTypes_d_ObjectResizeEvent = ObjectResizeEvent;
1513
+ type EventTypes_d_ObjectSelectedEvent = ObjectSelectedEvent;
1514
+ type EventTypes_d_ScrollIntoViewEvent = ScrollIntoViewEvent;
1515
+ type EventTypes_d_SetSelectionRangeEvent = SetSelectionRangeEvent;
1516
+ type EventTypes_d_ShowCaretEvent = ShowCaretEvent;
1517
+ type EventTypes_d_SwitchModeEvent = SwitchModeEvent;
1518
+ type EventTypes_d_AddUndoEvent = AddUndoEvent;
1519
+ type EventTypes_d_UndoRedoEvent = UndoRedoEvent;
1520
+ type EventTypes_d_WindowEvent<_0> = WindowEvent<_0>;
1521
+ type EventTypes_d_ProgressStateEvent = ProgressStateEvent;
1522
+ type EventTypes_d_AfterProgressStateEvent = AfterProgressStateEvent;
1523
+ type EventTypes_d_PlaceholderToggleEvent = PlaceholderToggleEvent;
1524
+ type EventTypes_d_LoadErrorEvent = LoadErrorEvent;
1525
+ type EventTypes_d_PreProcessEvent = PreProcessEvent;
1526
+ type EventTypes_d_PostProcessEvent = PostProcessEvent;
1527
+ type EventTypes_d_PastePlainTextToggleEvent = PastePlainTextToggleEvent;
1528
+ type EventTypes_d_PastePreProcessEvent = PastePreProcessEvent;
1529
+ type EventTypes_d_PastePostProcessEvent = PastePostProcessEvent;
1530
+ type EventTypes_d_NewTableRowEvent = NewTableRowEvent;
1531
+ type EventTypes_d_NewTableCellEvent = NewTableCellEvent;
1532
+ type EventTypes_d_TableEventData = TableEventData;
1533
+ type EventTypes_d_TableModifiedEvent = TableModifiedEvent;
1534
+ type EventTypes_d_EditorEventMap = EditorEventMap;
1535
+ type EventTypes_d_EditorManagerEventMap = EditorManagerEventMap;
1536
+ declare namespace EventTypes_d {
1537
+ export { EventTypes_d_ExecCommandEvent as ExecCommandEvent, EventTypes_d_BeforeGetContentEvent as BeforeGetContentEvent, EventTypes_d_GetContentEvent as GetContentEvent, EventTypes_d_BeforeSetContentEvent as BeforeSetContentEvent, EventTypes_d_SetContentEvent as SetContentEvent, EventTypes_d_NewBlockEvent as NewBlockEvent, EventTypes_d_NodeChangeEvent as NodeChangeEvent, EventTypes_d_FormatEvent as FormatEvent, EventTypes_d_ObjectResizeEvent as ObjectResizeEvent, EventTypes_d_ObjectSelectedEvent as ObjectSelectedEvent, EventTypes_d_ScrollIntoViewEvent as ScrollIntoViewEvent, EventTypes_d_SetSelectionRangeEvent as SetSelectionRangeEvent, EventTypes_d_ShowCaretEvent as ShowCaretEvent, EventTypes_d_SwitchModeEvent as SwitchModeEvent, EventTypes_d_AddUndoEvent as AddUndoEvent, EventTypes_d_UndoRedoEvent as UndoRedoEvent, EventTypes_d_WindowEvent as WindowEvent, EventTypes_d_ProgressStateEvent as ProgressStateEvent, EventTypes_d_AfterProgressStateEvent as AfterProgressStateEvent, EventTypes_d_PlaceholderToggleEvent as PlaceholderToggleEvent, EventTypes_d_LoadErrorEvent as LoadErrorEvent, EventTypes_d_PreProcessEvent as PreProcessEvent, EventTypes_d_PostProcessEvent as PostProcessEvent, EventTypes_d_PastePlainTextToggleEvent as PastePlainTextToggleEvent, EventTypes_d_PastePreProcessEvent as PastePreProcessEvent, EventTypes_d_PastePostProcessEvent as PastePostProcessEvent, EventTypes_d_NewTableRowEvent as NewTableRowEvent, EventTypes_d_NewTableCellEvent as NewTableCellEvent, EventTypes_d_TableEventData as TableEventData, EventTypes_d_TableModifiedEvent as TableModifiedEvent, EventTypes_d_EditorEventMap as EditorEventMap, EventTypes_d_EditorManagerEventMap as EditorManagerEventMap, };
1538
+ }
1539
+ type Format_d_Formats = Formats;
1540
+ type Format_d_Format = Format;
1541
+ type Format_d_ApplyFormat = ApplyFormat;
1542
+ type Format_d_BlockFormat = BlockFormat;
1543
+ type Format_d_InlineFormat = InlineFormat;
1544
+ type Format_d_SelectorFormat = SelectorFormat;
1545
+ type Format_d_RemoveFormat = RemoveFormat;
1546
+ type Format_d_RemoveBlockFormat = RemoveBlockFormat;
1547
+ type Format_d_RemoveInlineFormat = RemoveInlineFormat;
1548
+ type Format_d_RemoveSelectorFormat = RemoveSelectorFormat;
1549
+ declare namespace Format_d {
1550
+ export { Format_d_Formats as Formats, Format_d_Format as Format, Format_d_ApplyFormat as ApplyFormat, Format_d_BlockFormat as BlockFormat, Format_d_InlineFormat as InlineFormat, Format_d_SelectorFormat as SelectorFormat, Format_d_RemoveFormat as RemoveFormat, Format_d_RemoveBlockFormat as RemoveBlockFormat, Format_d_RemoveInlineFormat as RemoveInlineFormat, Format_d_RemoveSelectorFormat as RemoveSelectorFormat, };
1551
+ }
1552
+ declare type StyleFormat = BlockStyleFormat | InlineStyleFormat | SelectorStyleFormat;
1553
+ declare type AllowedFormat = Separator | FormatReference | StyleFormat | NestedFormatting;
1554
+ interface Separator {
1555
+ title: string;
1556
+ }
1557
+ interface FormatReference {
1558
+ title: string;
1559
+ format: string;
1560
+ icon?: string;
1561
+ }
1562
+ interface NestedFormatting {
1563
+ title: string;
1564
+ items: Array<FormatReference | StyleFormat>;
1565
+ }
1566
+ interface CommonStyleFormat {
1567
+ name?: string;
1568
+ title: string;
1569
+ icon?: string;
1570
+ }
1571
+ interface BlockStyleFormat extends BlockFormat, CommonStyleFormat {
1572
+ }
1573
+ interface InlineStyleFormat extends InlineFormat, CommonStyleFormat {
1574
+ }
1575
+ interface SelectorStyleFormat extends SelectorFormat, CommonStyleFormat {
1576
+ }
1577
+ declare type EntityEncoding = 'named' | 'numeric' | 'raw' | 'named,numeric' | 'named+numeric' | 'numeric,named' | 'numeric+named';
1578
+ interface ContentLanguage {
1579
+ readonly title: string;
1580
+ readonly code: string;
1581
+ readonly customCode?: string;
1582
+ }
1583
+ declare type ThemeInitFunc = (editor: Editor, elm: HTMLElement) => {
1584
+ editorContainer: HTMLElement;
1585
+ iframeContainer: HTMLElement;
1586
+ height?: number;
1587
+ iframeHeight?: number;
1588
+ api?: EditorUiApi;
1589
+ };
1590
+ declare type SetupCallback = (editor: Editor) => void;
1591
+ declare type FilePickerCallback = (callback: Function, value: any, meta: Record<string, any>) => void;
1592
+ declare type FilePickerValidationStatus = 'valid' | 'unknown' | 'invalid' | 'none';
1593
+ declare type FilePickerValidationCallback = (info: {
1594
+ type: string;
1595
+ url: string;
1596
+ }, callback: (validation: {
1597
+ status: FilePickerValidationStatus;
1598
+ message: string;
1599
+ }) => void) => void;
1600
+ declare type PastePreProcessFn = (editor: Editor, args: PastePreProcessEvent) => void;
1601
+ declare type PastePostProcessFn = (editor: Editor, args: PastePostProcessEvent) => void;
1602
+ declare type URLConverter = (url: string, name: string, elm?: HTMLElement) => string;
1603
+ declare type URLConverterCallback = (url: string, node: Node, on_save: boolean, name: string) => string;
1604
+ interface ToolbarGroup {
1605
+ name?: string;
1606
+ items: string[];
1607
+ }
1608
+ declare type ToolbarMode = 'floating' | 'sliding' | 'scrolling' | 'wrap';
1609
+ interface BaseEditorOptions {
1610
+ a11y_advanced_options?: boolean;
1611
+ add_form_submit_trigger?: boolean;
1612
+ add_unload_trigger?: boolean;
1613
+ allow_conditional_comments?: boolean;
1614
+ allow_html_data_urls?: boolean;
1615
+ allow_html_in_named_anchor?: boolean;
1616
+ allow_script_urls?: boolean;
1617
+ allow_svg_data_urls?: boolean;
1618
+ allow_unsafe_link_target?: boolean;
1619
+ anchor_bottom?: false | string;
1620
+ anchor_top?: false | string;
1621
+ auto_focus?: string | true;
1622
+ automatic_uploads?: boolean;
1623
+ base_url?: string;
1624
+ block_formats?: string;
1625
+ block_unsupported_drop?: boolean;
1626
+ body_id?: string;
1627
+ body_class?: string;
1628
+ br_in_pre?: boolean;
1390
1629
  br_newline_selector?: string;
1391
1630
  browser_spellcheck?: boolean;
1392
1631
  branding?: boolean;
@@ -1397,10 +1636,8 @@ interface BaseEditorSettings {
1397
1636
  content_css_cors?: boolean;
1398
1637
  content_security_policy?: string;
1399
1638
  content_style?: string;
1400
- deprecation_warnings?: boolean;
1401
- font_css?: string | string[];
1402
1639
  content_langs?: ContentLanguage[];
1403
- contextmenu?: string | false;
1640
+ contextmenu?: string | string[] | false;
1404
1641
  contextmenu_never_use_native?: boolean;
1405
1642
  convert_fonts_to_spans?: boolean;
1406
1643
  convert_urls?: boolean;
@@ -1408,9 +1645,11 @@ interface BaseEditorSettings {
1408
1645
  custom_elements?: string;
1409
1646
  custom_ui_selector?: string;
1410
1647
  custom_undo_redo_levels?: number;
1648
+ deprecation_warnings?: boolean;
1411
1649
  directionality?: 'ltr' | 'rtl';
1412
1650
  doctype?: string;
1413
1651
  document_base_url?: string;
1652
+ editable_class?: string;
1414
1653
  element_format?: 'xhtml' | 'html';
1415
1654
  elementpath?: boolean;
1416
1655
  encoding?: string;
@@ -1425,24 +1664,22 @@ interface BaseEditorSettings {
1425
1664
  fix_list_elements?: boolean;
1426
1665
  fixed_toolbar_container?: string;
1427
1666
  fixed_toolbar_container_target?: HTMLElement;
1428
- font_formats?: string;
1667
+ font_css?: string | string[];
1668
+ font_family_formats?: string;
1429
1669
  font_size_classes?: string;
1430
1670
  font_size_legacy_values?: string;
1431
1671
  font_size_style_values?: string;
1432
- fontsize_formats?: string;
1433
- force_hex_style_colors?: boolean;
1434
- forced_root_block?: boolean | string;
1672
+ font_size_formats?: string;
1673
+ forced_root_block?: string;
1435
1674
  forced_root_block_attrs?: Record<string, string>;
1436
1675
  formats?: Formats;
1437
- format_empty_lines?: boolean;
1438
- gecko_spellcheck?: boolean;
1439
1676
  height?: number | string;
1440
1677
  hidden_input?: boolean;
1441
1678
  icons?: string;
1442
1679
  icons_url?: string;
1443
1680
  id?: string;
1444
1681
  iframe_aria_text?: string;
1445
- images_dataimg_filter?: (imgElm: HTMLImageElement) => boolean;
1682
+ iframe_attrs?: Record<string, string>;
1446
1683
  images_file_types?: string;
1447
1684
  images_replace_blob_uris?: boolean;
1448
1685
  images_reuse_filename?: boolean;
@@ -1466,7 +1703,7 @@ interface BaseEditorSettings {
1466
1703
  language?: string;
1467
1704
  language_load?: boolean;
1468
1705
  language_url?: string;
1469
- lineheight_formats?: string;
1706
+ line_height_formats?: string;
1470
1707
  max_height?: number;
1471
1708
  max_width?: number;
1472
1709
  menu?: Record<string, {
@@ -1476,13 +1713,25 @@ interface BaseEditorSettings {
1476
1713
  menubar?: boolean | string;
1477
1714
  min_height?: number;
1478
1715
  min_width?: number;
1716
+ model?: string;
1717
+ model_url?: string;
1479
1718
  no_newline_selector?: string;
1719
+ noneditable_class?: string;
1720
+ noneditable_regexp?: RegExp | RegExp[];
1480
1721
  nowrap?: boolean;
1481
1722
  object_resizing?: boolean | string;
1482
- padd_empty_with_br?: boolean;
1723
+ paste_as_text?: boolean;
1724
+ paste_block_drop?: boolean;
1725
+ paste_data_images?: boolean;
1726
+ paste_merge_formats?: boolean;
1727
+ paste_postprocess?: PastePostProcessFn;
1728
+ paste_preprocess?: PastePreProcessFn;
1729
+ paste_remove_styles_if_webkit?: boolean;
1730
+ paste_tab_spaces?: number;
1731
+ paste_webkit_styles?: string;
1483
1732
  placeholder?: string;
1484
1733
  preserve_cdata?: boolean;
1485
- preview_styles?: boolean | string;
1734
+ preview_styles?: false | string;
1486
1735
  protect?: RegExp[];
1487
1736
  readonly?: boolean;
1488
1737
  referrer_policy?: ReferrerPolicy;
@@ -1498,14 +1747,17 @@ interface BaseEditorSettings {
1498
1747
  setup?: SetupCallback;
1499
1748
  skin?: boolean | string;
1500
1749
  skin_url?: string;
1750
+ smart_paste?: boolean;
1501
1751
  statusbar?: boolean;
1502
1752
  style_formats?: AllowedFormat[];
1503
1753
  style_formats_autohide?: boolean;
1504
1754
  style_formats_merge?: boolean;
1505
1755
  submit_patch?: boolean;
1506
1756
  suffix?: string;
1757
+ table_tab_navigation?: boolean;
1507
1758
  target?: HTMLElement;
1508
- theme?: string | ThemeInitFunc;
1759
+ text_patterns?: RawPattern[] | false;
1760
+ theme?: string | ThemeInitFunc | false;
1509
1761
  theme_url?: string;
1510
1762
  toolbar?: boolean | string | string[] | Array<ToolbarGroup>;
1511
1763
  toolbar1?: string;
@@ -1518,10 +1770,12 @@ interface BaseEditorSettings {
1518
1770
  toolbar8?: string;
1519
1771
  toolbar9?: string;
1520
1772
  toolbar_mode?: ToolbarMode;
1773
+ toolbar_sticky?: boolean;
1774
+ toolbar_sticky_offset?: number;
1521
1775
  typeahead_urls?: boolean;
1522
1776
  url_converter?: URLConverter;
1523
1777
  url_converter_scope?: any;
1524
- urlconverter_callback?: string | URLConverterCallback;
1778
+ urlconverter_callback?: URLConverterCallback;
1525
1779
  valid_children?: string;
1526
1780
  valid_classes?: string | Record<string, string>;
1527
1781
  valid_elements?: string;
@@ -1531,107 +1785,34 @@ interface BaseEditorSettings {
1531
1785
  visual_anchor_class?: string;
1532
1786
  visual_table_class?: string;
1533
1787
  width?: number | string;
1534
- toolbar_drawer?: false | 'floating' | 'sliding' | 'scrolling';
1535
- editor_deselector?: string;
1536
- editor_selector?: string;
1537
- elements?: string;
1538
- filepicker_validator_handler?: FilePickerValidationCallback;
1539
- mode?: 'exact' | 'textareas' | 'specific_textareas';
1540
- types?: Record<string, any>[];
1541
- block_elements?: string;
1542
- boolean_attributes?: string;
1543
- move_caret_before_on_enter_elements?: string;
1544
- non_empty_elements?: string;
1545
- self_closing_elements?: string;
1546
- short_ended_elements?: string;
1547
- text_block_elements?: string;
1548
- text_inline_elements?: string;
1549
- whitespace_elements?: string;
1550
- special?: string;
1551
1788
  disable_nodechange?: boolean;
1552
1789
  forced_plugins?: string | string[];
1553
1790
  plugin_base_urls?: Record<string, string>;
1554
1791
  service_message?: string;
1555
- validate?: boolean;
1556
1792
  [key: string]: any;
1557
1793
  }
1558
- interface RawEditorSettings extends BaseEditorSettings {
1794
+ interface RawEditorOptions extends BaseEditorOptions {
1559
1795
  external_plugins?: Record<string, string>;
1560
- mobile?: RawEditorSettings;
1796
+ mobile?: RawEditorOptions;
1561
1797
  plugins?: string | string[];
1562
1798
  }
1563
- interface EditorSettings extends BaseEditorSettings {
1799
+ interface NormalizedEditorOptions extends BaseEditorOptions {
1564
1800
  external_plugins: Record<string, string>;
1565
- plugins: string;
1566
- }
1567
- interface ParamTypeMap {
1568
- 'hash': Record<string, string>;
1569
- 'string': string;
1570
- 'number': number;
1571
- 'boolean': boolean;
1572
- 'string[]': string[];
1573
- 'array': any[];
1574
- }
1575
- interface BlobInfoImagePair {
1576
- image: HTMLImageElement;
1577
- blobInfo: BlobInfo;
1578
- }
1579
- declare class NodeChange {
1580
- private readonly editor;
1581
- private lastPath;
1582
- constructor(editor: Editor);
1583
- nodeChanged(args?: any): void;
1584
- private isSameElementPath;
1585
- }
1586
- interface SelectionOverrides {
1587
- showCaret: (direction: number, node: Element, before: boolean, scrollIntoView?: boolean) => Range | null;
1588
- showBlockCaretContainer: (blockCaretContainer: Element) => void;
1589
- hideFakeCaret: () => void;
1590
- destroy: () => void;
1591
- }
1592
- interface Quirks {
1593
- refreshContentEditable(): void;
1594
- isHidden(): boolean;
1595
- }
1596
- declare type DecoratorData = Record<string, any>;
1597
- declare type Decorator = (uid: string, data: DecoratorData) => {
1598
- attributes?: {};
1599
- classes?: string[];
1600
- };
1601
- declare type AnnotationListener = (state: boolean, name: string, data?: {
1602
- uid: string;
1603
- nodes: any[];
1604
- }) => void;
1605
- declare type AnnotationListenerApi = AnnotationListener;
1606
- interface AnnotatorSettings {
1607
- decorate: Decorator;
1608
- persistent?: boolean;
1609
- }
1610
- interface Annotator {
1611
- register: (name: string, settings: AnnotatorSettings) => void;
1612
- annotate: (name: string, data: DecoratorData) => void;
1613
- annotationChanged: (name: string, f: AnnotationListenerApi) => void;
1614
- remove: (name: string) => void;
1615
- getAll: (name: string) => Record<string, Element[]>;
1616
- }
1617
- interface GeomRect {
1618
- readonly x: number;
1619
- readonly y: number;
1620
- readonly w: number;
1621
- readonly h: number;
1622
- }
1623
- interface Rect {
1624
- inflate: (rect: GeomRect, w: number, h: number) => GeomRect;
1625
- relativePosition: (rect: GeomRect, targetRect: GeomRect, rel: string) => GeomRect;
1626
- findBestRelativePosition: (rect: GeomRect, targetRect: GeomRect, constrainRect: GeomRect, rels: string[]) => string | null;
1627
- intersect: (rect: GeomRect, cropRect: GeomRect) => GeomRect | null;
1628
- clamp: (rect: GeomRect, clampRect: GeomRect, fixedSize?: boolean) => GeomRect;
1629
- create: (x: number, y: number, w: number, h: number) => GeomRect;
1630
- fromClientRect: (clientRect: DOMRect) => GeomRect;
1631
- }
1632
- interface StyleMap {
1633
- [s: string]: string | number;
1634
- }
1801
+ forced_plugins: string[];
1802
+ plugins: string[];
1803
+ }
1804
+ interface EditorOptions extends NormalizedEditorOptions {
1805
+ content_css: string[];
1806
+ contextmenu: string[];
1807
+ font_css: string[];
1808
+ forced_root_block: string;
1809
+ forced_root_block_attrs: Record<string, string>;
1810
+ noneditable_regexp: RegExp[];
1811
+ object_resizing?: string;
1812
+ preview_styles?: string;
1813
+ text_patterns?: Pattern[];
1814
+ }
1815
+ declare type StyleMap = Record<string, string | number>;
1635
1816
  interface StylesSettings {
1636
1817
  allow_script_urls?: boolean;
1637
1818
  allow_svg_data_urls?: boolean;
@@ -1639,17 +1820,46 @@ interface StylesSettings {
1639
1820
  url_converter_scope?: any;
1640
1821
  }
1641
1822
  interface Styles {
1642
- toHex: (color: string) => string;
1643
1823
  parse: (css: string) => Record<string, string>;
1644
1824
  serialize: (styles: StyleMap, elementName?: string) => string;
1645
1825
  }
1826
+ declare type EventUtilsCallback<T> = (event: EventUtilsEvent<T>) => void;
1827
+ declare type EventUtilsEvent<T> = NormalizedEvent<T> & {
1828
+ metaKey: boolean;
1829
+ };
1830
+ interface EventUtilsConstructor {
1831
+ readonly prototype: EventUtils;
1832
+ new (): EventUtils;
1833
+ Event: EventUtils;
1834
+ }
1835
+ declare class EventUtils {
1836
+ static Event: EventUtils;
1837
+ domLoaded: boolean;
1838
+ events: Record<string, any>;
1839
+ private readonly expando;
1840
+ private hasFocusIn;
1841
+ private hasMouseEnterLeave;
1842
+ private mouseEnterLeave;
1843
+ private count;
1844
+ constructor();
1845
+ bind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback: EventUtilsCallback<HTMLElementEventMap[K]>, scope?: any): EventUtilsCallback<HTMLElementEventMap[K]>;
1846
+ bind<T = any>(target: any, names: string, callback: EventUtilsCallback<T>, scope?: any): EventUtilsCallback<T>;
1847
+ unbind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback?: EventUtilsCallback<HTMLElementEventMap[K]>): this;
1848
+ unbind<T = any>(target: any, names: string, callback?: EventUtilsCallback<T>): this;
1849
+ unbind(target: any): this;
1850
+ fire(target: any, name: string, args?: {}): this;
1851
+ dispatch(target: any, name: string, args?: {}): this;
1852
+ clean(target: any): this;
1853
+ destroy(): void;
1854
+ cancel<T = any>(e: EventUtilsEvent<T>): boolean;
1855
+ private executeHandlers;
1856
+ }
1646
1857
  interface DOMUtilsSettings {
1647
1858
  schema: Schema;
1648
1859
  url_converter: URLConverter;
1649
1860
  url_converter_scope: any;
1650
1861
  ownEvents: boolean;
1651
1862
  keep_values: boolean;
1652
- hex_colors: boolean;
1653
1863
  update_styles: boolean;
1654
1864
  root_element: HTMLElement;
1655
1865
  collect: Function;
@@ -1666,6 +1876,7 @@ declare type BoundEvent = [
1666
1876
  any
1667
1877
  ];
1668
1878
  declare type Callback<K extends string> = EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>;
1879
+ declare type RunResult<T, R> = T extends Array<any> ? false | R[] : false | R;
1669
1880
  interface DOMUtils {
1670
1881
  doc: Document;
1671
1882
  settings: Partial<DOMUtilsSettings>;
@@ -1679,11 +1890,6 @@ interface DOMUtils {
1679
1890
  schema: Schema;
1680
1891
  events: EventUtils;
1681
1892
  root: Node;
1682
- $: DomQueryConstructor;
1683
- $$: {
1684
- <T extends Node>(elm: T | T[] | DomQuery<T>): DomQuery<T>;
1685
- (elm: string): DomQuery<Node>;
1686
- };
1687
1893
  isBlock: (node: string | Node) => boolean;
1688
1894
  clone: (node: Node, deep: boolean) => Node;
1689
1895
  getRoot: () => HTMLElement;
@@ -1718,12 +1924,9 @@ interface DOMUtils {
1718
1924
  };
1719
1925
  createHTML: (name: string, attrs?: Record<string, string>, html?: string) => string;
1720
1926
  createFragment: (html?: string) => DocumentFragment;
1721
- remove: <T extends Node>(node: string | T | T[] | DomQuery<T>, keepChildren?: boolean) => T | T[];
1722
- setStyle: {
1723
- (elm: string | Node | Node[], name: string, value: string | number | null): void;
1724
- (elm: string | Node | Node[], styles: StyleMap): void;
1725
- };
1726
- getStyle: (elm: string | Node, name: string, computed?: boolean) => string;
1927
+ remove: <T extends Node>(node: string | T | T[], keepChildren?: boolean) => RunResult<typeof node, T>;
1928
+ setStyle: (elm: string | Node | Node[], name: string, value: string | number | null) => void;
1929
+ getStyle: (elm: string | Node, name: string, computed?: boolean) => string | undefined;
1727
1930
  setStyles: (elm: string | Node | Node[], stylesArg: StyleMap) => void;
1728
1931
  removeAllAttribs: (e: RunArguments<Element>) => void;
1729
1932
  setAttrib: (elm: string | Node | Node[], name: string, value: string | boolean | number | null) => void;
@@ -1752,7 +1955,7 @@ interface DOMUtils {
1752
1955
  encode: (text: string) => string;
1753
1956
  insertAfter: {
1754
1957
  <T extends Node>(node: T | T[], reference: string | Node): T;
1755
- <T extends Node>(node: RunArguments<T>, reference: string | Node): false | T;
1958
+ <T extends Node>(node: RunArguments<T>, reference: string | Node): RunResult<typeof node, T>;
1756
1959
  };
1757
1960
  replace: {
1758
1961
  <T extends Node>(newElm: Node, oldElm: T | T[], keepChildren?: boolean): T;
@@ -1763,9 +1966,8 @@ interface DOMUtils {
1763
1966
  (elm: Element, name: string): Element;
1764
1967
  };
1765
1968
  findCommonAncestor: (a: Node, b: Node) => Node;
1766
- toHex: (rgbVal: string) => string;
1767
- run<R, T extends Node>(this: DOMUtils, elm: T | T[], func: (node: T) => R, scope?: any): R;
1768
- run<R, T extends Node>(this: DOMUtils, elm: RunArguments<T>, func: (node: T) => R, scope?: any): false | R;
1969
+ run<R, T extends Node>(this: DOMUtils, elm: T | T[], func: (node: T) => R, scope?: any): typeof elm extends Array<any> ? R[] : R;
1970
+ run<R, T extends Node>(this: DOMUtils, elm: RunArguments<T>, func: (node: T) => R, scope?: any): RunResult<typeof elm, R>;
1769
1971
  getAttribs: (elm: string | Node) => NamedNodeMap | Attr[];
1770
1972
  isEmpty: (node: Node, elements?: Record<string, any>) => boolean;
1771
1973
  createRng: () => Range;
@@ -1783,6 +1985,7 @@ interface DOMUtils {
1783
1985
  <K extends string>(target: Target[], name?: K, func?: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils[];
1784
1986
  };
1785
1987
  fire: (target: Node | Window, name: string, evt?: {}) => EventUtils;
1988
+ dispatch: (target: Node | Window, name: string, evt?: {}) => EventUtils;
1786
1989
  getContentEditable: (node: Node) => string | null;
1787
1990
  getContentEditableParent: (node: Node) => string | null;
1788
1991
  destroy: () => void;
@@ -1797,13 +2000,6 @@ interface ClientRect {
1797
2000
  width: number;
1798
2001
  height: number;
1799
2002
  }
1800
- interface GetSelectionContentArgs extends GetContentArgs {
1801
- selection?: boolean;
1802
- contextual?: boolean;
1803
- }
1804
- interface SelectionSetContentArgs extends SetContentArgs {
1805
- selection?: boolean;
1806
- }
1807
2003
  interface BookmarkManager {
1808
2004
  getBookmark: (type: number, normalized?: boolean) => Bookmark;
1809
2005
  moveToBookmark: (bookmark: Bookmark) => void;
@@ -1815,52 +2011,6 @@ interface ControlSelection {
1815
2011
  updateResizeRect: (evt: EditorEvent<any>) => void;
1816
2012
  destroy: () => void;
1817
2013
  }
1818
- interface ParserArgs {
1819
- getInner?: boolean | number;
1820
- forced_root_block?: boolean | string;
1821
- context?: string;
1822
- isRootContent?: boolean;
1823
- format?: string;
1824
- invalid?: boolean;
1825
- no_events?: boolean;
1826
- [key: string]: any;
1827
- }
1828
- declare type ParserFilterCallback = (nodes: AstNode[], name: string, args: ParserArgs) => void;
1829
- interface ParserFilter {
1830
- name: string;
1831
- callbacks: ParserFilterCallback[];
1832
- }
1833
- interface DomParserSettings {
1834
- allow_html_data_urls?: boolean;
1835
- allow_svg_data_urls?: boolean;
1836
- allow_conditional_comments?: boolean;
1837
- allow_html_in_named_anchor?: boolean;
1838
- allow_script_urls?: boolean;
1839
- allow_unsafe_link_target?: boolean;
1840
- convert_fonts_to_spans?: boolean;
1841
- fix_list_elements?: boolean;
1842
- font_size_legacy_values?: string;
1843
- forced_root_block?: boolean | string;
1844
- forced_root_block_attrs?: Record<string, string>;
1845
- padd_empty_with_br?: boolean;
1846
- preserve_cdata?: boolean;
1847
- remove_trailing_brs?: boolean;
1848
- root_name?: string;
1849
- validate?: boolean;
1850
- inline_styles?: boolean;
1851
- blob_cache?: BlobCache;
1852
- document?: Document;
1853
- images_dataimg_filter?: (img: HTMLImageElement) => boolean;
1854
- }
1855
- interface DomParser {
1856
- schema: Schema;
1857
- addAttributeFilter: (name: string, callback: (nodes: AstNode[], name: string, args: ParserArgs) => void) => void;
1858
- getAttributeFilters: () => ParserFilter[];
1859
- addNodeFilter: (name: string, callback: (nodes: AstNode[], name: string, args: ParserArgs) => void) => void;
1860
- getNodeFilters: () => ParserFilter[];
1861
- filterNode: (node: AstNode) => AstNode;
1862
- parse: (html: string, args?: ParserArgs) => AstNode;
1863
- }
1864
2014
  interface WriterSettings {
1865
2015
  element_format?: 'xhtml' | 'html';
1866
2016
  entities?: string;
@@ -1907,309 +2057,91 @@ interface DomSerializerImpl {
1907
2057
  } & ParserArgs): AstNode;
1908
2058
  (node: Element, parserArgs?: ParserArgs): string;
1909
2059
  };
1910
- addRules: (rules: string) => void;
1911
- setRules: (rules: string) => void;
1912
- addTempAttr: (name: string) => void;
1913
- getTempAttrs: () => string[];
1914
- }
1915
- interface DomSerializer extends DomSerializerImpl {
1916
- }
1917
- interface EditorSelection {
1918
- bookmarkManager: BookmarkManager;
1919
- controlSelection: ControlSelection;
1920
- dom: DOMUtils;
1921
- win: Window;
1922
- serializer: DomSerializer;
1923
- editor: Editor;
1924
- collapse: (toStart?: boolean) => void;
1925
- setCursorLocation: {
1926
- (node: Node, offset: number): void;
1927
- (): void;
1928
- };
1929
- getContent: {
1930
- (args: {
1931
- format: 'tree';
1932
- } & GetSelectionContentArgs): AstNode;
1933
- (args?: GetSelectionContentArgs): string;
1934
- };
1935
- setContent: (content: string, args?: SelectionSetContentArgs) => void;
1936
- getBookmark: (type?: number, normalized?: boolean) => Bookmark;
1937
- moveToBookmark: (bookmark: Bookmark) => void;
1938
- select: (node: Node, content?: boolean) => Node;
1939
- isCollapsed: () => boolean;
1940
- isForward: () => boolean;
1941
- setNode: (elm: Element) => Element;
1942
- getNode: () => Element;
1943
- getSel: () => Selection | null;
1944
- setRng: (rng: Range, forward?: boolean) => void;
1945
- getRng: () => Range;
1946
- getStart: (real?: boolean) => Element;
1947
- getEnd: (real?: boolean) => Element;
1948
- getSelectedBlocks: (startElm?: Element, endElm?: Element) => Element[];
1949
- normalize: () => Range;
1950
- selectorChanged: (selector: string, callback: (active: boolean, args: {
1951
- node: Node;
1952
- selector: String;
1953
- parents: Element[];
1954
- }) => void) => EditorSelection;
1955
- selectorChangedWithUnbind: (selector: string, callback: (active: boolean, args: {
1956
- node: Node;
1957
- selector: String;
1958
- parents: Element[];
1959
- }) => void) => {
1960
- unbind: () => void;
1961
- };
1962
- getScrollContainer: () => HTMLElement;
1963
- scrollIntoView: (elm?: HTMLElement, alignToTop?: boolean) => void;
1964
- placeCaretAt: (clientX: number, clientY: number) => void;
1965
- getBoundingClientRect: () => ClientRect | DOMRect;
1966
- destroy: () => void;
1967
- }
1968
- declare type EditorCommandCallback = (ui: boolean, value: any, args: any) => void;
1969
- declare type EditorCommandsCallback = (command: string, ui: boolean, value: any, args: any) => void;
1970
- interface Commands {
1971
- state: Record<string, (command: string) => boolean>;
1972
- exec: Record<string, EditorCommandsCallback>;
1973
- value: Record<string, (command: string) => string>;
1974
- }
1975
- interface EditorCommandsConstructor {
1976
- readonly prototype: EditorCommands;
1977
- new (editor: Editor): EditorCommands;
1978
- }
1979
- declare class EditorCommands {
1980
- private readonly editor;
1981
- private selectionBookmark;
1982
- private commands;
1983
- constructor(editor: Editor);
1984
- execCommand(command: string, ui?: boolean, value?: any, args?: any): boolean;
1985
- queryCommandState(command: string): boolean;
1986
- queryCommandValue(command: string): string;
1987
- addCommands<K extends keyof Commands>(commandList: Commands[K], type: K): void;
1988
- addCommands(commandList: Record<string, EditorCommandsCallback>): void;
1989
- addCommand(command: string, callback: EditorCommandCallback, scope?: any): void;
1990
- queryCommandSupported(command: string): boolean;
1991
- addQueryStateHandler(command: string, callback: () => boolean, scope?: any): void;
1992
- addQueryValueHandler(command: string, callback: () => string, scope?: any): void;
1993
- hasCustomCommand(command: string): boolean;
1994
- private execNativeCommand;
1995
- private isFormatMatch;
1996
- private toggleFormat;
1997
- private storeSelection;
1998
- private restoreSelection;
1999
- private setupCommands;
2000
- }
2001
- interface WindowParams {
2002
- readonly inline?: 'cursor' | 'toolbar';
2003
- readonly ariaAttrs?: boolean;
2004
- }
2005
- declare type InstanceApi<T> = UrlDialogInstanceApi | DialogInstanceApi<T>;
2006
- interface WindowManagerImpl {
2007
- open: <T>(config: DialogSpec<T>, params: WindowParams, closeWindow: (dialog: DialogInstanceApi<T>) => void) => DialogInstanceApi<T>;
2008
- openUrl: (config: UrlDialogSpec, closeWindow: (dialog: UrlDialogInstanceApi) => void) => UrlDialogInstanceApi;
2009
- alert: (message: string, callback: () => void) => void;
2010
- confirm: (message: string, callback: (state: boolean) => void) => void;
2011
- close: (dialog: InstanceApi<any>) => void;
2012
- }
2013
- interface WindowManager {
2014
- open: <T>(config: DialogSpec<T>, params?: WindowParams) => DialogInstanceApi<T>;
2015
- openUrl: (config: UrlDialogSpec) => UrlDialogInstanceApi;
2016
- alert: (message: string, callback?: () => void, scope?: any) => void;
2017
- confirm: (message: string, callback?: (state: boolean) => void, scope?: any) => void;
2018
- close: () => void;
2019
- }
2020
- interface ExecCommandEvent {
2021
- command: string;
2022
- ui?: boolean;
2023
- value?: any;
2024
- }
2025
- declare type GetContentEvent = GetContentArgs & {
2026
- source_view?: boolean;
2027
- selection?: boolean;
2028
- save?: boolean;
2029
- };
2030
- declare type SetContentEvent = SetContentArgs & {
2031
- source_view?: boolean;
2032
- paste?: boolean;
2033
- selection?: boolean;
2034
- };
2035
- interface NewBlockEvent {
2036
- newBlock: Element;
2037
- }
2038
- interface NodeChangeEvent {
2039
- element: Element;
2040
- parents: Node[];
2041
- selectionChange?: boolean;
2042
- initial?: boolean;
2043
- }
2044
- interface FormatEvent {
2045
- format: string;
2046
- vars?: FormatVars;
2047
- node?: Node | RangeLikeObject;
2048
- }
2049
- interface ObjectResizeEvent {
2050
- target: HTMLElement;
2051
- width: number;
2052
- height: number;
2053
- origin: string;
2054
- }
2055
- interface ObjectSelectedEvent {
2056
- target: Node;
2057
- targetClone?: Node;
2058
- }
2059
- interface ScrollIntoViewEvent {
2060
- elm: HTMLElement;
2061
- alignToTop: boolean;
2062
- }
2063
- interface SetSelectionRangeEvent {
2064
- range: Range;
2065
- forward: boolean;
2066
- }
2067
- interface ShowCaretEvent {
2068
- target: Node;
2069
- direction: number;
2070
- before: boolean;
2071
- }
2072
- interface SwitchModeEvent {
2073
- mode: string;
2074
- }
2075
- interface AddUndoEvent {
2076
- level: UndoLevel;
2077
- lastLevel: UndoLevel;
2078
- originalEvent: Event;
2079
- }
2080
- interface UndoRedoEvent {
2081
- level: UndoLevel;
2082
- }
2083
- interface WindowEvent<T extends DialogData> {
2084
- dialog: InstanceApi<T>;
2085
- }
2086
- interface ProgressStateEvent {
2087
- state: boolean;
2088
- time?: number;
2089
- }
2090
- interface AfterProgressStateEvent {
2091
- state: boolean;
2092
- }
2093
- interface PlaceholderToggleEvent {
2094
- state: boolean;
2095
- }
2096
- interface LoadErrorEvent {
2097
- message: string;
2098
- }
2099
- interface PreProcessEvent extends ParserArgs {
2100
- node: Element;
2060
+ addRules: (rules: string) => void;
2061
+ setRules: (rules: string) => void;
2062
+ addTempAttr: (name: string) => void;
2063
+ getTempAttrs: () => string[];
2101
2064
  }
2102
- interface PostProcessEvent extends ParserArgs {
2103
- content: string;
2065
+ interface DomSerializer extends DomSerializerImpl {
2104
2066
  }
2105
- interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> {
2106
- 'activate': {
2107
- relatedTarget: Editor;
2108
- };
2109
- 'deactivate': {
2110
- relatedTarget: Editor;
2111
- };
2112
- 'focus': {
2113
- blurredEditor: Editor;
2067
+ interface EditorSelection {
2068
+ bookmarkManager: BookmarkManager;
2069
+ controlSelection: ControlSelection;
2070
+ dom: DOMUtils;
2071
+ win: Window;
2072
+ serializer: DomSerializer;
2073
+ editor: Editor;
2074
+ collapse: (toStart?: boolean) => void;
2075
+ setCursorLocation: {
2076
+ (node: Node, offset: number): void;
2077
+ (): void;
2114
2078
  };
2115
- 'blur': {
2116
- focusedEditor: Editor;
2079
+ getContent: {
2080
+ (args: {
2081
+ format: 'tree';
2082
+ } & Partial<GetSelectionContentArgs>): AstNode;
2083
+ (args?: Partial<GetSelectionContentArgs>): string;
2117
2084
  };
2118
- 'resize': UIEvent;
2119
- 'scroll': UIEvent;
2120
- 'detach': {};
2121
- 'remove': {};
2122
- 'init': {};
2123
- 'ScrollIntoView': ScrollIntoViewEvent;
2124
- 'AfterScrollIntoView': ScrollIntoViewEvent;
2125
- 'ObjectResized': ObjectResizeEvent;
2126
- 'ObjectResizeStart': ObjectResizeEvent;
2127
- 'SwitchMode': SwitchModeEvent;
2128
- 'ScrollWindow': UIEvent;
2129
- 'ResizeWindow': UIEvent;
2130
- 'SkinLoaded': {};
2131
- 'SkinLoadError': LoadErrorEvent;
2132
- 'PluginLoadError': LoadErrorEvent;
2133
- 'IconsLoadError': LoadErrorEvent;
2134
- 'LanguageLoadError': LoadErrorEvent;
2135
- 'BeforeExecCommand': ExecCommandEvent;
2136
- 'ExecCommand': ExecCommandEvent;
2137
- 'NodeChange': NodeChangeEvent;
2138
- 'FormatApply': FormatEvent;
2139
- 'FormatRemove': FormatEvent;
2140
- 'ShowCaret': ShowCaretEvent;
2141
- 'SelectionChange': {};
2142
- 'ObjectSelected': ObjectSelectedEvent;
2143
- 'BeforeObjectSelected': ObjectSelectedEvent;
2144
- 'GetSelectionRange': {
2145
- range: Range;
2085
+ setContent: (content: string, args?: Partial<SetSelectionContentArgs>) => void;
2086
+ getBookmark: (type?: number, normalized?: boolean) => Bookmark;
2087
+ moveToBookmark: (bookmark: Bookmark) => void;
2088
+ select: (node: Node, content?: boolean) => Node;
2089
+ isCollapsed: () => boolean;
2090
+ isForward: () => boolean;
2091
+ setNode: (elm: Element) => Element;
2092
+ getNode: () => Element;
2093
+ getSel: () => Selection | null;
2094
+ setRng: (rng: Range, forward?: boolean) => void;
2095
+ getRng: () => Range;
2096
+ getStart: (real?: boolean) => Element;
2097
+ getEnd: (real?: boolean) => Element;
2098
+ getSelectedBlocks: (startElm?: Element, endElm?: Element) => Element[];
2099
+ normalize: () => Range;
2100
+ selectorChanged: (selector: string, callback: (active: boolean, args: {
2101
+ node: Node;
2102
+ selector: String;
2103
+ parents: Element[];
2104
+ }) => void) => EditorSelection;
2105
+ selectorChangedWithUnbind: (selector: string, callback: (active: boolean, args: {
2106
+ node: Node;
2107
+ selector: String;
2108
+ parents: Element[];
2109
+ }) => void) => {
2110
+ unbind: () => void;
2146
2111
  };
2147
- 'SetSelectionRange': SetSelectionRangeEvent;
2148
- 'AfterSetSelectionRange': SetSelectionRangeEvent;
2149
- 'BeforeGetContent': GetContentEvent;
2150
- 'GetContent': GetContentEvent;
2151
- 'BeforeSetContent': SetContentEvent;
2152
- 'SetContent': SetContentEvent;
2153
- 'LoadContent': {};
2154
- 'PreviewFormats': {};
2155
- 'AfterPreviewFormats': {};
2156
- 'ScriptsLoaded': {};
2157
- 'PreInit': {};
2158
- 'PostRender': {};
2159
- 'NewBlock': NewBlockEvent;
2160
- 'ClearUndos': {};
2161
- 'TypingUndo': {};
2162
- 'Redo': UndoRedoEvent;
2163
- 'Undo': UndoRedoEvent;
2164
- 'BeforeAddUndo': AddUndoEvent;
2165
- 'AddUndo': AddUndoEvent;
2166
- 'CloseWindow': WindowEvent<any>;
2167
- 'OpenWindow': WindowEvent<any>;
2168
- 'ProgressState': ProgressStateEvent;
2169
- 'AfterProgressState': AfterProgressStateEvent;
2170
- 'PlaceholderToggle': PlaceholderToggleEvent;
2171
- 'tap': TouchEvent;
2172
- 'longpress': TouchEvent;
2173
- 'longpresscancel': {};
2174
- 'PreProcess': PreProcessEvent;
2175
- 'PostProcess': PostProcessEvent;
2112
+ getScrollContainer: () => HTMLElement;
2113
+ scrollIntoView: (elm?: HTMLElement, alignToTop?: boolean) => void;
2114
+ placeCaretAt: (clientX: number, clientY: number) => void;
2115
+ getBoundingClientRect: () => ClientRect | DOMRect;
2116
+ destroy: () => void;
2176
2117
  }
2177
- interface EditorManagerEventMap {
2178
- 'AddEditor': {
2179
- editor: Editor;
2180
- };
2181
- 'RemoveEditor': {
2182
- editor: Editor;
2183
- };
2184
- 'BeforeUnload': {
2185
- returnValue: any;
2186
- };
2118
+ declare type EditorCommandCallback = (ui: boolean, value: any) => void;
2119
+ declare type EditorCommandsCallback = (command: string, ui: boolean, value: any) => void;
2120
+ interface Commands {
2121
+ state: Record<string, (command: string) => boolean>;
2122
+ exec: Record<string, EditorCommandsCallback>;
2123
+ value: Record<string, (command: string) => string>;
2187
2124
  }
2188
- type EventTypes_d_ExecCommandEvent = ExecCommandEvent;
2189
- type EventTypes_d_GetContentEvent = GetContentEvent;
2190
- type EventTypes_d_SetContentEvent = SetContentEvent;
2191
- type EventTypes_d_NewBlockEvent = NewBlockEvent;
2192
- type EventTypes_d_NodeChangeEvent = NodeChangeEvent;
2193
- type EventTypes_d_FormatEvent = FormatEvent;
2194
- type EventTypes_d_ObjectResizeEvent = ObjectResizeEvent;
2195
- type EventTypes_d_ObjectSelectedEvent = ObjectSelectedEvent;
2196
- type EventTypes_d_ScrollIntoViewEvent = ScrollIntoViewEvent;
2197
- type EventTypes_d_SetSelectionRangeEvent = SetSelectionRangeEvent;
2198
- type EventTypes_d_ShowCaretEvent = ShowCaretEvent;
2199
- type EventTypes_d_SwitchModeEvent = SwitchModeEvent;
2200
- type EventTypes_d_AddUndoEvent = AddUndoEvent;
2201
- type EventTypes_d_UndoRedoEvent = UndoRedoEvent;
2202
- type EventTypes_d_WindowEvent<_0> = WindowEvent<_0>;
2203
- type EventTypes_d_ProgressStateEvent = ProgressStateEvent;
2204
- type EventTypes_d_AfterProgressStateEvent = AfterProgressStateEvent;
2205
- type EventTypes_d_PlaceholderToggleEvent = PlaceholderToggleEvent;
2206
- type EventTypes_d_LoadErrorEvent = LoadErrorEvent;
2207
- type EventTypes_d_PreProcessEvent = PreProcessEvent;
2208
- type EventTypes_d_PostProcessEvent = PostProcessEvent;
2209
- type EventTypes_d_EditorEventMap = EditorEventMap;
2210
- type EventTypes_d_EditorManagerEventMap = EditorManagerEventMap;
2211
- declare namespace EventTypes_d {
2212
- export { EventTypes_d_ExecCommandEvent as ExecCommandEvent, EventTypes_d_GetContentEvent as GetContentEvent, EventTypes_d_SetContentEvent as SetContentEvent, EventTypes_d_NewBlockEvent as NewBlockEvent, EventTypes_d_NodeChangeEvent as NodeChangeEvent, EventTypes_d_FormatEvent as FormatEvent, EventTypes_d_ObjectResizeEvent as ObjectResizeEvent, EventTypes_d_ObjectSelectedEvent as ObjectSelectedEvent, EventTypes_d_ScrollIntoViewEvent as ScrollIntoViewEvent, EventTypes_d_SetSelectionRangeEvent as SetSelectionRangeEvent, EventTypes_d_ShowCaretEvent as ShowCaretEvent, EventTypes_d_SwitchModeEvent as SwitchModeEvent, EventTypes_d_AddUndoEvent as AddUndoEvent, EventTypes_d_UndoRedoEvent as UndoRedoEvent, EventTypes_d_WindowEvent as WindowEvent, EventTypes_d_ProgressStateEvent as ProgressStateEvent, EventTypes_d_AfterProgressStateEvent as AfterProgressStateEvent, EventTypes_d_PlaceholderToggleEvent as PlaceholderToggleEvent, EventTypes_d_LoadErrorEvent as LoadErrorEvent, EventTypes_d_PreProcessEvent as PreProcessEvent, EventTypes_d_PostProcessEvent as PostProcessEvent, EventTypes_d_EditorEventMap as EditorEventMap, EventTypes_d_EditorManagerEventMap as EditorManagerEventMap, };
2125
+ interface ExecCommandArgs {
2126
+ skip_focus?: boolean;
2127
+ }
2128
+ interface EditorCommandsConstructor {
2129
+ readonly prototype: EditorCommands;
2130
+ new (editor: Editor): EditorCommands;
2131
+ }
2132
+ declare class EditorCommands {
2133
+ private readonly editor;
2134
+ private commands;
2135
+ constructor(editor: Editor);
2136
+ execCommand(command: string, ui?: boolean, value?: any, args?: ExecCommandArgs): boolean;
2137
+ queryCommandState(command: string): boolean;
2138
+ queryCommandValue(command: string): string;
2139
+ addCommands<K extends keyof Commands>(commandList: Commands[K], type: K): void;
2140
+ addCommands(commandList: Record<string, EditorCommandsCallback>): void;
2141
+ addCommand(command: string, callback: EditorCommandCallback, scope?: any): void;
2142
+ queryCommandSupported(command: string): boolean;
2143
+ addQueryStateHandler(command: string, callback: () => boolean, scope?: any): void;
2144
+ addQueryValueHandler(command: string, callback: () => string, scope?: any): void;
2213
2145
  }
2214
2146
  interface RawString {
2215
2147
  raw: string;
@@ -2232,6 +2164,7 @@ interface I18n {
2232
2164
  }
2233
2165
  interface Observable<T> {
2234
2166
  fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U, bubble?: boolean): EditorEvent<U>;
2167
+ dispatch<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U, bubble?: boolean): EditorEvent<U>;
2235
2168
  on<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): EventDispatcher<T>;
2236
2169
  off<K extends string>(name?: K, callback?: (event: EditorEvent<MappedEvent<T, K>>) => void): EventDispatcher<T>;
2237
2170
  once<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void): EventDispatcher<T>;
@@ -2296,15 +2229,12 @@ declare class URI {
2296
2229
  getURI(noProtoHost?: boolean): string;
2297
2230
  }
2298
2231
  interface EditorManager extends Observable<EditorManagerEventMap> {
2299
- $: DomQueryConstructor;
2300
- defaultSettings: RawEditorSettings;
2232
+ defaultOptions: RawEditorOptions;
2301
2233
  majorVersion: string;
2302
2234
  minorVersion: string;
2303
2235
  releaseDate: string;
2304
- editors: Editor[];
2305
2236
  activeEditor: Editor;
2306
2237
  focusedEditor: Editor;
2307
- settings: RawEditorSettings;
2308
2238
  baseURI: URI;
2309
2239
  baseURL: string;
2310
2240
  documentBaseURL: string;
@@ -2312,12 +2242,12 @@ interface EditorManager extends Observable<EditorManagerEventMap> {
2312
2242
  suffix: string;
2313
2243
  add(this: EditorManager, editor: Editor): Editor;
2314
2244
  addI18n: (code: string, item: Record<string, string>) => void;
2315
- createEditor(this: EditorManager, id: string, settings: RawEditorSettings): Editor;
2245
+ createEditor(this: EditorManager, id: string, options: RawEditorOptions): Editor;
2316
2246
  execCommand(this: EditorManager, cmd: string, ui: boolean, value: any): boolean;
2317
2247
  get(this: EditorManager): Editor[];
2318
2248
  get(this: EditorManager, id: number | string): Editor;
2319
- init(this: EditorManager, settings: RawEditorSettings): Promise<Editor[]>;
2320
- overrideDefaults(this: EditorManager, defaultSettings: Partial<RawEditorSettings>): void;
2249
+ init(this: EditorManager, options: RawEditorOptions): Promise<Editor[]>;
2250
+ overrideDefaults(this: EditorManager, defaultOptions: Partial<RawEditorOptions>): void;
2321
2251
  remove(this: EditorManager): void;
2322
2252
  remove(this: EditorManager, selector: string | Editor): Editor | void;
2323
2253
  setActive(this: EditorManager, editor: Editor): void;
@@ -2331,18 +2261,73 @@ interface EditorObservable extends Observable<EditorEventMap> {
2331
2261
  toggleNativeEvent(this: Editor, name: string, state: boolean): any;
2332
2262
  unbindAllNativeEvents(this: Editor): void;
2333
2263
  }
2264
+ interface ProcessorSuccess<T> {
2265
+ valid: true;
2266
+ value: T;
2267
+ }
2268
+ interface ProcessorError {
2269
+ valid: false;
2270
+ message: string;
2271
+ }
2272
+ declare type SimpleProcessor = (value: unknown) => boolean;
2273
+ declare type Processor<T> = (value: unknown) => ProcessorSuccess<T> | ProcessorError;
2274
+ interface BuiltInOptionTypeMap {
2275
+ 'string': string;
2276
+ 'number': number;
2277
+ 'boolean': boolean;
2278
+ 'array': any[];
2279
+ 'function': Function;
2280
+ 'object': any;
2281
+ 'string[]': string[];
2282
+ 'object[]': any[];
2283
+ 'regexp': RegExp;
2284
+ }
2285
+ declare type BuiltInOptionType = keyof BuiltInOptionTypeMap;
2286
+ interface BaseOptionSpec {
2287
+ immutable?: boolean;
2288
+ deprecated?: boolean;
2289
+ docsUrl?: string;
2290
+ }
2291
+ interface BuiltInOptionSpec<K extends BuiltInOptionType> extends BaseOptionSpec {
2292
+ processor: K;
2293
+ default?: BuiltInOptionTypeMap[K];
2294
+ }
2295
+ interface SimpleOptionSpec<T> extends BaseOptionSpec {
2296
+ processor: SimpleProcessor;
2297
+ default?: T;
2298
+ }
2299
+ interface OptionSpec<T, U> extends BaseOptionSpec {
2300
+ processor: Processor<U>;
2301
+ default?: T;
2302
+ }
2303
+ interface Options {
2304
+ register: {
2305
+ <K extends BuiltInOptionType>(name: string, spec: BuiltInOptionSpec<K>): void;
2306
+ <K extends keyof NormalizedEditorOptions>(name: K, spec: OptionSpec<NormalizedEditorOptions[K], EditorOptions[K]> | SimpleOptionSpec<NormalizedEditorOptions[K]>): void;
2307
+ <T, U>(name: string, spec: OptionSpec<T, U>): void;
2308
+ <T>(name: string, spec: SimpleOptionSpec<T>): void;
2309
+ };
2310
+ isRegistered: (name: string) => boolean;
2311
+ get: {
2312
+ <K extends keyof EditorOptions>(name: K): EditorOptions[K] | undefined;
2313
+ <T>(name: string): T | undefined;
2314
+ };
2315
+ set: <K extends string, T>(name: K, value: K extends keyof NormalizedEditorOptions ? NormalizedEditorOptions[K] : T) => boolean;
2316
+ unset: (name: string) => boolean;
2317
+ isSet: (name: string) => boolean;
2318
+ }
2334
2319
  interface UploadResult$1 {
2335
2320
  element: HTMLImageElement;
2336
2321
  status: boolean;
2337
2322
  blobInfo: BlobInfo;
2338
2323
  uploadUri: string;
2324
+ removed: boolean;
2339
2325
  }
2340
- declare type UploadCallback = (results: UploadResult$1[]) => void;
2341
2326
  interface EditorUpload {
2342
2327
  blobCache: BlobCache;
2343
2328
  addFilter: (filter: (img: HTMLImageElement) => boolean) => void;
2344
- uploadImages: (callback?: UploadCallback) => Promise<UploadResult$1[]>;
2345
- uploadImagesAuto: (callback?: UploadCallback) => void | Promise<UploadResult$1[]>;
2329
+ uploadImages: () => Promise<UploadResult$1[]>;
2330
+ uploadImagesAuto: () => Promise<UploadResult$1[]>;
2346
2331
  scanForImages: () => Promise<BlobInfoImagePair[]>;
2347
2332
  destroy: () => void;
2348
2333
  }
@@ -2385,14 +2370,22 @@ interface EditorModeApi {
2385
2370
  deactivate: () => void;
2386
2371
  editorReadOnly: boolean;
2387
2372
  }
2373
+ interface Model {
2374
+ readonly table: {
2375
+ readonly getSelectedCells: () => HTMLTableCellElement[];
2376
+ readonly clearSelectedCells: (container: Node) => void;
2377
+ };
2378
+ }
2379
+ declare type ModelManager = AddOnManager<Model>;
2388
2380
  interface Plugin {
2389
2381
  getMetadata?: () => {
2390
2382
  name: string;
2391
2383
  url: string;
2392
2384
  };
2385
+ init?: (editor: Editor, url: string) => void;
2393
2386
  [key: string]: any;
2394
2387
  }
2395
- declare type PluginManager = AddOnManager<Plugin>;
2388
+ declare type PluginManager = AddOnManager<void | Plugin>;
2396
2389
  interface ShortcutsConstructor {
2397
2390
  readonly prototype: Shortcuts;
2398
2391
  new (editor: Editor): Shortcuts;
@@ -2421,7 +2414,7 @@ interface Theme {
2421
2414
  inline?: any;
2422
2415
  execCommand?: (command: string, ui?: boolean, value?: any) => boolean;
2423
2416
  destroy?: () => void;
2424
- init?: (editor: Editor, url: string, $: DomQueryConstructor) => void;
2417
+ init?: (editor: Editor, url: string) => void;
2425
2418
  renderUI?: () => {
2426
2419
  iframeContainer?: HTMLIFrameElement;
2427
2420
  editorContainer: HTMLElement;
@@ -2430,15 +2423,14 @@ interface Theme {
2430
2423
  getNotificationManagerImpl?: () => NotificationManagerImpl;
2431
2424
  getWindowManagerImpl?: () => WindowManagerImpl;
2432
2425
  }
2433
- declare type ThemeManager = AddOnManager<Theme>;
2426
+ declare type ThemeManager = AddOnManager<void | Theme>;
2434
2427
  interface EditorConstructor {
2435
2428
  readonly prototype: Editor;
2436
- new (id: string, settings: RawEditorSettings, editorManager: EditorManager): Editor;
2429
+ new (id: string, options: RawEditorOptions, editorManager: EditorManager): Editor;
2437
2430
  }
2438
2431
  declare class Editor implements EditorObservable {
2439
2432
  documentBaseUrl: string;
2440
2433
  baseUri: URI;
2441
- settings: EditorSettings;
2442
2434
  id: string;
2443
2435
  plugins: Record<string, Plugin>;
2444
2436
  documentBaseURI: URI;
@@ -2447,8 +2439,7 @@ declare class Editor implements EditorObservable {
2447
2439
  contentStyles: string[];
2448
2440
  ui: EditorUi;
2449
2441
  mode: EditorMode;
2450
- setMode: (mode: string) => void;
2451
- $: DomQueryConstructor;
2442
+ options: Options;
2452
2443
  shortcuts: Shortcuts;
2453
2444
  loadedCSS: Record<string, any>;
2454
2445
  editorCommands: EditorCommands;
@@ -2456,9 +2447,6 @@ declare class Editor implements EditorObservable {
2456
2447
  editorManager: EditorManager;
2457
2448
  inline: boolean;
2458
2449
  isNotDirty: boolean;
2459
- callbackLookup: any;
2460
- _nodeChangeDispatcher: NodeChange;
2461
- editorUpload: EditorUpload;
2462
2450
  annotator: Annotator;
2463
2451
  bodyElement: HTMLElement;
2464
2452
  bookmark: any;
@@ -2471,6 +2459,7 @@ declare class Editor implements EditorObservable {
2471
2459
  destroyed: boolean;
2472
2460
  dom: DOMUtils;
2473
2461
  editorContainer: HTMLElement;
2462
+ editorUpload: EditorUpload;
2474
2463
  eventRoot?: Element;
2475
2464
  formatter: Formatter;
2476
2465
  formElement: HTMLElement;
@@ -2494,12 +2483,12 @@ declare class Editor implements EditorObservable {
2494
2483
  startContent: string;
2495
2484
  targetElm: HTMLElement;
2496
2485
  theme: Theme;
2486
+ model: Model;
2497
2487
  undoManager: UndoManager;
2498
- validate: boolean;
2499
2488
  windowManager: WindowManager;
2500
2489
  _beforeUnload: () => void;
2501
2490
  _eventDispatcher: EventDispatcher<NativeEventMap>;
2502
- _mceOldSubmit: any;
2491
+ _nodeChangeDispatcher: NodeChange;
2503
2492
  _pendingNativeEvents: string[];
2504
2493
  _selectionOverrides: SelectionOverrides;
2505
2494
  _skinLoaded: boolean;
@@ -2507,19 +2496,19 @@ declare class Editor implements EditorObservable {
2507
2496
  toggleNativeEvent: EditorObservable['toggleNativeEvent'];
2508
2497
  unbindAllNativeEvents: EditorObservable['unbindAllNativeEvents'];
2509
2498
  fire: EditorObservable['fire'];
2499
+ dispatch: EditorObservable['dispatch'];
2510
2500
  on: EditorObservable['on'];
2511
2501
  off: EditorObservable['off'];
2512
2502
  once: EditorObservable['once'];
2513
2503
  hasEventListeners: EditorObservable['hasEventListeners'];
2514
- constructor(id: string, settings: RawEditorSettings, editorManager: EditorManager);
2504
+ constructor(id: string, options: RawEditorOptions, editorManager: EditorManager);
2515
2505
  render(): void;
2516
2506
  focus(skipFocus?: boolean): void;
2517
2507
  hasFocus(): boolean;
2518
- execCallback(name: string, ...x: any[]): any;
2519
2508
  translate(text: Untranslated): TranslatedString;
2520
- getParam<K extends keyof ParamTypeMap>(name: string, defaultVal: ParamTypeMap[K], type: K): ParamTypeMap[K];
2521
- getParam<K extends keyof EditorSettings>(name: K, defaultVal?: EditorSettings[K], type?: string): EditorSettings[K];
2522
- getParam<T>(name: string, defaultVal: T, type?: string): T;
2509
+ getParam<K extends BuiltInOptionType>(name: string, defaultVal: BuiltInOptionTypeMap[K], type: K): BuiltInOptionTypeMap[K];
2510
+ getParam<K extends keyof NormalizedEditorOptions>(name: K, defaultVal?: NormalizedEditorOptions[K], type?: BuiltInOptionType): NormalizedEditorOptions[K];
2511
+ getParam<T>(name: string, defaultVal: T, type?: BuiltInOptionType): T;
2523
2512
  hasPlugin(name: string, loaded?: boolean): boolean;
2524
2513
  nodeChanged(args?: any): void;
2525
2514
  addCommand(name: string, callback: EditorCommandCallback, scope?: object): void;
@@ -2530,7 +2519,7 @@ declare class Editor implements EditorObservable {
2530
2519
  boolean,
2531
2520
  any
2532
2521
  ] | (() => void), scope?: any): void;
2533
- execCommand(cmd: string, ui?: boolean, value?: any, args?: any): boolean;
2522
+ execCommand(cmd: string, ui?: boolean, value?: any, args?: ExecCommandArgs): boolean;
2534
2523
  queryCommandState(cmd: string): boolean;
2535
2524
  queryCommandValue(cmd: string): string;
2536
2525
  queryCommandSupported(cmd: string): boolean;
@@ -2540,13 +2529,13 @@ declare class Editor implements EditorObservable {
2540
2529
  setProgressState(state: boolean, time?: number): void;
2541
2530
  load(args?: any): string;
2542
2531
  save(args?: any): string;
2543
- setContent(content: string, args?: SetContentArgs): string;
2544
- setContent(content: AstNode, args?: SetContentArgs): AstNode;
2545
- setContent(content: Content, args?: SetContentArgs): Content;
2532
+ setContent(content: string, args?: Partial<SetContentArgs>): string;
2533
+ setContent(content: AstNode, args?: Partial<SetContentArgs>): AstNode;
2534
+ setContent(content: Content, args?: Partial<SetContentArgs>): Content;
2546
2535
  getContent(args: {
2547
2536
  format: 'tree';
2548
- } & GetContentArgs): AstNode;
2549
- getContent(args?: GetContentArgs): string;
2537
+ } & Partial<GetContentArgs>): AstNode;
2538
+ getContent(args?: Partial<GetContentArgs>): string;
2550
2539
  insertContent(content: string, args?: any): void;
2551
2540
  resetContent(initialContent?: string): void;
2552
2541
  isDirty(): boolean;
@@ -2561,12 +2550,8 @@ declare class Editor implements EditorObservable {
2561
2550
  addVisual(elm?: HTMLElement): void;
2562
2551
  remove(): void;
2563
2552
  destroy(automatic?: boolean): void;
2564
- uploadImages(callback?: UploadCallback): Promise<UploadResult$1[]>;
2553
+ uploadImages(): Promise<UploadResult$1[]>;
2565
2554
  _scanForImages(): Promise<BlobInfoImagePair[]>;
2566
- addButton(): void;
2567
- addSidebar(): void;
2568
- addMenuItem(): void;
2569
- addContextToolbar(): void;
2570
2555
  }
2571
2556
  interface UrlObject {
2572
2557
  prefix: string;
@@ -2574,29 +2559,20 @@ interface UrlObject {
2574
2559
  suffix: string;
2575
2560
  }
2576
2561
  declare type WaitState = 'added' | 'loaded';
2577
- declare type AddOnCallback<T> = (editor: Editor, url: string, $?: DomQueryConstructor) => void | T;
2578
- declare type AddOnConstructor<T> = new (editor: Editor, url: string, $?: DomQueryConstructor) => T;
2562
+ declare type AddOnConstructor<T> = (editor: Editor, url: string) => T;
2579
2563
  interface AddOnManager<T> {
2580
2564
  items: AddOnConstructor<T>[];
2581
2565
  urls: Record<string, string>;
2582
2566
  lookup: Record<string, {
2583
2567
  instance: AddOnConstructor<T>;
2584
- dependencies?: string[];
2585
2568
  }>;
2586
- _listeners: {
2587
- name: string;
2588
- state: WaitState;
2589
- callback: () => void;
2590
- }[];
2591
2569
  get: (name: string) => AddOnConstructor<T>;
2592
- dependencies: (name: string) => string[];
2593
2570
  requireLangPack: (name: string, languages: string) => void;
2594
- add: (id: string, addOn: AddOnCallback<T>, dependencies?: string[]) => AddOnConstructor<T>;
2571
+ add: (id: string, addOn: AddOnConstructor<T>) => AddOnConstructor<T>;
2595
2572
  remove: (name: string) => void;
2596
2573
  createUrl: (baseUrl: UrlObject, dep: string | UrlObject) => UrlObject;
2597
- addComponents: (pluginName: string, scripts: string[]) => void;
2598
- load: (name: string, addOnUrl: string | UrlObject, success?: () => void, scope?: any, failure?: () => void) => void;
2599
- waitFor: (name: string, callback: () => void, state?: WaitState) => void;
2574
+ load: (name: string, addOnUrl: string | UrlObject) => Promise<void>;
2575
+ waitFor: (name: string, state?: WaitState) => Promise<void>;
2600
2576
  }
2601
2577
  interface RangeUtils {
2602
2578
  walk: (rng: Range, callback: (nodes: Node[]) => void) => void;
@@ -2621,14 +2597,14 @@ declare class ScriptLoader {
2621
2597
  private loading;
2622
2598
  constructor(settings?: ScriptLoaderSettings);
2623
2599
  _setReferrerPolicy(referrerPolicy: ReferrerPolicy): void;
2624
- loadScript(url: string, success?: () => void, failure?: () => void): void;
2600
+ loadScript(url: string): Promise<void>;
2625
2601
  isDone(url: string): boolean;
2626
2602
  markDone(url: string): void;
2627
- add(url: string, success?: () => void, scope?: any, failure?: () => void): void;
2628
- load(url: string, success?: () => void, scope?: any, failure?: () => void): void;
2603
+ add(url: string): Promise<void>;
2604
+ load(url: string): Promise<void>;
2629
2605
  remove(url: string): void;
2630
- loadQueue(success?: () => void, scope?: any, failure?: (urls: string[]) => void): void;
2631
- loadScripts(scripts: string[], success?: () => void, scope?: any, failure?: (urls: string[]) => void): void;
2606
+ loadQueue(): Promise<void>;
2607
+ loadScripts(scripts: string[]): Promise<void>;
2632
2608
  }
2633
2609
  declare type TextProcessCallback = (node: Text, offset: number, text: string) => number;
2634
2610
  interface Spot {
@@ -2659,31 +2635,17 @@ interface Version {
2659
2635
  minor: number;
2660
2636
  }
2661
2637
  interface Env {
2662
- opera: boolean;
2663
- webkit: boolean;
2664
- ie: false | number;
2665
- gecko: boolean;
2666
- mac: boolean;
2667
- iOS: boolean;
2668
- android: boolean;
2669
- contentEditable: boolean;
2670
2638
  transparentSrc: string;
2671
- caretAfter: boolean;
2672
- range: boolean;
2673
2639
  documentMode: number;
2674
- fileApi: boolean;
2675
- ceFalse: boolean;
2676
2640
  cacheSuffix: any;
2677
2641
  container: any;
2678
- experimentalShadowDom: boolean;
2679
2642
  canHaveCSP: boolean;
2680
- desktop: boolean;
2681
2643
  windowsPhone: boolean;
2682
2644
  browser: {
2683
2645
  current: string | undefined;
2684
2646
  version: Version;
2685
2647
  isEdge: () => boolean;
2686
- isChrome: () => boolean;
2648
+ isChromium: () => boolean;
2687
2649
  isIE: () => boolean;
2688
2650
  isOpera: () => boolean;
2689
2651
  isFirefox: () => boolean;
@@ -2695,7 +2657,7 @@ interface Env {
2695
2657
  isWindows: () => boolean;
2696
2658
  isiOS: () => boolean;
2697
2659
  isAndroid: () => boolean;
2698
- isOSX: () => boolean;
2660
+ isMacOS: () => boolean;
2699
2661
  isLinux: () => boolean;
2700
2662
  isSolaris: () => boolean;
2701
2663
  isFreeBSD: () => boolean;
@@ -2711,6 +2673,17 @@ interface Env {
2711
2673
  isDesktop: () => boolean;
2712
2674
  };
2713
2675
  }
2676
+ interface FakeClipboardItem {
2677
+ readonly items: Record<string, any>;
2678
+ readonly types: ReadonlyArray<string>;
2679
+ readonly getType: <D = any>(type: string) => D | undefined;
2680
+ }
2681
+ interface FakeClipboard {
2682
+ readonly FakeClipboardItem: (items: Record<string, any>) => FakeClipboardItem;
2683
+ readonly write: (data: FakeClipboardItem[]) => void;
2684
+ readonly read: () => FakeClipboardItem[] | undefined;
2685
+ readonly clear: () => void;
2686
+ }
2714
2687
  interface FocusManager {
2715
2688
  isEditorUIElement: (elm: Element) => boolean;
2716
2689
  }
@@ -2725,35 +2698,6 @@ interface Entities {
2725
2698
  getEncodeFunc: (name: string, entities?: EntitiesMap | string) => (text: string, attr?: boolean) => string;
2726
2699
  decode: (text: string) => string;
2727
2700
  }
2728
- declare type AttrList = Array<{
2729
- name: string;
2730
- value: string;
2731
- }> & {
2732
- map: Record<string, string>;
2733
- };
2734
- interface SaxParserSettings {
2735
- allow_conditional_comments?: boolean;
2736
- allow_html_data_urls?: boolean;
2737
- allow_script_urls?: boolean;
2738
- allow_svg_data_urls?: boolean;
2739
- fix_self_closing?: boolean;
2740
- preserve_cdata?: boolean;
2741
- remove_internals?: boolean;
2742
- self_closing_elements?: Record<string, {}>;
2743
- validate?: boolean;
2744
- document?: Document;
2745
- cdata?: (text: string) => void;
2746
- comment?: (text: string) => void;
2747
- doctype?: (text: string) => void;
2748
- end?: (name: string) => void;
2749
- pi?: (name: string, text: string) => void;
2750
- start?: (name: string, attrs: AttrList, empty: boolean) => void;
2751
- text?: (text: string, raw?: boolean) => void;
2752
- }
2753
- declare type ParserFormat = 'html' | 'xhtml' | 'xml';
2754
- interface SaxParser {
2755
- parse: (html: string, format?: ParserFormat) => void;
2756
- }
2757
2701
  interface IconPack {
2758
2702
  icons: Record<string, string>;
2759
2703
  }
@@ -2765,104 +2709,45 @@ interface IconManager {
2765
2709
  interface Resource {
2766
2710
  load: <T = any>(id: string, url: string) => Promise<T>;
2767
2711
  add: (id: string, data: any) => void;
2768
- }
2769
- declare type WithSubItems<T, K extends keyof T> = T[K] extends Array<any> ? (T & T[K][number]) : T;
2770
- interface Props<A extends any[] = any[]> {
2771
- Mixins?: Array<Record<string, any>>;
2772
- Methods?: string;
2773
- Properties?: string;
2774
- Statics?: Record<string, any>;
2775
- Defaults?: Record<string, any>;
2776
- init?: (...args: A) => void;
2777
- }
2778
- declare type ExtendedClass<T extends Props<A>, A extends any[]> = WithSubItems<T, 'Mixins'>;
2779
- interface ExtendedClassConstructor<T extends Props<A>, A extends any[] = any[]> extends Class {
2780
- readonly prototype: ExtendedClass<T, A>;
2781
- new (...args: A): ExtendedClass<T, A>;
2782
- [key: string]: T['Statics'];
2783
- }
2784
- interface Class {
2785
- extend<T extends Props<A>, A extends any[] = any[]>(props: T): ExtendedClassConstructor<T, A>;
2786
- }
2787
- interface RGB {
2788
- r: number;
2789
- g: number;
2790
- b: number;
2791
- }
2792
- interface HSV {
2793
- h: number;
2794
- s: number;
2795
- v: number;
2796
- }
2797
- declare type ColorConstructor = new (value?: string | RGB | HSV) => Color;
2798
- interface Color {
2799
- toRgb: () => RGB;
2800
- toHsv: () => HSV;
2801
- toHex: () => string;
2802
- parse: (value: string | RGB | HSV) => Color;
2803
- }
2804
- interface DebounceFunc<T extends (...args: any[]) => void> {
2805
- (...args: Parameters<T>): void;
2806
- stop: () => void;
2712
+ unload: (id: string) => void;
2807
2713
  }
2808
2714
  interface Delay {
2809
- requestAnimationFrame: (callback: () => void, element?: HTMLElement) => void;
2810
2715
  setEditorInterval: (editor: Editor, callback: () => void, time?: number) => number;
2811
2716
  setEditorTimeout: (editor: Editor, callback: () => void, time?: number) => number;
2812
- setInterval: (callback: () => void, time?: number) => number;
2813
- setTimeout: (callback: () => void, time?: number) => number;
2814
- clearInterval: (id?: number) => void;
2815
- clearTimeout: (id?: number) => void;
2816
- debounce: <T extends (...args: any[]) => any>(callback: T, time?: number) => DebounceFunc<T>;
2817
- throttle: <T extends (...args: any[]) => any>(callback: T, time?: number) => DebounceFunc<T>;
2818
2717
  }
2819
2718
  declare type UploadResult = UploadResult$2;
2820
2719
  interface ImageUploader {
2821
2720
  upload: (blobInfos: BlobInfo[], showNotification?: boolean) => Promise<UploadResult[]>;
2822
2721
  }
2823
- interface JSONUtils {
2824
- serialize: (obj: any) => string;
2825
- parse: (text: string) => any;
2826
- }
2827
- interface JSONPSettings {
2828
- count?: number;
2829
- url: string;
2830
- callback: (json: string) => void;
2831
- }
2832
- interface JSONP {
2833
- callbacks: {};
2834
- count: number;
2835
- send(this: JSONP, settings: JSONPSettings): void;
2836
- }
2837
- interface JSONRequestSettings {
2838
- crossDomain?: boolean;
2839
- requestheaders?: Record<string, {
2840
- key: string;
2841
- value: string;
2842
- }>;
2843
- type?: string;
2844
- url?: string;
2845
- error_scope?: any;
2846
- success_scope?: any;
2847
- success?: (data: any) => void;
2848
- error?: (error: any, xhr: XMLHttpRequest) => void;
2849
- }
2850
- interface JSONRequestArgs extends JSONRequestSettings {
2851
- id?: string;
2852
- method?: string;
2853
- params?: string;
2854
- }
2855
- interface JSONRequestConstructor {
2856
- readonly prototype: JSONRequest;
2857
- new (settings?: JSONRequestSettings): JSONRequest;
2858
- sendRPC: (o: JSONRequestArgs) => void;
2859
- }
2860
- declare class JSONRequest {
2861
- static sendRPC(o: JSONRequestArgs): void;
2862
- settings: JSONRequestSettings;
2863
- count: number;
2864
- constructor(settings?: JSONRequestSettings);
2865
- send(args: JSONRequestArgs): void;
2722
+ declare type ArrayCallback$1<T, R> = (x: T, i: number, xs: ReadonlyArray<T>) => R;
2723
+ declare type ObjCallback$1<T, R> = (value: T, key: string, obj: Record<string, T>) => R;
2724
+ declare type ArrayCallback<T, R> = ArrayCallback$1<T, R>;
2725
+ declare type ObjCallback<T, R> = ObjCallback$1<T, R>;
2726
+ interface Tools {
2727
+ is: (obj: any, type: string) => boolean;
2728
+ isArray: <T>(arr: any) => arr is Array<T>;
2729
+ inArray: <T>(arr: ArrayLike<T>, value: T) => number;
2730
+ grep: {
2731
+ <T>(arr: ArrayLike<T> | null | undefined, pred?: ArrayCallback<T, boolean>): T[];
2732
+ <T>(arr: Record<string, T> | null | undefined, pred?: ObjCallback<T, boolean>): T[];
2733
+ };
2734
+ trim: (str: string | null | undefined) => string;
2735
+ toArray: <T>(obj: ArrayLike<T>) => T[];
2736
+ hasOwn: (obj: any, name: string) => boolean;
2737
+ makeMap: <T>(items: ArrayLike<T> | string, delim?: string | RegExp, map?: Record<string, T | string>) => Record<string, T | string>;
2738
+ each: {
2739
+ <T>(arr: ArrayLike<T> | null | undefined, cb: ArrayCallback<T, void | boolean>, scope?: any): boolean;
2740
+ <T>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, void | boolean>, scope?: any): boolean;
2741
+ };
2742
+ map: {
2743
+ <T, R>(arr: ArrayLike<T> | null | undefined, cb: ArrayCallback<T, R>): R[];
2744
+ <T, R>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, R>): R[];
2745
+ };
2746
+ extend: (obj: Object, ext: Object, ...objs: Object[]) => any;
2747
+ walk: <T = any>(obj: T, f: Function, n?: keyof T, scope?: any) => void;
2748
+ resolve: (path: string, o?: Object) => any;
2749
+ explode: (s: string, d?: string | RegExp) => string[];
2750
+ _addCacheSuffix: (url: string) => string;
2866
2751
  }
2867
2752
  interface KeyboardLikeEvent {
2868
2753
  shiftKey: boolean;
@@ -2888,130 +2773,90 @@ interface VK {
2888
2773
  modifierPressed: (e: KeyboardLikeEvent) => boolean;
2889
2774
  metaKeyPressed: (e: KeyboardLikeEvent) => boolean;
2890
2775
  }
2891
- interface XHRSettings {
2892
- async?: boolean;
2893
- content_type?: string;
2894
- crossDomain?: boolean;
2895
- data?: Document | BodyInit;
2896
- requestheaders?: Record<string, {
2897
- key: string;
2898
- value: string;
2899
- }>;
2900
- scope?: any;
2901
- type?: string;
2902
- url: string;
2903
- error_scope?: any;
2904
- success_scope?: any;
2905
- error?: (message: 'TIMED_OUT' | 'GENERAL', xhr: XMLHttpRequest, settings: XHRSettings) => void;
2906
- success?: (text: string, xhr: XMLHttpRequest, settings: XHRSettings) => void;
2907
- }
2908
- interface XHREventMap {
2909
- beforeInitialize: {
2910
- settings: XHRSettings;
2911
- };
2912
- beforeSend: {
2913
- xhr: XMLHttpRequest;
2914
- settings: XHRSettings;
2915
- };
2916
- }
2917
- interface XHR extends Observable<XHREventMap> {
2918
- send(this: XHR, settings: XHRSettings): void;
2919
- }
2920
2776
  interface DOMUtilsNamespace {
2921
- new (doc: Document, settings: Partial<DOMUtilsSettings>): DOMUtils;
2777
+ (doc: Document, settings: Partial<DOMUtilsSettings>): DOMUtils;
2922
2778
  DOM: DOMUtils;
2923
2779
  nodeIndex: (node: Node, normalized?: boolean) => number;
2924
2780
  }
2925
2781
  interface RangeUtilsNamespace {
2926
- new (dom: DOMUtils): RangeUtils;
2782
+ (dom: DOMUtils): RangeUtils;
2927
2783
  compareRanges: (rng1: RangeLikeObject, rng2: RangeLikeObject) => boolean;
2928
2784
  getCaretRangeFromPoint: (clientX: number, clientY: number, doc: Document) => Range;
2929
2785
  getSelectedNode: (range: Range) => Node;
2930
2786
  getNode: (container: Node, offset: number) => Node;
2931
2787
  }
2932
2788
  interface AddOnManagerNamespace {
2933
- new <T>(): AddOnManager<T>;
2789
+ <T>(): AddOnManager<T>;
2934
2790
  language: string | undefined;
2935
2791
  languageLoad: boolean;
2936
2792
  baseURL: string;
2937
2793
  PluginManager: PluginManager;
2938
2794
  ThemeManager: ThemeManager;
2795
+ ModelManager: ModelManager;
2939
2796
  }
2940
2797
  interface BookmarkManagerNamespace {
2941
2798
  (selection: EditorSelection): BookmarkManager;
2942
2799
  isBookmarkNode: (node: Node) => boolean;
2943
2800
  }
2944
- interface SaxParserNamespace {
2945
- new (settings?: SaxParserSettings, schema?: Schema): SaxParser;
2946
- findEndTag: (schema: Schema, html: string, startIndex: number) => number;
2947
- }
2948
2801
  interface TinyMCE extends EditorManager {
2949
2802
  geom: {
2950
2803
  Rect: Rect;
2951
2804
  };
2952
2805
  util: {
2953
- Promise: PromiseConstructor;
2954
2806
  Delay: Delay;
2955
2807
  Tools: Tools;
2956
2808
  VK: VK;
2957
2809
  URI: URIConstructor;
2958
- Class: Class;
2959
2810
  EventDispatcher: EventDispatcherConstructor<any>;
2960
2811
  Observable: Observable<any>;
2961
2812
  I18n: I18n;
2962
- XHR: XHR;
2963
- JSON: JSONUtils;
2964
- JSONRequest: JSONRequestConstructor;
2965
- JSONP: JSONP;
2966
2813
  LocalStorage: Storage;
2967
- Color: ColorConstructor;
2968
2814
  ImageUploader: ImageUploader;
2969
2815
  };
2970
2816
  dom: {
2971
2817
  EventUtils: EventUtilsConstructor;
2972
- Sizzle: any;
2973
- DomQuery: DomQueryConstructor;
2974
2818
  TreeWalker: DomTreeWalkerConstructor;
2975
- TextSeeker: new (dom: DOMUtils, isBlockBoundary?: (node: Node) => boolean) => TextSeeker;
2819
+ TextSeeker: (dom: DOMUtils, isBlockBoundary?: (node: Node) => boolean) => TextSeeker;
2976
2820
  DOMUtils: DOMUtilsNamespace;
2977
2821
  ScriptLoader: ScriptLoaderConstructor;
2978
2822
  RangeUtils: RangeUtilsNamespace;
2979
- Serializer: new (settings: DomSerializerSettings, editor?: Editor) => DomSerializer;
2823
+ Serializer: (settings: DomSerializerSettings, editor?: Editor) => DomSerializer;
2980
2824
  ControlSelection: (selection: EditorSelection, editor: Editor) => ControlSelection;
2981
2825
  BookmarkManager: BookmarkManagerNamespace;
2982
- Selection: new (dom: DOMUtils, win: Window, serializer: DomSerializer, editor: Editor) => EditorSelection;
2983
- StyleSheetLoader: new (documentOrShadowRoot: Document | ShadowRoot, settings: StyleSheetLoaderSettings) => StyleSheetLoader;
2826
+ Selection: (dom: DOMUtils, win: Window, serializer: DomSerializer, editor: Editor) => EditorSelection;
2827
+ StyleSheetLoader: (documentOrShadowRoot: Document | ShadowRoot, settings: StyleSheetLoaderSettings) => StyleSheetLoader;
2984
2828
  Event: EventUtils;
2985
2829
  };
2986
2830
  html: {
2987
- Styles: new (settings?: StylesSettings, schema?: Schema) => Styles;
2831
+ Styles: (settings?: StylesSettings, schema?: Schema) => Styles;
2988
2832
  Entities: Entities;
2989
2833
  Node: AstNodeConstructor;
2990
- Schema: new (settings?: SchemaSettings) => Schema;
2991
- SaxParser: SaxParserNamespace;
2992
- DomParser: new (settings?: DomParserSettings, schema?: Schema) => DomParser;
2993
- Writer: new (settings?: WriterSettings) => Writer;
2994
- Serializer: new (settings?: HtmlSerializerSettings, schema?: Schema) => HtmlSerializer;
2834
+ Schema: (settings?: SchemaSettings) => Schema;
2835
+ DomParser: (settings?: DomParserSettings, schema?: Schema) => DomParser;
2836
+ Writer: (settings?: WriterSettings) => Writer;
2837
+ Serializer: (settings?: HtmlSerializerSettings, schema?: Schema) => HtmlSerializer;
2995
2838
  };
2996
2839
  AddOnManager: AddOnManagerNamespace;
2997
- Annotator: new (editor: Editor) => Annotator;
2840
+ Annotator: (editor: Editor) => Annotator;
2998
2841
  Editor: EditorConstructor;
2999
2842
  EditorCommands: EditorCommandsConstructor;
3000
2843
  EditorManager: EditorManager;
3001
2844
  EditorObservable: EditorObservable;
3002
2845
  Env: Env;
3003
2846
  FocusManager: FocusManager;
3004
- Formatter: new (editor: Editor) => Formatter;
3005
- NotificationManager: new (editor: Editor) => NotificationManager;
2847
+ Formatter: (editor: Editor) => Formatter;
2848
+ NotificationManager: (editor: Editor) => NotificationManager;
3006
2849
  Shortcuts: ShortcutsConstructor;
3007
- UndoManager: new (editor: Editor) => UndoManager;
3008
- WindowManager: new (editor: Editor) => WindowManager;
2850
+ UndoManager: (editor: Editor) => UndoManager;
2851
+ WindowManager: (editor: Editor) => WindowManager;
3009
2852
  DOM: DOMUtils;
3010
2853
  ScriptLoader: ScriptLoader;
3011
2854
  PluginManager: PluginManager;
3012
2855
  ThemeManager: ThemeManager;
2856
+ ModelManager: ModelManager;
3013
2857
  IconManager: IconManager;
3014
2858
  Resource: Resource;
2859
+ FakeClipboard: FakeClipboard;
3015
2860
  trim: Tools['trim'];
3016
2861
  isArray: Tools['isArray'];
3017
2862
  is: Tools['is'];
@@ -3022,18 +2867,10 @@ interface TinyMCE extends EditorManager {
3022
2867
  grep: Tools['grep'];
3023
2868
  inArray: Tools['inArray'];
3024
2869
  extend: Tools['extend'];
3025
- create: Tools['create'];
3026
2870
  walk: Tools['walk'];
3027
- createNS: Tools['createNS'];
3028
2871
  resolve: Tools['resolve'];
3029
2872
  explode: Tools['explode'];
3030
2873
  _addCacheSuffix: Tools['_addCacheSuffix'];
3031
- isOpera: boolean;
3032
- isWebKit: boolean;
3033
- isIE: false | number;
3034
- isGecko: boolean;
3035
- isMac: boolean;
3036
2874
  }
3037
2875
  declare const tinymce: TinyMCE;
3038
- export default tinymce;
3039
- export { AddOnManager, Annotator, AstNode, Bookmark, BookmarkManager, Class, Color, ControlSelection, DOMUtils, Delay, DomParser, DomParserSettings, DomQuery, DomSerializer, DomSerializerSettings, DomTreeWalker, Editor, EditorCommands, EditorEvent, EditorManager, EditorModeApi, EditorObservable, EditorSelection, EditorSettings, Entities, Env, EventDispatcher, EventUtils, EventTypes_d as Events, FocusManager, Format_d as Formats, Formatter, GeomRect, HtmlSerializer, HtmlSerializerSettings, I18n, IconManager, JSONUtils as JSON, JSONP, JSONRequest, JSONRequestArgs, JSONRequestSettings, NotificationApi, NotificationManager, NotificationSpec, Observable, Plugin, PluginManager, RangeUtils, RawEditorSettings, Rect, Resource, SaxParser, SaxParserSettings, Schema, SchemaSettings, ScriptLoader, Shortcuts, StyleSheetLoader, Styles, TextSeeker, Theme, ThemeManager, TinyMCE, Tools, URI, Ui_d as Ui, UndoManager, VK, WindowManager, Writer, WriterSettings, XHR, XHRSettings };
2876
+ export { AddOnManager, Annotator, AstNode, Bookmark, BookmarkManager, ControlSelection, DOMUtils, Delay, DomParser, DomParserSettings, DomSerializer, DomSerializerSettings, DomTreeWalker, Editor, EditorCommands, EditorEvent, EditorManager, EditorModeApi, EditorObservable, EditorOptions, EditorSelection, Entities, Env, EventDispatcher, EventUtils, EventTypes_d as Events, FakeClipboard, FocusManager, Format_d as Formats, Formatter, GeomRect, HtmlSerializer, HtmlSerializerSettings, I18n, IconManager, Model, ModelManager, NotificationApi, NotificationManager, NotificationSpec, Observable, Plugin, PluginManager, RangeUtils, RawEditorOptions, Rect, Resource, Schema, SchemaSettings, ScriptLoader, Shortcuts, StyleSheetLoader, Styles, TextSeeker, Theme, ThemeManager, TinyMCE, Tools, URI, Ui_d as Ui, UndoManager, VK, WindowManager, Writer, WriterSettings, tinymce as default };