tinymce-rails 8.0.1 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/app/assets/source/tinymce/tinymce.js +323 -347
- data/lib/tinymce/rails/version.rb +2 -2
- data/vendor/assets/javascripts/tinymce/icons/default/icons.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.inline.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/content.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide/skin.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.inline.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/content.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/oxide-dark/skin.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.inline.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.inline.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.inline.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/content.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5/skin.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.inline.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.inline.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.inline.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/content.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.css +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.js +1 -1
- data/vendor/assets/javascripts/tinymce/skins/ui/tinymce-5-dark/skin.min.css +1 -1
- data/vendor/assets/javascripts/tinymce/themes/silver/theme.js +1 -1
- data/vendor/assets/javascripts/tinymce/tinymce.d.ts +405 -399
- data/vendor/assets/javascripts/tinymce/tinymce.js +2 -2
- metadata +1 -1
@@ -162,36 +162,6 @@ declare class AstNode {
|
|
162
162
|
isEmpty(elements: SchemaMap, whitespace?: SchemaMap, predicate?: (node: AstNode) => boolean): boolean;
|
163
163
|
walk(prev?: boolean): AstNode | null | undefined;
|
164
164
|
}
|
165
|
-
type Content = string | AstNode;
|
166
|
-
type ContentFormat = 'raw' | 'text' | 'html' | 'tree';
|
167
|
-
interface GetContentArgs {
|
168
|
-
format: ContentFormat;
|
169
|
-
get: boolean;
|
170
|
-
getInner: boolean;
|
171
|
-
no_events?: boolean;
|
172
|
-
save?: boolean;
|
173
|
-
source_view?: boolean;
|
174
|
-
[key: string]: any;
|
175
|
-
}
|
176
|
-
interface SetContentArgs {
|
177
|
-
format: string;
|
178
|
-
set: boolean;
|
179
|
-
content: Content;
|
180
|
-
no_events?: boolean;
|
181
|
-
no_selection?: boolean;
|
182
|
-
paste?: boolean;
|
183
|
-
load?: boolean;
|
184
|
-
initial?: boolean;
|
185
|
-
[key: string]: any;
|
186
|
-
}
|
187
|
-
interface GetSelectionContentArgs extends GetContentArgs {
|
188
|
-
selection?: boolean;
|
189
|
-
contextual?: boolean;
|
190
|
-
}
|
191
|
-
interface SetSelectionContentArgs extends SetContentArgs {
|
192
|
-
content: string;
|
193
|
-
selection?: boolean;
|
194
|
-
}
|
195
165
|
interface BlobInfoData {
|
196
166
|
id?: string;
|
197
167
|
name?: string;
|
@@ -223,51 +193,76 @@ interface BlobCache {
|
|
223
193
|
removeByUri: (blobUri: string) => void;
|
224
194
|
destroy: () => void;
|
225
195
|
}
|
226
|
-
interface
|
227
|
-
|
228
|
-
|
196
|
+
interface NotificationManagerImpl {
|
197
|
+
open: (spec: NotificationSpec, closeCallback: () => void, hasEditorFocus: () => boolean) => NotificationApi;
|
198
|
+
close: <T extends NotificationApi>(notification: T) => void;
|
199
|
+
getArgs: <T extends NotificationApi>(notification: T) => NotificationSpec;
|
229
200
|
}
|
230
|
-
interface
|
231
|
-
|
232
|
-
|
233
|
-
|
201
|
+
interface NotificationSpec {
|
202
|
+
type?: 'info' | 'warning' | 'error' | 'success';
|
203
|
+
text: string;
|
204
|
+
icon?: string;
|
205
|
+
progressBar?: boolean;
|
206
|
+
timeout?: number;
|
234
207
|
}
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
requireLangPack: (name: string, languages?: string) => void;
|
245
|
-
add: (id: string, addOn: AddOnConstructor<T>) => AddOnConstructor<T>;
|
246
|
-
remove: (name: string) => void;
|
247
|
-
createUrl: (baseUrl: UrlObject, dep: string | UrlObject) => UrlObject;
|
248
|
-
load: (name: string, addOnUrl: string | UrlObject) => Promise<void>;
|
249
|
-
waitFor: (name: string, state?: WaitState) => Promise<void>;
|
208
|
+
interface NotificationApi {
|
209
|
+
close: () => void;
|
210
|
+
progressBar: {
|
211
|
+
value: (percent: number) => void;
|
212
|
+
};
|
213
|
+
text: (text: string) => void;
|
214
|
+
reposition: () => void;
|
215
|
+
getEl: () => HTMLElement;
|
216
|
+
settings: NotificationSpec;
|
250
217
|
}
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
218
|
+
interface NotificationManager {
|
219
|
+
open: (spec: NotificationSpec) => NotificationApi;
|
220
|
+
close: () => void;
|
221
|
+
getNotifications: () => NotificationApi[];
|
255
222
|
}
|
256
|
-
interface
|
257
|
-
|
223
|
+
interface UploadFailure {
|
224
|
+
message: string;
|
225
|
+
remove?: boolean;
|
258
226
|
}
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
227
|
+
type ProgressFn = (percent: number) => void;
|
228
|
+
type UploadHandler = (blobInfo: BlobInfo, progress: ProgressFn) => Promise<string>;
|
229
|
+
interface UploadResult$2 {
|
230
|
+
url: string;
|
231
|
+
blobInfo: BlobInfo;
|
232
|
+
status: boolean;
|
233
|
+
error?: UploadFailure;
|
265
234
|
}
|
266
|
-
interface
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
235
|
+
interface IsEmptyOptions {
|
236
|
+
readonly skipBogus?: boolean;
|
237
|
+
readonly includeZwsp?: boolean;
|
238
|
+
readonly checkRootAsContent?: boolean;
|
239
|
+
readonly isContent?: (node: Node) => boolean;
|
240
|
+
}
|
241
|
+
interface GeomRect {
|
242
|
+
readonly x: number;
|
243
|
+
readonly y: number;
|
244
|
+
readonly w: number;
|
245
|
+
readonly h: number;
|
246
|
+
}
|
247
|
+
interface Rect {
|
248
|
+
inflate: (rect: GeomRect, w: number, h: number) => GeomRect;
|
249
|
+
relativePosition: (rect: GeomRect, targetRect: GeomRect, rel: string) => GeomRect;
|
250
|
+
findBestRelativePosition: (rect: GeomRect, targetRect: GeomRect, constrainRect: GeomRect, rels: string[]) => string | null;
|
251
|
+
intersect: (rect: GeomRect, cropRect: GeomRect) => GeomRect | null;
|
252
|
+
clamp: (rect: GeomRect, clampRect: GeomRect, fixedSize?: boolean) => GeomRect;
|
253
|
+
create: (x: number, y: number, w: number, h: number) => GeomRect;
|
254
|
+
fromClientRect: (clientRect: DOMRect) => GeomRect;
|
255
|
+
}
|
256
|
+
type StyleMap = Record<string, string | number>;
|
257
|
+
interface StylesSettings {
|
258
|
+
allow_script_urls?: boolean;
|
259
|
+
allow_svg_data_urls?: boolean;
|
260
|
+
url_converter?: URLConverter;
|
261
|
+
url_converter_scope?: any;
|
262
|
+
}
|
263
|
+
interface Styles {
|
264
|
+
parse: (css: string | undefined) => Record<string, string>;
|
265
|
+
serialize: (styles: StyleMap, elementName?: string) => string;
|
271
266
|
}
|
272
267
|
type NormalizedEvent<E, T = any> = E & {
|
273
268
|
readonly type: string;
|
@@ -347,127 +342,220 @@ declare class EventDispatcher<T extends {}> {
|
|
347
342
|
once<K extends string>(name: K, callback: (event: EditorEvent<MappedEvent<T, K>>) => void, prepend?: boolean): this;
|
348
343
|
has(name: string): boolean;
|
349
344
|
}
|
350
|
-
type
|
351
|
-
|
352
|
-
|
353
|
-
bookmark: Bookmark | null;
|
354
|
-
beforeBookmark: Bookmark | null;
|
355
|
-
}
|
356
|
-
interface FragmentedUndoLevel extends BaseUndoLevel {
|
357
|
-
type: 'fragmented';
|
358
|
-
fragments: string[];
|
359
|
-
content: '';
|
360
|
-
}
|
361
|
-
interface CompleteUndoLevel extends BaseUndoLevel {
|
362
|
-
type: 'complete';
|
363
|
-
fragments: null;
|
364
|
-
content: string;
|
365
|
-
}
|
366
|
-
type NewUndoLevel = CompleteUndoLevel | FragmentedUndoLevel;
|
367
|
-
type UndoLevel = NewUndoLevel & {
|
368
|
-
bookmark: Bookmark;
|
345
|
+
type EventUtilsCallback<T> = (event: EventUtilsEvent<T>) => void | boolean;
|
346
|
+
type EventUtilsEvent<T> = NormalizedEvent<T> & {
|
347
|
+
metaKey: boolean;
|
369
348
|
};
|
370
|
-
interface
|
371
|
-
|
372
|
-
|
373
|
-
add: (level?: Partial<UndoLevel>, event?: EditorEvent<any>) => UndoLevel | null;
|
374
|
-
dispatchChange: () => void;
|
375
|
-
beforeChange: () => void;
|
376
|
-
undo: () => UndoLevel | undefined;
|
377
|
-
redo: () => UndoLevel | undefined;
|
378
|
-
clear: () => void;
|
379
|
-
reset: () => void;
|
380
|
-
hasUndo: () => boolean;
|
381
|
-
hasRedo: () => boolean;
|
382
|
-
transact: (callback: () => void) => UndoLevel | null;
|
383
|
-
ignore: (callback: () => void) => void;
|
384
|
-
extra: (callback1: () => void, callback2: () => void) => void;
|
349
|
+
interface Callback$1<T> {
|
350
|
+
func: EventUtilsCallback<T>;
|
351
|
+
scope: any;
|
385
352
|
}
|
386
|
-
interface
|
387
|
-
|
388
|
-
|
353
|
+
interface CallbackList<T> extends Array<Callback$1<T>> {
|
354
|
+
fakeName: string | false;
|
355
|
+
capture: boolean;
|
356
|
+
nativeHandler: EventListener;
|
389
357
|
}
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
};
|
395
|
-
type AnnotationListener = (state: boolean, name: string, data?: {
|
396
|
-
uid: string;
|
397
|
-
nodes: any[];
|
398
|
-
}) => void;
|
399
|
-
type AnnotationListenerApi = AnnotationListener;
|
400
|
-
interface AnnotatorSettings {
|
401
|
-
decorate: Decorator;
|
402
|
-
persistent?: boolean;
|
358
|
+
interface EventUtilsConstructor {
|
359
|
+
readonly prototype: EventUtils;
|
360
|
+
new (): EventUtils;
|
361
|
+
Event: EventUtils;
|
403
362
|
}
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
363
|
+
declare class EventUtils {
|
364
|
+
static Event: EventUtils;
|
365
|
+
domLoaded: boolean;
|
366
|
+
events: Record<number, Record<string, CallbackList<any>>>;
|
367
|
+
private readonly expando;
|
368
|
+
private hasFocusIn;
|
369
|
+
private count;
|
370
|
+
constructor();
|
371
|
+
bind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback: EventUtilsCallback<HTMLElementEventMap[K]>, scope?: any): EventUtilsCallback<HTMLElementEventMap[K]>;
|
372
|
+
bind<T = any>(target: any, names: string, callback: EventUtilsCallback<T>, scope?: any): EventUtilsCallback<T>;
|
373
|
+
unbind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback?: EventUtilsCallback<HTMLElementEventMap[K]>): this;
|
374
|
+
unbind<T = any>(target: any, names: string, callback?: EventUtilsCallback<T>): this;
|
375
|
+
unbind(target: any): this;
|
376
|
+
fire(target: any, name: string, args?: {}): this;
|
377
|
+
dispatch(target: any, name: string, args?: {}): this;
|
378
|
+
clean(target: any): this;
|
379
|
+
destroy(): void;
|
380
|
+
cancel<T>(e: EventUtilsEvent<T>): boolean;
|
381
|
+
private executeHandlers;
|
411
382
|
}
|
412
|
-
interface
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
383
|
+
interface StyleSheetLoaderSettings {
|
384
|
+
maxLoadTime?: number;
|
385
|
+
contentCssCors?: boolean;
|
386
|
+
crossOrigin?: (url: string) => string | undefined;
|
387
|
+
referrerPolicy?: ReferrerPolicy;
|
417
388
|
}
|
418
|
-
interface
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
389
|
+
interface StyleSheetLoader {
|
390
|
+
load: (url: string) => Promise<void>;
|
391
|
+
loadRawCss: (key: string, css: string) => void;
|
392
|
+
loadAll: (urls: string[]) => Promise<string[]>;
|
393
|
+
unload: (url: string) => void;
|
394
|
+
unloadRawCss: (key: string) => void;
|
395
|
+
unloadAll: (urls: string[]) => void;
|
396
|
+
_setReferrerPolicy: (referrerPolicy: ReferrerPolicy) => void;
|
397
|
+
_setContentCssCors: (contentCssCors: boolean) => void;
|
398
|
+
_setCrossOrigin: (crossOrigin: (url: string) => string | undefined) => void;
|
423
399
|
}
|
424
|
-
interface
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
intersect: (rect: GeomRect, cropRect: GeomRect) => GeomRect | null;
|
429
|
-
clamp: (rect: GeomRect, clampRect: GeomRect, fixedSize?: boolean) => GeomRect;
|
430
|
-
create: (x: number, y: number, w: number, h: number) => GeomRect;
|
431
|
-
fromClientRect: (clientRect: DOMRect) => GeomRect;
|
432
|
-
}
|
433
|
-
interface NotificationManagerImpl {
|
434
|
-
open: (spec: NotificationSpec, closeCallback: () => void, hasEditorFocus: () => boolean) => NotificationApi;
|
435
|
-
close: <T extends NotificationApi>(notification: T) => void;
|
436
|
-
getArgs: <T extends NotificationApi>(notification: T) => NotificationSpec;
|
400
|
+
interface SetAttribEvent {
|
401
|
+
attrElm: HTMLElement;
|
402
|
+
attrName: string;
|
403
|
+
attrValue: string | boolean | number | null;
|
437
404
|
}
|
438
|
-
interface
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
405
|
+
interface DOMUtilsSettings {
|
406
|
+
schema: Schema;
|
407
|
+
url_converter: URLConverter;
|
408
|
+
url_converter_scope: any;
|
409
|
+
ownEvents: boolean;
|
410
|
+
keep_values: boolean;
|
411
|
+
update_styles: boolean;
|
412
|
+
root_element: HTMLElement | null;
|
413
|
+
collect: boolean;
|
414
|
+
onSetAttrib: (event: SetAttribEvent) => void;
|
415
|
+
contentCssCors: boolean;
|
416
|
+
referrerPolicy: ReferrerPolicy;
|
417
|
+
crossOrigin: (url: string, resourceType: 'script' | 'stylesheet') => string | undefined;
|
444
418
|
}
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
419
|
+
type Target = Node | Window;
|
420
|
+
type RunArguments<T extends Node = Node> = string | T | Array<string | T> | null;
|
421
|
+
type BoundEvent = [
|
422
|
+
Target,
|
423
|
+
string,
|
424
|
+
EventUtilsCallback<any>,
|
425
|
+
any
|
426
|
+
];
|
427
|
+
type Callback<K extends string> = EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>;
|
428
|
+
type RunResult<T, R> = T extends Array<any> ? R[] : false | R;
|
429
|
+
interface DOMUtils {
|
430
|
+
doc: Document;
|
431
|
+
settings: Partial<DOMUtilsSettings>;
|
432
|
+
win: Window;
|
433
|
+
files: Record<string, boolean>;
|
434
|
+
stdMode: boolean;
|
435
|
+
boxModel: boolean;
|
436
|
+
styleSheetLoader: StyleSheetLoader;
|
437
|
+
boundEvents: BoundEvent[];
|
438
|
+
styles: Styles;
|
439
|
+
schema: Schema;
|
440
|
+
events: EventUtils;
|
441
|
+
root: Node | null;
|
442
|
+
isBlock: {
|
443
|
+
(node: Node | null): node is HTMLElement;
|
444
|
+
(node: string): boolean;
|
449
445
|
};
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
446
|
+
clone: (node: Node, deep: boolean) => Node;
|
447
|
+
getRoot: () => HTMLElement;
|
448
|
+
getViewPort: (argWin?: Window) => GeomRect;
|
449
|
+
getRect: (elm: string | HTMLElement) => GeomRect;
|
450
|
+
getSize: (elm: string | HTMLElement) => {
|
451
|
+
w: number;
|
452
|
+
h: number;
|
453
|
+
};
|
454
|
+
getParent: {
|
455
|
+
<K extends keyof HTMLElementTagNameMap>(node: string | Node | null, selector: K, root?: Node): HTMLElementTagNameMap[K] | null;
|
456
|
+
<T extends Element>(node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node): T | null;
|
457
|
+
(node: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node): Node | null;
|
458
|
+
};
|
459
|
+
getParents: {
|
460
|
+
<K extends keyof HTMLElementTagNameMap>(elm: string | HTMLElementTagNameMap[K] | null, selector: K, root?: Node, collect?: boolean): Array<HTMLElementTagNameMap[K]>;
|
461
|
+
<T extends Element>(node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node, collect?: boolean): T[];
|
462
|
+
(elm: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node, collect?: boolean): Node[];
|
463
|
+
};
|
464
|
+
get: {
|
465
|
+
<T extends Node>(elm: T): T;
|
466
|
+
(elm: string): HTMLElement | null;
|
467
|
+
};
|
468
|
+
getNext: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null;
|
469
|
+
getPrev: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null;
|
470
|
+
select: {
|
471
|
+
<K extends keyof HTMLElementTagNameMap>(selector: K, scope?: string | Node): Array<HTMLElementTagNameMap[K]>;
|
472
|
+
<T extends HTMLElement = HTMLElement>(selector: string, scope?: string | Node): T[];
|
473
|
+
};
|
474
|
+
is: {
|
475
|
+
<T extends Element>(elm: Node | Node[] | null, selector: string): elm is T;
|
476
|
+
(elm: Node | Node[] | null, selector: string): boolean;
|
477
|
+
};
|
478
|
+
add: (parentElm: RunArguments, name: string | Element, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null, create?: boolean) => HTMLElement;
|
479
|
+
create: {
|
480
|
+
<K extends keyof HTMLElementTagNameMap>(name: K, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null): HTMLElementTagNameMap[K];
|
481
|
+
(name: string, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null): HTMLElement;
|
482
|
+
};
|
483
|
+
createHTML: (name: string, attrs?: Record<string, string | null>, html?: string) => string;
|
484
|
+
createFragment: (html?: string) => DocumentFragment;
|
485
|
+
remove: {
|
486
|
+
<T extends Node>(node: T | T[], keepChildren?: boolean): typeof node extends Array<any> ? T[] : T;
|
487
|
+
<T extends Node>(node: string, keepChildren?: boolean): T | false;
|
488
|
+
};
|
489
|
+
getStyle: {
|
490
|
+
(elm: Element, name: string, computed: true): string;
|
491
|
+
(elm: string | Element | null, name: string, computed?: boolean): string | undefined;
|
492
|
+
};
|
493
|
+
setStyle: (elm: string | Element | Element[], name: string, value: string | number | null) => void;
|
494
|
+
setStyles: (elm: string | Element | Element[], stylesArg: StyleMap) => void;
|
495
|
+
removeAllAttribs: (e: RunArguments<Element>) => void;
|
496
|
+
setAttrib: (elm: RunArguments<Element>, name: string, value: string | boolean | number | null) => void;
|
497
|
+
setAttribs: (elm: RunArguments<Element>, attrs: Record<string, string | boolean | number | null>) => void;
|
498
|
+
getAttrib: (elm: string | Element | null, name: string, defaultVal?: string) => string;
|
499
|
+
getAttribs: (elm: string | Element) => NamedNodeMap | Attr[];
|
500
|
+
getPos: (elm: string | Element, rootElm?: Node) => {
|
501
|
+
x: number;
|
502
|
+
y: number;
|
503
|
+
};
|
504
|
+
parseStyle: (cssText: string) => Record<string, string>;
|
505
|
+
serializeStyle: (stylesArg: StyleMap, name?: string) => string;
|
506
|
+
addStyle: (cssText: string) => void;
|
507
|
+
loadCSS: (url: string) => void;
|
508
|
+
hasClass: (elm: string | Element, cls: string) => boolean;
|
509
|
+
addClass: (elm: RunArguments<Element>, cls: string) => void;
|
510
|
+
removeClass: (elm: RunArguments<Element>, cls: string) => void;
|
511
|
+
toggleClass: (elm: RunArguments<Element>, cls: string, state?: boolean) => void;
|
512
|
+
show: (elm: string | Node | Node[]) => void;
|
513
|
+
hide: (elm: string | Node | Node[]) => void;
|
514
|
+
isHidden: (elm: string | Node) => boolean;
|
515
|
+
uniqueId: (prefix?: string) => string;
|
516
|
+
setHTML: (elm: RunArguments<Element>, html: string) => void;
|
517
|
+
getOuterHTML: (elm: string | Node) => string;
|
518
|
+
setOuterHTML: (elm: string | Node | Node[], html: string) => void;
|
519
|
+
decode: (text: string) => string;
|
520
|
+
encode: (text: string) => string;
|
521
|
+
insertAfter: {
|
522
|
+
<T extends Node>(node: T | T[], reference: string | Node): T;
|
523
|
+
<T extends Node>(node: RunArguments<T>, reference: string | Node): RunResult<typeof node, T>;
|
524
|
+
};
|
525
|
+
replace: {
|
526
|
+
<T extends Node>(newElm: Node, oldElm: T | T[], keepChildren?: boolean): T;
|
527
|
+
<T extends Node>(newElm: Node, oldElm: RunArguments<T>, keepChildren?: boolean): false | T;
|
528
|
+
};
|
529
|
+
rename: {
|
530
|
+
<K extends keyof HTMLElementTagNameMap>(elm: Element, name: K): HTMLElementTagNameMap[K];
|
531
|
+
(elm: Element, name: string): Element;
|
532
|
+
};
|
533
|
+
findCommonAncestor: (a: Node, b: Node) => Node | null;
|
534
|
+
run<R, T extends Node>(this: DOMUtils, elm: T | T[], func: (node: T) => R, scope?: any): typeof elm extends Array<any> ? R[] : R;
|
535
|
+
run<R, T extends Node>(this: DOMUtils, elm: RunArguments<T>, func: (node: T) => R, scope?: any): RunResult<typeof elm, R>;
|
536
|
+
isEmpty: (node: Node, elements?: Record<string, any>, options?: IsEmptyOptions) => boolean;
|
537
|
+
createRng: () => Range;
|
538
|
+
nodeIndex: (node: Node, normalized?: boolean) => number;
|
539
|
+
split: {
|
540
|
+
<T extends Node>(parentElm: Node, splitElm: Node, replacementElm: T): T | undefined;
|
541
|
+
<T extends Node>(parentElm: Node, splitElm: T): T | undefined;
|
542
|
+
};
|
543
|
+
bind: {
|
544
|
+
<K extends string>(target: Target, name: K, func: Callback<K>, scope?: any): Callback<K>;
|
545
|
+
<K extends string>(target: Target[], name: K, func: Callback<K>, scope?: any): Callback<K>[];
|
546
|
+
};
|
547
|
+
unbind: {
|
548
|
+
<K extends string>(target: Target, name?: K, func?: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils;
|
549
|
+
<K extends string>(target: Target[], name?: K, func?: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils[];
|
550
|
+
};
|
551
|
+
fire: (target: Node | Window, name: string, evt?: {}) => EventUtils;
|
552
|
+
dispatch: (target: Node | Window, name: string, evt?: {}) => EventUtils;
|
553
|
+
getContentEditable: (node: Node) => string | null;
|
554
|
+
getContentEditableParent: (node: Node) => string | null;
|
555
|
+
isEditable: (node: Node | null | undefined) => boolean;
|
556
|
+
destroy: () => void;
|
557
|
+
isChildOf: (node: Node, parent: Node) => boolean;
|
558
|
+
dumpRng: (r: Range) => string;
|
471
559
|
}
|
472
560
|
type BlockPatternTrigger = 'enter' | 'space';
|
473
561
|
interface RawPattern {
|
@@ -1481,6 +1569,42 @@ interface RemoveInlineFormat extends Inline, CommonRemoveFormat<RemoveInlineForm
|
|
1481
1569
|
}
|
1482
1570
|
interface RemoveSelectorFormat extends Selector, CommonRemoveFormat<RemoveSelectorFormat> {
|
1483
1571
|
}
|
1572
|
+
type UndoLevelType = 'fragmented' | 'complete';
|
1573
|
+
interface BaseUndoLevel {
|
1574
|
+
type: UndoLevelType;
|
1575
|
+
bookmark: Bookmark | null;
|
1576
|
+
beforeBookmark: Bookmark | null;
|
1577
|
+
}
|
1578
|
+
interface FragmentedUndoLevel extends BaseUndoLevel {
|
1579
|
+
type: 'fragmented';
|
1580
|
+
fragments: string[];
|
1581
|
+
content: '';
|
1582
|
+
}
|
1583
|
+
interface CompleteUndoLevel extends BaseUndoLevel {
|
1584
|
+
type: 'complete';
|
1585
|
+
fragments: null;
|
1586
|
+
content: string;
|
1587
|
+
}
|
1588
|
+
type NewUndoLevel = CompleteUndoLevel | FragmentedUndoLevel;
|
1589
|
+
type UndoLevel = NewUndoLevel & {
|
1590
|
+
bookmark: Bookmark;
|
1591
|
+
};
|
1592
|
+
interface UndoManager {
|
1593
|
+
data: UndoLevel[];
|
1594
|
+
typing: boolean;
|
1595
|
+
add: (level?: Partial<UndoLevel>, event?: EditorEvent<any>) => UndoLevel | null;
|
1596
|
+
dispatchChange: () => void;
|
1597
|
+
beforeChange: () => void;
|
1598
|
+
undo: () => UndoLevel | undefined;
|
1599
|
+
redo: () => UndoLevel | undefined;
|
1600
|
+
clear: () => void;
|
1601
|
+
reset: () => void;
|
1602
|
+
hasUndo: () => boolean;
|
1603
|
+
hasRedo: () => boolean;
|
1604
|
+
transact: (callback: () => void) => UndoLevel | null;
|
1605
|
+
ignore: (callback: () => void) => void;
|
1606
|
+
extra: (callback1: () => void, callback2: () => void) => void;
|
1607
|
+
}
|
1484
1608
|
interface Filter<C extends Function> {
|
1485
1609
|
name: string;
|
1486
1610
|
callbacks: C[];
|
@@ -1536,23 +1660,6 @@ interface DomParser {
|
|
1536
1660
|
removeNodeFilter: (name: string, callback?: ParserFilterCallback) => void;
|
1537
1661
|
parse: (html: string, args?: ParserArgs) => AstNode;
|
1538
1662
|
}
|
1539
|
-
interface StyleSheetLoaderSettings {
|
1540
|
-
maxLoadTime?: number;
|
1541
|
-
contentCssCors?: boolean;
|
1542
|
-
crossOrigin?: (url: string) => string | undefined;
|
1543
|
-
referrerPolicy?: ReferrerPolicy;
|
1544
|
-
}
|
1545
|
-
interface StyleSheetLoader {
|
1546
|
-
load: (url: string) => Promise<void>;
|
1547
|
-
loadRawCss: (key: string, css: string) => void;
|
1548
|
-
loadAll: (urls: string[]) => Promise<string[]>;
|
1549
|
-
unload: (url: string) => void;
|
1550
|
-
unloadRawCss: (key: string) => void;
|
1551
|
-
unloadAll: (urls: string[]) => void;
|
1552
|
-
_setReferrerPolicy: (referrerPolicy: ReferrerPolicy) => void;
|
1553
|
-
_setContentCssCors: (contentCssCors: boolean) => void;
|
1554
|
-
_setCrossOrigin: (crossOrigin: (url: string) => string | undefined) => void;
|
1555
|
-
}
|
1556
1663
|
type Registry = Registry$1;
|
1557
1664
|
interface EditorUiApi {
|
1558
1665
|
show: () => void;
|
@@ -2259,214 +2366,109 @@ interface EditorOptions extends NormalizedEditorOptions {
|
|
2259
2366
|
xss_sanitization: boolean;
|
2260
2367
|
disabled: boolean;
|
2261
2368
|
}
|
2262
|
-
type
|
2263
|
-
|
2264
|
-
|
2265
|
-
|
2266
|
-
|
2267
|
-
|
2268
|
-
|
2269
|
-
|
2270
|
-
|
2271
|
-
|
2272
|
-
|
2273
|
-
|
2274
|
-
type EventUtilsEvent<T> = NormalizedEvent<T> & {
|
2275
|
-
metaKey: boolean;
|
2276
|
-
};
|
2277
|
-
interface Callback$1<T> {
|
2278
|
-
func: EventUtilsCallback<T>;
|
2279
|
-
scope: any;
|
2369
|
+
type Content = string | AstNode;
|
2370
|
+
type ContentFormat = 'raw' | 'text' | 'html' | 'tree';
|
2371
|
+
interface GetContentArgs {
|
2372
|
+
format: ContentFormat;
|
2373
|
+
get: boolean;
|
2374
|
+
getInner: boolean;
|
2375
|
+
no_events?: boolean;
|
2376
|
+
save?: boolean;
|
2377
|
+
source_view?: boolean;
|
2378
|
+
indent?: boolean;
|
2379
|
+
entity_encoding?: EntityEncoding;
|
2380
|
+
[key: string]: any;
|
2280
2381
|
}
|
2281
|
-
interface
|
2282
|
-
|
2283
|
-
|
2284
|
-
|
2382
|
+
interface SetContentArgs {
|
2383
|
+
format: string;
|
2384
|
+
set: boolean;
|
2385
|
+
content: Content;
|
2386
|
+
no_events?: boolean;
|
2387
|
+
no_selection?: boolean;
|
2388
|
+
paste?: boolean;
|
2389
|
+
load?: boolean;
|
2390
|
+
initial?: boolean;
|
2391
|
+
[key: string]: any;
|
2285
2392
|
}
|
2286
|
-
interface
|
2287
|
-
|
2288
|
-
|
2289
|
-
Event: EventUtils;
|
2393
|
+
interface GetSelectionContentArgs extends GetContentArgs {
|
2394
|
+
selection?: boolean;
|
2395
|
+
contextual?: boolean;
|
2290
2396
|
}
|
2291
|
-
|
2292
|
-
|
2293
|
-
|
2294
|
-
events: Record<number, Record<string, CallbackList<any>>>;
|
2295
|
-
private readonly expando;
|
2296
|
-
private hasFocusIn;
|
2297
|
-
private count;
|
2298
|
-
constructor();
|
2299
|
-
bind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback: EventUtilsCallback<HTMLElementEventMap[K]>, scope?: any): EventUtilsCallback<HTMLElementEventMap[K]>;
|
2300
|
-
bind<T = any>(target: any, names: string, callback: EventUtilsCallback<T>, scope?: any): EventUtilsCallback<T>;
|
2301
|
-
unbind<K extends keyof HTMLElementEventMap>(target: any, name: K, callback?: EventUtilsCallback<HTMLElementEventMap[K]>): this;
|
2302
|
-
unbind<T = any>(target: any, names: string, callback?: EventUtilsCallback<T>): this;
|
2303
|
-
unbind(target: any): this;
|
2304
|
-
fire(target: any, name: string, args?: {}): this;
|
2305
|
-
dispatch(target: any, name: string, args?: {}): this;
|
2306
|
-
clean(target: any): this;
|
2307
|
-
destroy(): void;
|
2308
|
-
cancel<T>(e: EventUtilsEvent<T>): boolean;
|
2309
|
-
private executeHandlers;
|
2397
|
+
interface SetSelectionContentArgs extends SetContentArgs {
|
2398
|
+
content: string;
|
2399
|
+
selection?: boolean;
|
2310
2400
|
}
|
2311
|
-
interface
|
2312
|
-
|
2313
|
-
|
2314
|
-
attrValue: string | boolean | number | null;
|
2401
|
+
interface BlobInfoImagePair {
|
2402
|
+
image: HTMLImageElement;
|
2403
|
+
blobInfo: BlobInfo;
|
2315
2404
|
}
|
2316
|
-
interface
|
2317
|
-
|
2318
|
-
|
2319
|
-
|
2320
|
-
ownEvents: boolean;
|
2321
|
-
keep_values: boolean;
|
2322
|
-
update_styles: boolean;
|
2323
|
-
root_element: HTMLElement | null;
|
2324
|
-
collect: boolean;
|
2325
|
-
onSetAttrib: (event: SetAttribEvent) => void;
|
2326
|
-
contentCssCors: boolean;
|
2327
|
-
referrerPolicy: ReferrerPolicy;
|
2328
|
-
crossOrigin: (url: string, resourceType: 'script' | 'stylesheet') => string | undefined;
|
2405
|
+
interface UrlObject {
|
2406
|
+
prefix: string;
|
2407
|
+
resource: string;
|
2408
|
+
suffix: string;
|
2329
2409
|
}
|
2330
|
-
type
|
2331
|
-
type
|
2332
|
-
|
2333
|
-
|
2334
|
-
string,
|
2335
|
-
|
2336
|
-
|
2337
|
-
|
2338
|
-
|
2339
|
-
|
2340
|
-
|
2341
|
-
|
2342
|
-
|
2343
|
-
|
2344
|
-
|
2345
|
-
|
2346
|
-
|
2347
|
-
|
2348
|
-
|
2349
|
-
|
2350
|
-
|
2351
|
-
|
2352
|
-
|
2353
|
-
|
2354
|
-
|
2355
|
-
|
2356
|
-
|
2357
|
-
|
2358
|
-
|
2359
|
-
|
2360
|
-
|
2361
|
-
|
2362
|
-
|
2363
|
-
|
2364
|
-
|
2365
|
-
getParent: {
|
2366
|
-
<K extends keyof HTMLElementTagNameMap>(node: string | Node | null, selector: K, root?: Node): HTMLElementTagNameMap[K] | null;
|
2367
|
-
<T extends Element>(node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node): T | null;
|
2368
|
-
(node: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node): Node | null;
|
2369
|
-
};
|
2370
|
-
getParents: {
|
2371
|
-
<K extends keyof HTMLElementTagNameMap>(elm: string | HTMLElementTagNameMap[K] | null, selector: K, root?: Node, collect?: boolean): Array<HTMLElementTagNameMap[K]>;
|
2372
|
-
<T extends Element>(node: string | Node | null, selector: string | ((node: Node) => node is T), root?: Node, collect?: boolean): T[];
|
2373
|
-
(elm: string | Node | null, selector?: string | ((node: Node) => boolean | void), root?: Node, collect?: boolean): Node[];
|
2374
|
-
};
|
2375
|
-
get: {
|
2376
|
-
<T extends Node>(elm: T): T;
|
2377
|
-
(elm: string): HTMLElement | null;
|
2378
|
-
};
|
2379
|
-
getNext: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null;
|
2380
|
-
getPrev: (node: Node | null, selector: string | ((node: Node) => boolean)) => Node | null;
|
2381
|
-
select: {
|
2382
|
-
<K extends keyof HTMLElementTagNameMap>(selector: K, scope?: string | Node): Array<HTMLElementTagNameMap[K]>;
|
2383
|
-
<T extends HTMLElement = HTMLElement>(selector: string, scope?: string | Node): T[];
|
2384
|
-
};
|
2385
|
-
is: {
|
2386
|
-
<T extends Element>(elm: Node | Node[] | null, selector: string): elm is T;
|
2387
|
-
(elm: Node | Node[] | null, selector: string): boolean;
|
2388
|
-
};
|
2389
|
-
add: (parentElm: RunArguments, name: string | Element, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null, create?: boolean) => HTMLElement;
|
2390
|
-
create: {
|
2391
|
-
<K extends keyof HTMLElementTagNameMap>(name: K, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null): HTMLElementTagNameMap[K];
|
2392
|
-
(name: string, attrs?: Record<string, string | boolean | number | null>, html?: string | Node | null): HTMLElement;
|
2393
|
-
};
|
2394
|
-
createHTML: (name: string, attrs?: Record<string, string | null>, html?: string) => string;
|
2395
|
-
createFragment: (html?: string) => DocumentFragment;
|
2396
|
-
remove: {
|
2397
|
-
<T extends Node>(node: T | T[], keepChildren?: boolean): typeof node extends Array<any> ? T[] : T;
|
2398
|
-
<T extends Node>(node: string, keepChildren?: boolean): T | false;
|
2399
|
-
};
|
2400
|
-
getStyle: {
|
2401
|
-
(elm: Element, name: string, computed: true): string;
|
2402
|
-
(elm: string | Element | null, name: string, computed?: boolean): string | undefined;
|
2403
|
-
};
|
2404
|
-
setStyle: (elm: string | Element | Element[], name: string, value: string | number | null) => void;
|
2405
|
-
setStyles: (elm: string | Element | Element[], stylesArg: StyleMap) => void;
|
2406
|
-
removeAllAttribs: (e: RunArguments<Element>) => void;
|
2407
|
-
setAttrib: (elm: RunArguments<Element>, name: string, value: string | boolean | number | null) => void;
|
2408
|
-
setAttribs: (elm: RunArguments<Element>, attrs: Record<string, string | boolean | number | null>) => void;
|
2409
|
-
getAttrib: (elm: string | Element | null, name: string, defaultVal?: string) => string;
|
2410
|
-
getAttribs: (elm: string | Element) => NamedNodeMap | Attr[];
|
2411
|
-
getPos: (elm: string | Element, rootElm?: Node) => {
|
2412
|
-
x: number;
|
2413
|
-
y: number;
|
2414
|
-
};
|
2415
|
-
parseStyle: (cssText: string) => Record<string, string>;
|
2416
|
-
serializeStyle: (stylesArg: StyleMap, name?: string) => string;
|
2417
|
-
addStyle: (cssText: string) => void;
|
2418
|
-
loadCSS: (url: string) => void;
|
2419
|
-
hasClass: (elm: string | Element, cls: string) => boolean;
|
2420
|
-
addClass: (elm: RunArguments<Element>, cls: string) => void;
|
2421
|
-
removeClass: (elm: RunArguments<Element>, cls: string) => void;
|
2422
|
-
toggleClass: (elm: RunArguments<Element>, cls: string, state?: boolean) => void;
|
2423
|
-
show: (elm: string | Node | Node[]) => void;
|
2424
|
-
hide: (elm: string | Node | Node[]) => void;
|
2425
|
-
isHidden: (elm: string | Node) => boolean;
|
2426
|
-
uniqueId: (prefix?: string) => string;
|
2427
|
-
setHTML: (elm: RunArguments<Element>, html: string) => void;
|
2428
|
-
getOuterHTML: (elm: string | Node) => string;
|
2429
|
-
setOuterHTML: (elm: string | Node | Node[], html: string) => void;
|
2430
|
-
decode: (text: string) => string;
|
2431
|
-
encode: (text: string) => string;
|
2432
|
-
insertAfter: {
|
2433
|
-
<T extends Node>(node: T | T[], reference: string | Node): T;
|
2434
|
-
<T extends Node>(node: RunArguments<T>, reference: string | Node): RunResult<typeof node, T>;
|
2435
|
-
};
|
2436
|
-
replace: {
|
2437
|
-
<T extends Node>(newElm: Node, oldElm: T | T[], keepChildren?: boolean): T;
|
2438
|
-
<T extends Node>(newElm: Node, oldElm: RunArguments<T>, keepChildren?: boolean): false | T;
|
2439
|
-
};
|
2440
|
-
rename: {
|
2441
|
-
<K extends keyof HTMLElementTagNameMap>(elm: Element, name: K): HTMLElementTagNameMap[K];
|
2442
|
-
(elm: Element, name: string): Element;
|
2443
|
-
};
|
2444
|
-
findCommonAncestor: (a: Node, b: Node) => Node | null;
|
2445
|
-
run<R, T extends Node>(this: DOMUtils, elm: T | T[], func: (node: T) => R, scope?: any): typeof elm extends Array<any> ? R[] : R;
|
2446
|
-
run<R, T extends Node>(this: DOMUtils, elm: RunArguments<T>, func: (node: T) => R, scope?: any): RunResult<typeof elm, R>;
|
2447
|
-
isEmpty: (node: Node, elements?: Record<string, any>, options?: IsEmptyOptions) => boolean;
|
2448
|
-
createRng: () => Range;
|
2449
|
-
nodeIndex: (node: Node, normalized?: boolean) => number;
|
2450
|
-
split: {
|
2451
|
-
<T extends Node>(parentElm: Node, splitElm: Node, replacementElm: T): T | undefined;
|
2452
|
-
<T extends Node>(parentElm: Node, splitElm: T): T | undefined;
|
2453
|
-
};
|
2454
|
-
bind: {
|
2455
|
-
<K extends string>(target: Target, name: K, func: Callback<K>, scope?: any): Callback<K>;
|
2456
|
-
<K extends string>(target: Target[], name: K, func: Callback<K>, scope?: any): Callback<K>[];
|
2457
|
-
};
|
2458
|
-
unbind: {
|
2459
|
-
<K extends string>(target: Target, name?: K, func?: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils;
|
2460
|
-
<K extends string>(target: Target[], name?: K, func?: EventUtilsCallback<MappedEvent<HTMLElementEventMap, K>>): EventUtils[];
|
2461
|
-
};
|
2462
|
-
fire: (target: Node | Window, name: string, evt?: {}) => EventUtils;
|
2463
|
-
dispatch: (target: Node | Window, name: string, evt?: {}) => EventUtils;
|
2464
|
-
getContentEditable: (node: Node) => string | null;
|
2465
|
-
getContentEditableParent: (node: Node) => string | null;
|
2466
|
-
isEditable: (node: Node | null | undefined) => boolean;
|
2410
|
+
type WaitState = 'added' | 'loaded';
|
2411
|
+
type AddOnConstructor<T> = (editor: Editor, url: string) => T;
|
2412
|
+
interface AddOnManager<T> {
|
2413
|
+
items: AddOnConstructor<T>[];
|
2414
|
+
urls: Record<string, string>;
|
2415
|
+
lookup: Record<string, {
|
2416
|
+
instance: AddOnConstructor<T>;
|
2417
|
+
}>;
|
2418
|
+
get: (name: string) => AddOnConstructor<T> | undefined;
|
2419
|
+
requireLangPack: (name: string, languages?: string) => void;
|
2420
|
+
add: (id: string, addOn: AddOnConstructor<T>) => AddOnConstructor<T>;
|
2421
|
+
remove: (name: string) => void;
|
2422
|
+
createUrl: (baseUrl: UrlObject, dep: string | UrlObject) => UrlObject;
|
2423
|
+
load: (name: string, addOnUrl: string | UrlObject) => Promise<void>;
|
2424
|
+
waitFor: (name: string, state?: WaitState) => Promise<void>;
|
2425
|
+
}
|
2426
|
+
type LicenseKeyManagerAddon = AddOnConstructor<LicenseKeyManager>;
|
2427
|
+
interface ValidateData {
|
2428
|
+
plugin?: string;
|
2429
|
+
[key: string]: any;
|
2430
|
+
}
|
2431
|
+
interface LicenseKeyManager {
|
2432
|
+
readonly validate: (data: ValidateData) => Promise<boolean>;
|
2433
|
+
}
|
2434
|
+
declare class NodeChange {
|
2435
|
+
private readonly editor;
|
2436
|
+
private lastPath;
|
2437
|
+
constructor(editor: Editor);
|
2438
|
+
nodeChanged(args?: Record<string, any>): void;
|
2439
|
+
private isSameElementPath;
|
2440
|
+
}
|
2441
|
+
interface SelectionOverrides {
|
2442
|
+
showCaret: (direction: number, node: HTMLElement, before: boolean, scrollIntoView?: boolean) => Range | null;
|
2443
|
+
showBlockCaretContainer: (blockCaretContainer: HTMLElement) => void;
|
2444
|
+
hideFakeCaret: () => void;
|
2467
2445
|
destroy: () => void;
|
2468
|
-
|
2469
|
-
|
2446
|
+
}
|
2447
|
+
interface Quirks {
|
2448
|
+
refreshContentEditable(): void;
|
2449
|
+
isHidden(): boolean;
|
2450
|
+
}
|
2451
|
+
type DecoratorData = Record<string, any>;
|
2452
|
+
type Decorator = (uid: string, data: DecoratorData) => {
|
2453
|
+
attributes?: {};
|
2454
|
+
classes?: string[];
|
2455
|
+
};
|
2456
|
+
type AnnotationListener = (state: boolean, name: string, data?: {
|
2457
|
+
uid: string;
|
2458
|
+
nodes: any[];
|
2459
|
+
}) => void;
|
2460
|
+
type AnnotationListenerApi = AnnotationListener;
|
2461
|
+
interface AnnotatorSettings {
|
2462
|
+
decorate: Decorator;
|
2463
|
+
persistent?: boolean;
|
2464
|
+
}
|
2465
|
+
interface Annotator {
|
2466
|
+
register: (name: string, settings: AnnotatorSettings) => void;
|
2467
|
+
annotate: (name: string, data: DecoratorData) => void;
|
2468
|
+
annotationChanged: (name: string, f: AnnotationListenerApi) => void;
|
2469
|
+
remove: (name: string) => void;
|
2470
|
+
removeAll: (name: string) => void;
|
2471
|
+
getAll: (name: string) => Record<string, Element[]>;
|
2470
2472
|
}
|
2471
2473
|
interface ClientRect {
|
2472
2474
|
left: number;
|
@@ -2522,6 +2524,10 @@ interface DomSerializerSettings extends DomParserSettings, WriterSettings, Schem
|
|
2522
2524
|
url_converter?: URLConverter;
|
2523
2525
|
url_converter_scope?: {};
|
2524
2526
|
}
|
2527
|
+
interface DomSerializerArgs extends ParserArgs {
|
2528
|
+
indent?: HtmlSerializerSettings['indent'];
|
2529
|
+
entity_encoding?: HtmlSerializerSettings['entity_encoding'];
|
2530
|
+
}
|
2525
2531
|
interface DomSerializerImpl {
|
2526
2532
|
schema: Schema;
|
2527
2533
|
addNodeFilter: (name: string, callback: ParserFilterCallback) => void;
|
@@ -2534,7 +2540,7 @@ interface DomSerializerImpl {
|
|
2534
2540
|
(node: Element, parserArgs: {
|
2535
2541
|
format: 'tree';
|
2536
2542
|
} & ParserArgs): AstNode;
|
2537
|
-
(node: Element,
|
2543
|
+
(node: Element, domSerializerArgs?: DomSerializerArgs): string;
|
2538
2544
|
};
|
2539
2545
|
addRules: (rules: string) => void;
|
2540
2546
|
setRules: (rules: string) => void;
|