@ckeditor/ckeditor5-utils 48.2.0 → 48.3.0-alpha.1

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 (82) hide show
  1. package/dist/abortabledebounce.d.ts +19 -13
  2. package/dist/areconnectedthroughproperties.d.ts +7 -7
  3. package/dist/ckeditorerror.d.ts +113 -113
  4. package/dist/collection.d.ts +419 -415
  5. package/dist/collectstylesheets.d.ts +9 -9
  6. package/dist/comparearrays.d.ts +25 -25
  7. package/dist/config.d.ts +159 -156
  8. package/dist/count.d.ts +14 -14
  9. package/dist/crc32.d.ts +19 -19
  10. package/dist/decodelicensekey.d.ts +7 -7
  11. package/dist/delay.d.ts +13 -13
  12. package/dist/diff.d.ts +32 -27
  13. package/dist/difftochanges.d.ts +47 -47
  14. package/dist/dom/createelement.d.ts +43 -43
  15. package/dist/dom/emittermixin.d.ts +144 -135
  16. package/dist/dom/findclosestscrollableancestor.d.ts +8 -8
  17. package/dist/dom/getancestors.d.ts +13 -13
  18. package/dist/dom/getborderwidths.d.ts +16 -16
  19. package/dist/dom/getcommonancestor.d.ts +9 -9
  20. package/dist/dom/getdatafromelement.d.ts +10 -10
  21. package/dist/dom/getpositionedancestor.d.ts +7 -7
  22. package/dist/dom/getrangefrommouseevent.d.ts +12 -12
  23. package/dist/dom/getvisualviewportoffset.d.ts +7 -7
  24. package/dist/dom/global.d.ts +24 -24
  25. package/dist/dom/indexof.d.ts +10 -10
  26. package/dist/dom/insertat.d.ts +11 -11
  27. package/dist/dom/iscomment.d.ts +7 -7
  28. package/dist/dom/isnode.d.ts +7 -7
  29. package/dist/dom/isrange.d.ts +7 -7
  30. package/dist/dom/istext.d.ts +7 -7
  31. package/dist/dom/isvalidattributename.d.ts +7 -7
  32. package/dist/dom/isvisible.d.ts +12 -12
  33. package/dist/dom/iswindow.d.ts +7 -7
  34. package/dist/dom/position.d.ts +200 -200
  35. package/dist/dom/rect.d.ts +194 -194
  36. package/dist/dom/remove.d.ts +9 -9
  37. package/dist/dom/resizeobserver.d.ts +70 -70
  38. package/dist/dom/scroll.d.ts +75 -72
  39. package/dist/dom/setdatainelement.d.ts +10 -10
  40. package/dist/dom/tounit.d.ts +16 -16
  41. package/dist/elementreplacer.d.ts +26 -26
  42. package/dist/emittermixin.d.ts +290 -280
  43. package/dist/env.d.ts +124 -124
  44. package/dist/eventinfo.d.ts +58 -55
  45. package/dist/fastdiff.d.ts +112 -109
  46. package/dist/first.d.ts +7 -7
  47. package/dist/focustracker.d.ts +133 -131
  48. package/dist/formathtml.d.ts +15 -15
  49. package/dist/index-content.css +1 -0
  50. package/dist/index-editor.css +1 -0
  51. package/dist/index.css +0 -2
  52. package/dist/index.d.ts +78 -77
  53. package/dist/index.js +5695 -6360
  54. package/dist/index.js.map +1 -1
  55. package/dist/inserttopriorityarray.d.ts +23 -23
  56. package/dist/isfeatureblockedbylicensekey.d.ts +10 -10
  57. package/dist/isiterable.d.ts +10 -10
  58. package/dist/keyboard.d.ts +107 -109
  59. package/dist/keystrokehandler.d.ts +90 -90
  60. package/dist/language.d.ts +12 -12
  61. package/dist/legacyerrors.d.ts +0 -4
  62. package/dist/locale.d.ts +122 -122
  63. package/dist/mapsequal.d.ts +11 -11
  64. package/dist/mix.d.ts +54 -53
  65. package/dist/nth.d.ts +12 -12
  66. package/dist/objecttomap.d.ts +18 -18
  67. package/dist/observablemixin.d.ts +621 -539
  68. package/dist/parsebase64encodedobject.d.ts +7 -7
  69. package/dist/parsedimensionwithunit.d.ts +40 -0
  70. package/dist/priorities.d.ts +24 -24
  71. package/dist/retry.d.ts +27 -27
  72. package/dist/splicearray.d.ts +22 -22
  73. package/dist/spy.d.ts +15 -15
  74. package/dist/toarray.d.ts +17 -17
  75. package/dist/tomap.d.ts +15 -15
  76. package/dist/translation-service.d.ts +157 -157
  77. package/dist/uid.d.ts +12 -12
  78. package/dist/unicode.d.ts +42 -42
  79. package/dist/version.d.ts +5 -5
  80. package/dist/wait.d.ts +11 -11
  81. package/package.json +2 -2
  82. package/dist/index.css.map +0 -1
@@ -1,78 +1,81 @@
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
  export type IfTrue<T> = T extends true ? true : never;
6
6
  /**
7
- * Makes any page `HTMLElement` or `Range` (`target`) visible inside the browser viewport.
8
- * This helper will scroll all `target` ancestors and the web browser viewport to reveal the target to
9
- * the user. If the `target` is already visible, nothing will happen.
10
- *
11
- * @param options Additional configuration of the scrolling behavior.
12
- * @param options.target A target, which supposed to become visible to the user.
13
- * @param options.viewportOffset An offset from the edge of the viewport (in pixels)
14
- * the `target` will be moved by if the viewport is scrolled. It enhances the user experience
15
- * by keeping the `target` some distance from the edge of the viewport and thus making it easier to
16
- * read or edit by the user.
17
- * @param options.ancestorOffset An offset from the boundary of scrollable ancestors (if any)
18
- * the `target` will be moved by if the viewport is scrolled. It enhances the user experience
19
- * by keeping the `target` some distance from the edge of the ancestors and thus making it easier to
20
- * read or edit by the user.
21
- * @param options.alignToTop When set `true`, the helper will make sure the `target` is scrolled up
22
- * to the top boundary of the viewport and/or scrollable ancestors if scrolled up. When not set
23
- * (default), the `target` will be revealed by scrolling as little as possible. This option will
24
- * not affect `targets` that must be scrolled down because they will appear at the top of the boundary
25
- * anyway.
26
- *
27
- * ```
28
- * scrollViewportToShowTarget() with scrollViewportToShowTarget() with
29
- * Initial state alignToTop unset (default) alignToTop = true
30
- *
31
- * ┌────────────────────────────────┬─┐ ┌────────────────────────────────┬─┐ ┌────────────────────────────────┬─┐
32
- * │ │▲│ │ │▲│ │ [ Target to be revealed ] │▲│
33
- * │ │ │ │ │ │ │ │ │
34
- * │ │█│ │ │ │ │ │ │
35
- * │ │█│ │ │ │ │ │ │
36
- * │ │ │ │ │█│ │ │ │
37
- * │ │ │ │ │█│ │ │█│
38
- * │ │ │ │ │ │ │ │█│
39
- * │ │▼│ │ [ Target to be revealed ] │▼│ │ │▼│
40
- * └────────────────────────────────┴─┘ └────────────────────────────────┴─┘ └────────────────────────────────┴─┘
41
- *
42
- *
43
- * [ Target to be revealed ]
44
- *```
45
- *
46
- * @param options.forceScroll When set `true`, the `target` will be aligned to the top of the viewport
47
- * and scrollable ancestors whether it is already visible or not. This option will only work when `alignToTop`
48
- * is `true`
49
- */
50
- export declare function scrollViewportToShowTarget<T extends boolean, U extends IfTrue<T>>({ target, viewportOffset, ancestorOffset, alignToTop, forceScroll }: {
51
- readonly target: HTMLElement | Range;
52
- readonly viewportOffset?: number | {
53
- top: number;
54
- bottom: number;
55
- left: number;
56
- right: number;
57
- };
58
- readonly ancestorOffset?: number;
59
- readonly alignToTop?: T;
60
- readonly forceScroll?: U;
7
+ * Makes any page `HTMLElement` or `Range` (`target`) visible inside the browser viewport.
8
+ * This helper will scroll all `target` ancestors and the web browser viewport to reveal the target to
9
+ * the user. If the `target` is already visible, nothing will happen.
10
+ *
11
+ * @param options Additional configuration of the scrolling behavior.
12
+ * @param options.target A target, which supposed to become visible to the user.
13
+ * @param options.viewportOffset An offset from the edge of the viewport (in pixels)
14
+ * the `target` will be moved by if the viewport is scrolled. It enhances the user experience
15
+ * by keeping the `target` some distance from the edge of the viewport and thus making it easier to
16
+ * read or edit by the user.
17
+ * @param options.ancestorOffset An offset from the boundary of scrollable ancestors (if any)
18
+ * the `target` will be moved by if the viewport is scrolled. It enhances the user experience
19
+ * by keeping the `target` some distance from the edge of the ancestors and thus making it easier to
20
+ * read or edit by the user.
21
+ * @param options.alignToTop When set `true`, the helper will make sure the `target` is scrolled up
22
+ * to the top boundary of the viewport and/or scrollable ancestors if scrolled up. When not set
23
+ * (default), the `target` will be revealed by scrolling as little as possible. This option will
24
+ * not affect `targets` that must be scrolled down because they will appear at the top of the boundary
25
+ * anyway.
26
+ *
27
+ * ```
28
+ * scrollViewportToShowTarget() with scrollViewportToShowTarget() with
29
+ * Initial state alignToTop unset (default) alignToTop = true
30
+ *
31
+ * ┌────────────────────────────────┬─┐ ┌────────────────────────────────┬─┐ ┌────────────────────────────────┬─┐
32
+ * │ │▲│ │ │▲│ │ [ Target to be revealed ] │▲│
33
+ * │ │ │ │ │ │ │ │ │
34
+ * │ │█│ │ │ │ │ │ │
35
+ * │ │█│ │ │ │ │ │ │
36
+ * │ │ │ │ │█│ │ │ │
37
+ * │ │ │ │ │█│ │ │█│
38
+ * │ │ │ │ │ │ │ │█│
39
+ * │ │▼│ │ [ Target to be revealed ] │▼│ │ │▼│
40
+ * └────────────────────────────────┴─┘ └────────────────────────────────┴─┘ └────────────────────────────────┴─┘
41
+ *
42
+ *
43
+ * [ Target to be revealed ]
44
+ *```
45
+ *
46
+ * @param options.forceScroll When set `true`, the `target` will be aligned to the top of the viewport
47
+ * and scrollable ancestors whether it is already visible or not. This option will only work when `alignToTop`
48
+ * is `true`
49
+ */
50
+ export declare function scrollViewportToShowTarget<
51
+ T extends boolean,
52
+ U extends IfTrue<T>
53
+ >({ target, viewportOffset, ancestorOffset, alignToTop, forceScroll }: {
54
+ readonly target: HTMLElement | Range;
55
+ readonly viewportOffset?: number | {
56
+ top: number;
57
+ bottom: number;
58
+ left: number;
59
+ right: number;
60
+ };
61
+ readonly ancestorOffset?: number;
62
+ readonly alignToTop?: T;
63
+ readonly forceScroll?: U;
61
64
  }): void;
62
65
  /**
63
- * Makes any page `HTMLElement` or `Range` (target) visible within its scrollable ancestors,
64
- * e.g. if they have `overflow: scroll` CSS style.
65
- *
66
- * @param target A target, which supposed to become visible to the user.
67
- * @param ancestorOffset An offset between the target and the boundary of scrollable ancestors
68
- * to be maintained while scrolling.
69
- * @param limiterElement The outermost ancestor that should be scrolled. If specified, it can prevent
70
- * scrolling the whole page.
71
- * @param alignToTop When set `true`, the function will make sure the `target` is scrolled up
72
- * to the top boundary of the scrollable ancestors if scrolled up. When not set (default), the `target`
73
- * will be revealed by scrolling as little as possible. This option will not affect target elements that must be
74
- * scrolled down because they will appear at the top of the boundary anyway.
75
- * @param forceScroll When set `true`, the `target` will be aligned to the top of scrollable ancestors
76
- * whether it is already visible or not. This option will only work when `alignToTop` is `true`
77
- */
66
+ * Makes any page `HTMLElement` or `Range` (target) visible within its scrollable ancestors,
67
+ * e.g. if they have `overflow: scroll` CSS style.
68
+ *
69
+ * @param target A target, which supposed to become visible to the user.
70
+ * @param ancestorOffset An offset between the target and the boundary of scrollable ancestors
71
+ * to be maintained while scrolling.
72
+ * @param limiterElement The outermost ancestor that should be scrolled. If specified, it can prevent
73
+ * scrolling the whole page.
74
+ * @param alignToTop When set `true`, the function will make sure the `target` is scrolled up
75
+ * to the top boundary of the scrollable ancestors if scrolled up. When not set (default), the `target`
76
+ * will be revealed by scrolling as little as possible. This option will not affect target elements that must be
77
+ * scrolled down because they will appear at the top of the boundary anyway.
78
+ * @param forceScroll When set `true`, the `target` will be aligned to the top of scrollable ancestors
79
+ * whether it is already visible or not. This option will only work when `alignToTop` is `true`
80
+ */
78
81
  export declare function scrollAncestorsToShowTarget(target: HTMLElement | Range, ancestorOffset?: number, limiterElement?: HTMLElement, alignToTop?: boolean, forceScroll?: true): void;
@@ -1,14 +1,14 @@
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/dom/setdatainelement
7
- */
6
+ * @module utils/dom/setdatainelement
7
+ */
8
8
  /**
9
- * Sets data in a given element.
10
- *
11
- * @param el The element in which the data will be set.
12
- * @param data The data string.
13
- */
9
+ * Sets data in a given element.
10
+ *
11
+ * @param el The element in which the data will be set.
12
+ * @param data The data string.
13
+ */
14
14
  export declare function setDataInElement(el: HTMLElement, data: string): void;
@@ -1,22 +1,22 @@
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/dom/tounit
7
- */
6
+ * @module utils/dom/tounit
7
+ */
8
8
  /**
9
- * Returns a helper function, which adds a desired trailing
10
- * `unit` to the passed value.
11
- *
12
- * @param unit An unit like "px" or "em".
13
- */
9
+ * Returns a helper function, which adds a desired trailing
10
+ * `unit` to the passed value.
11
+ *
12
+ * @param unit An unit like "px" or "em".
13
+ */
14
14
  export declare function toUnit(unit: string): ToUnitHelper;
15
15
  /**
16
- * A function, which adds a pre–defined trailing `unit`
17
- * to the passed `value`.
18
- *
19
- * @param value A value to be given the unit.
20
- * @returns A value with the trailing unit.
21
- */
16
+ * A function, which adds a pre–defined trailing `unit`
17
+ * to the passed `value`.
18
+ *
19
+ * @param value A value to be given the unit.
20
+ * @returns A value with the trailing unit.
21
+ */
22
22
  export type ToUnitHelper = (value: string | number) => string;
@@ -1,31 +1,31 @@
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/elementreplacer
7
- */
6
+ * @module utils/elementreplacer
7
+ */
8
8
  /**
9
- * Utility class allowing to hide existing HTML elements or replace them with given ones in a way that doesn't remove
10
- * the original elements from the DOM.
11
- */
9
+ * Utility class allowing to hide existing HTML elements or replace them with given ones in a way that doesn't remove
10
+ * the original elements from the DOM.
11
+ */
12
12
  export declare class ElementReplacer {
13
- /**
14
- * The elements replaced by {@link #replace} and their replacements.
15
- */
16
- private _replacedElements;
17
- constructor();
18
- /**
19
- * Hides the `element` and, if specified, inserts the the given element next to it.
20
- *
21
- * The effect of this method can be reverted by {@link #restore}.
22
- *
23
- * @param element The element to replace.
24
- * @param newElement The replacement element. If not passed, then the `element` will just be hidden.
25
- */
26
- replace(element: HTMLElement, newElement?: HTMLElement): void;
27
- /**
28
- * Restores what {@link #replace} did.
29
- */
30
- restore(): void;
13
+ /**
14
+ * The elements replaced by {@link #replace} and their replacements.
15
+ */
16
+ private _replacedElements;
17
+ constructor();
18
+ /**
19
+ * Hides the `element` and, if specified, inserts the the given element next to it.
20
+ *
21
+ * The effect of this method can be reverted by {@link #restore}.
22
+ *
23
+ * @param element The element to replace.
24
+ * @param newElement The replacement element. If not passed, then the `element` will just be hidden.
25
+ */
26
+ replace(element: HTMLElement, newElement?: HTMLElement): void;
27
+ /**
28
+ * Restores what {@link #replace} did.
29
+ */
30
+ restore(): void;
31
31
  }