@ckeditor/ckeditor5-widget 31.1.0 → 34.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. package/LICENSE.md +2 -2
  2. package/README.md +2 -1
  3. package/lang/translations/az.po +1 -1
  4. package/lang/translations/cs.po +1 -1
  5. package/lang/translations/da.po +1 -1
  6. package/lang/translations/de-ch.po +1 -1
  7. package/lang/translations/de.po +1 -1
  8. package/lang/translations/el.po +29 -0
  9. package/lang/translations/en-au.po +1 -1
  10. package/lang/translations/en.po +1 -1
  11. package/lang/translations/es.po +1 -1
  12. package/lang/translations/et.po +1 -1
  13. package/lang/translations/fa.po +1 -1
  14. package/lang/translations/fr.po +1 -1
  15. package/lang/translations/gl.po +1 -1
  16. package/lang/translations/he.po +1 -1
  17. package/lang/translations/hi.po +1 -1
  18. package/lang/translations/hr.po +3 -3
  19. package/lang/translations/hu.po +1 -1
  20. package/lang/translations/id.po +3 -3
  21. package/lang/translations/it.po +1 -1
  22. package/lang/translations/ja.po +1 -1
  23. package/lang/translations/ko.po +1 -1
  24. package/lang/translations/ku.po +1 -1
  25. package/lang/translations/lv.po +1 -1
  26. package/lang/translations/nl.po +1 -1
  27. package/lang/translations/no.po +1 -1
  28. package/lang/translations/pl.po +1 -1
  29. package/lang/translations/pt-br.po +1 -1
  30. package/lang/translations/ro.po +1 -1
  31. package/lang/translations/ru.po +1 -1
  32. package/lang/translations/sk.po +1 -1
  33. package/lang/translations/sr-latn.po +1 -1
  34. package/lang/translations/sr.po +1 -1
  35. package/lang/translations/th.po +1 -1
  36. package/lang/translations/tk.po +1 -1
  37. package/lang/translations/tr.po +1 -1
  38. package/lang/translations/uk.po +1 -1
  39. package/lang/translations/uz.po +1 -1
  40. package/lang/translations/vi.po +1 -1
  41. package/lang/translations/zh-cn.po +1 -1
  42. package/lang/translations/zh.po +1 -1
  43. package/package.json +22 -22
  44. package/src/highlightstack.js +1 -1
  45. package/src/index.js +1 -1
  46. package/src/utils.js +5 -26
  47. package/src/verticalnavigation.js +1 -1
  48. package/src/widget.js +1 -1
  49. package/src/widgetresize/resizer.js +1 -1
  50. package/src/widgetresize/resizerstate.js +1 -1
  51. package/src/widgetresize/sizeview.js +1 -1
  52. package/src/widgetresize.js +1 -1
  53. package/src/widgettoolbarrepository.js +10 -2
  54. package/src/widgettypearound/utils.js +1 -1
  55. package/src/widgettypearound/widgettypearound.js +37 -2
  56. package/theme/widget.css +1 -1
  57. package/theme/widgetresize.css +1 -1
  58. package/theme/widgettypearound.css +1 -1
package/LICENSE.md CHANGED
@@ -2,7 +2,7 @@ Software License Agreement
2
2
  ==========================
3
3
 
4
4
  **CKEditor 5 widget API** – https://github.com/ckeditor/ckeditor5-image <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
 
@@ -14,4 +14,4 @@ Where not otherwise indicated, all CKEditor content is authored by CKSource engi
14
14
  Trademarks
15
15
  ----------
16
16
 
17
- **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.
17
+ **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 widget API
3
3
 
4
4
  [![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-widget.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-widget)
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-widget)
7
8
 
8
9
  This package implements the widget API for CKEditor 5.
9
10
 
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -0,0 +1,29 @@
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
+ #
3
+ # !!! IMPORTANT !!!
4
+ #
5
+ # Before you edit this file, please keep in mind that contributing to the project
6
+ # translations is possible ONLY via the Transifex online service.
7
+ #
8
+ # To submit your translations, visit https://www.transifex.com/ckeditor/ckeditor5.
9
+ #
10
+ # To learn more, check out the official contributor's guide:
11
+ # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
12
+ #
13
+ msgid ""
14
+ msgstr ""
15
+ "Language-Team: Greek (https://www.transifex.com/ckeditor/teams/11143/el/)\n"
16
+ "Language: el\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+
19
+ msgctxt "The label used by assistive technologies describing a toolbar attached to a widget."
20
+ msgid "Widget toolbar"
21
+ msgstr "Γραμμή εργαλείων γραφικού στοιχείου"
22
+
23
+ msgctxt "The title displayed when a mouse is over a button that inserts a paragraph before a block."
24
+ msgid "Insert paragraph before block"
25
+ msgstr "Εισαγωγή παραγράφου πριν το τμήμα"
26
+
27
+ msgctxt "The title displayed when a mouse is over a button that inserts a paragraph after a block."
28
+ msgid "Insert paragraph after block"
29
+ msgstr "Εισαγωγή παραγράφου μετά το τμήμα"
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -22,8 +22,8 @@ msgstr "Traka sa spravicama"
22
22
 
23
23
  msgctxt "The title displayed when a mouse is over a button that inserts a paragraph before a block."
24
24
  msgid "Insert paragraph before block"
25
- msgstr ""
25
+ msgstr "Umetni odlomak prije bloka"
26
26
 
27
27
  msgctxt "The title displayed when a mouse is over a button that inserts a paragraph after a block."
28
28
  msgid "Insert paragraph after block"
29
- msgstr ""
29
+ msgstr "Umetni odlomak poslije bloka"
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -22,8 +22,8 @@ msgstr "Alat widget"
22
22
 
23
23
  msgctxt "The title displayed when a mouse is over a button that inserts a paragraph before a block."
24
24
  msgid "Insert paragraph before block"
25
- msgstr ""
25
+ msgstr "Tambahkan paragraf sebelum blok"
26
26
 
27
27
  msgctxt "The title displayed when a mouse is over a button that inserts a paragraph after a block."
28
28
  msgid "Insert paragraph after block"
29
- msgstr ""
29
+ msgstr "Tambahkan paragraf setelah blok"
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
@@ -1,4 +1,4 @@
1
- # Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
1
+ # Copyright (c) 2003-2022, CKSource Holding sp. z o.o. All rights reserved.
2
2
  #
3
3
  # !!! IMPORTANT !!!
4
4
  #
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-widget",
3
- "version": "31.1.0",
3
+ "version": "34.0.0",
4
4
  "description": "Widget API for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -11,32 +11,32 @@
11
11
  ],
12
12
  "main": "src/index.js",
13
13
  "dependencies": {
14
- "@ckeditor/ckeditor5-core": "^31.1.0",
15
- "@ckeditor/ckeditor5-engine": "^31.1.0",
16
- "@ckeditor/ckeditor5-enter": "^31.1.0",
17
- "@ckeditor/ckeditor5-ui": "^31.1.0",
18
- "@ckeditor/ckeditor5-utils": "^31.1.0",
19
- "@ckeditor/ckeditor5-typing": "^31.1.0",
14
+ "@ckeditor/ckeditor5-core": "^34.0.0",
15
+ "@ckeditor/ckeditor5-engine": "^34.0.0",
16
+ "@ckeditor/ckeditor5-enter": "^34.0.0",
17
+ "@ckeditor/ckeditor5-ui": "^34.0.0",
18
+ "@ckeditor/ckeditor5-utils": "^34.0.0",
19
+ "@ckeditor/ckeditor5-typing": "^34.0.0",
20
20
  "lodash-es": "^4.17.15"
21
21
  },
22
22
  "devDependencies": {
23
- "@ckeditor/ckeditor5-basic-styles": "^31.1.0",
24
- "@ckeditor/ckeditor5-block-quote": "^31.1.0",
25
- "@ckeditor/ckeditor5-clipboard": "^31.1.0",
26
- "@ckeditor/ckeditor5-editor-balloon": "^31.1.0",
27
- "@ckeditor/ckeditor5-editor-classic": "^31.1.0",
28
- "@ckeditor/ckeditor5-essentials": "^31.1.0",
29
- "@ckeditor/ckeditor5-heading": "^31.1.0",
30
- "@ckeditor/ckeditor5-horizontal-line": "^31.1.0",
31
- "@ckeditor/ckeditor5-image": "^31.1.0",
32
- "@ckeditor/ckeditor5-link": "^31.1.0",
33
- "@ckeditor/ckeditor5-media-embed": "^31.1.0",
34
- "@ckeditor/ckeditor5-paragraph": "^31.1.0",
35
- "@ckeditor/ckeditor5-table": "^31.1.0",
36
- "@ckeditor/ckeditor5-undo": "^31.1.0"
23
+ "@ckeditor/ckeditor5-basic-styles": "^34.0.0",
24
+ "@ckeditor/ckeditor5-block-quote": "^34.0.0",
25
+ "@ckeditor/ckeditor5-clipboard": "^34.0.0",
26
+ "@ckeditor/ckeditor5-editor-balloon": "^34.0.0",
27
+ "@ckeditor/ckeditor5-editor-classic": "^34.0.0",
28
+ "@ckeditor/ckeditor5-essentials": "^34.0.0",
29
+ "@ckeditor/ckeditor5-heading": "^34.0.0",
30
+ "@ckeditor/ckeditor5-horizontal-line": "^34.0.0",
31
+ "@ckeditor/ckeditor5-image": "^34.0.0",
32
+ "@ckeditor/ckeditor5-link": "^34.0.0",
33
+ "@ckeditor/ckeditor5-media-embed": "^34.0.0",
34
+ "@ckeditor/ckeditor5-paragraph": "^34.0.0",
35
+ "@ckeditor/ckeditor5-table": "^34.0.0",
36
+ "@ckeditor/ckeditor5-undo": "^34.0.0"
37
37
  },
38
38
  "engines": {
39
- "node": ">=12.0.0",
39
+ "node": ">=14.0.0",
40
40
  "npm": ">=5.7.1"
41
41
  },
42
42
  "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
 
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
 
package/src/utils.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
 
@@ -9,6 +9,9 @@
9
9
 
10
10
  import CKEditorError from '@ckeditor/ckeditor5-utils/src/ckeditorerror';
11
11
  import toArray from '@ckeditor/ckeditor5-utils/src/toarray';
12
+ import {
13
+ findOptimalInsertionRange as engineFindOptimalInsertionRange
14
+ } from '@ckeditor/ckeditor5-engine/src/model/utils/findoptimalinsertionrange';
12
15
 
13
16
  import HighlightStack from './highlightstack';
14
17
  import { getTypeAroundFakeCaretPosition } from './widgettypearound/utils';
@@ -307,33 +310,9 @@ export function findOptimalInsertionRange( selection, model ) {
307
310
  if ( typeAroundFakeCaretPosition ) {
308
311
  return model.createRange( model.createPositionAt( selectedElement, typeAroundFakeCaretPosition ) );
309
312
  }
310
-
311
- if ( model.schema.isObject( selectedElement ) && !model.schema.isInline( selectedElement ) ) {
312
- return model.createRangeOn( selectedElement );
313
- }
314
- }
315
-
316
- const firstBlock = selection.getSelectedBlocks().next().value;
317
-
318
- if ( firstBlock ) {
319
- // If inserting into an empty block – return position in that block. It will get
320
- // replaced with the image by insertContent(). #42.
321
- if ( firstBlock.isEmpty ) {
322
- return model.createRange( model.createPositionAt( firstBlock, 0 ) );
323
- }
324
-
325
- const positionAfter = model.createPositionAfter( firstBlock );
326
-
327
- // If selection is at the end of the block - return position after the block.
328
- if ( selection.focus.isTouching( positionAfter ) ) {
329
- return model.createRange( positionAfter );
330
- }
331
-
332
- // Otherwise return position before the block.
333
- return model.createRange( model.createPositionBefore( firstBlock ) );
334
313
  }
335
314
 
336
- return model.createRange( selection.focus );
315
+ return engineFindOptimalInsertionRange( selection, model );
337
316
  }
338
317
 
339
318
  /**
@@ -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/widget.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
 
@@ -124,10 +124,18 @@ export default class WidgetToolbarRepository extends Plugin {
124
124
  // Trying to register a toolbar without any item.
125
125
  if ( !items.length ) {
126
126
  /**
127
- * When {@link #register} a new toolbar, you need to provide a non-empty array with
127
+ * When {@link #register registering} a new widget toolbar, you need to provide a non-empty array with
128
128
  * the items that will be inserted into the toolbar.
129
129
  *
130
+ * If you see this error when integrating the editor, you likely forgot to configure one of the widget toolbars.
131
+ *
132
+ * See for instance:
133
+ *
134
+ * * {@link module:table/table~TableConfig#contentToolbar `config.table.contentToolbar`}
135
+ * * {@link module:image/image~ImageConfig#toolbar `config.image.toolbar`}
136
+ *
130
137
  * @error widget-toolbar-no-items
138
+ * @param {String} toolbarId The id of the toolbar that has not been configured correctly.
131
139
  */
132
140
  logWarning( 'widget-toolbar-no-items', { toolbarId } );
133
141
 
@@ -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
 
@@ -121,6 +121,7 @@ export default class WidgetTypeAround extends Plugin {
121
121
  this._enableTypeAroundFakeCaretActivationUsingKeyboardArrows();
122
122
  this._enableDeleteIntegration();
123
123
  this._enableInsertContentIntegration();
124
+ this._enableInsertObjectIntegration();
124
125
  this._enableDeleteContentIntegration();
125
126
  }
126
127
 
@@ -145,8 +146,11 @@ export default class WidgetTypeAround extends Plugin {
145
146
  const editor = this.editor;
146
147
  const editingView = editor.editing.view;
147
148
 
149
+ const attributesToCopy = editor.model.schema.getAttributesWithProperty( widgetModelElement, 'copyOnReplace', true );
150
+
148
151
  editor.execute( 'insertParagraph', {
149
- position: editor.model.createPositionAt( widgetModelElement, position )
152
+ position: editor.model.createPositionAt( widgetModelElement, position ),
153
+ attributes: attributesToCopy
150
154
  } );
151
155
 
152
156
  editingView.focus();
@@ -779,6 +783,37 @@ export default class WidgetTypeAround extends Plugin {
779
783
  }, { priority: 'high' } );
780
784
  }
781
785
 
786
+ /**
787
+ * Attaches the {@link module:engine/model/model~Model#event:insertObject} event listener that modifies `options.findOptimalPosition`
788
+ * parameter to position of fake caret in relation to selected element to reflect user's intent of desired insertion position.
789
+ *
790
+ * The object is inserted according to the `widget-type-around` selection attribute (see {@link #_handleArrowKeyPress}).
791
+ *
792
+ * @private
793
+ */
794
+ _enableInsertObjectIntegration() {
795
+ const editor = this.editor;
796
+ const model = this.editor.model;
797
+ const documentSelection = model.document.selection;
798
+
799
+ this._listenToIfEnabled( editor.model, 'insertObject', ( evt, args ) => {
800
+ const [ , selectable, , options = {} ] = args;
801
+
802
+ if ( selectable && !selectable.is( 'documentSelection' ) ) {
803
+ return;
804
+ }
805
+
806
+ const typeAroundFakeCaretPosition = getTypeAroundFakeCaretPosition( documentSelection );
807
+
808
+ if ( !typeAroundFakeCaretPosition ) {
809
+ return;
810
+ }
811
+
812
+ options.findOptimalPosition = typeAroundFakeCaretPosition;
813
+ args[ 3 ] = options;
814
+ }, { priority: 'high' } );
815
+ }
816
+
782
817
  /**
783
818
  * Attaches the {@link module:engine/model/model~Model#event:deleteContent} event listener to block the event when the fake
784
819
  * caret is active.
package/theme/widget.css CHANGED
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * 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
- * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * 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
- * Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
2
+ * 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