@ckeditor/ckeditor5-restricted-editing 0.0.0-nightly-20240424.0 → 0.0.0-nightly-20240426.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 (57) hide show
  1. package/build/restricted-editing.js +1 -1
  2. package/dist/index.js +14 -13
  3. package/dist/index.js.map +1 -1
  4. package/dist/translations/ar.umd.js +11 -0
  5. package/dist/translations/az.umd.js +11 -0
  6. package/dist/translations/bg.umd.js +11 -0
  7. package/dist/translations/bn.umd.js +11 -0
  8. package/dist/translations/ca.umd.js +11 -0
  9. package/dist/translations/cs.umd.js +11 -0
  10. package/dist/translations/da.umd.js +11 -0
  11. package/dist/translations/de-ch.umd.js +11 -0
  12. package/dist/translations/de.umd.js +11 -0
  13. package/dist/translations/el.umd.js +11 -0
  14. package/dist/translations/en-au.umd.js +11 -0
  15. package/dist/translations/en-gb.umd.js +11 -0
  16. package/dist/translations/en.umd.js +11 -0
  17. package/dist/translations/es.umd.js +11 -0
  18. package/dist/translations/et.umd.js +11 -0
  19. package/dist/translations/fa.umd.js +11 -0
  20. package/dist/translations/fi.umd.js +11 -0
  21. package/dist/translations/fr.umd.js +11 -0
  22. package/dist/translations/gl.umd.js +11 -0
  23. package/dist/translations/he.umd.js +11 -0
  24. package/dist/translations/hi.umd.js +11 -0
  25. package/dist/translations/hr.umd.js +11 -0
  26. package/dist/translations/hu.umd.js +11 -0
  27. package/dist/translations/id.umd.js +11 -0
  28. package/dist/translations/it.umd.js +11 -0
  29. package/dist/translations/ja.umd.js +11 -0
  30. package/dist/translations/ko.umd.js +11 -0
  31. package/dist/translations/ku.umd.js +11 -0
  32. package/dist/translations/lt.umd.js +11 -0
  33. package/dist/translations/lv.umd.js +11 -0
  34. package/dist/translations/ms.umd.js +11 -0
  35. package/dist/translations/nl.umd.js +11 -0
  36. package/dist/translations/no.umd.js +11 -0
  37. package/dist/translations/pl.umd.js +11 -0
  38. package/dist/translations/pt-br.umd.js +11 -0
  39. package/dist/translations/pt.umd.js +11 -0
  40. package/dist/translations/ro.umd.js +11 -0
  41. package/dist/translations/ru.umd.js +11 -0
  42. package/dist/translations/sk.umd.js +11 -0
  43. package/dist/translations/sq.umd.js +11 -0
  44. package/dist/translations/sr-latn.umd.js +11 -0
  45. package/dist/translations/sr.umd.js +11 -0
  46. package/dist/translations/sv.umd.js +11 -0
  47. package/dist/translations/th.umd.js +11 -0
  48. package/dist/translations/tk.umd.js +11 -0
  49. package/dist/translations/tr.umd.js +11 -0
  50. package/dist/translations/uk.umd.js +11 -0
  51. package/dist/translations/ur.umd.js +11 -0
  52. package/dist/translations/uz.umd.js +11 -0
  53. package/dist/translations/vi.umd.js +11 -0
  54. package/dist/translations/zh-cn.umd.js +11 -0
  55. package/dist/translations/zh.umd.js +11 -0
  56. package/package.json +2 -2
  57. package/src/restrictededitingmodeediting.js +12 -14
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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
+ ( e => {
7
+ const { [ 'tr' ]: { dictionary, getPluralForm } } = {"tr":{"dictionary":{"Disable editing":"Düzenlemeyi devre dışı bırak","Enable editing":"Düzenlemeyi etkinleştir","Previous editable region":"Önceki düzenlenebilir alan","Next editable region":"Sonraki düzenlenebilir alan","Navigate editable regions":"Düzenlenebilir alanlara git"},getPluralForm(n){return (n > 1);}}};
8
+ e[ 'tr' ] ||= { dictionary: {}, getPluralForm: null };
9
+ e[ 'tr' ].dictionary = Object.assign( e[ 'tr' ].dictionary, dictionary );
10
+ e[ 'tr' ].getPluralForm = getPluralForm;
11
+ } )( window.CKEDITOR_TRANSLATIONS ||= {} );
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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
+ ( e => {
7
+ const { [ 'uk' ]: { dictionary, getPluralForm } } = {"uk":{"dictionary":{"Disable editing":"Вимкнути редагування","Enable editing":"Увімкнути редагування","Previous editable region":"Попередня область редагування","Next editable region":"Наступна область редагування","Navigate editable regions":"Навігація по областях редагування"},getPluralForm(n){return (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);}}};
8
+ e[ 'uk' ] ||= { dictionary: {}, getPluralForm: null };
9
+ e[ 'uk' ].dictionary = Object.assign( e[ 'uk' ].dictionary, dictionary );
10
+ e[ 'uk' ].getPluralForm = getPluralForm;
11
+ } )( window.CKEDITOR_TRANSLATIONS ||= {} );
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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
+ ( e => {
7
+ const { [ 'ur' ]: { dictionary, getPluralForm } } = {"ur":{"dictionary":{"Disable editing":"تدویں غیر فعال کریں","Enable editing":"تدوین فعال کریں","Previous editable region":"","Next editable region":"","Navigate editable regions":""},getPluralForm(n){return (n != 1);}}};
8
+ e[ 'ur' ] ||= { dictionary: {}, getPluralForm: null };
9
+ e[ 'ur' ].dictionary = Object.assign( e[ 'ur' ].dictionary, dictionary );
10
+ e[ 'ur' ].getPluralForm = getPluralForm;
11
+ } )( window.CKEDITOR_TRANSLATIONS ||= {} );
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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
+ ( e => {
7
+ const { [ 'uz' ]: { dictionary, getPluralForm } } = {"uz":{"dictionary":{"Disable editing":"Tahrirlashni o‘chirib qo‘yish","Enable editing":"Tahrirlashga ruxsat berish","Previous editable region":"Avvalgi tahrirlanadigan hudud","Next editable region":"Keyingi tahrirlanadigan hudud","Navigate editable regions":"Tahrirlanadigan hududlar boʻylab navigatsiya"},getPluralForm(n){return 0;}}};
8
+ e[ 'uz' ] ||= { dictionary: {}, getPluralForm: null };
9
+ e[ 'uz' ].dictionary = Object.assign( e[ 'uz' ].dictionary, dictionary );
10
+ e[ 'uz' ].getPluralForm = getPluralForm;
11
+ } )( window.CKEDITOR_TRANSLATIONS ||= {} );
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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
+ ( e => {
7
+ const { [ 'vi' ]: { dictionary, getPluralForm } } = {"vi":{"dictionary":{"Disable editing":"Tắt tính năng chỉnh sửa","Enable editing":"Bật tính năng chỉnh sửa","Previous editable region":"Vùng có thể chỉnh sửa trước đó","Next editable region":"Vùng có thể chỉnh sửa tiếp theo","Navigate editable regions":"Di chuyển giữa các vùng có thể chỉnh sửa"},getPluralForm(n){return 0;}}};
8
+ e[ 'vi' ] ||= { dictionary: {}, getPluralForm: null };
9
+ e[ 'vi' ].dictionary = Object.assign( e[ 'vi' ].dictionary, dictionary );
10
+ e[ 'vi' ].getPluralForm = getPluralForm;
11
+ } )( window.CKEDITOR_TRANSLATIONS ||= {} );
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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
+ ( e => {
7
+ const { [ 'zh-cn' ]: { dictionary, getPluralForm } } = {"zh-cn":{"dictionary":{"Disable editing":"禁用编辑","Enable editing":"允许编辑","Previous editable region":"上一个可编辑区域","Next editable region":"下一个可编辑区域","Navigate editable regions":"导航至可编辑区域"},getPluralForm(n){return 0;}}};
8
+ e[ 'zh-cn' ] ||= { dictionary: {}, getPluralForm: null };
9
+ e[ 'zh-cn' ].dictionary = Object.assign( e[ 'zh-cn' ].dictionary, dictionary );
10
+ e[ 'zh-cn' ].getPluralForm = getPluralForm;
11
+ } )( window.CKEDITOR_TRANSLATIONS ||= {} );
@@ -0,0 +1,11 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2024, 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
+ ( e => {
7
+ const { [ 'zh' ]: { dictionary, getPluralForm } } = {"zh":{"dictionary":{"Disable editing":"停用編輯","Enable editing":"啟用編輯","Previous editable region":"上一個可編輯區域","Next editable region":"下一個可編輯區域","Navigate editable regions":"編輯區域導航"},getPluralForm(n){return 0;}}};
8
+ e[ 'zh' ] ||= { dictionary: {}, getPluralForm: null };
9
+ e[ 'zh' ].dictionary = Object.assign( e[ 'zh' ].dictionary, dictionary );
10
+ e[ 'zh' ].getPluralForm = getPluralForm;
11
+ } )( window.CKEDITOR_TRANSLATIONS ||= {} );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-restricted-editing",
3
- "version": "0.0.0-nightly-20240424.0",
3
+ "version": "0.0.0-nightly-20240426.0",
4
4
  "description": "Restricted editing feature for CKEditor 5 editors.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -12,7 +12,7 @@
12
12
  "type": "module",
13
13
  "main": "src/index.js",
14
14
  "dependencies": {
15
- "ckeditor5": "0.0.0-nightly-20240424.0"
15
+ "ckeditor5": "0.0.0-nightly-20240426.0"
16
16
  },
17
17
  "author": "CKSource (http://cksource.com/)",
18
18
  "license": "GPL-2.0-or-later",
@@ -50,8 +50,18 @@ export default class RestrictedEditingModeEditing extends Plugin {
50
50
  // Commands & keystrokes that allow navigation in the content.
51
51
  editor.commands.add('goToPreviousRestrictedEditingException', new RestrictedEditingModeNavigationCommand(editor, 'backward'));
52
52
  editor.commands.add('goToNextRestrictedEditingException', new RestrictedEditingModeNavigationCommand(editor, 'forward'));
53
- editor.keystrokes.set('Tab', getCommandExecuter(editor, 'goToNextRestrictedEditingException'));
54
- editor.keystrokes.set('Shift+Tab', getCommandExecuter(editor, 'goToPreviousRestrictedEditingException'));
53
+ this.listenTo(editingView.document, 'tab', (evt, data) => {
54
+ const commandName = !data.shiftKey ? 'goToNextRestrictedEditingException' : 'goToPreviousRestrictedEditingException';
55
+ const command = editor.commands.get(commandName);
56
+ if (command.isEnabled) {
57
+ editor.execute(commandName);
58
+ // Stop the event in the DOM: no listener in the web page will be triggered by this event.
59
+ data.preventDefault();
60
+ data.stopPropagation();
61
+ }
62
+ // Stop the event bubbling in the editor: no more callbacks will be executed for this keystroke.
63
+ evt.stop();
64
+ }, { context: '$capture' });
55
65
  editor.keystrokes.set('Ctrl+A', getSelectAllHandler(editor));
56
66
  editingView.change(writer => {
57
67
  for (const root of editingView.document.roots) {
@@ -231,18 +241,6 @@ export default class RestrictedEditingModeEditing extends Plugin {
231
241
  }
232
242
  }
233
243
  }
234
- /**
235
- * Helper method for executing enabled commands only.
236
- */
237
- function getCommandExecuter(editor, commandName) {
238
- return (_, cancel) => {
239
- const command = editor.commands.get(commandName);
240
- if (command.isEnabled) {
241
- editor.execute(commandName);
242
- cancel();
243
- }
244
- };
245
- }
246
244
  /**
247
245
  * Helper for handling Ctrl+A keydown behaviour.
248
246
  */