@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.
- 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
package/dist/dom/scroll.d.ts
CHANGED
|
@@ -1,78 +1,81 @@
|
|
|
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
|
export type IfTrue<T> = T extends true ? true : never;
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
export declare function scrollViewportToShowTarget<
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
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/dom/setdatainelement
|
|
7
|
+
*/
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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;
|
package/dist/dom/tounit.d.ts
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
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/dom/tounit
|
|
7
|
+
*/
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
|
|
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/elementreplacer
|
|
7
|
+
*/
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
}
|