tinymce-rails 6.1.0 → 7.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +21 -11
  3. data/app/assets/source/tinymce/tinymce.js +10358 -7311
  4. data/lib/tinymce/rails/asset_installer/copy_no_preserve.rb +1 -1
  5. data/lib/tinymce/rails/asset_installer.rb +4 -4
  6. data/lib/tinymce/rails/asset_manifest/json_manifest.rb +62 -0
  7. data/lib/tinymce/rails/asset_manifest/null_manifest.rb +12 -0
  8. data/lib/tinymce/rails/asset_manifest/propshaft_manifest.rb +43 -0
  9. data/lib/tinymce/rails/asset_manifest/yaml_manifest.rb +43 -0
  10. data/lib/tinymce/rails/asset_manifest.rb +7 -104
  11. data/lib/tinymce/rails/configuration.rb +6 -1
  12. data/lib/tinymce/rails/configuration_file.rb +2 -1
  13. data/lib/tinymce/rails/engine.rb +15 -2
  14. data/lib/tinymce/rails/helper.rb +19 -5
  15. data/lib/tinymce/rails/propshaft/asset.rb +11 -0
  16. data/lib/tinymce/rails/version.rb +2 -2
  17. data/lib/tinymce/rails.rb +2 -2
  18. data/vendor/assets/javascripts/tinymce/icons/default/icons.js +1 -1
  19. data/vendor/assets/javascripts/tinymce/langs/readme.md +3 -0
  20. data/vendor/assets/javascripts/tinymce/license.md +6 -0
  21. data/vendor/assets/javascripts/tinymce/models/dom/model.js +2 -2
  22. data/vendor/assets/javascripts/tinymce/plugins/accordion/plugin.js +4 -0
  23. data/vendor/assets/javascripts/tinymce/plugins/advlist/plugin.js +2 -2
  24. data/vendor/assets/javascripts/tinymce/plugins/anchor/plugin.js +2 -2
  25. data/vendor/assets/javascripts/tinymce/plugins/autolink/plugin.js +2 -2
  26. data/vendor/assets/javascripts/tinymce/plugins/autoresize/plugin.js +2 -2
  27. data/vendor/assets/javascripts/tinymce/plugins/autosave/plugin.js +2 -2
  28. data/vendor/assets/javascripts/tinymce/plugins/charmap/plugin.js +2 -2
  29. data/vendor/assets/javascripts/tinymce/plugins/code/plugin.js +1 -1
  30. data/vendor/assets/javascripts/tinymce/plugins/codesample/plugin.js +2 -2
  31. data/vendor/assets/javascripts/tinymce/plugins/directionality/plugin.js +2 -2
  32. data/vendor/assets/javascripts/tinymce/plugins/emoticons/plugin.js +2 -2
  33. data/vendor/assets/javascripts/tinymce/plugins/fullscreen/plugin.js +2 -2
  34. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ar.js +93 -0
  35. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/bg_BG.js +93 -0
  36. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ca.js +93 -0
  37. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/cs.js +93 -0
  38. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/da.js +93 -0
  39. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/de.js +93 -0
  40. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/el.js +93 -0
  41. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/en.js +93 -0
  42. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/es.js +93 -0
  43. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/eu.js +93 -0
  44. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/fa.js +93 -0
  45. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/fi.js +93 -0
  46. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/fr_FR.js +93 -0
  47. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/he_IL.js +93 -0
  48. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/hi.js +93 -0
  49. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/hr.js +93 -0
  50. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/hu_HU.js +93 -0
  51. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/id.js +93 -0
  52. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/it.js +93 -0
  53. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ja.js +93 -0
  54. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/kk.js +93 -0
  55. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ko_KR.js +93 -0
  56. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ms.js +93 -0
  57. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/nb_NO.js +93 -0
  58. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/nl.js +93 -0
  59. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/pl.js +93 -0
  60. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/pt_BR.js +93 -0
  61. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/pt_PT.js +93 -0
  62. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ro.js +93 -0
  63. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/ru.js +93 -0
  64. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/sk.js +93 -0
  65. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/sl_SI.js +93 -0
  66. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/sv_SE.js +93 -0
  67. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/th_TH.js +93 -0
  68. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/tr.js +93 -0
  69. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/uk.js +93 -0
  70. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/vi.js +93 -0
  71. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/zh_CN.js +87 -0
  72. data/vendor/assets/javascripts/tinymce/plugins/help/js/i18n/keynav/zh_TW.js +93 -0
  73. data/vendor/assets/javascripts/tinymce/plugins/help/plugin.js +2 -2
  74. data/vendor/assets/javascripts/tinymce/plugins/image/plugin.js +2 -2
  75. data/vendor/assets/javascripts/tinymce/plugins/importcss/plugin.js +2 -2
  76. data/vendor/assets/javascripts/tinymce/plugins/insertdatetime/plugin.js +2 -2
  77. data/vendor/assets/javascripts/tinymce/plugins/link/plugin.js +2 -2
  78. data/vendor/assets/javascripts/tinymce/plugins/lists/plugin.js +2 -2
  79. data/vendor/assets/javascripts/tinymce/plugins/media/plugin.js +2 -2
  80. data/vendor/assets/javascripts/tinymce/plugins/nonbreaking/plugin.js +2 -2
  81. data/vendor/assets/javascripts/tinymce/plugins/pagebreak/plugin.js +2 -2
  82. data/vendor/assets/javascripts/tinymce/plugins/preview/plugin.js +2 -2
  83. data/vendor/assets/javascripts/tinymce/plugins/quickbars/plugin.js +2 -2
  84. data/vendor/assets/javascripts/tinymce/plugins/save/plugin.js +2 -2
  85. data/vendor/assets/javascripts/tinymce/plugins/searchreplace/plugin.js +2 -2
  86. data/vendor/assets/javascripts/tinymce/plugins/table/plugin.js +2 -2
  87. data/vendor/assets/javascripts/tinymce/plugins/visualblocks/plugin.js +2 -2
  88. data/vendor/assets/javascripts/tinymce/plugins/visualchars/plugin.js +2 -2
  89. data/vendor/assets/javascripts/tinymce/plugins/wordcount/plugin.js +2 -2
  90. data/vendor/assets/javascripts/tinymce/skins/content/dark/content.js +1 -0
  91. data/vendor/assets/javascripts/tinymce/skins/content/default/content.js +1 -0
  92. data/vendor/assets/javascripts/tinymce/skins/content/document/content.js +1 -0
  93. data/vendor/assets/javascripts/tinymce/skins/content/tinymce-5/content.js +1 -0
  94. data/vendor/assets/javascripts/tinymce/skins/content/tinymce-5-dark/content.js +1 -0
  95. data/vendor/assets/javascripts/tinymce/skins/content/writer/content.js +1 -0
  96. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.css +1 -1
  97. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.css +1 -1
  98. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.js +1 -0
  99. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.min.css +1 -1
  100. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.js +1 -0
  101. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.min.css +1 -1
  102. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.css +1 -1
  103. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.js +1 -0
  104. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +1 -1
  105. data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.shadowdom.js +1 -0
  106. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.css +1 -1
  107. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.css +1 -1
  108. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.js +1 -0
  109. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -1
  110. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.js +1 -0
  111. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.min.css +1 -1
  112. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.css +1 -1
  113. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.js +1 -0
  114. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
  115. data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.shadowdom.js +1 -0
  116. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.css +1 -1
  117. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.inline.css +1 -1
  118. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.inline.js +1 -0
  119. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.inline.min.css +1 -1
  120. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.js +1 -0
  121. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.min.css +1 -1
  122. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.css +1 -1
  123. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.js +1 -0
  124. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.min.css +1 -1
  125. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.shadowdom.js +1 -0
  126. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.css +1 -1
  127. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.inline.css +1 -1
  128. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.inline.js +1 -0
  129. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +1 -1
  130. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.js +1 -0
  131. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.min.css +1 -1
  132. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.css +1 -1
  133. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.js +1 -0
  134. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -1
  135. data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.shadowdom.js +1 -0
  136. data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +384 -2
  137. data/vendor/assets/javascripts/tinymce/tinymce.d.ts +934 -516
  138. data/vendor/assets/javascripts/tinymce/tinymce.js +383 -2
  139. metadata +75 -10
  140. data/LICENSE +0 -19
  141. data/vendor/assets/javascripts/tinymce/langs/README.md +0 -3
  142. data/vendor/assets/javascripts/tinymce/license.txt +0 -21
  143. data/vendor/assets/javascripts/tinymce/plugins/template/plugin.js +0 -4
  144. /data/app/assets/{javascripts → sprockets}/tinymce/preinit.js.erb +0 -0
  145. /data/app/assets/{javascripts → sprockets}/tinymce.js +0 -0
@@ -22,8 +22,8 @@ interface PathBookmark {
22
22
  isFakeCaret?: boolean;
23
23
  forward?: boolean;
24
24
  }
25
- declare type Bookmark = StringPathBookmark | RangeBookmark | IdBookmark | IndexBookmark | PathBookmark;
26
- declare type NormalizedEvent<E, T = any> = E & {
25
+ type Bookmark = StringPathBookmark | RangeBookmark | IdBookmark | IndexBookmark | PathBookmark;
26
+ type NormalizedEvent<E, T = any> = E & {
27
27
  readonly type: string;
28
28
  readonly target: T;
29
29
  readonly isDefaultPrevented: () => boolean;
@@ -33,7 +33,7 @@ declare type NormalizedEvent<E, T = any> = E & {
33
33
  readonly isImmediatePropagationStopped: () => boolean;
34
34
  readonly stopImmediatePropagation: () => void;
35
35
  };
36
- declare type MappedEvent<T, K extends string> = K extends keyof T ? T[K] : any;
36
+ type MappedEvent<T extends {}, K extends string> = K extends keyof T ? T[K] : any;
37
37
  interface NativeEventMap {
38
38
  'beforepaste': Event;
39
39
  'blur': FocusEvent;
@@ -76,61 +76,83 @@ interface NativeEventMap {
76
76
  'touchcancel': TouchEvent;
77
77
  'wheel': WheelEvent;
78
78
  }
79
- declare type EditorEvent<T> = NormalizedEvent<T>;
79
+ type EditorEvent<T> = NormalizedEvent<T>;
80
80
  interface EventDispatcherSettings {
81
81
  scope?: any;
82
82
  toggleEvent?: (name: string, state: boolean) => void | boolean;
83
83
  beforeFire?: <T>(args: EditorEvent<T>) => void;
84
84
  }
85
- interface EventDispatcherConstructor<T extends NativeEventMap> {
85
+ interface EventDispatcherConstructor<T extends {}> {
86
86
  readonly prototype: EventDispatcher<T>;
87
87
  new (settings?: EventDispatcherSettings): EventDispatcher<T>;
88
88
  isNative: (name: string) => boolean;
89
89
  }
90
- declare class EventDispatcher<T> {
90
+ declare class EventDispatcher<T extends {}> {
91
91
  static isNative(name: string): boolean;
92
92
  private readonly settings;
93
93
  private readonly scope;
94
94
  private readonly toggleEvent;
95
95
  private bindings;
96
- constructor(settings?: Record<string, any>);
96
+ constructor(settings?: EventDispatcherSettings);
97
97
  fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>;
98
98
  dispatch<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>;
99
- on<K extends string>(name: K, callback: false | ((event: EditorEvent<MappedEvent<T, K>>) => void), prepend?: boolean, extra?: {}): this;
99
+ on<K extends string>(name: K, callback: false | ((event: EditorEvent<MappedEvent<T, K>>) => void | boolean), prepend?: boolean, extra?: {}): this;
100
100
  off<K extends string>(name?: K, callback?: (event: EditorEvent<MappedEvent<T, K>>) => void): this;
101
101
  once<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): this;
102
102
  has(name: string): boolean;
103
103
  }
104
- declare const enum UndoLevelType {
105
- Fragmented = "fragmented",
106
- Complete = "complete"
107
- }
108
- interface UndoLevel {
104
+ type UndoLevelType = 'fragmented' | 'complete';
105
+ interface BaseUndoLevel {
109
106
  type: UndoLevelType;
107
+ bookmark: Bookmark | null;
108
+ beforeBookmark: Bookmark | null;
109
+ }
110
+ interface FragmentedUndoLevel extends BaseUndoLevel {
111
+ type: 'fragmented';
110
112
  fragments: string[];
113
+ content: '';
114
+ }
115
+ interface CompleteUndoLevel extends BaseUndoLevel {
116
+ type: 'complete';
117
+ fragments: null;
111
118
  content: string;
112
- bookmark: Bookmark;
113
- beforeBookmark: Bookmark;
114
119
  }
120
+ type NewUndoLevel = CompleteUndoLevel | FragmentedUndoLevel;
121
+ type UndoLevel = NewUndoLevel & {
122
+ bookmark: Bookmark;
123
+ };
115
124
  interface UndoManager {
116
125
  data: UndoLevel[];
117
126
  typing: boolean;
118
- add: (level?: UndoLevel, event?: EditorEvent<any>) => UndoLevel;
127
+ add: (level?: Partial<UndoLevel>, event?: EditorEvent<any>) => UndoLevel | null;
119
128
  dispatchChange: () => void;
120
129
  beforeChange: () => void;
121
- undo: () => UndoLevel;
122
- redo: () => UndoLevel;
130
+ undo: () => UndoLevel | undefined;
131
+ redo: () => UndoLevel | undefined;
123
132
  clear: () => void;
124
133
  reset: () => void;
125
134
  hasUndo: () => boolean;
126
135
  hasRedo: () => boolean;
127
- transact: (callback: () => void) => UndoLevel;
136
+ transact: (callback: () => void) => UndoLevel | null;
128
137
  ignore: (callback: () => void) => void;
129
138
  extra: (callback1: () => void, callback2: () => void) => void;
130
139
  }
131
- declare type SchemaType = 'html4' | 'html5' | 'html5-strict';
132
- interface SchemaSettings {
133
- custom_elements?: string;
140
+ type SchemaType = 'html4' | 'html5' | 'html5-strict';
141
+ interface ElementSettings {
142
+ block_elements?: string;
143
+ boolean_attributes?: string;
144
+ move_caret_before_on_enter_elements?: string;
145
+ non_empty_elements?: string;
146
+ self_closing_elements?: string;
147
+ text_block_elements?: string;
148
+ text_inline_elements?: string;
149
+ void_elements?: string;
150
+ whitespace_elements?: string;
151
+ transparent_elements?: string;
152
+ wrap_block_elements?: string;
153
+ }
154
+ interface SchemaSettings extends ElementSettings {
155
+ custom_elements?: string | Record<string, CustomElementSpec>;
134
156
  extended_valid_elements?: string;
135
157
  invalid_elements?: string;
136
158
  invalid_styles?: string | Record<string, string>;
@@ -152,12 +174,8 @@ interface DefaultAttribute {
152
174
  name: string;
153
175
  value: string;
154
176
  }
155
- interface AttributePattern {
156
- defaultValue?: string;
157
- forcedValue?: string;
177
+ interface AttributePattern extends Attribute {
158
178
  pattern: RegExp;
159
- required?: boolean;
160
- validValues?: Record<string, {}>;
161
179
  }
162
180
  interface ElementRule {
163
181
  attributes: Record<string, Attribute>;
@@ -182,6 +200,12 @@ interface SchemaMap {
182
200
  interface SchemaRegExpMap {
183
201
  [name: string]: RegExp;
184
202
  }
203
+ interface CustomElementSpec {
204
+ extends?: string;
205
+ attributes?: string[];
206
+ children?: string[];
207
+ padEmpty?: boolean;
208
+ }
185
209
  interface Schema {
186
210
  type: SchemaType;
187
211
  children: Record<string, SchemaMap>;
@@ -199,16 +223,20 @@ interface Schema {
199
223
  getNonEmptyElements: () => SchemaMap;
200
224
  getMoveCaretBeforeOnEnterElements: () => SchemaMap;
201
225
  getWhitespaceElements: () => SchemaMap;
226
+ getTransparentElements: () => SchemaMap;
202
227
  getSpecialElements: () => SchemaRegExpMap;
203
228
  isValidChild: (name: string, child: string) => boolean;
204
229
  isValid: (name: string, attr?: string) => boolean;
230
+ isBlock: (name: string) => boolean;
231
+ isInline: (name: string) => boolean;
232
+ isWrapper: (name: string) => boolean;
205
233
  getCustomElements: () => SchemaMap;
206
234
  addValidElements: (validElements: string) => void;
207
235
  setValidElements: (validElements: string) => void;
208
- addCustomElements: (customElements: string) => void;
236
+ addCustomElements: (customElements: string | Record<string, CustomElementSpec>) => void;
209
237
  addValidChildren: (validChildren: any) => void;
210
238
  }
211
- declare type Attributes$1 = Array<{
239
+ type Attributes$1 = Array<{
212
240
  name: string;
213
241
  value: string;
214
242
  }> & {
@@ -225,16 +253,16 @@ declare class AstNode {
225
253
  type: number;
226
254
  attributes?: Attributes$1;
227
255
  value?: string;
228
- parent?: AstNode;
229
- firstChild?: AstNode;
230
- lastChild?: AstNode;
231
- next?: AstNode;
232
- prev?: AstNode;
256
+ parent?: AstNode | null;
257
+ firstChild?: AstNode | null;
258
+ lastChild?: AstNode | null;
259
+ next?: AstNode | null;
260
+ prev?: AstNode | null;
233
261
  raw?: boolean;
234
262
  constructor(name: string, type: number);
235
263
  replace(node: AstNode): AstNode;
236
- attr(name: string, value: string | null): AstNode | undefined;
237
- attr(name: Record<string, string | null>): AstNode | undefined;
264
+ attr(name: string, value: string | null | undefined): AstNode | undefined;
265
+ attr(name: Record<string, string | null | undefined> | undefined): AstNode | undefined;
238
266
  attr(name: string): string | undefined;
239
267
  clone(): AstNode;
240
268
  wrap(wrapper: AstNode): AstNode;
@@ -246,10 +274,10 @@ declare class AstNode {
246
274
  children(): AstNode[];
247
275
  empty(): AstNode;
248
276
  isEmpty(elements: SchemaMap, whitespace?: SchemaMap, predicate?: (node: AstNode) => boolean): boolean;
249
- walk(prev?: boolean): AstNode;
277
+ walk(prev?: boolean): AstNode | null | undefined;
250
278
  }
251
- declare type Content = string | AstNode;
252
- declare type ContentFormat = 'raw' | 'text' | 'html' | 'tree';
279
+ type Content = string | AstNode;
280
+ type ContentFormat = 'raw' | 'text' | 'html' | 'tree';
253
281
  interface GetContentArgs {
254
282
  format: ContentFormat;
255
283
  get: boolean;
@@ -266,6 +294,9 @@ interface SetContentArgs {
266
294
  no_events?: boolean;
267
295
  no_selection?: boolean;
268
296
  paste?: boolean;
297
+ load?: boolean;
298
+ initial?: boolean;
299
+ [key: string]: any;
269
300
  }
270
301
  interface GetSelectionContentArgs extends GetContentArgs {
271
302
  selection?: boolean;
@@ -314,12 +345,12 @@ declare class NodeChange {
314
345
  private readonly editor;
315
346
  private lastPath;
316
347
  constructor(editor: Editor);
317
- nodeChanged(args?: any): void;
348
+ nodeChanged(args?: Record<string, any>): void;
318
349
  private isSameElementPath;
319
350
  }
320
351
  interface SelectionOverrides {
321
- showCaret: (direction: number, node: Element, before: boolean, scrollIntoView?: boolean) => Range | null;
322
- showBlockCaretContainer: (blockCaretContainer: Element) => void;
352
+ showCaret: (direction: number, node: HTMLElement, before: boolean, scrollIntoView?: boolean) => Range | null;
353
+ showBlockCaretContainer: (blockCaretContainer: HTMLElement) => void;
323
354
  hideFakeCaret: () => void;
324
355
  destroy: () => void;
325
356
  }
@@ -327,16 +358,16 @@ interface Quirks {
327
358
  refreshContentEditable(): void;
328
359
  isHidden(): boolean;
329
360
  }
330
- declare type DecoratorData = Record<string, any>;
331
- declare type Decorator = (uid: string, data: DecoratorData) => {
361
+ type DecoratorData = Record<string, any>;
362
+ type Decorator = (uid: string, data: DecoratorData) => {
332
363
  attributes?: {};
333
364
  classes?: string[];
334
365
  };
335
- declare type AnnotationListener = (state: boolean, name: string, data?: {
366
+ type AnnotationListener = (state: boolean, name: string, data?: {
336
367
  uid: string;
337
368
  nodes: any[];
338
369
  }) => void;
339
- declare type AnnotationListenerApi = AnnotationListener;
370
+ type AnnotationListenerApi = AnnotationListener;
340
371
  interface AnnotatorSettings {
341
372
  decorate: Decorator;
342
373
  persistent?: boolean;
@@ -349,6 +380,12 @@ interface Annotator {
349
380
  removeAll: (name: string) => void;
350
381
  getAll: (name: string) => Record<string, Element[]>;
351
382
  }
383
+ interface IsEmptyOptions {
384
+ readonly skipBogus?: boolean;
385
+ readonly includeZwsp?: boolean;
386
+ readonly checkRootAsContent?: boolean;
387
+ readonly isContent?: (node: Node) => boolean;
388
+ }
352
389
  interface GeomRect {
353
390
  readonly x: number;
354
391
  readonly y: number;
@@ -365,7 +402,7 @@ interface Rect {
365
402
  fromClientRect: (clientRect: DOMRect) => GeomRect;
366
403
  }
367
404
  interface NotificationManagerImpl {
368
- open: (spec: NotificationSpec, closeCallback?: () => void) => NotificationApi;
405
+ open: (spec: NotificationSpec, closeCallback: () => void, hasEditorFocus: () => boolean) => NotificationApi;
369
406
  close: <T extends NotificationApi>(notification: T) => void;
370
407
  getArgs: <T extends NotificationApi>(notification: T) => NotificationSpec;
371
408
  }
@@ -375,7 +412,6 @@ interface NotificationSpec {
375
412
  icon?: string;
376
413
  progressBar?: boolean;
377
414
  timeout?: number;
378
- closeButton?: boolean;
379
415
  }
380
416
  interface NotificationApi {
381
417
  close: () => void;
@@ -396,14 +432,15 @@ interface UploadFailure {
396
432
  message: string;
397
433
  remove?: boolean;
398
434
  }
399
- declare type ProgressFn = (percent: number) => void;
400
- declare type UploadHandler = (blobInfo: BlobInfo, progress: ProgressFn) => Promise<string>;
435
+ type ProgressFn = (percent: number) => void;
436
+ type UploadHandler = (blobInfo: BlobInfo, progress: ProgressFn) => Promise<string>;
401
437
  interface UploadResult$2 {
402
438
  url: string;
403
439
  blobInfo: BlobInfo;
404
440
  status: boolean;
405
441
  error?: UploadFailure;
406
442
  }
443
+ type BlockPatternTrigger = 'enter' | 'space';
407
444
  interface RawPattern {
408
445
  start?: any;
409
446
  end?: any;
@@ -411,6 +448,7 @@ interface RawPattern {
411
448
  cmd?: any;
412
449
  value?: any;
413
450
  replacement?: any;
451
+ trigger?: BlockPatternTrigger;
414
452
  }
415
453
  interface InlineBasePattern {
416
454
  readonly start: string;
@@ -425,9 +463,10 @@ interface InlineCmdPattern extends InlineBasePattern {
425
463
  readonly cmd: string;
426
464
  readonly value?: any;
427
465
  }
428
- declare type InlinePattern = InlineFormatPattern | InlineCmdPattern;
466
+ type InlinePattern = InlineFormatPattern | InlineCmdPattern;
429
467
  interface BlockBasePattern {
430
468
  readonly start: string;
469
+ readonly trigger: BlockPatternTrigger;
431
470
  }
432
471
  interface BlockFormatPattern extends BlockBasePattern {
433
472
  readonly type: 'block-format';
@@ -438,8 +477,14 @@ interface BlockCmdPattern extends BlockBasePattern {
438
477
  readonly cmd: string;
439
478
  readonly value?: any;
440
479
  }
441
- declare type BlockPattern = BlockFormatPattern | BlockCmdPattern;
442
- declare type Pattern = InlinePattern | BlockPattern;
480
+ type BlockPattern = BlockFormatPattern | BlockCmdPattern;
481
+ type Pattern = InlinePattern | BlockPattern;
482
+ interface DynamicPatternContext {
483
+ readonly text: string;
484
+ readonly block: Element;
485
+ }
486
+ type DynamicPatternsLookup = (ctx: DynamicPatternContext) => Pattern[];
487
+ type RawDynamicPatternsLookup = (ctx: DynamicPatternContext) => RawPattern[];
443
488
  interface AlertBannerSpec {
444
489
  type: 'alertbanner';
445
490
  level: 'info' | 'warn' | 'error' | 'success';
@@ -456,6 +501,7 @@ interface ButtonSpec {
456
501
  icon?: string;
457
502
  borderless?: boolean;
458
503
  buttonType?: 'primary' | 'secondary' | 'toolbar';
504
+ context?: string;
459
505
  }
460
506
  interface FormComponentSpec {
461
507
  type: string;
@@ -468,9 +514,11 @@ interface CheckboxSpec extends FormComponentSpec {
468
514
  type: 'checkbox';
469
515
  label: string;
470
516
  enabled?: boolean;
517
+ context?: string;
471
518
  }
472
519
  interface CollectionSpec extends FormComponentWithLabelSpec {
473
520
  type: 'collection';
521
+ context?: string;
474
522
  }
475
523
  interface CollectionItem {
476
524
  value: string;
@@ -479,6 +527,8 @@ interface CollectionItem {
479
527
  }
480
528
  interface ColorInputSpec extends FormComponentWithLabelSpec {
481
529
  type: 'colorinput';
530
+ storageKey?: string;
531
+ context?: string;
482
532
  }
483
533
  interface ColorPickerSpec extends FormComponentWithLabelSpec {
484
534
  type: 'colorpicker';
@@ -488,7 +538,7 @@ interface CustomEditorInit {
488
538
  getValue: () => string;
489
539
  destroy: () => void;
490
540
  }
491
- declare type CustomEditorInitFn = (elm: HTMLElement, settings: any) => Promise<CustomEditorInit>;
541
+ type CustomEditorInitFn = (elm: HTMLElement, settings: any) => Promise<CustomEditorInit>;
492
542
  interface CustomEditorOldSpec extends FormComponentSpec {
493
543
  type: 'customeditor';
494
544
  tag?: string;
@@ -499,11 +549,13 @@ interface CustomEditorNewSpec extends FormComponentSpec {
499
549
  tag?: string;
500
550
  scriptId: string;
501
551
  scriptUrl: string;
552
+ onFocus?: (e: HTMLElement) => void;
502
553
  settings?: any;
503
554
  }
504
- declare type CustomEditorSpec = CustomEditorOldSpec | CustomEditorNewSpec;
555
+ type CustomEditorSpec = CustomEditorOldSpec | CustomEditorNewSpec;
505
556
  interface DropZoneSpec extends FormComponentWithLabelSpec {
506
557
  type: 'dropzone';
558
+ context?: string;
507
559
  }
508
560
  interface GridSpec {
509
561
  type: 'grid';
@@ -513,11 +565,15 @@ interface GridSpec {
513
565
  interface HtmlPanelSpec {
514
566
  type: 'htmlpanel';
515
567
  html: string;
568
+ onInit?: (el: HTMLElement) => void;
516
569
  presets?: 'presentation' | 'document';
570
+ stretched?: boolean;
517
571
  }
518
572
  interface IframeSpec extends FormComponentWithLabelSpec {
519
573
  type: 'iframe';
574
+ border?: boolean;
520
575
  sandboxed?: boolean;
576
+ streamContent?: boolean;
521
577
  transparent?: boolean;
522
578
  }
523
579
  interface ImagePreviewSpec extends FormComponentSpec {
@@ -530,11 +586,15 @@ interface InputSpec extends FormComponentWithLabelSpec {
530
586
  placeholder?: string;
531
587
  maximized?: boolean;
532
588
  enabled?: boolean;
589
+ context?: string;
533
590
  }
591
+ type Alignment = 'start' | 'center' | 'end';
534
592
  interface LabelSpec {
535
593
  type: 'label';
536
594
  label: string;
537
595
  items: BodyComponentSpec[];
596
+ align?: Alignment;
597
+ for?: string;
538
598
  }
539
599
  interface ListBoxSingleItemSpec {
540
600
  text: string;
@@ -544,11 +604,12 @@ interface ListBoxNestedItemSpec {
544
604
  text: string;
545
605
  items: ListBoxItemSpec[];
546
606
  }
547
- declare type ListBoxItemSpec = ListBoxNestedItemSpec | ListBoxSingleItemSpec;
607
+ type ListBoxItemSpec = ListBoxNestedItemSpec | ListBoxSingleItemSpec;
548
608
  interface ListBoxSpec extends FormComponentWithLabelSpec {
549
609
  type: 'listbox';
550
610
  items: ListBoxItemSpec[];
551
611
  disabled?: boolean;
612
+ context?: string;
552
613
  }
553
614
  interface PanelSpec {
554
615
  type: 'panel';
@@ -564,11 +625,13 @@ interface SelectBoxSpec extends FormComponentWithLabelSpec {
564
625
  items: SelectBoxItemSpec[];
565
626
  size?: number;
566
627
  enabled?: boolean;
628
+ context?: string;
567
629
  }
568
630
  interface SizeInputSpec extends FormComponentWithLabelSpec {
569
631
  type: 'sizeinput';
570
632
  constrain?: boolean;
571
633
  enabled?: boolean;
634
+ context?: string;
572
635
  }
573
636
  interface SliderSpec extends FormComponentSpec {
574
637
  type: 'slider';
@@ -586,22 +649,62 @@ interface TextAreaSpec extends FormComponentWithLabelSpec {
586
649
  placeholder?: string;
587
650
  maximized?: boolean;
588
651
  enabled?: boolean;
652
+ context?: string;
589
653
  }
590
- interface UrlInputSpec extends FormComponentWithLabelSpec {
591
- type: 'urlinput';
592
- filetype?: 'image' | 'media' | 'file';
654
+ interface BaseToolbarButtonSpec<I extends BaseToolbarButtonInstanceApi> {
593
655
  enabled?: boolean;
656
+ tooltip?: string;
657
+ icon?: string;
658
+ text?: string;
659
+ onSetup?: (api: I) => (api: I) => void;
660
+ context?: string;
594
661
  }
595
- interface UrlInputData {
596
- value: string;
597
- meta: {
598
- text?: string;
599
- };
662
+ interface BaseToolbarButtonInstanceApi {
663
+ isEnabled: () => boolean;
664
+ setEnabled: (state: boolean) => void;
665
+ setText: (text: string) => void;
666
+ setIcon: (icon: string) => void;
600
667
  }
601
- 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;
602
- interface BarSpec {
603
- type: 'bar';
604
- items: BodyComponentSpec[];
668
+ interface ToolbarButtonSpec extends BaseToolbarButtonSpec<ToolbarButtonInstanceApi> {
669
+ type?: 'button';
670
+ onAction: (api: ToolbarButtonInstanceApi) => void;
671
+ shortcut?: string;
672
+ }
673
+ interface ToolbarButtonInstanceApi extends BaseToolbarButtonInstanceApi {
674
+ }
675
+ interface ToolbarGroupSetting {
676
+ name: string;
677
+ items: string[];
678
+ }
679
+ type ToolbarConfig = string | ToolbarGroupSetting[];
680
+ interface GroupToolbarButtonInstanceApi extends BaseToolbarButtonInstanceApi {
681
+ }
682
+ interface GroupToolbarButtonSpec extends BaseToolbarButtonSpec<GroupToolbarButtonInstanceApi> {
683
+ type?: 'grouptoolbarbutton';
684
+ items?: ToolbarConfig;
685
+ }
686
+ interface CardImageSpec {
687
+ type: 'cardimage';
688
+ src: string;
689
+ alt?: string;
690
+ classes?: string[];
691
+ }
692
+ interface CardTextSpec {
693
+ type: 'cardtext';
694
+ text: string;
695
+ name?: string;
696
+ classes?: string[];
697
+ }
698
+ type CardItemSpec = CardContainerSpec | CardImageSpec | CardTextSpec;
699
+ type CardContainerDirection = 'vertical' | 'horizontal';
700
+ type CardContainerAlign = 'left' | 'right';
701
+ type CardContainerValign = 'top' | 'middle' | 'bottom';
702
+ interface CardContainerSpec {
703
+ type: 'cardcontainer';
704
+ items: CardItemSpec[];
705
+ direction?: CardContainerDirection;
706
+ align?: CardContainerAlign;
707
+ valign?: CardContainerValign;
605
708
  }
606
709
  interface CommonMenuItemSpec {
607
710
  enabled?: boolean;
@@ -609,16 +712,231 @@ interface CommonMenuItemSpec {
609
712
  value?: string;
610
713
  meta?: Record<string, any>;
611
714
  shortcut?: string;
715
+ context?: string;
612
716
  }
613
717
  interface CommonMenuItemInstanceApi {
614
718
  isEnabled: () => boolean;
615
719
  setEnabled: (state: boolean) => void;
616
720
  }
721
+ interface CardMenuItemInstanceApi extends CommonMenuItemInstanceApi {
722
+ }
723
+ interface CardMenuItemSpec extends Omit<CommonMenuItemSpec, 'text' | 'shortcut'> {
724
+ type: 'cardmenuitem';
725
+ label?: string;
726
+ items: CardItemSpec[];
727
+ onSetup?: (api: CardMenuItemInstanceApi) => (api: CardMenuItemInstanceApi) => void;
728
+ onAction?: (api: CardMenuItemInstanceApi) => void;
729
+ }
730
+ interface ChoiceMenuItemSpec extends CommonMenuItemSpec {
731
+ type?: 'choiceitem';
732
+ icon?: string;
733
+ }
734
+ interface ChoiceMenuItemInstanceApi extends CommonMenuItemInstanceApi {
735
+ isActive: () => boolean;
736
+ setActive: (state: boolean) => void;
737
+ }
738
+ interface ContextMenuItem extends CommonMenuItemSpec {
739
+ text: string;
740
+ icon?: string;
741
+ type?: 'item';
742
+ onAction: () => void;
743
+ }
744
+ interface ContextSubMenu extends CommonMenuItemSpec {
745
+ type: 'submenu';
746
+ text: string;
747
+ icon?: string;
748
+ getSubmenuItems: () => string | Array<ContextMenuContents>;
749
+ }
750
+ type ContextMenuContents = string | ContextMenuItem | SeparatorMenuItemSpec | ContextSubMenu;
751
+ interface ContextMenuApi {
752
+ update: (element: Element) => string | Array<ContextMenuContents>;
753
+ }
754
+ interface FancyActionArgsMap {
755
+ 'inserttable': {
756
+ numRows: number;
757
+ numColumns: number;
758
+ };
759
+ 'colorswatch': {
760
+ value: string;
761
+ };
762
+ }
763
+ interface BaseFancyMenuItemSpec<T extends keyof FancyActionArgsMap> {
764
+ type: 'fancymenuitem';
765
+ fancytype: T;
766
+ initData?: Record<string, unknown>;
767
+ onAction?: (data: FancyActionArgsMap[T]) => void;
768
+ }
769
+ interface InsertTableMenuItemSpec extends BaseFancyMenuItemSpec<'inserttable'> {
770
+ fancytype: 'inserttable';
771
+ initData?: {};
772
+ }
773
+ interface ColorSwatchMenuItemSpec extends BaseFancyMenuItemSpec<'colorswatch'> {
774
+ fancytype: 'colorswatch';
775
+ select?: (value: string) => boolean;
776
+ initData?: {
777
+ allowCustomColors?: boolean;
778
+ colors?: ChoiceMenuItemSpec[];
779
+ storageKey?: string;
780
+ };
781
+ }
782
+ type FancyMenuItemSpec = InsertTableMenuItemSpec | ColorSwatchMenuItemSpec;
783
+ interface MenuItemSpec extends CommonMenuItemSpec {
784
+ type?: 'menuitem';
785
+ icon?: string;
786
+ onSetup?: (api: MenuItemInstanceApi) => (api: MenuItemInstanceApi) => void;
787
+ onAction?: (api: MenuItemInstanceApi) => void;
788
+ }
789
+ interface MenuItemInstanceApi extends CommonMenuItemInstanceApi {
790
+ }
791
+ interface SeparatorMenuItemSpec {
792
+ type?: 'separator';
793
+ text?: string;
794
+ }
795
+ interface ToggleMenuItemSpec extends CommonMenuItemSpec {
796
+ type?: 'togglemenuitem';
797
+ icon?: string;
798
+ active?: boolean;
799
+ onSetup?: (api: ToggleMenuItemInstanceApi) => void;
800
+ onAction: (api: ToggleMenuItemInstanceApi) => void;
801
+ }
802
+ interface ToggleMenuItemInstanceApi extends CommonMenuItemInstanceApi {
803
+ isActive: () => boolean;
804
+ setActive: (state: boolean) => void;
805
+ }
806
+ type NestedMenuItemContents = string | MenuItemSpec | NestedMenuItemSpec | ToggleMenuItemSpec | SeparatorMenuItemSpec | FancyMenuItemSpec;
807
+ interface NestedMenuItemSpec extends CommonMenuItemSpec {
808
+ type?: 'nestedmenuitem';
809
+ icon?: string;
810
+ getSubmenuItems: () => string | Array<NestedMenuItemContents>;
811
+ onSetup?: (api: NestedMenuItemInstanceApi) => (api: NestedMenuItemInstanceApi) => void;
812
+ }
813
+ interface NestedMenuItemInstanceApi extends CommonMenuItemInstanceApi {
814
+ setTooltip: (tooltip: string) => void;
815
+ setIconFill: (id: string, value: string) => void;
816
+ }
817
+ type MenuButtonItemTypes = NestedMenuItemContents;
818
+ type SuccessCallback$1 = (menu: string | MenuButtonItemTypes[]) => void;
819
+ interface MenuButtonFetchContext {
820
+ pattern: string;
821
+ }
822
+ interface BaseMenuButtonSpec {
823
+ text?: string;
824
+ tooltip?: string;
825
+ icon?: string;
826
+ search?: boolean | {
827
+ placeholder?: string;
828
+ };
829
+ fetch: (success: SuccessCallback$1, fetchContext: MenuButtonFetchContext, api: BaseMenuButtonInstanceApi) => void;
830
+ onSetup?: (api: BaseMenuButtonInstanceApi) => (api: BaseMenuButtonInstanceApi) => void;
831
+ context?: string;
832
+ }
833
+ interface BaseMenuButtonInstanceApi {
834
+ isEnabled: () => boolean;
835
+ setEnabled: (state: boolean) => void;
836
+ isActive: () => boolean;
837
+ setActive: (state: boolean) => void;
838
+ setText: (text: string) => void;
839
+ setIcon: (icon: string) => void;
840
+ }
841
+ interface ToolbarMenuButtonSpec extends BaseMenuButtonSpec {
842
+ type?: 'menubutton';
843
+ onSetup?: (api: ToolbarMenuButtonInstanceApi) => (api: ToolbarMenuButtonInstanceApi) => void;
844
+ }
845
+ interface ToolbarMenuButtonInstanceApi extends BaseMenuButtonInstanceApi {
846
+ }
847
+ type ToolbarSplitButtonItemTypes = ChoiceMenuItemSpec | SeparatorMenuItemSpec;
848
+ type SuccessCallback = (menu: ToolbarSplitButtonItemTypes[]) => void;
849
+ type SelectPredicate = (value: string) => boolean;
850
+ type PresetTypes = 'color' | 'normal' | 'listpreview';
851
+ type ColumnTypes$1 = number | 'auto';
852
+ interface ToolbarSplitButtonSpec {
853
+ type?: 'splitbutton';
854
+ tooltip?: string;
855
+ icon?: string;
856
+ text?: string;
857
+ select?: SelectPredicate;
858
+ presets?: PresetTypes;
859
+ columns?: ColumnTypes$1;
860
+ fetch: (success: SuccessCallback) => void;
861
+ onSetup?: (api: ToolbarSplitButtonInstanceApi) => (api: ToolbarSplitButtonInstanceApi) => void;
862
+ onAction: (api: ToolbarSplitButtonInstanceApi) => void;
863
+ onItemAction: (api: ToolbarSplitButtonInstanceApi, value: string) => void;
864
+ context?: string;
865
+ }
866
+ interface ToolbarSplitButtonInstanceApi {
867
+ isEnabled: () => boolean;
868
+ setEnabled: (state: boolean) => void;
869
+ setIconFill: (id: string, value: string) => void;
870
+ isActive: () => boolean;
871
+ setActive: (state: boolean) => void;
872
+ setTooltip: (tooltip: string) => void;
873
+ setText: (text: string) => void;
874
+ setIcon: (icon: string) => void;
875
+ }
876
+ interface BaseToolbarToggleButtonSpec<I extends BaseToolbarButtonInstanceApi> extends BaseToolbarButtonSpec<I> {
877
+ active?: boolean;
878
+ }
879
+ interface BaseToolbarToggleButtonInstanceApi extends BaseToolbarButtonInstanceApi {
880
+ isActive: () => boolean;
881
+ setActive: (state: boolean) => void;
882
+ }
883
+ interface ToolbarToggleButtonSpec extends BaseToolbarToggleButtonSpec<ToolbarToggleButtonInstanceApi> {
884
+ type?: 'togglebutton';
885
+ onAction: (api: ToolbarToggleButtonInstanceApi) => void;
886
+ shortcut?: string;
887
+ }
888
+ interface ToolbarToggleButtonInstanceApi extends BaseToolbarToggleButtonInstanceApi {
889
+ }
890
+ type Id = string;
891
+ interface TreeSpec {
892
+ type: 'tree';
893
+ items: TreeItemSpec[];
894
+ onLeafAction?: (id: Id) => void;
895
+ defaultExpandedIds?: Id[];
896
+ onToggleExpand?: (expandedIds: Id[], { expanded, node }: {
897
+ expanded: boolean;
898
+ node: Id;
899
+ }) => void;
900
+ defaultSelectedId?: Id;
901
+ }
902
+ interface BaseTreeItemSpec {
903
+ title: string;
904
+ id: Id;
905
+ menu?: ToolbarMenuButtonSpec;
906
+ customStateIcon?: string;
907
+ customStateIconTooltip?: string;
908
+ }
909
+ interface DirectorySpec extends BaseTreeItemSpec {
910
+ type: 'directory';
911
+ children: TreeItemSpec[];
912
+ }
913
+ interface LeafSpec extends BaseTreeItemSpec {
914
+ type: 'leaf';
915
+ }
916
+ type TreeItemSpec = DirectorySpec | LeafSpec;
917
+ interface UrlInputSpec extends FormComponentWithLabelSpec {
918
+ type: 'urlinput';
919
+ filetype?: 'image' | 'media' | 'file';
920
+ enabled?: boolean;
921
+ picker_text?: string;
922
+ context?: string;
923
+ }
924
+ interface UrlInputData {
925
+ value: string;
926
+ meta: {
927
+ text?: string;
928
+ };
929
+ }
930
+ type BodyComponentSpec = BarSpec | ButtonSpec | CheckboxSpec | TextAreaSpec | InputSpec | ListBoxSpec | SelectBoxSpec | SizeInputSpec | SliderSpec | IframeSpec | HtmlPanelSpec | UrlInputSpec | DropZoneSpec | ColorInputSpec | GridSpec | ColorPickerSpec | ImagePreviewSpec | AlertBannerSpec | CollectionSpec | LabelSpec | TableSpec | TreeSpec | PanelSpec | CustomEditorSpec;
931
+ interface BarSpec {
932
+ type: 'bar';
933
+ items: BodyComponentSpec[];
934
+ }
617
935
  interface DialogToggleMenuItemSpec extends CommonMenuItemSpec {
618
936
  type?: 'togglemenuitem';
619
937
  name: string;
620
938
  }
621
- declare type DialogFooterMenuButtonItemSpec = DialogToggleMenuItemSpec;
939
+ type DialogFooterMenuButtonItemSpec = DialogToggleMenuItemSpec;
622
940
  interface BaseDialogFooterButtonSpec {
623
941
  name?: string;
624
942
  align?: 'start' | 'end';
@@ -626,6 +944,7 @@ interface BaseDialogFooterButtonSpec {
626
944
  enabled?: boolean;
627
945
  icon?: string;
628
946
  buttonType?: 'primary' | 'secondary';
947
+ context?: string;
629
948
  }
630
949
  interface DialogFooterNormalButtonSpec extends BaseDialogFooterButtonSpec {
631
950
  type: 'submit' | 'cancel' | 'custom';
@@ -638,7 +957,14 @@ interface DialogFooterMenuButtonSpec extends BaseDialogFooterButtonSpec {
638
957
  icon?: string;
639
958
  items: DialogFooterMenuButtonItemSpec[];
640
959
  }
641
- declare type DialogFooterButtonSpec = DialogFooterNormalButtonSpec | DialogFooterMenuButtonSpec;
960
+ interface DialogFooterToggleButtonSpec extends BaseDialogFooterButtonSpec {
961
+ type: 'togglebutton';
962
+ tooltip?: string;
963
+ icon?: string;
964
+ text?: string;
965
+ active?: boolean;
966
+ }
967
+ type DialogFooterButtonSpec = DialogFooterNormalButtonSpec | DialogFooterMenuButtonSpec | DialogFooterToggleButtonSpec;
642
968
  interface TabSpec {
643
969
  name?: string;
644
970
  title: string;
@@ -648,8 +974,8 @@ interface TabPanelSpec {
648
974
  type: 'tabpanel';
649
975
  tabs: TabSpec[];
650
976
  }
651
- declare type DialogDataItem = any;
652
- declare type DialogData = Record<string, DialogDataItem>;
977
+ type DialogDataItem = any;
978
+ type DialogData = Record<string, DialogDataItem>;
653
979
  interface DialogInstanceApi<T extends DialogData> {
654
980
  getData: () => T;
655
981
  setData: (data: Partial<T>) => void;
@@ -659,6 +985,7 @@ interface DialogInstanceApi<T extends DialogData> {
659
985
  redial: (nu: DialogSpec<T>) => void;
660
986
  block: (msg: string) => void;
661
987
  unblock: () => void;
988
+ toggleFullscreen: () => void;
662
989
  close: () => void;
663
990
  }
664
991
  interface DialogActionDetails {
@@ -672,18 +999,18 @@ interface DialogTabChangeDetails {
672
999
  newTabName: string;
673
1000
  oldTabName: string;
674
1001
  }
675
- declare type DialogActionHandler<T> = (api: DialogInstanceApi<T>, details: DialogActionDetails) => void;
676
- declare type DialogChangeHandler<T> = (api: DialogInstanceApi<T>, details: DialogChangeDetails<T>) => void;
677
- declare type DialogSubmitHandler<T> = (api: DialogInstanceApi<T>) => void;
678
- declare type DialogCloseHandler = () => void;
679
- declare type DialogCancelHandler<T> = (api: DialogInstanceApi<T>) => void;
680
- declare type DialogTabChangeHandler<T> = (api: DialogInstanceApi<T>, details: DialogTabChangeDetails) => void;
681
- declare type DialogSize = 'normal' | 'medium' | 'large';
1002
+ type DialogActionHandler<T extends DialogData> = (api: DialogInstanceApi<T>, details: DialogActionDetails) => void;
1003
+ type DialogChangeHandler<T extends DialogData> = (api: DialogInstanceApi<T>, details: DialogChangeDetails<T>) => void;
1004
+ type DialogSubmitHandler<T extends DialogData> = (api: DialogInstanceApi<T>) => void;
1005
+ type DialogCloseHandler = () => void;
1006
+ type DialogCancelHandler<T extends DialogData> = (api: DialogInstanceApi<T>) => void;
1007
+ type DialogTabChangeHandler<T extends DialogData> = (api: DialogInstanceApi<T>, details: DialogTabChangeDetails) => void;
1008
+ type DialogSize = 'normal' | 'medium' | 'large';
682
1009
  interface DialogSpec<T extends DialogData> {
683
1010
  title: string;
684
1011
  size?: DialogSize;
685
1012
  body: TabPanelSpec | PanelSpec;
686
- buttons: DialogFooterButtonSpec[];
1013
+ buttons?: DialogFooterButtonSpec[];
687
1014
  initialData?: Partial<T>;
688
1015
  onAction?: DialogActionHandler<T>;
689
1016
  onChange?: DialogChangeHandler<T>;
@@ -704,64 +1031,28 @@ interface UrlDialogActionDetails {
704
1031
  }
705
1032
  interface UrlDialogMessage {
706
1033
  mceAction: string;
707
- [key: string]: any;
708
- }
709
- declare type UrlDialogActionHandler = (api: UrlDialogInstanceApi, actions: UrlDialogActionDetails) => void;
710
- declare type UrlDialogCloseHandler = () => void;
711
- declare type UrlDialogCancelHandler = (api: UrlDialogInstanceApi) => void;
712
- declare type UrlDialogMessageHandler = (api: UrlDialogInstanceApi, message: UrlDialogMessage) => void;
713
- interface UrlDialogFooterButtonSpec extends DialogFooterNormalButtonSpec {
714
- type: 'cancel' | 'custom';
715
- }
716
- interface UrlDialogSpec {
717
- title: string;
718
- url: string;
719
- height?: number;
720
- width?: number;
721
- buttons?: UrlDialogFooterButtonSpec[];
722
- onAction?: UrlDialogActionHandler;
723
- onClose?: UrlDialogCloseHandler;
724
- onCancel?: UrlDialogCancelHandler;
725
- onMessage?: UrlDialogMessageHandler;
726
- }
727
- declare type CardContainerDirection = 'vertical' | 'horizontal';
728
- declare type CardContainerAlign = 'left' | 'right';
729
- declare type CardContainerValign = 'top' | 'middle' | 'bottom';
730
- interface CardContainerSpec {
731
- type: 'cardcontainer';
732
- items: CardItemSpec[];
733
- direction?: CardContainerDirection;
734
- align?: CardContainerAlign;
735
- valign?: CardContainerValign;
736
- }
737
- interface CardImageSpec {
738
- type: 'cardimage';
739
- src: string;
740
- alt?: string;
741
- classes?: string[];
742
- }
743
- interface CardTextSpec {
744
- type: 'cardtext';
745
- text: string;
746
- name?: string;
747
- classes?: string[];
748
- }
749
- declare type CardItemSpec = CardContainerSpec | CardImageSpec | CardTextSpec;
750
- interface CardMenuItemInstanceApi extends CommonMenuItemInstanceApi {
1034
+ [key: string]: any;
751
1035
  }
752
- interface CardMenuItemSpec extends Omit<CommonMenuItemSpec, 'text' | 'shortcut'> {
753
- type: 'cardmenuitem';
754
- label?: string;
755
- items: CardItemSpec[];
756
- onSetup?: (api: CardMenuItemInstanceApi) => (api: CardMenuItemInstanceApi) => void;
757
- onAction?: (api: CardMenuItemInstanceApi) => void;
1036
+ type UrlDialogActionHandler = (api: UrlDialogInstanceApi, actions: UrlDialogActionDetails) => void;
1037
+ type UrlDialogCloseHandler = () => void;
1038
+ type UrlDialogCancelHandler = (api: UrlDialogInstanceApi) => void;
1039
+ type UrlDialogMessageHandler = (api: UrlDialogInstanceApi, message: UrlDialogMessage) => void;
1040
+ interface UrlDialogFooterButtonSpec extends DialogFooterNormalButtonSpec {
1041
+ type: 'cancel' | 'custom';
758
1042
  }
759
- interface SeparatorMenuItemSpec {
760
- type?: 'separator';
761
- text?: string;
1043
+ interface UrlDialogSpec {
1044
+ title: string;
1045
+ url: string;
1046
+ height?: number;
1047
+ width?: number;
1048
+ buttons?: UrlDialogFooterButtonSpec[];
1049
+ onAction?: UrlDialogActionHandler;
1050
+ onClose?: UrlDialogCloseHandler;
1051
+ onCancel?: UrlDialogCancelHandler;
1052
+ onMessage?: UrlDialogMessageHandler;
762
1053
  }
763
- declare type ColumnTypes$1 = number | 'auto';
764
- declare type SeparatorItemSpec = SeparatorMenuItemSpec;
1054
+ type ColumnTypes = number | 'auto';
1055
+ type SeparatorItemSpec = SeparatorMenuItemSpec;
765
1056
  interface AutocompleterItemSpec {
766
1057
  type?: 'autocompleteitem';
767
1058
  value: string;
@@ -769,12 +1060,12 @@ interface AutocompleterItemSpec {
769
1060
  icon?: string;
770
1061
  meta?: Record<string, any>;
771
1062
  }
772
- declare type AutocompleterContents = SeparatorItemSpec | AutocompleterItemSpec | CardMenuItemSpec;
1063
+ type AutocompleterContents = SeparatorItemSpec | AutocompleterItemSpec | CardMenuItemSpec;
773
1064
  interface AutocompleterSpec {
774
1065
  type?: 'autocompleter';
775
- ch: string;
1066
+ trigger: string;
776
1067
  minChars?: number;
777
- columns?: ColumnTypes$1;
1068
+ columns?: ColumnTypes;
778
1069
  matches?: (rng: Range, text: string, pattern: string) => boolean;
779
1070
  fetch: (pattern: string, maxResults: number, fetchOptions: Record<string, any>) => Promise<AutocompleterContents[]>;
780
1071
  onAction: (autocompleterApi: AutocompleterInstanceApi, rng: Range, value: string, meta: Record<string, any>) => void;
@@ -785,43 +1076,13 @@ interface AutocompleterInstanceApi {
785
1076
  hide: () => void;
786
1077
  reload: (fetchOptions: Record<string, any>) => void;
787
1078
  }
788
- declare type ContextPosition = 'node' | 'selection' | 'line';
789
- declare type ContextScope = 'node' | 'editor';
1079
+ type ContextPosition = 'node' | 'selection' | 'line';
1080
+ type ContextScope = 'node' | 'editor';
790
1081
  interface ContextBarSpec {
791
1082
  predicate?: (elem: Element) => boolean;
792
1083
  position?: ContextPosition;
793
1084
  scope?: ContextScope;
794
1085
  }
795
- interface BaseToolbarButtonSpec<I extends BaseToolbarButtonInstanceApi> {
796
- enabled?: boolean;
797
- tooltip?: string;
798
- icon?: string;
799
- text?: string;
800
- onSetup?: (api: I) => (api: I) => void;
801
- }
802
- interface BaseToolbarButtonInstanceApi {
803
- isEnabled: () => boolean;
804
- setEnabled: (state: boolean) => void;
805
- }
806
- interface ToolbarButtonSpec extends BaseToolbarButtonSpec<ToolbarButtonInstanceApi> {
807
- type?: 'button';
808
- onAction: (api: ToolbarButtonInstanceApi) => void;
809
- }
810
- interface ToolbarButtonInstanceApi extends BaseToolbarButtonInstanceApi {
811
- }
812
- interface BaseToolbarToggleButtonSpec<I extends BaseToolbarButtonInstanceApi> extends BaseToolbarButtonSpec<I> {
813
- active?: boolean;
814
- }
815
- interface BaseToolbarToggleButtonInstanceApi extends BaseToolbarButtonInstanceApi {
816
- isActive: () => boolean;
817
- setActive: (state: boolean) => void;
818
- }
819
- interface ToolbarToggleButtonSpec extends BaseToolbarToggleButtonSpec<ToolbarToggleButtonInstanceApi> {
820
- type?: 'togglebutton';
821
- onAction: (api: ToolbarToggleButtonInstanceApi) => void;
822
- }
823
- interface ToolbarToggleButtonInstanceApi extends BaseToolbarToggleButtonInstanceApi {
824
- }
825
1086
  interface ContextFormLaunchButtonApi extends BaseToolbarButtonSpec<BaseToolbarButtonInstanceApi> {
826
1087
  type: 'contextformbutton';
827
1088
  }
@@ -832,109 +1093,59 @@ interface ContextFormButtonInstanceApi extends BaseToolbarButtonInstanceApi {
832
1093
  }
833
1094
  interface ContextFormToggleButtonInstanceApi extends BaseToolbarToggleButtonInstanceApi {
834
1095
  }
835
- interface ContextFormButtonSpec extends BaseToolbarButtonSpec<ContextFormButtonInstanceApi> {
1096
+ interface ContextFormButtonSpec<T> extends BaseToolbarButtonSpec<ContextFormButtonInstanceApi> {
836
1097
  type?: 'contextformbutton';
837
1098
  primary?: boolean;
838
- onAction: (formApi: ContextFormInstanceApi, api: ContextFormButtonInstanceApi) => void;
1099
+ align?: 'start' | 'end';
1100
+ onAction: (formApi: ContextFormInstanceApi<T>, api: ContextFormButtonInstanceApi) => void;
839
1101
  }
840
- interface ContextFormToggleButtonSpec extends BaseToolbarToggleButtonSpec<ContextFormToggleButtonInstanceApi> {
1102
+ interface ContextFormToggleButtonSpec<T> extends BaseToolbarToggleButtonSpec<ContextFormToggleButtonInstanceApi> {
841
1103
  type?: 'contextformtogglebutton';
842
- onAction: (formApi: ContextFormInstanceApi, buttonApi: ContextFormToggleButtonInstanceApi) => void;
843
1104
  primary?: boolean;
1105
+ align?: 'start' | 'end';
1106
+ onAction: (formApi: ContextFormInstanceApi<T>, buttonApi: ContextFormToggleButtonInstanceApi) => void;
844
1107
  }
845
- interface ContextFormInstanceApi {
1108
+ interface ContextFormInstanceApi<T> {
1109
+ setInputEnabled: (state: boolean) => void;
1110
+ isInputEnabled: () => boolean;
846
1111
  hide: () => void;
847
- getValue: () => string;
1112
+ back: () => void;
1113
+ getValue: () => T;
1114
+ setValue: (value: T) => void;
848
1115
  }
849
- interface ContextFormSpec extends ContextBarSpec {
850
- type?: 'contextform';
851
- initValue?: () => string;
1116
+ interface SizeData {
1117
+ width: string;
1118
+ height: string;
1119
+ }
1120
+ interface BaseContextFormSpec<T> extends ContextBarSpec {
1121
+ initValue?: () => T;
852
1122
  label?: string;
853
1123
  launch?: ContextFormLaunchButtonApi | ContextFormLaunchToggleButtonSpec;
854
- commands: Array<ContextFormToggleButtonSpec | ContextFormButtonSpec>;
855
- }
856
- interface ContextToolbarSpec extends ContextBarSpec {
857
- type?: 'contexttoolbar';
858
- items: string;
859
- }
860
- interface ChoiceMenuItemSpec extends CommonMenuItemSpec {
861
- type?: 'choiceitem';
862
- icon?: string;
863
- }
864
- interface ChoiceMenuItemInstanceApi extends CommonMenuItemInstanceApi {
865
- isActive: () => boolean;
866
- setActive: (state: boolean) => void;
867
- }
868
- interface ContextMenuItem extends CommonMenuItemSpec {
869
- text: string;
870
- icon?: string;
871
- type?: 'item';
872
- onAction: () => void;
873
- }
874
- interface ContextSubMenu extends CommonMenuItemSpec {
875
- type: 'submenu';
876
- text: string;
877
- icon?: string;
878
- getSubmenuItems: () => string | Array<ContextMenuContents>;
879
- }
880
- declare type ContextMenuContents = string | ContextMenuItem | SeparatorMenuItemSpec | ContextSubMenu;
881
- interface ContextMenuApi {
882
- update: (element: Element) => string | Array<ContextMenuContents>;
883
- }
884
- interface FancyActionArgsMap {
885
- 'inserttable': {
886
- numRows: number;
887
- numColumns: number;
888
- };
889
- 'colorswatch': {
890
- value: string;
891
- };
892
- }
893
- interface BaseFancyMenuItemSpec<T extends keyof FancyActionArgsMap> {
894
- type: 'fancymenuitem';
895
- fancytype: T;
896
- initData?: Record<string, unknown>;
897
- onAction?: (data: FancyActionArgsMap[T]) => void;
898
- }
899
- interface InsertTableMenuItemSpec extends BaseFancyMenuItemSpec<'inserttable'> {
900
- fancytype: 'inserttable';
901
- initData?: {};
902
- }
903
- interface ColorSwatchMenuItemSpec extends BaseFancyMenuItemSpec<'colorswatch'> {
904
- fancytype: 'colorswatch';
905
- initData?: {
906
- allowCustomColors?: boolean;
907
- colors: ChoiceMenuItemSpec[];
908
- };
909
- }
910
- declare type FancyMenuItemSpec = InsertTableMenuItemSpec | ColorSwatchMenuItemSpec;
911
- interface MenuItemSpec extends CommonMenuItemSpec {
912
- type?: 'menuitem';
913
- icon?: string;
914
- onSetup?: (api: MenuItemInstanceApi) => (api: MenuItemInstanceApi) => void;
915
- onAction?: (api: MenuItemInstanceApi) => void;
1124
+ commands: Array<ContextFormToggleButtonSpec<T> | ContextFormButtonSpec<T>>;
1125
+ onInput?: (api: ContextFormInstanceApi<T>) => void;
1126
+ onSetup?: (api: ContextFormInstanceApi<T>) => (api: ContextFormInstanceApi<T>) => void;
916
1127
  }
917
- interface MenuItemInstanceApi extends CommonMenuItemInstanceApi {
1128
+ interface ContextInputFormSpec extends BaseContextFormSpec<string> {
1129
+ type?: 'contextform';
1130
+ placeholder?: string;
918
1131
  }
919
- declare type NestedMenuItemContents = string | MenuItemSpec | NestedMenuItemSpec | ToggleMenuItemSpec | SeparatorMenuItemSpec | FancyMenuItemSpec;
920
- interface NestedMenuItemSpec extends CommonMenuItemSpec {
921
- type?: 'nestedmenuitem';
922
- icon?: string;
923
- getSubmenuItems: () => string | Array<NestedMenuItemContents>;
924
- onSetup?: (api: NestedMenuItemInstanceApi) => (api: NestedMenuItemInstanceApi) => void;
1132
+ interface ContextSliderFormSpec extends BaseContextFormSpec<number> {
1133
+ type: 'contextsliderform';
1134
+ min?: () => number;
1135
+ max?: () => number;
925
1136
  }
926
- interface NestedMenuItemInstanceApi extends CommonMenuItemInstanceApi {
1137
+ interface ContextSizeInputFormSpec extends BaseContextFormSpec<SizeData> {
1138
+ type: 'contextsizeinputform';
927
1139
  }
928
- interface ToggleMenuItemSpec extends CommonMenuItemSpec {
929
- type?: 'togglemenuitem';
930
- icon?: string;
931
- active?: boolean;
932
- onSetup?: (api: ToggleMenuItemInstanceApi) => void;
933
- onAction: (api: ToggleMenuItemInstanceApi) => void;
1140
+ type ContextFormSpec = ContextInputFormSpec | ContextSliderFormSpec | ContextSizeInputFormSpec;
1141
+ interface ToolbarGroupSpec {
1142
+ name?: string;
1143
+ label?: string;
1144
+ items: string[];
934
1145
  }
935
- interface ToggleMenuItemInstanceApi extends CommonMenuItemInstanceApi {
936
- isActive: () => boolean;
937
- setActive: (state: boolean) => void;
1146
+ interface ContextToolbarSpec extends ContextBarSpec {
1147
+ type?: 'contexttoolbar';
1148
+ items: string | ToolbarGroupSpec[];
938
1149
  }
939
1150
  type PublicDialog_d_AlertBannerSpec = AlertBannerSpec;
940
1151
  type PublicDialog_d_BarSpec = BarSpec;
@@ -950,11 +1161,11 @@ type PublicDialog_d_CustomEditorInit = CustomEditorInit;
950
1161
  type PublicDialog_d_CustomEditorInitFn = CustomEditorInitFn;
951
1162
  type PublicDialog_d_DialogData = DialogData;
952
1163
  type PublicDialog_d_DialogSize = DialogSize;
953
- type PublicDialog_d_DialogSpec<_0> = DialogSpec<_0>;
954
- type PublicDialog_d_DialogInstanceApi<_0> = DialogInstanceApi<_0>;
1164
+ type PublicDialog_d_DialogSpec<T extends DialogData> = DialogSpec<T>;
1165
+ type PublicDialog_d_DialogInstanceApi<T extends DialogData> = DialogInstanceApi<T>;
955
1166
  type PublicDialog_d_DialogFooterButtonSpec = DialogFooterButtonSpec;
956
1167
  type PublicDialog_d_DialogActionDetails = DialogActionDetails;
957
- type PublicDialog_d_DialogChangeDetails<_0> = DialogChangeDetails<_0>;
1168
+ type PublicDialog_d_DialogChangeDetails<T> = DialogChangeDetails<T>;
958
1169
  type PublicDialog_d_DialogTabChangeDetails = DialogTabChangeDetails;
959
1170
  type PublicDialog_d_DropZoneSpec = DropZoneSpec;
960
1171
  type PublicDialog_d_GridSpec = GridSpec;
@@ -976,6 +1187,8 @@ type PublicDialog_d_TableSpec = TableSpec;
976
1187
  type PublicDialog_d_TabSpec = TabSpec;
977
1188
  type PublicDialog_d_TabPanelSpec = TabPanelSpec;
978
1189
  type PublicDialog_d_TextAreaSpec = TextAreaSpec;
1190
+ type PublicDialog_d_TreeSpec = TreeSpec;
1191
+ type PublicDialog_d_TreeItemSpec = TreeItemSpec;
979
1192
  type PublicDialog_d_UrlInputData = UrlInputData;
980
1193
  type PublicDialog_d_UrlInputSpec = UrlInputSpec;
981
1194
  type PublicDialog_d_UrlDialogSpec = UrlDialogSpec;
@@ -984,7 +1197,7 @@ type PublicDialog_d_UrlDialogInstanceApi = UrlDialogInstanceApi;
984
1197
  type PublicDialog_d_UrlDialogActionDetails = UrlDialogActionDetails;
985
1198
  type PublicDialog_d_UrlDialogMessage = UrlDialogMessage;
986
1199
  declare namespace PublicDialog_d {
987
- 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, };
1200
+ 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_TreeSpec as TreeSpec, PublicDialog_d_TreeItemSpec as TreeItemSpec, DirectorySpec as TreeDirectorySpec, LeafSpec as TreeLeafSpec, 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, };
988
1201
  }
989
1202
  type PublicInlineContent_d_AutocompleterSpec = AutocompleterSpec;
990
1203
  type PublicInlineContent_d_AutocompleterItemSpec = AutocompleterItemSpec;
@@ -993,10 +1206,10 @@ type PublicInlineContent_d_AutocompleterInstanceApi = AutocompleterInstanceApi;
993
1206
  type PublicInlineContent_d_ContextPosition = ContextPosition;
994
1207
  type PublicInlineContent_d_ContextScope = ContextScope;
995
1208
  type PublicInlineContent_d_ContextFormSpec = ContextFormSpec;
996
- type PublicInlineContent_d_ContextFormInstanceApi = ContextFormInstanceApi;
997
- type PublicInlineContent_d_ContextFormButtonSpec = ContextFormButtonSpec;
1209
+ type PublicInlineContent_d_ContextFormInstanceApi<T> = ContextFormInstanceApi<T>;
1210
+ type PublicInlineContent_d_ContextFormButtonSpec<T> = ContextFormButtonSpec<T>;
998
1211
  type PublicInlineContent_d_ContextFormButtonInstanceApi = ContextFormButtonInstanceApi;
999
- type PublicInlineContent_d_ContextFormToggleButtonSpec = ContextFormToggleButtonSpec;
1212
+ type PublicInlineContent_d_ContextFormToggleButtonSpec<T> = ContextFormToggleButtonSpec<T>;
1000
1213
  type PublicInlineContent_d_ContextFormToggleButtonInstanceApi = ContextFormToggleButtonInstanceApi;
1001
1214
  type PublicInlineContent_d_ContextToolbarSpec = ContextToolbarSpec;
1002
1215
  type PublicInlineContent_d_SeparatorItemSpec = SeparatorItemSpec;
@@ -1044,63 +1257,6 @@ type PublicSidebar_d_SidebarInstanceApi = SidebarInstanceApi;
1044
1257
  declare namespace PublicSidebar_d {
1045
1258
  export { PublicSidebar_d_SidebarSpec as SidebarSpec, PublicSidebar_d_SidebarInstanceApi as SidebarInstanceApi, };
1046
1259
  }
1047
- interface ToolbarGroupSetting {
1048
- name: string;
1049
- items: string[];
1050
- }
1051
- declare type ToolbarConfig = string | ToolbarGroupSetting[];
1052
- interface GroupToolbarButtonInstanceApi extends BaseToolbarButtonInstanceApi {
1053
- }
1054
- interface GroupToolbarButtonSpec extends BaseToolbarButtonSpec<GroupToolbarButtonInstanceApi> {
1055
- type?: 'grouptoolbarbutton';
1056
- items?: ToolbarConfig;
1057
- }
1058
- declare type MenuButtonItemTypes = NestedMenuItemContents;
1059
- declare type SuccessCallback$1 = (menu: string | MenuButtonItemTypes[]) => void;
1060
- interface BaseMenuButtonSpec {
1061
- text?: string;
1062
- tooltip?: string;
1063
- icon?: string;
1064
- fetch: (success: SuccessCallback$1) => void;
1065
- onSetup?: (api: BaseMenuButtonInstanceApi) => (api: BaseMenuButtonInstanceApi) => void;
1066
- }
1067
- interface BaseMenuButtonInstanceApi {
1068
- isEnabled: () => boolean;
1069
- setEnabled: (state: boolean) => void;
1070
- isActive: () => boolean;
1071
- setActive: (state: boolean) => void;
1072
- }
1073
- interface ToolbarMenuButtonSpec extends BaseMenuButtonSpec {
1074
- type?: 'menubutton';
1075
- onSetup?: (api: ToolbarMenuButtonInstanceApi) => (api: ToolbarMenuButtonInstanceApi) => void;
1076
- }
1077
- interface ToolbarMenuButtonInstanceApi extends BaseMenuButtonInstanceApi {
1078
- }
1079
- declare type ToolbarSplitButtonItemTypes = ChoiceMenuItemSpec | SeparatorMenuItemSpec;
1080
- declare type SuccessCallback = (menu: ToolbarSplitButtonItemTypes[]) => void;
1081
- declare type SelectPredicate = (value: string) => boolean;
1082
- declare type PresetTypes = 'color' | 'normal' | 'listpreview';
1083
- declare type ColumnTypes = number | 'auto';
1084
- interface ToolbarSplitButtonSpec {
1085
- type?: 'splitbutton';
1086
- tooltip?: string;
1087
- icon?: string;
1088
- text?: string;
1089
- select?: SelectPredicate;
1090
- presets?: PresetTypes;
1091
- columns?: ColumnTypes;
1092
- fetch: (success: SuccessCallback) => void;
1093
- onSetup?: (api: ToolbarSplitButtonInstanceApi) => (api: ToolbarSplitButtonInstanceApi) => void;
1094
- onAction: (api: ToolbarSplitButtonInstanceApi) => void;
1095
- onItemAction: (api: ToolbarSplitButtonInstanceApi, value: string) => void;
1096
- }
1097
- interface ToolbarSplitButtonInstanceApi {
1098
- isEnabled: () => boolean;
1099
- setEnabled: (state: boolean) => void;
1100
- setIconFill: (id: string, value: string) => void;
1101
- isActive: () => boolean;
1102
- setActive: (state: boolean) => void;
1103
- }
1104
1260
  type PublicToolbar_d_ToolbarButtonSpec = ToolbarButtonSpec;
1105
1261
  type PublicToolbar_d_ToolbarButtonInstanceApi = ToolbarButtonInstanceApi;
1106
1262
  type PublicToolbar_d_ToolbarSplitButtonSpec = ToolbarSplitButtonSpec;
@@ -1114,6 +1270,50 @@ type PublicToolbar_d_GroupToolbarButtonInstanceApi = GroupToolbarButtonInstanceA
1114
1270
  declare namespace PublicToolbar_d {
1115
1271
  export { PublicToolbar_d_ToolbarButtonSpec as ToolbarButtonSpec, PublicToolbar_d_ToolbarButtonInstanceApi as ToolbarButtonInstanceApi, PublicToolbar_d_ToolbarSplitButtonSpec as ToolbarSplitButtonSpec, PublicToolbar_d_ToolbarSplitButtonInstanceApi as ToolbarSplitButtonInstanceApi, PublicToolbar_d_ToolbarMenuButtonSpec as ToolbarMenuButtonSpec, PublicToolbar_d_ToolbarMenuButtonInstanceApi as ToolbarMenuButtonInstanceApi, PublicToolbar_d_ToolbarToggleButtonSpec as ToolbarToggleButtonSpec, PublicToolbar_d_ToolbarToggleButtonInstanceApi as ToolbarToggleButtonInstanceApi, PublicToolbar_d_GroupToolbarButtonSpec as GroupToolbarButtonSpec, PublicToolbar_d_GroupToolbarButtonInstanceApi as GroupToolbarButtonInstanceApi, };
1116
1272
  }
1273
+ interface ViewButtonApi {
1274
+ setIcon: (newIcon: string) => void;
1275
+ }
1276
+ interface ViewToggleButtonApi extends ViewButtonApi {
1277
+ isActive: () => boolean;
1278
+ setActive: (state: boolean) => void;
1279
+ focus: () => void;
1280
+ }
1281
+ interface BaseButtonSpec<Api extends ViewButtonApi> {
1282
+ text?: string;
1283
+ icon?: string;
1284
+ tooltip?: string;
1285
+ buttonType?: 'primary' | 'secondary';
1286
+ borderless?: boolean;
1287
+ onAction: (api: Api) => void;
1288
+ context?: string;
1289
+ }
1290
+ interface ViewNormalButtonSpec extends BaseButtonSpec<ViewButtonApi> {
1291
+ text: string;
1292
+ type: 'button';
1293
+ }
1294
+ interface ViewToggleButtonSpec extends BaseButtonSpec<ViewToggleButtonApi> {
1295
+ type: 'togglebutton';
1296
+ active?: boolean;
1297
+ onAction: (api: ViewToggleButtonApi) => void;
1298
+ }
1299
+ interface ViewButtonsGroupSpec {
1300
+ type: 'group';
1301
+ buttons: Array<ViewNormalButtonSpec | ViewToggleButtonSpec>;
1302
+ }
1303
+ type ViewButtonSpec = ViewNormalButtonSpec | ViewToggleButtonSpec | ViewButtonsGroupSpec;
1304
+ interface ViewInstanceApi {
1305
+ getContainer: () => HTMLElement;
1306
+ }
1307
+ interface ViewSpec {
1308
+ buttons?: ViewButtonSpec[];
1309
+ onShow: (api: ViewInstanceApi) => void;
1310
+ onHide: (api: ViewInstanceApi) => void;
1311
+ }
1312
+ type PublicView_d_ViewSpec = ViewSpec;
1313
+ type PublicView_d_ViewInstanceApi = ViewInstanceApi;
1314
+ declare namespace PublicView_d {
1315
+ export { PublicView_d_ViewSpec as ViewSpec, PublicView_d_ViewInstanceApi as ViewInstanceApi, };
1316
+ }
1117
1317
  interface Registry$1 {
1118
1318
  addButton: (name: string, spec: ToolbarButtonSpec) => void;
1119
1319
  addGroupToolbarButton: (name: string, spec: GroupToolbarButtonSpec) => void;
@@ -1129,6 +1329,8 @@ interface Registry$1 {
1129
1329
  addIcon: (name: string, svgData: string) => void;
1130
1330
  addAutocompleter: (name: string, spec: AutocompleterSpec) => void;
1131
1331
  addSidebar: (name: string, spec: SidebarSpec) => void;
1332
+ addView: (name: string, spec: ViewSpec) => void;
1333
+ addContext: (name: string, pred: (args: string) => boolean) => void;
1132
1334
  getAll: () => {
1133
1335
  buttons: Record<string, ToolbarButtonSpec | GroupToolbarButtonSpec | ToolbarMenuButtonSpec | ToolbarSplitButtonSpec | ToolbarToggleButtonSpec>;
1134
1336
  menuItems: Record<string, MenuItemSpec | NestedMenuItemSpec | ToggleMenuItemSpec>;
@@ -1137,12 +1339,14 @@ interface Registry$1 {
1137
1339
  contextToolbars: Record<string, ContextToolbarSpec | ContextFormSpec>;
1138
1340
  icons: Record<string, string>;
1139
1341
  sidebars: Record<string, SidebarSpec>;
1342
+ views: Record<string, ViewSpec>;
1343
+ contexts: Record<string, (args: string) => boolean>;
1140
1344
  };
1141
1345
  }
1142
1346
  interface AutocompleteLookupData {
1143
1347
  readonly matchText: string;
1144
1348
  readonly items: AutocompleterContents[];
1145
- readonly columns: ColumnTypes$1;
1349
+ readonly columns: ColumnTypes;
1146
1350
  readonly onAction: (autoApi: AutocompleterInstanceApi, rng: Range, value: string, meta: Record<string, any>) => void;
1147
1351
  readonly highlightOn: string[];
1148
1352
  }
@@ -1155,12 +1359,12 @@ interface RangeLikeObject {
1155
1359
  endContainer: Node;
1156
1360
  endOffset: number;
1157
1361
  }
1158
- declare type ApplyFormat = BlockFormat | InlineFormat | SelectorFormat;
1159
- declare type RemoveFormat = RemoveBlockFormat | RemoveInlineFormat | RemoveSelectorFormat;
1160
- declare type Format = ApplyFormat | RemoveFormat;
1161
- declare type Formats = Record<string, Format | Format[]>;
1162
- declare type FormatAttrOrStyleValue = string | ((vars?: FormatVars) => string);
1163
- declare type FormatVars = Record<string, string | null>;
1362
+ type ApplyFormat = BlockFormat | InlineFormat | SelectorFormat;
1363
+ type RemoveFormat = RemoveBlockFormat | RemoveInlineFormat | RemoveSelectorFormat;
1364
+ type Format = ApplyFormat | RemoveFormat;
1365
+ type Formats = Record<string, Format | Format[]>;
1366
+ type FormatAttrOrStyleValue = string | ((vars?: FormatVars) => string | null);
1367
+ type FormatVars = Record<string, string | null>;
1164
1368
  interface BaseFormat<T> {
1165
1369
  ceFalseOverride?: boolean;
1166
1370
  classes?: string | string[];
@@ -1170,7 +1374,7 @@ interface BaseFormat<T> {
1170
1374
  links?: boolean;
1171
1375
  mixed?: boolean;
1172
1376
  block_expand?: boolean;
1173
- onmatch?: (node: Node, fmt: T, itemName: string) => boolean;
1377
+ onmatch?: (node: Element, fmt: T, itemName: string) => boolean;
1174
1378
  remove?: 'none' | 'empty' | 'all';
1175
1379
  remove_similar?: boolean;
1176
1380
  split?: boolean;
@@ -1194,7 +1398,7 @@ interface CommonFormat<T> extends BaseFormat<T> {
1194
1398
  styles?: Record<string, FormatAttrOrStyleValue>;
1195
1399
  toggle?: boolean;
1196
1400
  preview?: string | false;
1197
- onformat?: (elm: Node, fmt: T, vars?: FormatVars, node?: Node | RangeLikeObject) => void;
1401
+ onformat?: (elm: Element, fmt: T, vars?: FormatVars, node?: Node | RangeLikeObject | null) => void;
1198
1402
  clear_child_styles?: boolean;
1199
1403
  merge_siblings?: boolean;
1200
1404
  merge_with_parents?: boolean;
@@ -1229,7 +1433,7 @@ interface ParserArgs {
1229
1433
  no_events?: boolean;
1230
1434
  [key: string]: any;
1231
1435
  }
1232
- declare type ParserFilterCallback = (nodes: AstNode[], name: string, args: ParserArgs) => void;
1436
+ type ParserFilterCallback = (nodes: AstNode[], name: string, args: ParserArgs) => void;
1233
1437
  interface ParserFilter extends Filter<ParserFilterCallback> {
1234
1438
  }
1235
1439
  interface DomParserSettings {
@@ -1239,18 +1443,23 @@ interface DomParserSettings {
1239
1443
  allow_html_in_named_anchor?: boolean;
1240
1444
  allow_script_urls?: boolean;
1241
1445
  allow_unsafe_link_target?: boolean;
1446
+ allow_mathml_annotation_encodings?: string[];
1447
+ blob_cache?: BlobCache;
1242
1448
  convert_fonts_to_spans?: boolean;
1449
+ convert_unsafe_embeds?: boolean;
1450
+ document?: Document;
1243
1451
  fix_list_elements?: boolean;
1244
1452
  font_size_legacy_values?: string;
1245
1453
  forced_root_block?: boolean | string;
1246
1454
  forced_root_block_attrs?: Record<string, string>;
1455
+ inline_styles?: boolean;
1456
+ pad_empty_with_br?: boolean;
1247
1457
  preserve_cdata?: boolean;
1248
- remove_trailing_brs?: boolean;
1249
1458
  root_name?: string;
1459
+ sandbox_iframes?: boolean;
1460
+ sandbox_iframes_exclusions?: string[];
1461
+ sanitize?: boolean;
1250
1462
  validate?: boolean;
1251
- inline_styles?: boolean;
1252
- blob_cache?: BlobCache;
1253
- document?: Document;
1254
1463
  }
1255
1464
  interface DomParser {
1256
1465
  schema: Schema;
@@ -1269,12 +1478,15 @@ interface StyleSheetLoaderSettings {
1269
1478
  }
1270
1479
  interface StyleSheetLoader {
1271
1480
  load: (url: string) => Promise<void>;
1481
+ loadRawCss: (key: string, css: string) => void;
1272
1482
  loadAll: (urls: string[]) => Promise<string[]>;
1273
1483
  unload: (url: string) => void;
1484
+ unloadRawCss: (key: string) => void;
1274
1485
  unloadAll: (urls: string[]) => void;
1275
1486
  _setReferrerPolicy: (referrerPolicy: ReferrerPolicy) => void;
1487
+ _setContentCssCors: (contentCssCors: boolean) => void;
1276
1488
  }
1277
- declare type Registry = Registry$1;
1489
+ type Registry = Registry$1;
1278
1490
  interface EditorUiApi {
1279
1491
  show: () => void;
1280
1492
  hide: () => void;
@@ -1289,22 +1501,23 @@ type Ui_d_Registry = Registry;
1289
1501
  type Ui_d_EditorUiApi = EditorUiApi;
1290
1502
  type Ui_d_EditorUi = EditorUi;
1291
1503
  declare namespace Ui_d {
1292
- 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, };
1504
+ export { Ui_d_Registry as Registry, PublicDialog_d as Dialog, PublicInlineContent_d as InlineContent, PublicMenu_d as Menu, PublicView_d as View, PublicSidebar_d as Sidebar, PublicToolbar_d as Toolbar, Ui_d_EditorUiApi as EditorUiApi, Ui_d_EditorUi as EditorUi, };
1293
1505
  }
1294
1506
  interface WindowParams {
1295
- readonly inline?: 'cursor' | 'toolbar';
1507
+ readonly inline?: 'cursor' | 'toolbar' | 'bottom';
1296
1508
  readonly ariaAttrs?: boolean;
1509
+ readonly persistent?: boolean;
1297
1510
  }
1298
- declare type InstanceApi<T> = UrlDialogInstanceApi | DialogInstanceApi<T>;
1511
+ type InstanceApi<T extends DialogData> = UrlDialogInstanceApi | DialogInstanceApi<T>;
1299
1512
  interface WindowManagerImpl {
1300
- open: <T>(config: DialogSpec<T>, params: WindowParams, closeWindow: (dialog: DialogInstanceApi<T>) => void) => DialogInstanceApi<T>;
1513
+ open: <T extends DialogData>(config: DialogSpec<T>, params: WindowParams | undefined, closeWindow: (dialog: DialogInstanceApi<T>) => void) => DialogInstanceApi<T>;
1301
1514
  openUrl: (config: UrlDialogSpec, closeWindow: (dialog: UrlDialogInstanceApi) => void) => UrlDialogInstanceApi;
1302
1515
  alert: (message: string, callback: () => void) => void;
1303
1516
  confirm: (message: string, callback: (state: boolean) => void) => void;
1304
1517
  close: (dialog: InstanceApi<any>) => void;
1305
1518
  }
1306
1519
  interface WindowManager {
1307
- open: <T>(config: DialogSpec<T>, params?: WindowParams) => DialogInstanceApi<T>;
1520
+ open: <T extends DialogData>(config: DialogSpec<T>, params?: WindowParams) => DialogInstanceApi<T>;
1308
1521
  openUrl: (config: UrlDialogSpec) => UrlDialogInstanceApi;
1309
1522
  alert: (message: string, callback?: () => void, scope?: any) => void;
1310
1523
  confirm: (message: string, callback?: (state: boolean) => void, scope?: any) => void;
@@ -1312,7 +1525,7 @@ interface WindowManager {
1312
1525
  }
1313
1526
  interface ExecCommandEvent {
1314
1527
  command: string;
1315
- ui?: boolean;
1528
+ ui: boolean;
1316
1529
  value?: any;
1317
1530
  }
1318
1531
  interface BeforeGetContentEvent extends GetContentArgs {
@@ -1328,6 +1541,9 @@ interface BeforeSetContentEvent extends SetContentArgs {
1328
1541
  interface SetContentEvent extends BeforeSetContentEvent {
1329
1542
  content: string;
1330
1543
  }
1544
+ interface SaveContentEvent extends GetContentEvent {
1545
+ save: boolean;
1546
+ }
1331
1547
  interface NewBlockEvent {
1332
1548
  newBlock: Element;
1333
1549
  }
@@ -1340,7 +1556,7 @@ interface NodeChangeEvent {
1340
1556
  interface FormatEvent {
1341
1557
  format: string;
1342
1558
  vars?: FormatVars;
1343
- node?: Node | RangeLikeObject;
1559
+ node?: Node | RangeLikeObject | null;
1344
1560
  }
1345
1561
  interface ObjectResizeEvent {
1346
1562
  target: HTMLElement;
@@ -1354,11 +1570,11 @@ interface ObjectSelectedEvent {
1354
1570
  }
1355
1571
  interface ScrollIntoViewEvent {
1356
1572
  elm: HTMLElement;
1357
- alignToTop: boolean;
1573
+ alignToTop: boolean | undefined;
1358
1574
  }
1359
1575
  interface SetSelectionRangeEvent {
1360
1576
  range: Range;
1361
- forward: boolean;
1577
+ forward: boolean | undefined;
1362
1578
  }
1363
1579
  interface ShowCaretEvent {
1364
1580
  target: Node;
@@ -1368,10 +1584,12 @@ interface ShowCaretEvent {
1368
1584
  interface SwitchModeEvent {
1369
1585
  mode: string;
1370
1586
  }
1371
- interface AddUndoEvent {
1587
+ interface ChangeEvent {
1372
1588
  level: UndoLevel;
1373
- lastLevel: UndoLevel;
1374
- originalEvent: Event;
1589
+ lastLevel: UndoLevel | undefined;
1590
+ }
1591
+ interface AddUndoEvent extends ChangeEvent {
1592
+ originalEvent: Event | undefined;
1375
1593
  }
1376
1594
  interface UndoRedoEvent {
1377
1595
  level: UndoLevel;
@@ -1409,6 +1627,9 @@ interface PastePostProcessEvent {
1409
1627
  node: HTMLElement;
1410
1628
  readonly internal: boolean;
1411
1629
  }
1630
+ interface EditableRootStateChangeEvent {
1631
+ state: boolean;
1632
+ }
1412
1633
  interface NewTableRowEvent {
1413
1634
  node: HTMLTableRowElement;
1414
1635
  }
@@ -1422,21 +1643,32 @@ interface TableEventData {
1422
1643
  interface TableModifiedEvent extends TableEventData {
1423
1644
  readonly table: HTMLTableElement;
1424
1645
  }
1646
+ interface BeforeOpenNotificationEvent {
1647
+ notification: NotificationSpec;
1648
+ }
1649
+ interface OpenNotificationEvent {
1650
+ notification: NotificationApi;
1651
+ }
1652
+ interface DisabledStateChangeEvent {
1653
+ readonly state: boolean;
1654
+ }
1425
1655
  interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> {
1426
1656
  'activate': {
1427
- relatedTarget: Editor;
1657
+ relatedTarget: Editor | null;
1428
1658
  };
1429
1659
  'deactivate': {
1430
1660
  relatedTarget: Editor;
1431
1661
  };
1432
1662
  'focus': {
1433
- blurredEditor: Editor;
1663
+ blurredEditor: Editor | null;
1434
1664
  };
1435
1665
  'blur': {
1436
- focusedEditor: Editor;
1666
+ focusedEditor: Editor | null;
1437
1667
  };
1438
1668
  'resize': UIEvent;
1439
1669
  'scroll': UIEvent;
1670
+ 'input': InputEvent;
1671
+ 'beforeinput': InputEvent;
1440
1672
  'detach': {};
1441
1673
  'remove': {};
1442
1674
  'init': {};
@@ -1445,7 +1677,7 @@ interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> {
1445
1677
  'ObjectResized': ObjectResizeEvent;
1446
1678
  'ObjectResizeStart': ObjectResizeEvent;
1447
1679
  'SwitchMode': SwitchModeEvent;
1448
- 'ScrollWindow': UIEvent;
1680
+ 'ScrollWindow': Event;
1449
1681
  'ResizeWindow': UIEvent;
1450
1682
  'SkinLoaded': {};
1451
1683
  'SkinLoadError': LoadErrorEvent;
@@ -1472,7 +1704,12 @@ interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> {
1472
1704
  'GetContent': GetContentEvent;
1473
1705
  'BeforeSetContent': BeforeSetContentEvent;
1474
1706
  'SetContent': SetContentEvent;
1475
- 'LoadContent': {};
1707
+ 'SaveContent': SaveContentEvent;
1708
+ 'RawSaveContent': SaveContentEvent;
1709
+ 'LoadContent': {
1710
+ load: boolean;
1711
+ element: HTMLElement;
1712
+ };
1476
1713
  'PreviewFormats': {};
1477
1714
  'AfterPreviewFormats': {};
1478
1715
  'ScriptsLoaded': {};
@@ -1485,6 +1722,7 @@ interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> {
1485
1722
  'Undo': UndoRedoEvent;
1486
1723
  'BeforeAddUndo': AddUndoEvent;
1487
1724
  'AddUndo': AddUndoEvent;
1725
+ 'change': ChangeEvent;
1488
1726
  'CloseWindow': WindowEvent<any>;
1489
1727
  'OpenWindow': WindowEvent<any>;
1490
1728
  'ProgressState': ProgressStateEvent;
@@ -1504,6 +1742,12 @@ interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> {
1504
1742
  'TableModified': TableModifiedEvent;
1505
1743
  'NewRow': NewTableRowEvent;
1506
1744
  'NewCell': NewTableCellEvent;
1745
+ 'SetAttrib': SetAttribEvent;
1746
+ 'hide': {};
1747
+ 'show': {};
1748
+ 'dirty': {};
1749
+ 'BeforeOpenNotification': BeforeOpenNotificationEvent;
1750
+ 'OpenNotification': OpenNotificationEvent;
1507
1751
  }
1508
1752
  interface EditorManagerEventMap {
1509
1753
  'AddEditor': {
@@ -1521,6 +1765,7 @@ type EventTypes_d_BeforeGetContentEvent = BeforeGetContentEvent;
1521
1765
  type EventTypes_d_GetContentEvent = GetContentEvent;
1522
1766
  type EventTypes_d_BeforeSetContentEvent = BeforeSetContentEvent;
1523
1767
  type EventTypes_d_SetContentEvent = SetContentEvent;
1768
+ type EventTypes_d_SaveContentEvent = SaveContentEvent;
1524
1769
  type EventTypes_d_NewBlockEvent = NewBlockEvent;
1525
1770
  type EventTypes_d_NodeChangeEvent = NodeChangeEvent;
1526
1771
  type EventTypes_d_FormatEvent = FormatEvent;
@@ -1530,9 +1775,10 @@ type EventTypes_d_ScrollIntoViewEvent = ScrollIntoViewEvent;
1530
1775
  type EventTypes_d_SetSelectionRangeEvent = SetSelectionRangeEvent;
1531
1776
  type EventTypes_d_ShowCaretEvent = ShowCaretEvent;
1532
1777
  type EventTypes_d_SwitchModeEvent = SwitchModeEvent;
1778
+ type EventTypes_d_ChangeEvent = ChangeEvent;
1533
1779
  type EventTypes_d_AddUndoEvent = AddUndoEvent;
1534
1780
  type EventTypes_d_UndoRedoEvent = UndoRedoEvent;
1535
- type EventTypes_d_WindowEvent<_0> = WindowEvent<_0>;
1781
+ type EventTypes_d_WindowEvent<T extends DialogData> = WindowEvent<T>;
1536
1782
  type EventTypes_d_ProgressStateEvent = ProgressStateEvent;
1537
1783
  type EventTypes_d_AfterProgressStateEvent = AfterProgressStateEvent;
1538
1784
  type EventTypes_d_PlaceholderToggleEvent = PlaceholderToggleEvent;
@@ -1542,14 +1788,18 @@ type EventTypes_d_PostProcessEvent = PostProcessEvent;
1542
1788
  type EventTypes_d_PastePlainTextToggleEvent = PastePlainTextToggleEvent;
1543
1789
  type EventTypes_d_PastePreProcessEvent = PastePreProcessEvent;
1544
1790
  type EventTypes_d_PastePostProcessEvent = PastePostProcessEvent;
1791
+ type EventTypes_d_EditableRootStateChangeEvent = EditableRootStateChangeEvent;
1545
1792
  type EventTypes_d_NewTableRowEvent = NewTableRowEvent;
1546
1793
  type EventTypes_d_NewTableCellEvent = NewTableCellEvent;
1547
1794
  type EventTypes_d_TableEventData = TableEventData;
1548
1795
  type EventTypes_d_TableModifiedEvent = TableModifiedEvent;
1796
+ type EventTypes_d_BeforeOpenNotificationEvent = BeforeOpenNotificationEvent;
1797
+ type EventTypes_d_OpenNotificationEvent = OpenNotificationEvent;
1798
+ type EventTypes_d_DisabledStateChangeEvent = DisabledStateChangeEvent;
1549
1799
  type EventTypes_d_EditorEventMap = EditorEventMap;
1550
1800
  type EventTypes_d_EditorManagerEventMap = EditorManagerEventMap;
1551
1801
  declare namespace EventTypes_d {
1552
- 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, };
1802
+ 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_SaveContentEvent as SaveContentEvent, 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_ChangeEvent as ChangeEvent, 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_EditableRootStateChangeEvent as EditableRootStateChangeEvent, EventTypes_d_NewTableRowEvent as NewTableRowEvent, EventTypes_d_NewTableCellEvent as NewTableCellEvent, EventTypes_d_TableEventData as TableEventData, EventTypes_d_TableModifiedEvent as TableModifiedEvent, EventTypes_d_BeforeOpenNotificationEvent as BeforeOpenNotificationEvent, EventTypes_d_OpenNotificationEvent as OpenNotificationEvent, EventTypes_d_DisabledStateChangeEvent as DisabledStateChangeEvent, EventTypes_d_EditorEventMap as EditorEventMap, EventTypes_d_EditorManagerEventMap as EditorManagerEventMap, };
1553
1803
  }
1554
1804
  type Format_d_Formats = Formats;
1555
1805
  type Format_d_Format = Format;
@@ -1564,8 +1814,8 @@ type Format_d_RemoveSelectorFormat = RemoveSelectorFormat;
1564
1814
  declare namespace Format_d {
1565
1815
  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, };
1566
1816
  }
1567
- declare type StyleFormat = BlockStyleFormat | InlineStyleFormat | SelectorStyleFormat;
1568
- declare type AllowedFormat = Separator | FormatReference | StyleFormat | NestedFormatting;
1817
+ type StyleFormat = BlockStyleFormat | InlineStyleFormat | SelectorStyleFormat;
1818
+ type AllowedFormat = Separator | FormatReference | StyleFormat | NestedFormatting;
1569
1819
  interface Separator {
1570
1820
  title: string;
1571
1821
  }
@@ -1589,38 +1839,40 @@ interface InlineStyleFormat extends InlineFormat, CommonStyleFormat {
1589
1839
  }
1590
1840
  interface SelectorStyleFormat extends SelectorFormat, CommonStyleFormat {
1591
1841
  }
1592
- declare type EntityEncoding = 'named' | 'numeric' | 'raw' | 'named,numeric' | 'named+numeric' | 'numeric,named' | 'numeric+named';
1842
+ type EntityEncoding = 'named' | 'numeric' | 'raw' | 'named,numeric' | 'named+numeric' | 'numeric,named' | 'numeric+named';
1593
1843
  interface ContentLanguage {
1594
1844
  readonly title: string;
1595
1845
  readonly code: string;
1596
1846
  readonly customCode?: string;
1597
1847
  }
1598
- declare type ThemeInitFunc = (editor: Editor, elm: HTMLElement) => {
1848
+ type ThemeInitFunc = (editor: Editor, elm: HTMLElement) => {
1599
1849
  editorContainer: HTMLElement;
1600
1850
  iframeContainer: HTMLElement;
1601
1851
  height?: number;
1602
1852
  iframeHeight?: number;
1603
1853
  api?: EditorUiApi;
1604
1854
  };
1605
- declare type SetupCallback = (editor: Editor) => void;
1606
- declare type FilePickerCallback = (callback: Function, value: any, meta: Record<string, any>) => void;
1607
- declare type FilePickerValidationStatus = 'valid' | 'unknown' | 'invalid' | 'none';
1608
- declare type FilePickerValidationCallback = (info: {
1855
+ type SetupCallback = (editor: Editor) => void;
1856
+ type FilePickerCallback = (callback: (value: string, meta?: Record<string, any>) => void, value: string, meta: Record<string, any>) => void;
1857
+ type FilePickerValidationStatus = 'valid' | 'unknown' | 'invalid' | 'none';
1858
+ type FilePickerValidationCallback = (info: {
1609
1859
  type: string;
1610
1860
  url: string;
1611
1861
  }, callback: (validation: {
1612
1862
  status: FilePickerValidationStatus;
1613
1863
  message: string;
1614
1864
  }) => void) => void;
1615
- declare type PastePreProcessFn = (editor: Editor, args: PastePreProcessEvent) => void;
1616
- declare type PastePostProcessFn = (editor: Editor, args: PastePostProcessEvent) => void;
1617
- declare type URLConverter = (url: string, name: string, elm?: HTMLElement) => string;
1618
- declare type URLConverterCallback = (url: string, node: Node, on_save: boolean, name: string) => string;
1865
+ type PastePreProcessFn = (editor: Editor, args: PastePreProcessEvent) => void;
1866
+ type PastePostProcessFn = (editor: Editor, args: PastePostProcessEvent) => void;
1867
+ type URLConverter = (url: string, name: string, elm?: string | Element) => string;
1868
+ type URLConverterCallback = (url: string, node: Node | string | undefined, on_save: boolean, name: string) => string;
1619
1869
  interface ToolbarGroup {
1620
1870
  name?: string;
1871
+ label?: string;
1621
1872
  items: string[];
1622
1873
  }
1623
- declare type ToolbarMode = 'floating' | 'sliding' | 'scrolling' | 'wrap';
1874
+ type ToolbarMode = 'floating' | 'sliding' | 'scrolling' | 'wrap';
1875
+ type ToolbarLocation = 'top' | 'bottom' | 'auto';
1624
1876
  interface BaseEditorOptions {
1625
1877
  a11y_advanced_options?: boolean;
1626
1878
  add_form_submit_trigger?: boolean;
@@ -1646,7 +1898,13 @@ interface BaseEditorOptions {
1646
1898
  branding?: boolean;
1647
1899
  cache_suffix?: string;
1648
1900
  color_cols?: number;
1901
+ color_cols_foreground?: number;
1902
+ color_cols_background?: number;
1649
1903
  color_map?: string[];
1904
+ color_map_foreground?: string[];
1905
+ color_map_background?: string[];
1906
+ color_default_foreground?: string;
1907
+ color_default_background?: string;
1650
1908
  content_css?: boolean | string | string[];
1651
1909
  content_css_cors?: boolean;
1652
1910
  content_security_policy?: string;
@@ -1655,16 +1913,20 @@ interface BaseEditorOptions {
1655
1913
  contextmenu?: string | string[] | false;
1656
1914
  contextmenu_never_use_native?: boolean;
1657
1915
  convert_fonts_to_spans?: boolean;
1916
+ convert_unsafe_embeds?: boolean;
1658
1917
  convert_urls?: boolean;
1659
1918
  custom_colors?: boolean;
1660
- custom_elements?: string;
1919
+ custom_elements?: string | Record<string, CustomElementSpec>;
1661
1920
  custom_ui_selector?: string;
1662
1921
  custom_undo_redo_levels?: number;
1922
+ default_font_stack?: string[];
1663
1923
  deprecation_warnings?: boolean;
1664
1924
  directionality?: 'ltr' | 'rtl';
1665
1925
  doctype?: string;
1666
1926
  document_base_url?: string;
1927
+ draggable_modal?: boolean;
1667
1928
  editable_class?: string;
1929
+ editable_root?: boolean;
1668
1930
  element_format?: 'xhtml' | 'html';
1669
1931
  elementpath?: boolean;
1670
1932
  encoding?: string;
@@ -1685,11 +1947,15 @@ interface BaseEditorOptions {
1685
1947
  font_size_legacy_values?: string;
1686
1948
  font_size_style_values?: string;
1687
1949
  font_size_formats?: string;
1950
+ font_size_input_default_unit?: string;
1688
1951
  forced_root_block?: string;
1689
1952
  forced_root_block_attrs?: Record<string, string>;
1690
1953
  formats?: Formats;
1954
+ format_noneditable_selector?: string;
1691
1955
  height?: number | string;
1956
+ help_accessibility?: boolean;
1692
1957
  hidden_input?: boolean;
1958
+ highlight_on_focus?: boolean;
1693
1959
  icons?: string;
1694
1960
  icons_url?: string;
1695
1961
  id?: string;
@@ -1730,12 +1996,14 @@ interface BaseEditorOptions {
1730
1996
  min_width?: number;
1731
1997
  model?: string;
1732
1998
  model_url?: string;
1999
+ newdocument_content?: string;
1733
2000
  newline_behavior?: 'block' | 'linebreak' | 'invert' | 'default';
1734
2001
  no_newline_selector?: string;
1735
2002
  noneditable_class?: string;
1736
2003
  noneditable_regexp?: RegExp | RegExp[];
1737
2004
  nowrap?: boolean;
1738
2005
  object_resizing?: boolean | string;
2006
+ pad_empty_with_br?: boolean;
1739
2007
  paste_as_text?: boolean;
1740
2008
  paste_block_drop?: boolean;
1741
2009
  paste_data_images?: boolean;
@@ -1748,6 +2016,7 @@ interface BaseEditorOptions {
1748
2016
  placeholder?: string;
1749
2017
  preserve_cdata?: boolean;
1750
2018
  preview_styles?: false | string;
2019
+ promotion?: boolean;
1751
2020
  protect?: RegExp[];
1752
2021
  readonly?: boolean;
1753
2022
  referrer_policy?: ReferrerPolicy;
@@ -1758,6 +2027,8 @@ interface BaseEditorOptions {
1758
2027
  resize?: boolean | 'both';
1759
2028
  resize_img_proportional?: boolean;
1760
2029
  root_name?: string;
2030
+ sandbox_iframes?: boolean;
2031
+ sandbox_iframes_exclusions?: string[];
1761
2032
  schema?: SchemaType;
1762
2033
  selector?: string;
1763
2034
  setup?: SetupCallback;
@@ -1774,6 +2045,7 @@ interface BaseEditorOptions {
1774
2045
  table_tab_navigation?: boolean;
1775
2046
  target?: HTMLElement;
1776
2047
  text_patterns?: RawPattern[] | false;
2048
+ text_patterns_lookup?: RawDynamicPatternsLookup;
1777
2049
  theme?: string | ThemeInitFunc | false;
1778
2050
  theme_url?: string;
1779
2051
  toolbar?: boolean | string | string[] | Array<ToolbarGroup>;
@@ -1786,10 +2058,13 @@ interface BaseEditorOptions {
1786
2058
  toolbar7?: string;
1787
2059
  toolbar8?: string;
1788
2060
  toolbar9?: string;
2061
+ toolbar_groups?: Record<string, GroupToolbarButtonSpec>;
2062
+ toolbar_location?: ToolbarLocation;
1789
2063
  toolbar_mode?: ToolbarMode;
1790
2064
  toolbar_sticky?: boolean;
1791
2065
  toolbar_sticky_offset?: number;
1792
2066
  typeahead_urls?: boolean;
2067
+ ui_mode?: 'combined' | 'split';
1793
2068
  url_converter?: URLConverter;
1794
2069
  url_converter_scope?: any;
1795
2070
  urlconverter_callback?: URLConverterCallback;
@@ -1802,6 +2077,9 @@ interface BaseEditorOptions {
1802
2077
  visual_anchor_class?: string;
1803
2078
  visual_table_class?: string;
1804
2079
  width?: number | string;
2080
+ xss_sanitization?: boolean;
2081
+ license_key?: string;
2082
+ disabled?: boolean;
1805
2083
  disable_nodechange?: boolean;
1806
2084
  forced_plugins?: string | string[];
1807
2085
  plugin_base_urls?: Record<string, string>;
@@ -1819,17 +2097,92 @@ interface NormalizedEditorOptions extends BaseEditorOptions {
1819
2097
  plugins: string[];
1820
2098
  }
1821
2099
  interface EditorOptions extends NormalizedEditorOptions {
2100
+ a11y_advanced_options: boolean;
2101
+ allow_unsafe_link_target: boolean;
2102
+ anchor_bottom: string;
2103
+ anchor_top: string;
2104
+ automatic_uploads: boolean;
2105
+ block_formats: string;
2106
+ body_class: string;
2107
+ body_id: string;
2108
+ br_newline_selector: string;
2109
+ color_map: string[];
2110
+ color_cols: number;
2111
+ color_cols_foreground: number;
2112
+ color_cols_background: number;
2113
+ color_default_background: string;
2114
+ color_default_foreground: string;
1822
2115
  content_css: string[];
1823
2116
  contextmenu: string[];
2117
+ convert_unsafe_embeds: boolean;
2118
+ custom_colors: boolean;
2119
+ default_font_stack: string[];
2120
+ document_base_url: string;
2121
+ init_content_sync: boolean;
2122
+ draggable_modal: boolean;
2123
+ editable_class: string;
2124
+ editable_root: boolean;
1824
2125
  font_css: string[];
2126
+ font_family_formats: string;
2127
+ font_size_classes: string;
2128
+ font_size_formats: string;
2129
+ font_size_input_default_unit: string;
2130
+ font_size_legacy_values: string;
2131
+ font_size_style_values: string;
1825
2132
  forced_root_block: string;
1826
2133
  forced_root_block_attrs: Record<string, string>;
2134
+ format_noneditable_selector: string;
2135
+ height: number | string;
2136
+ highlight_on_focus: boolean;
2137
+ iframe_attrs: Record<string, string>;
2138
+ images_file_types: string;
2139
+ images_upload_base_path: string;
2140
+ images_upload_credentials: boolean;
2141
+ images_upload_url: string;
2142
+ indent_use_margin: boolean;
2143
+ indentation: string;
2144
+ inline: boolean;
2145
+ inline_boundaries_selector: string;
2146
+ language: string;
2147
+ language_load: boolean;
2148
+ language_url: string;
2149
+ line_height_formats: string;
2150
+ menu: Record<string, {
2151
+ title: string;
2152
+ items: string;
2153
+ }>;
2154
+ menubar: boolean | string;
2155
+ model: string;
2156
+ newdocument_content: string;
2157
+ no_newline_selector: string;
2158
+ noneditable_class: string;
1827
2159
  noneditable_regexp: RegExp[];
1828
- object_resizing?: string;
1829
- preview_styles?: string;
1830
- text_patterns?: Pattern[];
1831
- }
1832
- declare type StyleMap = Record<string, string | number>;
2160
+ object_resizing: string;
2161
+ pad_empty_with_br: boolean;
2162
+ paste_as_text: boolean;
2163
+ preview_styles: string;
2164
+ promotion: boolean;
2165
+ readonly: boolean;
2166
+ removed_menuitems: string;
2167
+ sandbox_iframes: boolean;
2168
+ sandbox_iframes_exclusions: string[];
2169
+ toolbar: boolean | string | string[] | Array<ToolbarGroup>;
2170
+ toolbar_groups: Record<string, GroupToolbarButtonSpec>;
2171
+ toolbar_location: ToolbarLocation;
2172
+ toolbar_mode: ToolbarMode;
2173
+ toolbar_persist: boolean;
2174
+ toolbar_sticky: boolean;
2175
+ toolbar_sticky_offset: number;
2176
+ text_patterns: Pattern[];
2177
+ text_patterns_lookup: DynamicPatternsLookup;
2178
+ visual: boolean;
2179
+ visual_anchor_class: string;
2180
+ visual_table_class: string;
2181
+ width: number | string;
2182
+ xss_sanitization: boolean;
2183
+ disabled: boolean;
2184
+ }
2185
+ type StyleMap = Record<string, string | number>;
1833
2186
  interface StylesSettings {
1834
2187
  allow_script_urls?: boolean;
1835
2188
  allow_svg_data_urls?: boolean;
@@ -1837,13 +2190,22 @@ interface StylesSettings {
1837
2190
  url_converter_scope?: any;
1838
2191
  }
1839
2192
  interface Styles {
1840
- parse: (css: string) => Record<string, string>;
2193
+ parse: (css: string | undefined) => Record<string, string>;
1841
2194
  serialize: (styles: StyleMap, elementName?: string) => string;
1842
2195
  }
1843
- declare type EventUtilsCallback<T> = (event: EventUtilsEvent<T>) => void;
1844
- declare type EventUtilsEvent<T> = NormalizedEvent<T> & {
2196
+ type EventUtilsCallback<T> = (event: EventUtilsEvent<T>) => void | boolean;
2197
+ type EventUtilsEvent<T> = NormalizedEvent<T> & {
1845
2198
  metaKey: boolean;
1846
2199
  };
2200
+ interface Callback$1<T> {
2201
+ func: EventUtilsCallback<T>;
2202
+ scope: any;
2203
+ }
2204
+ interface CallbackList<T> extends Array<Callback$1<T>> {
2205
+ fakeName: string | false;
2206
+ capture: boolean;
2207
+ nativeHandler: EventListener;
2208
+ }
1847
2209
  interface EventUtilsConstructor {
1848
2210
  readonly prototype: EventUtils;
1849
2211
  new (): EventUtils;
@@ -1852,11 +2214,9 @@ interface EventUtilsConstructor {
1852
2214
  declare class EventUtils {
1853
2215
  static Event: EventUtils;
1854
2216
  domLoaded: boolean;
1855
- events: Record<string, any>;
2217
+ events: Record<number, Record<string, CallbackList<any>>>;
1856
2218
  private readonly expando;
1857
2219
  private hasFocusIn;
1858
- private hasMouseEnterLeave;
1859
- private mouseEnterLeave;
1860
2220
  private count;
1861
2221
  constructor();
1862
2222
  bind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback: EventUtilsCallback<HTMLElementEventMap[K]>, scope?: any): EventUtilsCallback<HTMLElementEventMap[K]>;
@@ -1868,9 +2228,14 @@ declare class EventUtils {
1868
2228
  dispatch(target: any, name: string, args?: {}): this;
1869
2229
  clean(target: any): this;
1870
2230
  destroy(): void;
1871
- cancel<T = any>(e: EventUtilsEvent<T>): boolean;
2231
+ cancel<T>(e: EventUtilsEvent<T>): boolean;
1872
2232
  private executeHandlers;
1873
2233
  }
2234
+ interface SetAttribEvent {
2235
+ attrElm: HTMLElement;
2236
+ attrName: string;
2237
+ attrValue: string | boolean | number | null;
2238
+ }
1874
2239
  interface DOMUtilsSettings {
1875
2240
  schema: Schema;
1876
2241
  url_converter: URLConverter;
@@ -1878,22 +2243,22 @@ interface DOMUtilsSettings {
1878
2243
  ownEvents: boolean;
1879
2244
  keep_values: boolean;
1880
2245
  update_styles: boolean;
1881
- root_element: HTMLElement;
1882
- collect: Function;
1883
- onSetAttrib: Function;
2246
+ root_element: HTMLElement | null;
2247
+ collect: boolean;
2248
+ onSetAttrib: (event: SetAttribEvent) => void;
1884
2249
  contentCssCors: boolean;
1885
2250
  referrerPolicy: ReferrerPolicy;
1886
2251
  }
1887
- declare type Target = Node | Window;
1888
- declare type RunArguments<T extends Node = Node> = string | T | Array<string | T>;
1889
- declare type BoundEvent = [
2252
+ type Target = Node | Window;
2253
+ type RunArguments<T extends Node = Node> = string | T | Array<string | T> | null;
2254
+ type BoundEvent = [
1890
2255
  Target,
1891
2256
  string,
1892
2257
  EventUtilsCallback<any>,
1893
2258
  any
1894
2259
  ];
1895
- declare type Callback<K extends string> = EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>;
1896
- declare type RunResult<T, R> = T extends Array<any> ? false | R[] : false | R;
2260
+ type Callback<K extends string> = EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>;
2261
+ type RunResult<T, R> = T extends Array<any> ? R[] : false | R;
1897
2262
  interface DOMUtils {
1898
2263
  doc: Document;
1899
2264
  settings: Partial<DOMUtilsSettings>;
@@ -1906,8 +2271,11 @@ interface DOMUtils {
1906
2271
  styles: Styles;
1907
2272
  schema: Schema;
1908
2273
  events: EventUtils;
1909
- root: Node;
1910
- isBlock: (node: string | Node) => boolean;
2274
+ root: Node | null;
2275
+ isBlock: {
2276
+ (node: Node | null): node is HTMLElement;
2277
+ (node: string): boolean;
2278
+ };
1911
2279
  clone: (node: Node, deep: boolean) => Node;
1912
2280
  getRoot: () => HTMLElement;
1913
2281
  getViewPort: (argWin?: Window) => GeomRect;
@@ -1917,39 +2285,52 @@ interface DOMUtils {
1917
2285
  h: number;
1918
2286
  };
1919
2287
  getParent: {
1920
- <K extends keyof HTMLElementTagNameMap>(node: string | Node, selector: K, root?: Node): HTMLElementTagNameMap[K] | null;
1921
- <T extends HTMLElement>(node: string | Node, selector: (node: HTMLElement) => node is T, root?: Node): T | null;
1922
- <T extends Element = Element>(node: string | Node, selector?: string | ((node: HTMLElement) => boolean | void), root?: Node): T | null;
2288
+ <K extends keyof HTMLElementTagNameMap>(node: string | Node | null, selector: K, root?: Node): HTMLElementTagNameMap[K] | null;
2289
+ <T extends Element>(node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node): T | null;
2290
+ (node: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node): Node | null;
1923
2291
  };
1924
2292
  getParents: {
1925
- <K extends keyof HTMLElementTagNameMap>(elm: string | Node, selector: K, root?: Node, collect?: boolean): Array<HTMLElementTagNameMap[K]>;
1926
- <T extends HTMLElement>(node: string | Node, selector: (node: HTMLElement) => node is T, root?: Node): T[];
1927
- <T extends Element = Element>(elm: string | Node, selector?: string | ((node: HTMLElement) => boolean | void), root?: Node, collect?: boolean): T[];
2293
+ <K extends keyof HTMLElementTagNameMap>(elm: string | HTMLElementTagNameMap[K] | null, selector: K, root?: Node, collect?: boolean): Array<HTMLElementTagNameMap[K]>;
2294
+ <T extends Element>(node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node, collect?: boolean): T[];
2295
+ (elm: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node, collect?: boolean): Node[];
2296
+ };
2297
+ get: {
2298
+ <T extends Node>(elm: T): T;
2299
+ (elm: string): HTMLElement | null;
1928
2300
  };
1929
- get: (elm: string | Node) => HTMLElement | null;
1930
- getNext: (node: Node, selector: string | ((node: Node) => boolean)) => Node | null;
1931
- getPrev: (node: Node, selector: string | ((node: Node) => boolean)) => Node | null;
2301
+ getNext: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null;
2302
+ getPrev: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null;
1932
2303
  select: {
1933
2304
  <K extends keyof HTMLElementTagNameMap>(selector: K, scope?: string | Node): Array<HTMLElementTagNameMap[K]>;
1934
2305
  <T extends HTMLElement = HTMLElement>(selector: string, scope?: string | Node): T[];
1935
2306
  };
1936
- is: (elm: Node | Node[], selector: string) => boolean;
1937
- add: (parentElm: RunArguments, name: string | Node, attrs?: Record<string, string | boolean | number>, html?: string | Node, create?: boolean) => HTMLElement;
2307
+ is: {
2308
+ <T extends Element>(elm: Node | Node[] | null, selector: string): elm is T;
2309
+ (elm: Node | Node[] | null, selector: string): boolean;
2310
+ };
2311
+ add: (parentElm: RunArguments, name: string | Element, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null, create?: boolean) => HTMLElement;
1938
2312
  create: {
1939
- <K extends keyof HTMLElementTagNameMap>(name: K, attrs?: Record<string, string | boolean | number>, html?: string | Node): HTMLElementTagNameMap[K];
1940
- (name: string, attrs?: Record<string, string | boolean | number>, html?: string | Node): HTMLElement;
2313
+ <K extends keyof HTMLElementTagNameMap>(name: K, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null): HTMLElementTagNameMap[K];
2314
+ (name: string, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null): HTMLElement;
1941
2315
  };
1942
- createHTML: (name: string, attrs?: Record<string, string>, html?: string) => string;
2316
+ createHTML: (name: string, attrs?: Record<string, string | null>, html?: string) => string;
1943
2317
  createFragment: (html?: string) => DocumentFragment;
1944
- remove: <T extends Node>(node: string | T | T[], keepChildren?: boolean) => RunResult<typeof node, T>;
1945
- setStyle: (elm: string | Node | Node[], name: string, value: string | number | null) => void;
1946
- getStyle: (elm: string | Node, name: string, computed?: boolean) => string | undefined;
1947
- setStyles: (elm: string | Node | Node[], stylesArg: StyleMap) => void;
2318
+ remove: {
2319
+ <T extends Node>(node: T | T[], keepChildren?: boolean): typeof node extends Array<any> ? T[] : T;
2320
+ <T extends Node>(node: string, keepChildren?: boolean): T | false;
2321
+ };
2322
+ getStyle: {
2323
+ (elm: Element, name: string, computed: true): string;
2324
+ (elm: string | Element | null, name: string, computed?: boolean): string | undefined;
2325
+ };
2326
+ setStyle: (elm: string | Element | Element[], name: string, value: string | number | null) => void;
2327
+ setStyles: (elm: string | Element | Element[], stylesArg: StyleMap) => void;
1948
2328
  removeAllAttribs: (e: RunArguments<Element>) => void;
1949
- setAttrib: (elm: string | Node | Node[], name: string, value: string | boolean | number | null) => void;
1950
- setAttribs: (elm: string | Node | Node[], attrs: Record<string, string | boolean | number | null>) => void;
1951
- getAttrib: (elm: string | Node, name: string, defaultVal?: string) => string;
1952
- getPos: (elm: string | Node, rootElm?: Node) => {
2329
+ setAttrib: (elm: RunArguments<Element>, name: string, value: string | boolean | number | null) => void;
2330
+ setAttribs: (elm: RunArguments<Element>, attrs: Record<string, string | boolean | number | null>) => void;
2331
+ getAttrib: (elm: string | Element | null, name: string, defaultVal?: string) => string;
2332
+ getAttribs: (elm: string | Element) => NamedNodeMap | Attr[];
2333
+ getPos: (elm: string | Element, rootElm?: Node) => {
1953
2334
  x: number;
1954
2335
  y: number;
1955
2336
  };
@@ -1957,15 +2338,15 @@ interface DOMUtils {
1957
2338
  serializeStyle: (stylesArg: StyleMap, name?: string) => string;
1958
2339
  addStyle: (cssText: string) => void;
1959
2340
  loadCSS: (url: string) => void;
1960
- addClass: (elm: string | Node | Node[], cls: string) => void;
1961
- removeClass: (elm: string | Node | Node[], cls: string) => void;
1962
- hasClass: (elm: string | Node, cls: string) => boolean;
1963
- toggleClass: (elm: string | Node | Node[], cls: string, state?: boolean) => void;
2341
+ hasClass: (elm: string | Element, cls: string) => boolean;
2342
+ addClass: (elm: RunArguments<Element>, cls: string) => void;
2343
+ removeClass: (elm: RunArguments<Element>, cls: string) => void;
2344
+ toggleClass: (elm: RunArguments<Element>, cls: string, state?: boolean) => void;
1964
2345
  show: (elm: string | Node | Node[]) => void;
1965
2346
  hide: (elm: string | Node | Node[]) => void;
1966
2347
  isHidden: (elm: string | Node) => boolean;
1967
2348
  uniqueId: (prefix?: string) => string;
1968
- setHTML: (elm: string | Node | Node[], html: string) => void;
2349
+ setHTML: (elm: RunArguments<Element>, html: string) => void;
1969
2350
  getOuterHTML: (elm: string | Node) => string;
1970
2351
  setOuterHTML: (elm: string | Node | Node[], html: string) => void;
1971
2352
  decode: (text: string) => string;
@@ -1982,16 +2363,15 @@ interface DOMUtils {
1982
2363
  <K extends keyof HTMLElementTagNameMap>(elm: Element, name: K): HTMLElementTagNameMap[K];
1983
2364
  (elm: Element, name: string): Element;
1984
2365
  };
1985
- findCommonAncestor: (a: Node, b: Node) => Node;
2366
+ findCommonAncestor: (a: Node, b: Node) => Node | null;
1986
2367
  run<R, T extends Node>(this: DOMUtils, elm: T | T[], func: (node: T) => R, scope?: any): typeof elm extends Array<any> ? R[] : R;
1987
2368
  run<R, T extends Node>(this: DOMUtils, elm: RunArguments<T>, func: (node: T) => R, scope?: any): RunResult<typeof elm, R>;
1988
- getAttribs: (elm: string | Node) => NamedNodeMap | Attr[];
1989
- isEmpty: (node: Node, elements?: Record<string, any>) => boolean;
2369
+ isEmpty: (node: Node, elements?: Record<string, any>, options?: IsEmptyOptions) => boolean;
1990
2370
  createRng: () => Range;
1991
2371
  nodeIndex: (node: Node, normalized?: boolean) => number;
1992
2372
  split: {
1993
- <T extends Node>(parentElm: Node, splitElm: Node, replacementElm: T): T;
1994
- <T extends Node>(parentElm: Node, splitElm: T): T;
2373
+ <T extends Node>(parentElm: Node, splitElm: Node, replacementElm: T): T | undefined;
2374
+ <T extends Node>(parentElm: Node, splitElm: T): T | undefined;
1995
2375
  };
1996
2376
  bind: {
1997
2377
  <K extends string>(target: Target, name: K, func: Callback<K>, scope?: any): Callback<K>;
@@ -2005,6 +2385,7 @@ interface DOMUtils {
2005
2385
  dispatch: (target: Node | Window, name: string, evt?: {}) => EventUtils;
2006
2386
  getContentEditable: (node: Node) => string | null;
2007
2387
  getContentEditableParent: (node: Node) => string | null;
2388
+ isEditable: (node: Node | null | undefined) => boolean;
2008
2389
  destroy: () => void;
2009
2390
  isChildOf: (node: Node, parent: Node) => boolean;
2010
2391
  dumpRng: (r: Range) => string;
@@ -2018,12 +2399,12 @@ interface ClientRect {
2018
2399
  height: number;
2019
2400
  }
2020
2401
  interface BookmarkManager {
2021
- getBookmark: (type: number, normalized?: boolean) => Bookmark;
2402
+ getBookmark: (type?: number, normalized?: boolean) => Bookmark;
2022
2403
  moveToBookmark: (bookmark: Bookmark) => void;
2023
2404
  }
2024
2405
  interface ControlSelection {
2025
2406
  isResizable: (elm: Element) => boolean;
2026
- showResizeRect: (elm: Element) => void;
2407
+ showResizeRect: (elm: HTMLElement) => void;
2027
2408
  hideResizeRect: () => void;
2028
2409
  updateResizeRect: (evt: EditorEvent<any>) => void;
2029
2410
  destroy: () => void;
@@ -2036,7 +2417,7 @@ interface WriterSettings {
2036
2417
  indent_after?: string;
2037
2418
  indent_before?: string;
2038
2419
  }
2039
- declare type Attributes = Array<{
2420
+ type Attributes = Array<{
2040
2421
  name: string;
2041
2422
  value: string;
2042
2423
  }>;
@@ -2048,7 +2429,7 @@ interface Writer {
2048
2429
  getContent: () => string;
2049
2430
  pi: (name: string, text?: string) => void;
2050
2431
  reset: () => void;
2051
- start: (name: string, attrs?: Attributes, empty?: boolean) => void;
2432
+ start: (name: string, attrs?: Attributes | null, empty?: boolean) => void;
2052
2433
  text: (text: string, raw?: boolean) => void;
2053
2434
  }
2054
2435
  interface HtmlSerializerSettings extends WriterSettings {
@@ -2059,6 +2440,7 @@ interface HtmlSerializer {
2059
2440
  serialize: (node: AstNode) => string;
2060
2441
  }
2061
2442
  interface DomSerializerSettings extends DomParserSettings, WriterSettings, SchemaSettings, HtmlSerializerSettings {
2443
+ remove_trailing_brs?: boolean;
2062
2444
  url_converter?: URLConverter;
2063
2445
  url_converter_scope?: {};
2064
2446
  }
@@ -2106,9 +2488,10 @@ interface EditorSelection {
2106
2488
  moveToBookmark: (bookmark: Bookmark) => void;
2107
2489
  select: (node: Node, content?: boolean) => Node;
2108
2490
  isCollapsed: () => boolean;
2491
+ isEditable: () => boolean;
2109
2492
  isForward: () => boolean;
2110
2493
  setNode: (elm: Element) => Element;
2111
- getNode: () => Element;
2494
+ getNode: () => HTMLElement;
2112
2495
  getSel: () => Selection | null;
2113
2496
  setRng: (rng: Range, forward?: boolean) => void;
2114
2497
  getRng: () => Range;
@@ -2119,23 +2502,26 @@ interface EditorSelection {
2119
2502
  selectorChanged: (selector: string, callback: (active: boolean, args: {
2120
2503
  node: Node;
2121
2504
  selector: String;
2122
- parents: Element[];
2505
+ parents: Node[];
2123
2506
  }) => void) => EditorSelection;
2124
2507
  selectorChangedWithUnbind: (selector: string, callback: (active: boolean, args: {
2125
2508
  node: Node;
2126
2509
  selector: String;
2127
- parents: Element[];
2510
+ parents: Node[];
2128
2511
  }) => void) => {
2129
2512
  unbind: () => void;
2130
2513
  };
2131
- getScrollContainer: () => HTMLElement;
2514
+ getScrollContainer: () => HTMLElement | undefined;
2132
2515
  scrollIntoView: (elm?: HTMLElement, alignToTop?: boolean) => void;
2133
2516
  placeCaretAt: (clientX: number, clientY: number) => void;
2134
2517
  getBoundingClientRect: () => ClientRect | DOMRect;
2135
2518
  destroy: () => void;
2519
+ expand: (options?: {
2520
+ type: 'word';
2521
+ }) => void;
2136
2522
  }
2137
- declare type EditorCommandCallback = (ui: boolean, value: any) => void;
2138
- declare type EditorCommandsCallback = (command: string, ui: boolean, value: any) => void;
2523
+ type EditorCommandCallback<S> = (this: S, ui: boolean, value: any) => void;
2524
+ type EditorCommandsCallback = (command: string, ui: boolean, value?: any) => void;
2139
2525
  interface Commands {
2140
2526
  state: Record<string, (command: string) => boolean>;
2141
2527
  exec: Record<string, EditorCommandsCallback>;
@@ -2157,21 +2543,24 @@ declare class EditorCommands {
2157
2543
  queryCommandValue(command: string): string;
2158
2544
  addCommands<K extends keyof Commands>(commandList: Commands[K], type: K): void;
2159
2545
  addCommands(commandList: Record<string, EditorCommandsCallback>): void;
2160
- addCommand(command: string, callback: EditorCommandCallback, scope?: any): void;
2546
+ addCommand<S>(command: string, callback: EditorCommandCallback<S>, scope: S): void;
2547
+ addCommand(command: string, callback: EditorCommandCallback<Editor>): void;
2161
2548
  queryCommandSupported(command: string): boolean;
2162
- addQueryStateHandler(command: string, callback: () => boolean, scope?: any): void;
2163
- addQueryValueHandler(command: string, callback: () => string, scope?: any): void;
2549
+ addQueryStateHandler<S>(command: string, callback: (this: S) => boolean, scope: S): void;
2550
+ addQueryStateHandler(command: string, callback: (this: Editor) => boolean): void;
2551
+ addQueryValueHandler<S>(command: string, callback: (this: S) => string, scope: S): void;
2552
+ addQueryValueHandler(command: string, callback: (this: Editor) => string): void;
2164
2553
  }
2165
2554
  interface RawString {
2166
2555
  raw: string;
2167
2556
  }
2168
- declare type Primitive = string | number | boolean | Record<string | number, any> | Function;
2169
- declare type TokenisedString = [
2557
+ type Primitive = string | number | boolean | Record<string | number, any> | Function;
2558
+ type TokenisedString = [
2170
2559
  string,
2171
2560
  ...Primitive[]
2172
2561
  ];
2173
- declare type Untranslated = Primitive | TokenisedString | RawString;
2174
- declare type TranslatedString = string;
2562
+ type Untranslated = Primitive | TokenisedString | RawString | null | undefined;
2563
+ type TranslatedString = string;
2175
2564
  interface I18n {
2176
2565
  getData: () => Record<string, Record<string, string>>;
2177
2566
  setCode: (newCode: string) => void;
@@ -2181,7 +2570,7 @@ interface I18n {
2181
2570
  isRtl: () => boolean;
2182
2571
  hasCode: (code: string) => boolean;
2183
2572
  }
2184
- interface Observable<T> {
2573
+ interface Observable<T extends {}> {
2185
2574
  fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U, bubble?: boolean): EditorEvent<U>;
2186
2575
  dispatch<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U, bubble?: boolean): EditorEvent<U>;
2187
2576
  on<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): EventDispatcher<T>;
@@ -2213,7 +2602,7 @@ interface SafeUriOptions {
2213
2602
  }
2214
2603
  declare class URI {
2215
2604
  static parseDataUri(uri: string): {
2216
- type: string;
2605
+ type: string | undefined;
2217
2606
  data: string;
2218
2607
  };
2219
2608
  static isDomSafe(uri: string, context?: string, options?: SafeUriOptions): boolean;
@@ -2224,19 +2613,19 @@ declare class URI {
2224
2613
  pathname?: string;
2225
2614
  }): string;
2226
2615
  source: string;
2227
- protocol: string;
2228
- authority: string;
2229
- userInfo: string;
2230
- user: string;
2231
- password: string;
2232
- host: string;
2233
- port: string;
2234
- relative: string;
2616
+ protocol: string | undefined;
2617
+ authority: string | undefined;
2618
+ userInfo: string | undefined;
2619
+ user: string | undefined;
2620
+ password: string | undefined;
2621
+ host: string | undefined;
2622
+ port: string | undefined;
2623
+ relative: string | undefined;
2235
2624
  path: string;
2236
2625
  directory: string;
2237
- file: string;
2238
- query: string;
2239
- anchor: string;
2626
+ file: string | undefined;
2627
+ query: string | undefined;
2628
+ anchor: string | undefined;
2240
2629
  settings: URISettings;
2241
2630
  constructor(url: string, settings?: URISettings);
2242
2631
  setPath(path: string): void;
@@ -2252,8 +2641,8 @@ interface EditorManager extends Observable<EditorManagerEventMap> {
2252
2641
  majorVersion: string;
2253
2642
  minorVersion: string;
2254
2643
  releaseDate: string;
2255
- activeEditor: Editor;
2256
- focusedEditor: Editor;
2644
+ activeEditor: Editor | null;
2645
+ focusedEditor: Editor | null;
2257
2646
  baseURI: URI;
2258
2647
  baseURL: string;
2259
2648
  documentBaseURL: string;
@@ -2264,11 +2653,12 @@ interface EditorManager extends Observable<EditorManagerEventMap> {
2264
2653
  createEditor(this: EditorManager, id: string, options: RawEditorOptions): Editor;
2265
2654
  execCommand(this: EditorManager, cmd: string, ui: boolean, value: any): boolean;
2266
2655
  get(this: EditorManager): Editor[];
2267
- get(this: EditorManager, id: number | string): Editor;
2656
+ get(this: EditorManager, id: number | string): Editor | null;
2268
2657
  init(this: EditorManager, options: RawEditorOptions): Promise<Editor[]>;
2269
2658
  overrideDefaults(this: EditorManager, defaultOptions: Partial<RawEditorOptions>): void;
2270
2659
  remove(this: EditorManager): void;
2271
- remove(this: EditorManager, selector: string | Editor): Editor | void;
2660
+ remove(this: EditorManager, selector: string): void;
2661
+ remove(this: EditorManager, editor: Editor): Editor | null;
2272
2662
  setActive(this: EditorManager, editor: Editor): void;
2273
2663
  setup(this: EditorManager): void;
2274
2664
  translate: (text: Untranslated) => TranslatedString;
@@ -2277,7 +2667,7 @@ interface EditorManager extends Observable<EditorManagerEventMap> {
2277
2667
  }
2278
2668
  interface EditorObservable extends Observable<EditorEventMap> {
2279
2669
  bindPendingEventDelegates(this: Editor): void;
2280
- toggleNativeEvent(this: Editor, name: string, state: boolean): any;
2670
+ toggleNativeEvent(this: Editor, name: string, state: boolean): void;
2281
2671
  unbindAllNativeEvents(this: Editor): void;
2282
2672
  }
2283
2673
  interface ProcessorSuccess<T> {
@@ -2288,8 +2678,8 @@ interface ProcessorError {
2288
2678
  valid: false;
2289
2679
  message: string;
2290
2680
  }
2291
- declare type SimpleProcessor = (value: unknown) => boolean;
2292
- declare type Processor<T> = (value: unknown) => ProcessorSuccess<T> | ProcessorError;
2681
+ type SimpleProcessor = (value: unknown) => boolean;
2682
+ type Processor<T> = (value: unknown) => ProcessorSuccess<T> | ProcessorError;
2293
2683
  interface BuiltInOptionTypeMap {
2294
2684
  'string': string;
2295
2685
  'number': number;
@@ -2301,7 +2691,7 @@ interface BuiltInOptionTypeMap {
2301
2691
  'object[]': any[];
2302
2692
  'regexp': RegExp;
2303
2693
  }
2304
- declare type BuiltInOptionType = keyof BuiltInOptionTypeMap;
2694
+ type BuiltInOptionType = keyof BuiltInOptionTypeMap;
2305
2695
  interface BaseOptionSpec {
2306
2696
  immutable?: boolean;
2307
2697
  deprecated?: boolean;
@@ -2328,12 +2718,13 @@ interface Options {
2328
2718
  };
2329
2719
  isRegistered: (name: string) => boolean;
2330
2720
  get: {
2331
- <K extends keyof EditorOptions>(name: K): EditorOptions[K] | undefined;
2721
+ <K extends keyof EditorOptions>(name: K): EditorOptions[K];
2332
2722
  <T>(name: string): T | undefined;
2333
2723
  };
2334
2724
  set: <K extends string, T>(name: K, value: K extends keyof NormalizedEditorOptions ? NormalizedEditorOptions[K] : T) => boolean;
2335
2725
  unset: (name: string) => boolean;
2336
2726
  isSet: (name: string) => boolean;
2727
+ debug: () => void;
2337
2728
  }
2338
2729
  interface UploadResult$1 {
2339
2730
  element: HTMLImageElement;
@@ -2350,10 +2741,10 @@ interface EditorUpload {
2350
2741
  scanForImages: () => Promise<BlobInfoImagePair[]>;
2351
2742
  destroy: () => void;
2352
2743
  }
2353
- declare type FormatChangeCallback = (state: boolean, data: {
2744
+ type FormatChangeCallback = (state: boolean, data: {
2354
2745
  node: Node;
2355
2746
  format: string;
2356
- parents: any;
2747
+ parents: Element[];
2357
2748
  }) => void;
2358
2749
  interface FormatRegistry {
2359
2750
  get: {
@@ -2365,18 +2756,18 @@ interface FormatRegistry {
2365
2756
  unregister: (name: string) => Formats;
2366
2757
  }
2367
2758
  interface Formatter extends FormatRegistry {
2368
- apply: (name: string, vars?: FormatVars, node?: Node | RangeLikeObject) => void;
2759
+ apply: (name: string, vars?: FormatVars, node?: Node | RangeLikeObject | null) => void;
2369
2760
  remove: (name: string, vars?: FormatVars, node?: Node | Range, similar?: boolean) => void;
2370
2761
  toggle: (name: string, vars?: FormatVars, node?: Node) => void;
2371
2762
  match: (name: string, vars?: FormatVars, node?: Node, similar?: boolean) => boolean;
2372
2763
  closest: (names: string[]) => string | null;
2373
2764
  matchAll: (names: string[], vars?: FormatVars) => string[];
2374
- matchNode: (node: Node, name: string, vars?: FormatVars, similar?: boolean) => Format | undefined;
2765
+ matchNode: (node: Node | null, name: string, vars?: FormatVars, similar?: boolean) => Format | undefined;
2375
2766
  canApply: (name: string) => boolean;
2376
2767
  formatChanged: (names: string, callback: FormatChangeCallback, similar?: boolean, vars?: FormatVars) => {
2377
2768
  unbind: () => void;
2378
2769
  };
2379
- getCssText: (format: string | Format) => string;
2770
+ getCssText: (format: string | ApplyFormat) => string;
2380
2771
  }
2381
2772
  interface EditorMode {
2382
2773
  isReadOnly: () => boolean;
@@ -2395,7 +2786,7 @@ interface Model {
2395
2786
  readonly clearSelectedCells: (container: Node) => void;
2396
2787
  };
2397
2788
  }
2398
- declare type ModelManager = AddOnManager<Model>;
2789
+ type ModelManager = AddOnManager<Model>;
2399
2790
  interface Plugin {
2400
2791
  getMetadata?: () => {
2401
2792
  name: string;
@@ -2404,12 +2795,12 @@ interface Plugin {
2404
2795
  init?: (editor: Editor, url: string) => void;
2405
2796
  [key: string]: any;
2406
2797
  }
2407
- declare type PluginManager = AddOnManager<void | Plugin>;
2798
+ type PluginManager = AddOnManager<void | Plugin>;
2408
2799
  interface ShortcutsConstructor {
2409
2800
  readonly prototype: Shortcuts;
2410
2801
  new (editor: Editor): Shortcuts;
2411
2802
  }
2412
- declare type CommandFunc = string | [
2803
+ type CommandFunc = string | [
2413
2804
  string,
2414
2805
  boolean,
2415
2806
  any
@@ -2419,7 +2810,7 @@ declare class Shortcuts {
2419
2810
  private readonly shortcuts;
2420
2811
  private pendingPatterns;
2421
2812
  constructor(editor: Editor);
2422
- add(pattern: string, desc: string, cmdFunc: CommandFunc, scope?: any): boolean;
2813
+ add(pattern: string, desc: string | null, cmdFunc: CommandFunc, scope?: any): boolean;
2423
2814
  remove(pattern: string): boolean;
2424
2815
  private normalizeCommandFunc;
2425
2816
  private createShortcut;
@@ -2428,21 +2819,22 @@ declare class Shortcuts {
2428
2819
  private matchShortcut;
2429
2820
  private executeShortcutAction;
2430
2821
  }
2822
+ interface RenderResult {
2823
+ iframeContainer?: HTMLElement;
2824
+ editorContainer: HTMLElement;
2825
+ api?: Partial<EditorUiApi>;
2826
+ }
2431
2827
  interface Theme {
2432
2828
  ui?: any;
2433
2829
  inline?: any;
2434
2830
  execCommand?: (command: string, ui?: boolean, value?: any) => boolean;
2435
2831
  destroy?: () => void;
2436
2832
  init?: (editor: Editor, url: string) => void;
2437
- renderUI?: () => {
2438
- iframeContainer?: HTMLIFrameElement;
2439
- editorContainer: HTMLElement;
2440
- api?: Partial<EditorUiApi>;
2441
- };
2833
+ renderUI?: () => Promise<RenderResult> | RenderResult;
2442
2834
  getNotificationManagerImpl?: () => NotificationManagerImpl;
2443
2835
  getWindowManagerImpl?: () => WindowManagerImpl;
2444
2836
  }
2445
- declare type ThemeManager = AddOnManager<void | Theme>;
2837
+ type ThemeManager = AddOnManager<void | Theme>;
2446
2838
  interface EditorConstructor {
2447
2839
  readonly prototype: Editor;
2448
2840
  new (id: string, options: RawEditorOptions, editorManager: EditorManager): Editor;
@@ -2459,39 +2851,39 @@ declare class Editor implements EditorObservable {
2459
2851
  ui: EditorUi;
2460
2852
  mode: EditorMode;
2461
2853
  options: Options;
2854
+ editorUpload: EditorUpload;
2462
2855
  shortcuts: Shortcuts;
2463
2856
  loadedCSS: Record<string, any>;
2464
2857
  editorCommands: EditorCommands;
2465
2858
  suffix: string;
2466
2859
  editorManager: EditorManager;
2860
+ hidden: boolean;
2467
2861
  inline: boolean;
2862
+ hasVisual: boolean;
2468
2863
  isNotDirty: boolean;
2469
2864
  annotator: Annotator;
2470
- bodyElement: HTMLElement;
2865
+ bodyElement: HTMLElement | undefined;
2471
2866
  bookmark: any;
2472
2867
  composing: boolean;
2473
2868
  container: HTMLElement;
2474
2869
  contentAreaContainer: HTMLElement;
2475
2870
  contentDocument: Document;
2476
2871
  contentWindow: Window;
2477
- delegates: Record<string, (event: any) => void>;
2872
+ delegates: Record<string, EventUtilsCallback<any>> | undefined;
2478
2873
  destroyed: boolean;
2479
2874
  dom: DOMUtils;
2480
2875
  editorContainer: HTMLElement;
2481
- editorUpload: EditorUpload;
2482
- eventRoot?: Element;
2876
+ eventRoot: Element | undefined;
2483
2877
  formatter: Formatter;
2484
- formElement: HTMLElement;
2485
- formEventDelegate: (e: Event) => void;
2878
+ formElement: HTMLElement | undefined;
2879
+ formEventDelegate: ((e: Event) => void) | undefined;
2486
2880
  hasHiddenInput: boolean;
2487
- hasVisual: boolean;
2488
- hidden: boolean;
2489
2881
  iframeElement: HTMLIFrameElement | null;
2490
- iframeHTML: string;
2882
+ iframeHTML: string | undefined;
2491
2883
  initialized: boolean;
2492
2884
  notificationManager: NotificationManager;
2493
2885
  orgDisplay: string;
2494
- orgVisibility: string;
2886
+ orgVisibility: string | undefined;
2495
2887
  parser: DomParser;
2496
2888
  quirks: Quirks;
2497
2889
  readonly: boolean;
@@ -2505,12 +2897,13 @@ declare class Editor implements EditorObservable {
2505
2897
  model: Model;
2506
2898
  undoManager: UndoManager;
2507
2899
  windowManager: WindowManager;
2508
- _beforeUnload: () => void;
2509
- _eventDispatcher: EventDispatcher<NativeEventMap>;
2900
+ _beforeUnload: (() => void) | undefined;
2901
+ _eventDispatcher: EventDispatcher<NativeEventMap> | undefined;
2510
2902
  _nodeChangeDispatcher: NodeChange;
2511
2903
  _pendingNativeEvents: string[];
2512
2904
  _selectionOverrides: SelectionOverrides;
2513
2905
  _skinLoaded: boolean;
2906
+ _editableRoot: boolean;
2514
2907
  bindPendingEventDelegates: EditorObservable['bindPendingEventDelegates'];
2515
2908
  toggleNativeEvent: EditorObservable['toggleNativeEvent'];
2516
2909
  unbindAllNativeEvents: EditorObservable['unbindAllNativeEvents'];
@@ -2530,9 +2923,12 @@ declare class Editor implements EditorObservable {
2530
2923
  getParam<T>(name: string, defaultVal: T, type?: BuiltInOptionType): T;
2531
2924
  hasPlugin(name: string, loaded?: boolean): boolean;
2532
2925
  nodeChanged(args?: any): void;
2533
- addCommand(name: string, callback: EditorCommandCallback, scope?: object): void;
2534
- addQueryStateHandler(name: string, callback: () => boolean, scope?: any): void;
2535
- addQueryValueHandler(name: string, callback: () => string, scope?: any): void;
2926
+ addCommand<S>(name: string, callback: EditorCommandCallback<S>, scope: S): void;
2927
+ addCommand(name: string, callback: EditorCommandCallback<Editor>): void;
2928
+ addQueryStateHandler<S>(name: string, callback: (this: S) => boolean, scope?: S): void;
2929
+ addQueryStateHandler(name: string, callback: (this: Editor) => boolean): void;
2930
+ addQueryValueHandler<S>(name: string, callback: (this: S) => string, scope: S): void;
2931
+ addQueryValueHandler(name: string, callback: (this: Editor) => string): void;
2536
2932
  addShortcut(pattern: string, desc: string, cmdFunc: string | [
2537
2933
  string,
2538
2934
  boolean,
@@ -2546,8 +2942,8 @@ declare class Editor implements EditorObservable {
2546
2942
  hide(): void;
2547
2943
  isHidden(): boolean;
2548
2944
  setProgressState(state: boolean, time?: number): void;
2549
- load(args?: any): string;
2550
- save(args?: any): string;
2945
+ load(args?: Partial<SetContentArgs>): string;
2946
+ save(args?: Partial<GetContentArgs>): string;
2551
2947
  setContent(content: string, args?: Partial<SetContentArgs>): string;
2552
2948
  setContent(content: AstNode, args?: Partial<SetContentArgs>): AstNode;
2553
2949
  setContent(content: Content, args?: Partial<SetContentArgs>): Content;
@@ -2565,8 +2961,10 @@ declare class Editor implements EditorObservable {
2565
2961
  getWin(): Window;
2566
2962
  getDoc(): Document;
2567
2963
  getBody(): HTMLElement;
2568
- convertURL(url: string, name: string, elm?: any): string;
2964
+ convertURL(url: string, name: string, elm?: string | Element): string;
2569
2965
  addVisual(elm?: HTMLElement): void;
2966
+ setEditableRoot(state: boolean): void;
2967
+ hasEditableRoot(): boolean;
2570
2968
  remove(): void;
2571
2969
  destroy(automatic?: boolean): void;
2572
2970
  uploadImages(): Promise<UploadResult$1[]>;
@@ -2577,16 +2975,16 @@ interface UrlObject {
2577
2975
  resource: string;
2578
2976
  suffix: string;
2579
2977
  }
2580
- declare type WaitState = 'added' | 'loaded';
2581
- declare type AddOnConstructor<T> = (editor: Editor, url: string) => T;
2978
+ type WaitState = 'added' | 'loaded';
2979
+ type AddOnConstructor<T> = (editor: Editor, url: string) => T;
2582
2980
  interface AddOnManager<T> {
2583
2981
  items: AddOnConstructor<T>[];
2584
2982
  urls: Record<string, string>;
2585
2983
  lookup: Record<string, {
2586
2984
  instance: AddOnConstructor<T>;
2587
2985
  }>;
2588
- get: (name: string) => AddOnConstructor<T>;
2589
- requireLangPack: (name: string, languages: string) => void;
2986
+ get: (name: string) => AddOnConstructor<T> | undefined;
2987
+ requireLangPack: (name: string, languages?: string) => void;
2590
2988
  add: (id: string, addOn: AddOnConstructor<T>) => AddOnConstructor<T>;
2591
2989
  remove: (name: string) => void;
2592
2990
  createUrl: (baseUrl: UrlObject, dep: string | UrlObject) => UrlObject;
@@ -2597,6 +2995,9 @@ interface RangeUtils {
2597
2995
  walk: (rng: Range, callback: (nodes: Node[]) => void) => void;
2598
2996
  split: (rng: Range) => RangeLikeObject;
2599
2997
  normalize: (rng: Range) => boolean;
2998
+ expand: (rng: Range, options?: {
2999
+ type: 'word';
3000
+ }) => Range;
2600
3001
  }
2601
3002
  interface ScriptLoaderSettings {
2602
3003
  referrerPolicy?: ReferrerPolicy;
@@ -2625,7 +3026,7 @@ declare class ScriptLoader {
2625
3026
  loadQueue(): Promise<void>;
2626
3027
  loadScripts(scripts: string[]): Promise<void>;
2627
3028
  }
2628
- declare type TextProcessCallback = (node: Text, offset: number, text: string) => number;
3029
+ type TextProcessCallback = (node: Text, offset: number, text: string) => number;
2629
3030
  interface Spot {
2630
3031
  container: Text;
2631
3032
  offset: number;
@@ -2642,10 +3043,10 @@ declare class DomTreeWalker {
2642
3043
  private readonly rootNode;
2643
3044
  private node;
2644
3045
  constructor(startNode: Node, rootNode: Node);
2645
- current(): Node | undefined;
2646
- next(shallow?: boolean): Node | undefined;
2647
- prev(shallow?: boolean): Node | undefined;
2648
- prev2(shallow?: boolean): Node | undefined;
3046
+ current(): Node | null | undefined;
3047
+ next(shallow?: boolean): Node | null | undefined;
3048
+ prev(shallow?: boolean): Node | null | undefined;
3049
+ prev2(shallow?: boolean): Node | null | undefined;
2649
3050
  private findSibling;
2650
3051
  private findPreviousNode;
2651
3052
  }
@@ -2714,7 +3115,7 @@ interface Entities {
2714
3115
  encodeAllRaw: (text: string) => string;
2715
3116
  encodeNumeric: (text: string, attr?: boolean) => string;
2716
3117
  encodeNamed: (text: string, attr?: boolean, entities?: EntitiesMap) => string;
2717
- getEncodeFunc: (name: string, entities?: EntitiesMap | string) => (text: string, attr?: boolean) => string;
3118
+ getEncodeFunc: (name: string, entities?: string) => (text: string, attr?: boolean) => string;
2718
3119
  decode: (text: string) => string;
2719
3120
  }
2720
3121
  interface IconPack {
@@ -2728,22 +3129,39 @@ interface IconManager {
2728
3129
  interface Resource {
2729
3130
  load: <T = any>(id: string, url: string) => Promise<T>;
2730
3131
  add: (id: string, data: any) => void;
3132
+ has: (id: string) => boolean;
3133
+ get: (id: string) => any;
2731
3134
  unload: (id: string) => void;
2732
3135
  }
3136
+ type TextPatterns_d_Pattern = Pattern;
3137
+ type TextPatterns_d_RawPattern = RawPattern;
3138
+ type TextPatterns_d_DynamicPatternsLookup = DynamicPatternsLookup;
3139
+ type TextPatterns_d_RawDynamicPatternsLookup = RawDynamicPatternsLookup;
3140
+ type TextPatterns_d_DynamicPatternContext = DynamicPatternContext;
3141
+ type TextPatterns_d_BlockCmdPattern = BlockCmdPattern;
3142
+ type TextPatterns_d_BlockPattern = BlockPattern;
3143
+ type TextPatterns_d_BlockFormatPattern = BlockFormatPattern;
3144
+ type TextPatterns_d_InlineCmdPattern = InlineCmdPattern;
3145
+ type TextPatterns_d_InlinePattern = InlinePattern;
3146
+ type TextPatterns_d_InlineFormatPattern = InlineFormatPattern;
3147
+ declare namespace TextPatterns_d {
3148
+ export { TextPatterns_d_Pattern as Pattern, TextPatterns_d_RawPattern as RawPattern, TextPatterns_d_DynamicPatternsLookup as DynamicPatternsLookup, TextPatterns_d_RawDynamicPatternsLookup as RawDynamicPatternsLookup, TextPatterns_d_DynamicPatternContext as DynamicPatternContext, TextPatterns_d_BlockCmdPattern as BlockCmdPattern, TextPatterns_d_BlockPattern as BlockPattern, TextPatterns_d_BlockFormatPattern as BlockFormatPattern, TextPatterns_d_InlineCmdPattern as InlineCmdPattern, TextPatterns_d_InlinePattern as InlinePattern, TextPatterns_d_InlineFormatPattern as InlineFormatPattern, };
3149
+ }
2733
3150
  interface Delay {
2734
3151
  setEditorInterval: (editor: Editor, callback: () => void, time?: number) => number;
2735
3152
  setEditorTimeout: (editor: Editor, callback: () => void, time?: number) => number;
2736
3153
  }
2737
- declare type UploadResult = UploadResult$2;
3154
+ type UploadResult = UploadResult$2;
2738
3155
  interface ImageUploader {
2739
3156
  upload: (blobInfos: BlobInfo[], showNotification?: boolean) => Promise<UploadResult[]>;
2740
3157
  }
2741
- declare type ArrayCallback$1<T, R> = (x: T, i: number, xs: ReadonlyArray<T>) => R;
2742
- declare type ObjCallback$1<T, R> = (value: T, key: string, obj: Record<string, T>) => R;
2743
- declare type ArrayCallback<T, R> = ArrayCallback$1<T, R>;
2744
- declare type ObjCallback<T, R> = ObjCallback$1<T, R>;
3158
+ type ArrayCallback$1<T, R> = (this: any, x: T, i: number, xs: ArrayLike<T>) => R;
3159
+ type ObjCallback$1<T, R> = (this: any, value: T, key: string, obj: Record<string, T>) => R;
3160
+ type ArrayCallback<T, R> = ArrayCallback$1<T, R>;
3161
+ type ObjCallback<T, R> = ObjCallback$1<T, R>;
3162
+ type WalkCallback<T> = (this: any, o: T, i: string, n: keyof T | undefined) => boolean | void;
2745
3163
  interface Tools {
2746
- is: (obj: any, type: string) => boolean;
3164
+ is: (obj: any, type?: string) => boolean;
2747
3165
  isArray: <T>(arr: any) => arr is Array<T>;
2748
3166
  inArray: <T>(arr: ArrayLike<T>, value: T) => number;
2749
3167
  grep: {
@@ -2753,7 +3171,7 @@ interface Tools {
2753
3171
  trim: (str: string | null | undefined) => string;
2754
3172
  toArray: <T>(obj: ArrayLike<T>) => T[];
2755
3173
  hasOwn: (obj: any, name: string) => boolean;
2756
- makeMap: <T>(items: ArrayLike<T> | string, delim?: string | RegExp, map?: Record<string, T | string>) => Record<string, T | string>;
3174
+ makeMap: (items: ArrayLike<string> | string | undefined, delim?: string | RegExp, map?: Record<string, {}>) => Record<string, {}>;
2757
3175
  each: {
2758
3176
  <T>(arr: ArrayLike<T> | null | undefined, cb: ArrayCallback<T, void | boolean>, scope?: any): boolean;
2759
3177
  <T>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, void | boolean>, scope?: any): boolean;
@@ -2763,9 +3181,9 @@ interface Tools {
2763
3181
  <T, R>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, R>): R[];
2764
3182
  };
2765
3183
  extend: (obj: Object, ext: Object, ...objs: Object[]) => any;
2766
- walk: <T = any>(obj: T, f: Function, n?: keyof T, scope?: any) => void;
3184
+ walk: <T extends Record<string, any>>(obj: T, f: WalkCallback<T>, n?: keyof T, scope?: any) => void;
2767
3185
  resolve: (path: string, o?: Object) => any;
2768
- explode: (s: string, d?: string | RegExp) => string[];
3186
+ explode: (s: string | string[], d?: string | RegExp) => string[];
2769
3187
  _addCacheSuffix: (url: string) => string;
2770
3188
  }
2771
3189
  interface KeyboardLikeEvent {
@@ -2892,4 +3310,4 @@ interface TinyMCE extends EditorManager {
2892
3310
  _addCacheSuffix: Tools['_addCacheSuffix'];
2893
3311
  }
2894
3312
  declare const tinymce: TinyMCE;
2895
- 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 };
3313
+ 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, TextPatterns_d as TextPatterns, TextSeeker, Theme, ThemeManager, TinyMCE, Tools, URI, Ui_d as Ui, UndoManager, VK, WindowManager, Writer, WriterSettings, tinymce as default };