@ckeditor/ckeditor5-enter 47.6.1-alpha.1 → 48.0.0-alpha.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 (93) hide show
  1. package/dist/index.css +3 -0
  2. package/dist/index.css.map +1 -0
  3. package/package.json +21 -40
  4. package/lang/contexts.json +0 -4
  5. package/lang/translations/af.po +0 -20
  6. package/lang/translations/ar.po +0 -20
  7. package/lang/translations/ast.po +0 -20
  8. package/lang/translations/az.po +0 -20
  9. package/lang/translations/be.po +0 -20
  10. package/lang/translations/bg.po +0 -20
  11. package/lang/translations/bn.po +0 -20
  12. package/lang/translations/bs.po +0 -20
  13. package/lang/translations/ca.po +0 -20
  14. package/lang/translations/cs.po +0 -20
  15. package/lang/translations/da.po +0 -20
  16. package/lang/translations/de-ch.po +0 -20
  17. package/lang/translations/de.po +0 -20
  18. package/lang/translations/el.po +0 -20
  19. package/lang/translations/en-au.po +0 -20
  20. package/lang/translations/en-gb.po +0 -20
  21. package/lang/translations/en.po +0 -20
  22. package/lang/translations/eo.po +0 -20
  23. package/lang/translations/es-co.po +0 -20
  24. package/lang/translations/es.po +0 -20
  25. package/lang/translations/et.po +0 -20
  26. package/lang/translations/eu.po +0 -20
  27. package/lang/translations/fa.po +0 -20
  28. package/lang/translations/fi.po +0 -20
  29. package/lang/translations/fr.po +0 -20
  30. package/lang/translations/gl.po +0 -20
  31. package/lang/translations/gu.po +0 -20
  32. package/lang/translations/he.po +0 -20
  33. package/lang/translations/hi.po +0 -20
  34. package/lang/translations/hr.po +0 -20
  35. package/lang/translations/hu.po +0 -20
  36. package/lang/translations/hy.po +0 -20
  37. package/lang/translations/id.po +0 -20
  38. package/lang/translations/it.po +0 -20
  39. package/lang/translations/ja.po +0 -20
  40. package/lang/translations/jv.po +0 -20
  41. package/lang/translations/kk.po +0 -20
  42. package/lang/translations/km.po +0 -20
  43. package/lang/translations/kn.po +0 -20
  44. package/lang/translations/ko.po +0 -20
  45. package/lang/translations/ku.po +0 -20
  46. package/lang/translations/lt.po +0 -20
  47. package/lang/translations/lv.po +0 -20
  48. package/lang/translations/ms.po +0 -20
  49. package/lang/translations/nb.po +0 -20
  50. package/lang/translations/ne.po +0 -20
  51. package/lang/translations/nl.po +0 -20
  52. package/lang/translations/no.po +0 -20
  53. package/lang/translations/oc.po +0 -20
  54. package/lang/translations/pl.po +0 -20
  55. package/lang/translations/pt-br.po +0 -20
  56. package/lang/translations/pt.po +0 -20
  57. package/lang/translations/ro.po +0 -20
  58. package/lang/translations/ru.po +0 -20
  59. package/lang/translations/si.po +0 -20
  60. package/lang/translations/sk.po +0 -20
  61. package/lang/translations/sl.po +0 -20
  62. package/lang/translations/sq.po +0 -20
  63. package/lang/translations/sr-latn.po +0 -20
  64. package/lang/translations/sr.po +0 -20
  65. package/lang/translations/sv.po +0 -20
  66. package/lang/translations/th.po +0 -20
  67. package/lang/translations/ti.po +0 -20
  68. package/lang/translations/tk.po +0 -20
  69. package/lang/translations/tr.po +0 -20
  70. package/lang/translations/tt.po +0 -20
  71. package/lang/translations/ug.po +0 -20
  72. package/lang/translations/uk.po +0 -20
  73. package/lang/translations/ur.po +0 -20
  74. package/lang/translations/uz.po +0 -20
  75. package/lang/translations/vi.po +0 -20
  76. package/lang/translations/zh-cn.po +0 -20
  77. package/lang/translations/zh.po +0 -20
  78. package/src/augmentation.js +0 -5
  79. package/src/enter.js +0 -61
  80. package/src/entercommand.js +0 -96
  81. package/src/enterobserver.js +0 -61
  82. package/src/index.js +0 -14
  83. package/src/shiftenter.js +0 -79
  84. package/src/shiftentercommand.js +0 -118
  85. package/src/utils.js +0 -21
  86. /package/{src → dist}/augmentation.d.ts +0 -0
  87. /package/{src → dist}/enter.d.ts +0 -0
  88. /package/{src → dist}/entercommand.d.ts +0 -0
  89. /package/{src → dist}/enterobserver.d.ts +0 -0
  90. /package/{src → dist}/index.d.ts +0 -0
  91. /package/{src → dist}/shiftenter.d.ts +0 -0
  92. /package/{src → dist}/shiftentercommand.d.ts +0 -0
  93. /package/{src → dist}/utils.d.ts +0 -0
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: sk\n"
11
- "Plural-Forms: nplurals=3; plural=(n == 1 ? 0 : (n >= 2 && n <= 4) ? 1 : 2);\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr "Vložiť mäkkú medzeru (prvok <code>&lt;br&gt;</code>)"
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr "Vložiť pevnú medzeru (nový odsek)"
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: sl\n"
11
- "Plural-Forms: nplurals=4; plural=(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0);\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr ""
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr ""
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: sq\n"
11
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr ""
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr ""
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: sr@latin\n"
11
- "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"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr "Umetnite meku pauzu (element &lt;br&gt;)"
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr "Ubacite čvrstu pauzu (novi pasus)  "
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: sr\n"
11
- "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"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr "Umetni blagi prekid (<code>&lt;br&gt;</code> element)"
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr "Umetni jači prekid (novi pasus)"
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: sv\n"
11
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr "Infoga radbrytning (a <code>&lt;br&gt;</code>-element)"
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr "Infoga blankrad (nytt stycke)"
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: th\n"
11
- "Plural-Forms: nplurals=1; plural=0;\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr "แทรกการขึ้นบรรทัดใหม่แบบ Soft Break (<code>&lt;br&gt;</code> element)"
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr "แทรกการขึ้นบรรทัดใหม่แบบ Hard Break (ย่อหน้าใหม่)"
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: ti\n"
11
- "Plural-Forms: nplurals=2; plural=(n > 1);\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr ""
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr ""
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: tk\n"
11
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr ""
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr ""
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: tr\n"
11
- "Plural-Forms: nplurals=2; plural=(n > 1);\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr "Değişebilir sayfa sonu ekle (bir <code><br></code> ögesi)"
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr "Değişmez sayfa sonu ekle (yeni bir paragraf)"
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: tt\n"
11
- "Plural-Forms: nplurals=1; plural=0;\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr ""
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr ""
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: ug\n"
11
- "Plural-Forms: nplurals=1; plural=0;\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr ""
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr ""
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: uk\n"
11
- "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"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr "Вставити м’який розрив (елемент <code>&lt;br&gt;</code>)"
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr "Вставити жорсткий розрив (новий абзац)"
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: ur\n"
11
- "Plural-Forms: nplurals=2; plural=(n != 1);\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr ""
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr ""
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: uz\n"
11
- "Plural-Forms: nplurals=2; plural=(n > 1);\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr ""
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr ""
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: vi\n"
11
- "Plural-Forms: nplurals=1; plural=0;\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr "Chèn dấu ngắt mềm (phần tử <code>&lt;br&gt;</code>)"
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr "Chèn dấu ngắt cứng (đoạn văn mới)"
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: zh_CN\n"
11
- "Plural-Forms: nplurals=1; plural=0;\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr "插入软换行(一个<code>&lt;br&gt;</code> 元素)"
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr "插入硬换行(新段落)"
@@ -1,20 +0,0 @@
1
- # Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
2
- #
3
- # Want to contribute to this file? Submit your changes via a GitHub Pull Request.
4
- #
5
- # Check out the official contributor's guide:
6
- # https://ckeditor.com/docs/ckeditor5/latest/framework/guides/contributing/contributing.html
7
- #
8
- msgid ""
9
- msgstr ""
10
- "Language: zh_TW\n"
11
- "Plural-Forms: nplurals=1; plural=0;\n"
12
- "Content-Type: text/plain; charset=UTF-8\n"
13
-
14
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a soft break."
15
- msgid "Insert a soft break (a <code>&lt;br&gt;</code> element)"
16
- msgstr "插入非強制斷行(<code>&lt;br&gt;</code> 元件)"
17
-
18
- msgctxt "Keystroke description for assistive technologies: keystroke for inserting a hard break."
19
- msgid "Insert a hard break (a new paragraph)"
20
- msgstr "插入強制斷行(新段落)"
@@ -1,5 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- export {};
package/src/enter.js DELETED
@@ -1,61 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- /**
6
- * @module enter/enter
7
- */
8
- import { Plugin } from '@ckeditor/ckeditor5-core';
9
- import { EnterCommand } from './entercommand.js';
10
- import { EnterObserver } from './enterobserver.js';
11
- /**
12
- * This plugin handles the <kbd>Enter</kbd> keystroke (hard line break) in the editor.
13
- *
14
- * See also the {@link module:enter/shiftenter~ShiftEnter} plugin.
15
- *
16
- * For more information about this feature see the {@glink api/enter package page}.
17
- */
18
- export class Enter extends Plugin {
19
- /**
20
- * @inheritDoc
21
- */
22
- static get pluginName() {
23
- return 'Enter';
24
- }
25
- /**
26
- * @inheritDoc
27
- */
28
- static get isOfficialPlugin() {
29
- return true;
30
- }
31
- init() {
32
- const editor = this.editor;
33
- const view = editor.editing.view;
34
- const viewDocument = view.document;
35
- const t = this.editor.t;
36
- view.addObserver(EnterObserver);
37
- editor.commands.add('enter', new EnterCommand(editor));
38
- this.listenTo(viewDocument, 'enter', (evt, data) => {
39
- // When not in composition, we handle the action, so prevent the default one.
40
- // When in composition, it's the browser who modify the DOM (renderer is disabled).
41
- if (!viewDocument.isComposing) {
42
- data.preventDefault();
43
- }
44
- // The soft enter key is handled by the ShiftEnter plugin.
45
- if (data.isSoft) {
46
- return;
47
- }
48
- editor.execute('enter');
49
- view.scrollToTheSelection();
50
- }, { priority: 'low' });
51
- // Add the information about the keystroke to the accessibility database.
52
- editor.accessibility.addKeystrokeInfos({
53
- keystrokes: [
54
- {
55
- label: t('Insert a hard break (a new paragraph)'),
56
- keystroke: 'Enter'
57
- }
58
- ]
59
- });
60
- }
61
- }
@@ -1,96 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- /**
6
- * @module enter/entercommand
7
- */
8
- import { Command } from '@ckeditor/ckeditor5-core';
9
- import { getCopyOnEnterAttributes } from './utils.js';
10
- /**
11
- * Enter command used by the {@link module:enter/enter~Enter Enter feature} to handle the <kbd>Enter</kbd> keystroke.
12
- */
13
- export class EnterCommand extends Command {
14
- /**
15
- * @inheritDoc
16
- */
17
- execute() {
18
- this.editor.model.change(writer => {
19
- this.enterBlock(writer);
20
- this.fire('afterExecute', { writer });
21
- });
22
- }
23
- /**
24
- * Splits a block where the document selection is placed, in the way how the <kbd>Enter</kbd> key is expected to work:
25
- *
26
- * ```
27
- * <p>Foo[]bar</p> -> <p>Foo</p><p>[]bar</p>
28
- * <p>Foobar[]</p> -> <p>Foobar</p><p>[]</p>
29
- * <p>Fo[ob]ar</p> -> <p>Fo</p><p>[]ar</p>
30
- * ```
31
- *
32
- * In some cases, the split will not happen:
33
- *
34
- * ```
35
- * // The selection parent is a limit element:
36
- * <figcaption>A[bc]d</figcaption> -> <figcaption>A[]d</figcaption>
37
- *
38
- * // The selection spans over multiple elements:
39
- * <h>x[x</h><p>y]y<p> -> <h>x</h><p>[]y</p>
40
- * ```
41
- *
42
- * @param writer Writer to use when performing the enter action.
43
- * @returns Boolean indicating if the block was split.
44
- */
45
- enterBlock(writer) {
46
- const model = this.editor.model;
47
- const selection = model.document.selection;
48
- const schema = model.schema;
49
- const isSelectionEmpty = selection.isCollapsed;
50
- const range = selection.getFirstRange();
51
- const startElement = range.start.parent;
52
- const endElement = range.end.parent;
53
- // Don't touch the roots and other limit elements.
54
- if (schema.isLimit(startElement) || schema.isLimit(endElement)) {
55
- // Delete the selected content but only if inside a single limit element.
56
- // Abort, when crossing limit elements boundary (e.g. <limit1>x[x</limit1>donttouchme<limit2>y]y</limit2>).
57
- // This is an edge case and it's hard to tell what should actually happen because such a selection
58
- // is not entirely valid.
59
- if (!isSelectionEmpty && startElement == endElement) {
60
- model.deleteContent(selection);
61
- }
62
- return false;
63
- }
64
- if (isSelectionEmpty) {
65
- const attributesToCopy = getCopyOnEnterAttributes(writer.model.schema, selection.getAttributes());
66
- splitBlock(writer, range.start);
67
- writer.setSelectionAttribute(attributesToCopy);
68
- return true;
69
- }
70
- else {
71
- const leaveUnmerged = !(range.start.isAtStart && range.end.isAtEnd);
72
- const isContainedWithinOneElement = (startElement == endElement);
73
- model.deleteContent(selection, { leaveUnmerged });
74
- if (leaveUnmerged) {
75
- // Partially selected elements.
76
- //
77
- // <h>x[xx]x</h> -> <h>x^x</h> -> <h>x</h><h>^x</h>
78
- if (isContainedWithinOneElement) {
79
- splitBlock(writer, selection.focus);
80
- return true;
81
- }
82
- // Selection over multiple elements.
83
- //
84
- // <h>x[x</h><p>y]y<p> -> <h>x^</h><p>y</p> -> <h>x</h><p>^y</p>
85
- else {
86
- writer.setSelection(endElement, 0);
87
- }
88
- }
89
- }
90
- return false;
91
- }
92
- }
93
- function splitBlock(writer, splitPos) {
94
- writer.split(splitPos);
95
- writer.setSelection(splitPos.parent.nextSibling, 0);
96
- }
@@ -1,61 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- /**
6
- * @module enter/enterobserver
7
- */
8
- import { Observer, ViewDocumentDomEventData, BubblingEventInfo } from '@ckeditor/ckeditor5-engine';
9
- import { env } from '@ckeditor/ckeditor5-utils';
10
- const ENTER_EVENT_TYPES = {
11
- insertParagraph: { isSoft: false },
12
- insertLineBreak: { isSoft: true }
13
- };
14
- /**
15
- * Enter observer introduces the {@link module:engine/view/document~ViewDocument#event:enter `Document#enter`} event.
16
- */
17
- export class EnterObserver extends Observer {
18
- /**
19
- * @inheritDoc
20
- */
21
- constructor(view) {
22
- super(view);
23
- const doc = this.document;
24
- let shiftPressed = false;
25
- doc.on('keydown', (evt, data) => {
26
- shiftPressed = data.shiftKey;
27
- });
28
- doc.on('beforeinput', (evt, data) => {
29
- if (!this.isEnabled) {
30
- return;
31
- }
32
- let inputType = data.inputType;
33
- // See https://github.com/ckeditor/ckeditor5/issues/13321.
34
- if (env.isSafari && shiftPressed && inputType == 'insertParagraph') {
35
- inputType = 'insertLineBreak';
36
- }
37
- const domEvent = data.domEvent;
38
- const enterEventSpec = ENTER_EVENT_TYPES[inputType];
39
- if (!enterEventSpec) {
40
- return;
41
- }
42
- const event = new BubblingEventInfo(doc, 'enter', data.targetRanges[0]);
43
- doc.fire(event, new ViewDocumentDomEventData(view, domEvent, {
44
- isSoft: enterEventSpec.isSoft
45
- }));
46
- // Stop `beforeinput` event if `enter` event was stopped.
47
- // https://github.com/ckeditor/ckeditor5/issues/753
48
- if (event.stop.called) {
49
- evt.stop();
50
- }
51
- });
52
- }
53
- /**
54
- * @inheritDoc
55
- */
56
- observe() { }
57
- /**
58
- * @inheritDoc
59
- */
60
- stopObserving() { }
61
- }
package/src/index.js DELETED
@@ -1,14 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- /**
6
- * @module enter
7
- */
8
- export { Enter } from './enter.js';
9
- export { ShiftEnter } from './shiftenter.js';
10
- export { EnterObserver } from './enterobserver.js';
11
- export { EnterCommand } from './entercommand.js';
12
- export { ShiftEnterCommand } from './shiftentercommand.js';
13
- export { getCopyOnEnterAttributes as _getCopyOnEnterAttributes } from './utils.js';
14
- import './augmentation.js';