@ckeditor/ckeditor5-utils 48.2.0-alpha.7 → 48.3.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/abortabledebounce.d.ts +19 -13
- package/dist/areconnectedthroughproperties.d.ts +7 -7
- package/dist/ckeditorerror.d.ts +113 -113
- package/dist/collection.d.ts +419 -415
- package/dist/collectstylesheets.d.ts +9 -9
- package/dist/comparearrays.d.ts +25 -25
- package/dist/config.d.ts +159 -156
- package/dist/count.d.ts +14 -14
- package/dist/crc32.d.ts +19 -19
- package/dist/decodelicensekey.d.ts +7 -7
- package/dist/delay.d.ts +13 -13
- package/dist/diff.d.ts +32 -27
- package/dist/difftochanges.d.ts +47 -47
- package/dist/dom/createelement.d.ts +43 -43
- package/dist/dom/emittermixin.d.ts +144 -135
- package/dist/dom/findclosestscrollableancestor.d.ts +8 -8
- package/dist/dom/getancestors.d.ts +13 -13
- package/dist/dom/getborderwidths.d.ts +16 -16
- package/dist/dom/getcommonancestor.d.ts +9 -9
- package/dist/dom/getdatafromelement.d.ts +10 -10
- package/dist/dom/getpositionedancestor.d.ts +7 -7
- package/dist/dom/getrangefrommouseevent.d.ts +12 -12
- package/dist/dom/getvisualviewportoffset.d.ts +7 -7
- package/dist/dom/global.d.ts +24 -24
- package/dist/dom/indexof.d.ts +10 -10
- package/dist/dom/insertat.d.ts +11 -11
- package/dist/dom/iscomment.d.ts +7 -7
- package/dist/dom/isnode.d.ts +7 -7
- package/dist/dom/isrange.d.ts +7 -7
- package/dist/dom/istext.d.ts +7 -7
- package/dist/dom/isvalidattributename.d.ts +7 -7
- package/dist/dom/isvisible.d.ts +12 -12
- package/dist/dom/iswindow.d.ts +7 -7
- package/dist/dom/position.d.ts +200 -200
- package/dist/dom/rect.d.ts +194 -194
- package/dist/dom/remove.d.ts +9 -9
- package/dist/dom/resizeobserver.d.ts +70 -70
- package/dist/dom/scroll.d.ts +75 -72
- package/dist/dom/setdatainelement.d.ts +10 -10
- package/dist/dom/tounit.d.ts +16 -16
- package/dist/elementreplacer.d.ts +26 -26
- package/dist/emittermixin.d.ts +290 -280
- package/dist/env.d.ts +124 -124
- package/dist/eventinfo.d.ts +58 -55
- package/dist/fastdiff.d.ts +112 -109
- package/dist/first.d.ts +7 -7
- package/dist/focustracker.d.ts +133 -131
- package/dist/formathtml.d.ts +15 -15
- package/dist/index-content.css +1 -0
- package/dist/index-editor.css +1 -0
- package/dist/index.css +0 -2
- package/dist/index.d.ts +78 -77
- package/dist/index.js +5695 -6360
- package/dist/index.js.map +1 -1
- package/dist/inserttopriorityarray.d.ts +23 -23
- package/dist/isfeatureblockedbylicensekey.d.ts +10 -10
- package/dist/isiterable.d.ts +10 -10
- package/dist/keyboard.d.ts +107 -109
- package/dist/keystrokehandler.d.ts +90 -90
- package/dist/language.d.ts +12 -12
- package/dist/legacyerrors.d.ts +0 -4
- package/dist/locale.d.ts +122 -122
- package/dist/mapsequal.d.ts +11 -11
- package/dist/mix.d.ts +54 -53
- package/dist/nth.d.ts +12 -12
- package/dist/objecttomap.d.ts +18 -18
- package/dist/observablemixin.d.ts +621 -539
- package/dist/parsebase64encodedobject.d.ts +7 -7
- package/dist/parsedimensionwithunit.d.ts +40 -0
- package/dist/priorities.d.ts +24 -24
- package/dist/retry.d.ts +27 -27
- package/dist/splicearray.d.ts +22 -22
- package/dist/spy.d.ts +15 -15
- package/dist/toarray.d.ts +17 -17
- package/dist/tomap.d.ts +15 -15
- package/dist/translation-service.d.ts +157 -157
- package/dist/uid.d.ts +12 -12
- package/dist/unicode.d.ts +42 -42
- package/dist/version.d.ts +5 -5
- package/dist/wait.d.ts +11 -11
- package/package.json +2 -2
- package/dist/index.css.map +0 -1
|
@@ -1,17 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
* @module utils/abortabledebounce
|
|
7
|
+
*/
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export declare function abortableDebounce<
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
* Returns a function wrapper that will execute the provided function and abort any previous call that is still in progress.
|
|
10
|
+
*
|
|
11
|
+
* @param func The function to be called. It will be provided with `AbortSignal` as the first parameter.
|
|
12
|
+
*/
|
|
13
|
+
export declare function abortableDebounce<
|
|
14
|
+
Args extends Array<any>,
|
|
15
|
+
Ret
|
|
16
|
+
>(func: (signal: AbortSignal, ...args: Args) => Ret): AbortableFunc<Args, Ret>;
|
|
17
|
+
export interface AbortableFunc<
|
|
18
|
+
Args extends Array<any>,
|
|
19
|
+
Ret
|
|
20
|
+
> {
|
|
21
|
+
(...args: Args): Ret;
|
|
22
|
+
abort(): void;
|
|
17
23
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
* @module utils/areconnectedthroughproperties
|
|
7
|
+
*/
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
* Traverses both structures to find out whether there is a reference that is shared between both structures.
|
|
10
|
+
*/
|
|
11
11
|
export declare function areConnectedThroughProperties(obj1: object, obj2: object): boolean;
|
package/dist/ckeditorerror.d.ts
CHANGED
|
@@ -1,124 +1,124 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
* @module utils/ckeditorerror
|
|
7
|
+
*/
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
* URL to the documentation with error codes.
|
|
10
|
+
*/
|
|
11
11
|
export declare const DOCUMENTATION_URL = "https://ckeditor.com/docs/ckeditor5/latest/support/error-codes.html";
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
13
|
+
* The CKEditor error class.
|
|
14
|
+
*
|
|
15
|
+
* You should throw `CKEditorError` when:
|
|
16
|
+
*
|
|
17
|
+
* * An unexpected situation occurred and the editor (most probably) will not work properly. Such exception will be handled
|
|
18
|
+
* by the {@link module:watchdog/watchdog~Watchdog watchdog} (if it is integrated),
|
|
19
|
+
* * If the editor is incorrectly integrated or the editor API is used in the wrong way. This way you will give
|
|
20
|
+
* feedback to the developer as soon as possible. Keep in mind that for common integration issues which should not
|
|
21
|
+
* stop editor initialization (like missing upload adapter, wrong name of a toolbar component) we use
|
|
22
|
+
* {@link module:utils/ckeditorerror~logWarning `logWarning()`} and
|
|
23
|
+
* {@link module:utils/ckeditorerror~logError `logError()`}
|
|
24
|
+
* to improve developers experience and let them see the a working editor as soon as possible.
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* /**
|
|
28
|
+
* * Error thrown when a plugin cannot be loaded due to JavaScript errors, lack of plugins with a given name, etc.
|
|
29
|
+
* *
|
|
30
|
+
* * @error plugin-load
|
|
31
|
+
* * @param pluginName The name of the plugin that could not be loaded.
|
|
32
|
+
* * @param moduleName The name of the module which tried to load this plugin.
|
|
33
|
+
* *\/
|
|
34
|
+
* throw new CKEditorError( 'plugin-load', {
|
|
35
|
+
* pluginName: 'foo',
|
|
36
|
+
* moduleName: 'bar'
|
|
37
|
+
* } );
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
40
|
export declare class CKEditorError extends Error {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
41
|
+
/**
|
|
42
|
+
* A context of the error by which the Watchdog is able to determine which editor crashed.
|
|
43
|
+
*/
|
|
44
|
+
readonly context: object | null | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* The additional error data passed to the constructor. Undefined if none was passed.
|
|
47
|
+
*/
|
|
48
|
+
readonly data?: object;
|
|
49
|
+
/**
|
|
50
|
+
* Creates an instance of the CKEditorError class.
|
|
51
|
+
*
|
|
52
|
+
* @param errorName The error id in an `error-name` format. A link to this error documentation page will be added
|
|
53
|
+
* to the thrown error's `message`.
|
|
54
|
+
* @param context A context of the error by which the {@link module:watchdog/watchdog~Watchdog watchdog}
|
|
55
|
+
* is able to determine which editor crashed. It should be an editor instance or a property connected to it. It can be also
|
|
56
|
+
* a `null` value if the editor should not be restarted in case of the error (e.g. during the editor initialization).
|
|
57
|
+
* The error context should be checked using the `areConnectedThroughProperties( editor, context )` utility
|
|
58
|
+
* to check if the object works as the context.
|
|
59
|
+
* @param data Additional data describing the error. A stringified version of this object
|
|
60
|
+
* will be appended to the error message, so the data are quickly visible in the console. The original
|
|
61
|
+
* data object will also be later available under the {@link #data} property.
|
|
62
|
+
* @param originalError An optional original error that is being wrapped in the `CKEditorError` instance.
|
|
63
|
+
*/
|
|
64
|
+
constructor(errorName: string, context?: object | null, data?: object, originalError?: Error);
|
|
65
|
+
/**
|
|
66
|
+
* Checks if the error is of the `CKEditorError` type.
|
|
67
|
+
*/
|
|
68
|
+
is(type: string): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* A utility that ensures that the thrown error is a {@link module:utils/ckeditorerror~CKEditorError} one.
|
|
71
|
+
* It is useful when combined with the {@link module:watchdog/watchdog~Watchdog} feature, which can restart the editor in case
|
|
72
|
+
* of a {@link module:utils/ckeditorerror~CKEditorError} error.
|
|
73
|
+
*
|
|
74
|
+
* @param error The error to rethrow.
|
|
75
|
+
* @param context An object connected through properties with the editor instance. This context will be used
|
|
76
|
+
* by the watchdog to verify which editor should be restarted.
|
|
77
|
+
*/
|
|
78
|
+
static rethrowUnexpectedError(error: Error, context: object): never;
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
81
|
+
* Logs a warning to the console with a properly formatted message and adds a link to the documentation.
|
|
82
|
+
* Use whenever you want to log a warning to the console.
|
|
83
|
+
*
|
|
84
|
+
* ```ts
|
|
85
|
+
* /**
|
|
86
|
+
* * There was a problem processing the configuration of the toolbar. The item with the given
|
|
87
|
+
* * name does not exist, so it was omitted when rendering the toolbar.
|
|
88
|
+
* *
|
|
89
|
+
* * @error toolbarview-item-unavailable
|
|
90
|
+
* * @param {String} name The name of the component.
|
|
91
|
+
* *\/
|
|
92
|
+
* logWarning( 'toolbarview-item-unavailable', { name } );
|
|
93
|
+
* ```
|
|
94
|
+
*
|
|
95
|
+
* See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to throw an error and when to log
|
|
96
|
+
* a warning or an error to the console.
|
|
97
|
+
*
|
|
98
|
+
* @param errorName The error name to be logged.
|
|
99
|
+
* @param data Additional data to be logged.
|
|
100
|
+
*/
|
|
101
101
|
export declare function logWarning(errorName: string, data?: object): void;
|
|
102
102
|
/**
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
103
|
+
* Logs an error to the console with a properly formatted message and adds a link to the documentation.
|
|
104
|
+
* Use whenever you want to log an error to the console.
|
|
105
|
+
*
|
|
106
|
+
* ```ts
|
|
107
|
+
* /**
|
|
108
|
+
* * There was a problem processing the configuration of the toolbar. The item with the given
|
|
109
|
+
* * name does not exist, so it was omitted when rendering the toolbar.
|
|
110
|
+
* *
|
|
111
|
+
* * @error toolbarview-item-unavailable
|
|
112
|
+
* * @param {String} name The name of the component.
|
|
113
|
+
* *\/
|
|
114
|
+
* logError( 'toolbarview-item-unavailable', { name } );
|
|
115
|
+
* ```
|
|
116
|
+
*
|
|
117
|
+
* **Note**: In most cases logging a warning using {@link module:utils/ckeditorerror~logWarning} is enough.
|
|
118
|
+
*
|
|
119
|
+
* See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to use each method.
|
|
120
|
+
*
|
|
121
|
+
* @param errorName The error name to be logged.
|
|
122
|
+
* @param data Additional data to be logged.
|
|
123
|
+
*/
|
|
124
124
|
export declare function logError(errorName: string, data?: object): void;
|