@ckeditor/ckeditor5-utils 40.0.0 → 40.1.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 (128) hide show
  1. package/LICENSE.md +3 -3
  2. package/package.json +1 -1
  3. package/src/areconnectedthroughproperties.d.ts +11 -11
  4. package/src/areconnectedthroughproperties.js +73 -73
  5. package/src/ckeditorerror.d.ts +123 -123
  6. package/src/ckeditorerror.js +176 -176
  7. package/src/collection.d.ts +433 -427
  8. package/src/collection.js +583 -575
  9. package/src/comparearrays.d.ts +30 -30
  10. package/src/comparearrays.js +47 -47
  11. package/src/config.d.ts +163 -163
  12. package/src/config.js +163 -162
  13. package/src/count.d.ts +18 -18
  14. package/src/count.js +24 -24
  15. package/src/delay.d.ts +19 -19
  16. package/src/delay.js +26 -26
  17. package/src/diff.d.ts +31 -31
  18. package/src/diff.js +115 -115
  19. package/src/difftochanges.d.ts +59 -59
  20. package/src/difftochanges.js +79 -79
  21. package/src/dom/createelement.d.ts +57 -57
  22. package/src/dom/createelement.js +40 -40
  23. package/src/dom/emittermixin.d.ts +142 -142
  24. package/src/dom/emittermixin.js +239 -239
  25. package/src/dom/findclosestscrollableancestor.d.ts +11 -11
  26. package/src/dom/findclosestscrollableancestor.js +31 -31
  27. package/src/dom/getancestors.d.ts +17 -17
  28. package/src/dom/getancestors.js +27 -27
  29. package/src/dom/getborderwidths.d.ts +24 -24
  30. package/src/dom/getborderwidths.js +24 -24
  31. package/src/dom/getcommonancestor.d.ts +12 -12
  32. package/src/dom/getcommonancestor.js +25 -25
  33. package/src/dom/getdatafromelement.d.ts +14 -14
  34. package/src/dom/getdatafromelement.js +20 -20
  35. package/src/dom/getpositionedancestor.d.ts +10 -10
  36. package/src/dom/getpositionedancestor.js +22 -22
  37. package/src/dom/global.d.ts +32 -32
  38. package/src/dom/global.js +35 -35
  39. package/src/dom/indexof.d.ts +14 -14
  40. package/src/dom/indexof.js +21 -21
  41. package/src/dom/insertat.d.ts +15 -15
  42. package/src/dom/insertat.js +17 -17
  43. package/src/dom/iscomment.d.ts +11 -11
  44. package/src/dom/iscomment.js +14 -14
  45. package/src/dom/isnode.d.ts +11 -11
  46. package/src/dom/isnode.js +21 -21
  47. package/src/dom/isrange.d.ts +11 -11
  48. package/src/dom/isrange.js +13 -13
  49. package/src/dom/istext.d.ts +11 -11
  50. package/src/dom/istext.js +13 -13
  51. package/src/dom/isvalidattributename.d.ts +10 -10
  52. package/src/dom/isvalidattributename.js +22 -22
  53. package/src/dom/isvisible.d.ts +18 -18
  54. package/src/dom/isvisible.js +20 -20
  55. package/src/dom/iswindow.d.ts +11 -11
  56. package/src/dom/iswindow.js +22 -22
  57. package/src/dom/position.d.ts +211 -211
  58. package/src/dom/position.js +313 -313
  59. package/src/dom/rect.d.ts +195 -195
  60. package/src/dom/rect.js +474 -474
  61. package/src/dom/remove.d.ts +13 -13
  62. package/src/dom/remove.js +18 -18
  63. package/src/dom/resizeobserver.d.ts +74 -74
  64. package/src/dom/resizeobserver.js +126 -126
  65. package/src/dom/scroll.d.ts +73 -73
  66. package/src/dom/scroll.js +383 -383
  67. package/src/dom/setdatainelement.d.ts +14 -14
  68. package/src/dom/setdatainelement.js +20 -20
  69. package/src/dom/tounit.d.ts +22 -22
  70. package/src/dom/tounit.js +16 -16
  71. package/src/elementreplacer.d.ts +31 -31
  72. package/src/elementreplacer.js +43 -43
  73. package/src/emittermixin.d.ts +312 -312
  74. package/src/emittermixin.js +453 -453
  75. package/src/env.d.ts +117 -117
  76. package/src/env.js +122 -122
  77. package/src/eventinfo.d.ts +58 -58
  78. package/src/eventinfo.js +26 -26
  79. package/src/fastdiff.d.ts +112 -112
  80. package/src/fastdiff.js +248 -248
  81. package/src/first.d.ts +11 -11
  82. package/src/first.js +17 -17
  83. package/src/focustracker.d.ts +75 -75
  84. package/src/focustracker.js +95 -95
  85. package/src/index.d.ts +61 -61
  86. package/src/index.js +60 -60
  87. package/src/inserttopriorityarray.d.ts +30 -30
  88. package/src/inserttopriorityarray.js +21 -21
  89. package/src/isiterable.d.ts +14 -14
  90. package/src/isiterable.js +16 -16
  91. package/src/keyboard.d.ts +126 -126
  92. package/src/keyboard.js +221 -221
  93. package/src/keystrokehandler.d.ts +87 -87
  94. package/src/keystrokehandler.js +122 -122
  95. package/src/language.d.ts +17 -17
  96. package/src/language.js +19 -19
  97. package/src/locale.d.ts +120 -120
  98. package/src/locale.js +76 -76
  99. package/src/mapsequal.d.ts +15 -15
  100. package/src/mapsequal.js +27 -27
  101. package/src/mix.d.ts +85 -85
  102. package/src/mix.js +50 -50
  103. package/src/nth.d.ts +16 -16
  104. package/src/nth.js +24 -24
  105. package/src/objecttomap.d.ts +23 -23
  106. package/src/objecttomap.js +27 -27
  107. package/src/observablemixin.d.ts +560 -560
  108. package/src/observablemixin.js +580 -580
  109. package/src/priorities.d.ts +33 -33
  110. package/src/priorities.js +23 -23
  111. package/src/splicearray.d.ts +26 -26
  112. package/src/splicearray.js +40 -40
  113. package/src/spy.d.ts +21 -21
  114. package/src/spy.js +22 -22
  115. package/src/toarray.d.ts +25 -25
  116. package/src/toarray.js +7 -7
  117. package/src/tomap.d.ts +19 -19
  118. package/src/tomap.js +29 -29
  119. package/src/translation-service.d.ts +168 -168
  120. package/src/translation-service.js +198 -198
  121. package/src/uid.d.ts +15 -15
  122. package/src/uid.js +57 -57
  123. package/src/unicode.d.ts +54 -54
  124. package/src/unicode.js +85 -85
  125. package/src/verifylicense.d.ts +15 -15
  126. package/src/verifylicense.js +87 -87
  127. package/src/version.d.ts +10 -10
  128. package/src/version.js +153 -153
@@ -1,14 +1,14 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module utils/dom/setdatainelement
7
- */
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
- */
14
- export default function setDataInElement(el: HTMLElement, data: string): void;
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module utils/dom/setdatainelement
7
+ */
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
+ */
14
+ export default function setDataInElement(el: HTMLElement, data: string): void;
@@ -1,20 +1,20 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module utils/dom/setdatainelement
7
- */
8
- /* globals HTMLTextAreaElement */
9
- /**
10
- * Sets data in a given element.
11
- *
12
- * @param el The element in which the data will be set.
13
- * @param data The data string.
14
- */
15
- export default function setDataInElement(el, data) {
16
- if (el instanceof HTMLTextAreaElement) {
17
- el.value = data;
18
- }
19
- el.innerHTML = data;
20
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module utils/dom/setdatainelement
7
+ */
8
+ /* globals HTMLTextAreaElement */
9
+ /**
10
+ * Sets data in a given element.
11
+ *
12
+ * @param el The element in which the data will be set.
13
+ * @param data The data string.
14
+ */
15
+ export default function setDataInElement(el, data) {
16
+ if (el instanceof HTMLTextAreaElement) {
17
+ el.value = data;
18
+ }
19
+ el.innerHTML = data;
20
+ }
@@ -1,22 +1,22 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module utils/dom/tounit
7
- */
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
- */
14
- export default function toUnit(unit: string): ToUnitHelper;
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
- */
22
- export type ToUnitHelper = (value: string | number) => string;
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module utils/dom/tounit
7
+ */
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
+ */
14
+ export default function toUnit(unit: string): ToUnitHelper;
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
+ */
22
+ export type ToUnitHelper = (value: string | number) => string;
package/src/dom/tounit.js CHANGED
@@ -1,16 +1,16 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module utils/dom/tounit
7
- */
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
- */
14
- export default function toUnit(unit) {
15
- return value => value + unit;
16
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module utils/dom/tounit
7
+ */
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
+ */
14
+ export default function toUnit(unit) {
15
+ return value => value + unit;
16
+ }
@@ -1,31 +1,31 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module utils/elementreplacer
7
- */
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
- */
12
- export default 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;
31
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module utils/elementreplacer
7
+ */
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
+ */
12
+ export default 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;
31
+ }
@@ -1,43 +1,43 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module utils/elementreplacer
7
- */
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
- */
12
- export default class ElementReplacer {
13
- constructor() {
14
- this._replacedElements = [];
15
- }
16
- /**
17
- * Hides the `element` and, if specified, inserts the the given element next to it.
18
- *
19
- * The effect of this method can be reverted by {@link #restore}.
20
- *
21
- * @param element The element to replace.
22
- * @param newElement The replacement element. If not passed, then the `element` will just be hidden.
23
- */
24
- replace(element, newElement) {
25
- this._replacedElements.push({ element, newElement });
26
- element.style.display = 'none';
27
- if (newElement) {
28
- element.parentNode.insertBefore(newElement, element.nextSibling);
29
- }
30
- }
31
- /**
32
- * Restores what {@link #replace} did.
33
- */
34
- restore() {
35
- this._replacedElements.forEach(({ element, newElement }) => {
36
- element.style.display = '';
37
- if (newElement) {
38
- newElement.remove();
39
- }
40
- });
41
- this._replacedElements = [];
42
- }
43
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module utils/elementreplacer
7
+ */
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
+ */
12
+ export default class ElementReplacer {
13
+ constructor() {
14
+ this._replacedElements = [];
15
+ }
16
+ /**
17
+ * Hides the `element` and, if specified, inserts the the given element next to it.
18
+ *
19
+ * The effect of this method can be reverted by {@link #restore}.
20
+ *
21
+ * @param element The element to replace.
22
+ * @param newElement The replacement element. If not passed, then the `element` will just be hidden.
23
+ */
24
+ replace(element, newElement) {
25
+ this._replacedElements.push({ element, newElement });
26
+ element.style.display = 'none';
27
+ if (newElement) {
28
+ element.parentNode.insertBefore(newElement, element.nextSibling);
29
+ }
30
+ }
31
+ /**
32
+ * Restores what {@link #replace} did.
33
+ */
34
+ restore() {
35
+ this._replacedElements.forEach(({ element, newElement }) => {
36
+ element.style.display = '';
37
+ if (newElement) {
38
+ newElement.remove();
39
+ }
40
+ });
41
+ this._replacedElements = [];
42
+ }
43
+ }