@ckeditor/ckeditor5-restricted-editing 39.0.1 → 40.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 (83) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +3 -3
  3. package/build/restricted-editing.js.map +1 -0
  4. package/build/translations/pt-br.js +1 -1
  5. package/lang/translations/ar.po +1 -0
  6. package/lang/translations/az.po +1 -0
  7. package/lang/translations/bg.po +1 -0
  8. package/lang/translations/bn.po +1 -0
  9. package/lang/translations/ca.po +1 -0
  10. package/lang/translations/cs.po +1 -0
  11. package/lang/translations/da.po +1 -0
  12. package/lang/translations/de-ch.po +1 -0
  13. package/lang/translations/de.po +1 -0
  14. package/lang/translations/el.po +1 -0
  15. package/lang/translations/en-au.po +1 -0
  16. package/lang/translations/en-gb.po +1 -0
  17. package/lang/translations/en.po +1 -0
  18. package/lang/translations/es.po +1 -0
  19. package/lang/translations/et.po +1 -0
  20. package/lang/translations/fa.po +1 -0
  21. package/lang/translations/fi.po +1 -0
  22. package/lang/translations/fr.po +1 -0
  23. package/lang/translations/gl.po +1 -0
  24. package/lang/translations/he.po +1 -0
  25. package/lang/translations/hi.po +1 -0
  26. package/lang/translations/hr.po +1 -0
  27. package/lang/translations/hu.po +1 -0
  28. package/lang/translations/id.po +1 -0
  29. package/lang/translations/it.po +1 -0
  30. package/lang/translations/ja.po +1 -0
  31. package/lang/translations/ko.po +1 -0
  32. package/lang/translations/ku.po +1 -0
  33. package/lang/translations/lt.po +1 -0
  34. package/lang/translations/lv.po +1 -0
  35. package/lang/translations/ms.po +1 -0
  36. package/lang/translations/nl.po +1 -0
  37. package/lang/translations/no.po +1 -0
  38. package/lang/translations/pl.po +1 -0
  39. package/lang/translations/pt-br.po +6 -5
  40. package/lang/translations/pt.po +1 -0
  41. package/lang/translations/ro.po +1 -0
  42. package/lang/translations/ru.po +1 -0
  43. package/lang/translations/sk.po +1 -0
  44. package/lang/translations/sq.po +1 -0
  45. package/lang/translations/sr-latn.po +1 -0
  46. package/lang/translations/sr.po +1 -0
  47. package/lang/translations/sv.po +1 -0
  48. package/lang/translations/th.po +1 -0
  49. package/lang/translations/tk.po +1 -0
  50. package/lang/translations/tr.po +1 -0
  51. package/lang/translations/uk.po +1 -0
  52. package/lang/translations/ur.po +1 -0
  53. package/lang/translations/uz.po +1 -0
  54. package/lang/translations/vi.po +1 -0
  55. package/lang/translations/zh-cn.po +1 -0
  56. package/lang/translations/zh.po +1 -0
  57. package/package.json +2 -6
  58. package/src/augmentation.d.ts +29 -29
  59. package/src/augmentation.js +5 -5
  60. package/src/index.d.ts +17 -17
  61. package/src/index.js +14 -14
  62. package/src/restrictededitingconfig.d.ts +60 -60
  63. package/src/restrictededitingconfig.js +5 -5
  64. package/src/restrictededitingexceptioncommand.d.ts +30 -30
  65. package/src/restrictededitingexceptioncommand.js +61 -61
  66. package/src/restrictededitingmode/converters.d.ts +39 -39
  67. package/src/restrictededitingmode/converters.js +142 -142
  68. package/src/restrictededitingmode/utils.d.ts +30 -30
  69. package/src/restrictededitingmode/utils.js +50 -50
  70. package/src/restrictededitingmode.d.ts +29 -29
  71. package/src/restrictededitingmode.js +33 -33
  72. package/src/restrictededitingmodeediting.d.ts +83 -83
  73. package/src/restrictededitingmodeediting.js +391 -391
  74. package/src/restrictededitingmodenavigationcommand.d.ts +42 -42
  75. package/src/restrictededitingmodenavigationcommand.js +94 -94
  76. package/src/restrictededitingmodeui.d.ts +32 -32
  77. package/src/restrictededitingmodeui.js +75 -75
  78. package/src/standardeditingmode.d.ts +26 -26
  79. package/src/standardeditingmode.js +30 -30
  80. package/src/standardeditingmodeediting.d.ts +25 -25
  81. package/src/standardeditingmodeediting.js +53 -53
  82. package/src/standardeditingmodeui.d.ts +23 -23
  83. package/src/standardeditingmodeui.js +48 -48
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Romanian (https://app.transifex.com/ckeditor/teams/11143/ro/)\n"
16
16
  "Language: ro\n"
17
17
  "Plural-Forms: nplurals=3; plural=(n==1?0:(((n%100>19)||((n%100==0)&&(n!=0)))?2:1));\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Russian (https://app.transifex.com/ckeditor/teams/11143/ru/)\n"
16
16
  "Language: ru\n"
17
17
  "Plural-Forms: nplurals=4; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : n%10==0 || (n%10>=5 && n%10<=9) || (n%100>=11 && n%100<=14)? 2 : 3);\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Slovak (https://app.transifex.com/ckeditor/teams/11143/sk/)\n"
16
16
  "Language: sk\n"
17
17
  "Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n == 1 ? 0 : n % 1 == 0 && n >= 2 && n <= 4 ? 1 : n % 1 != 0 ? 2: 3);\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Albanian (https://app.transifex.com/ckeditor/teams/11143/sq/)\n"
16
16
  "Language: sq\n"
17
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Serbian (Latin) (https://app.transifex.com/ckeditor/teams/11143/sr@latin/)\n"
16
16
  "Language: sr@latin\n"
17
17
  "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Serbian (https://app.transifex.com/ckeditor/teams/11143/sr/)\n"
16
16
  "Language: sr\n"
17
17
  "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Swedish (https://app.transifex.com/ckeditor/teams/11143/sv/)\n"
16
16
  "Language: sv\n"
17
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Thai (https://app.transifex.com/ckeditor/teams/11143/th/)\n"
16
16
  "Language: th\n"
17
17
  "Plural-Forms: nplurals=1; plural=0;\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Turkmen (https://app.transifex.com/ckeditor/teams/11143/tk/)\n"
16
16
  "Language: tk\n"
17
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Turkish (https://app.transifex.com/ckeditor/teams/11143/tr/)\n"
16
16
  "Language: tr\n"
17
17
  "Plural-Forms: nplurals=2; plural=(n > 1);\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Ukrainian (https://app.transifex.com/ckeditor/teams/11143/uk/)\n"
16
16
  "Language: uk\n"
17
17
  "Plural-Forms: nplurals=4; plural=(n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Urdu (https://app.transifex.com/ckeditor/teams/11143/ur/)\n"
16
16
  "Language: ur\n"
17
17
  "Plural-Forms: nplurals=2; plural=(n != 1);\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Uzbek (https://app.transifex.com/ckeditor/teams/11143/uz/)\n"
16
16
  "Language: uz\n"
17
17
  "Plural-Forms: nplurals=1; plural=0;\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Vietnamese (https://app.transifex.com/ckeditor/teams/11143/vi/)\n"
16
16
  "Language: vi\n"
17
17
  "Plural-Forms: nplurals=1; plural=0;\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Chinese (China) (https://app.transifex.com/ckeditor/teams/11143/zh_CN/)\n"
16
16
  "Language: zh_CN\n"
17
17
  "Plural-Forms: nplurals=1; plural=0;\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
@@ -15,6 +15,7 @@ msgstr ""
15
15
  "Language-Team: Chinese (Taiwan) (https://app.transifex.com/ckeditor/teams/11143/zh_TW/)\n"
16
16
  "Language: zh_TW\n"
17
17
  "Plural-Forms: nplurals=1; plural=0;\n"
18
+ "Content-Type: text/plain; charset=UTF-8\n"
18
19
 
19
20
  msgctxt "A label of the button indicating that using this button will make a selected text non–editable."
20
21
  msgid "Disable editing"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-restricted-editing",
3
- "version": "39.0.1",
3
+ "version": "40.0.0",
4
4
  "description": "Restricted editing feature for CKEditor 5 editors.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -11,11 +11,7 @@
11
11
  ],
12
12
  "main": "src/index.js",
13
13
  "dependencies": {
14
- "ckeditor5": "39.0.1"
15
- },
16
- "engines": {
17
- "node": ">=16.0.0",
18
- "npm": ">=5.7.1"
14
+ "ckeditor5": "40.0.0"
19
15
  },
20
16
  "author": "CKSource (http://cksource.com/)",
21
17
  "license": "GPL-2.0-or-later",
@@ -1,29 +1,29 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- import type { RestrictedEditingMode, RestrictedEditingModeEditing, RestrictedEditingModeUI, StandardEditingMode, StandardEditingModeEditing, StandardEditingModeUI, RestrictedEditingConfig, RestrictedEditingExceptionCommand, RestrictedEditingModeNavigationCommand } from './index';
6
- declare module '@ckeditor/ckeditor5-core' {
7
- interface PluginsMap {
8
- [RestrictedEditingMode.pluginName]: RestrictedEditingMode;
9
- [RestrictedEditingModeEditing.pluginName]: RestrictedEditingModeEditing;
10
- [RestrictedEditingModeUI.pluginName]: RestrictedEditingModeUI;
11
- [StandardEditingMode.pluginName]: StandardEditingMode;
12
- [StandardEditingModeEditing.pluginName]: StandardEditingModeEditing;
13
- [StandardEditingModeUI.pluginName]: StandardEditingModeUI;
14
- }
15
- interface CommandsMap {
16
- restrictedEditingException: RestrictedEditingExceptionCommand;
17
- goToPreviousRestrictedEditingException: RestrictedEditingModeNavigationCommand;
18
- goToNextRestrictedEditingException: RestrictedEditingModeNavigationCommand;
19
- }
20
- interface EditorConfig {
21
- /**
22
- * The configuration of the restricted editing mode feature. Introduced by the
23
- * {@link module:restricted-editing/restrictededitingmode~RestrictedEditingMode} feature.
24
- *
25
- * Read more in {@link module:restricted-editing/restrictededitingconfig~RestrictedEditingConfig}.
26
- */
27
- restrictedEditing?: RestrictedEditingConfig;
28
- }
29
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import type { RestrictedEditingMode, RestrictedEditingModeEditing, RestrictedEditingModeUI, StandardEditingMode, StandardEditingModeEditing, StandardEditingModeUI, RestrictedEditingConfig, RestrictedEditingExceptionCommand, RestrictedEditingModeNavigationCommand } from './index';
6
+ declare module '@ckeditor/ckeditor5-core' {
7
+ interface PluginsMap {
8
+ [RestrictedEditingMode.pluginName]: RestrictedEditingMode;
9
+ [RestrictedEditingModeEditing.pluginName]: RestrictedEditingModeEditing;
10
+ [RestrictedEditingModeUI.pluginName]: RestrictedEditingModeUI;
11
+ [StandardEditingMode.pluginName]: StandardEditingMode;
12
+ [StandardEditingModeEditing.pluginName]: StandardEditingModeEditing;
13
+ [StandardEditingModeUI.pluginName]: StandardEditingModeUI;
14
+ }
15
+ interface CommandsMap {
16
+ restrictedEditingException: RestrictedEditingExceptionCommand;
17
+ goToPreviousRestrictedEditingException: RestrictedEditingModeNavigationCommand;
18
+ goToNextRestrictedEditingException: RestrictedEditingModeNavigationCommand;
19
+ }
20
+ interface EditorConfig {
21
+ /**
22
+ * The configuration of the restricted editing mode feature. Introduced by the
23
+ * {@link module:restricted-editing/restrictededitingmode~RestrictedEditingMode} feature.
24
+ *
25
+ * Read more in {@link module:restricted-editing/restrictededitingconfig~RestrictedEditingConfig}.
26
+ */
27
+ restrictedEditing?: RestrictedEditingConfig;
28
+ }
29
+ }
@@ -1,5 +1,5 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- export {};
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export {};
package/src/index.d.ts CHANGED
@@ -1,17 +1,17 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module restricted-editing
7
- */
8
- export { default as RestrictedEditingMode } from './restrictededitingmode';
9
- export { default as RestrictedEditingModeEditing } from './restrictededitingmodeediting';
10
- export { default as RestrictedEditingModeUI } from './restrictededitingmodeui';
11
- export { default as StandardEditingMode } from './standardeditingmode';
12
- export { default as StandardEditingModeEditing } from './standardeditingmodeediting';
13
- export { default as StandardEditingModeUI } from './standardeditingmodeui';
14
- export type { RestrictedEditingConfig } from './restrictededitingconfig';
15
- export type { default as RestrictedEditingExceptionCommand } from './restrictededitingexceptioncommand';
16
- export type { default as RestrictedEditingModeNavigationCommand } from './restrictededitingmodenavigationcommand';
17
- import './augmentation';
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module restricted-editing
7
+ */
8
+ export { default as RestrictedEditingMode } from './restrictededitingmode';
9
+ export { default as RestrictedEditingModeEditing } from './restrictededitingmodeediting';
10
+ export { default as RestrictedEditingModeUI } from './restrictededitingmodeui';
11
+ export { default as StandardEditingMode } from './standardeditingmode';
12
+ export { default as StandardEditingModeEditing } from './standardeditingmodeediting';
13
+ export { default as StandardEditingModeUI } from './standardeditingmodeui';
14
+ export type { RestrictedEditingConfig } from './restrictededitingconfig';
15
+ export type { default as RestrictedEditingExceptionCommand } from './restrictededitingexceptioncommand';
16
+ export type { default as RestrictedEditingModeNavigationCommand } from './restrictededitingmodenavigationcommand';
17
+ import './augmentation';
package/src/index.js CHANGED
@@ -1,14 +1,14 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module restricted-editing
7
- */
8
- export { default as RestrictedEditingMode } from './restrictededitingmode';
9
- export { default as RestrictedEditingModeEditing } from './restrictededitingmodeediting';
10
- export { default as RestrictedEditingModeUI } from './restrictededitingmodeui';
11
- export { default as StandardEditingMode } from './standardeditingmode';
12
- export { default as StandardEditingModeEditing } from './standardeditingmodeediting';
13
- export { default as StandardEditingModeUI } from './standardeditingmodeui';
14
- import './augmentation';
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module restricted-editing
7
+ */
8
+ export { default as RestrictedEditingMode } from './restrictededitingmode';
9
+ export { default as RestrictedEditingModeEditing } from './restrictededitingmodeediting';
10
+ export { default as RestrictedEditingModeUI } from './restrictededitingmodeui';
11
+ export { default as StandardEditingMode } from './standardeditingmode';
12
+ export { default as StandardEditingModeEditing } from './standardeditingmodeediting';
13
+ export { default as StandardEditingModeUI } from './standardeditingmodeui';
14
+ import './augmentation';
@@ -1,60 +1,60 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module restricted-editing/restrictededitingconfig
7
- */
8
- /**
9
- * The configuration of the restricted editing mode feature.
10
- * The option is used by the {@link module:restricted-editing/restrictededitingmode~RestrictedEditingMode} feature.
11
- *
12
- * ```ts
13
- * ClassicEditor
14
- * .create( {
15
- * restrictedEditing: {
16
- * allowedCommands: [ 'bold', 'link', 'unlink' ],
17
- * allowedAttributes: [ 'bold', 'linkHref' ]
18
- * }
19
- * } )
20
- * .then( ... )
21
- * .catch( ... );
22
- * ```
23
- *
24
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
25
- */
26
- export interface RestrictedEditingConfig {
27
- /**
28
- * The command names allowed in non-restricted areas of the content.
29
- *
30
- * Defines which feature commands should be enabled in the restricted editing mode. The commands used for typing and deleting text
31
- * (`'input'`, `'delete'` and `'deleteForward'`) are allowed by the feature inside non-restricted regions and do not need to be defined.
32
- *
33
- * **Note**: The restricted editing mode always allows to use the restricted mode navigation commands as well as `'undo'` and `'redo'`
34
- * commands.
35
- *
36
- * The default value is:
37
- *
38
- * ```ts
39
- * const restrictedEditingConfig = {
40
- * allowedCommands: [ 'bold', 'italic', 'link', 'unlink' ]
41
- * };
42
- * ```
43
- *
44
- * To make a command always enabled (also outside non-restricted areas) use
45
- * {@link module:restricted-editing/restrictededitingmodeediting~RestrictedEditingModeEditing#enableCommand} method.
46
- */
47
- allowedCommands: Array<string>;
48
- /**
49
- * The text attribute names allowed when pasting content ot non-restricted areas.
50
- *
51
- * The default value is:
52
- *
53
- * ```ts
54
- * const restrictedEditingConfig = {
55
- * allowedAttributes: [ 'bold', 'italic', 'linkHref' ]
56
- * };
57
- * ```
58
- */
59
- allowedAttributes: Array<string>;
60
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module restricted-editing/restrictededitingconfig
7
+ */
8
+ /**
9
+ * The configuration of the restricted editing mode feature.
10
+ * The option is used by the {@link module:restricted-editing/restrictededitingmode~RestrictedEditingMode} feature.
11
+ *
12
+ * ```ts
13
+ * ClassicEditor
14
+ * .create( {
15
+ * restrictedEditing: {
16
+ * allowedCommands: [ 'bold', 'link', 'unlink' ],
17
+ * allowedAttributes: [ 'bold', 'linkHref' ]
18
+ * }
19
+ * } )
20
+ * .then( ... )
21
+ * .catch( ... );
22
+ * ```
23
+ *
24
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
25
+ */
26
+ export interface RestrictedEditingConfig {
27
+ /**
28
+ * The command names allowed in non-restricted areas of the content.
29
+ *
30
+ * Defines which feature commands should be enabled in the restricted editing mode. The commands used for typing and deleting text
31
+ * (`'input'`, `'delete'` and `'deleteForward'`) are allowed by the feature inside non-restricted regions and do not need to be defined.
32
+ *
33
+ * **Note**: The restricted editing mode always allows to use the restricted mode navigation commands as well as `'undo'` and `'redo'`
34
+ * commands.
35
+ *
36
+ * The default value is:
37
+ *
38
+ * ```ts
39
+ * const restrictedEditingConfig = {
40
+ * allowedCommands: [ 'bold', 'italic', 'link', 'unlink' ]
41
+ * };
42
+ * ```
43
+ *
44
+ * To make a command always enabled (also outside non-restricted areas) use
45
+ * {@link module:restricted-editing/restrictededitingmodeediting~RestrictedEditingModeEditing#enableCommand} method.
46
+ */
47
+ allowedCommands: Array<string>;
48
+ /**
49
+ * The text attribute names allowed when pasting content ot non-restricted areas.
50
+ *
51
+ * The default value is:
52
+ *
53
+ * ```ts
54
+ * const restrictedEditingConfig = {
55
+ * allowedAttributes: [ 'bold', 'italic', 'linkHref' ]
56
+ * };
57
+ * ```
58
+ */
59
+ allowedAttributes: Array<string>;
60
+ }
@@ -1,5 +1,5 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- export {};
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ export {};
@@ -1,30 +1,30 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module restricted-editing/restrictededitingexceptioncommand
7
- */
8
- import { Command } from 'ckeditor5/src/core';
9
- /**
10
- * The command that toggles exceptions from the restricted editing on text.
11
- */
12
- export default class RestrictedEditingExceptionCommand extends Command {
13
- /**
14
- * A flag indicating whether the command is active
15
- *
16
- * @readonly
17
- */
18
- value: boolean;
19
- /**
20
- * @inheritDoc
21
- */
22
- refresh(): void;
23
- /**
24
- * @inheritDoc
25
- */
26
- execute(options?: RestrictedEditingExceptionCommandParams): void;
27
- }
28
- export interface RestrictedEditingExceptionCommandParams {
29
- forceValue?: unknown;
30
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module restricted-editing/restrictededitingexceptioncommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core';
9
+ /**
10
+ * The command that toggles exceptions from the restricted editing on text.
11
+ */
12
+ export default class RestrictedEditingExceptionCommand extends Command {
13
+ /**
14
+ * A flag indicating whether the command is active
15
+ *
16
+ * @readonly
17
+ */
18
+ value: boolean;
19
+ /**
20
+ * @inheritDoc
21
+ */
22
+ refresh(): void;
23
+ /**
24
+ * @inheritDoc
25
+ */
26
+ execute(options?: RestrictedEditingExceptionCommandParams): void;
27
+ }
28
+ export interface RestrictedEditingExceptionCommandParams {
29
+ forceValue?: unknown;
30
+ }
@@ -1,61 +1,61 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module restricted-editing/restrictededitingexceptioncommand
7
- */
8
- import { Command } from 'ckeditor5/src/core';
9
- /**
10
- * The command that toggles exceptions from the restricted editing on text.
11
- */
12
- export default class RestrictedEditingExceptionCommand extends Command {
13
- /**
14
- * @inheritDoc
15
- */
16
- refresh() {
17
- const model = this.editor.model;
18
- const doc = model.document;
19
- this.value = !!doc.selection.getAttribute('restrictedEditingException');
20
- this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, 'restrictedEditingException');
21
- }
22
- /**
23
- * @inheritDoc
24
- */
25
- execute(options = {}) {
26
- const model = this.editor.model;
27
- const document = model.document;
28
- const selection = document.selection;
29
- const valueToSet = (options.forceValue === undefined) ? !this.value : options.forceValue;
30
- model.change(writer => {
31
- const ranges = model.schema.getValidRanges(selection.getRanges(), 'restrictedEditingException');
32
- if (selection.isCollapsed) {
33
- if (valueToSet) {
34
- writer.setSelectionAttribute('restrictedEditingException', valueToSet);
35
- }
36
- else {
37
- const isSameException = (value) => {
38
- return value.item.getAttribute('restrictedEditingException') === this.value;
39
- };
40
- const focus = selection.focus;
41
- const exceptionStart = focus.getLastMatchingPosition(isSameException, { direction: 'backward' });
42
- const exceptionEnd = focus.getLastMatchingPosition(isSameException);
43
- writer.removeSelectionAttribute('restrictedEditingException');
44
- if (!(focus.isEqual(exceptionStart) || focus.isEqual(exceptionEnd))) {
45
- writer.removeAttribute('restrictedEditingException', writer.createRange(exceptionStart, exceptionEnd));
46
- }
47
- }
48
- }
49
- else {
50
- for (const range of ranges) {
51
- if (valueToSet) {
52
- writer.setAttribute('restrictedEditingException', valueToSet, range);
53
- }
54
- else {
55
- writer.removeAttribute('restrictedEditingException', range);
56
- }
57
- }
58
- }
59
- });
60
- }
61
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module restricted-editing/restrictededitingexceptioncommand
7
+ */
8
+ import { Command } from 'ckeditor5/src/core';
9
+ /**
10
+ * The command that toggles exceptions from the restricted editing on text.
11
+ */
12
+ export default class RestrictedEditingExceptionCommand extends Command {
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ refresh() {
17
+ const model = this.editor.model;
18
+ const doc = model.document;
19
+ this.value = !!doc.selection.getAttribute('restrictedEditingException');
20
+ this.isEnabled = model.schema.checkAttributeInSelection(doc.selection, 'restrictedEditingException');
21
+ }
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ execute(options = {}) {
26
+ const model = this.editor.model;
27
+ const document = model.document;
28
+ const selection = document.selection;
29
+ const valueToSet = (options.forceValue === undefined) ? !this.value : options.forceValue;
30
+ model.change(writer => {
31
+ const ranges = model.schema.getValidRanges(selection.getRanges(), 'restrictedEditingException');
32
+ if (selection.isCollapsed) {
33
+ if (valueToSet) {
34
+ writer.setSelectionAttribute('restrictedEditingException', valueToSet);
35
+ }
36
+ else {
37
+ const isSameException = (value) => {
38
+ return value.item.getAttribute('restrictedEditingException') === this.value;
39
+ };
40
+ const focus = selection.focus;
41
+ const exceptionStart = focus.getLastMatchingPosition(isSameException, { direction: 'backward' });
42
+ const exceptionEnd = focus.getLastMatchingPosition(isSameException);
43
+ writer.removeSelectionAttribute('restrictedEditingException');
44
+ if (!(focus.isEqual(exceptionStart) || focus.isEqual(exceptionEnd))) {
45
+ writer.removeAttribute('restrictedEditingException', writer.createRange(exceptionStart, exceptionEnd));
46
+ }
47
+ }
48
+ }
49
+ else {
50
+ for (const range of ranges) {
51
+ if (valueToSet) {
52
+ writer.setAttribute('restrictedEditingException', valueToSet, range);
53
+ }
54
+ else {
55
+ writer.removeAttribute('restrictedEditingException', range);
56
+ }
57
+ }
58
+ }
59
+ });
60
+ }
61
+ }