@ckeditor/ckeditor5-utils 45.2.1 → 46.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.
- package/dist/index.js +191 -158
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/abortabledebounce.d.ts +1 -1
- package/src/abortabledebounce.js +1 -1
- package/src/areconnectedthroughproperties.d.ts +1 -1
- package/src/areconnectedthroughproperties.js +1 -1
- package/src/ckeditorerror.d.ts +5 -4
- package/src/ckeditorerror.js +18 -14
- package/src/collection.d.ts +1 -1
- package/src/collection.js +5 -5
- package/src/collectstylesheets.d.ts +1 -1
- package/src/collectstylesheets.js +1 -1
- package/src/comparearrays.d.ts +1 -1
- package/src/comparearrays.js +1 -1
- package/src/config.d.ts +1 -1
- package/src/config.js +1 -1
- package/src/count.d.ts +1 -1
- package/src/count.js +1 -1
- package/src/crc32.d.ts +2 -3
- package/src/crc32.js +1 -1
- package/src/delay.d.ts +1 -1
- package/src/delay.js +1 -1
- package/src/diff.d.ts +3 -4
- package/src/diff.js +2 -2
- package/src/difftochanges.d.ts +1 -1
- package/src/difftochanges.js +1 -1
- package/src/dom/createelement.d.ts +5 -6
- package/src/dom/createelement.js +2 -2
- package/src/dom/emittermixin.d.ts +5 -5
- package/src/dom/emittermixin.js +6 -15
- package/src/dom/findclosestscrollableancestor.d.ts +1 -1
- package/src/dom/findclosestscrollableancestor.js +2 -2
- package/src/dom/getancestors.d.ts +1 -1
- package/src/dom/getancestors.js +1 -1
- package/src/dom/getborderwidths.d.ts +1 -1
- package/src/dom/getborderwidths.js +1 -1
- package/src/dom/getcommonancestor.d.ts +1 -1
- package/src/dom/getcommonancestor.js +2 -2
- package/src/dom/getdatafromelement.d.ts +1 -1
- package/src/dom/getdatafromelement.js +1 -1
- package/src/dom/getpositionedancestor.d.ts +1 -1
- package/src/dom/getpositionedancestor.js +2 -2
- package/src/dom/getrangefrommouseevent.d.ts +1 -1
- package/src/dom/getrangefrommouseevent.js +1 -1
- package/src/dom/getvisualviewportoffset.d.ts +1 -1
- package/src/dom/getvisualviewportoffset.js +3 -3
- package/src/dom/global.d.ts +2 -2
- package/src/dom/global.js +4 -4
- package/src/dom/indexof.d.ts +1 -1
- package/src/dom/indexof.js +1 -1
- package/src/dom/insertat.d.ts +1 -1
- package/src/dom/insertat.js +1 -1
- package/src/dom/iscomment.d.ts +1 -1
- package/src/dom/iscomment.js +1 -1
- package/src/dom/isnode.d.ts +1 -1
- package/src/dom/isnode.js +1 -1
- package/src/dom/isrange.d.ts +1 -1
- package/src/dom/isrange.js +1 -1
- package/src/dom/istext.d.ts +1 -1
- package/src/dom/istext.js +1 -1
- package/src/dom/isvalidattributename.d.ts +1 -1
- package/src/dom/isvalidattributename.js +2 -2
- package/src/dom/isvisible.d.ts +1 -1
- package/src/dom/isvisible.js +2 -2
- package/src/dom/iswindow.d.ts +1 -1
- package/src/dom/iswindow.js +1 -1
- package/src/dom/position.d.ts +5 -5
- package/src/dom/position.js +3 -3
- package/src/dom/rect.d.ts +3 -3
- package/src/dom/rect.js +7 -7
- package/src/dom/remove.d.ts +1 -1
- package/src/dom/remove.js +1 -1
- package/src/dom/resizeobserver.d.ts +1 -1
- package/src/dom/resizeobserver.js +2 -2
- package/src/dom/scroll.d.ts +1 -2
- package/src/dom/scroll.js +3 -3
- package/src/dom/setdatainelement.d.ts +1 -1
- package/src/dom/setdatainelement.js +1 -1
- package/src/dom/tounit.d.ts +1 -1
- package/src/dom/tounit.js +1 -1
- package/src/elementreplacer.d.ts +1 -1
- package/src/elementreplacer.js +1 -1
- package/src/emittermixin.d.ts +3 -3
- package/src/emittermixin.js +6 -14
- package/src/env.d.ts +16 -2
- package/src/env.js +17 -3
- package/src/eventinfo.d.ts +1 -1
- package/src/eventinfo.js +2 -2
- package/src/fastdiff.d.ts +1 -1
- package/src/fastdiff.js +1 -1
- package/src/first.d.ts +1 -1
- package/src/first.js +1 -1
- package/src/focustracker.d.ts +1 -1
- package/src/focustracker.js +4 -4
- package/src/formathtml.d.ts +1 -1
- package/src/formathtml.js +1 -1
- package/src/index.d.ts +69 -62
- package/src/index.js +68 -61
- package/src/inserttopriorityarray.d.ts +1 -1
- package/src/inserttopriorityarray.js +2 -2
- package/src/isiterable.d.ts +1 -1
- package/src/isiterable.js +1 -1
- package/src/keyboard.d.ts +2 -2
- package/src/keyboard.js +4 -4
- package/src/keystrokehandler.d.ts +2 -2
- package/src/keystrokehandler.js +3 -3
- package/src/legacyerrors.d.ts +5 -0
- package/src/legacyerrors.js +18 -0
- package/src/locale.d.ts +1 -10
- package/src/locale.js +2 -23
- package/src/mapsequal.d.ts +1 -1
- package/src/mapsequal.js +1 -1
- package/src/mix.d.ts +0 -27
- package/src/mix.js +1 -46
- package/src/nth.d.ts +1 -1
- package/src/nth.js +1 -1
- package/src/objecttomap.d.ts +1 -1
- package/src/objecttomap.js +1 -1
- package/src/observablemixin.d.ts +8 -9
- package/src/observablemixin.js +3 -12
- package/src/parsebase64encodedobject.d.ts +1 -1
- package/src/parsebase64encodedobject.js +1 -1
- package/src/priorities.d.ts +1 -2
- package/src/priorities.js +1 -2
- package/src/retry.d.ts +1 -1
- package/src/retry.js +2 -2
- package/src/splicearray.d.ts +1 -1
- package/src/splicearray.js +1 -1
- package/src/spy.d.ts +1 -2
- package/src/spy.js +1 -2
- package/src/toarray.d.ts +2 -2
- package/src/toarray.js +1 -1
- package/src/tomap.d.ts +1 -1
- package/src/tomap.js +3 -3
- package/src/translation-service.d.ts +1 -1
- package/src/translation-service.js +3 -3
- package/src/uid.d.ts +1 -1
- package/src/uid.js +1 -1
- package/src/version.d.ts +1 -2
- package/src/version.js +12 -13
- package/src/wait.d.ts +1 -1
- package/src/wait.js +1 -1
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module utils/dom/getpositionedancestor
|
|
7
7
|
*/
|
|
8
|
-
import global from './global.js';
|
|
8
|
+
import { global } from './global.js';
|
|
9
9
|
/**
|
|
10
10
|
* For a given element, returns the nearest ancestor element which CSS position is not "static".
|
|
11
11
|
*
|
|
12
12
|
* @param element The native DOM element to be checked.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export function getPositionedAncestor(element) {
|
|
15
15
|
if (!element || !element.parentNode) {
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @param domEvent The mouse event.
|
|
12
12
|
* @returns The DOM range.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export declare function getRangeFromMouseEvent(domEvent: MouseEvent & {
|
|
15
15
|
rangeParent?: HTMLElement;
|
|
16
16
|
rangeOffset?: number;
|
|
17
17
|
}): Range | null;
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module utils/dom/getvisualviewportoffset
|
|
7
7
|
*/
|
|
8
|
-
import global from './global.js';
|
|
9
|
-
import env from '../env.js';
|
|
8
|
+
import { global } from './global.js';
|
|
9
|
+
import { env } from '../env.js';
|
|
10
10
|
/**
|
|
11
11
|
* Returns the visual viewport offsets to adjust elements with `position: fixed` style.
|
|
12
12
|
*/
|
|
13
|
-
export
|
|
13
|
+
export function getVisualViewportOffset() {
|
|
14
14
|
const visualViewport = global.window.visualViewport;
|
|
15
15
|
if (!visualViewport || !(env.isiOS || env.isSafari)) {
|
|
16
16
|
return { left: 0, top: 0 };
|
package/src/dom/global.d.ts
CHANGED
package/src/dom/global.js
CHANGED
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
* console.log( global.window.innerWidth );
|
|
19
19
|
* ```
|
|
20
20
|
*/
|
|
21
|
-
let
|
|
21
|
+
let global; // named globalVar instead of global: https://github.com/ckeditor/ckeditor5/issues/12971
|
|
22
22
|
// In some environments window and document API might not be available.
|
|
23
23
|
try {
|
|
24
|
-
|
|
24
|
+
global = { window, document };
|
|
25
25
|
}
|
|
26
26
|
catch {
|
|
27
27
|
// It's not possible to mock a window object to simulate lack of a window object without writing extremely convoluted code.
|
|
@@ -30,6 +30,6 @@ catch {
|
|
|
30
30
|
// We only handle this so loading editor in environments without window and document doesn't fail.
|
|
31
31
|
// For better DX we shouldn't introduce mixed types and require developers to check the type manually.
|
|
32
32
|
// This module should not be used on purpose in any environment outside browser.
|
|
33
|
-
|
|
33
|
+
global = { window: {}, document: {} };
|
|
34
34
|
}
|
|
35
|
-
export
|
|
35
|
+
export { global };
|
package/src/dom/indexof.d.ts
CHANGED
package/src/dom/indexof.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @param node Node which index is tested.
|
|
12
12
|
* @returns Index of the node in the parent element. Returns 0 if node has no parent.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export function indexOf(node) {
|
|
15
15
|
let index = 0;
|
|
16
16
|
while (node.previousSibling) {
|
|
17
17
|
node = node.previousSibling;
|
package/src/dom/insertat.d.ts
CHANGED
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* @param index Insertions index.
|
|
13
13
|
* @param nodeToInsert Node to insert.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export declare function insertAt(parentElement: Element, index: number, nodeToInsert: Node): void;
|
package/src/dom/insertat.js
CHANGED
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
* @param index Insertions index.
|
|
13
13
|
* @param nodeToInsert Node to insert.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export function insertAt(parentElement, index, nodeToInsert) {
|
|
16
16
|
parentElement.insertBefore(nodeToInsert, parentElement.childNodes[index] || null);
|
|
17
17
|
}
|
package/src/dom/iscomment.d.ts
CHANGED
package/src/dom/iscomment.js
CHANGED
package/src/dom/isnode.d.ts
CHANGED
package/src/dom/isnode.js
CHANGED
package/src/dom/isrange.d.ts
CHANGED
package/src/dom/isrange.js
CHANGED
package/src/dom/istext.d.ts
CHANGED
package/src/dom/istext.js
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module utils/dom/isvalidattributename
|
|
7
7
|
*/
|
|
8
|
-
import global from './global.js';
|
|
8
|
+
import { global } from './global.js';
|
|
9
9
|
/**
|
|
10
10
|
* Checks if the given attribute name is valid in terms of HTML.
|
|
11
11
|
*
|
|
12
12
|
* @param name Attribute name.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export function isValidAttributeName(name) {
|
|
15
15
|
try {
|
|
16
16
|
global.document.createAttribute(name);
|
|
17
17
|
}
|
package/src/dom/isvisible.d.ts
CHANGED
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
* **Note**: This helper does not check whether the element is hidden by cropping, overflow, etc..
|
|
13
13
|
* To check that, use {@link module:utils/dom/rect~Rect} instead.
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export declare function isVisible(element: Text | HTMLElement | null | undefined): boolean;
|
package/src/dom/isvisible.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module utils/dom/isvisible
|
|
7
7
|
*/
|
|
8
|
-
import isText from './istext.js';
|
|
8
|
+
import { isText } from './istext.js';
|
|
9
9
|
/**
|
|
10
10
|
* Checks whether the element is visible to the user in DOM:
|
|
11
11
|
*
|
|
@@ -16,7 +16,7 @@ import isText from './istext.js';
|
|
|
16
16
|
* **Note**: This helper does not check whether the element is hidden by cropping, overflow, etc..
|
|
17
17
|
* To check that, use {@link module:utils/dom/rect~Rect} instead.
|
|
18
18
|
*/
|
|
19
|
-
export
|
|
19
|
+
export function isVisible(element) {
|
|
20
20
|
if (!element) {
|
|
21
21
|
return false;
|
|
22
22
|
}
|
package/src/dom/iswindow.d.ts
CHANGED
package/src/dom/iswindow.js
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/**
|
|
9
9
|
* Checks if the object is a native DOM Window.
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
11
|
+
export function isWindow(obj) {
|
|
12
12
|
const stringifiedObject = Object.prototype.toString.apply(obj);
|
|
13
13
|
// Returns `true` for the `window` object in browser environments.
|
|
14
14
|
if (stringifiedObject == '[object Window]') {
|
package/src/dom/position.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
|
-
import Rect,
|
|
5
|
+
import { Rect, type RectSource } from './rect.js';
|
|
6
6
|
/**
|
|
7
7
|
* Calculates the `position: absolute` coordinates of a given element so it can be positioned with respect to the
|
|
8
8
|
* target in the visually most efficient way, taking various restrictions like viewport or limiter geometry
|
|
@@ -71,7 +71,7 @@ import Rect, { type RectSource } from './rect.js';
|
|
|
71
71
|
*
|
|
72
72
|
* @param options The input data and configuration of the helper.
|
|
73
73
|
*/
|
|
74
|
-
export declare function getOptimalPosition({ element, target, positions, limiter, fitInViewport, viewportOffsetConfig }:
|
|
74
|
+
export declare function getOptimalPosition({ element, target, positions, limiter, fitInViewport, viewportOffsetConfig }: DomOptimalPositionOptions): DomPoint | null;
|
|
75
75
|
/**
|
|
76
76
|
* A position object which instances are created and used by the {@link module:utils/dom/position~getOptimalPosition} helper.
|
|
77
77
|
*
|
|
@@ -105,7 +105,7 @@ export interface DomPoint {
|
|
|
105
105
|
/**
|
|
106
106
|
* The `getOptimalPosition()` helper options.
|
|
107
107
|
*/
|
|
108
|
-
export interface
|
|
108
|
+
export interface DomOptimalPositionOptions {
|
|
109
109
|
/**
|
|
110
110
|
* Element that is to be positioned.
|
|
111
111
|
*/
|
|
@@ -182,11 +182,11 @@ export interface Options {
|
|
|
182
182
|
* @param viewportRect The rect of the visual browser viewport.
|
|
183
183
|
* @returns When the function returns `null`, it will not be considered by {@link module:utils/dom/position~getOptimalPosition}.
|
|
184
184
|
*/
|
|
185
|
-
export type PositioningFunction = (elementRect: Rect, targetRect: Rect, viewportRect: Rect, limiterRect?: Rect) =>
|
|
185
|
+
export type PositioningFunction = (elementRect: Rect, targetRect: Rect, viewportRect: Rect, limiterRect?: Rect) => DomPositioningFunctionResult | null;
|
|
186
186
|
/**
|
|
187
187
|
* The result of {@link module:utils/dom/position~PositioningFunction}.
|
|
188
188
|
*/
|
|
189
|
-
export interface
|
|
189
|
+
export interface DomPositioningFunctionResult {
|
|
190
190
|
/**
|
|
191
191
|
* The `top` value of the element rect that would represent the position.
|
|
192
192
|
*/
|
package/src/dom/position.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module utils/dom/position
|
|
7
7
|
*/
|
|
8
|
-
import global from './global.js';
|
|
9
|
-
import Rect from './rect.js';
|
|
10
|
-
import getPositionedAncestor from './getpositionedancestor.js';
|
|
8
|
+
import { global } from './global.js';
|
|
9
|
+
import { Rect } from './rect.js';
|
|
10
|
+
import { getPositionedAncestor } from './getpositionedancestor.js';
|
|
11
11
|
import { isFunction } from 'es-toolkit/compat';
|
|
12
12
|
// @if CK_DEBUG_POSITION // const {
|
|
13
13
|
// @if CK_DEBUG_POSITION // default: RectDrawer,
|
package/src/dom/rect.d.ts
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* the native `object.getBoundingClientRect()` method. Provides a set of methods
|
|
8
8
|
* to manipulate the rect and compare it against other rect instances.
|
|
9
9
|
*/
|
|
10
|
-
export
|
|
10
|
+
export declare class Rect {
|
|
11
11
|
/**
|
|
12
12
|
* The "top" value of the rect.
|
|
13
13
|
*
|
|
@@ -181,11 +181,11 @@ export default class Rect {
|
|
|
181
181
|
/**
|
|
182
182
|
* A source of {@link module:utils/dom/rect~Rect}.
|
|
183
183
|
*/
|
|
184
|
-
export type RectSource = HTMLElement | Range | Window |
|
|
184
|
+
export type RectSource = HTMLElement | Range | Window | DomRectLike;
|
|
185
185
|
/**
|
|
186
186
|
* An object that describes properties of `ClientRect` object.
|
|
187
187
|
*/
|
|
188
|
-
export interface
|
|
188
|
+
export interface DomRectLike {
|
|
189
189
|
readonly top: number;
|
|
190
190
|
readonly right: number;
|
|
191
191
|
readonly bottom: number;
|
package/src/dom/rect.js
CHANGED
|
@@ -5,19 +5,19 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module utils/dom/rect
|
|
7
7
|
*/
|
|
8
|
-
import isRange from './isrange.js';
|
|
9
|
-
import isWindow from './iswindow.js';
|
|
10
|
-
import getBorderWidths from './getborderwidths.js';
|
|
11
|
-
import isText from './istext.js';
|
|
12
|
-
import getPositionedAncestor from './getpositionedancestor.js';
|
|
13
|
-
import global from './global.js';
|
|
8
|
+
import { isRange } from './isrange.js';
|
|
9
|
+
import { isWindow } from './iswindow.js';
|
|
10
|
+
import { getBorderWidths } from './getborderwidths.js';
|
|
11
|
+
import { isText } from './istext.js';
|
|
12
|
+
import { getPositionedAncestor } from './getpositionedancestor.js';
|
|
13
|
+
import { global } from './global.js';
|
|
14
14
|
const rectProperties = ['top', 'right', 'bottom', 'left', 'width', 'height'];
|
|
15
15
|
/**
|
|
16
16
|
* A helper class representing a `ClientRect` object, e.g. value returned by
|
|
17
17
|
* the native `object.getBoundingClientRect()` method. Provides a set of methods
|
|
18
18
|
* to manipulate the rect and compare it against other rect instances.
|
|
19
19
|
*/
|
|
20
|
-
export
|
|
20
|
+
export class Rect {
|
|
21
21
|
/**
|
|
22
22
|
* The "top" value of the rect.
|
|
23
23
|
*
|
package/src/dom/remove.d.ts
CHANGED
package/src/dom/remove.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* It uses the [native DOM resize observer](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver)
|
|
19
19
|
* under the hood.
|
|
20
20
|
*/
|
|
21
|
-
export
|
|
21
|
+
export declare class ResizeObserver {
|
|
22
22
|
/**
|
|
23
23
|
* The element observed by this observer.
|
|
24
24
|
*/
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module utils/dom/resizeobserver
|
|
7
7
|
*/
|
|
8
|
-
import global from './global.js';
|
|
8
|
+
import { global } from './global.js';
|
|
9
9
|
/**
|
|
10
10
|
* A helper class which instances allow performing custom actions when native DOM elements are resized.
|
|
11
11
|
*
|
|
@@ -132,4 +132,4 @@ class ResizeObserver {
|
|
|
132
132
|
});
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
|
-
export
|
|
135
|
+
export { ResizeObserver };
|
package/src/dom/scroll.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
|
-
type IfTrue<T> = T extends true ? true : never;
|
|
5
|
+
export type IfTrue<T> = T extends true ? true : never;
|
|
6
6
|
/**
|
|
7
7
|
* Makes any page `HTMLElement` or `Range` (`target`) visible inside the browser viewport.
|
|
8
8
|
* This helper will scroll all `target` ancestors and the web browser viewport to reveal the target to
|
|
@@ -70,4 +70,3 @@ export declare function scrollViewportToShowTarget<T extends boolean, U extends
|
|
|
70
70
|
* scrolling the whole page.
|
|
71
71
|
*/
|
|
72
72
|
export declare function scrollAncestorsToShowTarget(target: HTMLElement | Range, ancestorOffset?: number, limiterElement?: HTMLElement): void;
|
|
73
|
-
export {};
|
package/src/dom/scroll.js
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module utils/dom/scroll
|
|
7
7
|
*/
|
|
8
|
-
import isRange from './isrange.js';
|
|
9
|
-
import Rect from './rect.js';
|
|
10
|
-
import isText from './istext.js';
|
|
8
|
+
import { isRange } from './isrange.js';
|
|
9
|
+
import { Rect } from './rect.js';
|
|
10
|
+
import { isText } from './istext.js';
|
|
11
11
|
/**
|
|
12
12
|
* Makes any page `HTMLElement` or `Range` (`target`) visible inside the browser viewport.
|
|
13
13
|
* This helper will scroll all `target` ancestors and the web browser viewport to reveal the target to
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* @param el The element in which the data will be set.
|
|
12
12
|
* @param data The data string.
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export function setDataInElement(el, data) {
|
|
15
15
|
if (el instanceof HTMLTextAreaElement) {
|
|
16
16
|
el.value = data;
|
|
17
17
|
}
|
package/src/dom/tounit.d.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @param unit An unit like "px" or "em".
|
|
13
13
|
*/
|
|
14
|
-
export
|
|
14
|
+
export declare function toUnit(unit: string): ToUnitHelper;
|
|
15
15
|
/**
|
|
16
16
|
* A function, which adds a pre–defined trailing `unit`
|
|
17
17
|
* to the passed `value`.
|
package/src/dom/tounit.js
CHANGED
package/src/elementreplacer.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Utility class allowing to hide existing HTML elements or replace them with given ones in a way that doesn't remove
|
|
10
10
|
* the original elements from the DOM.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export declare class ElementReplacer {
|
|
13
13
|
/**
|
|
14
14
|
* The elements replaced by {@link #replace} and their replacements.
|
|
15
15
|
*/
|
package/src/elementreplacer.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Utility class allowing to hide existing HTML elements or replace them with given ones in a way that doesn't remove
|
|
10
10
|
* the original elements from the DOM.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export class ElementReplacer {
|
|
13
13
|
/**
|
|
14
14
|
* The elements replaced by {@link #replace} and their replacements.
|
|
15
15
|
*/
|
package/src/emittermixin.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module utils/emittermixin
|
|
7
7
|
*/
|
|
8
|
-
import EventInfo from './eventinfo.js';
|
|
8
|
+
import { EventInfo } from './eventinfo.js';
|
|
9
9
|
import { type PriorityString } from './priorities.js';
|
|
10
10
|
import type { Constructor, Mixed } from './mix.js';
|
|
11
11
|
import './version.js';
|
|
@@ -29,7 +29,7 @@ import './version.js';
|
|
|
29
29
|
*
|
|
30
30
|
* @label EXTENDS
|
|
31
31
|
*/
|
|
32
|
-
export
|
|
32
|
+
export declare function EmitterMixin<Base extends Constructor>(base: Base): Mixed<Base, Emitter>;
|
|
33
33
|
/**
|
|
34
34
|
* Mixin that injects the {@link ~Emitter events API} into its host.
|
|
35
35
|
*
|
|
@@ -48,7 +48,7 @@ export default function EmitterMixin<Base extends Constructor>(base: Base): Mixe
|
|
|
48
48
|
*
|
|
49
49
|
* @label NO_ARGUMENTS
|
|
50
50
|
*/
|
|
51
|
-
export
|
|
51
|
+
export declare function EmitterMixin(): {
|
|
52
52
|
new (): Emitter;
|
|
53
53
|
prototype: Emitter;
|
|
54
54
|
};
|
package/src/emittermixin.js
CHANGED
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module utils/emittermixin
|
|
7
7
|
*/
|
|
8
|
-
import EventInfo from './eventinfo.js';
|
|
9
|
-
import uid from './uid.js';
|
|
10
|
-
import priorities from './priorities.js';
|
|
11
|
-
import insertToPriorityArray from './inserttopriorityarray.js';
|
|
8
|
+
import { EventInfo } from './eventinfo.js';
|
|
9
|
+
import { uid } from './uid.js';
|
|
10
|
+
import { priorities } from './priorities.js';
|
|
11
|
+
import { insertToPriorityArray } from './inserttopriorityarray.js';
|
|
12
12
|
// To check if component is loaded more than once.
|
|
13
13
|
import './version.js';
|
|
14
|
-
import CKEditorError from './ckeditorerror.js';
|
|
14
|
+
import { CKEditorError } from './ckeditorerror.js';
|
|
15
15
|
const _listeningTo = Symbol('listeningTo');
|
|
16
16
|
const _emitterId = Symbol('emitterId');
|
|
17
17
|
const _delegations = Symbol('delegations');
|
|
18
18
|
const defaultEmitterClass = /* #__PURE__ */ EmitterMixin(Object);
|
|
19
|
-
export
|
|
19
|
+
export function EmitterMixin(base) {
|
|
20
20
|
if (!base) {
|
|
21
21
|
return defaultEmitterClass;
|
|
22
22
|
}
|
|
@@ -241,14 +241,6 @@ export default function EmitterMixin(base) {
|
|
|
241
241
|
}
|
|
242
242
|
return Mixin;
|
|
243
243
|
}
|
|
244
|
-
// Backward compatibility with `mix`
|
|
245
|
-
([
|
|
246
|
-
'on', 'once', 'off', 'listenTo',
|
|
247
|
-
'stopListening', 'fire', 'delegate', 'stopDelegating',
|
|
248
|
-
'_addEventListener', '_removeEventListener'
|
|
249
|
-
]).forEach(key => {
|
|
250
|
-
EmitterMixin[key] = defaultEmitterClass.prototype[key];
|
|
251
|
-
});
|
|
252
244
|
/**
|
|
253
245
|
* Checks if `listeningEmitter` listens to an emitter with given `listenedToEmitterId` and if so, returns that emitter.
|
|
254
246
|
* If not, returns `null`.
|