@ckeditor/ckeditor5-utils 31.1.0 → 34.0.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 (61) hide show
  1. package/LICENSE.md +2 -2
  2. package/README.md +2 -1
  3. package/package.json +6 -6
  4. package/src/areconnectedthroughproperties.js +1 -1
  5. package/src/ckeditorerror.js +1 -1
  6. package/src/collection.js +1 -1
  7. package/src/comparearrays.js +1 -1
  8. package/src/config.js +1 -1
  9. package/src/count.js +1 -1
  10. package/src/diff.js +1 -1
  11. package/src/difftochanges.js +1 -1
  12. package/src/dom/createelement.js +1 -1
  13. package/src/dom/emittermixin.js +1 -1
  14. package/src/dom/getancestors.js +1 -1
  15. package/src/dom/getborderwidths.js +1 -1
  16. package/src/dom/getcommonancestor.js +1 -1
  17. package/src/dom/getdatafromelement.js +1 -1
  18. package/src/dom/getpositionedancestor.js +1 -1
  19. package/src/dom/global.js +1 -1
  20. package/src/dom/indexof.js +1 -1
  21. package/src/dom/insertat.js +1 -1
  22. package/src/dom/iscomment.js +20 -0
  23. package/src/dom/isnode.js +1 -1
  24. package/src/dom/isrange.js +1 -1
  25. package/src/dom/istext.js +1 -1
  26. package/src/dom/isvisible.js +25 -0
  27. package/src/dom/iswindow.js +1 -1
  28. package/src/dom/position.js +1 -1
  29. package/src/dom/rect.js +1 -1
  30. package/src/dom/remove.js +1 -1
  31. package/src/dom/resizeobserver.js +1 -1
  32. package/src/dom/scroll.js +1 -1
  33. package/src/dom/setdatainelement.js +1 -1
  34. package/src/dom/tounit.js +1 -1
  35. package/src/elementreplacer.js +1 -1
  36. package/src/emittermixin.js +3 -16
  37. package/src/env.js +1 -1
  38. package/src/eventinfo.js +1 -1
  39. package/src/fastdiff.js +1 -1
  40. package/src/first.js +1 -1
  41. package/src/focustracker.js +1 -1
  42. package/src/index.js +3 -1
  43. package/src/inserttopriorityarray.js +42 -0
  44. package/src/isiterable.js +1 -1
  45. package/src/keyboard.js +1 -1
  46. package/src/keystrokehandler.js +1 -1
  47. package/src/language.js +1 -1
  48. package/src/locale.js +1 -1
  49. package/src/mapsequal.js +1 -1
  50. package/src/mix.js +1 -1
  51. package/src/nth.js +1 -1
  52. package/src/objecttomap.js +1 -1
  53. package/src/observablemixin.js +1 -1
  54. package/src/priorities.js +1 -1
  55. package/src/spy.js +1 -1
  56. package/src/toarray.js +1 -1
  57. package/src/tomap.js +1 -1
  58. package/src/translation-service.js +1 -1
  59. package/src/uid.js +1 -1
  60. package/src/unicode.js +38 -1
  61. package/src/version.js +6 -6
package/LICENSE.md CHANGED
@@ -2,7 +2,7 @@ Software License Agreement
2
2
  ==========================
3
3
 
4
4
  **CKEditor 5 utilities** – https://github.com/ckeditor/ckeditor5-utils <br>
5
- Copyright (c) 2003-2021, [CKSource](http://cksource.com) Frederico Knabben. All rights reserved.
5
+ Copyright (c) 2003-2022, [CKSource](http://cksource.com) Holding sp. z o.o. All rights reserved.
6
6
 
7
7
  Licensed under the terms of [GNU General Public License Version 2 or later](http://www.gnu.org/licenses/gpl.html).
8
8
 
@@ -18,4 +18,4 @@ The following libraries are included in CKEditor under the [MIT license](https:/
18
18
  Trademarks
19
19
  ----------
20
20
 
21
- **CKEditor** is a trademark of [CKSource](http://cksource.com) Frederico Knabben. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
21
+ **CKEditor** is a trademark of [CKSource](http://cksource.com) Holding sp. z o.o. All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
package/README.md CHANGED
@@ -3,7 +3,8 @@ CKEditor 5 utilities
3
3
 
4
4
  [![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-utils.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-utils)
5
5
  [![Coverage Status](https://coveralls.io/repos/github/ckeditor/ckeditor5/badge.svg?branch=master)](https://coveralls.io/github/ckeditor/ckeditor5?branch=master)
6
- [![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://travis-ci.com/ckeditor/ckeditor5)
6
+ [![Build Status](https://travis-ci.com/ckeditor/ckeditor5.svg?branch=master)](https://app.travis-ci.com/github/ckeditor/ckeditor5)
7
+ ![Dependency Status](https://img.shields.io/librariesio/release/npm/@ckeditor/ckeditor5-utils)
7
8
 
8
9
  Various utilities used by CKEditor 5 and its features. This is a sort of CKEditor 5's standard library.
9
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-utils",
3
- "version": "31.1.0",
3
+ "version": "34.0.0",
4
4
  "description": "Miscellaneous utilities used by CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -14,13 +14,13 @@
14
14
  "lodash-es": "^4.17.15"
15
15
  },
16
16
  "devDependencies": {
17
- "@ckeditor/ckeditor5-build-classic": "^31.1.0",
18
- "@ckeditor/ckeditor5-editor-classic": "^31.1.0",
19
- "@ckeditor/ckeditor5-core": "^31.1.0",
20
- "@ckeditor/ckeditor5-engine": "^31.1.0"
17
+ "@ckeditor/ckeditor5-build-classic": "^34.0.0",
18
+ "@ckeditor/ckeditor5-editor-classic": "^34.0.0",
19
+ "@ckeditor/ckeditor5-core": "^34.0.0",
20
+ "@ckeditor/ckeditor5-engine": "^34.0.0"
21
21
  },
22
22
  "engines": {
23
- "node": ">=12.0.0",
23
+ "node": ">=14.0.0",
24
24
  "npm": ">=5.7.1"
25
25
  },
26
26
  "author": "CKSource (http://cksource.com/)",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/collection.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/count.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/diff.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/dom/global.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2022, 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
+ /* globals Node */
7
+
8
+ /**
9
+ * @module utils/dom/iscomment
10
+ */
11
+
12
+ /**
13
+ * Checks whether the object is a native DOM Comment node.
14
+ *
15
+ * @param {*} obj
16
+ * @returns {Boolean}
17
+ */
18
+ export default function isComment( obj ) {
19
+ return obj && obj.nodeType === Node.COMMENT_NODE;
20
+ }
package/src/dom/isnode.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/dom/istext.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2022, 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
+ /**
7
+ * @module utils/dom/isvisible
8
+ */
9
+
10
+ /**
11
+ * Checks whether the element is visible to the user in DOM:
12
+ *
13
+ * * connected to the root of the document,
14
+ * * has no `display: none`,
15
+ * * has no ancestors with `display: none`.
16
+ *
17
+ * **Note**: This helper does not check whether the element is hidden by cropping, overflow, etc..
18
+ * To check that, use {@link module:utils/dom/rect~Rect} instead.
19
+ *
20
+ * @param {HTMLElement|null|undefined} element
21
+ * @returns {Boolean}
22
+ */
23
+ export default function isVisible( element ) {
24
+ return !!( element && element.getClientRects && element.getClientRects().length );
25
+ }
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/dom/rect.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/dom/remove.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/dom/scroll.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/dom/tounit.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -10,6 +10,7 @@
10
10
  import EventInfo from './eventinfo';
11
11
  import uid from './uid';
12
12
  import priorities from './priorities';
13
+ import insertToPriorityArray from './inserttopriorityarray';
13
14
 
14
15
  // To check if component is loaded more than once.
15
16
  import './version';
@@ -298,21 +299,7 @@ const EmitterMixin = {
298
299
  // Add the callback to all callbacks list.
299
300
  for ( const callbacks of lists ) {
300
301
  // Add the callback to the list in the right priority position.
301
- let added = false;
302
-
303
- for ( let i = 0; i < callbacks.length; i++ ) {
304
- if ( callbacks[ i ].priority < priority ) {
305
- callbacks.splice( i, 0, callbackDefinition );
306
- added = true;
307
-
308
- break;
309
- }
310
- }
311
-
312
- // Add at the end, if right place was not found.
313
- if ( !added ) {
314
- callbacks.push( callbackDefinition );
315
- }
302
+ insertToPriorityArray( callbacks, callbackDefinition );
316
303
  }
317
304
  },
318
305
 
package/src/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/eventinfo.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/fastdiff.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/first.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -26,6 +26,8 @@ export { default as Rect } from './dom/rect';
26
26
  export { default as ResizeObserver } from './dom/resizeobserver';
27
27
  export { default as setDataInElement } from './dom/setdatainelement';
28
28
  export { default as toUnit } from './dom/tounit';
29
+ export { default as isVisible } from './dom/isvisible';
30
+ export * from './dom/scroll';
29
31
 
30
32
  export * from './keyboard';
31
33
  export * from './language';
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2022, 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
+ import priorities from './priorities';
7
+
8
+ /**
9
+ * @module utils/inserttopriorityarray
10
+ */
11
+
12
+ /**
13
+ * The priority object descriptor.
14
+ *
15
+ * const objectWithPriority = {
16
+ * priority: 'high'
17
+ * }
18
+ *
19
+ * @typedef {Object} module:utils/inserttopriorityarray~ObjectWithPriority
20
+ *
21
+ * @property {module:utils/priorities~PriorityString|Number} priority Priority of the object.
22
+ */
23
+
24
+ /**
25
+ * Inserts any object with priority at correct index by priority so registered objects are always sorted from highest to lowest priority.
26
+ *
27
+ * @param {Array.<module:utils/inserttopriorityarray~ObjectWithPriority>} objects Array of objects with priority to insert object to.
28
+ * @param {module:utils/inserttopriorityarray~ObjectWithPriority} objectToInsert Object with `priority` property.
29
+ */
30
+ export default function insertToPriorityArray( objects, objectToInsert ) {
31
+ const priority = priorities.get( objectToInsert.priority );
32
+
33
+ for ( let i = 0; i < objects.length; i++ ) {
34
+ if ( priorities.get( objects[ i ].priority ) < priority ) {
35
+ objects.splice( i, 0, objectToInsert );
36
+
37
+ return;
38
+ }
39
+ }
40
+
41
+ objects.push( objectToInsert );
42
+ }
package/src/isiterable.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/keyboard.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/language.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/locale.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/mapsequal.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/mix.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/nth.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/priorities.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/spy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/toarray.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/tomap.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/uid.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
package/src/unicode.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -67,3 +67,40 @@ export function isInsideSurrogatePair( string, offset ) {
67
67
  export function isInsideCombinedSymbol( string, offset ) {
68
68
  return isCombiningMark( string.charAt( offset ) );
69
69
  }
70
+
71
+ const EMOJI_PATTERN = buildEmojiRegexp();
72
+
73
+ /**
74
+ * Checks whether given offset in a string is inside multi-character emoji sequence.
75
+ *
76
+ * @param {String} string String to check.
77
+ * @param {Number} offset Offset to check.
78
+ * @returns {Boolean}
79
+ */
80
+ export function isInsideEmojiSequence( string, offset ) {
81
+ const matches = String( string ).matchAll( EMOJI_PATTERN );
82
+
83
+ return Array.from( matches ).some( match => match.index < offset && offset < match.index + match[ 0 ].length );
84
+ }
85
+
86
+ function buildEmojiRegexp() {
87
+ const parts = [
88
+ // Emoji Tag Sequence (ETS)
89
+ /\p{Emoji}[\u{E0020}-\u{E007E}]+\u{E007F}/u,
90
+
91
+ // Emoji Keycap Sequence
92
+ /\p{Emoji}\u{FE0F}?\u{20E3}/u,
93
+
94
+ // Emoji Presentation Sequence
95
+ /\p{Emoji}\u{FE0F}/u,
96
+
97
+ // Single-Character Emoji / Emoji Modifier Sequence
98
+ /(?=\p{General_Category=Other_Symbol})\p{Emoji}\p{Emoji_Modifier}*/u
99
+ ];
100
+
101
+ const flagSequence = /\p{Regional_Indicator}{2}/u.source;
102
+ const emoji = '(?:' + parts.map( part => part.source ).join( '|' ) + ')';
103
+ const sequence = `${ flagSequence }|${ emoji }(?:\u{200D}${ emoji })*`;
104
+
105
+ return new RegExp( sequence, 'ug' );
106
+ }
package/src/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * @license Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
5
 
@@ -11,7 +11,7 @@
11
11
 
12
12
  import CKEditorError from './ckeditorerror';
13
13
 
14
- const version = '31.1.0';
14
+ const version = '34.0.0';
15
15
 
16
16
  export default version;
17
17
 
@@ -49,14 +49,14 @@ if ( windowOrGlobal.CKEDITOR_VERSION ) {
49
49
  * Adding plugins to a build is done by taking the source version of this build (so, before it was built with webpack)
50
50
  * and adding plugins there. In this situation, webpack will know that it only needs to load each plugin once.
51
51
  *
52
- * Read more in the {@glink builds/guides/integration/installing-plugins "Installing plugins"} guide.
52
+ * Read more in the {@glink installation/getting-started/installing-plugins "Installing plugins"} guide.
53
53
  *
54
54
  * # Confused an editor build with an editor implementation
55
55
  *
56
56
  * This scenario is very similar to the previous one, but has a different origin.
57
57
  *
58
58
  * Let's assume that you wanted to use CKEditor 5 from source, as explained in the
59
- * {@glink builds/guides/integration/advanced-setup#scenario-2-building-from-source "Building from source"} section
59
+ * {@glink installation/advanced/alternative-setups/integrating-from-source "Building from source"} section
60
60
  * or in the {@glink framework/guides/quick-start "Quick start"} guide of CKEditor 5 Framework.
61
61
  *
62
62
  * The correct way to do so is to import an editor and plugins and run them together like this:
@@ -98,7 +98,7 @@ if ( windowOrGlobal.CKEDITOR_VERSION ) {
98
98
  * Check your web page for duplicated `<script>` elements or make sure your page builder/bundler includes CKEditor only once.
99
99
  *
100
100
  * If you want to use two different types of editors at once, see the
101
- * {@glink builds/guides/integration/advanced-setup#scenario-3-using-two-different-editors "Using two different editors"}
101
+ * {@glink installation/advanced/using-two-editors "Using two different editors"}
102
102
  * section.
103
103
  *
104
104
  * # Using outdated packages
@@ -124,7 +124,7 @@ if ( windowOrGlobal.CKEDITOR_VERSION ) {
124
124
  * **Note:** All official CKEditor 5 packages (excluding integrations and `ckeditor5-dev-*` packages) are released in the
125
125
  * same major version. This is &mdash; in the `x.y.z`, the `x` is the same for all packages. This is the simplest way to check
126
126
  * whether you use packages coming from the same CKEditor 5 version. You can read more about versioning in the
127
- * {@glink framework/guides/support/versioning-policy Versioning policy} guide.
127
+ * {@glink support/versioning-policy Versioning policy} guide.
128
128
  *
129
129
  * # Packages were duplicated in `node_modules`
130
130
  *