card-mod-tinymce_editor 0.15.5 → 0.15.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/script/nest_editor.js.coffee +76 -63
- data/assets/script/script_tinymce.js +2 -2
- data/assets/script/tinymce_config.js.coffee +6 -0
- data/data/files/mod_tinymce_editor_script_asset_output/file.js +15 -17
- data/public/icons/default/icons.min.js +1 -0
- data/public/jquery.tinymce.min.js +40 -41
- data/public/langs/{readme.md → README.md} +0 -0
- data/public/license.txt +0 -0
- data/public/plugins/advlist/plugin.min.js +2 -2
- data/public/plugins/anchor/plugin.min.js +2 -2
- data/public/plugins/autolink/plugin.min.js +2 -2
- data/public/plugins/autoresize/plugin.min.js +2 -2
- data/public/plugins/autosave/plugin.min.js +2 -2
- data/public/plugins/bbcode/plugin.min.js +2 -2
- data/public/plugins/charmap/plugin.min.js +2 -2
- data/public/plugins/code/plugin.min.js +2 -2
- data/public/plugins/codesample/plugin.min.js +2 -2
- data/public/plugins/colorpicker/plugin.min.js +2 -2
- data/public/plugins/contextmenu/plugin.min.js +2 -2
- data/public/plugins/directionality/plugin.min.js +2 -2
- data/public/plugins/emoticons/js/emojiimages.js +9424 -0
- data/public/plugins/emoticons/js/emojiimages.min.js +3 -0
- data/public/plugins/emoticons/js/emojis.js +1916 -1508
- data/public/plugins/emoticons/js/emojis.min.js +2 -2
- data/public/plugins/emoticons/plugin.min.js +2 -2
- data/public/plugins/fullpage/plugin.min.js +2 -2
- data/public/plugins/fullscreen/plugin.min.js +2 -2
- data/public/plugins/help/plugin.min.js +2 -2
- data/public/plugins/hr/plugin.min.js +2 -2
- data/public/plugins/image/plugin.min.js +2 -2
- data/public/plugins/imagetools/plugin.min.js +2 -2
- data/public/plugins/importcss/plugin.min.js +2 -2
- data/public/plugins/insertdatetime/plugin.min.js +2 -2
- data/public/plugins/legacyoutput/plugin.min.js +2 -2
- data/public/plugins/link/plugin.min.js +2 -2
- data/public/plugins/lists/plugin.min.js +2 -2
- data/public/plugins/media/plugin.min.js +2 -2
- data/public/plugins/nonbreaking/plugin.min.js +2 -2
- data/public/plugins/noneditable/plugin.min.js +2 -2
- data/public/plugins/pagebreak/plugin.min.js +2 -2
- data/public/plugins/paste/plugin.min.js +2 -2
- data/public/plugins/preview/plugin.min.js +2 -2
- data/public/plugins/print/plugin.min.js +2 -2
- data/public/plugins/quickbars/plugin.min.js +2 -2
- data/public/plugins/save/plugin.min.js +2 -2
- data/public/plugins/searchreplace/plugin.min.js +2 -2
- data/public/plugins/spellchecker/plugin.min.js +2 -2
- data/public/plugins/tabfocus/plugin.min.js +2 -2
- data/public/plugins/table/plugin.min.js +2 -2
- data/public/plugins/template/plugin.min.js +2 -2
- data/public/plugins/textcolor/plugin.min.js +2 -2
- data/public/plugins/textpattern/plugin.min.js +2 -2
- data/public/plugins/toc/plugin.min.js +2 -2
- data/public/plugins/visualblocks/plugin.min.js +2 -2
- data/public/plugins/visualchars/plugin.min.js +2 -2
- data/public/plugins/wordcount/plugin.min.js +2 -2
- data/public/skins/content/dark/content.min.css +7 -0
- data/public/skins/content/default/content.min.css +1 -1
- data/public/skins/content/document/content.min.css +1 -1
- data/public/skins/content/writer/content.min.css +1 -1
- data/public/skins/ui/oxide/content.inline.min.css +1 -1
- data/public/skins/ui/oxide/content.min.css +1 -1
- data/public/skins/ui/oxide/content.mobile.min.css +0 -0
- data/public/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
- data/public/skins/ui/oxide/skin.min.css +1 -1
- data/public/skins/ui/oxide/skin.mobile.min.css +1 -1
- data/public/skins/ui/oxide/skin.shadowdom.min.css +7 -0
- data/public/skins/ui/oxide-dark/content.inline.min.css +1 -1
- data/public/skins/ui/oxide-dark/content.min.css +1 -1
- data/public/skins/ui/oxide-dark/content.mobile.min.css +0 -0
- data/public/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
- data/public/skins/ui/oxide-dark/skin.min.css +1 -1
- data/public/skins/ui/oxide-dark/skin.mobile.min.css +1 -1
- data/public/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -0
- data/public/themes/mobile/theme.min.js +2 -2
- data/public/themes/silver/theme.min.js +2 -2
- data/public/tinymce.d.ts +3039 -0
- data/public/tinymce.min.js +2 -2
- data/set/all/reference_editor/link_editor.rb +1 -1
- metadata +15 -8
data/public/tinymce.d.ts
ADDED
@@ -0,0 +1,3039 @@
|
|
1
|
+
interface StringPathBookmark {
|
2
|
+
start: string;
|
3
|
+
end?: string;
|
4
|
+
}
|
5
|
+
interface RangeBookmark {
|
6
|
+
rng: Range;
|
7
|
+
}
|
8
|
+
interface IdBookmark {
|
9
|
+
id: string;
|
10
|
+
keep?: boolean;
|
11
|
+
}
|
12
|
+
interface IndexBookmark {
|
13
|
+
name: string;
|
14
|
+
index: number;
|
15
|
+
}
|
16
|
+
interface PathBookmark {
|
17
|
+
start: number[];
|
18
|
+
end?: number[];
|
19
|
+
isFakeCaret?: boolean;
|
20
|
+
}
|
21
|
+
declare type Bookmark = StringPathBookmark | RangeBookmark | IdBookmark | IndexBookmark | PathBookmark;
|
22
|
+
declare type NormalizedEvent<E, T = any> = E & {
|
23
|
+
readonly type: string;
|
24
|
+
readonly target: T;
|
25
|
+
readonly isDefaultPrevented: () => boolean;
|
26
|
+
readonly preventDefault: () => void;
|
27
|
+
readonly isPropagationStopped: () => boolean;
|
28
|
+
readonly stopPropagation: () => void;
|
29
|
+
readonly isImmediatePropagationStopped: () => boolean;
|
30
|
+
readonly stopImmediatePropagation: () => void;
|
31
|
+
};
|
32
|
+
declare type MappedEvent<T, K extends string> = K extends keyof T ? T[K] : any;
|
33
|
+
interface NativeEventMap {
|
34
|
+
'beforepaste': Event;
|
35
|
+
'blur': FocusEvent;
|
36
|
+
'beforeinput': InputEvent;
|
37
|
+
'click': MouseEvent;
|
38
|
+
'compositionend': Event;
|
39
|
+
'compositionstart': Event;
|
40
|
+
'compositionupdate': Event;
|
41
|
+
'contextmenu': PointerEvent;
|
42
|
+
'copy': ClipboardEvent;
|
43
|
+
'cut': ClipboardEvent;
|
44
|
+
'dblclick': MouseEvent;
|
45
|
+
'drag': DragEvent;
|
46
|
+
'dragdrop': DragEvent;
|
47
|
+
'dragend': DragEvent;
|
48
|
+
'draggesture': DragEvent;
|
49
|
+
'dragover': DragEvent;
|
50
|
+
'dragstart': DragEvent;
|
51
|
+
'drop': DragEvent;
|
52
|
+
'focus': FocusEvent;
|
53
|
+
'focusin': FocusEvent;
|
54
|
+
'focusout': FocusEvent;
|
55
|
+
'input': InputEvent;
|
56
|
+
'keydown': KeyboardEvent;
|
57
|
+
'keypress': KeyboardEvent;
|
58
|
+
'keyup': KeyboardEvent;
|
59
|
+
'mousedown': MouseEvent;
|
60
|
+
'mouseenter': MouseEvent;
|
61
|
+
'mouseleave': MouseEvent;
|
62
|
+
'mousemove': MouseEvent;
|
63
|
+
'mouseout': MouseEvent;
|
64
|
+
'mouseover': MouseEvent;
|
65
|
+
'mouseup': MouseEvent;
|
66
|
+
'paste': ClipboardEvent;
|
67
|
+
'selectionchange': Event;
|
68
|
+
'submit': Event;
|
69
|
+
'touchend': TouchEvent;
|
70
|
+
'touchmove': TouchEvent;
|
71
|
+
'touchstart': TouchEvent;
|
72
|
+
'touchcancel': TouchEvent;
|
73
|
+
'wheel': WheelEvent;
|
74
|
+
}
|
75
|
+
declare type EditorEvent<T> = NormalizedEvent<T>;
|
76
|
+
interface EventDispatcherSettings {
|
77
|
+
scope?: any;
|
78
|
+
toggleEvent?: (name: string, state: boolean) => void | boolean;
|
79
|
+
beforeFire?: <T>(args: EditorEvent<T>) => void;
|
80
|
+
}
|
81
|
+
interface EventDispatcherConstructor<T extends NativeEventMap> {
|
82
|
+
readonly prototype: EventDispatcher<T>;
|
83
|
+
new (settings?: EventDispatcherSettings): EventDispatcher<T>;
|
84
|
+
isNative: (name: string) => boolean;
|
85
|
+
}
|
86
|
+
declare class EventDispatcher<T> {
|
87
|
+
static isNative(name: string): boolean;
|
88
|
+
private readonly settings;
|
89
|
+
private readonly scope;
|
90
|
+
private readonly toggleEvent;
|
91
|
+
private bindings;
|
92
|
+
constructor(settings?: Record<string, any>);
|
93
|
+
fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U): EditorEvent<U>;
|
94
|
+
on<K extends string>(name: K, callback: false | ((event: EditorEvent<MappedEvent<T, K>>) => void), prepend?: boolean, extra?: {}): this;
|
95
|
+
off<K extends string>(name?: K, callback?: (event: EditorEvent<MappedEvent<T, K>>) => void): this;
|
96
|
+
once<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): this;
|
97
|
+
has(name: string): boolean;
|
98
|
+
}
|
99
|
+
declare const enum UndoLevelType {
|
100
|
+
Fragmented = "fragmented",
|
101
|
+
Complete = "complete"
|
102
|
+
}
|
103
|
+
interface UndoLevel {
|
104
|
+
type: UndoLevelType;
|
105
|
+
fragments: string[];
|
106
|
+
content: string;
|
107
|
+
bookmark: Bookmark;
|
108
|
+
beforeBookmark: Bookmark;
|
109
|
+
}
|
110
|
+
interface UndoManager {
|
111
|
+
data: UndoLevel[];
|
112
|
+
typing: boolean;
|
113
|
+
add: (level?: UndoLevel, event?: EditorEvent<any>) => UndoLevel;
|
114
|
+
beforeChange: () => void;
|
115
|
+
undo: () => UndoLevel;
|
116
|
+
redo: () => UndoLevel;
|
117
|
+
clear: () => void;
|
118
|
+
reset: () => void;
|
119
|
+
hasUndo: () => boolean;
|
120
|
+
hasRedo: () => boolean;
|
121
|
+
transact: (callback: () => void) => UndoLevel;
|
122
|
+
ignore: (callback: () => void) => void;
|
123
|
+
extra: (callback1: () => void, callback2: () => void) => void;
|
124
|
+
}
|
125
|
+
declare type ArrayCallback$1<T, R> = (x: T, i: number, xs: ReadonlyArray<T>) => R;
|
126
|
+
declare type ObjCallback$1<T, R> = (value: T, key: string, obj: Record<string, T>) => R;
|
127
|
+
declare type ArrayCallback<T, R> = ArrayCallback$1<T, R>;
|
128
|
+
declare type ObjCallback<T, R> = ObjCallback$1<T, R>;
|
129
|
+
interface Tools {
|
130
|
+
is: (obj: any, type: string) => boolean;
|
131
|
+
isArray: <T>(arr: any) => arr is Array<T>;
|
132
|
+
inArray: <T>(arr: ArrayLike<T>, value: T) => number;
|
133
|
+
grep: {
|
134
|
+
<T>(arr: ArrayLike<T> | null | undefined, pred?: ArrayCallback<T, boolean>): T[];
|
135
|
+
<T>(arr: Record<string, T> | null | undefined, pred?: ObjCallback<T, boolean>): T[];
|
136
|
+
};
|
137
|
+
trim: (str: string) => string;
|
138
|
+
toArray: <T>(obj: ArrayLike<T>) => T[];
|
139
|
+
hasOwn: (obj: any, name: string) => boolean;
|
140
|
+
makeMap: <T>(items: ArrayLike<T> | string, delim?: string | RegExp, map?: Record<string, T | string>) => Record<string, T | string>;
|
141
|
+
each: {
|
142
|
+
<T>(arr: ArrayLike<T> | null | undefined, cb: ArrayCallback<T, void | boolean>, scope?: any): boolean;
|
143
|
+
<T>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, void | boolean>, scope?: any): boolean;
|
144
|
+
};
|
145
|
+
map: {
|
146
|
+
<T, R>(arr: ArrayLike<T> | null | undefined, cb: ArrayCallback<T, R>): R[];
|
147
|
+
<T, R>(obj: Record<string, T> | null | undefined, cb: ObjCallback<T, R>): R[];
|
148
|
+
};
|
149
|
+
extend: (obj: Object, ext: Object, ...objs: Object[]) => any;
|
150
|
+
create: (name: string, p: Object, root?: Object) => void;
|
151
|
+
walk: <T = any>(obj: T, f: Function, n?: keyof T, scope?: any) => void;
|
152
|
+
createNS: (name: string, o?: Object) => any;
|
153
|
+
resolve: (path: string, o?: Object) => any;
|
154
|
+
explode: (s: string, d?: string | RegExp) => string[];
|
155
|
+
_addCacheSuffix: (url: string) => string;
|
156
|
+
}
|
157
|
+
declare type EventUtilsCallback<T> = (event: EventUtilsEvent<T>) => void;
|
158
|
+
declare type EventUtilsEvent<T> = NormalizedEvent<T> & {
|
159
|
+
metaKey: boolean;
|
160
|
+
};
|
161
|
+
interface EventUtilsConstructor {
|
162
|
+
readonly prototype: EventUtils;
|
163
|
+
new (): EventUtils;
|
164
|
+
Event: EventUtils;
|
165
|
+
}
|
166
|
+
declare class EventUtils {
|
167
|
+
static Event: EventUtils;
|
168
|
+
domLoaded: boolean;
|
169
|
+
events: Record<string, any>;
|
170
|
+
private readonly expando;
|
171
|
+
private hasFocusIn;
|
172
|
+
private hasMouseEnterLeave;
|
173
|
+
private mouseEnterLeave;
|
174
|
+
private count;
|
175
|
+
constructor();
|
176
|
+
bind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback: EventUtilsCallback<HTMLElementEventMap[K]>, scope?: any): EventUtilsCallback<HTMLElementEventMap[K]>;
|
177
|
+
bind<T = any>(target: any, names: string, callback: EventUtilsCallback<T>, scope?: any): EventUtilsCallback<T>;
|
178
|
+
unbind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback?: EventUtilsCallback<HTMLElementEventMap[K]>): this;
|
179
|
+
unbind<T = any>(target: any, names: string, callback?: EventUtilsCallback<T>): this;
|
180
|
+
unbind(target: any): this;
|
181
|
+
fire(target: any, name: string, args?: {}): this;
|
182
|
+
clean(target: any): this;
|
183
|
+
destroy(): void;
|
184
|
+
cancel<T = any>(e: EventUtilsEvent<T>): boolean;
|
185
|
+
private executeHandlers;
|
186
|
+
}
|
187
|
+
declare type DomQuerySelector<T extends Node> = string | T | T[] | DomQuery<T>;
|
188
|
+
declare type DomQueryInitSelector<T extends Node> = DomQuerySelector<T> | Window;
|
189
|
+
interface Hook {
|
190
|
+
get: <T extends Node>(elm: T) => string;
|
191
|
+
set: <T extends Node>($elm: DomQuery<T>, value: string | null) => void;
|
192
|
+
}
|
193
|
+
interface DomQueryConstructor {
|
194
|
+
readonly prototype: DomQuery;
|
195
|
+
attrHooks: Record<string, Hook>;
|
196
|
+
cssHooks: Record<string, Hook>;
|
197
|
+
fn: DomQuery;
|
198
|
+
find: any;
|
199
|
+
expr: {
|
200
|
+
cacheLength: number;
|
201
|
+
createPseudo: Function;
|
202
|
+
match: Record<string, RegExp>;
|
203
|
+
attrHandle: {};
|
204
|
+
find: Record<string, Function>;
|
205
|
+
relative: Record<string, {
|
206
|
+
dir: string;
|
207
|
+
first?: boolean;
|
208
|
+
}>;
|
209
|
+
preFilter: Record<string, Function>;
|
210
|
+
filter: Record<string, Function>;
|
211
|
+
pseudos: Record<string, Function>;
|
212
|
+
};
|
213
|
+
extend: Tools['extend'];
|
214
|
+
isArray: Tools['isArray'];
|
215
|
+
new <T extends Node = Node>(selector?: DomQueryInitSelector<T>, context?: Node): DomQuery<T>;
|
216
|
+
<T extends Node = Node>(selector?: DomQueryInitSelector<T>, context?: Node): DomQuery<T>;
|
217
|
+
overrideDefaults(callback: () => {
|
218
|
+
context: Node;
|
219
|
+
element: Element;
|
220
|
+
}): DomQueryConstructor;
|
221
|
+
makeArray<T>(object: T): T[];
|
222
|
+
inArray<T>(item: {}, array: T[]): number;
|
223
|
+
each<T>(obj: T[], callback: (i: number, value: T) => void): void;
|
224
|
+
each<T>(obj: T, callback: (key: string, obj: T[keyof T]) => void): void;
|
225
|
+
trim(str: string): string;
|
226
|
+
grep<T>(array: T[], callback: (item: any, i: number) => boolean): T[];
|
227
|
+
unique<T>(results: T[]): T[];
|
228
|
+
text(elem: Node): string;
|
229
|
+
contains(context: any, elem: Node): boolean;
|
230
|
+
filter(expr: string, elems: Node[], not?: boolean): any;
|
231
|
+
}
|
232
|
+
interface DomQuery<T extends Node = Node> extends ArrayLike<T> {
|
233
|
+
init: (selector?: DomQueryInitSelector<T>, context?: Node) => void;
|
234
|
+
context: T;
|
235
|
+
length: number;
|
236
|
+
selector: string;
|
237
|
+
add(items: Array<string | T> | DomQuery<T>, sort?: boolean): this;
|
238
|
+
addClass(className: string): this;
|
239
|
+
after(content: DomQuerySelector<T>): this;
|
240
|
+
append(content: DomQuerySelector<T>): this;
|
241
|
+
appendTo(val: DomQuerySelector<T>): this;
|
242
|
+
attr(name: string, value: string | boolean | number | null): this;
|
243
|
+
attr(attrs: Record<string, string | boolean | number | null>): this;
|
244
|
+
attr(name: string): string;
|
245
|
+
before(content: DomQuerySelector<T>): this;
|
246
|
+
children(selector?: string): DomQuery<Node & ChildNode>;
|
247
|
+
clone(): this;
|
248
|
+
closest(selector: DomQuerySelector<T>): this;
|
249
|
+
contents(selector?: string): DomQuery<Node & ChildNode>;
|
250
|
+
css(name: string, value: string | number | null): this;
|
251
|
+
css(styles: Record<string, string | number | null>): this;
|
252
|
+
css(name: string): string;
|
253
|
+
each(callback: (i: number, value: T) => void): this;
|
254
|
+
empty(): this;
|
255
|
+
eq(index: number): this;
|
256
|
+
filter(selector: string | ((i: number, item: any) => boolean)): this;
|
257
|
+
find<K extends keyof HTMLElementTagNameMap>(selector: K): DomQuery<HTMLElementTagNameMap[K]>;
|
258
|
+
find<T extends Node>(selector: string): DomQuery<T>;
|
259
|
+
first(): this;
|
260
|
+
hasClass(className: string): boolean;
|
261
|
+
hide(): this;
|
262
|
+
html(value: string): this;
|
263
|
+
html(): string;
|
264
|
+
is(selector: string | ((i: number, item: any) => boolean)): boolean;
|
265
|
+
last(): this;
|
266
|
+
next(selector?: string): DomQuery<Node & ChildNode>;
|
267
|
+
nextUntil(selector: DomQuerySelector<T>, until?: string): DomQuery<Node & ChildNode>;
|
268
|
+
off<K extends keyof HTMLElementEventMap>(name: K, callback?: EventUtilsCallback<HTMLElementEventMap[K]>): this;
|
269
|
+
off<U>(name?: string, callback?: EventUtilsCallback<U>): this;
|
270
|
+
offset(offset?: {}): {} | this;
|
271
|
+
on<K extends keyof HTMLElementEventMap>(name: K, callback: EventUtilsCallback<HTMLElementEventMap[K]>): this;
|
272
|
+
on<U>(name: string, callback: EventUtilsCallback<U>): this;
|
273
|
+
parent(selector?: string): DomQuery<Node>;
|
274
|
+
parents(selector?: string): DomQuery<Node>;
|
275
|
+
parentsUntil(selector: DomQuerySelector<T>, filter?: string): DomQuery<Node>;
|
276
|
+
prepend(content: DomQuerySelector<T>): this;
|
277
|
+
prependTo(val: DomQuerySelector<T>): this;
|
278
|
+
prev(selector?: string): DomQuery<Node & ChildNode>;
|
279
|
+
prevUntil(selector: DomQuerySelector<T>, filter?: string): DomQuery<Node & ChildNode>;
|
280
|
+
prop(name: string, value: string): this;
|
281
|
+
prop(props: Record<string, string | number>): this;
|
282
|
+
prop(name: string): string;
|
283
|
+
push(...items: T[]): number;
|
284
|
+
remove(): this;
|
285
|
+
removeAttr(name: string): this;
|
286
|
+
removeClass(className: string): this;
|
287
|
+
replaceWith(content: DomQuerySelector<T>): this;
|
288
|
+
show(): this;
|
289
|
+
slice(start: number, end?: number): this;
|
290
|
+
splice(start: number, deleteCount?: number): T[];
|
291
|
+
sort(compareFn?: (a: T, b: T) => number): T[];
|
292
|
+
text(value: string): DomQuery;
|
293
|
+
text(): string;
|
294
|
+
toArray(): T[];
|
295
|
+
toggleClass(className: string, state?: boolean): this;
|
296
|
+
trigger(name: string | {
|
297
|
+
type: string;
|
298
|
+
}): this;
|
299
|
+
unwrap(): this;
|
300
|
+
wrap(content: DomQuerySelector<T>): this;
|
301
|
+
wrapAll(content: DomQuerySelector<T>): this;
|
302
|
+
wrapInner(content: string): this;
|
303
|
+
}
|
304
|
+
declare type SchemaType = 'html4' | 'html5' | 'html5-strict';
|
305
|
+
interface SchemaSettings {
|
306
|
+
block_elements?: string;
|
307
|
+
boolean_attributes?: string;
|
308
|
+
custom_elements?: string;
|
309
|
+
extended_valid_elements?: string;
|
310
|
+
invalid_elements?: string;
|
311
|
+
invalid_styles?: string | Record<string, string>;
|
312
|
+
move_caret_before_on_enter_elements?: string;
|
313
|
+
non_empty_elements?: string;
|
314
|
+
schema?: SchemaType;
|
315
|
+
self_closing_elements?: string;
|
316
|
+
short_ended_elements?: string;
|
317
|
+
special?: string;
|
318
|
+
text_block_elements?: string;
|
319
|
+
text_inline_elements?: string;
|
320
|
+
valid_children?: string;
|
321
|
+
valid_classes?: string | Record<string, string>;
|
322
|
+
valid_elements?: string;
|
323
|
+
valid_styles?: string | Record<string, string>;
|
324
|
+
verify_html?: boolean;
|
325
|
+
whitespace_elements?: string;
|
326
|
+
padd_empty_block_inline_children?: boolean;
|
327
|
+
}
|
328
|
+
interface Attribute {
|
329
|
+
required?: boolean;
|
330
|
+
defaultValue?: string;
|
331
|
+
forcedValue?: string;
|
332
|
+
validValues?: any;
|
333
|
+
}
|
334
|
+
interface DefaultAttribute {
|
335
|
+
name: string;
|
336
|
+
value: string;
|
337
|
+
}
|
338
|
+
interface AttributePattern {
|
339
|
+
defaultValue?: string;
|
340
|
+
forcedValue?: string;
|
341
|
+
pattern: RegExp;
|
342
|
+
required?: boolean;
|
343
|
+
validValues?: Record<string, string>;
|
344
|
+
}
|
345
|
+
interface ElementRule {
|
346
|
+
attributes: Record<string, Attribute>;
|
347
|
+
attributesDefault?: DefaultAttribute[];
|
348
|
+
attributesForced?: DefaultAttribute[];
|
349
|
+
attributesOrder: string[];
|
350
|
+
attributePatterns?: AttributePattern[];
|
351
|
+
attributesRequired?: string[];
|
352
|
+
paddEmpty?: boolean;
|
353
|
+
removeEmpty?: boolean;
|
354
|
+
removeEmptyAttrs?: boolean;
|
355
|
+
paddInEmptyBlock?: boolean;
|
356
|
+
}
|
357
|
+
interface SchemaElement extends ElementRule {
|
358
|
+
outputName?: string;
|
359
|
+
parentsRequired?: string[];
|
360
|
+
pattern?: RegExp;
|
361
|
+
}
|
362
|
+
interface SchemaMap {
|
363
|
+
[name: string]: {};
|
364
|
+
}
|
365
|
+
interface SchemaRegExpMap {
|
366
|
+
[name: string]: RegExp;
|
367
|
+
}
|
368
|
+
interface Schema {
|
369
|
+
children: Record<string, SchemaMap>;
|
370
|
+
elements: Record<string, SchemaElement>;
|
371
|
+
getValidStyles: () => Record<string, string[]> | undefined;
|
372
|
+
getValidClasses: () => Record<string, SchemaMap> | undefined;
|
373
|
+
getBlockElements: () => SchemaMap;
|
374
|
+
getInvalidStyles: () => Record<string, SchemaMap> | undefined;
|
375
|
+
getShortEndedElements: () => SchemaMap;
|
376
|
+
getTextBlockElements: () => SchemaMap;
|
377
|
+
getTextInlineElements: () => SchemaMap;
|
378
|
+
getBoolAttrs: () => SchemaMap;
|
379
|
+
getElementRule: (name: string) => SchemaElement | undefined;
|
380
|
+
getSelfClosingElements: () => SchemaMap;
|
381
|
+
getNonEmptyElements: () => SchemaMap;
|
382
|
+
getMoveCaretBeforeOnEnterElements: () => SchemaMap;
|
383
|
+
getWhiteSpaceElements: () => SchemaMap;
|
384
|
+
getSpecialElements: () => SchemaRegExpMap;
|
385
|
+
isValidChild: (name: string, child: string) => boolean;
|
386
|
+
isValid: (name: string, attr?: string) => boolean;
|
387
|
+
getCustomElements: () => SchemaMap;
|
388
|
+
addValidElements: (validElements: string) => void;
|
389
|
+
setValidElements: (validElements: string) => void;
|
390
|
+
addCustomElements: (customElements: string) => void;
|
391
|
+
addValidChildren: (validChildren: any) => void;
|
392
|
+
}
|
393
|
+
declare type Attributes$1 = Array<{
|
394
|
+
name: string;
|
395
|
+
value: string;
|
396
|
+
}> & {
|
397
|
+
map: Record<string, string>;
|
398
|
+
};
|
399
|
+
interface AstNodeConstructor {
|
400
|
+
readonly prototype: AstNode;
|
401
|
+
new (name: string, type: number): AstNode;
|
402
|
+
create(name: string, attrs?: Record<string, string>): AstNode;
|
403
|
+
}
|
404
|
+
declare class AstNode {
|
405
|
+
static create(name: string, attrs?: Record<string, string>): AstNode;
|
406
|
+
name: string;
|
407
|
+
type: number;
|
408
|
+
attributes?: Attributes$1;
|
409
|
+
value?: string;
|
410
|
+
shortEnded?: boolean;
|
411
|
+
parent?: AstNode;
|
412
|
+
firstChild?: AstNode;
|
413
|
+
lastChild?: AstNode;
|
414
|
+
next?: AstNode;
|
415
|
+
prev?: AstNode;
|
416
|
+
raw?: boolean;
|
417
|
+
fixed?: boolean;
|
418
|
+
constructor(name: string, type: number);
|
419
|
+
replace(node: AstNode): AstNode;
|
420
|
+
attr(name: string, value: string | null): AstNode | undefined;
|
421
|
+
attr(name: Record<string, string | null>): AstNode | undefined;
|
422
|
+
attr(name: string): string | undefined;
|
423
|
+
clone(): AstNode;
|
424
|
+
wrap(wrapper: AstNode): AstNode;
|
425
|
+
unwrap(): void;
|
426
|
+
remove(): AstNode;
|
427
|
+
append(node: AstNode): AstNode;
|
428
|
+
insert(node: AstNode, refNode: AstNode, before?: boolean): AstNode;
|
429
|
+
getAll(name: string): AstNode[];
|
430
|
+
children(): AstNode[];
|
431
|
+
empty(): AstNode;
|
432
|
+
isEmpty(elements: SchemaMap, whitespace?: SchemaMap, predicate?: (node: AstNode) => boolean): boolean;
|
433
|
+
walk(prev?: boolean): AstNode;
|
434
|
+
}
|
435
|
+
declare type Content = string | AstNode;
|
436
|
+
declare type ContentFormat = 'raw' | 'text' | 'html' | 'tree';
|
437
|
+
interface GetContentArgs {
|
438
|
+
format?: ContentFormat;
|
439
|
+
get?: boolean;
|
440
|
+
content?: string;
|
441
|
+
getInner?: boolean;
|
442
|
+
no_events?: boolean;
|
443
|
+
[key: string]: any;
|
444
|
+
}
|
445
|
+
interface SetContentArgs {
|
446
|
+
format?: string;
|
447
|
+
set?: boolean;
|
448
|
+
content?: string;
|
449
|
+
no_events?: boolean;
|
450
|
+
no_selection?: boolean;
|
451
|
+
}
|
452
|
+
interface BlobInfoData {
|
453
|
+
id?: string;
|
454
|
+
name?: string;
|
455
|
+
filename?: string;
|
456
|
+
blob: Blob;
|
457
|
+
base64: string;
|
458
|
+
blobUri?: string;
|
459
|
+
uri?: string;
|
460
|
+
}
|
461
|
+
interface BlobInfo {
|
462
|
+
id: () => string;
|
463
|
+
name: () => string;
|
464
|
+
filename: () => string;
|
465
|
+
blob: () => Blob;
|
466
|
+
base64: () => string;
|
467
|
+
blobUri: () => string;
|
468
|
+
uri: () => string | undefined;
|
469
|
+
}
|
470
|
+
interface BlobCache {
|
471
|
+
create: (o: string | BlobInfoData, blob?: Blob, base64?: string, name?: string, filename?: string) => BlobInfo;
|
472
|
+
add: (blobInfo: BlobInfo) => void;
|
473
|
+
get: (id: string) => BlobInfo | undefined;
|
474
|
+
getByUri: (blobUri: string) => BlobInfo | undefined;
|
475
|
+
getByData: (base64: string, type: string) => BlobInfo | undefined;
|
476
|
+
findFirst: (predicate: (blobInfo: BlobInfo) => boolean) => BlobInfo | undefined;
|
477
|
+
removeByUri: (blobUri: string) => void;
|
478
|
+
destroy: () => void;
|
479
|
+
}
|
480
|
+
interface NotificationManagerImpl {
|
481
|
+
open: (spec: NotificationSpec, closeCallback?: () => void) => NotificationApi;
|
482
|
+
close: <T extends NotificationApi>(notification: T) => void;
|
483
|
+
reposition: <T extends NotificationApi>(notifications: T[]) => void;
|
484
|
+
getArgs: <T extends NotificationApi>(notification: T) => NotificationSpec;
|
485
|
+
}
|
486
|
+
interface NotificationSpec {
|
487
|
+
type?: 'info' | 'warning' | 'error' | 'success';
|
488
|
+
text: string;
|
489
|
+
icon?: string;
|
490
|
+
progressBar?: boolean;
|
491
|
+
timeout?: number;
|
492
|
+
closeButton?: boolean;
|
493
|
+
}
|
494
|
+
interface NotificationApi {
|
495
|
+
close: () => void;
|
496
|
+
progressBar: {
|
497
|
+
value: (percent: number) => void;
|
498
|
+
};
|
499
|
+
text: (text: string) => void;
|
500
|
+
moveTo: (x: number, y: number) => void;
|
501
|
+
moveRel: (element: Element, rel: 'tc-tc' | 'bc-bc' | 'bc-tc' | 'tc-bc' | 'banner') => void;
|
502
|
+
getEl: () => HTMLElement;
|
503
|
+
settings: NotificationSpec;
|
504
|
+
}
|
505
|
+
interface NotificationManager {
|
506
|
+
open: (spec: NotificationSpec) => NotificationApi;
|
507
|
+
close: () => void;
|
508
|
+
getNotifications: () => NotificationApi[];
|
509
|
+
}
|
510
|
+
interface UploadFailureOptions {
|
511
|
+
remove?: boolean;
|
512
|
+
}
|
513
|
+
declare type UploadHandler = (blobInfo: BlobInfo, success: (url: string) => void, failure: (err: string, options?: UploadFailureOptions) => void, progress?: (percent: number) => void) => void;
|
514
|
+
interface UploadResult$2 {
|
515
|
+
url: string;
|
516
|
+
blobInfo: BlobInfo;
|
517
|
+
status: boolean;
|
518
|
+
error?: {
|
519
|
+
options: UploadFailureOptions;
|
520
|
+
message: string;
|
521
|
+
};
|
522
|
+
}
|
523
|
+
interface RangeLikeObject {
|
524
|
+
startContainer: Node;
|
525
|
+
startOffset: number;
|
526
|
+
endContainer: Node;
|
527
|
+
endOffset: number;
|
528
|
+
}
|
529
|
+
declare type ApplyFormat = BlockFormat | InlineFormat | SelectorFormat;
|
530
|
+
declare type RemoveFormat = RemoveBlockFormat | RemoveInlineFormat | RemoveSelectorFormat;
|
531
|
+
declare type Format = ApplyFormat | RemoveFormat;
|
532
|
+
declare type Formats = Record<string, Format | Format[]>;
|
533
|
+
declare type FormatAttrOrStyleValue = string | ((vars?: FormatVars) => string);
|
534
|
+
declare type FormatVars = Record<string, string | null>;
|
535
|
+
interface BaseFormat<T> {
|
536
|
+
ceFalseOverride?: boolean;
|
537
|
+
classes?: string | string[];
|
538
|
+
collapsed?: boolean;
|
539
|
+
exact?: boolean;
|
540
|
+
expand?: boolean;
|
541
|
+
links?: boolean;
|
542
|
+
mixed?: boolean;
|
543
|
+
block_expand?: boolean;
|
544
|
+
onmatch?: (node: Node, fmt: T, itemName: string) => boolean;
|
545
|
+
remove?: 'none' | 'empty' | 'all';
|
546
|
+
remove_similar?: boolean;
|
547
|
+
split?: boolean;
|
548
|
+
deep?: boolean;
|
549
|
+
preserve_attributes?: string[];
|
550
|
+
}
|
551
|
+
interface Block {
|
552
|
+
block: string;
|
553
|
+
list_block?: string;
|
554
|
+
wrapper?: boolean;
|
555
|
+
}
|
556
|
+
interface Inline {
|
557
|
+
inline: string;
|
558
|
+
}
|
559
|
+
interface Selector {
|
560
|
+
selector: string;
|
561
|
+
inherit?: boolean;
|
562
|
+
}
|
563
|
+
interface CommonFormat<T> extends BaseFormat<T> {
|
564
|
+
attributes?: Record<string, FormatAttrOrStyleValue>;
|
565
|
+
styles?: Record<string, FormatAttrOrStyleValue>;
|
566
|
+
toggle?: boolean;
|
567
|
+
preview?: string | false;
|
568
|
+
onformat?: (elm: Node, fmt: T, vars?: FormatVars, node?: Node | RangeLikeObject) => void;
|
569
|
+
clear_child_styles?: boolean;
|
570
|
+
merge_siblings?: boolean;
|
571
|
+
merge_with_parents?: boolean;
|
572
|
+
defaultBlock?: string;
|
573
|
+
}
|
574
|
+
interface BlockFormat extends Block, CommonFormat<BlockFormat> {
|
575
|
+
}
|
576
|
+
interface InlineFormat extends Inline, CommonFormat<InlineFormat> {
|
577
|
+
}
|
578
|
+
interface SelectorFormat extends Selector, CommonFormat<SelectorFormat> {
|
579
|
+
}
|
580
|
+
interface CommonRemoveFormat<T> extends BaseFormat<T> {
|
581
|
+
attributes?: string[] | Record<string, FormatAttrOrStyleValue>;
|
582
|
+
styles?: string[] | Record<string, FormatAttrOrStyleValue>;
|
583
|
+
}
|
584
|
+
interface RemoveBlockFormat extends Block, CommonRemoveFormat<RemoveBlockFormat> {
|
585
|
+
}
|
586
|
+
interface RemoveInlineFormat extends Inline, CommonRemoveFormat<RemoveInlineFormat> {
|
587
|
+
}
|
588
|
+
interface RemoveSelectorFormat extends Selector, CommonRemoveFormat<RemoveSelectorFormat> {
|
589
|
+
}
|
590
|
+
type Format_d_Formats = Formats;
|
591
|
+
type Format_d_Format = Format;
|
592
|
+
type Format_d_ApplyFormat = ApplyFormat;
|
593
|
+
type Format_d_BlockFormat = BlockFormat;
|
594
|
+
type Format_d_InlineFormat = InlineFormat;
|
595
|
+
type Format_d_SelectorFormat = SelectorFormat;
|
596
|
+
type Format_d_RemoveFormat = RemoveFormat;
|
597
|
+
type Format_d_RemoveBlockFormat = RemoveBlockFormat;
|
598
|
+
type Format_d_RemoveInlineFormat = RemoveInlineFormat;
|
599
|
+
type Format_d_RemoveSelectorFormat = RemoveSelectorFormat;
|
600
|
+
declare namespace Format_d {
|
601
|
+
export { Format_d_Formats as Formats, Format_d_Format as Format, Format_d_ApplyFormat as ApplyFormat, Format_d_BlockFormat as BlockFormat, Format_d_InlineFormat as InlineFormat, Format_d_SelectorFormat as SelectorFormat, Format_d_RemoveFormat as RemoveFormat, Format_d_RemoveBlockFormat as RemoveBlockFormat, Format_d_RemoveInlineFormat as RemoveInlineFormat, Format_d_RemoveSelectorFormat as RemoveSelectorFormat, };
|
602
|
+
}
|
603
|
+
declare type StyleFormat = BlockStyleFormat | InlineStyleFormat | SelectorStyleFormat;
|
604
|
+
declare type AllowedFormat = Separator | FormatReference | StyleFormat | NestedFormatting;
|
605
|
+
interface Separator {
|
606
|
+
title: string;
|
607
|
+
}
|
608
|
+
interface FormatReference {
|
609
|
+
title: string;
|
610
|
+
format: string;
|
611
|
+
icon?: string;
|
612
|
+
}
|
613
|
+
interface NestedFormatting {
|
614
|
+
title: string;
|
615
|
+
items: Array<FormatReference | StyleFormat>;
|
616
|
+
}
|
617
|
+
interface CommonStyleFormat {
|
618
|
+
name?: string;
|
619
|
+
title: string;
|
620
|
+
icon?: string;
|
621
|
+
}
|
622
|
+
interface BlockStyleFormat extends BlockFormat, CommonStyleFormat {
|
623
|
+
}
|
624
|
+
interface InlineStyleFormat extends InlineFormat, CommonStyleFormat {
|
625
|
+
}
|
626
|
+
interface SelectorStyleFormat extends SelectorFormat, CommonStyleFormat {
|
627
|
+
}
|
628
|
+
interface AlertBannerSpec {
|
629
|
+
type: 'alertbanner';
|
630
|
+
level: 'info' | 'warn' | 'error' | 'success';
|
631
|
+
text: string;
|
632
|
+
icon: string;
|
633
|
+
url?: string;
|
634
|
+
}
|
635
|
+
interface ButtonSpec {
|
636
|
+
type: 'button';
|
637
|
+
text: string;
|
638
|
+
disabled?: boolean;
|
639
|
+
primary?: boolean;
|
640
|
+
name?: string;
|
641
|
+
icon?: string;
|
642
|
+
borderless?: boolean;
|
643
|
+
}
|
644
|
+
interface CheckboxSpec {
|
645
|
+
name: string;
|
646
|
+
type: 'checkbox';
|
647
|
+
label: string;
|
648
|
+
disabled?: boolean;
|
649
|
+
}
|
650
|
+
interface FormComponentSpec {
|
651
|
+
type: string;
|
652
|
+
name: string;
|
653
|
+
}
|
654
|
+
interface FormComponentWithLabelSpec extends FormComponentSpec {
|
655
|
+
label?: string;
|
656
|
+
}
|
657
|
+
interface CollectionSpec extends FormComponentWithLabelSpec {
|
658
|
+
type: 'collection';
|
659
|
+
}
|
660
|
+
interface ColorInputSpec extends FormComponentWithLabelSpec {
|
661
|
+
type: 'colorinput';
|
662
|
+
}
|
663
|
+
interface ColorPickerSpec extends FormComponentWithLabelSpec {
|
664
|
+
type: 'colorpicker';
|
665
|
+
}
|
666
|
+
interface CustomEditorInit {
|
667
|
+
setValue: (value: string) => void;
|
668
|
+
getValue: () => string;
|
669
|
+
destroy: () => void;
|
670
|
+
}
|
671
|
+
declare type CustomEditorInitFn = (elm: HTMLElement, settings: any) => Promise<CustomEditorInit>;
|
672
|
+
interface CustomEditorOldSpec extends FormComponentSpec {
|
673
|
+
type: 'customeditor';
|
674
|
+
tag?: string;
|
675
|
+
init: (e: HTMLElement) => Promise<CustomEditorInit>;
|
676
|
+
}
|
677
|
+
interface CustomEditorNewSpec extends FormComponentSpec {
|
678
|
+
type: 'customeditor';
|
679
|
+
tag?: string;
|
680
|
+
scriptId: string;
|
681
|
+
scriptUrl: string;
|
682
|
+
settings?: any;
|
683
|
+
}
|
684
|
+
declare type CustomEditorSpec = CustomEditorOldSpec | CustomEditorNewSpec;
|
685
|
+
interface DropZoneSpec extends FormComponentWithLabelSpec {
|
686
|
+
type: 'dropzone';
|
687
|
+
}
|
688
|
+
interface GridSpec {
|
689
|
+
type: 'grid';
|
690
|
+
columns: number;
|
691
|
+
items: BodyComponentSpec[];
|
692
|
+
}
|
693
|
+
interface HtmlPanelSpec {
|
694
|
+
type: 'htmlpanel';
|
695
|
+
html: string;
|
696
|
+
presets?: 'presentation' | 'document';
|
697
|
+
}
|
698
|
+
interface IframeSpec extends FormComponentWithLabelSpec {
|
699
|
+
type: 'iframe';
|
700
|
+
sandboxed?: boolean;
|
701
|
+
}
|
702
|
+
interface ImageToolsState {
|
703
|
+
blob: Blob;
|
704
|
+
url: string;
|
705
|
+
}
|
706
|
+
interface ImageToolsSpec extends FormComponentWithLabelSpec {
|
707
|
+
type: 'imagetools';
|
708
|
+
currentState: ImageToolsState;
|
709
|
+
}
|
710
|
+
interface InputSpec extends FormComponentWithLabelSpec {
|
711
|
+
type: 'input';
|
712
|
+
inputMode?: string;
|
713
|
+
placeholder?: string;
|
714
|
+
maximized?: boolean;
|
715
|
+
disabled?: boolean;
|
716
|
+
}
|
717
|
+
interface LabelSpec {
|
718
|
+
type: 'label';
|
719
|
+
label: string;
|
720
|
+
items: BodyComponentSpec[];
|
721
|
+
}
|
722
|
+
interface ListBoxSingleItemSpec {
|
723
|
+
text: string;
|
724
|
+
value: string;
|
725
|
+
}
|
726
|
+
interface ListBoxNestedItemSpec {
|
727
|
+
text: string;
|
728
|
+
items: ListBoxItemSpec[];
|
729
|
+
}
|
730
|
+
declare type ListBoxItemSpec = ListBoxNestedItemSpec | ListBoxSingleItemSpec;
|
731
|
+
interface ListBoxSpec extends FormComponentWithLabelSpec {
|
732
|
+
type: 'listbox';
|
733
|
+
items: ListBoxItemSpec[];
|
734
|
+
disabled?: boolean;
|
735
|
+
}
|
736
|
+
interface PanelSpec {
|
737
|
+
type: 'panel';
|
738
|
+
classes?: string[];
|
739
|
+
items: BodyComponentSpec[];
|
740
|
+
}
|
741
|
+
interface SelectBoxItemSpec {
|
742
|
+
text: string;
|
743
|
+
value: string;
|
744
|
+
}
|
745
|
+
interface SelectBoxSpec extends FormComponentWithLabelSpec {
|
746
|
+
type: 'selectbox';
|
747
|
+
items: SelectBoxItemSpec[];
|
748
|
+
size?: number;
|
749
|
+
disabled?: boolean;
|
750
|
+
}
|
751
|
+
interface SizeInputSpec extends FormComponentWithLabelSpec {
|
752
|
+
type: 'sizeinput';
|
753
|
+
constrain?: boolean;
|
754
|
+
disabled?: boolean;
|
755
|
+
}
|
756
|
+
interface TableSpec {
|
757
|
+
type: 'table';
|
758
|
+
header: string[];
|
759
|
+
cells: string[][];
|
760
|
+
}
|
761
|
+
interface TextAreaSpec extends FormComponentWithLabelSpec {
|
762
|
+
type: 'textarea';
|
763
|
+
placeholder?: string;
|
764
|
+
maximized?: boolean;
|
765
|
+
disabled?: boolean;
|
766
|
+
}
|
767
|
+
interface UrlInputSpec extends FormComponentWithLabelSpec {
|
768
|
+
type: 'urlinput';
|
769
|
+
filetype?: 'image' | 'media' | 'file';
|
770
|
+
disabled?: boolean;
|
771
|
+
}
|
772
|
+
declare type BodyComponentSpec = BarSpec | ButtonSpec | CheckboxSpec | TextAreaSpec | InputSpec | ListBoxSpec | SelectBoxSpec | SizeInputSpec | IframeSpec | HtmlPanelSpec | UrlInputSpec | DropZoneSpec | ColorInputSpec | GridSpec | ColorPickerSpec | ImageToolsSpec | AlertBannerSpec | CollectionSpec | LabelSpec | TableSpec | PanelSpec | CustomEditorSpec;
|
773
|
+
interface BarSpec {
|
774
|
+
type: 'bar';
|
775
|
+
items: BodyComponentSpec[];
|
776
|
+
}
|
777
|
+
interface CommonMenuItemSpec {
|
778
|
+
disabled?: boolean;
|
779
|
+
text?: string;
|
780
|
+
value?: string;
|
781
|
+
meta?: Record<string, any>;
|
782
|
+
shortcut?: string;
|
783
|
+
}
|
784
|
+
interface CommonMenuItemInstanceApi {
|
785
|
+
isDisabled: () => boolean;
|
786
|
+
setDisabled: (state: boolean) => void;
|
787
|
+
}
|
788
|
+
interface DialogToggleMenuItemSpec extends CommonMenuItemSpec {
|
789
|
+
type?: 'togglemenuitem';
|
790
|
+
name: string;
|
791
|
+
}
|
792
|
+
declare type DialogFooterMenuButtonItemSpec = DialogToggleMenuItemSpec;
|
793
|
+
interface BaseDialogFooterButtonSpec {
|
794
|
+
name?: string;
|
795
|
+
align?: 'start' | 'end';
|
796
|
+
primary?: boolean;
|
797
|
+
disabled?: boolean;
|
798
|
+
icon?: string;
|
799
|
+
}
|
800
|
+
interface DialogFooterNormalButtonSpec extends BaseDialogFooterButtonSpec {
|
801
|
+
type: 'submit' | 'cancel' | 'custom';
|
802
|
+
text: string;
|
803
|
+
}
|
804
|
+
interface DialogFooterMenuButtonSpec extends BaseDialogFooterButtonSpec {
|
805
|
+
type: 'menu';
|
806
|
+
text?: string;
|
807
|
+
tooltip?: string;
|
808
|
+
icon?: string;
|
809
|
+
items: DialogFooterMenuButtonItemSpec[];
|
810
|
+
}
|
811
|
+
declare type DialogFooterButtonSpec = DialogFooterNormalButtonSpec | DialogFooterMenuButtonSpec;
|
812
|
+
interface TabSpec {
|
813
|
+
name?: string;
|
814
|
+
title: string;
|
815
|
+
items: BodyComponentSpec[];
|
816
|
+
}
|
817
|
+
interface TabPanelSpec {
|
818
|
+
type: 'tabpanel';
|
819
|
+
tabs: TabSpec[];
|
820
|
+
}
|
821
|
+
declare type DialogDataItem = any;
|
822
|
+
declare type DialogData = Record<string, DialogDataItem>;
|
823
|
+
interface DialogInstanceApi<T extends DialogData> {
|
824
|
+
getData: () => T;
|
825
|
+
setData: (data: Partial<T>) => void;
|
826
|
+
disable: (name: string) => void;
|
827
|
+
focus: (name: string) => void;
|
828
|
+
showTab: (name: string) => void;
|
829
|
+
redial: (nu: DialogSpec<T>) => void;
|
830
|
+
enable: (name: string) => void;
|
831
|
+
block: (msg: string) => void;
|
832
|
+
unblock: () => void;
|
833
|
+
close: () => void;
|
834
|
+
}
|
835
|
+
interface DialogActionDetails {
|
836
|
+
name: string;
|
837
|
+
value?: any;
|
838
|
+
}
|
839
|
+
interface DialogChangeDetails<T> {
|
840
|
+
name: keyof T;
|
841
|
+
}
|
842
|
+
interface DialogTabChangeDetails {
|
843
|
+
newTabName: string;
|
844
|
+
oldTabName: string;
|
845
|
+
}
|
846
|
+
declare type DialogActionHandler<T> = (api: DialogInstanceApi<T>, details: DialogActionDetails) => void;
|
847
|
+
declare type DialogChangeHandler<T> = (api: DialogInstanceApi<T>, details: DialogChangeDetails<T>) => void;
|
848
|
+
declare type DialogSubmitHandler<T> = (api: DialogInstanceApi<T>) => void;
|
849
|
+
declare type DialogCloseHandler = () => void;
|
850
|
+
declare type DialogCancelHandler<T> = (api: DialogInstanceApi<T>) => void;
|
851
|
+
declare type DialogTabChangeHandler<T> = (api: DialogInstanceApi<T>, details: DialogTabChangeDetails) => void;
|
852
|
+
declare type DialogSize = 'normal' | 'medium' | 'large';
|
853
|
+
interface DialogSpec<T extends DialogData> {
|
854
|
+
title: string;
|
855
|
+
size?: DialogSize;
|
856
|
+
body: TabPanelSpec | PanelSpec;
|
857
|
+
buttons: DialogFooterButtonSpec[];
|
858
|
+
initialData?: T;
|
859
|
+
onAction?: DialogActionHandler<T>;
|
860
|
+
onChange?: DialogChangeHandler<T>;
|
861
|
+
onSubmit?: DialogSubmitHandler<T>;
|
862
|
+
onClose?: DialogCloseHandler;
|
863
|
+
onCancel?: DialogCancelHandler<T>;
|
864
|
+
onTabChange?: DialogTabChangeHandler<T>;
|
865
|
+
}
|
866
|
+
interface UrlDialogInstanceApi {
|
867
|
+
block: (msg: string) => void;
|
868
|
+
unblock: () => void;
|
869
|
+
close: () => void;
|
870
|
+
sendMessage: (msg: any) => void;
|
871
|
+
}
|
872
|
+
interface UrlDialogActionDetails {
|
873
|
+
name: string;
|
874
|
+
value?: any;
|
875
|
+
}
|
876
|
+
interface UrlDialogMessage {
|
877
|
+
mceAction: string;
|
878
|
+
[key: string]: any;
|
879
|
+
}
|
880
|
+
declare type UrlDialogActionHandler = (api: UrlDialogInstanceApi, actions: UrlDialogActionDetails) => void;
|
881
|
+
declare type UrlDialogCloseHandler = () => void;
|
882
|
+
declare type UrlDialogCancelHandler = (api: UrlDialogInstanceApi) => void;
|
883
|
+
declare type UrlDialogMessageHandler = (api: UrlDialogInstanceApi, message: UrlDialogMessage) => void;
|
884
|
+
interface UrlDialogFooterButtonSpec extends DialogFooterNormalButtonSpec {
|
885
|
+
type: 'cancel' | 'custom';
|
886
|
+
}
|
887
|
+
interface UrlDialogSpec {
|
888
|
+
title: string;
|
889
|
+
url: string;
|
890
|
+
height?: number;
|
891
|
+
width?: number;
|
892
|
+
buttons?: UrlDialogFooterButtonSpec[];
|
893
|
+
onAction?: UrlDialogActionHandler;
|
894
|
+
onClose?: UrlDialogCloseHandler;
|
895
|
+
onCancel?: UrlDialogCancelHandler;
|
896
|
+
onMessage?: UrlDialogMessageHandler;
|
897
|
+
}
|
898
|
+
declare type CardContainerDirection = 'vertical' | 'horizontal';
|
899
|
+
declare type CardContainerAlign = 'left' | 'right';
|
900
|
+
declare type CardContainerValign = 'top' | 'middle' | 'bottom';
|
901
|
+
interface CardContainerSpec {
|
902
|
+
type: 'cardcontainer';
|
903
|
+
items: CardItemSpec[];
|
904
|
+
direction?: CardContainerDirection;
|
905
|
+
align?: CardContainerAlign;
|
906
|
+
valign?: CardContainerValign;
|
907
|
+
}
|
908
|
+
interface CardImageSpec {
|
909
|
+
type: 'cardimage';
|
910
|
+
src: string;
|
911
|
+
alt?: string;
|
912
|
+
classes?: string[];
|
913
|
+
}
|
914
|
+
interface CardTextSpec {
|
915
|
+
type: 'cardtext';
|
916
|
+
text: string;
|
917
|
+
name?: string;
|
918
|
+
classes?: string[];
|
919
|
+
}
|
920
|
+
declare type CardItemSpec = CardContainerSpec | CardImageSpec | CardTextSpec;
|
921
|
+
interface CardMenuItemInstanceApi extends CommonMenuItemInstanceApi {
|
922
|
+
}
|
923
|
+
interface CardMenuItemSpec extends Omit<CommonMenuItemSpec, 'text' | 'shortcut'> {
|
924
|
+
type: 'cardmenuitem';
|
925
|
+
label?: string;
|
926
|
+
items: CardItemSpec[];
|
927
|
+
onSetup?: (api: CardMenuItemInstanceApi) => (api: CardMenuItemInstanceApi) => void;
|
928
|
+
onAction?: (api: CardMenuItemInstanceApi) => void;
|
929
|
+
}
|
930
|
+
interface SeparatorMenuItemSpec {
|
931
|
+
type?: 'separator';
|
932
|
+
text?: string;
|
933
|
+
}
|
934
|
+
declare type ColumnTypes$1 = number | 'auto';
|
935
|
+
declare type SeparatorItemSpec = SeparatorMenuItemSpec;
|
936
|
+
interface AutocompleterItemSpec {
|
937
|
+
type?: 'autocompleteitem';
|
938
|
+
value: string;
|
939
|
+
text?: string;
|
940
|
+
icon?: string;
|
941
|
+
meta?: Record<string, any>;
|
942
|
+
}
|
943
|
+
declare type AutocompleterContents = SeparatorItemSpec | AutocompleterItemSpec | CardMenuItemSpec;
|
944
|
+
interface AutocompleterSpec {
|
945
|
+
type?: 'autocompleter';
|
946
|
+
ch: string;
|
947
|
+
minChars?: number;
|
948
|
+
columns?: ColumnTypes$1;
|
949
|
+
matches?: (rng: Range, text: string, pattern: string) => boolean;
|
950
|
+
fetch: (pattern: string, maxResults: number, fetchOptions: Record<string, any>) => Promise<AutocompleterContents[]>;
|
951
|
+
onAction: (autocompleterApi: AutocompleterInstanceApi, rng: Range, value: string, meta: Record<string, any>) => void;
|
952
|
+
maxResults?: number;
|
953
|
+
highlightOn?: string[];
|
954
|
+
}
|
955
|
+
interface AutocompleterInstanceApi {
|
956
|
+
hide: () => void;
|
957
|
+
reload: (fetchOptions: Record<string, any>) => void;
|
958
|
+
}
|
959
|
+
declare type ContextPosition = 'node' | 'selection' | 'line';
|
960
|
+
declare type ContextScope = 'node' | 'editor';
|
961
|
+
interface ContextBarSpec {
|
962
|
+
predicate?: (elem: Element) => boolean;
|
963
|
+
position?: ContextPosition;
|
964
|
+
scope?: ContextScope;
|
965
|
+
}
|
966
|
+
interface BaseToolbarButtonSpec<I extends BaseToolbarButtonInstanceApi> {
|
967
|
+
disabled?: boolean;
|
968
|
+
tooltip?: string;
|
969
|
+
icon?: string;
|
970
|
+
text?: string;
|
971
|
+
onSetup?: (api: I) => (api: I) => void;
|
972
|
+
}
|
973
|
+
interface BaseToolbarButtonInstanceApi {
|
974
|
+
isDisabled: () => boolean;
|
975
|
+
setDisabled: (state: boolean) => void;
|
976
|
+
}
|
977
|
+
interface ToolbarButtonSpec extends BaseToolbarButtonSpec<ToolbarButtonInstanceApi> {
|
978
|
+
type?: 'button';
|
979
|
+
onAction: (api: ToolbarButtonInstanceApi) => void;
|
980
|
+
}
|
981
|
+
interface ToolbarButtonInstanceApi extends BaseToolbarButtonInstanceApi {
|
982
|
+
}
|
983
|
+
interface BaseToolbarToggleButtonSpec<I extends BaseToolbarButtonInstanceApi> extends BaseToolbarButtonSpec<I> {
|
984
|
+
active?: boolean;
|
985
|
+
}
|
986
|
+
interface BaseToolbarToggleButtonInstanceApi extends BaseToolbarButtonInstanceApi {
|
987
|
+
isActive: () => boolean;
|
988
|
+
setActive: (state: boolean) => void;
|
989
|
+
}
|
990
|
+
interface ToolbarToggleButtonSpec extends BaseToolbarToggleButtonSpec<ToolbarToggleButtonInstanceApi> {
|
991
|
+
type?: 'togglebutton';
|
992
|
+
onAction: (api: ToolbarToggleButtonInstanceApi) => void;
|
993
|
+
}
|
994
|
+
interface ToolbarToggleButtonInstanceApi extends BaseToolbarToggleButtonInstanceApi {
|
995
|
+
}
|
996
|
+
interface ContextFormLaunchButtonApi extends BaseToolbarButtonSpec<BaseToolbarButtonInstanceApi> {
|
997
|
+
type: 'contextformbutton';
|
998
|
+
}
|
999
|
+
interface ContextFormLaunchToggleButtonSpec extends BaseToolbarToggleButtonSpec<BaseToolbarToggleButtonInstanceApi> {
|
1000
|
+
type: 'contextformtogglebutton';
|
1001
|
+
}
|
1002
|
+
interface ContextFormButtonInstanceApi extends BaseToolbarButtonInstanceApi {
|
1003
|
+
}
|
1004
|
+
interface ContextFormToggleButtonInstanceApi extends BaseToolbarToggleButtonInstanceApi {
|
1005
|
+
}
|
1006
|
+
interface ContextFormButtonSpec extends BaseToolbarButtonSpec<ContextFormButtonInstanceApi> {
|
1007
|
+
type?: 'contextformbutton';
|
1008
|
+
primary?: boolean;
|
1009
|
+
onAction: (formApi: ContextFormInstanceApi, api: ContextFormButtonInstanceApi) => void;
|
1010
|
+
}
|
1011
|
+
interface ContextFormToggleButtonSpec extends BaseToolbarToggleButtonSpec<ContextFormToggleButtonInstanceApi> {
|
1012
|
+
type?: 'contextformtogglebutton';
|
1013
|
+
onAction: (formApi: ContextFormInstanceApi, buttonApi: ContextFormToggleButtonInstanceApi) => void;
|
1014
|
+
primary?: boolean;
|
1015
|
+
}
|
1016
|
+
interface ContextFormInstanceApi {
|
1017
|
+
hide: () => void;
|
1018
|
+
getValue: () => string;
|
1019
|
+
}
|
1020
|
+
interface ContextFormSpec extends ContextBarSpec {
|
1021
|
+
type?: 'contextform';
|
1022
|
+
initValue?: () => string;
|
1023
|
+
label?: string;
|
1024
|
+
launch?: ContextFormLaunchButtonApi | ContextFormLaunchToggleButtonSpec;
|
1025
|
+
commands: Array<ContextFormToggleButtonSpec | ContextFormButtonSpec>;
|
1026
|
+
}
|
1027
|
+
interface ContextToolbarSpec extends ContextBarSpec {
|
1028
|
+
type?: 'contexttoolbar';
|
1029
|
+
items: string;
|
1030
|
+
}
|
1031
|
+
interface ChoiceMenuItemSpec extends CommonMenuItemSpec {
|
1032
|
+
type?: 'choiceitem';
|
1033
|
+
icon?: string;
|
1034
|
+
}
|
1035
|
+
interface ChoiceMenuItemInstanceApi extends CommonMenuItemInstanceApi {
|
1036
|
+
isActive: () => boolean;
|
1037
|
+
setActive: (state: boolean) => void;
|
1038
|
+
}
|
1039
|
+
interface ContextMenuItem extends CommonMenuItemSpec {
|
1040
|
+
text: string;
|
1041
|
+
icon?: string;
|
1042
|
+
type?: 'item';
|
1043
|
+
onAction: () => void;
|
1044
|
+
}
|
1045
|
+
interface ContextSubMenu extends CommonMenuItemSpec {
|
1046
|
+
type: 'submenu';
|
1047
|
+
text: string;
|
1048
|
+
icon?: string;
|
1049
|
+
getSubmenuItems: () => string | Array<ContextMenuContents>;
|
1050
|
+
}
|
1051
|
+
declare type ContextMenuContents = string | ContextMenuItem | SeparatorMenuItemSpec | ContextSubMenu;
|
1052
|
+
interface ContextMenuApi {
|
1053
|
+
update: (element: Element) => string | Array<ContextMenuContents>;
|
1054
|
+
}
|
1055
|
+
interface FancyActionArgsMap {
|
1056
|
+
'inserttable': {
|
1057
|
+
numRows: number;
|
1058
|
+
numColumns: number;
|
1059
|
+
};
|
1060
|
+
'colorswatch': {
|
1061
|
+
value: string;
|
1062
|
+
};
|
1063
|
+
}
|
1064
|
+
interface BaseFancyMenuItemSpec<T extends keyof FancyActionArgsMap> {
|
1065
|
+
type: 'fancymenuitem';
|
1066
|
+
fancytype: T;
|
1067
|
+
initData?: Record<string, unknown>;
|
1068
|
+
onAction?: (data: FancyActionArgsMap[T]) => void;
|
1069
|
+
}
|
1070
|
+
interface InsertTableMenuItemSpec extends BaseFancyMenuItemSpec<'inserttable'> {
|
1071
|
+
fancytype: 'inserttable';
|
1072
|
+
initData?: {};
|
1073
|
+
}
|
1074
|
+
interface ColorSwatchMenuItemSpec extends BaseFancyMenuItemSpec<'colorswatch'> {
|
1075
|
+
fancytype: 'colorswatch';
|
1076
|
+
initData?: {
|
1077
|
+
allowCustomColors?: boolean;
|
1078
|
+
colors: ChoiceMenuItemSpec[];
|
1079
|
+
};
|
1080
|
+
}
|
1081
|
+
declare type FancyMenuItemSpec = InsertTableMenuItemSpec | ColorSwatchMenuItemSpec;
|
1082
|
+
interface MenuItemSpec extends CommonMenuItemSpec {
|
1083
|
+
type?: 'menuitem';
|
1084
|
+
icon?: string;
|
1085
|
+
onSetup?: (api: MenuItemInstanceApi) => (api: MenuItemInstanceApi) => void;
|
1086
|
+
onAction?: (api: MenuItemInstanceApi) => void;
|
1087
|
+
}
|
1088
|
+
interface MenuItemInstanceApi extends CommonMenuItemInstanceApi {
|
1089
|
+
}
|
1090
|
+
declare type NestedMenuItemContents = string | MenuItemSpec | NestedMenuItemSpec | ToggleMenuItemSpec | SeparatorMenuItemSpec | FancyMenuItemSpec;
|
1091
|
+
interface NestedMenuItemSpec extends CommonMenuItemSpec {
|
1092
|
+
type?: 'nestedmenuitem';
|
1093
|
+
icon?: string;
|
1094
|
+
getSubmenuItems: () => string | Array<NestedMenuItemContents>;
|
1095
|
+
onSetup?: (api: NestedMenuItemInstanceApi) => (api: NestedMenuItemInstanceApi) => void;
|
1096
|
+
}
|
1097
|
+
interface NestedMenuItemInstanceApi extends CommonMenuItemInstanceApi {
|
1098
|
+
}
|
1099
|
+
interface ToggleMenuItemSpec extends CommonMenuItemSpec {
|
1100
|
+
type?: 'togglemenuitem';
|
1101
|
+
icon?: string;
|
1102
|
+
active?: boolean;
|
1103
|
+
onSetup?: (api: ToggleMenuItemInstanceApi) => void;
|
1104
|
+
onAction: (api: ToggleMenuItemInstanceApi) => void;
|
1105
|
+
}
|
1106
|
+
interface ToggleMenuItemInstanceApi extends CommonMenuItemInstanceApi {
|
1107
|
+
isActive: () => boolean;
|
1108
|
+
setActive: (state: boolean) => void;
|
1109
|
+
}
|
1110
|
+
type PublicDialog_d_AlertBannerSpec = AlertBannerSpec;
|
1111
|
+
type PublicDialog_d_BarSpec = BarSpec;
|
1112
|
+
type PublicDialog_d_BodyComponentSpec = BodyComponentSpec;
|
1113
|
+
type PublicDialog_d_ButtonSpec = ButtonSpec;
|
1114
|
+
type PublicDialog_d_CheckboxSpec = CheckboxSpec;
|
1115
|
+
type PublicDialog_d_CollectionSpec = CollectionSpec;
|
1116
|
+
type PublicDialog_d_ColorInputSpec = ColorInputSpec;
|
1117
|
+
type PublicDialog_d_ColorPickerSpec = ColorPickerSpec;
|
1118
|
+
type PublicDialog_d_CustomEditorSpec = CustomEditorSpec;
|
1119
|
+
type PublicDialog_d_CustomEditorInit = CustomEditorInit;
|
1120
|
+
type PublicDialog_d_CustomEditorInitFn = CustomEditorInitFn;
|
1121
|
+
type PublicDialog_d_DialogData = DialogData;
|
1122
|
+
type PublicDialog_d_DialogSize = DialogSize;
|
1123
|
+
type PublicDialog_d_DialogSpec<_0> = DialogSpec<_0>;
|
1124
|
+
type PublicDialog_d_DialogInstanceApi<_0> = DialogInstanceApi<_0>;
|
1125
|
+
type PublicDialog_d_DialogFooterButtonSpec = DialogFooterButtonSpec;
|
1126
|
+
type PublicDialog_d_DialogActionDetails = DialogActionDetails;
|
1127
|
+
type PublicDialog_d_DialogChangeDetails<_0> = DialogChangeDetails<_0>;
|
1128
|
+
type PublicDialog_d_DialogTabChangeDetails = DialogTabChangeDetails;
|
1129
|
+
type PublicDialog_d_DropZoneSpec = DropZoneSpec;
|
1130
|
+
type PublicDialog_d_GridSpec = GridSpec;
|
1131
|
+
type PublicDialog_d_HtmlPanelSpec = HtmlPanelSpec;
|
1132
|
+
type PublicDialog_d_IframeSpec = IframeSpec;
|
1133
|
+
type PublicDialog_d_ImageToolsSpec = ImageToolsSpec;
|
1134
|
+
type PublicDialog_d_InputSpec = InputSpec;
|
1135
|
+
type PublicDialog_d_LabelSpec = LabelSpec;
|
1136
|
+
type PublicDialog_d_ListBoxSpec = ListBoxSpec;
|
1137
|
+
type PublicDialog_d_ListBoxItemSpec = ListBoxItemSpec;
|
1138
|
+
type PublicDialog_d_ListBoxNestedItemSpec = ListBoxNestedItemSpec;
|
1139
|
+
type PublicDialog_d_ListBoxSingleItemSpec = ListBoxSingleItemSpec;
|
1140
|
+
type PublicDialog_d_PanelSpec = PanelSpec;
|
1141
|
+
type PublicDialog_d_SelectBoxSpec = SelectBoxSpec;
|
1142
|
+
type PublicDialog_d_SelectBoxItemSpec = SelectBoxItemSpec;
|
1143
|
+
type PublicDialog_d_SizeInputSpec = SizeInputSpec;
|
1144
|
+
type PublicDialog_d_TableSpec = TableSpec;
|
1145
|
+
type PublicDialog_d_TabSpec = TabSpec;
|
1146
|
+
type PublicDialog_d_TabPanelSpec = TabPanelSpec;
|
1147
|
+
type PublicDialog_d_TextAreaSpec = TextAreaSpec;
|
1148
|
+
type PublicDialog_d_UrlInputSpec = UrlInputSpec;
|
1149
|
+
type PublicDialog_d_UrlDialogSpec = UrlDialogSpec;
|
1150
|
+
type PublicDialog_d_UrlDialogFooterButtonSpec = UrlDialogFooterButtonSpec;
|
1151
|
+
type PublicDialog_d_UrlDialogInstanceApi = UrlDialogInstanceApi;
|
1152
|
+
type PublicDialog_d_UrlDialogActionDetails = UrlDialogActionDetails;
|
1153
|
+
type PublicDialog_d_UrlDialogMessage = UrlDialogMessage;
|
1154
|
+
declare namespace PublicDialog_d {
|
1155
|
+
export { PublicDialog_d_AlertBannerSpec as AlertBannerSpec, PublicDialog_d_BarSpec as BarSpec, PublicDialog_d_BodyComponentSpec as BodyComponentSpec, PublicDialog_d_ButtonSpec as ButtonSpec, PublicDialog_d_CheckboxSpec as CheckboxSpec, PublicDialog_d_CollectionSpec as CollectionSpec, PublicDialog_d_ColorInputSpec as ColorInputSpec, PublicDialog_d_ColorPickerSpec as ColorPickerSpec, PublicDialog_d_CustomEditorSpec as CustomEditorSpec, PublicDialog_d_CustomEditorInit as CustomEditorInit, PublicDialog_d_CustomEditorInitFn as CustomEditorInitFn, PublicDialog_d_DialogData as DialogData, PublicDialog_d_DialogSize as DialogSize, PublicDialog_d_DialogSpec as DialogSpec, PublicDialog_d_DialogInstanceApi as DialogInstanceApi, PublicDialog_d_DialogFooterButtonSpec as DialogFooterButtonSpec, PublicDialog_d_DialogActionDetails as DialogActionDetails, PublicDialog_d_DialogChangeDetails as DialogChangeDetails, PublicDialog_d_DialogTabChangeDetails as DialogTabChangeDetails, PublicDialog_d_DropZoneSpec as DropZoneSpec, PublicDialog_d_GridSpec as GridSpec, PublicDialog_d_HtmlPanelSpec as HtmlPanelSpec, PublicDialog_d_IframeSpec as IframeSpec, PublicDialog_d_ImageToolsSpec as ImageToolsSpec, PublicDialog_d_InputSpec as InputSpec, PublicDialog_d_LabelSpec as LabelSpec, PublicDialog_d_ListBoxSpec as ListBoxSpec, PublicDialog_d_ListBoxItemSpec as ListBoxItemSpec, PublicDialog_d_ListBoxNestedItemSpec as ListBoxNestedItemSpec, PublicDialog_d_ListBoxSingleItemSpec as ListBoxSingleItemSpec, PublicDialog_d_PanelSpec as PanelSpec, PublicDialog_d_SelectBoxSpec as SelectBoxSpec, PublicDialog_d_SelectBoxItemSpec as SelectBoxItemSpec, PublicDialog_d_SizeInputSpec as SizeInputSpec, PublicDialog_d_TableSpec as TableSpec, PublicDialog_d_TabSpec as TabSpec, PublicDialog_d_TabPanelSpec as TabPanelSpec, PublicDialog_d_TextAreaSpec as TextAreaSpec, PublicDialog_d_UrlInputSpec as UrlInputSpec, PublicDialog_d_UrlDialogSpec as UrlDialogSpec, PublicDialog_d_UrlDialogFooterButtonSpec as UrlDialogFooterButtonSpec, PublicDialog_d_UrlDialogInstanceApi as UrlDialogInstanceApi, PublicDialog_d_UrlDialogActionDetails as UrlDialogActionDetails, PublicDialog_d_UrlDialogMessage as UrlDialogMessage, };
|
1156
|
+
}
|
1157
|
+
type PublicInlineContent_d_AutocompleterSpec = AutocompleterSpec;
|
1158
|
+
type PublicInlineContent_d_AutocompleterItemSpec = AutocompleterItemSpec;
|
1159
|
+
type PublicInlineContent_d_AutocompleterContents = AutocompleterContents;
|
1160
|
+
type PublicInlineContent_d_AutocompleterInstanceApi = AutocompleterInstanceApi;
|
1161
|
+
type PublicInlineContent_d_ContextPosition = ContextPosition;
|
1162
|
+
type PublicInlineContent_d_ContextScope = ContextScope;
|
1163
|
+
type PublicInlineContent_d_ContextFormSpec = ContextFormSpec;
|
1164
|
+
type PublicInlineContent_d_ContextFormInstanceApi = ContextFormInstanceApi;
|
1165
|
+
type PublicInlineContent_d_ContextFormButtonSpec = ContextFormButtonSpec;
|
1166
|
+
type PublicInlineContent_d_ContextFormButtonInstanceApi = ContextFormButtonInstanceApi;
|
1167
|
+
type PublicInlineContent_d_ContextFormToggleButtonSpec = ContextFormToggleButtonSpec;
|
1168
|
+
type PublicInlineContent_d_ContextFormToggleButtonInstanceApi = ContextFormToggleButtonInstanceApi;
|
1169
|
+
type PublicInlineContent_d_ContextToolbarSpec = ContextToolbarSpec;
|
1170
|
+
type PublicInlineContent_d_SeparatorItemSpec = SeparatorItemSpec;
|
1171
|
+
declare namespace PublicInlineContent_d {
|
1172
|
+
export { PublicInlineContent_d_AutocompleterSpec as AutocompleterSpec, PublicInlineContent_d_AutocompleterItemSpec as AutocompleterItemSpec, PublicInlineContent_d_AutocompleterContents as AutocompleterContents, PublicInlineContent_d_AutocompleterInstanceApi as AutocompleterInstanceApi, PublicInlineContent_d_ContextPosition as ContextPosition, PublicInlineContent_d_ContextScope as ContextScope, PublicInlineContent_d_ContextFormSpec as ContextFormSpec, PublicInlineContent_d_ContextFormInstanceApi as ContextFormInstanceApi, PublicInlineContent_d_ContextFormButtonSpec as ContextFormButtonSpec, PublicInlineContent_d_ContextFormButtonInstanceApi as ContextFormButtonInstanceApi, PublicInlineContent_d_ContextFormToggleButtonSpec as ContextFormToggleButtonSpec, PublicInlineContent_d_ContextFormToggleButtonInstanceApi as ContextFormToggleButtonInstanceApi, PublicInlineContent_d_ContextToolbarSpec as ContextToolbarSpec, PublicInlineContent_d_SeparatorItemSpec as SeparatorItemSpec, };
|
1173
|
+
}
|
1174
|
+
type PublicMenu_d_MenuItemSpec = MenuItemSpec;
|
1175
|
+
type PublicMenu_d_MenuItemInstanceApi = MenuItemInstanceApi;
|
1176
|
+
type PublicMenu_d_NestedMenuItemContents = NestedMenuItemContents;
|
1177
|
+
type PublicMenu_d_NestedMenuItemSpec = NestedMenuItemSpec;
|
1178
|
+
type PublicMenu_d_NestedMenuItemInstanceApi = NestedMenuItemInstanceApi;
|
1179
|
+
type PublicMenu_d_FancyMenuItemSpec = FancyMenuItemSpec;
|
1180
|
+
type PublicMenu_d_ColorSwatchMenuItemSpec = ColorSwatchMenuItemSpec;
|
1181
|
+
type PublicMenu_d_InsertTableMenuItemSpec = InsertTableMenuItemSpec;
|
1182
|
+
type PublicMenu_d_ToggleMenuItemSpec = ToggleMenuItemSpec;
|
1183
|
+
type PublicMenu_d_ToggleMenuItemInstanceApi = ToggleMenuItemInstanceApi;
|
1184
|
+
type PublicMenu_d_ChoiceMenuItemSpec = ChoiceMenuItemSpec;
|
1185
|
+
type PublicMenu_d_ChoiceMenuItemInstanceApi = ChoiceMenuItemInstanceApi;
|
1186
|
+
type PublicMenu_d_SeparatorMenuItemSpec = SeparatorMenuItemSpec;
|
1187
|
+
type PublicMenu_d_ContextMenuApi = ContextMenuApi;
|
1188
|
+
type PublicMenu_d_ContextMenuContents = ContextMenuContents;
|
1189
|
+
type PublicMenu_d_ContextMenuItem = ContextMenuItem;
|
1190
|
+
type PublicMenu_d_ContextSubMenu = ContextSubMenu;
|
1191
|
+
type PublicMenu_d_CardMenuItemSpec = CardMenuItemSpec;
|
1192
|
+
type PublicMenu_d_CardMenuItemInstanceApi = CardMenuItemInstanceApi;
|
1193
|
+
type PublicMenu_d_CardItemSpec = CardItemSpec;
|
1194
|
+
type PublicMenu_d_CardContainerSpec = CardContainerSpec;
|
1195
|
+
type PublicMenu_d_CardImageSpec = CardImageSpec;
|
1196
|
+
type PublicMenu_d_CardTextSpec = CardTextSpec;
|
1197
|
+
declare namespace PublicMenu_d {
|
1198
|
+
export { PublicMenu_d_MenuItemSpec as MenuItemSpec, PublicMenu_d_MenuItemInstanceApi as MenuItemInstanceApi, PublicMenu_d_NestedMenuItemContents as NestedMenuItemContents, PublicMenu_d_NestedMenuItemSpec as NestedMenuItemSpec, PublicMenu_d_NestedMenuItemInstanceApi as NestedMenuItemInstanceApi, PublicMenu_d_FancyMenuItemSpec as FancyMenuItemSpec, PublicMenu_d_ColorSwatchMenuItemSpec as ColorSwatchMenuItemSpec, PublicMenu_d_InsertTableMenuItemSpec as InsertTableMenuItemSpec, PublicMenu_d_ToggleMenuItemSpec as ToggleMenuItemSpec, PublicMenu_d_ToggleMenuItemInstanceApi as ToggleMenuItemInstanceApi, PublicMenu_d_ChoiceMenuItemSpec as ChoiceMenuItemSpec, PublicMenu_d_ChoiceMenuItemInstanceApi as ChoiceMenuItemInstanceApi, PublicMenu_d_SeparatorMenuItemSpec as SeparatorMenuItemSpec, PublicMenu_d_ContextMenuApi as ContextMenuApi, PublicMenu_d_ContextMenuContents as ContextMenuContents, PublicMenu_d_ContextMenuItem as ContextMenuItem, PublicMenu_d_ContextSubMenu as ContextSubMenu, PublicMenu_d_CardMenuItemSpec as CardMenuItemSpec, PublicMenu_d_CardMenuItemInstanceApi as CardMenuItemInstanceApi, PublicMenu_d_CardItemSpec as CardItemSpec, PublicMenu_d_CardContainerSpec as CardContainerSpec, PublicMenu_d_CardImageSpec as CardImageSpec, PublicMenu_d_CardTextSpec as CardTextSpec, };
|
1199
|
+
}
|
1200
|
+
interface SidebarInstanceApi {
|
1201
|
+
element: () => HTMLElement;
|
1202
|
+
}
|
1203
|
+
interface SidebarSpec {
|
1204
|
+
icon?: string;
|
1205
|
+
tooltip?: string;
|
1206
|
+
onShow?: (api: SidebarInstanceApi) => void;
|
1207
|
+
onSetup?: (api: SidebarInstanceApi) => (api: SidebarInstanceApi) => void;
|
1208
|
+
onHide?: (api: SidebarInstanceApi) => void;
|
1209
|
+
}
|
1210
|
+
type PublicSidebar_d_SidebarSpec = SidebarSpec;
|
1211
|
+
type PublicSidebar_d_SidebarInstanceApi = SidebarInstanceApi;
|
1212
|
+
declare namespace PublicSidebar_d {
|
1213
|
+
export { PublicSidebar_d_SidebarSpec as SidebarSpec, PublicSidebar_d_SidebarInstanceApi as SidebarInstanceApi, };
|
1214
|
+
}
|
1215
|
+
interface ToolbarGroupSetting {
|
1216
|
+
name: string;
|
1217
|
+
items: string[];
|
1218
|
+
}
|
1219
|
+
declare type ToolbarConfig = string | ToolbarGroupSetting[];
|
1220
|
+
interface GroupToolbarButtonInstanceApi extends BaseToolbarButtonInstanceApi {
|
1221
|
+
}
|
1222
|
+
interface GroupToolbarButtonSpec extends BaseToolbarButtonSpec<GroupToolbarButtonInstanceApi> {
|
1223
|
+
type?: 'grouptoolbarbutton';
|
1224
|
+
items?: ToolbarConfig;
|
1225
|
+
}
|
1226
|
+
declare type MenuButtonItemTypes = NestedMenuItemContents;
|
1227
|
+
declare type SuccessCallback$1 = (menu: string | MenuButtonItemTypes[]) => void;
|
1228
|
+
interface BaseMenuButtonSpec {
|
1229
|
+
text?: string;
|
1230
|
+
tooltip?: string;
|
1231
|
+
icon?: string;
|
1232
|
+
fetch: (success: SuccessCallback$1) => void;
|
1233
|
+
onSetup?: (api: BaseMenuButtonInstanceApi) => (api: BaseMenuButtonInstanceApi) => void;
|
1234
|
+
}
|
1235
|
+
interface BaseMenuButtonInstanceApi {
|
1236
|
+
isDisabled: () => boolean;
|
1237
|
+
setDisabled: (state: boolean) => void;
|
1238
|
+
isActive: () => boolean;
|
1239
|
+
setActive: (state: boolean) => void;
|
1240
|
+
}
|
1241
|
+
interface ToolbarMenuButtonSpec extends BaseMenuButtonSpec {
|
1242
|
+
type?: 'menubutton';
|
1243
|
+
onSetup?: (api: ToolbarMenuButtonInstanceApi) => (api: ToolbarMenuButtonInstanceApi) => void;
|
1244
|
+
}
|
1245
|
+
interface ToolbarMenuButtonInstanceApi extends BaseMenuButtonInstanceApi {
|
1246
|
+
}
|
1247
|
+
declare type ToolbarSplitButtonItemTypes = ChoiceMenuItemSpec | SeparatorMenuItemSpec;
|
1248
|
+
declare type SuccessCallback = (menu: ToolbarSplitButtonItemTypes[]) => void;
|
1249
|
+
declare type SelectPredicate = (value: string) => boolean;
|
1250
|
+
declare type PresetTypes = 'color' | 'normal' | 'listpreview';
|
1251
|
+
declare type ColumnTypes = number | 'auto';
|
1252
|
+
interface ToolbarSplitButtonSpec {
|
1253
|
+
type?: 'splitbutton';
|
1254
|
+
tooltip?: string;
|
1255
|
+
icon?: string;
|
1256
|
+
text?: string;
|
1257
|
+
select?: SelectPredicate;
|
1258
|
+
presets?: PresetTypes;
|
1259
|
+
columns?: ColumnTypes;
|
1260
|
+
fetch: (success: SuccessCallback) => void;
|
1261
|
+
onSetup?: (api: ToolbarSplitButtonInstanceApi) => (api: ToolbarSplitButtonInstanceApi) => void;
|
1262
|
+
onAction: (api: ToolbarSplitButtonInstanceApi) => void;
|
1263
|
+
onItemAction: (api: ToolbarSplitButtonInstanceApi, value: string) => void;
|
1264
|
+
}
|
1265
|
+
interface ToolbarSplitButtonInstanceApi {
|
1266
|
+
isDisabled: () => boolean;
|
1267
|
+
setDisabled: (state: boolean) => void;
|
1268
|
+
setIconFill: (id: string, value: string) => void;
|
1269
|
+
setIconStroke: (id: string, value: string) => void;
|
1270
|
+
isActive: () => boolean;
|
1271
|
+
setActive: (state: boolean) => void;
|
1272
|
+
}
|
1273
|
+
type PublicToolbar_d_ToolbarButtonSpec = ToolbarButtonSpec;
|
1274
|
+
type PublicToolbar_d_ToolbarButtonInstanceApi = ToolbarButtonInstanceApi;
|
1275
|
+
type PublicToolbar_d_ToolbarSplitButtonSpec = ToolbarSplitButtonSpec;
|
1276
|
+
type PublicToolbar_d_ToolbarSplitButtonInstanceApi = ToolbarSplitButtonInstanceApi;
|
1277
|
+
type PublicToolbar_d_ToolbarMenuButtonSpec = ToolbarMenuButtonSpec;
|
1278
|
+
type PublicToolbar_d_ToolbarMenuButtonInstanceApi = ToolbarMenuButtonInstanceApi;
|
1279
|
+
type PublicToolbar_d_ToolbarToggleButtonSpec = ToolbarToggleButtonSpec;
|
1280
|
+
type PublicToolbar_d_ToolbarToggleButtonInstanceApi = ToolbarToggleButtonInstanceApi;
|
1281
|
+
type PublicToolbar_d_GroupToolbarButtonSpec = GroupToolbarButtonSpec;
|
1282
|
+
type PublicToolbar_d_GroupToolbarButtonInstanceApi = GroupToolbarButtonInstanceApi;
|
1283
|
+
declare namespace PublicToolbar_d {
|
1284
|
+
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, };
|
1285
|
+
}
|
1286
|
+
interface Registry$1 {
|
1287
|
+
addButton: (name: string, spec: ToolbarButtonSpec) => void;
|
1288
|
+
addGroupToolbarButton: (name: string, spec: GroupToolbarButtonSpec) => void;
|
1289
|
+
addToggleButton: (name: string, spec: ToolbarToggleButtonSpec) => void;
|
1290
|
+
addMenuButton: (name: string, spec: ToolbarMenuButtonSpec) => void;
|
1291
|
+
addSplitButton: (name: string, spec: ToolbarSplitButtonSpec) => void;
|
1292
|
+
addMenuItem: (name: string, spec: MenuItemSpec) => void;
|
1293
|
+
addNestedMenuItem: (name: string, spec: NestedMenuItemSpec) => void;
|
1294
|
+
addToggleMenuItem: (name: string, spec: ToggleMenuItemSpec) => void;
|
1295
|
+
addContextMenu: (name: string, spec: ContextMenuApi) => void;
|
1296
|
+
addContextToolbar: (name: string, spec: ContextToolbarSpec) => void;
|
1297
|
+
addContextForm: (name: string, spec: ContextFormSpec) => void;
|
1298
|
+
addIcon: (name: string, svgData: string) => void;
|
1299
|
+
addAutocompleter: (name: string, spec: AutocompleterSpec) => void;
|
1300
|
+
addSidebar: (name: string, spec: SidebarSpec) => void;
|
1301
|
+
getAll: () => {
|
1302
|
+
buttons: Record<string, ToolbarButtonSpec | GroupToolbarButtonSpec | ToolbarMenuButtonSpec | ToolbarSplitButtonSpec | ToolbarToggleButtonSpec>;
|
1303
|
+
menuItems: Record<string, MenuItemSpec | NestedMenuItemSpec | ToggleMenuItemSpec>;
|
1304
|
+
popups: Record<string, AutocompleterSpec>;
|
1305
|
+
contextMenus: Record<string, ContextMenuApi>;
|
1306
|
+
contextToolbars: Record<string, ContextToolbarSpec | ContextFormSpec>;
|
1307
|
+
icons: Record<string, string>;
|
1308
|
+
sidebars: Record<string, SidebarSpec>;
|
1309
|
+
};
|
1310
|
+
}
|
1311
|
+
interface StyleSheetLoaderSettings {
|
1312
|
+
maxLoadTime?: number;
|
1313
|
+
contentCssCors?: boolean;
|
1314
|
+
referrerPolicy?: ReferrerPolicy;
|
1315
|
+
}
|
1316
|
+
interface StyleSheetLoader {
|
1317
|
+
load: (url: string, success: () => void, failure?: () => void) => void;
|
1318
|
+
loadAll: (urls: string[], success: (urls: string[]) => void, failure: (urls: string[]) => void) => void;
|
1319
|
+
unload: (url: string) => void;
|
1320
|
+
unloadAll: (urls: string[]) => void;
|
1321
|
+
_setReferrerPolicy: (referrerPolicy: ReferrerPolicy) => void;
|
1322
|
+
}
|
1323
|
+
declare type Registry = Registry$1;
|
1324
|
+
interface EditorUiApi {
|
1325
|
+
show: () => void;
|
1326
|
+
hide: () => void;
|
1327
|
+
enable: () => void;
|
1328
|
+
disable: () => void;
|
1329
|
+
isDisabled: () => boolean;
|
1330
|
+
}
|
1331
|
+
interface EditorUi extends EditorUiApi {
|
1332
|
+
registry: Registry;
|
1333
|
+
styleSheetLoader: StyleSheetLoader;
|
1334
|
+
}
|
1335
|
+
type Ui_d_Registry = Registry;
|
1336
|
+
type Ui_d_EditorUiApi = EditorUiApi;
|
1337
|
+
type Ui_d_EditorUi = EditorUi;
|
1338
|
+
declare namespace Ui_d {
|
1339
|
+
export { Ui_d_Registry as Registry, PublicDialog_d as Dialog, PublicInlineContent_d as InlineContent, PublicMenu_d as Menu, PublicSidebar_d as Sidebar, PublicToolbar_d as Toolbar, Ui_d_EditorUiApi as EditorUiApi, Ui_d_EditorUi as EditorUi, };
|
1340
|
+
}
|
1341
|
+
declare type EntityEncoding = 'named' | 'numeric' | 'raw' | 'named,numeric' | 'named+numeric' | 'numeric,named' | 'numeric+named';
|
1342
|
+
interface ContentLanguage {
|
1343
|
+
readonly title: string;
|
1344
|
+
readonly code: string;
|
1345
|
+
readonly customCode?: string;
|
1346
|
+
}
|
1347
|
+
declare type ThemeInitFunc = (editor: Editor, elm: HTMLElement) => {
|
1348
|
+
editorContainer: HTMLElement;
|
1349
|
+
iframeContainer: HTMLElement;
|
1350
|
+
height?: number;
|
1351
|
+
iframeHeight?: number;
|
1352
|
+
api?: EditorUiApi;
|
1353
|
+
};
|
1354
|
+
declare type SetupCallback = (editor: Editor) => void;
|
1355
|
+
declare type FilePickerCallback = (callback: Function, value: any, meta: Record<string, any>) => void;
|
1356
|
+
declare type FilePickerValidationStatus = 'valid' | 'unknown' | 'invalid' | 'none';
|
1357
|
+
declare type FilePickerValidationCallback = (info: {
|
1358
|
+
type: string;
|
1359
|
+
url: string;
|
1360
|
+
}, callback: (validation: {
|
1361
|
+
status: FilePickerValidationStatus;
|
1362
|
+
message: string;
|
1363
|
+
}) => void) => void;
|
1364
|
+
declare type URLConverter = (url: string, name: string, elm?: HTMLElement) => string;
|
1365
|
+
declare type URLConverterCallback = (url: string, node: Node, on_save: boolean, name: string) => void;
|
1366
|
+
interface ToolbarGroup {
|
1367
|
+
name?: string;
|
1368
|
+
items: string[];
|
1369
|
+
}
|
1370
|
+
declare type ToolbarMode = 'floating' | 'sliding' | 'scrolling' | 'wrap';
|
1371
|
+
interface BaseEditorSettings {
|
1372
|
+
add_form_submit_trigger?: boolean;
|
1373
|
+
add_unload_trigger?: boolean;
|
1374
|
+
allow_conditional_comments?: boolean;
|
1375
|
+
allow_html_data_urls?: boolean;
|
1376
|
+
allow_html_in_named_anchor?: boolean;
|
1377
|
+
allow_script_urls?: boolean;
|
1378
|
+
allow_svg_data_urls?: boolean;
|
1379
|
+
allow_unsafe_link_target?: boolean;
|
1380
|
+
anchor_bottom?: false | string;
|
1381
|
+
anchor_top?: false | string;
|
1382
|
+
auto_focus?: string | true;
|
1383
|
+
automatic_uploads?: boolean;
|
1384
|
+
base_url?: string;
|
1385
|
+
block_formats?: string;
|
1386
|
+
block_unsupported_drop?: boolean;
|
1387
|
+
body_id?: string;
|
1388
|
+
body_class?: string;
|
1389
|
+
br_in_pre?: boolean;
|
1390
|
+
br_newline_selector?: string;
|
1391
|
+
browser_spellcheck?: boolean;
|
1392
|
+
branding?: boolean;
|
1393
|
+
cache_suffix?: string;
|
1394
|
+
color_cols?: number;
|
1395
|
+
color_map?: string[];
|
1396
|
+
content_css?: boolean | string | string[];
|
1397
|
+
content_css_cors?: boolean;
|
1398
|
+
content_security_policy?: string;
|
1399
|
+
content_style?: string;
|
1400
|
+
deprecation_warnings?: boolean;
|
1401
|
+
font_css?: string | string[];
|
1402
|
+
content_langs?: ContentLanguage[];
|
1403
|
+
contextmenu?: string | false;
|
1404
|
+
contextmenu_never_use_native?: boolean;
|
1405
|
+
convert_fonts_to_spans?: boolean;
|
1406
|
+
convert_urls?: boolean;
|
1407
|
+
custom_colors?: boolean;
|
1408
|
+
custom_elements?: string;
|
1409
|
+
custom_ui_selector?: string;
|
1410
|
+
custom_undo_redo_levels?: number;
|
1411
|
+
directionality?: 'ltr' | 'rtl';
|
1412
|
+
doctype?: string;
|
1413
|
+
document_base_url?: string;
|
1414
|
+
element_format?: 'xhtml' | 'html';
|
1415
|
+
elementpath?: boolean;
|
1416
|
+
encoding?: string;
|
1417
|
+
end_container_on_empty_block?: boolean;
|
1418
|
+
entities?: string;
|
1419
|
+
entity_encoding?: EntityEncoding;
|
1420
|
+
extended_valid_elements?: string;
|
1421
|
+
event_root?: string;
|
1422
|
+
file_picker_callback?: FilePickerCallback;
|
1423
|
+
file_picker_types?: string;
|
1424
|
+
file_picker_validator_handler?: FilePickerValidationCallback;
|
1425
|
+
fix_list_elements?: boolean;
|
1426
|
+
fixed_toolbar_container?: string;
|
1427
|
+
fixed_toolbar_container_target?: HTMLElement;
|
1428
|
+
font_formats?: string;
|
1429
|
+
font_size_classes?: string;
|
1430
|
+
font_size_legacy_values?: string;
|
1431
|
+
font_size_style_values?: string;
|
1432
|
+
fontsize_formats?: string;
|
1433
|
+
force_hex_style_colors?: boolean;
|
1434
|
+
forced_root_block?: boolean | string;
|
1435
|
+
forced_root_block_attrs?: Record<string, string>;
|
1436
|
+
formats?: Formats;
|
1437
|
+
format_empty_lines?: boolean;
|
1438
|
+
gecko_spellcheck?: boolean;
|
1439
|
+
height?: number | string;
|
1440
|
+
hidden_input?: boolean;
|
1441
|
+
icons?: string;
|
1442
|
+
icons_url?: string;
|
1443
|
+
id?: string;
|
1444
|
+
iframe_aria_text?: string;
|
1445
|
+
images_dataimg_filter?: (imgElm: HTMLImageElement) => boolean;
|
1446
|
+
images_file_types?: string;
|
1447
|
+
images_replace_blob_uris?: boolean;
|
1448
|
+
images_reuse_filename?: boolean;
|
1449
|
+
images_upload_base_path?: string;
|
1450
|
+
images_upload_credentials?: boolean;
|
1451
|
+
images_upload_handler?: UploadHandler;
|
1452
|
+
images_upload_url?: string;
|
1453
|
+
indent?: boolean;
|
1454
|
+
indent_after?: string;
|
1455
|
+
indent_before?: string;
|
1456
|
+
indent_use_margin?: boolean;
|
1457
|
+
indentation?: string;
|
1458
|
+
init_instance_callback?: SetupCallback;
|
1459
|
+
inline?: boolean;
|
1460
|
+
inline_boundaries?: boolean;
|
1461
|
+
inline_boundaries_selector?: string;
|
1462
|
+
inline_styles?: boolean;
|
1463
|
+
invalid_elements?: string;
|
1464
|
+
invalid_styles?: string | Record<string, string>;
|
1465
|
+
keep_styles?: boolean;
|
1466
|
+
language?: string;
|
1467
|
+
language_load?: boolean;
|
1468
|
+
language_url?: string;
|
1469
|
+
lineheight_formats?: string;
|
1470
|
+
max_height?: number;
|
1471
|
+
max_width?: number;
|
1472
|
+
menu?: Record<string, {
|
1473
|
+
title: string;
|
1474
|
+
items: string;
|
1475
|
+
}>;
|
1476
|
+
menubar?: boolean | string;
|
1477
|
+
min_height?: number;
|
1478
|
+
min_width?: number;
|
1479
|
+
no_newline_selector?: string;
|
1480
|
+
nowrap?: boolean;
|
1481
|
+
object_resizing?: boolean | string;
|
1482
|
+
padd_empty_with_br?: boolean;
|
1483
|
+
placeholder?: string;
|
1484
|
+
preserve_cdata?: boolean;
|
1485
|
+
preview_styles?: boolean | string;
|
1486
|
+
protect?: RegExp[];
|
1487
|
+
readonly?: boolean;
|
1488
|
+
referrer_policy?: ReferrerPolicy;
|
1489
|
+
relative_urls?: boolean;
|
1490
|
+
remove_script_host?: boolean;
|
1491
|
+
remove_trailing_brs?: boolean;
|
1492
|
+
removed_menuitems?: string;
|
1493
|
+
resize?: boolean | 'both';
|
1494
|
+
resize_img_proportional?: boolean;
|
1495
|
+
root_name?: string;
|
1496
|
+
schema?: SchemaType;
|
1497
|
+
selector?: string;
|
1498
|
+
setup?: SetupCallback;
|
1499
|
+
skin?: boolean | string;
|
1500
|
+
skin_url?: string;
|
1501
|
+
statusbar?: boolean;
|
1502
|
+
style_formats?: AllowedFormat[];
|
1503
|
+
style_formats_autohide?: boolean;
|
1504
|
+
style_formats_merge?: boolean;
|
1505
|
+
submit_patch?: boolean;
|
1506
|
+
suffix?: string;
|
1507
|
+
target?: HTMLElement;
|
1508
|
+
theme?: string | ThemeInitFunc;
|
1509
|
+
theme_url?: string;
|
1510
|
+
toolbar?: boolean | string | string[] | Array<ToolbarGroup>;
|
1511
|
+
toolbar1?: string;
|
1512
|
+
toolbar2?: string;
|
1513
|
+
toolbar3?: string;
|
1514
|
+
toolbar4?: string;
|
1515
|
+
toolbar5?: string;
|
1516
|
+
toolbar6?: string;
|
1517
|
+
toolbar7?: string;
|
1518
|
+
toolbar8?: string;
|
1519
|
+
toolbar9?: string;
|
1520
|
+
toolbar_mode?: ToolbarMode;
|
1521
|
+
typeahead_urls?: boolean;
|
1522
|
+
url_converter?: URLConverter;
|
1523
|
+
url_converter_scope?: any;
|
1524
|
+
urlconverter_callback?: string | URLConverterCallback;
|
1525
|
+
valid_children?: string;
|
1526
|
+
valid_classes?: string | Record<string, string>;
|
1527
|
+
valid_elements?: string;
|
1528
|
+
valid_styles?: string | Record<string, string>;
|
1529
|
+
verify_html?: boolean;
|
1530
|
+
visual?: boolean;
|
1531
|
+
visual_anchor_class?: string;
|
1532
|
+
visual_table_class?: string;
|
1533
|
+
width?: number | string;
|
1534
|
+
toolbar_drawer?: false | 'floating' | 'sliding' | 'scrolling';
|
1535
|
+
editor_deselector?: string;
|
1536
|
+
editor_selector?: string;
|
1537
|
+
elements?: string;
|
1538
|
+
filepicker_validator_handler?: FilePickerValidationCallback;
|
1539
|
+
mode?: 'exact' | 'textareas' | 'specific_textareas';
|
1540
|
+
types?: Record<string, any>[];
|
1541
|
+
block_elements?: string;
|
1542
|
+
boolean_attributes?: string;
|
1543
|
+
move_caret_before_on_enter_elements?: string;
|
1544
|
+
non_empty_elements?: string;
|
1545
|
+
self_closing_elements?: string;
|
1546
|
+
short_ended_elements?: string;
|
1547
|
+
text_block_elements?: string;
|
1548
|
+
text_inline_elements?: string;
|
1549
|
+
whitespace_elements?: string;
|
1550
|
+
special?: string;
|
1551
|
+
disable_nodechange?: boolean;
|
1552
|
+
forced_plugins?: string | string[];
|
1553
|
+
plugin_base_urls?: Record<string, string>;
|
1554
|
+
service_message?: string;
|
1555
|
+
validate?: boolean;
|
1556
|
+
[key: string]: any;
|
1557
|
+
}
|
1558
|
+
interface RawEditorSettings extends BaseEditorSettings {
|
1559
|
+
external_plugins?: Record<string, string>;
|
1560
|
+
mobile?: RawEditorSettings;
|
1561
|
+
plugins?: string | string[];
|
1562
|
+
}
|
1563
|
+
interface EditorSettings extends BaseEditorSettings {
|
1564
|
+
external_plugins: Record<string, string>;
|
1565
|
+
plugins: string;
|
1566
|
+
}
|
1567
|
+
interface ParamTypeMap {
|
1568
|
+
'hash': Record<string, string>;
|
1569
|
+
'string': string;
|
1570
|
+
'number': number;
|
1571
|
+
'boolean': boolean;
|
1572
|
+
'string[]': string[];
|
1573
|
+
'array': any[];
|
1574
|
+
}
|
1575
|
+
interface BlobInfoImagePair {
|
1576
|
+
image: HTMLImageElement;
|
1577
|
+
blobInfo: BlobInfo;
|
1578
|
+
}
|
1579
|
+
declare class NodeChange {
|
1580
|
+
private readonly editor;
|
1581
|
+
private lastPath;
|
1582
|
+
constructor(editor: Editor);
|
1583
|
+
nodeChanged(args?: any): void;
|
1584
|
+
private isSameElementPath;
|
1585
|
+
}
|
1586
|
+
interface SelectionOverrides {
|
1587
|
+
showCaret: (direction: number, node: Element, before: boolean, scrollIntoView?: boolean) => Range | null;
|
1588
|
+
showBlockCaretContainer: (blockCaretContainer: Element) => void;
|
1589
|
+
hideFakeCaret: () => void;
|
1590
|
+
destroy: () => void;
|
1591
|
+
}
|
1592
|
+
interface Quirks {
|
1593
|
+
refreshContentEditable(): void;
|
1594
|
+
isHidden(): boolean;
|
1595
|
+
}
|
1596
|
+
declare type DecoratorData = Record<string, any>;
|
1597
|
+
declare type Decorator = (uid: string, data: DecoratorData) => {
|
1598
|
+
attributes?: {};
|
1599
|
+
classes?: string[];
|
1600
|
+
};
|
1601
|
+
declare type AnnotationListener = (state: boolean, name: string, data?: {
|
1602
|
+
uid: string;
|
1603
|
+
nodes: any[];
|
1604
|
+
}) => void;
|
1605
|
+
declare type AnnotationListenerApi = AnnotationListener;
|
1606
|
+
interface AnnotatorSettings {
|
1607
|
+
decorate: Decorator;
|
1608
|
+
persistent?: boolean;
|
1609
|
+
}
|
1610
|
+
interface Annotator {
|
1611
|
+
register: (name: string, settings: AnnotatorSettings) => void;
|
1612
|
+
annotate: (name: string, data: DecoratorData) => void;
|
1613
|
+
annotationChanged: (name: string, f: AnnotationListenerApi) => void;
|
1614
|
+
remove: (name: string) => void;
|
1615
|
+
getAll: (name: string) => Record<string, Element[]>;
|
1616
|
+
}
|
1617
|
+
interface GeomRect {
|
1618
|
+
readonly x: number;
|
1619
|
+
readonly y: number;
|
1620
|
+
readonly w: number;
|
1621
|
+
readonly h: number;
|
1622
|
+
}
|
1623
|
+
interface Rect {
|
1624
|
+
inflate: (rect: GeomRect, w: number, h: number) => GeomRect;
|
1625
|
+
relativePosition: (rect: GeomRect, targetRect: GeomRect, rel: string) => GeomRect;
|
1626
|
+
findBestRelativePosition: (rect: GeomRect, targetRect: GeomRect, constrainRect: GeomRect, rels: string[]) => string | null;
|
1627
|
+
intersect: (rect: GeomRect, cropRect: GeomRect) => GeomRect | null;
|
1628
|
+
clamp: (rect: GeomRect, clampRect: GeomRect, fixedSize?: boolean) => GeomRect;
|
1629
|
+
create: (x: number, y: number, w: number, h: number) => GeomRect;
|
1630
|
+
fromClientRect: (clientRect: DOMRect) => GeomRect;
|
1631
|
+
}
|
1632
|
+
interface StyleMap {
|
1633
|
+
[s: string]: string | number;
|
1634
|
+
}
|
1635
|
+
interface StylesSettings {
|
1636
|
+
allow_script_urls?: boolean;
|
1637
|
+
allow_svg_data_urls?: boolean;
|
1638
|
+
url_converter?: URLConverter;
|
1639
|
+
url_converter_scope?: any;
|
1640
|
+
}
|
1641
|
+
interface Styles {
|
1642
|
+
toHex: (color: string) => string;
|
1643
|
+
parse: (css: string) => Record<string, string>;
|
1644
|
+
serialize: (styles: StyleMap, elementName?: string) => string;
|
1645
|
+
}
|
1646
|
+
interface DOMUtilsSettings {
|
1647
|
+
schema: Schema;
|
1648
|
+
url_converter: URLConverter;
|
1649
|
+
url_converter_scope: any;
|
1650
|
+
ownEvents: boolean;
|
1651
|
+
keep_values: boolean;
|
1652
|
+
hex_colors: boolean;
|
1653
|
+
update_styles: boolean;
|
1654
|
+
root_element: HTMLElement;
|
1655
|
+
collect: Function;
|
1656
|
+
onSetAttrib: Function;
|
1657
|
+
contentCssCors: boolean;
|
1658
|
+
referrerPolicy: ReferrerPolicy;
|
1659
|
+
}
|
1660
|
+
declare type Target = Node | Window;
|
1661
|
+
declare type RunArguments<T extends Node = Node> = string | T | Array<string | T>;
|
1662
|
+
declare type BoundEvent = [
|
1663
|
+
Target,
|
1664
|
+
string,
|
1665
|
+
EventUtilsCallback<any>,
|
1666
|
+
any
|
1667
|
+
];
|
1668
|
+
declare type Callback<K extends string> = EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>;
|
1669
|
+
interface DOMUtils {
|
1670
|
+
doc: Document;
|
1671
|
+
settings: Partial<DOMUtilsSettings>;
|
1672
|
+
win: Window;
|
1673
|
+
files: Record<string, boolean>;
|
1674
|
+
stdMode: boolean;
|
1675
|
+
boxModel: boolean;
|
1676
|
+
styleSheetLoader: StyleSheetLoader;
|
1677
|
+
boundEvents: BoundEvent[];
|
1678
|
+
styles: Styles;
|
1679
|
+
schema: Schema;
|
1680
|
+
events: EventUtils;
|
1681
|
+
root: Node;
|
1682
|
+
$: DomQueryConstructor;
|
1683
|
+
$$: {
|
1684
|
+
<T extends Node>(elm: T | T[] | DomQuery<T>): DomQuery<T>;
|
1685
|
+
(elm: string): DomQuery<Node>;
|
1686
|
+
};
|
1687
|
+
isBlock: (node: string | Node) => boolean;
|
1688
|
+
clone: (node: Node, deep: boolean) => Node;
|
1689
|
+
getRoot: () => HTMLElement;
|
1690
|
+
getViewPort: (argWin?: Window) => GeomRect;
|
1691
|
+
getRect: (elm: string | HTMLElement) => GeomRect;
|
1692
|
+
getSize: (elm: string | HTMLElement) => {
|
1693
|
+
w: number;
|
1694
|
+
h: number;
|
1695
|
+
};
|
1696
|
+
getParent: {
|
1697
|
+
<K extends keyof HTMLElementTagNameMap>(node: string | Node, selector: K, root?: Node): HTMLElementTagNameMap[K] | null;
|
1698
|
+
<T extends HTMLElement>(node: string | Node, selector: (node: HTMLElement) => node is T, root?: Node): T | null;
|
1699
|
+
<T extends Element = Element>(node: string | Node, selector?: string | ((node: HTMLElement) => boolean | void), root?: Node): T | null;
|
1700
|
+
};
|
1701
|
+
getParents: {
|
1702
|
+
<K extends keyof HTMLElementTagNameMap>(elm: string | Node, selector: K, root?: Node, collect?: boolean): Array<HTMLElementTagNameMap[K]>;
|
1703
|
+
<T extends HTMLElement>(node: string | Node, selector: (node: HTMLElement) => node is T, root?: Node): T[];
|
1704
|
+
<T extends Element = Element>(elm: string | Node, selector?: string | ((node: HTMLElement) => boolean | void), root?: Node, collect?: boolean): T[];
|
1705
|
+
};
|
1706
|
+
get: (elm: string | Node) => HTMLElement | null;
|
1707
|
+
getNext: (node: Node, selector: string | ((node: Node) => boolean)) => Node | null;
|
1708
|
+
getPrev: (node: Node, selector: string | ((node: Node) => boolean)) => Node | null;
|
1709
|
+
select: {
|
1710
|
+
<K extends keyof HTMLElementTagNameMap>(selector: K, scope?: string | Node): Array<HTMLElementTagNameMap[K]>;
|
1711
|
+
<T extends HTMLElement = HTMLElement>(selector: string, scope?: string | Node): T[];
|
1712
|
+
};
|
1713
|
+
is: (elm: Node | Node[], selector: string) => boolean;
|
1714
|
+
add: (parentElm: RunArguments, name: string | Node, attrs?: Record<string, string | boolean | number>, html?: string | Node, create?: boolean) => HTMLElement;
|
1715
|
+
create: {
|
1716
|
+
<K extends keyof HTMLElementTagNameMap>(name: K, attrs?: Record<string, string | boolean | number>, html?: string | Node): HTMLElementTagNameMap[K];
|
1717
|
+
(name: string, attrs?: Record<string, string | boolean | number>, html?: string | Node): HTMLElement;
|
1718
|
+
};
|
1719
|
+
createHTML: (name: string, attrs?: Record<string, string>, html?: string) => string;
|
1720
|
+
createFragment: (html?: string) => DocumentFragment;
|
1721
|
+
remove: <T extends Node>(node: string | T | T[] | DomQuery<T>, keepChildren?: boolean) => T | T[];
|
1722
|
+
setStyle: {
|
1723
|
+
(elm: string | Node | Node[], name: string, value: string | number | null): void;
|
1724
|
+
(elm: string | Node | Node[], styles: StyleMap): void;
|
1725
|
+
};
|
1726
|
+
getStyle: (elm: string | Node, name: string, computed?: boolean) => string;
|
1727
|
+
setStyles: (elm: string | Node | Node[], stylesArg: StyleMap) => void;
|
1728
|
+
removeAllAttribs: (e: RunArguments<Element>) => void;
|
1729
|
+
setAttrib: (elm: string | Node | Node[], name: string, value: string | boolean | number | null) => void;
|
1730
|
+
setAttribs: (elm: string | Node | Node[], attrs: Record<string, string | boolean | number | null>) => void;
|
1731
|
+
getAttrib: (elm: string | Node, name: string, defaultVal?: string) => string;
|
1732
|
+
getPos: (elm: string | Node, rootElm?: Node) => {
|
1733
|
+
x: number;
|
1734
|
+
y: number;
|
1735
|
+
};
|
1736
|
+
parseStyle: (cssText: string) => Record<string, string>;
|
1737
|
+
serializeStyle: (stylesArg: StyleMap, name?: string) => string;
|
1738
|
+
addStyle: (cssText: string) => void;
|
1739
|
+
loadCSS: (url: string) => void;
|
1740
|
+
addClass: (elm: string | Node | Node[], cls: string) => void;
|
1741
|
+
removeClass: (elm: string | Node | Node[], cls: string) => void;
|
1742
|
+
hasClass: (elm: string | Node, cls: string) => boolean;
|
1743
|
+
toggleClass: (elm: string | Node | Node[], cls: string, state?: boolean) => void;
|
1744
|
+
show: (elm: string | Node | Node[]) => void;
|
1745
|
+
hide: (elm: string | Node | Node[]) => void;
|
1746
|
+
isHidden: (elm: string | Node) => boolean;
|
1747
|
+
uniqueId: (prefix?: string) => string;
|
1748
|
+
setHTML: (elm: string | Node | Node[], html: string) => void;
|
1749
|
+
getOuterHTML: (elm: string | Node) => string;
|
1750
|
+
setOuterHTML: (elm: string | Node | Node[], html: string) => void;
|
1751
|
+
decode: (text: string) => string;
|
1752
|
+
encode: (text: string) => string;
|
1753
|
+
insertAfter: {
|
1754
|
+
<T extends Node>(node: T | T[], reference: string | Node): T;
|
1755
|
+
<T extends Node>(node: RunArguments<T>, reference: string | Node): false | T;
|
1756
|
+
};
|
1757
|
+
replace: {
|
1758
|
+
<T extends Node>(newElm: Node, oldElm: T | T[], keepChildren?: boolean): T;
|
1759
|
+
<T extends Node>(newElm: Node, oldElm: RunArguments<T>, keepChildren?: boolean): false | T;
|
1760
|
+
};
|
1761
|
+
rename: {
|
1762
|
+
<K extends keyof HTMLElementTagNameMap>(elm: Element, name: K): HTMLElementTagNameMap[K];
|
1763
|
+
(elm: Element, name: string): Element;
|
1764
|
+
};
|
1765
|
+
findCommonAncestor: (a: Node, b: Node) => Node;
|
1766
|
+
toHex: (rgbVal: string) => string;
|
1767
|
+
run<R, T extends Node>(this: DOMUtils, elm: T | T[], func: (node: T) => R, scope?: any): R;
|
1768
|
+
run<R, T extends Node>(this: DOMUtils, elm: RunArguments<T>, func: (node: T) => R, scope?: any): false | R;
|
1769
|
+
getAttribs: (elm: string | Node) => NamedNodeMap | Attr[];
|
1770
|
+
isEmpty: (node: Node, elements?: Record<string, any>) => boolean;
|
1771
|
+
createRng: () => Range;
|
1772
|
+
nodeIndex: (node: Node, normalized?: boolean) => number;
|
1773
|
+
split: {
|
1774
|
+
<T extends Node>(parentElm: Node, splitElm: Node, replacementElm: T): T;
|
1775
|
+
<T extends Node>(parentElm: Node, splitElm: T): T;
|
1776
|
+
};
|
1777
|
+
bind: {
|
1778
|
+
<K extends string>(target: Target, name: K, func: Callback<K>, scope?: any): Callback<K>;
|
1779
|
+
<K extends string>(target: Target[], name: K, func: Callback<K>, scope?: any): Callback<K>[];
|
1780
|
+
};
|
1781
|
+
unbind: {
|
1782
|
+
<K extends string>(target: Target, name?: K, func?: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils;
|
1783
|
+
<K extends string>(target: Target[], name?: K, func?: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils[];
|
1784
|
+
};
|
1785
|
+
fire: (target: Node | Window, name: string, evt?: {}) => EventUtils;
|
1786
|
+
getContentEditable: (node: Node) => string | null;
|
1787
|
+
getContentEditableParent: (node: Node) => string | null;
|
1788
|
+
destroy: () => void;
|
1789
|
+
isChildOf: (node: Node, parent: Node) => boolean;
|
1790
|
+
dumpRng: (r: Range) => string;
|
1791
|
+
}
|
1792
|
+
interface ClientRect {
|
1793
|
+
left: number;
|
1794
|
+
top: number;
|
1795
|
+
bottom: number;
|
1796
|
+
right: number;
|
1797
|
+
width: number;
|
1798
|
+
height: number;
|
1799
|
+
}
|
1800
|
+
interface GetSelectionContentArgs extends GetContentArgs {
|
1801
|
+
selection?: boolean;
|
1802
|
+
contextual?: boolean;
|
1803
|
+
}
|
1804
|
+
interface SelectionSetContentArgs extends SetContentArgs {
|
1805
|
+
selection?: boolean;
|
1806
|
+
}
|
1807
|
+
interface BookmarkManager {
|
1808
|
+
getBookmark: (type: number, normalized?: boolean) => Bookmark;
|
1809
|
+
moveToBookmark: (bookmark: Bookmark) => void;
|
1810
|
+
}
|
1811
|
+
interface ControlSelection {
|
1812
|
+
isResizable: (elm: Element) => boolean;
|
1813
|
+
showResizeRect: (elm: Element) => void;
|
1814
|
+
hideResizeRect: () => void;
|
1815
|
+
updateResizeRect: (evt: EditorEvent<any>) => void;
|
1816
|
+
destroy: () => void;
|
1817
|
+
}
|
1818
|
+
interface ParserArgs {
|
1819
|
+
getInner?: boolean | number;
|
1820
|
+
forced_root_block?: boolean | string;
|
1821
|
+
context?: string;
|
1822
|
+
isRootContent?: boolean;
|
1823
|
+
format?: string;
|
1824
|
+
invalid?: boolean;
|
1825
|
+
no_events?: boolean;
|
1826
|
+
[key: string]: any;
|
1827
|
+
}
|
1828
|
+
declare type ParserFilterCallback = (nodes: AstNode[], name: string, args: ParserArgs) => void;
|
1829
|
+
interface ParserFilter {
|
1830
|
+
name: string;
|
1831
|
+
callbacks: ParserFilterCallback[];
|
1832
|
+
}
|
1833
|
+
interface DomParserSettings {
|
1834
|
+
allow_html_data_urls?: boolean;
|
1835
|
+
allow_svg_data_urls?: boolean;
|
1836
|
+
allow_conditional_comments?: boolean;
|
1837
|
+
allow_html_in_named_anchor?: boolean;
|
1838
|
+
allow_script_urls?: boolean;
|
1839
|
+
allow_unsafe_link_target?: boolean;
|
1840
|
+
convert_fonts_to_spans?: boolean;
|
1841
|
+
fix_list_elements?: boolean;
|
1842
|
+
font_size_legacy_values?: string;
|
1843
|
+
forced_root_block?: boolean | string;
|
1844
|
+
forced_root_block_attrs?: Record<string, string>;
|
1845
|
+
padd_empty_with_br?: boolean;
|
1846
|
+
preserve_cdata?: boolean;
|
1847
|
+
remove_trailing_brs?: boolean;
|
1848
|
+
root_name?: string;
|
1849
|
+
validate?: boolean;
|
1850
|
+
inline_styles?: boolean;
|
1851
|
+
blob_cache?: BlobCache;
|
1852
|
+
document?: Document;
|
1853
|
+
images_dataimg_filter?: (img: HTMLImageElement) => boolean;
|
1854
|
+
}
|
1855
|
+
interface DomParser {
|
1856
|
+
schema: Schema;
|
1857
|
+
addAttributeFilter: (name: string, callback: (nodes: AstNode[], name: string, args: ParserArgs) => void) => void;
|
1858
|
+
getAttributeFilters: () => ParserFilter[];
|
1859
|
+
addNodeFilter: (name: string, callback: (nodes: AstNode[], name: string, args: ParserArgs) => void) => void;
|
1860
|
+
getNodeFilters: () => ParserFilter[];
|
1861
|
+
filterNode: (node: AstNode) => AstNode;
|
1862
|
+
parse: (html: string, args?: ParserArgs) => AstNode;
|
1863
|
+
}
|
1864
|
+
interface WriterSettings {
|
1865
|
+
element_format?: 'xhtml' | 'html';
|
1866
|
+
entities?: string;
|
1867
|
+
entity_encoding?: EntityEncoding;
|
1868
|
+
indent?: boolean;
|
1869
|
+
indent_after?: string;
|
1870
|
+
indent_before?: string;
|
1871
|
+
}
|
1872
|
+
declare type Attributes = Array<{
|
1873
|
+
name: string;
|
1874
|
+
value: string;
|
1875
|
+
}>;
|
1876
|
+
interface Writer {
|
1877
|
+
cdata: (text: string) => void;
|
1878
|
+
comment: (text: string) => void;
|
1879
|
+
doctype: (text: string) => void;
|
1880
|
+
end: (name: string) => void;
|
1881
|
+
getContent: () => string;
|
1882
|
+
pi: (name: string, text?: string) => void;
|
1883
|
+
reset: () => void;
|
1884
|
+
start: (name: string, attrs?: Attributes, empty?: boolean) => void;
|
1885
|
+
text: (text: string, raw?: boolean) => void;
|
1886
|
+
}
|
1887
|
+
interface HtmlSerializerSettings extends WriterSettings {
|
1888
|
+
inner?: boolean;
|
1889
|
+
validate?: boolean;
|
1890
|
+
}
|
1891
|
+
interface HtmlSerializer {
|
1892
|
+
serialize: (node: AstNode) => string;
|
1893
|
+
}
|
1894
|
+
interface DomSerializerSettings extends DomParserSettings, WriterSettings, SchemaSettings, HtmlSerializerSettings {
|
1895
|
+
url_converter?: URLConverter;
|
1896
|
+
url_converter_scope?: {};
|
1897
|
+
}
|
1898
|
+
interface DomSerializerImpl {
|
1899
|
+
schema: Schema;
|
1900
|
+
addNodeFilter: (name: string, callback: (nodes: AstNode[], name: string, args: ParserArgs) => void) => void;
|
1901
|
+
addAttributeFilter: (name: string, callback: (nodes: AstNode[], name: string, args: ParserArgs) => void) => void;
|
1902
|
+
getNodeFilters: () => ParserFilter[];
|
1903
|
+
getAttributeFilters: () => ParserFilter[];
|
1904
|
+
serialize: {
|
1905
|
+
(node: Element, parserArgs: {
|
1906
|
+
format: 'tree';
|
1907
|
+
} & ParserArgs): AstNode;
|
1908
|
+
(node: Element, parserArgs?: ParserArgs): string;
|
1909
|
+
};
|
1910
|
+
addRules: (rules: string) => void;
|
1911
|
+
setRules: (rules: string) => void;
|
1912
|
+
addTempAttr: (name: string) => void;
|
1913
|
+
getTempAttrs: () => string[];
|
1914
|
+
}
|
1915
|
+
interface DomSerializer extends DomSerializerImpl {
|
1916
|
+
}
|
1917
|
+
interface EditorSelection {
|
1918
|
+
bookmarkManager: BookmarkManager;
|
1919
|
+
controlSelection: ControlSelection;
|
1920
|
+
dom: DOMUtils;
|
1921
|
+
win: Window;
|
1922
|
+
serializer: DomSerializer;
|
1923
|
+
editor: Editor;
|
1924
|
+
collapse: (toStart?: boolean) => void;
|
1925
|
+
setCursorLocation: {
|
1926
|
+
(node: Node, offset: number): void;
|
1927
|
+
(): void;
|
1928
|
+
};
|
1929
|
+
getContent: {
|
1930
|
+
(args: {
|
1931
|
+
format: 'tree';
|
1932
|
+
} & GetSelectionContentArgs): AstNode;
|
1933
|
+
(args?: GetSelectionContentArgs): string;
|
1934
|
+
};
|
1935
|
+
setContent: (content: string, args?: SelectionSetContentArgs) => void;
|
1936
|
+
getBookmark: (type?: number, normalized?: boolean) => Bookmark;
|
1937
|
+
moveToBookmark: (bookmark: Bookmark) => void;
|
1938
|
+
select: (node: Node, content?: boolean) => Node;
|
1939
|
+
isCollapsed: () => boolean;
|
1940
|
+
isForward: () => boolean;
|
1941
|
+
setNode: (elm: Element) => Element;
|
1942
|
+
getNode: () => Element;
|
1943
|
+
getSel: () => Selection | null;
|
1944
|
+
setRng: (rng: Range, forward?: boolean) => void;
|
1945
|
+
getRng: () => Range;
|
1946
|
+
getStart: (real?: boolean) => Element;
|
1947
|
+
getEnd: (real?: boolean) => Element;
|
1948
|
+
getSelectedBlocks: (startElm?: Element, endElm?: Element) => Element[];
|
1949
|
+
normalize: () => Range;
|
1950
|
+
selectorChanged: (selector: string, callback: (active: boolean, args: {
|
1951
|
+
node: Node;
|
1952
|
+
selector: String;
|
1953
|
+
parents: Element[];
|
1954
|
+
}) => void) => EditorSelection;
|
1955
|
+
selectorChangedWithUnbind: (selector: string, callback: (active: boolean, args: {
|
1956
|
+
node: Node;
|
1957
|
+
selector: String;
|
1958
|
+
parents: Element[];
|
1959
|
+
}) => void) => {
|
1960
|
+
unbind: () => void;
|
1961
|
+
};
|
1962
|
+
getScrollContainer: () => HTMLElement;
|
1963
|
+
scrollIntoView: (elm?: HTMLElement, alignToTop?: boolean) => void;
|
1964
|
+
placeCaretAt: (clientX: number, clientY: number) => void;
|
1965
|
+
getBoundingClientRect: () => ClientRect | DOMRect;
|
1966
|
+
destroy: () => void;
|
1967
|
+
}
|
1968
|
+
declare type EditorCommandCallback = (ui: boolean, value: any, args: any) => void;
|
1969
|
+
declare type EditorCommandsCallback = (command: string, ui: boolean, value: any, args: any) => void;
|
1970
|
+
interface Commands {
|
1971
|
+
state: Record<string, (command: string) => boolean>;
|
1972
|
+
exec: Record<string, EditorCommandsCallback>;
|
1973
|
+
value: Record<string, (command: string) => string>;
|
1974
|
+
}
|
1975
|
+
interface EditorCommandsConstructor {
|
1976
|
+
readonly prototype: EditorCommands;
|
1977
|
+
new (editor: Editor): EditorCommands;
|
1978
|
+
}
|
1979
|
+
declare class EditorCommands {
|
1980
|
+
private readonly editor;
|
1981
|
+
private selectionBookmark;
|
1982
|
+
private commands;
|
1983
|
+
constructor(editor: Editor);
|
1984
|
+
execCommand(command: string, ui?: boolean, value?: any, args?: any): boolean;
|
1985
|
+
queryCommandState(command: string): boolean;
|
1986
|
+
queryCommandValue(command: string): string;
|
1987
|
+
addCommands<K extends keyof Commands>(commandList: Commands[K], type: K): void;
|
1988
|
+
addCommands(commandList: Record<string, EditorCommandsCallback>): void;
|
1989
|
+
addCommand(command: string, callback: EditorCommandCallback, scope?: any): void;
|
1990
|
+
queryCommandSupported(command: string): boolean;
|
1991
|
+
addQueryStateHandler(command: string, callback: () => boolean, scope?: any): void;
|
1992
|
+
addQueryValueHandler(command: string, callback: () => string, scope?: any): void;
|
1993
|
+
hasCustomCommand(command: string): boolean;
|
1994
|
+
private execNativeCommand;
|
1995
|
+
private isFormatMatch;
|
1996
|
+
private toggleFormat;
|
1997
|
+
private storeSelection;
|
1998
|
+
private restoreSelection;
|
1999
|
+
private setupCommands;
|
2000
|
+
}
|
2001
|
+
interface WindowParams {
|
2002
|
+
readonly inline?: 'cursor' | 'toolbar';
|
2003
|
+
readonly ariaAttrs?: boolean;
|
2004
|
+
}
|
2005
|
+
declare type InstanceApi<T> = UrlDialogInstanceApi | DialogInstanceApi<T>;
|
2006
|
+
interface WindowManagerImpl {
|
2007
|
+
open: <T>(config: DialogSpec<T>, params: WindowParams, closeWindow: (dialog: DialogInstanceApi<T>) => void) => DialogInstanceApi<T>;
|
2008
|
+
openUrl: (config: UrlDialogSpec, closeWindow: (dialog: UrlDialogInstanceApi) => void) => UrlDialogInstanceApi;
|
2009
|
+
alert: (message: string, callback: () => void) => void;
|
2010
|
+
confirm: (message: string, callback: (state: boolean) => void) => void;
|
2011
|
+
close: (dialog: InstanceApi<any>) => void;
|
2012
|
+
}
|
2013
|
+
interface WindowManager {
|
2014
|
+
open: <T>(config: DialogSpec<T>, params?: WindowParams) => DialogInstanceApi<T>;
|
2015
|
+
openUrl: (config: UrlDialogSpec) => UrlDialogInstanceApi;
|
2016
|
+
alert: (message: string, callback?: () => void, scope?: any) => void;
|
2017
|
+
confirm: (message: string, callback?: (state: boolean) => void, scope?: any) => void;
|
2018
|
+
close: () => void;
|
2019
|
+
}
|
2020
|
+
interface ExecCommandEvent {
|
2021
|
+
command: string;
|
2022
|
+
ui?: boolean;
|
2023
|
+
value?: any;
|
2024
|
+
}
|
2025
|
+
declare type GetContentEvent = GetContentArgs & {
|
2026
|
+
source_view?: boolean;
|
2027
|
+
selection?: boolean;
|
2028
|
+
save?: boolean;
|
2029
|
+
};
|
2030
|
+
declare type SetContentEvent = SetContentArgs & {
|
2031
|
+
source_view?: boolean;
|
2032
|
+
paste?: boolean;
|
2033
|
+
selection?: boolean;
|
2034
|
+
};
|
2035
|
+
interface NewBlockEvent {
|
2036
|
+
newBlock: Element;
|
2037
|
+
}
|
2038
|
+
interface NodeChangeEvent {
|
2039
|
+
element: Element;
|
2040
|
+
parents: Node[];
|
2041
|
+
selectionChange?: boolean;
|
2042
|
+
initial?: boolean;
|
2043
|
+
}
|
2044
|
+
interface FormatEvent {
|
2045
|
+
format: string;
|
2046
|
+
vars?: FormatVars;
|
2047
|
+
node?: Node | RangeLikeObject;
|
2048
|
+
}
|
2049
|
+
interface ObjectResizeEvent {
|
2050
|
+
target: HTMLElement;
|
2051
|
+
width: number;
|
2052
|
+
height: number;
|
2053
|
+
origin: string;
|
2054
|
+
}
|
2055
|
+
interface ObjectSelectedEvent {
|
2056
|
+
target: Node;
|
2057
|
+
targetClone?: Node;
|
2058
|
+
}
|
2059
|
+
interface ScrollIntoViewEvent {
|
2060
|
+
elm: HTMLElement;
|
2061
|
+
alignToTop: boolean;
|
2062
|
+
}
|
2063
|
+
interface SetSelectionRangeEvent {
|
2064
|
+
range: Range;
|
2065
|
+
forward: boolean;
|
2066
|
+
}
|
2067
|
+
interface ShowCaretEvent {
|
2068
|
+
target: Node;
|
2069
|
+
direction: number;
|
2070
|
+
before: boolean;
|
2071
|
+
}
|
2072
|
+
interface SwitchModeEvent {
|
2073
|
+
mode: string;
|
2074
|
+
}
|
2075
|
+
interface AddUndoEvent {
|
2076
|
+
level: UndoLevel;
|
2077
|
+
lastLevel: UndoLevel;
|
2078
|
+
originalEvent: Event;
|
2079
|
+
}
|
2080
|
+
interface UndoRedoEvent {
|
2081
|
+
level: UndoLevel;
|
2082
|
+
}
|
2083
|
+
interface WindowEvent<T extends DialogData> {
|
2084
|
+
dialog: InstanceApi<T>;
|
2085
|
+
}
|
2086
|
+
interface ProgressStateEvent {
|
2087
|
+
state: boolean;
|
2088
|
+
time?: number;
|
2089
|
+
}
|
2090
|
+
interface AfterProgressStateEvent {
|
2091
|
+
state: boolean;
|
2092
|
+
}
|
2093
|
+
interface PlaceholderToggleEvent {
|
2094
|
+
state: boolean;
|
2095
|
+
}
|
2096
|
+
interface LoadErrorEvent {
|
2097
|
+
message: string;
|
2098
|
+
}
|
2099
|
+
interface PreProcessEvent extends ParserArgs {
|
2100
|
+
node: Element;
|
2101
|
+
}
|
2102
|
+
interface PostProcessEvent extends ParserArgs {
|
2103
|
+
content: string;
|
2104
|
+
}
|
2105
|
+
interface EditorEventMap extends Omit<NativeEventMap, 'blur' | 'focus'> {
|
2106
|
+
'activate': {
|
2107
|
+
relatedTarget: Editor;
|
2108
|
+
};
|
2109
|
+
'deactivate': {
|
2110
|
+
relatedTarget: Editor;
|
2111
|
+
};
|
2112
|
+
'focus': {
|
2113
|
+
blurredEditor: Editor;
|
2114
|
+
};
|
2115
|
+
'blur': {
|
2116
|
+
focusedEditor: Editor;
|
2117
|
+
};
|
2118
|
+
'resize': UIEvent;
|
2119
|
+
'scroll': UIEvent;
|
2120
|
+
'detach': {};
|
2121
|
+
'remove': {};
|
2122
|
+
'init': {};
|
2123
|
+
'ScrollIntoView': ScrollIntoViewEvent;
|
2124
|
+
'AfterScrollIntoView': ScrollIntoViewEvent;
|
2125
|
+
'ObjectResized': ObjectResizeEvent;
|
2126
|
+
'ObjectResizeStart': ObjectResizeEvent;
|
2127
|
+
'SwitchMode': SwitchModeEvent;
|
2128
|
+
'ScrollWindow': UIEvent;
|
2129
|
+
'ResizeWindow': UIEvent;
|
2130
|
+
'SkinLoaded': {};
|
2131
|
+
'SkinLoadError': LoadErrorEvent;
|
2132
|
+
'PluginLoadError': LoadErrorEvent;
|
2133
|
+
'IconsLoadError': LoadErrorEvent;
|
2134
|
+
'LanguageLoadError': LoadErrorEvent;
|
2135
|
+
'BeforeExecCommand': ExecCommandEvent;
|
2136
|
+
'ExecCommand': ExecCommandEvent;
|
2137
|
+
'NodeChange': NodeChangeEvent;
|
2138
|
+
'FormatApply': FormatEvent;
|
2139
|
+
'FormatRemove': FormatEvent;
|
2140
|
+
'ShowCaret': ShowCaretEvent;
|
2141
|
+
'SelectionChange': {};
|
2142
|
+
'ObjectSelected': ObjectSelectedEvent;
|
2143
|
+
'BeforeObjectSelected': ObjectSelectedEvent;
|
2144
|
+
'GetSelectionRange': {
|
2145
|
+
range: Range;
|
2146
|
+
};
|
2147
|
+
'SetSelectionRange': SetSelectionRangeEvent;
|
2148
|
+
'AfterSetSelectionRange': SetSelectionRangeEvent;
|
2149
|
+
'BeforeGetContent': GetContentEvent;
|
2150
|
+
'GetContent': GetContentEvent;
|
2151
|
+
'BeforeSetContent': SetContentEvent;
|
2152
|
+
'SetContent': SetContentEvent;
|
2153
|
+
'LoadContent': {};
|
2154
|
+
'PreviewFormats': {};
|
2155
|
+
'AfterPreviewFormats': {};
|
2156
|
+
'ScriptsLoaded': {};
|
2157
|
+
'PreInit': {};
|
2158
|
+
'PostRender': {};
|
2159
|
+
'NewBlock': NewBlockEvent;
|
2160
|
+
'ClearUndos': {};
|
2161
|
+
'TypingUndo': {};
|
2162
|
+
'Redo': UndoRedoEvent;
|
2163
|
+
'Undo': UndoRedoEvent;
|
2164
|
+
'BeforeAddUndo': AddUndoEvent;
|
2165
|
+
'AddUndo': AddUndoEvent;
|
2166
|
+
'CloseWindow': WindowEvent<any>;
|
2167
|
+
'OpenWindow': WindowEvent<any>;
|
2168
|
+
'ProgressState': ProgressStateEvent;
|
2169
|
+
'AfterProgressState': AfterProgressStateEvent;
|
2170
|
+
'PlaceholderToggle': PlaceholderToggleEvent;
|
2171
|
+
'tap': TouchEvent;
|
2172
|
+
'longpress': TouchEvent;
|
2173
|
+
'longpresscancel': {};
|
2174
|
+
'PreProcess': PreProcessEvent;
|
2175
|
+
'PostProcess': PostProcessEvent;
|
2176
|
+
}
|
2177
|
+
interface EditorManagerEventMap {
|
2178
|
+
'AddEditor': {
|
2179
|
+
editor: Editor;
|
2180
|
+
};
|
2181
|
+
'RemoveEditor': {
|
2182
|
+
editor: Editor;
|
2183
|
+
};
|
2184
|
+
'BeforeUnload': {
|
2185
|
+
returnValue: any;
|
2186
|
+
};
|
2187
|
+
}
|
2188
|
+
type EventTypes_d_ExecCommandEvent = ExecCommandEvent;
|
2189
|
+
type EventTypes_d_GetContentEvent = GetContentEvent;
|
2190
|
+
type EventTypes_d_SetContentEvent = SetContentEvent;
|
2191
|
+
type EventTypes_d_NewBlockEvent = NewBlockEvent;
|
2192
|
+
type EventTypes_d_NodeChangeEvent = NodeChangeEvent;
|
2193
|
+
type EventTypes_d_FormatEvent = FormatEvent;
|
2194
|
+
type EventTypes_d_ObjectResizeEvent = ObjectResizeEvent;
|
2195
|
+
type EventTypes_d_ObjectSelectedEvent = ObjectSelectedEvent;
|
2196
|
+
type EventTypes_d_ScrollIntoViewEvent = ScrollIntoViewEvent;
|
2197
|
+
type EventTypes_d_SetSelectionRangeEvent = SetSelectionRangeEvent;
|
2198
|
+
type EventTypes_d_ShowCaretEvent = ShowCaretEvent;
|
2199
|
+
type EventTypes_d_SwitchModeEvent = SwitchModeEvent;
|
2200
|
+
type EventTypes_d_AddUndoEvent = AddUndoEvent;
|
2201
|
+
type EventTypes_d_UndoRedoEvent = UndoRedoEvent;
|
2202
|
+
type EventTypes_d_WindowEvent<_0> = WindowEvent<_0>;
|
2203
|
+
type EventTypes_d_ProgressStateEvent = ProgressStateEvent;
|
2204
|
+
type EventTypes_d_AfterProgressStateEvent = AfterProgressStateEvent;
|
2205
|
+
type EventTypes_d_PlaceholderToggleEvent = PlaceholderToggleEvent;
|
2206
|
+
type EventTypes_d_LoadErrorEvent = LoadErrorEvent;
|
2207
|
+
type EventTypes_d_PreProcessEvent = PreProcessEvent;
|
2208
|
+
type EventTypes_d_PostProcessEvent = PostProcessEvent;
|
2209
|
+
type EventTypes_d_EditorEventMap = EditorEventMap;
|
2210
|
+
type EventTypes_d_EditorManagerEventMap = EditorManagerEventMap;
|
2211
|
+
declare namespace EventTypes_d {
|
2212
|
+
export { EventTypes_d_ExecCommandEvent as ExecCommandEvent, EventTypes_d_GetContentEvent as GetContentEvent, EventTypes_d_SetContentEvent as SetContentEvent, EventTypes_d_NewBlockEvent as NewBlockEvent, EventTypes_d_NodeChangeEvent as NodeChangeEvent, EventTypes_d_FormatEvent as FormatEvent, EventTypes_d_ObjectResizeEvent as ObjectResizeEvent, EventTypes_d_ObjectSelectedEvent as ObjectSelectedEvent, EventTypes_d_ScrollIntoViewEvent as ScrollIntoViewEvent, EventTypes_d_SetSelectionRangeEvent as SetSelectionRangeEvent, EventTypes_d_ShowCaretEvent as ShowCaretEvent, EventTypes_d_SwitchModeEvent as SwitchModeEvent, EventTypes_d_AddUndoEvent as AddUndoEvent, EventTypes_d_UndoRedoEvent as UndoRedoEvent, EventTypes_d_WindowEvent as WindowEvent, EventTypes_d_ProgressStateEvent as ProgressStateEvent, EventTypes_d_AfterProgressStateEvent as AfterProgressStateEvent, EventTypes_d_PlaceholderToggleEvent as PlaceholderToggleEvent, EventTypes_d_LoadErrorEvent as LoadErrorEvent, EventTypes_d_PreProcessEvent as PreProcessEvent, EventTypes_d_PostProcessEvent as PostProcessEvent, EventTypes_d_EditorEventMap as EditorEventMap, EventTypes_d_EditorManagerEventMap as EditorManagerEventMap, };
|
2213
|
+
}
|
2214
|
+
interface RawString {
|
2215
|
+
raw: string;
|
2216
|
+
}
|
2217
|
+
declare type Primitive = string | number | boolean | Record<string | number, any> | Function;
|
2218
|
+
declare type TokenisedString = [
|
2219
|
+
string,
|
2220
|
+
...Primitive[]
|
2221
|
+
];
|
2222
|
+
declare type Untranslated = Primitive | TokenisedString | RawString;
|
2223
|
+
declare type TranslatedString = string;
|
2224
|
+
interface I18n {
|
2225
|
+
getData: () => Record<string, Record<string, string>>;
|
2226
|
+
setCode: (newCode: string) => void;
|
2227
|
+
getCode: () => string;
|
2228
|
+
add: (code: string, items: Record<string, string>) => void;
|
2229
|
+
translate: (text: Untranslated) => TranslatedString;
|
2230
|
+
isRtl: () => boolean;
|
2231
|
+
hasCode: (code: string) => boolean;
|
2232
|
+
}
|
2233
|
+
interface Observable<T> {
|
2234
|
+
fire<K extends string, U extends MappedEvent<T, K>>(name: K, args?: U, bubble?: boolean): EditorEvent<U>;
|
2235
|
+
on<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): EventDispatcher<T>;
|
2236
|
+
off<K extends string>(name?: K, callback?: (event: EditorEvent<MappedEvent<T, K>>) => void): EventDispatcher<T>;
|
2237
|
+
once<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void): EventDispatcher<T>;
|
2238
|
+
hasEventListeners(name: string): boolean;
|
2239
|
+
}
|
2240
|
+
interface URISettings {
|
2241
|
+
base_uri?: URI;
|
2242
|
+
}
|
2243
|
+
interface URIConstructor {
|
2244
|
+
readonly prototype: URI;
|
2245
|
+
new (url: string, settings?: URISettings): URI;
|
2246
|
+
getDocumentBaseUrl: (loc: {
|
2247
|
+
protocol: string;
|
2248
|
+
host?: string;
|
2249
|
+
href?: string;
|
2250
|
+
pathname?: string;
|
2251
|
+
}) => string;
|
2252
|
+
parseDataUri: (uri: string) => {
|
2253
|
+
type: string;
|
2254
|
+
data: string;
|
2255
|
+
};
|
2256
|
+
}
|
2257
|
+
interface SafeUriOptions {
|
2258
|
+
readonly allow_html_data_urls?: boolean;
|
2259
|
+
readonly allow_script_urls?: boolean;
|
2260
|
+
readonly allow_svg_data_urls?: boolean;
|
2261
|
+
}
|
2262
|
+
declare class URI {
|
2263
|
+
static parseDataUri(uri: string): {
|
2264
|
+
type: string;
|
2265
|
+
data: string;
|
2266
|
+
};
|
2267
|
+
static isDomSafe(uri: string, context?: string, options?: SafeUriOptions): boolean;
|
2268
|
+
static getDocumentBaseUrl(loc: {
|
2269
|
+
protocol: string;
|
2270
|
+
host?: string;
|
2271
|
+
href?: string;
|
2272
|
+
pathname?: string;
|
2273
|
+
}): string;
|
2274
|
+
source: string;
|
2275
|
+
protocol: string;
|
2276
|
+
authority: string;
|
2277
|
+
userInfo: string;
|
2278
|
+
user: string;
|
2279
|
+
password: string;
|
2280
|
+
host: string;
|
2281
|
+
port: string;
|
2282
|
+
relative: string;
|
2283
|
+
path: string;
|
2284
|
+
directory: string;
|
2285
|
+
file: string;
|
2286
|
+
query: string;
|
2287
|
+
anchor: string;
|
2288
|
+
settings: URISettings;
|
2289
|
+
constructor(url: string, settings?: URISettings);
|
2290
|
+
setPath(path: string): void;
|
2291
|
+
toRelative(uri: string): string;
|
2292
|
+
toAbsolute(uri: string, noHost?: boolean): string;
|
2293
|
+
isSameOrigin(uri: URI): boolean;
|
2294
|
+
toRelPath(base: string, path: string): string;
|
2295
|
+
toAbsPath(base: string, path: string): string;
|
2296
|
+
getURI(noProtoHost?: boolean): string;
|
2297
|
+
}
|
2298
|
+
interface EditorManager extends Observable<EditorManagerEventMap> {
|
2299
|
+
$: DomQueryConstructor;
|
2300
|
+
defaultSettings: RawEditorSettings;
|
2301
|
+
majorVersion: string;
|
2302
|
+
minorVersion: string;
|
2303
|
+
releaseDate: string;
|
2304
|
+
editors: Editor[];
|
2305
|
+
activeEditor: Editor;
|
2306
|
+
focusedEditor: Editor;
|
2307
|
+
settings: RawEditorSettings;
|
2308
|
+
baseURI: URI;
|
2309
|
+
baseURL: string;
|
2310
|
+
documentBaseURL: string;
|
2311
|
+
i18n: I18n;
|
2312
|
+
suffix: string;
|
2313
|
+
add(this: EditorManager, editor: Editor): Editor;
|
2314
|
+
addI18n: (code: string, item: Record<string, string>) => void;
|
2315
|
+
createEditor(this: EditorManager, id: string, settings: RawEditorSettings): Editor;
|
2316
|
+
execCommand(this: EditorManager, cmd: string, ui: boolean, value: any): boolean;
|
2317
|
+
get(this: EditorManager): Editor[];
|
2318
|
+
get(this: EditorManager, id: number | string): Editor;
|
2319
|
+
init(this: EditorManager, settings: RawEditorSettings): Promise<Editor[]>;
|
2320
|
+
overrideDefaults(this: EditorManager, defaultSettings: Partial<RawEditorSettings>): void;
|
2321
|
+
remove(this: EditorManager): void;
|
2322
|
+
remove(this: EditorManager, selector: string | Editor): Editor | void;
|
2323
|
+
setActive(this: EditorManager, editor: Editor): void;
|
2324
|
+
setup(this: EditorManager): void;
|
2325
|
+
translate: (text: Untranslated) => TranslatedString;
|
2326
|
+
triggerSave: () => void;
|
2327
|
+
_setBaseUrl(this: EditorManager, baseUrl: string): void;
|
2328
|
+
}
|
2329
|
+
interface EditorObservable extends Observable<EditorEventMap> {
|
2330
|
+
bindPendingEventDelegates(this: Editor): void;
|
2331
|
+
toggleNativeEvent(this: Editor, name: string, state: boolean): any;
|
2332
|
+
unbindAllNativeEvents(this: Editor): void;
|
2333
|
+
}
|
2334
|
+
interface UploadResult$1 {
|
2335
|
+
element: HTMLImageElement;
|
2336
|
+
status: boolean;
|
2337
|
+
blobInfo: BlobInfo;
|
2338
|
+
uploadUri: string;
|
2339
|
+
}
|
2340
|
+
declare type UploadCallback = (results: UploadResult$1[]) => void;
|
2341
|
+
interface EditorUpload {
|
2342
|
+
blobCache: BlobCache;
|
2343
|
+
addFilter: (filter: (img: HTMLImageElement) => boolean) => void;
|
2344
|
+
uploadImages: (callback?: UploadCallback) => Promise<UploadResult$1[]>;
|
2345
|
+
uploadImagesAuto: (callback?: UploadCallback) => void | Promise<UploadResult$1[]>;
|
2346
|
+
scanForImages: () => Promise<BlobInfoImagePair[]>;
|
2347
|
+
destroy: () => void;
|
2348
|
+
}
|
2349
|
+
declare type FormatChangeCallback = (state: boolean, data: {
|
2350
|
+
node: Node;
|
2351
|
+
format: string;
|
2352
|
+
parents: any;
|
2353
|
+
}) => void;
|
2354
|
+
interface FormatRegistry {
|
2355
|
+
get: {
|
2356
|
+
(name: string): Format[] | undefined;
|
2357
|
+
(): Record<string, Format[]>;
|
2358
|
+
};
|
2359
|
+
has: (name: string) => boolean;
|
2360
|
+
register: (name: string | Formats, format?: Format[] | Format) => void;
|
2361
|
+
unregister: (name: string) => Formats;
|
2362
|
+
}
|
2363
|
+
interface Formatter extends FormatRegistry {
|
2364
|
+
apply: (name: string, vars?: FormatVars, node?: Node | RangeLikeObject) => void;
|
2365
|
+
remove: (name: string, vars?: FormatVars, node?: Node | Range, similar?: boolean) => void;
|
2366
|
+
toggle: (name: string, vars?: FormatVars, node?: Node) => void;
|
2367
|
+
match: (name: string, vars?: FormatVars, node?: Node, similar?: boolean) => boolean;
|
2368
|
+
closest: (names: string[]) => string | null;
|
2369
|
+
matchAll: (names: string[], vars?: FormatVars) => string[];
|
2370
|
+
matchNode: (node: Node, name: string, vars?: FormatVars, similar?: boolean) => Format | undefined;
|
2371
|
+
canApply: (name: string) => boolean;
|
2372
|
+
formatChanged: (names: string, callback: FormatChangeCallback, similar?: boolean, vars?: FormatVars) => {
|
2373
|
+
unbind: () => void;
|
2374
|
+
};
|
2375
|
+
getCssText: (format: string | Format) => string;
|
2376
|
+
}
|
2377
|
+
interface EditorMode {
|
2378
|
+
isReadOnly: () => boolean;
|
2379
|
+
set: (mode: string) => void;
|
2380
|
+
get: () => string;
|
2381
|
+
register: (mode: string, api: EditorModeApi) => void;
|
2382
|
+
}
|
2383
|
+
interface EditorModeApi {
|
2384
|
+
activate: () => void;
|
2385
|
+
deactivate: () => void;
|
2386
|
+
editorReadOnly: boolean;
|
2387
|
+
}
|
2388
|
+
interface Plugin {
|
2389
|
+
getMetadata?: () => {
|
2390
|
+
name: string;
|
2391
|
+
url: string;
|
2392
|
+
};
|
2393
|
+
[key: string]: any;
|
2394
|
+
}
|
2395
|
+
declare type PluginManager = AddOnManager<Plugin>;
|
2396
|
+
interface ShortcutsConstructor {
|
2397
|
+
readonly prototype: Shortcuts;
|
2398
|
+
new (editor: Editor): Shortcuts;
|
2399
|
+
}
|
2400
|
+
declare type CommandFunc = string | [
|
2401
|
+
string,
|
2402
|
+
boolean,
|
2403
|
+
any
|
2404
|
+
] | (() => void);
|
2405
|
+
declare class Shortcuts {
|
2406
|
+
private readonly editor;
|
2407
|
+
private readonly shortcuts;
|
2408
|
+
private pendingPatterns;
|
2409
|
+
constructor(editor: Editor);
|
2410
|
+
add(pattern: string, desc: string, cmdFunc: CommandFunc, scope?: any): boolean;
|
2411
|
+
remove(pattern: string): boolean;
|
2412
|
+
private normalizeCommandFunc;
|
2413
|
+
private createShortcut;
|
2414
|
+
private hasModifier;
|
2415
|
+
private isFunctionKey;
|
2416
|
+
private matchShortcut;
|
2417
|
+
private executeShortcutAction;
|
2418
|
+
}
|
2419
|
+
interface Theme {
|
2420
|
+
ui?: any;
|
2421
|
+
inline?: any;
|
2422
|
+
execCommand?: (command: string, ui?: boolean, value?: any) => boolean;
|
2423
|
+
destroy?: () => void;
|
2424
|
+
init?: (editor: Editor, url: string, $: DomQueryConstructor) => void;
|
2425
|
+
renderUI?: () => {
|
2426
|
+
iframeContainer?: HTMLIFrameElement;
|
2427
|
+
editorContainer: HTMLElement;
|
2428
|
+
api?: Partial<EditorUiApi>;
|
2429
|
+
};
|
2430
|
+
getNotificationManagerImpl?: () => NotificationManagerImpl;
|
2431
|
+
getWindowManagerImpl?: () => WindowManagerImpl;
|
2432
|
+
}
|
2433
|
+
declare type ThemeManager = AddOnManager<Theme>;
|
2434
|
+
interface EditorConstructor {
|
2435
|
+
readonly prototype: Editor;
|
2436
|
+
new (id: string, settings: RawEditorSettings, editorManager: EditorManager): Editor;
|
2437
|
+
}
|
2438
|
+
declare class Editor implements EditorObservable {
|
2439
|
+
documentBaseUrl: string;
|
2440
|
+
baseUri: URI;
|
2441
|
+
settings: EditorSettings;
|
2442
|
+
id: string;
|
2443
|
+
plugins: Record<string, Plugin>;
|
2444
|
+
documentBaseURI: URI;
|
2445
|
+
baseURI: URI;
|
2446
|
+
contentCSS: string[];
|
2447
|
+
contentStyles: string[];
|
2448
|
+
ui: EditorUi;
|
2449
|
+
mode: EditorMode;
|
2450
|
+
setMode: (mode: string) => void;
|
2451
|
+
$: DomQueryConstructor;
|
2452
|
+
shortcuts: Shortcuts;
|
2453
|
+
loadedCSS: Record<string, any>;
|
2454
|
+
editorCommands: EditorCommands;
|
2455
|
+
suffix: string;
|
2456
|
+
editorManager: EditorManager;
|
2457
|
+
inline: boolean;
|
2458
|
+
isNotDirty: boolean;
|
2459
|
+
callbackLookup: any;
|
2460
|
+
_nodeChangeDispatcher: NodeChange;
|
2461
|
+
editorUpload: EditorUpload;
|
2462
|
+
annotator: Annotator;
|
2463
|
+
bodyElement: HTMLElement;
|
2464
|
+
bookmark: any;
|
2465
|
+
composing: boolean;
|
2466
|
+
container: HTMLElement;
|
2467
|
+
contentAreaContainer: HTMLElement;
|
2468
|
+
contentDocument: Document;
|
2469
|
+
contentWindow: Window;
|
2470
|
+
delegates: Record<string, (event: any) => void>;
|
2471
|
+
destroyed: boolean;
|
2472
|
+
dom: DOMUtils;
|
2473
|
+
editorContainer: HTMLElement;
|
2474
|
+
eventRoot?: Element;
|
2475
|
+
formatter: Formatter;
|
2476
|
+
formElement: HTMLElement;
|
2477
|
+
formEventDelegate: (e: Event) => void;
|
2478
|
+
hasHiddenInput: boolean;
|
2479
|
+
hasVisual: boolean;
|
2480
|
+
hidden: boolean;
|
2481
|
+
iframeElement: HTMLIFrameElement | null;
|
2482
|
+
iframeHTML: string;
|
2483
|
+
initialized: boolean;
|
2484
|
+
notificationManager: NotificationManager;
|
2485
|
+
orgDisplay: string;
|
2486
|
+
orgVisibility: string;
|
2487
|
+
parser: DomParser;
|
2488
|
+
quirks: Quirks;
|
2489
|
+
readonly: boolean;
|
2490
|
+
removed: boolean;
|
2491
|
+
schema: Schema;
|
2492
|
+
selection: EditorSelection;
|
2493
|
+
serializer: DomSerializer;
|
2494
|
+
startContent: string;
|
2495
|
+
targetElm: HTMLElement;
|
2496
|
+
theme: Theme;
|
2497
|
+
undoManager: UndoManager;
|
2498
|
+
validate: boolean;
|
2499
|
+
windowManager: WindowManager;
|
2500
|
+
_beforeUnload: () => void;
|
2501
|
+
_eventDispatcher: EventDispatcher<NativeEventMap>;
|
2502
|
+
_mceOldSubmit: any;
|
2503
|
+
_pendingNativeEvents: string[];
|
2504
|
+
_selectionOverrides: SelectionOverrides;
|
2505
|
+
_skinLoaded: boolean;
|
2506
|
+
bindPendingEventDelegates: EditorObservable['bindPendingEventDelegates'];
|
2507
|
+
toggleNativeEvent: EditorObservable['toggleNativeEvent'];
|
2508
|
+
unbindAllNativeEvents: EditorObservable['unbindAllNativeEvents'];
|
2509
|
+
fire: EditorObservable['fire'];
|
2510
|
+
on: EditorObservable['on'];
|
2511
|
+
off: EditorObservable['off'];
|
2512
|
+
once: EditorObservable['once'];
|
2513
|
+
hasEventListeners: EditorObservable['hasEventListeners'];
|
2514
|
+
constructor(id: string, settings: RawEditorSettings, editorManager: EditorManager);
|
2515
|
+
render(): void;
|
2516
|
+
focus(skipFocus?: boolean): void;
|
2517
|
+
hasFocus(): boolean;
|
2518
|
+
execCallback(name: string, ...x: any[]): any;
|
2519
|
+
translate(text: Untranslated): TranslatedString;
|
2520
|
+
getParam<K extends keyof ParamTypeMap>(name: string, defaultVal: ParamTypeMap[K], type: K): ParamTypeMap[K];
|
2521
|
+
getParam<K extends keyof EditorSettings>(name: K, defaultVal?: EditorSettings[K], type?: string): EditorSettings[K];
|
2522
|
+
getParam<T>(name: string, defaultVal: T, type?: string): T;
|
2523
|
+
hasPlugin(name: string, loaded?: boolean): boolean;
|
2524
|
+
nodeChanged(args?: any): void;
|
2525
|
+
addCommand(name: string, callback: EditorCommandCallback, scope?: object): void;
|
2526
|
+
addQueryStateHandler(name: string, callback: () => boolean, scope?: any): void;
|
2527
|
+
addQueryValueHandler(name: string, callback: () => string, scope?: any): void;
|
2528
|
+
addShortcut(pattern: string, desc: string, cmdFunc: string | [
|
2529
|
+
string,
|
2530
|
+
boolean,
|
2531
|
+
any
|
2532
|
+
] | (() => void), scope?: any): void;
|
2533
|
+
execCommand(cmd: string, ui?: boolean, value?: any, args?: any): boolean;
|
2534
|
+
queryCommandState(cmd: string): boolean;
|
2535
|
+
queryCommandValue(cmd: string): string;
|
2536
|
+
queryCommandSupported(cmd: string): boolean;
|
2537
|
+
show(): void;
|
2538
|
+
hide(): void;
|
2539
|
+
isHidden(): boolean;
|
2540
|
+
setProgressState(state: boolean, time?: number): void;
|
2541
|
+
load(args?: any): string;
|
2542
|
+
save(args?: any): string;
|
2543
|
+
setContent(content: string, args?: SetContentArgs): string;
|
2544
|
+
setContent(content: AstNode, args?: SetContentArgs): AstNode;
|
2545
|
+
setContent(content: Content, args?: SetContentArgs): Content;
|
2546
|
+
getContent(args: {
|
2547
|
+
format: 'tree';
|
2548
|
+
} & GetContentArgs): AstNode;
|
2549
|
+
getContent(args?: GetContentArgs): string;
|
2550
|
+
insertContent(content: string, args?: any): void;
|
2551
|
+
resetContent(initialContent?: string): void;
|
2552
|
+
isDirty(): boolean;
|
2553
|
+
setDirty(state: boolean): void;
|
2554
|
+
getContainer(): HTMLElement;
|
2555
|
+
getContentAreaContainer(): HTMLElement;
|
2556
|
+
getElement(): HTMLElement;
|
2557
|
+
getWin(): Window;
|
2558
|
+
getDoc(): Document;
|
2559
|
+
getBody(): HTMLElement;
|
2560
|
+
convertURL(url: string, name: string, elm?: any): string;
|
2561
|
+
addVisual(elm?: HTMLElement): void;
|
2562
|
+
remove(): void;
|
2563
|
+
destroy(automatic?: boolean): void;
|
2564
|
+
uploadImages(callback?: UploadCallback): Promise<UploadResult$1[]>;
|
2565
|
+
_scanForImages(): Promise<BlobInfoImagePair[]>;
|
2566
|
+
addButton(): void;
|
2567
|
+
addSidebar(): void;
|
2568
|
+
addMenuItem(): void;
|
2569
|
+
addContextToolbar(): void;
|
2570
|
+
}
|
2571
|
+
interface UrlObject {
|
2572
|
+
prefix: string;
|
2573
|
+
resource: string;
|
2574
|
+
suffix: string;
|
2575
|
+
}
|
2576
|
+
declare type WaitState = 'added' | 'loaded';
|
2577
|
+
declare type AddOnCallback<T> = (editor: Editor, url: string, $?: DomQueryConstructor) => void | T;
|
2578
|
+
declare type AddOnConstructor<T> = new (editor: Editor, url: string, $?: DomQueryConstructor) => T;
|
2579
|
+
interface AddOnManager<T> {
|
2580
|
+
items: AddOnConstructor<T>[];
|
2581
|
+
urls: Record<string, string>;
|
2582
|
+
lookup: Record<string, {
|
2583
|
+
instance: AddOnConstructor<T>;
|
2584
|
+
dependencies?: string[];
|
2585
|
+
}>;
|
2586
|
+
_listeners: {
|
2587
|
+
name: string;
|
2588
|
+
state: WaitState;
|
2589
|
+
callback: () => void;
|
2590
|
+
}[];
|
2591
|
+
get: (name: string) => AddOnConstructor<T>;
|
2592
|
+
dependencies: (name: string) => string[];
|
2593
|
+
requireLangPack: (name: string, languages: string) => void;
|
2594
|
+
add: (id: string, addOn: AddOnCallback<T>, dependencies?: string[]) => AddOnConstructor<T>;
|
2595
|
+
remove: (name: string) => void;
|
2596
|
+
createUrl: (baseUrl: UrlObject, dep: string | UrlObject) => UrlObject;
|
2597
|
+
addComponents: (pluginName: string, scripts: string[]) => void;
|
2598
|
+
load: (name: string, addOnUrl: string | UrlObject, success?: () => void, scope?: any, failure?: () => void) => void;
|
2599
|
+
waitFor: (name: string, callback: () => void, state?: WaitState) => void;
|
2600
|
+
}
|
2601
|
+
interface RangeUtils {
|
2602
|
+
walk: (rng: Range, callback: (nodes: Node[]) => void) => void;
|
2603
|
+
split: (rng: Range) => RangeLikeObject;
|
2604
|
+
normalize: (rng: Range) => boolean;
|
2605
|
+
}
|
2606
|
+
interface ScriptLoaderSettings {
|
2607
|
+
referrerPolicy?: ReferrerPolicy;
|
2608
|
+
}
|
2609
|
+
interface ScriptLoaderConstructor {
|
2610
|
+
readonly prototype: ScriptLoader;
|
2611
|
+
new (): ScriptLoader;
|
2612
|
+
ScriptLoader: ScriptLoader;
|
2613
|
+
}
|
2614
|
+
declare class ScriptLoader {
|
2615
|
+
static ScriptLoader: ScriptLoader;
|
2616
|
+
private settings;
|
2617
|
+
private states;
|
2618
|
+
private queue;
|
2619
|
+
private scriptLoadedCallbacks;
|
2620
|
+
private queueLoadedCallbacks;
|
2621
|
+
private loading;
|
2622
|
+
constructor(settings?: ScriptLoaderSettings);
|
2623
|
+
_setReferrerPolicy(referrerPolicy: ReferrerPolicy): void;
|
2624
|
+
loadScript(url: string, success?: () => void, failure?: () => void): void;
|
2625
|
+
isDone(url: string): boolean;
|
2626
|
+
markDone(url: string): void;
|
2627
|
+
add(url: string, success?: () => void, scope?: any, failure?: () => void): void;
|
2628
|
+
load(url: string, success?: () => void, scope?: any, failure?: () => void): void;
|
2629
|
+
remove(url: string): void;
|
2630
|
+
loadQueue(success?: () => void, scope?: any, failure?: (urls: string[]) => void): void;
|
2631
|
+
loadScripts(scripts: string[], success?: () => void, scope?: any, failure?: (urls: string[]) => void): void;
|
2632
|
+
}
|
2633
|
+
declare type TextProcessCallback = (node: Text, offset: number, text: string) => number;
|
2634
|
+
interface Spot {
|
2635
|
+
container: Text;
|
2636
|
+
offset: number;
|
2637
|
+
}
|
2638
|
+
interface TextSeeker {
|
2639
|
+
backwards: (node: Node, offset: number, process: TextProcessCallback, root?: Node) => Spot | null;
|
2640
|
+
forwards: (node: Node, offset: number, process: TextProcessCallback, root?: Node) => Spot | null;
|
2641
|
+
}
|
2642
|
+
interface DomTreeWalkerConstructor {
|
2643
|
+
readonly prototype: DomTreeWalker;
|
2644
|
+
new (startNode: Node, rootNode: Node): DomTreeWalker;
|
2645
|
+
}
|
2646
|
+
declare class DomTreeWalker {
|
2647
|
+
private readonly rootNode;
|
2648
|
+
private node;
|
2649
|
+
constructor(startNode: Node, rootNode: Node);
|
2650
|
+
current(): Node;
|
2651
|
+
next(shallow?: boolean): Node;
|
2652
|
+
prev(shallow?: boolean): Node;
|
2653
|
+
prev2(shallow?: boolean): Node;
|
2654
|
+
private findSibling;
|
2655
|
+
private findPreviousNode;
|
2656
|
+
}
|
2657
|
+
interface Version {
|
2658
|
+
major: number;
|
2659
|
+
minor: number;
|
2660
|
+
}
|
2661
|
+
interface Env {
|
2662
|
+
opera: boolean;
|
2663
|
+
webkit: boolean;
|
2664
|
+
ie: false | number;
|
2665
|
+
gecko: boolean;
|
2666
|
+
mac: boolean;
|
2667
|
+
iOS: boolean;
|
2668
|
+
android: boolean;
|
2669
|
+
contentEditable: boolean;
|
2670
|
+
transparentSrc: string;
|
2671
|
+
caretAfter: boolean;
|
2672
|
+
range: boolean;
|
2673
|
+
documentMode: number;
|
2674
|
+
fileApi: boolean;
|
2675
|
+
ceFalse: boolean;
|
2676
|
+
cacheSuffix: any;
|
2677
|
+
container: any;
|
2678
|
+
experimentalShadowDom: boolean;
|
2679
|
+
canHaveCSP: boolean;
|
2680
|
+
desktop: boolean;
|
2681
|
+
windowsPhone: boolean;
|
2682
|
+
browser: {
|
2683
|
+
current: string | undefined;
|
2684
|
+
version: Version;
|
2685
|
+
isEdge: () => boolean;
|
2686
|
+
isChrome: () => boolean;
|
2687
|
+
isIE: () => boolean;
|
2688
|
+
isOpera: () => boolean;
|
2689
|
+
isFirefox: () => boolean;
|
2690
|
+
isSafari: () => boolean;
|
2691
|
+
};
|
2692
|
+
os: {
|
2693
|
+
current: string | undefined;
|
2694
|
+
version: Version;
|
2695
|
+
isWindows: () => boolean;
|
2696
|
+
isiOS: () => boolean;
|
2697
|
+
isAndroid: () => boolean;
|
2698
|
+
isOSX: () => boolean;
|
2699
|
+
isLinux: () => boolean;
|
2700
|
+
isSolaris: () => boolean;
|
2701
|
+
isFreeBSD: () => boolean;
|
2702
|
+
isChromeOS: () => boolean;
|
2703
|
+
};
|
2704
|
+
deviceType: {
|
2705
|
+
isiPad: () => boolean;
|
2706
|
+
isiPhone: () => boolean;
|
2707
|
+
isTablet: () => boolean;
|
2708
|
+
isPhone: () => boolean;
|
2709
|
+
isTouch: () => boolean;
|
2710
|
+
isWebView: () => boolean;
|
2711
|
+
isDesktop: () => boolean;
|
2712
|
+
};
|
2713
|
+
}
|
2714
|
+
interface FocusManager {
|
2715
|
+
isEditorUIElement: (elm: Element) => boolean;
|
2716
|
+
}
|
2717
|
+
interface EntitiesMap {
|
2718
|
+
[name: string]: string;
|
2719
|
+
}
|
2720
|
+
interface Entities {
|
2721
|
+
encodeRaw: (text: string, attr?: boolean) => string;
|
2722
|
+
encodeAllRaw: (text: string) => string;
|
2723
|
+
encodeNumeric: (text: string, attr?: boolean) => string;
|
2724
|
+
encodeNamed: (text: string, attr?: boolean, entities?: EntitiesMap) => string;
|
2725
|
+
getEncodeFunc: (name: string, entities?: EntitiesMap | string) => (text: string, attr?: boolean) => string;
|
2726
|
+
decode: (text: string) => string;
|
2727
|
+
}
|
2728
|
+
declare type AttrList = Array<{
|
2729
|
+
name: string;
|
2730
|
+
value: string;
|
2731
|
+
}> & {
|
2732
|
+
map: Record<string, string>;
|
2733
|
+
};
|
2734
|
+
interface SaxParserSettings {
|
2735
|
+
allow_conditional_comments?: boolean;
|
2736
|
+
allow_html_data_urls?: boolean;
|
2737
|
+
allow_script_urls?: boolean;
|
2738
|
+
allow_svg_data_urls?: boolean;
|
2739
|
+
fix_self_closing?: boolean;
|
2740
|
+
preserve_cdata?: boolean;
|
2741
|
+
remove_internals?: boolean;
|
2742
|
+
self_closing_elements?: Record<string, {}>;
|
2743
|
+
validate?: boolean;
|
2744
|
+
document?: Document;
|
2745
|
+
cdata?: (text: string) => void;
|
2746
|
+
comment?: (text: string) => void;
|
2747
|
+
doctype?: (text: string) => void;
|
2748
|
+
end?: (name: string) => void;
|
2749
|
+
pi?: (name: string, text: string) => void;
|
2750
|
+
start?: (name: string, attrs: AttrList, empty: boolean) => void;
|
2751
|
+
text?: (text: string, raw?: boolean) => void;
|
2752
|
+
}
|
2753
|
+
declare type ParserFormat = 'html' | 'xhtml' | 'xml';
|
2754
|
+
interface SaxParser {
|
2755
|
+
parse: (html: string, format?: ParserFormat) => void;
|
2756
|
+
}
|
2757
|
+
interface IconPack {
|
2758
|
+
icons: Record<string, string>;
|
2759
|
+
}
|
2760
|
+
interface IconManager {
|
2761
|
+
add: (id: string, iconPack: IconPack) => void;
|
2762
|
+
get: (id: string) => IconPack;
|
2763
|
+
has: (id: string) => boolean;
|
2764
|
+
}
|
2765
|
+
interface Resource {
|
2766
|
+
load: <T = any>(id: string, url: string) => Promise<T>;
|
2767
|
+
add: (id: string, data: any) => void;
|
2768
|
+
}
|
2769
|
+
declare type WithSubItems<T, K extends keyof T> = T[K] extends Array<any> ? (T & T[K][number]) : T;
|
2770
|
+
interface Props<A extends any[] = any[]> {
|
2771
|
+
Mixins?: Array<Record<string, any>>;
|
2772
|
+
Methods?: string;
|
2773
|
+
Properties?: string;
|
2774
|
+
Statics?: Record<string, any>;
|
2775
|
+
Defaults?: Record<string, any>;
|
2776
|
+
init?: (...args: A) => void;
|
2777
|
+
}
|
2778
|
+
declare type ExtendedClass<T extends Props<A>, A extends any[]> = WithSubItems<T, 'Mixins'>;
|
2779
|
+
interface ExtendedClassConstructor<T extends Props<A>, A extends any[] = any[]> extends Class {
|
2780
|
+
readonly prototype: ExtendedClass<T, A>;
|
2781
|
+
new (...args: A): ExtendedClass<T, A>;
|
2782
|
+
[key: string]: T['Statics'];
|
2783
|
+
}
|
2784
|
+
interface Class {
|
2785
|
+
extend<T extends Props<A>, A extends any[] = any[]>(props: T): ExtendedClassConstructor<T, A>;
|
2786
|
+
}
|
2787
|
+
interface RGB {
|
2788
|
+
r: number;
|
2789
|
+
g: number;
|
2790
|
+
b: number;
|
2791
|
+
}
|
2792
|
+
interface HSV {
|
2793
|
+
h: number;
|
2794
|
+
s: number;
|
2795
|
+
v: number;
|
2796
|
+
}
|
2797
|
+
declare type ColorConstructor = new (value?: string | RGB | HSV) => Color;
|
2798
|
+
interface Color {
|
2799
|
+
toRgb: () => RGB;
|
2800
|
+
toHsv: () => HSV;
|
2801
|
+
toHex: () => string;
|
2802
|
+
parse: (value: string | RGB | HSV) => Color;
|
2803
|
+
}
|
2804
|
+
interface DebounceFunc<T extends (...args: any[]) => void> {
|
2805
|
+
(...args: Parameters<T>): void;
|
2806
|
+
stop: () => void;
|
2807
|
+
}
|
2808
|
+
interface Delay {
|
2809
|
+
requestAnimationFrame: (callback: () => void, element?: HTMLElement) => void;
|
2810
|
+
setEditorInterval: (editor: Editor, callback: () => void, time?: number) => number;
|
2811
|
+
setEditorTimeout: (editor: Editor, callback: () => void, time?: number) => number;
|
2812
|
+
setInterval: (callback: () => void, time?: number) => number;
|
2813
|
+
setTimeout: (callback: () => void, time?: number) => number;
|
2814
|
+
clearInterval: (id?: number) => void;
|
2815
|
+
clearTimeout: (id?: number) => void;
|
2816
|
+
debounce: <T extends (...args: any[]) => any>(callback: T, time?: number) => DebounceFunc<T>;
|
2817
|
+
throttle: <T extends (...args: any[]) => any>(callback: T, time?: number) => DebounceFunc<T>;
|
2818
|
+
}
|
2819
|
+
declare type UploadResult = UploadResult$2;
|
2820
|
+
interface ImageUploader {
|
2821
|
+
upload: (blobInfos: BlobInfo[], showNotification?: boolean) => Promise<UploadResult[]>;
|
2822
|
+
}
|
2823
|
+
interface JSONUtils {
|
2824
|
+
serialize: (obj: any) => string;
|
2825
|
+
parse: (text: string) => any;
|
2826
|
+
}
|
2827
|
+
interface JSONPSettings {
|
2828
|
+
count?: number;
|
2829
|
+
url: string;
|
2830
|
+
callback: (json: string) => void;
|
2831
|
+
}
|
2832
|
+
interface JSONP {
|
2833
|
+
callbacks: {};
|
2834
|
+
count: number;
|
2835
|
+
send(this: JSONP, settings: JSONPSettings): void;
|
2836
|
+
}
|
2837
|
+
interface JSONRequestSettings {
|
2838
|
+
crossDomain?: boolean;
|
2839
|
+
requestheaders?: Record<string, {
|
2840
|
+
key: string;
|
2841
|
+
value: string;
|
2842
|
+
}>;
|
2843
|
+
type?: string;
|
2844
|
+
url?: string;
|
2845
|
+
error_scope?: any;
|
2846
|
+
success_scope?: any;
|
2847
|
+
success?: (data: any) => void;
|
2848
|
+
error?: (error: any, xhr: XMLHttpRequest) => void;
|
2849
|
+
}
|
2850
|
+
interface JSONRequestArgs extends JSONRequestSettings {
|
2851
|
+
id?: string;
|
2852
|
+
method?: string;
|
2853
|
+
params?: string;
|
2854
|
+
}
|
2855
|
+
interface JSONRequestConstructor {
|
2856
|
+
readonly prototype: JSONRequest;
|
2857
|
+
new (settings?: JSONRequestSettings): JSONRequest;
|
2858
|
+
sendRPC: (o: JSONRequestArgs) => void;
|
2859
|
+
}
|
2860
|
+
declare class JSONRequest {
|
2861
|
+
static sendRPC(o: JSONRequestArgs): void;
|
2862
|
+
settings: JSONRequestSettings;
|
2863
|
+
count: number;
|
2864
|
+
constructor(settings?: JSONRequestSettings);
|
2865
|
+
send(args: JSONRequestArgs): void;
|
2866
|
+
}
|
2867
|
+
interface KeyboardLikeEvent {
|
2868
|
+
shiftKey: boolean;
|
2869
|
+
ctrlKey: boolean;
|
2870
|
+
altKey: boolean;
|
2871
|
+
metaKey: boolean;
|
2872
|
+
}
|
2873
|
+
interface VK {
|
2874
|
+
BACKSPACE: number;
|
2875
|
+
DELETE: number;
|
2876
|
+
DOWN: number;
|
2877
|
+
ENTER: number;
|
2878
|
+
ESC: number;
|
2879
|
+
LEFT: number;
|
2880
|
+
RIGHT: number;
|
2881
|
+
SPACEBAR: number;
|
2882
|
+
TAB: number;
|
2883
|
+
UP: number;
|
2884
|
+
PAGE_UP: number;
|
2885
|
+
PAGE_DOWN: number;
|
2886
|
+
END: number;
|
2887
|
+
HOME: number;
|
2888
|
+
modifierPressed: (e: KeyboardLikeEvent) => boolean;
|
2889
|
+
metaKeyPressed: (e: KeyboardLikeEvent) => boolean;
|
2890
|
+
}
|
2891
|
+
interface XHRSettings {
|
2892
|
+
async?: boolean;
|
2893
|
+
content_type?: string;
|
2894
|
+
crossDomain?: boolean;
|
2895
|
+
data?: Document | BodyInit;
|
2896
|
+
requestheaders?: Record<string, {
|
2897
|
+
key: string;
|
2898
|
+
value: string;
|
2899
|
+
}>;
|
2900
|
+
scope?: any;
|
2901
|
+
type?: string;
|
2902
|
+
url: string;
|
2903
|
+
error_scope?: any;
|
2904
|
+
success_scope?: any;
|
2905
|
+
error?: (message: 'TIMED_OUT' | 'GENERAL', xhr: XMLHttpRequest, settings: XHRSettings) => void;
|
2906
|
+
success?: (text: string, xhr: XMLHttpRequest, settings: XHRSettings) => void;
|
2907
|
+
}
|
2908
|
+
interface XHREventMap {
|
2909
|
+
beforeInitialize: {
|
2910
|
+
settings: XHRSettings;
|
2911
|
+
};
|
2912
|
+
beforeSend: {
|
2913
|
+
xhr: XMLHttpRequest;
|
2914
|
+
settings: XHRSettings;
|
2915
|
+
};
|
2916
|
+
}
|
2917
|
+
interface XHR extends Observable<XHREventMap> {
|
2918
|
+
send(this: XHR, settings: XHRSettings): void;
|
2919
|
+
}
|
2920
|
+
interface DOMUtilsNamespace {
|
2921
|
+
new (doc: Document, settings: Partial<DOMUtilsSettings>): DOMUtils;
|
2922
|
+
DOM: DOMUtils;
|
2923
|
+
nodeIndex: (node: Node, normalized?: boolean) => number;
|
2924
|
+
}
|
2925
|
+
interface RangeUtilsNamespace {
|
2926
|
+
new (dom: DOMUtils): RangeUtils;
|
2927
|
+
compareRanges: (rng1: RangeLikeObject, rng2: RangeLikeObject) => boolean;
|
2928
|
+
getCaretRangeFromPoint: (clientX: number, clientY: number, doc: Document) => Range;
|
2929
|
+
getSelectedNode: (range: Range) => Node;
|
2930
|
+
getNode: (container: Node, offset: number) => Node;
|
2931
|
+
}
|
2932
|
+
interface AddOnManagerNamespace {
|
2933
|
+
new <T>(): AddOnManager<T>;
|
2934
|
+
language: string | undefined;
|
2935
|
+
languageLoad: boolean;
|
2936
|
+
baseURL: string;
|
2937
|
+
PluginManager: PluginManager;
|
2938
|
+
ThemeManager: ThemeManager;
|
2939
|
+
}
|
2940
|
+
interface BookmarkManagerNamespace {
|
2941
|
+
(selection: EditorSelection): BookmarkManager;
|
2942
|
+
isBookmarkNode: (node: Node) => boolean;
|
2943
|
+
}
|
2944
|
+
interface SaxParserNamespace {
|
2945
|
+
new (settings?: SaxParserSettings, schema?: Schema): SaxParser;
|
2946
|
+
findEndTag: (schema: Schema, html: string, startIndex: number) => number;
|
2947
|
+
}
|
2948
|
+
interface TinyMCE extends EditorManager {
|
2949
|
+
geom: {
|
2950
|
+
Rect: Rect;
|
2951
|
+
};
|
2952
|
+
util: {
|
2953
|
+
Promise: PromiseConstructor;
|
2954
|
+
Delay: Delay;
|
2955
|
+
Tools: Tools;
|
2956
|
+
VK: VK;
|
2957
|
+
URI: URIConstructor;
|
2958
|
+
Class: Class;
|
2959
|
+
EventDispatcher: EventDispatcherConstructor<any>;
|
2960
|
+
Observable: Observable<any>;
|
2961
|
+
I18n: I18n;
|
2962
|
+
XHR: XHR;
|
2963
|
+
JSON: JSONUtils;
|
2964
|
+
JSONRequest: JSONRequestConstructor;
|
2965
|
+
JSONP: JSONP;
|
2966
|
+
LocalStorage: Storage;
|
2967
|
+
Color: ColorConstructor;
|
2968
|
+
ImageUploader: ImageUploader;
|
2969
|
+
};
|
2970
|
+
dom: {
|
2971
|
+
EventUtils: EventUtilsConstructor;
|
2972
|
+
Sizzle: any;
|
2973
|
+
DomQuery: DomQueryConstructor;
|
2974
|
+
TreeWalker: DomTreeWalkerConstructor;
|
2975
|
+
TextSeeker: new (dom: DOMUtils, isBlockBoundary?: (node: Node) => boolean) => TextSeeker;
|
2976
|
+
DOMUtils: DOMUtilsNamespace;
|
2977
|
+
ScriptLoader: ScriptLoaderConstructor;
|
2978
|
+
RangeUtils: RangeUtilsNamespace;
|
2979
|
+
Serializer: new (settings: DomSerializerSettings, editor?: Editor) => DomSerializer;
|
2980
|
+
ControlSelection: (selection: EditorSelection, editor: Editor) => ControlSelection;
|
2981
|
+
BookmarkManager: BookmarkManagerNamespace;
|
2982
|
+
Selection: new (dom: DOMUtils, win: Window, serializer: DomSerializer, editor: Editor) => EditorSelection;
|
2983
|
+
StyleSheetLoader: new (documentOrShadowRoot: Document | ShadowRoot, settings: StyleSheetLoaderSettings) => StyleSheetLoader;
|
2984
|
+
Event: EventUtils;
|
2985
|
+
};
|
2986
|
+
html: {
|
2987
|
+
Styles: new (settings?: StylesSettings, schema?: Schema) => Styles;
|
2988
|
+
Entities: Entities;
|
2989
|
+
Node: AstNodeConstructor;
|
2990
|
+
Schema: new (settings?: SchemaSettings) => Schema;
|
2991
|
+
SaxParser: SaxParserNamespace;
|
2992
|
+
DomParser: new (settings?: DomParserSettings, schema?: Schema) => DomParser;
|
2993
|
+
Writer: new (settings?: WriterSettings) => Writer;
|
2994
|
+
Serializer: new (settings?: HtmlSerializerSettings, schema?: Schema) => HtmlSerializer;
|
2995
|
+
};
|
2996
|
+
AddOnManager: AddOnManagerNamespace;
|
2997
|
+
Annotator: new (editor: Editor) => Annotator;
|
2998
|
+
Editor: EditorConstructor;
|
2999
|
+
EditorCommands: EditorCommandsConstructor;
|
3000
|
+
EditorManager: EditorManager;
|
3001
|
+
EditorObservable: EditorObservable;
|
3002
|
+
Env: Env;
|
3003
|
+
FocusManager: FocusManager;
|
3004
|
+
Formatter: new (editor: Editor) => Formatter;
|
3005
|
+
NotificationManager: new (editor: Editor) => NotificationManager;
|
3006
|
+
Shortcuts: ShortcutsConstructor;
|
3007
|
+
UndoManager: new (editor: Editor) => UndoManager;
|
3008
|
+
WindowManager: new (editor: Editor) => WindowManager;
|
3009
|
+
DOM: DOMUtils;
|
3010
|
+
ScriptLoader: ScriptLoader;
|
3011
|
+
PluginManager: PluginManager;
|
3012
|
+
ThemeManager: ThemeManager;
|
3013
|
+
IconManager: IconManager;
|
3014
|
+
Resource: Resource;
|
3015
|
+
trim: Tools['trim'];
|
3016
|
+
isArray: Tools['isArray'];
|
3017
|
+
is: Tools['is'];
|
3018
|
+
toArray: Tools['toArray'];
|
3019
|
+
makeMap: Tools['makeMap'];
|
3020
|
+
each: Tools['each'];
|
3021
|
+
map: Tools['map'];
|
3022
|
+
grep: Tools['grep'];
|
3023
|
+
inArray: Tools['inArray'];
|
3024
|
+
extend: Tools['extend'];
|
3025
|
+
create: Tools['create'];
|
3026
|
+
walk: Tools['walk'];
|
3027
|
+
createNS: Tools['createNS'];
|
3028
|
+
resolve: Tools['resolve'];
|
3029
|
+
explode: Tools['explode'];
|
3030
|
+
_addCacheSuffix: Tools['_addCacheSuffix'];
|
3031
|
+
isOpera: boolean;
|
3032
|
+
isWebKit: boolean;
|
3033
|
+
isIE: false | number;
|
3034
|
+
isGecko: boolean;
|
3035
|
+
isMac: boolean;
|
3036
|
+
}
|
3037
|
+
declare const tinymce: TinyMCE;
|
3038
|
+
export default tinymce;
|
3039
|
+
export { AddOnManager, Annotator, AstNode, Bookmark, BookmarkManager, Class, Color, ControlSelection, DOMUtils, Delay, DomParser, DomParserSettings, DomQuery, DomSerializer, DomSerializerSettings, DomTreeWalker, Editor, EditorCommands, EditorEvent, EditorManager, EditorModeApi, EditorObservable, EditorSelection, EditorSettings, Entities, Env, EventDispatcher, EventUtils, EventTypes_d as Events, FocusManager, Format_d as Formats, Formatter, GeomRect, HtmlSerializer, HtmlSerializerSettings, I18n, IconManager, JSONUtils as JSON, JSONP, JSONRequest, JSONRequestArgs, JSONRequestSettings, NotificationApi, NotificationManager, NotificationSpec, Observable, Plugin, PluginManager, RangeUtils, RawEditorSettings, Rect, Resource, SaxParser, SaxParserSettings, Schema, SchemaSettings, ScriptLoader, Shortcuts, StyleSheetLoader, Styles, TextSeeker, Theme, ThemeManager, TinyMCE, Tools, URI, Ui_d as Ui, UndoManager, VK, WindowManager, Writer, WriterSettings, XHR, XHRSettings };
|