@ckeditor/ckeditor5-utils 44.0.0 → 44.1.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 (207) hide show
  1. package/dist/abortabledebounce.d.ts +1 -1
  2. package/dist/areconnectedthroughproperties.d.ts +1 -1
  3. package/dist/ckeditorerror.d.ts +1 -1
  4. package/dist/collection.d.ts +1 -1
  5. package/dist/comparearrays.d.ts +1 -1
  6. package/dist/config.d.ts +1 -1
  7. package/dist/count.d.ts +1 -1
  8. package/dist/crc32.d.ts +1 -1
  9. package/dist/delay.d.ts +1 -1
  10. package/dist/diff.d.ts +1 -1
  11. package/dist/difftochanges.d.ts +1 -1
  12. package/dist/dom/createelement.d.ts +1 -1
  13. package/dist/dom/emittermixin.d.ts +1 -1
  14. package/dist/dom/findclosestscrollableancestor.d.ts +1 -1
  15. package/dist/dom/getancestors.d.ts +1 -1
  16. package/dist/dom/getborderwidths.d.ts +1 -1
  17. package/dist/dom/getcommonancestor.d.ts +1 -1
  18. package/dist/dom/getdatafromelement.d.ts +1 -1
  19. package/dist/dom/getpositionedancestor.d.ts +1 -1
  20. package/dist/dom/getrangefrommouseevent.d.ts +1 -1
  21. package/dist/dom/global.d.ts +1 -1
  22. package/dist/dom/indexof.d.ts +1 -1
  23. package/dist/dom/insertat.d.ts +1 -1
  24. package/dist/dom/iscomment.d.ts +1 -1
  25. package/dist/dom/isnode.d.ts +1 -1
  26. package/dist/dom/isrange.d.ts +1 -1
  27. package/dist/dom/istext.d.ts +1 -1
  28. package/dist/dom/isvalidattributename.d.ts +1 -1
  29. package/dist/dom/isvisible.d.ts +1 -1
  30. package/dist/dom/iswindow.d.ts +1 -1
  31. package/dist/dom/position.d.ts +1 -1
  32. package/dist/dom/rect.d.ts +1 -1
  33. package/dist/dom/remove.d.ts +1 -1
  34. package/dist/dom/resizeobserver.d.ts +1 -1
  35. package/dist/dom/scroll.d.ts +1 -1
  36. package/dist/dom/setdatainelement.d.ts +1 -1
  37. package/dist/dom/tounit.d.ts +1 -1
  38. package/dist/elementreplacer.d.ts +1 -1
  39. package/dist/emittermixin.d.ts +1 -1
  40. package/dist/env.d.ts +1 -1
  41. package/dist/eventinfo.d.ts +1 -1
  42. package/dist/fastdiff.d.ts +1 -1
  43. package/dist/first.d.ts +1 -1
  44. package/dist/focustracker.d.ts +1 -1
  45. package/dist/index.d.ts +1 -1
  46. package/dist/index.js +73 -78
  47. package/dist/index.js.map +1 -1
  48. package/dist/inserttopriorityarray.d.ts +1 -1
  49. package/dist/isiterable.d.ts +1 -1
  50. package/dist/keyboard.d.ts +1 -1
  51. package/dist/keystrokehandler.d.ts +1 -1
  52. package/dist/language.d.ts +1 -1
  53. package/dist/locale.d.ts +1 -1
  54. package/dist/mapsequal.d.ts +1 -1
  55. package/dist/mix.d.ts +1 -1
  56. package/dist/nth.d.ts +1 -1
  57. package/dist/objecttomap.d.ts +1 -1
  58. package/dist/observablemixin.d.ts +1 -1
  59. package/dist/parsebase64encodedobject.d.ts +1 -1
  60. package/dist/priorities.d.ts +1 -1
  61. package/dist/retry.d.ts +1 -1
  62. package/dist/splicearray.d.ts +12 -11
  63. package/dist/spy.d.ts +1 -1
  64. package/dist/toarray.d.ts +1 -1
  65. package/dist/tomap.d.ts +1 -1
  66. package/dist/translation-service.d.ts +1 -1
  67. package/dist/uid.d.ts +1 -1
  68. package/dist/unicode.d.ts +1 -1
  69. package/dist/version.d.ts +2 -2
  70. package/dist/wait.d.ts +1 -1
  71. package/package.json +2 -2
  72. package/src/abortabledebounce.d.ts +1 -1
  73. package/src/abortabledebounce.js +1 -1
  74. package/src/areconnectedthroughproperties.d.ts +1 -1
  75. package/src/areconnectedthroughproperties.js +1 -1
  76. package/src/ckeditorerror.d.ts +1 -1
  77. package/src/ckeditorerror.js +1 -1
  78. package/src/collection.d.ts +1 -1
  79. package/src/collection.js +1 -1
  80. package/src/comparearrays.d.ts +1 -1
  81. package/src/comparearrays.js +1 -1
  82. package/src/config.d.ts +1 -1
  83. package/src/config.js +1 -1
  84. package/src/count.d.ts +1 -1
  85. package/src/count.js +1 -1
  86. package/src/crc32.d.ts +1 -1
  87. package/src/crc32.js +1 -1
  88. package/src/delay.d.ts +1 -1
  89. package/src/delay.js +1 -1
  90. package/src/diff.d.ts +1 -1
  91. package/src/diff.js +1 -1
  92. package/src/difftochanges.d.ts +1 -1
  93. package/src/difftochanges.js +1 -1
  94. package/src/dom/createelement.d.ts +1 -1
  95. package/src/dom/createelement.js +1 -1
  96. package/src/dom/emittermixin.d.ts +1 -1
  97. package/src/dom/emittermixin.js +1 -1
  98. package/src/dom/findclosestscrollableancestor.d.ts +1 -1
  99. package/src/dom/findclosestscrollableancestor.js +1 -1
  100. package/src/dom/getancestors.d.ts +1 -1
  101. package/src/dom/getancestors.js +1 -1
  102. package/src/dom/getborderwidths.d.ts +1 -1
  103. package/src/dom/getborderwidths.js +1 -1
  104. package/src/dom/getcommonancestor.d.ts +1 -1
  105. package/src/dom/getcommonancestor.js +1 -1
  106. package/src/dom/getdatafromelement.d.ts +1 -1
  107. package/src/dom/getdatafromelement.js +1 -1
  108. package/src/dom/getpositionedancestor.d.ts +1 -1
  109. package/src/dom/getpositionedancestor.js +1 -1
  110. package/src/dom/getrangefrommouseevent.d.ts +1 -1
  111. package/src/dom/getrangefrommouseevent.js +1 -1
  112. package/src/dom/global.d.ts +1 -1
  113. package/src/dom/global.js +1 -1
  114. package/src/dom/indexof.d.ts +1 -1
  115. package/src/dom/indexof.js +1 -1
  116. package/src/dom/insertat.d.ts +1 -1
  117. package/src/dom/insertat.js +1 -1
  118. package/src/dom/iscomment.d.ts +1 -1
  119. package/src/dom/iscomment.js +1 -1
  120. package/src/dom/isnode.d.ts +1 -1
  121. package/src/dom/isnode.js +1 -1
  122. package/src/dom/isrange.d.ts +1 -1
  123. package/src/dom/isrange.js +1 -1
  124. package/src/dom/istext.d.ts +1 -1
  125. package/src/dom/istext.js +1 -1
  126. package/src/dom/isvalidattributename.d.ts +1 -1
  127. package/src/dom/isvalidattributename.js +1 -1
  128. package/src/dom/isvisible.d.ts +1 -1
  129. package/src/dom/isvisible.js +1 -1
  130. package/src/dom/iswindow.d.ts +1 -1
  131. package/src/dom/iswindow.js +1 -1
  132. package/src/dom/position.d.ts +1 -1
  133. package/src/dom/position.js +1 -1
  134. package/src/dom/rect.d.ts +1 -1
  135. package/src/dom/rect.js +1 -1
  136. package/src/dom/remove.d.ts +1 -1
  137. package/src/dom/remove.js +1 -1
  138. package/src/dom/resizeobserver.d.ts +1 -1
  139. package/src/dom/resizeobserver.js +1 -1
  140. package/src/dom/scroll.d.ts +1 -1
  141. package/src/dom/scroll.js +1 -1
  142. package/src/dom/setdatainelement.d.ts +1 -1
  143. package/src/dom/setdatainelement.js +1 -1
  144. package/src/dom/tounit.d.ts +1 -1
  145. package/src/dom/tounit.js +1 -1
  146. package/src/elementreplacer.d.ts +1 -1
  147. package/src/elementreplacer.js +1 -1
  148. package/src/emittermixin.d.ts +1 -1
  149. package/src/emittermixin.js +17 -19
  150. package/src/env.d.ts +1 -1
  151. package/src/env.js +1 -1
  152. package/src/eventinfo.d.ts +1 -1
  153. package/src/eventinfo.js +1 -1
  154. package/src/fastdiff.d.ts +1 -1
  155. package/src/fastdiff.js +1 -1
  156. package/src/first.d.ts +1 -1
  157. package/src/first.js +1 -1
  158. package/src/focustracker.d.ts +1 -1
  159. package/src/focustracker.js +1 -1
  160. package/src/index.d.ts +1 -1
  161. package/src/index.js +1 -1
  162. package/src/inserttopriorityarray.d.ts +1 -1
  163. package/src/inserttopriorityarray.js +1 -1
  164. package/src/isiterable.d.ts +1 -1
  165. package/src/isiterable.js +1 -1
  166. package/src/keyboard.d.ts +1 -1
  167. package/src/keyboard.js +1 -1
  168. package/src/keystrokehandler.d.ts +1 -1
  169. package/src/keystrokehandler.js +1 -1
  170. package/src/language.d.ts +1 -1
  171. package/src/language.js +1 -1
  172. package/src/locale.d.ts +1 -1
  173. package/src/locale.js +1 -1
  174. package/src/mapsequal.d.ts +1 -1
  175. package/src/mapsequal.js +1 -1
  176. package/src/mix.d.ts +1 -1
  177. package/src/mix.js +1 -1
  178. package/src/nth.d.ts +1 -1
  179. package/src/nth.js +1 -1
  180. package/src/objecttomap.d.ts +1 -1
  181. package/src/objecttomap.js +1 -1
  182. package/src/observablemixin.d.ts +1 -1
  183. package/src/observablemixin.js +1 -1
  184. package/src/parsebase64encodedobject.d.ts +1 -1
  185. package/src/parsebase64encodedobject.js +1 -1
  186. package/src/priorities.d.ts +1 -1
  187. package/src/priorities.js +1 -1
  188. package/src/retry.d.ts +1 -1
  189. package/src/retry.js +1 -1
  190. package/src/splicearray.d.ts +12 -11
  191. package/src/splicearray.js +17 -19
  192. package/src/spy.d.ts +1 -1
  193. package/src/spy.js +1 -1
  194. package/src/toarray.d.ts +1 -1
  195. package/src/toarray.js +1 -1
  196. package/src/tomap.d.ts +1 -1
  197. package/src/tomap.js +1 -1
  198. package/src/translation-service.d.ts +1 -1
  199. package/src/translation-service.js +1 -1
  200. package/src/uid.d.ts +1 -1
  201. package/src/uid.js +1 -1
  202. package/src/unicode.d.ts +1 -1
  203. package/src/unicode.js +1 -1
  204. package/src/version.d.ts +2 -2
  205. package/src/version.js +3 -3
  206. package/src/wait.d.ts +1 -1
  207. package/src/wait.js +1 -1
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { isObject, isString, isPlainObject, cloneDeepWith, isElement as isElemen
6
6
 
7
7
  /**
8
8
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
9
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
9
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
10
10
  */ /* globals window, document */ /**
11
11
  * @module utils/dom/global
12
12
  */ // This interface exists to make our API pages more readable.
@@ -171,7 +171,7 @@ const userAgent = /* #__PURE__ */ getUserAgent();
171
171
 
172
172
  /**
173
173
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
174
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
174
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
175
175
  */ /**
176
176
  * @module utils/fastdiff
177
177
  */ /**
@@ -524,7 +524,7 @@ diff.fastDiff = fastDiff;
524
524
 
525
525
  /**
526
526
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
527
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
527
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
528
528
  */ /**
529
529
  * @module utils/difftochanges
530
530
  */ /**
@@ -599,7 +599,7 @@ diff.fastDiff = fastDiff;
599
599
 
600
600
  /**
601
601
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
602
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
602
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
603
603
  */ /**
604
604
  * @module utils/mix
605
605
  */ /**
@@ -647,7 +647,7 @@ diff.fastDiff = fastDiff;
647
647
 
648
648
  /**
649
649
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
650
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
650
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
651
651
  */ /**
652
652
  * @module utils/spy
653
653
  */ /**
@@ -714,7 +714,7 @@ diff.fastDiff = fastDiff;
714
714
 
715
715
  /**
716
716
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
717
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
717
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
718
718
  */ /**
719
719
  * @module utils/uid
720
720
  */ /**
@@ -739,7 +739,7 @@ diff.fastDiff = fastDiff;
739
739
 
740
740
  /**
741
741
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
742
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
742
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
743
743
  */ /**
744
744
  * @module utils/priorities
745
745
  */ /**
@@ -785,7 +785,7 @@ diff.fastDiff = fastDiff;
785
785
 
786
786
  /**
787
787
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
788
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
788
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
789
789
  */ /**
790
790
  * @module utils/ckeditorerror
791
791
  */ /* globals console */ /**
@@ -959,9 +959,9 @@ diff.fastDiff = fastDiff;
959
959
  ];
960
960
  }
961
961
 
962
- const version = '44.0.0';
962
+ const version = '44.1.0-alpha.1';
963
963
  // The second argument is not a month. It is `monthIndex` and starts from `0`.
964
- const releaseDate = new Date(2024, 11, 2);
964
+ const releaseDate = new Date(2024, 11, 12);
965
965
  /* istanbul ignore next -- @preserve */ if (globalThis.CKEDITOR_VERSION) {
966
966
  /**
967
967
  * This error is thrown when, due to a mistake in the way CKEditor 5 was installed,
@@ -1242,24 +1242,20 @@ function EmitterMixin(base) {
1242
1242
  eventInfo.path.push(this);
1243
1243
  // Handle event listener callbacks first.
1244
1244
  if (callbacks) {
1245
- // Arguments passed to each callback.
1246
- const callbackArgs = [
1247
- eventInfo,
1248
- ...args
1249
- ];
1250
1245
  // Copying callbacks array is the easiest and most secure way of preventing infinite loops, when event callbacks
1251
1246
  // are added while processing other callbacks. Previous solution involved adding counters (unique ids) but
1252
1247
  // failed if callbacks were added to the queue before currently processed callback.
1253
1248
  // If this proves to be too inefficient, another method is to change `.on()` so callbacks are stored if same
1254
1249
  // event is currently processed. Then, `.fire()` at the end, would have to add all stored events.
1255
- callbacks = Array.from(callbacks);
1250
+ callbacks = callbacks.slice();
1256
1251
  for(let i = 0; i < callbacks.length; i++){
1257
- callbacks[i].callback.apply(this, callbackArgs);
1252
+ const fn = callbacks[i].callback;
1253
+ fn.call(this, eventInfo, ...args);
1258
1254
  // Remove the callback from future requests if off() has been called.
1259
1255
  if (eventInfo.off.called) {
1260
1256
  // Remove the called mark for the next calls.
1261
1257
  delete eventInfo.off.called;
1262
- this._removeEventListener(event, callbacks[i].callback);
1258
+ this._removeEventListener(event, fn);
1263
1259
  }
1264
1260
  // Do not execute next callbacks if stop() was called.
1265
1261
  if (eventInfo.stop.called) {
@@ -1499,19 +1495,19 @@ function EmitterMixin(base) {
1499
1495
  * If there are no callbacks registered for given event, it checks if this is a specific event and looks
1500
1496
  * for callbacks for it's more generic version.
1501
1497
  */ function getCallbacksForEvent(source, eventName) {
1502
- let event;
1503
- if (!source._events || !(event = source._events[eventName]) || !event.callbacks.length) {
1504
- // There are no callbacks registered for specified eventName.
1505
- // But this could be a specific-type event that is in a namespace.
1506
- if (eventName.indexOf(':') > -1) {
1507
- // If the eventName is specific, try to find callback lists for more generic event.
1508
- return getCallbacksForEvent(source, eventName.substr(0, eventName.lastIndexOf(':')));
1509
- } else {
1510
- // If this is a top-level generic event, return null;
1511
- return null;
1512
- }
1498
+ if (!source._events) {
1499
+ return null;
1513
1500
  }
1514
- return event.callbacks;
1501
+ let currentEventName = eventName;
1502
+ do {
1503
+ const event = source._events[currentEventName];
1504
+ if (event && event.callbacks && event.callbacks.length) {
1505
+ return event.callbacks;
1506
+ }
1507
+ const colonIndex = currentEventName.lastIndexOf(':');
1508
+ currentEventName = colonIndex > -1 ? currentEventName.substring(0, colonIndex) : '';
1509
+ }while (currentEventName)
1510
+ return null;
1515
1511
  }
1516
1512
  /**
1517
1513
  * Fires delegated events for given map of destinations.
@@ -2132,7 +2128,7 @@ function initObservable(observable) {
2132
2128
 
2133
2129
  /**
2134
2130
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2135
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
2131
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2136
2132
  */ /**
2137
2133
  * @module utils/elementreplacer
2138
2134
  */ /**
@@ -2177,7 +2173,7 @@ function initObservable(observable) {
2177
2173
 
2178
2174
  /**
2179
2175
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2180
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
2176
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2181
2177
  */ /**
2182
2178
  * @module utils/abortabledebounce
2183
2179
  */ /**
@@ -2197,7 +2193,7 @@ function initObservable(observable) {
2197
2193
 
2198
2194
  /**
2199
2195
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2200
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
2196
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2201
2197
  */ /**
2202
2198
  * @module utils/count
2203
2199
  */ /**
@@ -2220,7 +2216,7 @@ function initObservable(observable) {
2220
2216
 
2221
2217
  /**
2222
2218
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2223
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
2219
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2224
2220
  */ /**
2225
2221
  * @module utils/comparearrays
2226
2222
  */ /**
@@ -2263,7 +2259,7 @@ function initObservable(observable) {
2263
2259
 
2264
2260
  /**
2265
2261
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2266
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
2262
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2267
2263
  */ /**
2268
2264
  * @module utils/isiterable
2269
2265
  */ /**
@@ -2460,7 +2456,7 @@ function initObservable(observable) {
2460
2456
 
2461
2457
  /**
2462
2458
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2463
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
2459
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2464
2460
  */ /**
2465
2461
  * @module utils/dom/isnode
2466
2462
  */ /**
@@ -2478,7 +2474,7 @@ function initObservable(observable) {
2478
2474
 
2479
2475
  /**
2480
2476
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2481
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
2477
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2482
2478
  */ /**
2483
2479
  * @module utils/dom/iswindow
2484
2480
  */ /**
@@ -2762,7 +2758,7 @@ function DomEmitterMixin(base) {
2762
2758
 
2763
2759
  /**
2764
2760
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2765
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
2761
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2766
2762
  */ /* globals Node */ /**
2767
2763
  * @module utils/dom/getancestors
2768
2764
  */ /**
@@ -2786,7 +2782,7 @@ function DomEmitterMixin(base) {
2786
2782
 
2787
2783
  /**
2788
2784
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2789
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
2785
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2790
2786
  */ /* globals HTMLTextAreaElement */ /**
2791
2787
  * @module utils/dom/getdatafromelement
2792
2788
  */ /**
@@ -2803,7 +2799,7 @@ function DomEmitterMixin(base) {
2803
2799
 
2804
2800
  /**
2805
2801
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2806
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
2802
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2807
2803
  */ /**
2808
2804
  * @module utils/dom/getborderwidths
2809
2805
  */ /**
@@ -2825,7 +2821,7 @@ function DomEmitterMixin(base) {
2825
2821
 
2826
2822
  /**
2827
2823
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2828
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
2824
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2829
2825
  */ /**
2830
2826
  * @module utils/dom/getrangefrommouseevent
2831
2827
  */ /**
@@ -2854,7 +2850,7 @@ function DomEmitterMixin(base) {
2854
2850
 
2855
2851
  /**
2856
2852
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2857
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
2853
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2858
2854
  */ /**
2859
2855
  * @module utils/dom/istext
2860
2856
  */ /**
@@ -2865,7 +2861,7 @@ function DomEmitterMixin(base) {
2865
2861
 
2866
2862
  /**
2867
2863
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
2868
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
2864
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
2869
2865
  */ /**
2870
2866
  * @module utils/dom/isrange
2871
2867
  */ /**
@@ -3473,7 +3469,7 @@ const rectProperties = [
3473
3469
 
3474
3470
  /**
3475
3471
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3476
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
3472
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
3477
3473
  */ /**
3478
3474
  * @module utils/dom/setdatainelement
3479
3475
  */ /* globals HTMLTextAreaElement */ /**
@@ -3490,7 +3486,7 @@ const rectProperties = [
3490
3486
 
3491
3487
  /**
3492
3488
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3493
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
3489
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
3494
3490
  */ /**
3495
3491
  * @module utils/dom/tounit
3496
3492
  */ /**
@@ -3504,7 +3500,7 @@ const rectProperties = [
3504
3500
 
3505
3501
  /**
3506
3502
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3507
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
3503
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
3508
3504
  */ /**
3509
3505
  * @module utils/dom/indexof
3510
3506
  */ /**
@@ -3523,7 +3519,7 @@ const rectProperties = [
3523
3519
 
3524
3520
  /**
3525
3521
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3526
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
3522
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
3527
3523
  */ /**
3528
3524
  * @module utils/dom/insertat
3529
3525
  */ /**
@@ -3538,7 +3534,7 @@ const rectProperties = [
3538
3534
 
3539
3535
  /**
3540
3536
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3541
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
3537
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
3542
3538
  */ /* globals Node */ /**
3543
3539
  * @module utils/dom/iscomment
3544
3540
  */ /**
@@ -3886,7 +3882,7 @@ const rectProperties = [
3886
3882
 
3887
3883
  /**
3888
3884
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3889
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
3885
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
3890
3886
  */ /**
3891
3887
  * @module utils/dom/remove
3892
3888
  */ /**
@@ -4500,7 +4496,7 @@ function splitKeystrokeText(keystroke) {
4500
4496
 
4501
4497
  /**
4502
4498
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
4503
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4499
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4504
4500
  */ /**
4505
4501
  * @module utils/language
4506
4502
  */ /**
@@ -4530,7 +4526,7 @@ function splitKeystrokeText(keystroke) {
4530
4526
 
4531
4527
  /**
4532
4528
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
4533
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4529
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4534
4530
  */ /**
4535
4531
  * @module utils/toarray
4536
4532
  */ /**
@@ -5350,7 +5346,7 @@ function getNumberOfLanguages(translations) {
5350
5346
 
5351
5347
  /**
5352
5348
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
5353
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
5349
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
5354
5350
  */ /**
5355
5351
  * @module utils/first
5356
5352
  */ /**
@@ -5774,7 +5770,7 @@ function isFocusedView(subTreeRoot, view) {
5774
5770
 
5775
5771
  /**
5776
5772
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
5777
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
5773
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
5778
5774
  */ /**
5779
5775
  * @module utils/objecttomap
5780
5776
  */ /**
@@ -5818,7 +5814,7 @@ function isFocusedView(subTreeRoot, view) {
5818
5814
 
5819
5815
  /**
5820
5816
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
5821
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
5817
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
5822
5818
  */ /**
5823
5819
  * @module utils/wait
5824
5820
  */ /**
@@ -5886,22 +5882,19 @@ function isFocusedView(subTreeRoot, view) {
5886
5882
 
5887
5883
  /**
5888
5884
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
5889
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
5885
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
5890
5886
  */ /**
5891
5887
  * @module utils/splicearray
5892
- */ const BIG_CHUNK_SIZE = 10000;
5893
- /**
5894
- * Splices one array into another. To be used instead of `Array.prototype.splice` as the latter may
5895
- * throw "Maximum call stack size exceeded" when passed huge number of items to insert.
5896
- *
5897
- * Note: in contrary to Array.splice, this function does not modify the original `target`.
5888
+ */ /**
5889
+ * Splices one array into another. To be used instead of `Array.prototype.splice` for better
5890
+ * performance and because the latter may throw "Maximum call stack size exceeded" error when
5891
+ * passing huge number of items to insert.
5898
5892
  *
5899
5893
  * ```ts
5900
- * spliceArray( [ 1, 2 ], [ 3, 4 ], 0, 0 ); // [ 3, 4, 1, 2 ]
5901
- * spliceArray( [ 1, 2 ], [ 3, 4 ], 1, 1 ); // [ 1, 3, 4 ]
5902
- * spliceArray( [ 1, 2 ], [ 3, 4 ], 1, 0 ); // [ 1, 3, 4, 2 ]
5903
- * spliceArray( [ 1, 2 ], [ 3, 4 ], 2, 0 ); // [ 1, 2, 3, 4 ]
5904
- * spliceArray( [ 1, 2 ], [], 0, 1 ); // [ 2 ]
5894
+ * spliceArray( [ 1, 2 ], [ 3, 4 ], 0 ); // [ 3, 4, 1, 2 ]
5895
+ * spliceArray( [ 1, 2 ], [ 3, 4 ], 1 ); // [ 1, 3, 4, 2 ]
5896
+ * spliceArray( [ 1, 2 ], [ 3, 4 ], 2 ); // [ 1, 2, 3, 4 ]
5897
+ * spliceArray( [ 1, 2 ], [], 0 ); // [ 1, 2 ]
5905
5898
  * ```
5906
5899
  *
5907
5900
  * @param target Array to be spliced.
@@ -5910,20 +5903,22 @@ function isFocusedView(subTreeRoot, view) {
5910
5903
  * @param count Number of items.
5911
5904
  *
5912
5905
  * @returns New spliced array.
5913
- */ function spliceArray(target, source, start, count) {
5914
- // In case of performance problems, see: https://github.com/ckeditor/ckeditor5/pull/12429/files#r965850568
5915
- if (Math.max(source.length, target.length) > BIG_CHUNK_SIZE) {
5916
- return target.slice(0, start).concat(source).concat(target.slice(start + count, target.length));
5917
- } else {
5918
- const newTarget = Array.from(target);
5919
- newTarget.splice(start, count, ...source);
5920
- return newTarget;
5906
+ */ function spliceArray(targetArray, insertArray, index) {
5907
+ const originalLength = targetArray.length;
5908
+ const insertLength = insertArray.length;
5909
+ // Shift elements in the target array to make space for insertArray
5910
+ for(let i = originalLength - 1; i >= index; i--){
5911
+ targetArray[i + insertLength] = targetArray[i];
5912
+ }
5913
+ // Copy elements from insertArray into the target array
5914
+ for(let i = 0; i < insertLength; i++){
5915
+ targetArray[index + i] = insertArray[i];
5921
5916
  }
5922
5917
  }
5923
5918
 
5924
5919
  /**
5925
5920
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
5926
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
5921
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
5927
5922
  */ /**
5928
5923
  * @module utils/delay
5929
5924
  */ /* globals setTimeout, clearTimeout */ /**
@@ -5946,7 +5941,7 @@ function isFocusedView(subTreeRoot, view) {
5946
5941
 
5947
5942
  /**
5948
5943
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
5949
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
5944
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
5950
5945
  */ /**
5951
5946
  * @module utils/parsebase64encodedobject
5952
5947
  */ /**
@@ -5965,7 +5960,7 @@ function isFocusedView(subTreeRoot, view) {
5965
5960
 
5966
5961
  /**
5967
5962
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
5968
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
5963
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
5969
5964
  */ /**
5970
5965
  * @module utils/crc32
5971
5966
  */ /**
@@ -6024,7 +6019,7 @@ function isFocusedView(subTreeRoot, view) {
6024
6019
 
6025
6020
  /**
6026
6021
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
6027
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
6022
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
6028
6023
  */ /**
6029
6024
  * Set of utils to handle unicode characters.
6030
6025
  *