@ckeditor/ckeditor5-core 33.0.0 → 34.2.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 (76) hide show
  1. package/LICENSE.md +2 -2
  2. package/README.md +2 -1
  3. package/lang/contexts.json +2 -1
  4. package/lang/translations/af.po +9 -5
  5. package/lang/translations/ar.po +4 -0
  6. package/lang/translations/ast.po +4 -0
  7. package/lang/translations/az.po +4 -0
  8. package/lang/translations/bg.po +4 -0
  9. package/lang/translations/bs.po +4 -0
  10. package/lang/translations/ca.po +4 -0
  11. package/lang/translations/cs.po +4 -0
  12. package/lang/translations/da.po +4 -0
  13. package/lang/translations/de-ch.po +4 -0
  14. package/lang/translations/de.po +4 -0
  15. package/lang/translations/el.po +4 -0
  16. package/lang/translations/en-au.po +5 -1
  17. package/lang/translations/en-gb.po +4 -0
  18. package/lang/translations/en.po +4 -0
  19. package/lang/translations/eo.po +4 -0
  20. package/lang/translations/es.po +5 -1
  21. package/lang/translations/et.po +4 -0
  22. package/lang/translations/eu.po +4 -0
  23. package/lang/translations/fa.po +4 -0
  24. package/lang/translations/fi.po +4 -0
  25. package/lang/translations/fr.po +5 -1
  26. package/lang/translations/gl.po +4 -0
  27. package/lang/translations/gu.po +45 -0
  28. package/lang/translations/he.po +4 -0
  29. package/lang/translations/hi.po +4 -0
  30. package/lang/translations/hr.po +5 -1
  31. package/lang/translations/hu.po +4 -0
  32. package/lang/translations/id.po +4 -0
  33. package/lang/translations/it.po +5 -1
  34. package/lang/translations/ja.po +4 -0
  35. package/lang/translations/jv.po +45 -0
  36. package/lang/translations/km.po +4 -0
  37. package/lang/translations/kn.po +4 -0
  38. package/lang/translations/ko.po +4 -0
  39. package/lang/translations/ku.po +4 -0
  40. package/lang/translations/lt.po +4 -0
  41. package/lang/translations/lv.po +5 -1
  42. package/lang/translations/ms.po +45 -0
  43. package/lang/translations/nb.po +4 -0
  44. package/lang/translations/ne.po +4 -0
  45. package/lang/translations/nl.po +4 -0
  46. package/lang/translations/no.po +4 -0
  47. package/lang/translations/oc.po +4 -0
  48. package/lang/translations/pl.po +4 -0
  49. package/lang/translations/pt-br.po +5 -1
  50. package/lang/translations/pt.po +5 -1
  51. package/lang/translations/ro.po +4 -0
  52. package/lang/translations/ru.po +4 -0
  53. package/lang/translations/si.po +45 -0
  54. package/lang/translations/sk.po +4 -0
  55. package/lang/translations/sl.po +4 -0
  56. package/lang/translations/sq.po +4 -0
  57. package/lang/translations/sr-latn.po +4 -0
  58. package/lang/translations/sr.po +4 -0
  59. package/lang/translations/sv.po +4 -0
  60. package/lang/translations/th.po +4 -0
  61. package/lang/translations/tk.po +4 -0
  62. package/lang/translations/tr.po +4 -0
  63. package/lang/translations/tt.po +4 -0
  64. package/lang/translations/ug.po +4 -0
  65. package/lang/translations/uk.po +4 -0
  66. package/lang/translations/ur.po +45 -0
  67. package/lang/translations/uz.po +4 -0
  68. package/lang/translations/vi.po +4 -0
  69. package/lang/translations/zh-cn.po +4 -0
  70. package/lang/translations/zh.po +4 -0
  71. package/package.json +17 -17
  72. package/src/editor/editor.js +136 -16
  73. package/src/editor/editorconfig.jsdoc +5 -5
  74. package/src/multicommand.js +19 -12
  75. package/src/pendingactions.js +1 -1
  76. package/src/plugincollection.js +7 -6
@@ -39,3 +39,7 @@ msgstr "Pokaż więcej"
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr "%0 z %1"
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "Nie można przesłać pliku:"
@@ -14,7 +14,7 @@ msgid ""
14
14
  msgstr ""
15
15
  "Language-Team: Portuguese (Brazil) (https://www.transifex.com/ckeditor/teams/11143/pt_BR/)\n"
16
16
  "Language: pt_BR\n"
17
- "Plural-Forms: nplurals=2; plural=(n > 1);\n"
17
+ "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
18
18
 
19
19
  msgctxt "Label for the Cancel button."
20
20
  msgid "Cancel"
@@ -39,3 +39,7 @@ msgstr "Exibir mais itens"
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr "%0 de %1"
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "Não foi possível enviar o arquivo:"
@@ -14,7 +14,7 @@ msgid ""
14
14
  msgstr ""
15
15
  "Language-Team: Portuguese (https://www.transifex.com/ckeditor/teams/11143/pt/)\n"
16
16
  "Language: pt\n"
17
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
17
+ "Plural-Forms: nplurals=3; plural=(n == 0 || n == 1) ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"
18
18
 
19
19
  msgctxt "Label for the Cancel button."
20
20
  msgid "Cancel"
@@ -39,3 +39,7 @@ msgstr ""
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr ""
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "Não foi possível carregar o ficheiro:"
@@ -39,3 +39,7 @@ msgstr "Arată mai multe elemente"
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr "%0 din %1"
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "Nu se poate încărca fișierul:"
@@ -39,3 +39,7 @@ msgstr "Другие инструменты"
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr "%0 из %1"
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "Невозможно загрузить файл"
@@ -0,0 +1,45 @@
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: Sinhala (Sri Lanka) (https://www.transifex.com/ckeditor/teams/11143/si_LK/)\n"
16
+ "Language: si_LK\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+
19
+ msgctxt "Label for the Cancel button."
20
+ msgid "Cancel"
21
+ msgstr ""
22
+
23
+ msgctxt "The label used by a button next to the color palette in the color picker that removes the color (resets it to an empty value, example usages in font color or table properties)."
24
+ msgid "Remove color"
25
+ msgstr ""
26
+
27
+ msgctxt "The label used by a button next to the color palette in the color picker that restores the default value if the default table properties are specified."
28
+ msgid "Restore default"
29
+ msgstr ""
30
+
31
+ msgctxt "Label for the Save button."
32
+ msgid "Save"
33
+ msgstr ""
34
+
35
+ msgctxt "Label of a toolbar button which reveals more toolbar items."
36
+ msgid "Show more items"
37
+ msgstr ""
38
+
39
+ msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
+ msgid "%0 of %1"
41
+ msgstr ""
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "ගොනුව යාවත්කාලීන කළ නොහැක:"
@@ -39,3 +39,7 @@ msgstr "Zobraziť viac položiek"
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr "%0 z %1"
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "Nie je možné nahrať súbor:"
@@ -39,3 +39,7 @@ msgstr ""
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr ""
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "Ni možno naložiti datoteke:"
@@ -39,3 +39,7 @@ msgstr ""
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr ""
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "Nuk mund të ngarkojë skedën:"
@@ -39,3 +39,7 @@ msgstr "Prikaži još stavki"
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr "%0 of %1"
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "Postavljanje fajla je neuspešno:"
@@ -39,3 +39,7 @@ msgstr "Прикажи још ставки"
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr "%0 of %1"
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "Постављање фајла је неуспешно:"
@@ -39,3 +39,7 @@ msgstr ""
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr ""
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "Kan inte ladda upp fil:"
@@ -39,3 +39,7 @@ msgstr ""
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr ""
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "ไม่สามารถอัปโหลดไฟล์ได้:"
@@ -39,3 +39,7 @@ msgstr "Has köp zady görkeziň"
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr "%1-iň %0-i"
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "Faýl ýükläp bolmady:"
@@ -39,3 +39,7 @@ msgstr "Daha fazla öğe göster"
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr "%0/%1"
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "Dosya yüklenemedi:"
@@ -39,3 +39,7 @@ msgstr ""
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr ""
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr ""
@@ -39,3 +39,7 @@ msgstr ""
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr ""
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "يۈكلەشكە بولمايدىغان ھۆججەت:"
@@ -39,3 +39,7 @@ msgstr "Показати більше"
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr "%0 із %1"
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "Неможливо завантажити файл:"
@@ -0,0 +1,45 @@
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: Urdu (https://www.transifex.com/ckeditor/teams/11143/ur/)\n"
16
+ "Language: ur\n"
17
+ "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+
19
+ msgctxt "Label for the Cancel button."
20
+ msgid "Cancel"
21
+ msgstr "منسوخ"
22
+
23
+ msgctxt "The label used by a button next to the color palette in the color picker that removes the color (resets it to an empty value, example usages in font color or table properties)."
24
+ msgid "Remove color"
25
+ msgstr "رنگ حذف کریں"
26
+
27
+ msgctxt "The label used by a button next to the color palette in the color picker that restores the default value if the default table properties are specified."
28
+ msgid "Restore default"
29
+ msgstr "طے شدہ بحال"
30
+
31
+ msgctxt "Label for the Save button."
32
+ msgid "Save"
33
+ msgstr "محفوظ"
34
+
35
+ msgctxt "Label of a toolbar button which reveals more toolbar items."
36
+ msgid "Show more items"
37
+ msgstr "مزید مواد کی نمائش کریں"
38
+
39
+ msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
+ msgid "%0 of %1"
41
+ msgstr "0% میں سے 1%"
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "فائل اپلوڈ نہیں ہو سکی:"
@@ -39,3 +39,7 @@ msgstr ""
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr ""
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr ""
@@ -39,3 +39,7 @@ msgstr "Xem thêm"
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr "%0 đến %1"
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "Không thể tải file:"
@@ -39,3 +39,7 @@ msgstr "显示更多"
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr "第 %0 步,共 %1 步"
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "无法上传的文件:"
@@ -39,3 +39,7 @@ msgstr "顯示更多"
39
39
  msgctxt "Label for an ‘X of Y’ status of a typical next/previous navigation. For instance, ‘Page 5 of 20’ or 'Search result 5 of 20'."
40
40
  msgid "%0 of %1"
41
41
  msgstr "%0/%1"
42
+
43
+ msgctxt "A generic error message displayed on upload failure. The file name is concatenated to this text."
44
+ msgid "Cannot upload file:"
45
+ msgstr "無法上傳檔案:"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-core",
3
- "version": "33.0.0",
3
+ "version": "34.2.0",
4
4
  "description": "The core architecture of CKEditor 5 – the best browser-based rich text editor.",
5
5
  "keywords": [
6
6
  "wysiwyg",
@@ -23,25 +23,25 @@
23
23
  ],
24
24
  "main": "src/index.js",
25
25
  "dependencies": {
26
- "@ckeditor/ckeditor5-engine": "^33.0.0",
27
- "@ckeditor/ckeditor5-ui": "^33.0.0",
28
- "@ckeditor/ckeditor5-utils": "^33.0.0",
26
+ "@ckeditor/ckeditor5-engine": "^34.2.0",
27
+ "@ckeditor/ckeditor5-ui": "^34.2.0",
28
+ "@ckeditor/ckeditor5-utils": "^34.2.0",
29
29
  "lodash-es": "^4.17.15"
30
30
  },
31
31
  "devDependencies": {
32
- "@ckeditor/ckeditor5-autoformat": "^33.0.0",
33
- "@ckeditor/ckeditor5-basic-styles": "^33.0.0",
34
- "@ckeditor/ckeditor5-block-quote": "^33.0.0",
35
- "@ckeditor/ckeditor5-editor-classic": "^33.0.0",
36
- "@ckeditor/ckeditor5-essentials": "^33.0.0",
37
- "@ckeditor/ckeditor5-heading": "^33.0.0",
38
- "@ckeditor/ckeditor5-image": "^33.0.0",
39
- "@ckeditor/ckeditor5-indent": "^33.0.0",
40
- "@ckeditor/ckeditor5-link": "^33.0.0",
41
- "@ckeditor/ckeditor5-list": "^33.0.0",
42
- "@ckeditor/ckeditor5-media-embed": "^33.0.0",
43
- "@ckeditor/ckeditor5-paragraph": "^33.0.0",
44
- "@ckeditor/ckeditor5-table": "^33.0.0"
32
+ "@ckeditor/ckeditor5-autoformat": "^34.2.0",
33
+ "@ckeditor/ckeditor5-basic-styles": "^34.2.0",
34
+ "@ckeditor/ckeditor5-block-quote": "^34.2.0",
35
+ "@ckeditor/ckeditor5-editor-classic": "^34.2.0",
36
+ "@ckeditor/ckeditor5-essentials": "^34.2.0",
37
+ "@ckeditor/ckeditor5-heading": "^34.2.0",
38
+ "@ckeditor/ckeditor5-image": "^34.2.0",
39
+ "@ckeditor/ckeditor5-indent": "^34.2.0",
40
+ "@ckeditor/ckeditor5-link": "^34.2.0",
41
+ "@ckeditor/ckeditor5-list": "^34.2.0",
42
+ "@ckeditor/ckeditor5-media-embed": "^34.2.0",
43
+ "@ckeditor/ckeditor5-paragraph": "^34.2.0",
44
+ "@ckeditor/ckeditor5-table": "^34.2.0"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=14.0.0",
@@ -108,6 +108,14 @@ export default class Editor {
108
108
  */
109
109
  this.t = this.locale.t;
110
110
 
111
+ /**
112
+ * A set of lock IDs for the {@link #isReadOnly} getter.
113
+ *
114
+ * @private
115
+ * @type {Set.<String|Symbol>}
116
+ */
117
+ this._readOnlyLocks = new Set();
118
+
111
119
  /**
112
120
  * Commands registered to the editor.
113
121
  *
@@ -142,21 +150,6 @@ export default class Editor {
142
150
  this.once( 'ready', () => ( this.state = 'ready' ), { priority: 'high' } );
143
151
  this.once( 'destroy', () => ( this.state = 'destroyed' ), { priority: 'high' } );
144
152
 
145
- /**
146
- * Defines whether this editor is in read-only mode.
147
- *
148
- * In read-only mode the editor {@link #commands commands} are disabled so it is not possible
149
- * to modify the document by using them. Also, the editable element(s) become non-editable.
150
- *
151
- * In order to make the editor read-only, you can set this value directly:
152
- *
153
- * editor.isReadOnly = true;
154
- *
155
- * @observable
156
- * @member {Boolean} #isReadOnly
157
- */
158
- this.set( 'isReadOnly', false );
159
-
160
153
  /**
161
154
  * The editor's model.
162
155
  *
@@ -229,6 +222,133 @@ export default class Editor {
229
222
  this.keystrokes.listenTo( this.editing.view.document );
230
223
  }
231
224
 
225
+ /**
226
+ * Defines whether the editor is in the read-only mode.
227
+ *
228
+ * In read-only mode the editor {@link #commands commands} are disabled so it is not possible
229
+ * to modify the document by using them. Also, the editable element(s) become non-editable.
230
+ *
231
+ * In order to make the editor read-only, you need to call the {@link #enableReadOnlyMode} method:
232
+ *
233
+ * editor.enableReadOnlyMode( 'feature-id' );
234
+ *
235
+ * Later, to turn off the read-only mode, call {@link #disableReadOnlyMode}:
236
+ *
237
+ * editor.disableReadOnlyMode( 'feature-id' );
238
+ *
239
+ * @readonly
240
+ * @observable
241
+ * @member {Boolean} #isReadOnly
242
+ */
243
+ get isReadOnly() {
244
+ return this._readOnlyLocks.size > 0;
245
+ }
246
+
247
+ set isReadOnly( value ) {
248
+ /**
249
+ * The {@link #isReadOnly Editor#isReadOnly} property is read-only since version `34.0.0` and can be set only using
250
+ * {@link #enableReadOnlyMode `Editor#enableReadOnlyMode( lockId )`} and
251
+ * {@link #disableReadOnlyMode `Editor#disableReadOnlyMode( lockId )`}.
252
+ *
253
+ * Usage before version `34.0.0`:
254
+ *
255
+ * editor.isReadOnly = true;
256
+ * editor.isReadOnly = false;
257
+ *
258
+ * Usage since version `34.0.0`:
259
+ *
260
+ * editor.enableReadOnlyMode( 'my-feature-id' );
261
+ * editor.disableReadOnlyMode( 'my-feature-id' );
262
+ *
263
+ * @error editor-isreadonly-has-no-setter
264
+ */
265
+ throw new CKEditorError( 'editor-isreadonly-has-no-setter' );
266
+ }
267
+
268
+ /**
269
+ * Turns on the read-only mode in the editor.
270
+ *
271
+ * Editor can be switched to or out of the read-only mode by many features, under various circumstances. The editor supports locking
272
+ * mechanism for the read-only mode. It enables easy control over the read-only mode when many features wants to turn it on or off at
273
+ * the same time, without conflicting with each other. It guarantees that you will not make the editor editable accidentally (which
274
+ * could lead to errors).
275
+ *
276
+ * Each read-only mode request is identified by a unique id (also called "lock"). If multiple plugins requested to turn on the
277
+ * read-only mode, then, the editor will become editable only after all these plugins turn the read-only mode off (using the same ids).
278
+ *
279
+ * Note, that you cannot force the editor to disable the read-only mode if other plugins set it.
280
+ *
281
+ * After the first `enableReadOnlyMode()` call, the {@link #isReadOnly `isReadOnly` property} will be set to `true`:
282
+ *
283
+ * editor.isReadOnly; // `false`.
284
+ * editor.enableReadOnlyMode( 'my-feature-id' );
285
+ * editor.isReadOnly; // `true`.
286
+ *
287
+ * You can turn off the read-only mode ("clear the lock") using the {@link #disableReadOnlyMode `disableReadOnlyMode()`} method:
288
+ *
289
+ * editor.enableReadOnlyMode( 'my-feature-id' );
290
+ * // ...
291
+ * editor.disableReadOnlyMode( 'my-feature-id' );
292
+ * editor.isReadOnly; // `false`.
293
+ *
294
+ * All "locks" need to be removed to enable editing:
295
+ *
296
+ * editor.enableReadOnlyMode( 'my-feature-id' );
297
+ * editor.enableReadOnlyMode( 'my-other-feature-id' );
298
+ * // ...
299
+ * editor.disableReadOnlyMode( 'my-feature-id' );
300
+ * editor.isReadOnly; // `true`.
301
+ * editor.disableReadOnlyMode( 'my-other-feature-id' );
302
+ * editor.isReadOnly; // `false`.
303
+ *
304
+ * @param {String|Symbol} lockId A unique ID for setting the editor to the read-only state.
305
+ */
306
+ enableReadOnlyMode( lockId ) {
307
+ if ( typeof lockId !== 'string' && typeof lockId !== 'symbol' ) {
308
+ /**
309
+ * The lock ID is missing or it is not a string or symbol.
310
+ *
311
+ * @error editor-read-only-lock-id-invalid
312
+ */
313
+ throw new CKEditorError( 'editor-read-only-lock-id-invalid', null, { lockId } );
314
+ }
315
+
316
+ if ( this._readOnlyLocks.has( lockId ) ) {
317
+ return;
318
+ }
319
+
320
+ this._readOnlyLocks.add( lockId );
321
+
322
+ if ( this._readOnlyLocks.size === 1 ) {
323
+ // Manually fire the `change:isReadOnly` event as only getter is provided.
324
+ this.fire( 'change:isReadOnly', 'isReadOnly', true, false );
325
+ }
326
+ }
327
+
328
+ /**
329
+ * Removes the read-only lock from the editor with given lock ID.
330
+ *
331
+ * When no lock is present on the editor anymore, then the {@link #isReadOnly `isReadOnly` property} will be set to `false`.
332
+ *
333
+ * @param {String|Symbol} lockId The lock ID for setting the editor to the read-only state.
334
+ */
335
+ disableReadOnlyMode( lockId ) {
336
+ if ( typeof lockId !== 'string' && typeof lockId !== 'symbol' ) {
337
+ throw new CKEditorError( 'editor-read-only-lock-id-invalid', null, { lockId } );
338
+ }
339
+
340
+ if ( !this._readOnlyLocks.has( lockId ) ) {
341
+ return;
342
+ }
343
+
344
+ this._readOnlyLocks.delete( lockId );
345
+
346
+ if ( this._readOnlyLocks.size === 0 ) {
347
+ // Manually fire the `change:isReadOnly` event as only getter is provided.
348
+ this.fire( 'change:isReadOnly', 'isReadOnly', false, true );
349
+ }
350
+ }
351
+
232
352
  /**
233
353
  * Loads and initializes plugins specified in the configuration.
234
354
  *
@@ -361,7 +481,7 @@ mix( Editor, ObservableMixin );
361
481
  * This error is thrown when trying to pass a `<textarea>` element to a `create()` function of an editor class.
362
482
  *
363
483
  * The only editor type which can be initialized on `<textarea>` elements is
364
- * the {@glink builds/guides/predefined-builds/overview#classic-editor classic editor}.
484
+ * the {@glink installation/advanced/alternative-setups/predefined-builds#classic-editor classic editor}.
365
485
  * This editor hides the passed element and inserts its own UI next to it. Other types of editors reuse the passed element as their root
366
486
  * editable element and therefore `<textarea>` is not appropriate for them. Use a `<div>` or another text container instead:
367
487
  *
@@ -24,7 +24,7 @@
24
24
  * .then( ... )
25
25
  * .catch( ... );
26
26
  *
27
- * Check the {@glink builds/guides/integration/configuration Configuration guide} for more information
27
+ * Check the {@glink installation/advanced/alternative-setups/predefined-builds Configuration guide} for more information
28
28
  * about setting configuration options.
29
29
  *
30
30
  * @interface EditorConfig
@@ -66,7 +66,7 @@
66
66
  /**
67
67
  * The list of plugins to load.
68
68
  *
69
- * If you use an {@glink builds/guides/predefined-builds/overview editor build} you can define the list of plugins to load
69
+ * If you use an {@glink installation/advanced/alternative-setups/predefined-builds editor build} you can define the list of plugins to load
70
70
  * using the names of plugins that are available:
71
71
  *
72
72
  * const config = {
@@ -98,7 +98,7 @@
98
98
 
99
99
  /**
100
100
  * The list of additional plugins to load along those already available in the
101
- * {@glink builds/guides/predefined-builds/overview editor build}. It extends the {@link #plugins `plugins`} configuration.
101
+ * {@glink installation/advanced/alternative-setups/predefined-builds editor build}. It extends the {@link #plugins `plugins`} configuration.
102
102
  *
103
103
  * function MyPlugin( editor ) {
104
104
  * // ...
@@ -110,7 +110,7 @@
110
110
  *
111
111
  * **Note:** This configuration works only for simple plugins which utilize the
112
112
  * {@link module:core/plugin~PluginInterface plugin interface} and have no dependencies. To extend a
113
- * build with complex features, create a {@glink builds/guides/development/custom-builds custom build}.
113
+ * build with complex features, create a {@glink installation/getting-started/quick-start#creating-custom-builds-with-online-builder custom build}.
114
114
  *
115
115
  * **Note:** Make sure you include the new features in you toolbar configuration. Learn more
116
116
  * about the {@glink features/toolbar/toolbar toolbar setup}.
@@ -119,7 +119,7 @@
119
119
  */
120
120
 
121
121
  /**
122
- * The list of plugins which should not be loaded despite being available in an {@glink builds/guides/predefined-builds/overview editor build}.
122
+ * The list of plugins which should not be loaded despite being available in an {@glink installation/advanced/alternative-setups/predefined-builds editor build}.
123
123
  *
124
124
  * const config = {
125
125
  * removePlugins: [ 'Bold', 'Italic' ]