@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.
Files changed (143) hide show
  1. package/dist/index.js +191 -158
  2. package/dist/index.js.map +1 -1
  3. package/package.json +3 -3
  4. package/src/abortabledebounce.d.ts +1 -1
  5. package/src/abortabledebounce.js +1 -1
  6. package/src/areconnectedthroughproperties.d.ts +1 -1
  7. package/src/areconnectedthroughproperties.js +1 -1
  8. package/src/ckeditorerror.d.ts +5 -4
  9. package/src/ckeditorerror.js +18 -14
  10. package/src/collection.d.ts +1 -1
  11. package/src/collection.js +5 -5
  12. package/src/collectstylesheets.d.ts +1 -1
  13. package/src/collectstylesheets.js +1 -1
  14. package/src/comparearrays.d.ts +1 -1
  15. package/src/comparearrays.js +1 -1
  16. package/src/config.d.ts +1 -1
  17. package/src/config.js +1 -1
  18. package/src/count.d.ts +1 -1
  19. package/src/count.js +1 -1
  20. package/src/crc32.d.ts +2 -3
  21. package/src/crc32.js +1 -1
  22. package/src/delay.d.ts +1 -1
  23. package/src/delay.js +1 -1
  24. package/src/diff.d.ts +3 -4
  25. package/src/diff.js +2 -2
  26. package/src/difftochanges.d.ts +1 -1
  27. package/src/difftochanges.js +1 -1
  28. package/src/dom/createelement.d.ts +5 -6
  29. package/src/dom/createelement.js +2 -2
  30. package/src/dom/emittermixin.d.ts +5 -5
  31. package/src/dom/emittermixin.js +6 -15
  32. package/src/dom/findclosestscrollableancestor.d.ts +1 -1
  33. package/src/dom/findclosestscrollableancestor.js +2 -2
  34. package/src/dom/getancestors.d.ts +1 -1
  35. package/src/dom/getancestors.js +1 -1
  36. package/src/dom/getborderwidths.d.ts +1 -1
  37. package/src/dom/getborderwidths.js +1 -1
  38. package/src/dom/getcommonancestor.d.ts +1 -1
  39. package/src/dom/getcommonancestor.js +2 -2
  40. package/src/dom/getdatafromelement.d.ts +1 -1
  41. package/src/dom/getdatafromelement.js +1 -1
  42. package/src/dom/getpositionedancestor.d.ts +1 -1
  43. package/src/dom/getpositionedancestor.js +2 -2
  44. package/src/dom/getrangefrommouseevent.d.ts +1 -1
  45. package/src/dom/getrangefrommouseevent.js +1 -1
  46. package/src/dom/getvisualviewportoffset.d.ts +1 -1
  47. package/src/dom/getvisualviewportoffset.js +3 -3
  48. package/src/dom/global.d.ts +2 -2
  49. package/src/dom/global.js +4 -4
  50. package/src/dom/indexof.d.ts +1 -1
  51. package/src/dom/indexof.js +1 -1
  52. package/src/dom/insertat.d.ts +1 -1
  53. package/src/dom/insertat.js +1 -1
  54. package/src/dom/iscomment.d.ts +1 -1
  55. package/src/dom/iscomment.js +1 -1
  56. package/src/dom/isnode.d.ts +1 -1
  57. package/src/dom/isnode.js +1 -1
  58. package/src/dom/isrange.d.ts +1 -1
  59. package/src/dom/isrange.js +1 -1
  60. package/src/dom/istext.d.ts +1 -1
  61. package/src/dom/istext.js +1 -1
  62. package/src/dom/isvalidattributename.d.ts +1 -1
  63. package/src/dom/isvalidattributename.js +2 -2
  64. package/src/dom/isvisible.d.ts +1 -1
  65. package/src/dom/isvisible.js +2 -2
  66. package/src/dom/iswindow.d.ts +1 -1
  67. package/src/dom/iswindow.js +1 -1
  68. package/src/dom/position.d.ts +5 -5
  69. package/src/dom/position.js +3 -3
  70. package/src/dom/rect.d.ts +3 -3
  71. package/src/dom/rect.js +7 -7
  72. package/src/dom/remove.d.ts +1 -1
  73. package/src/dom/remove.js +1 -1
  74. package/src/dom/resizeobserver.d.ts +1 -1
  75. package/src/dom/resizeobserver.js +2 -2
  76. package/src/dom/scroll.d.ts +1 -2
  77. package/src/dom/scroll.js +3 -3
  78. package/src/dom/setdatainelement.d.ts +1 -1
  79. package/src/dom/setdatainelement.js +1 -1
  80. package/src/dom/tounit.d.ts +1 -1
  81. package/src/dom/tounit.js +1 -1
  82. package/src/elementreplacer.d.ts +1 -1
  83. package/src/elementreplacer.js +1 -1
  84. package/src/emittermixin.d.ts +3 -3
  85. package/src/emittermixin.js +6 -14
  86. package/src/env.d.ts +16 -2
  87. package/src/env.js +17 -3
  88. package/src/eventinfo.d.ts +1 -1
  89. package/src/eventinfo.js +2 -2
  90. package/src/fastdiff.d.ts +1 -1
  91. package/src/fastdiff.js +1 -1
  92. package/src/first.d.ts +1 -1
  93. package/src/first.js +1 -1
  94. package/src/focustracker.d.ts +1 -1
  95. package/src/focustracker.js +4 -4
  96. package/src/formathtml.d.ts +1 -1
  97. package/src/formathtml.js +1 -1
  98. package/src/index.d.ts +69 -62
  99. package/src/index.js +68 -61
  100. package/src/inserttopriorityarray.d.ts +1 -1
  101. package/src/inserttopriorityarray.js +2 -2
  102. package/src/isiterable.d.ts +1 -1
  103. package/src/isiterable.js +1 -1
  104. package/src/keyboard.d.ts +2 -2
  105. package/src/keyboard.js +4 -4
  106. package/src/keystrokehandler.d.ts +2 -2
  107. package/src/keystrokehandler.js +3 -3
  108. package/src/legacyerrors.d.ts +5 -0
  109. package/src/legacyerrors.js +18 -0
  110. package/src/locale.d.ts +1 -10
  111. package/src/locale.js +2 -23
  112. package/src/mapsequal.d.ts +1 -1
  113. package/src/mapsequal.js +1 -1
  114. package/src/mix.d.ts +0 -27
  115. package/src/mix.js +1 -46
  116. package/src/nth.d.ts +1 -1
  117. package/src/nth.js +1 -1
  118. package/src/objecttomap.d.ts +1 -1
  119. package/src/objecttomap.js +1 -1
  120. package/src/observablemixin.d.ts +8 -9
  121. package/src/observablemixin.js +3 -12
  122. package/src/parsebase64encodedobject.d.ts +1 -1
  123. package/src/parsebase64encodedobject.js +1 -1
  124. package/src/priorities.d.ts +1 -2
  125. package/src/priorities.js +1 -2
  126. package/src/retry.d.ts +1 -1
  127. package/src/retry.js +2 -2
  128. package/src/splicearray.d.ts +1 -1
  129. package/src/splicearray.js +1 -1
  130. package/src/spy.d.ts +1 -2
  131. package/src/spy.js +1 -2
  132. package/src/toarray.d.ts +2 -2
  133. package/src/toarray.js +1 -1
  134. package/src/tomap.d.ts +1 -1
  135. package/src/tomap.js +3 -3
  136. package/src/translation-service.d.ts +1 -1
  137. package/src/translation-service.js +3 -3
  138. package/src/uid.d.ts +1 -1
  139. package/src/uid.js +1 -1
  140. package/src/version.d.ts +1 -2
  141. package/src/version.js +12 -13
  142. package/src/wait.d.ts +1 -1
  143. 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 default function getPositionedAncestor(element) {
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 default function getRangeFromMouseEvent(domEvent: MouseEvent & {
14
+ export declare function getRangeFromMouseEvent(domEvent: MouseEvent & {
15
15
  rangeParent?: HTMLElement;
16
16
  rangeOffset?: number;
17
17
  }): Range | null;
@@ -11,7 +11,7 @@
11
11
  * @param domEvent The mouse event.
12
12
  * @returns The DOM range.
13
13
  */
14
- export default function getRangeFromMouseEvent(domEvent) {
14
+ export function getRangeFromMouseEvent(domEvent) {
15
15
  if (!domEvent.target) {
16
16
  return null;
17
17
  }
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * Returns the visual viewport offsets to adjust elements with `position: fixed` style.
7
7
  */
8
- export default function getVisualViewportOffset(): {
8
+ export declare function getVisualViewportOffset(): {
9
9
  left: number;
10
10
  top: number;
11
11
  };
@@ -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 default function getVisualViewportOffset() {
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 };
@@ -28,5 +28,5 @@ export interface GlobalType {
28
28
  * console.log( global.window.innerWidth );
29
29
  * ```
30
30
  */
31
- declare let globalVar: GlobalType;
32
- export default globalVar;
31
+ declare let global: GlobalType;
32
+ export { global };
package/src/dom/global.js CHANGED
@@ -18,10 +18,10 @@
18
18
  * console.log( global.window.innerWidth );
19
19
  * ```
20
20
  */
21
- let globalVar; // named globalVar instead of global: https://github.com/ckeditor/ckeditor5/issues/12971
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
- globalVar = { window, document };
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
- globalVar = { window: {}, document: {} };
33
+ global = { window: {}, document: {} };
34
34
  }
35
- export default globalVar;
35
+ export { global };
@@ -11,4 +11,4 @@
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 default function indexOf(node: Node): number;
14
+ export declare function indexOf(node: Node): number;
@@ -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 default function indexOf(node) {
14
+ export function indexOf(node) {
15
15
  let index = 0;
16
16
  while (node.previousSibling) {
17
17
  node = node.previousSibling;
@@ -12,4 +12,4 @@
12
12
  * @param index Insertions index.
13
13
  * @param nodeToInsert Node to insert.
14
14
  */
15
- export default function insertAt(parentElement: Element, index: number, nodeToInsert: Node): void;
15
+ export declare function insertAt(parentElement: Element, index: number, nodeToInsert: Node): void;
@@ -12,6 +12,6 @@
12
12
  * @param index Insertions index.
13
13
  * @param nodeToInsert Node to insert.
14
14
  */
15
- export default function insertAt(parentElement, index, nodeToInsert) {
15
+ export function insertAt(parentElement, index, nodeToInsert) {
16
16
  parentElement.insertBefore(nodeToInsert, parentElement.childNodes[index] || null);
17
17
  }
@@ -8,4 +8,4 @@
8
8
  /**
9
9
  * Checks whether the object is a native DOM Comment node.
10
10
  */
11
- export default function isComment(obj: any): obj is Comment;
11
+ export declare function isComment(obj: any): obj is Comment;
@@ -8,6 +8,6 @@
8
8
  /**
9
9
  * Checks whether the object is a native DOM Comment node.
10
10
  */
11
- export default function isComment(obj) {
11
+ export function isComment(obj) {
12
12
  return obj && obj.nodeType === Node.COMMENT_NODE;
13
13
  }
@@ -8,4 +8,4 @@
8
8
  /**
9
9
  * Checks if the object is a native DOM Node.
10
10
  */
11
- export default function isNode(obj: any): obj is Node;
11
+ export declare function isNode(obj: any): obj is Node;
package/src/dom/isnode.js CHANGED
@@ -8,7 +8,7 @@
8
8
  /**
9
9
  * Checks if the object is a native DOM Node.
10
10
  */
11
- export default function isNode(obj) {
11
+ export function isNode(obj) {
12
12
  if (obj) {
13
13
  if (obj.defaultView) {
14
14
  return obj instanceof obj.defaultView.Document;
@@ -8,4 +8,4 @@
8
8
  /**
9
9
  * Checks if the object is a native DOM Range.
10
10
  */
11
- export default function isRange(obj: unknown): obj is Range;
11
+ export declare function isRange(obj: unknown): obj is Range;
@@ -8,6 +8,6 @@
8
8
  /**
9
9
  * Checks if the object is a native DOM Range.
10
10
  */
11
- export default function isRange(obj) {
11
+ export function isRange(obj) {
12
12
  return Object.prototype.toString.apply(obj) == '[object Range]';
13
13
  }
@@ -8,4 +8,4 @@
8
8
  /**
9
9
  * Checks if the object is a native DOM Text node.
10
10
  */
11
- export default function isText(obj: unknown): obj is Text;
11
+ export declare function isText(obj: unknown): obj is Text;
package/src/dom/istext.js CHANGED
@@ -8,6 +8,6 @@
8
8
  /**
9
9
  * Checks if the object is a native DOM Text node.
10
10
  */
11
- export default function isText(obj) {
11
+ export function isText(obj) {
12
12
  return Object.prototype.toString.call(obj) == '[object Text]';
13
13
  }
@@ -7,4 +7,4 @@
7
7
  *
8
8
  * @param name Attribute name.
9
9
  */
10
- export default function isValidAttributeName(name: string): boolean;
10
+ export declare function isValidAttributeName(name: string): boolean;
@@ -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 default function isValidAttributeName(name) {
14
+ export function isValidAttributeName(name) {
15
15
  try {
16
16
  global.document.createAttribute(name);
17
17
  }
@@ -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 default function isVisible(element: Text | HTMLElement | null | undefined): boolean;
15
+ export declare function isVisible(element: Text | HTMLElement | null | undefined): boolean;
@@ -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 default function isVisible(element) {
19
+ export function isVisible(element) {
20
20
  if (!element) {
21
21
  return false;
22
22
  }
@@ -8,4 +8,4 @@
8
8
  /**
9
9
  * Checks if the object is a native DOM Window.
10
10
  */
11
- export default function isWindow(obj: unknown): obj is Window;
11
+ export declare function isWindow(obj: unknown): obj is Window;
@@ -8,7 +8,7 @@
8
8
  /**
9
9
  * Checks if the object is a native DOM Window.
10
10
  */
11
- export default function isWindow(obj) {
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]') {
@@ -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, { type RectSource } from './rect.js';
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 }: Options): DomPoint | null;
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 Options {
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) => PositioningFunctionResult | null;
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 PositioningFunctionResult {
189
+ export interface DomPositioningFunctionResult {
190
190
  /**
191
191
  * The `top` value of the element rect that would represent the position.
192
192
  */
@@ -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 default class Rect {
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 | RectLike;
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 RectLike {
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 default class Rect {
20
+ export class Rect {
21
21
  /**
22
22
  * The "top" value of the rect.
23
23
  *
@@ -10,4 +10,4 @@
10
10
  *
11
11
  * @param node Node to remove.
12
12
  */
13
- export default function remove(node: Node): void;
13
+ export declare function remove(node: Node): void;
package/src/dom/remove.js CHANGED
@@ -10,7 +10,7 @@
10
10
  *
11
11
  * @param node Node to remove.
12
12
  */
13
- export default function remove(node) {
13
+ export function remove(node) {
14
14
  const parent = node.parentNode;
15
15
  if (parent) {
16
16
  parent.removeChild(node);
@@ -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 default class ResizeObserver {
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 default ResizeObserver;
135
+ export { ResizeObserver };
@@ -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,4 +11,4 @@
11
11
  * @param el The element in which the data will be set.
12
12
  * @param data The data string.
13
13
  */
14
- export default function setDataInElement(el: HTMLElement, data: string): void;
14
+ export declare function setDataInElement(el: HTMLElement, data: string): void;
@@ -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 default function setDataInElement(el, data) {
14
+ export function setDataInElement(el, data) {
15
15
  if (el instanceof HTMLTextAreaElement) {
16
16
  el.value = data;
17
17
  }
@@ -11,7 +11,7 @@
11
11
  *
12
12
  * @param unit An unit like "px" or "em".
13
13
  */
14
- export default function toUnit(unit: string): ToUnitHelper;
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
@@ -11,6 +11,6 @@
11
11
  *
12
12
  * @param unit An unit like "px" or "em".
13
13
  */
14
- export default function toUnit(unit) {
14
+ export function toUnit(unit) {
15
15
  return value => value + unit;
16
16
  }
@@ -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 default class ElementReplacer {
12
+ export declare class ElementReplacer {
13
13
  /**
14
14
  * The elements replaced by {@link #replace} and their replacements.
15
15
  */
@@ -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 default class ElementReplacer {
12
+ export class ElementReplacer {
13
13
  /**
14
14
  * The elements replaced by {@link #replace} and their replacements.
15
15
  */
@@ -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 default function EmitterMixin<Base extends Constructor>(base: Base): Mixed<Base, Emitter>;
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 default function EmitterMixin(): {
51
+ export declare function EmitterMixin(): {
52
52
  new (): Emitter;
53
53
  prototype: Emitter;
54
54
  };
@@ -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 default function EmitterMixin(base) {
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`.