@ckeditor/ckeditor5-utils 48.8.1-alpha.3 → 49.0.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.
Files changed (101) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/abortabledebounce.d.ts +19 -13
  3. package/dist/areconnectedthroughproperties.d.ts +7 -7
  4. package/dist/ckeditorerror.d.ts +114 -113
  5. package/dist/collection.d.ts +419 -415
  6. package/dist/collectstylesheets.d.ts +9 -9
  7. package/dist/comparearrays.d.ts +25 -25
  8. package/dist/config.d.ts +159 -156
  9. package/dist/count.d.ts +14 -14
  10. package/dist/crc32.d.ts +19 -19
  11. package/dist/decodelicensekey.d.ts +7 -7
  12. package/dist/delay.d.ts +13 -13
  13. package/dist/diff.d.ts +32 -27
  14. package/dist/difftochanges.d.ts +47 -47
  15. package/dist/dom/adoptglobalstylesheet.d.ts +19 -0
  16. package/dist/dom/containsnode.d.ts +18 -0
  17. package/dist/dom/createelement.d.ts +43 -43
  18. package/dist/dom/emittermixin.d.ts +141 -135
  19. package/dist/dom/findclosestscrollableancestor.d.ts +13 -8
  20. package/dist/dom/getactiveelement.d.ts +17 -0
  21. package/dist/dom/getancestors.d.ts +13 -13
  22. package/dist/dom/getborderwidths.d.ts +16 -16
  23. package/dist/dom/getdatafromelement.d.ts +10 -10
  24. package/dist/dom/getelementfrompoint.d.ts +23 -0
  25. package/dist/dom/getlayoutparentelement.d.ts +18 -0
  26. package/dist/dom/getlayoutparentnode.d.ts +24 -0
  27. package/dist/dom/getoverlaymountroot.d.ts +24 -0
  28. package/dist/dom/getparentelement.d.ts +13 -0
  29. package/dist/dom/getparentnode.d.ts +15 -0
  30. package/dist/dom/getpositionedancestor.d.ts +18 -7
  31. package/dist/dom/getrangefrommouseevent.d.ts +15 -13
  32. package/dist/dom/getselection.d.ts +106 -0
  33. package/dist/dom/getshadowroots.d.ts +19 -0
  34. package/dist/dom/getvisualviewportoffset.d.ts +7 -7
  35. package/dist/dom/global.d.ts +24 -24
  36. package/dist/dom/indexof.d.ts +10 -10
  37. package/dist/dom/insertat.d.ts +11 -11
  38. package/dist/dom/iscomment.d.ts +7 -7
  39. package/dist/dom/isdomselectionbackward.d.ts +18 -0
  40. package/dist/dom/isnode.d.ts +7 -7
  41. package/dist/dom/isoffline.d.ts +8 -0
  42. package/dist/dom/isrange.d.ts +7 -7
  43. package/dist/dom/isshadowhostof.d.ts +18 -0
  44. package/dist/dom/isshadowroot.d.ts +41 -0
  45. package/dist/dom/istext.d.ts +7 -7
  46. package/dist/dom/isvalidattributename.d.ts +7 -7
  47. package/dist/dom/isvisible.d.ts +16 -12
  48. package/dist/dom/iswindow.d.ts +7 -7
  49. package/dist/dom/position.d.ts +200 -200
  50. package/dist/dom/rect.d.ts +198 -194
  51. package/dist/dom/remove.d.ts +7 -10
  52. package/dist/dom/resizeobserver.d.ts +70 -70
  53. package/dist/dom/scroll.d.ts +83 -72
  54. package/dist/dom/setdatainelement.d.ts +8 -11
  55. package/dist/dom/shadowrootregistry.d.ts +125 -0
  56. package/dist/dom/tounit.d.ts +16 -16
  57. package/dist/dom/trustedtypes.d.ts +65 -0
  58. package/dist/dom/whenelementconnected.d.ts +26 -0
  59. package/dist/elementreplacer.d.ts +24 -27
  60. package/dist/emittermixin.d.ts +287 -280
  61. package/dist/env.d.ts +124 -124
  62. package/dist/eventinfo.d.ts +58 -55
  63. package/dist/fastdiff.d.ts +112 -109
  64. package/dist/first.d.ts +7 -7
  65. package/dist/focustracker.d.ts +133 -131
  66. package/dist/formathtml.d.ts +15 -15
  67. package/dist/index-content.css +3 -0
  68. package/dist/index-content.css.map +1 -0
  69. package/dist/index-editor.css +3 -0
  70. package/dist/index-editor.css.map +1 -0
  71. package/dist/index.d.ts +95 -77
  72. package/dist/index.js +6788 -6360
  73. package/dist/index.js.map +1 -1
  74. package/dist/inserttopriorityarray.d.ts +23 -23
  75. package/dist/isfeatureblockedbylicensekey.d.ts +10 -10
  76. package/dist/isiterable.d.ts +10 -10
  77. package/dist/keyboard.d.ts +107 -109
  78. package/dist/keystrokehandler.d.ts +90 -90
  79. package/dist/language.d.ts +12 -12
  80. package/dist/legacyerrors.d.ts +0 -4
  81. package/dist/locale.d.ts +122 -122
  82. package/dist/mapsequal.d.ts +11 -11
  83. package/dist/mix.d.ts +54 -53
  84. package/dist/nth.d.ts +12 -12
  85. package/dist/objecttomap.d.ts +18 -18
  86. package/dist/observablemixin.d.ts +618 -539
  87. package/dist/parsebase64encodedobject.d.ts +7 -7
  88. package/dist/parsedimensionwithunit.d.ts +40 -0
  89. package/dist/priorities.d.ts +24 -24
  90. package/dist/retry.d.ts +27 -27
  91. package/dist/splicearray.d.ts +22 -22
  92. package/dist/spy.d.ts +15 -15
  93. package/dist/toarray.d.ts +17 -17
  94. package/dist/tomap.d.ts +15 -15
  95. package/dist/translation-service.d.ts +157 -157
  96. package/dist/uid.d.ts +12 -12
  97. package/dist/unicode.d.ts +42 -42
  98. package/dist/version.d.ts +5 -5
  99. package/dist/wait.d.ts +11 -11
  100. package/package.json +3 -3
  101. package/dist/dom/getcommonancestor.d.ts +0 -12
package/LICENSE.md CHANGED
@@ -18,7 +18,7 @@ Where not otherwise indicated, all CKEditor 5 content is authored by CKSour
18
18
 
19
19
  The following libraries are included in CKEditor 5 under the [MIT license](https://opensource.org/licenses/MIT):
20
20
 
21
- * es-toolkit - Copyright (c) 2024 Viva Republica, Inc and Copyright OpenJS Foundation and other contributors.
21
+ * es-toolkit - Copyright (c) 2024 Viva Republica, Inc.
22
22
 
23
23
  Trademarks
24
24
  ----------
@@ -1,17 +1,23 @@
1
1
  /**
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
- */
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
- * @module utils/abortabledebounce
7
- */
6
+ * @module utils/abortabledebounce
7
+ */
8
8
  /**
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<Args extends Array<any>, Ret>(func: (signal: AbortSignal, ...args: Args) => Ret): AbortableFunc<Args, Ret>;
14
- export interface AbortableFunc<Args extends Array<any>, Ret> {
15
- (...args: Args): Ret;
16
- abort(): void;
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
- * @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
- */
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
- * @module utils/areconnectedthroughproperties
7
- */
6
+ * @module utils/areconnectedthroughproperties
7
+ */
8
8
  /**
9
- * Traverses both structures to find out whether there is a reference that is shared between both structures.
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;
@@ -1,124 +1,125 @@
1
1
  /**
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
- */
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
- * @module utils/ckeditorerror
7
- */
6
+ * @module utils/ckeditorerror
7
+ */
8
8
  /**
9
- * URL to the documentation with error codes.
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
- * 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
- */
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
18
+ * reported to the callbacks registered with {@link module:core/errorreporter~onEditorError `onEditorError()`},
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
- * 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;
41
+ /**
42
+ * A context of the error by which error reporting works out which editor the error came from.
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 {@link module:core/errorreporter~onEditorError error reporting}
55
+ * works out which editor the error came from. It should be an editor instance or a property connected to it. It can be
56
+ * also a `null` value if the error should not be attributed to any editor (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
+ * Only a {@link module:utils/ckeditorerror~CKEditorError} is reported to the callbacks registered with
72
+ * {@link module:core/errorreporter~onEditorError `onEditorError()`}, so wrapping an unexpected error in one is what
73
+ * makes it reach them.
74
+ *
75
+ * @param error The error to rethrow.
76
+ * @param context An object connected through properties with the editor instance. This context is what error
77
+ * reporting uses to work out which editor the error came from.
78
+ */
79
+ static rethrowUnexpectedError(error: Error, context: object): never;
79
80
  }
80
81
  /**
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
- */
82
+ * Logs a warning to the console with a properly formatted message and adds a link to the documentation.
83
+ * Use whenever you want to log a warning to the console.
84
+ *
85
+ * ```ts
86
+ * /**
87
+ * * There was a problem processing the configuration of the toolbar. The item with the given
88
+ * * name does not exist, so it was omitted when rendering the toolbar.
89
+ * *
90
+ * * @error toolbarview-item-unavailable
91
+ * * @param {String} name The name of the component.
92
+ * *\/
93
+ * logWarning( 'toolbarview-item-unavailable', { name } );
94
+ * ```
95
+ *
96
+ * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to throw an error and when to log
97
+ * a warning or an error to the console.
98
+ *
99
+ * @param errorName The error name to be logged.
100
+ * @param data Additional data to be logged.
101
+ */
101
102
  export declare function logWarning(errorName: string, data?: object): void;
102
103
  /**
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
- */
104
+ * Logs an error to the console with a properly formatted message and adds a link to the documentation.
105
+ * Use whenever you want to log an error to the console.
106
+ *
107
+ * ```ts
108
+ * /**
109
+ * * There was a problem processing the configuration of the toolbar. The item with the given
110
+ * * name does not exist, so it was omitted when rendering the toolbar.
111
+ * *
112
+ * * @error toolbarview-item-unavailable
113
+ * * @param {String} name The name of the component.
114
+ * *\/
115
+ * logError( 'toolbarview-item-unavailable', { name } );
116
+ * ```
117
+ *
118
+ * **Note**: In most cases logging a warning using {@link module:utils/ckeditorerror~logWarning} is enough.
119
+ *
120
+ * See also {@link module:utils/ckeditorerror~CKEditorError} for an explanation when to use each method.
121
+ *
122
+ * @param errorName The error name to be logged.
123
+ * @param data Additional data to be logged.
124
+ */
124
125
  export declare function logError(errorName: string, data?: object): void;