@ckeditor/ckeditor5-template 0.0.1 → 37.1.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 (111) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +36 -3
  3. package/build/template.js +5 -0
  4. package/build/translations/ar.js +1 -0
  5. package/build/translations/bg.js +1 -0
  6. package/build/translations/bn.js +1 -0
  7. package/build/translations/ca.js +1 -0
  8. package/build/translations/cs.js +1 -0
  9. package/build/translations/da.js +1 -0
  10. package/build/translations/de.js +1 -0
  11. package/build/translations/el.js +1 -0
  12. package/build/translations/es.js +1 -0
  13. package/build/translations/et.js +1 -0
  14. package/build/translations/fi.js +1 -0
  15. package/build/translations/fr.js +1 -0
  16. package/build/translations/he.js +1 -0
  17. package/build/translations/hi.js +1 -0
  18. package/build/translations/hr.js +1 -0
  19. package/build/translations/hu.js +1 -0
  20. package/build/translations/id.js +1 -0
  21. package/build/translations/it.js +1 -0
  22. package/build/translations/ja.js +1 -0
  23. package/build/translations/ko.js +1 -0
  24. package/build/translations/lt.js +1 -0
  25. package/build/translations/lv.js +1 -0
  26. package/build/translations/ms.js +1 -0
  27. package/build/translations/nl.js +1 -0
  28. package/build/translations/no.js +1 -0
  29. package/build/translations/pl.js +1 -0
  30. package/build/translations/pt-br.js +1 -0
  31. package/build/translations/pt.js +1 -0
  32. package/build/translations/ro.js +1 -0
  33. package/build/translations/ru.js +1 -0
  34. package/build/translations/sk.js +1 -0
  35. package/build/translations/sr.js +1 -0
  36. package/build/translations/sv.js +1 -0
  37. package/build/translations/th.js +1 -0
  38. package/build/translations/tr.js +1 -0
  39. package/build/translations/uk.js +1 -0
  40. package/build/translations/vi.js +1 -0
  41. package/build/translations/zh-cn.js +1 -0
  42. package/build/translations/zh.js +1 -0
  43. package/ckeditor5-metadata.json +18 -0
  44. package/lang/contexts.json +8 -0
  45. package/lang/translations/ar.po +41 -0
  46. package/lang/translations/bg.po +41 -0
  47. package/lang/translations/bn.po +41 -0
  48. package/lang/translations/ca.po +41 -0
  49. package/lang/translations/cs.po +41 -0
  50. package/lang/translations/da.po +41 -0
  51. package/lang/translations/de.po +41 -0
  52. package/lang/translations/el.po +41 -0
  53. package/lang/translations/en.po +41 -0
  54. package/lang/translations/es.po +41 -0
  55. package/lang/translations/et.po +41 -0
  56. package/lang/translations/fi.po +41 -0
  57. package/lang/translations/fr.po +41 -0
  58. package/lang/translations/he.po +41 -0
  59. package/lang/translations/hi.po +41 -0
  60. package/lang/translations/hr.po +41 -0
  61. package/lang/translations/hu.po +41 -0
  62. package/lang/translations/id.po +41 -0
  63. package/lang/translations/it.po +41 -0
  64. package/lang/translations/ja.po +41 -0
  65. package/lang/translations/ko.po +41 -0
  66. package/lang/translations/lt.po +41 -0
  67. package/lang/translations/lv.po +41 -0
  68. package/lang/translations/ms.po +41 -0
  69. package/lang/translations/nl.po +41 -0
  70. package/lang/translations/no.po +41 -0
  71. package/lang/translations/pl.po +41 -0
  72. package/lang/translations/pt-br.po +41 -0
  73. package/lang/translations/pt.po +41 -0
  74. package/lang/translations/ro.po +41 -0
  75. package/lang/translations/ru.po +41 -0
  76. package/lang/translations/sk.po +41 -0
  77. package/lang/translations/sr.po +41 -0
  78. package/lang/translations/sv.po +41 -0
  79. package/lang/translations/th.po +41 -0
  80. package/lang/translations/tr.po +41 -0
  81. package/lang/translations/uk.po +41 -0
  82. package/lang/translations/vi.po +41 -0
  83. package/lang/translations/zh-cn.po +41 -0
  84. package/lang/translations/zh.po +41 -0
  85. package/package.json +36 -4
  86. package/src/augmentation.d.ts +23 -0
  87. package/src/augmentation.js +23 -0
  88. package/src/index.d.ts +13 -0
  89. package/src/index.js +23 -0
  90. package/src/template.d.ts +113 -0
  91. package/src/template.js +23 -0
  92. package/src/templatecommand.d.ts +23 -0
  93. package/src/templatecommand.js +23 -0
  94. package/src/templateediting.d.ts +26 -0
  95. package/src/templateediting.js +23 -0
  96. package/src/templateui.d.ts +29 -0
  97. package/src/templateui.js +23 -0
  98. package/src/ui/templateforminfoview.d.ts +51 -0
  99. package/src/ui/templateforminfoview.js +23 -0
  100. package/src/ui/templateformsearchfieldview.d.ts +43 -0
  101. package/src/ui/templateformsearchfieldview.js +23 -0
  102. package/src/ui/templateformview.d.ts +110 -0
  103. package/src/ui/templateformview.js +23 -0
  104. package/src/ui/templatelistbuttonview.d.ts +104 -0
  105. package/src/ui/templatelistbuttonview.js +23 -0
  106. package/src/ui/templatelistitemview.d.ts +34 -0
  107. package/src/ui/templatelistitemview.js +23 -0
  108. package/theme/icons/loupe.svg +1 -0
  109. package/theme/icons/template-generic.svg +6 -0
  110. package/theme/icons/template.svg +1 -0
  111. package/theme/template.css +235 -0
@@ -0,0 +1,41 @@
1
+ # Copyright (c) 2003-2023, 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: Thai (https://app.transifex.com/ckeditor/teams/11143/th/)\n"
16
+ "Language: th\n"
17
+ "Plural-Forms: nplurals=1; plural=0;\n"
18
+
19
+ msgctxt "A toolbar button tooltip for the template feature."
20
+ msgid "Insert template"
21
+ msgstr "แทรกเทมเพลต"
22
+
23
+ msgctxt "The main text of an information message shown to the user when there is no templates available in the template feature."
24
+ msgid "No templates available."
25
+ msgstr "ไม่มีเทมเพลต"
26
+
27
+ msgctxt "The main text of an information message shown to the user when there are no templates available for the search criteria."
28
+ msgid "No templates were found matching \"%0\"."
29
+ msgstr "ไม่พบเทมเพลตที่ตรงกับ \"%0\""
30
+
31
+ msgctxt "The secondary text of an information message shown to the user when there are no templates available for the search criteria."
32
+ msgid "Please try a different phrase or check the spelling."
33
+ msgstr "โปรดลองใช้วลีอื่นหรือตรวจสอบตัวสะกด"
34
+
35
+ msgctxt "The label of the input allowing users to search templates."
36
+ msgid "Search template"
37
+ msgstr "ค้นหาเทมเพลต"
38
+
39
+ msgctxt "The label of a button that clears the value of the search templates input."
40
+ msgid "Clear"
41
+ msgstr "ล้าง"
@@ -0,0 +1,41 @@
1
+ # Copyright (c) 2003-2023, 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: Turkish (https://app.transifex.com/ckeditor/teams/11143/tr/)\n"
16
+ "Language: tr\n"
17
+ "Plural-Forms: nplurals=2; plural=(n > 1);\n"
18
+
19
+ msgctxt "A toolbar button tooltip for the template feature."
20
+ msgid "Insert template"
21
+ msgstr "Şablon ekle"
22
+
23
+ msgctxt "The main text of an information message shown to the user when there is no templates available in the template feature."
24
+ msgid "No templates available."
25
+ msgstr "Kullanılabilir şablon yok."
26
+
27
+ msgctxt "The main text of an information message shown to the user when there are no templates available for the search criteria."
28
+ msgid "No templates were found matching \"%0\"."
29
+ msgstr "\"%0\" ile eşleşen şablon bulunamadı."
30
+
31
+ msgctxt "The secondary text of an information message shown to the user when there are no templates available for the search criteria."
32
+ msgid "Please try a different phrase or check the spelling."
33
+ msgstr "Lütfen farklı bir kelime grubu deneyin veya yazım denetimi yapın."
34
+
35
+ msgctxt "The label of the input allowing users to search templates."
36
+ msgid "Search template"
37
+ msgstr "Şablon ara"
38
+
39
+ msgctxt "The label of a button that clears the value of the search templates input."
40
+ msgid "Clear"
41
+ msgstr "Temizle"
@@ -0,0 +1,41 @@
1
+ # Copyright (c) 2003-2023, 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: Ukrainian (https://app.transifex.com/ckeditor/teams/11143/uk/)\n"
16
+ "Language: uk\n"
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
+
19
+ msgctxt "A toolbar button tooltip for the template feature."
20
+ msgid "Insert template"
21
+ msgstr "Вставити шаблон"
22
+
23
+ msgctxt "The main text of an information message shown to the user when there is no templates available in the template feature."
24
+ msgid "No templates available."
25
+ msgstr "Немає доступних шаблонів"
26
+
27
+ msgctxt "The main text of an information message shown to the user when there are no templates available for the search criteria."
28
+ msgid "No templates were found matching \"%0\"."
29
+ msgstr "Не знайдено шаблонів, які б відповідали \"%0\"."
30
+
31
+ msgctxt "The secondary text of an information message shown to the user when there are no templates available for the search criteria."
32
+ msgid "Please try a different phrase or check the spelling."
33
+ msgstr "Будь ласка, спробуйте іншу фразу або перевірте написання."
34
+
35
+ msgctxt "The label of the input allowing users to search templates."
36
+ msgid "Search template"
37
+ msgstr "Шукати шаблон"
38
+
39
+ msgctxt "The label of a button that clears the value of the search templates input."
40
+ msgid "Clear"
41
+ msgstr "Очистити"
@@ -0,0 +1,41 @@
1
+ # Copyright (c) 2003-2023, 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: Vietnamese (https://app.transifex.com/ckeditor/teams/11143/vi/)\n"
16
+ "Language: vi\n"
17
+ "Plural-Forms: nplurals=1; plural=0;\n"
18
+
19
+ msgctxt "A toolbar button tooltip for the template feature."
20
+ msgid "Insert template"
21
+ msgstr "Chèn mẫu sẵn"
22
+
23
+ msgctxt "The main text of an information message shown to the user when there is no templates available in the template feature."
24
+ msgid "No templates available."
25
+ msgstr "Không có mẫu sẵn nào."
26
+
27
+ msgctxt "The main text of an information message shown to the user when there are no templates available for the search criteria."
28
+ msgid "No templates were found matching \"%0\"."
29
+ msgstr "Không tìm thấy mẫu sẵn nào khớp với \"%0\"."
30
+
31
+ msgctxt "The secondary text of an information message shown to the user when there are no templates available for the search criteria."
32
+ msgid "Please try a different phrase or check the spelling."
33
+ msgstr "Vui lòng thử một cụm từ khác hoặc kiểm tra lại cụm từ."
34
+
35
+ msgctxt "The label of the input allowing users to search templates."
36
+ msgid "Search template"
37
+ msgstr "Tìm mẫu sẵn"
38
+
39
+ msgctxt "The label of a button that clears the value of the search templates input."
40
+ msgid "Clear"
41
+ msgstr "Xóa"
@@ -0,0 +1,41 @@
1
+ # Copyright (c) 2003-2023, 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: Chinese (China) (https://app.transifex.com/ckeditor/teams/11143/zh_CN/)\n"
16
+ "Language: zh_CN\n"
17
+ "Plural-Forms: nplurals=1; plural=0;\n"
18
+
19
+ msgctxt "A toolbar button tooltip for the template feature."
20
+ msgid "Insert template"
21
+ msgstr "插入模板"
22
+
23
+ msgctxt "The main text of an information message shown to the user when there is no templates available in the template feature."
24
+ msgid "No templates available."
25
+ msgstr "无可用的模板"
26
+
27
+ msgctxt "The main text of an information message shown to the user when there are no templates available for the search criteria."
28
+ msgid "No templates were found matching \"%0\"."
29
+ msgstr "未找到与\"%0\"匹配的模板。"
30
+
31
+ msgctxt "The secondary text of an information message shown to the user when there are no templates available for the search criteria."
32
+ msgid "Please try a different phrase or check the spelling."
33
+ msgstr "请尝试使用不同的短语或检查拼写。"
34
+
35
+ msgctxt "The label of the input allowing users to search templates."
36
+ msgid "Search template"
37
+ msgstr "搜索模板"
38
+
39
+ msgctxt "The label of a button that clears the value of the search templates input."
40
+ msgid "Clear"
41
+ msgstr "清除"
@@ -0,0 +1,41 @@
1
+ # Copyright (c) 2003-2023, 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: Chinese (Taiwan) (https://app.transifex.com/ckeditor/teams/11143/zh_TW/)\n"
16
+ "Language: zh_TW\n"
17
+ "Plural-Forms: nplurals=1; plural=0;\n"
18
+
19
+ msgctxt "A toolbar button tooltip for the template feature."
20
+ msgid "Insert template"
21
+ msgstr "插入範本"
22
+
23
+ msgctxt "The main text of an information message shown to the user when there is no templates available in the template feature."
24
+ msgid "No templates available."
25
+ msgstr "無可用範本。"
26
+
27
+ msgctxt "The main text of an information message shown to the user when there are no templates available for the search criteria."
28
+ msgid "No templates were found matching \"%0\"."
29
+ msgstr "找不到符合「%0」的範本"
30
+
31
+ msgctxt "The secondary text of an information message shown to the user when there are no templates available for the search criteria."
32
+ msgid "Please try a different phrase or check the spelling."
33
+ msgstr "請嘗試其他詞彙或確認拼寫是否正確。"
34
+
35
+ msgctxt "The label of the input allowing users to search templates."
36
+ msgid "Search template"
37
+ msgstr "搜尋範本"
38
+
39
+ msgctxt "The label of a button that clears the value of the search templates input."
40
+ msgid "Clear"
41
+ msgstr "清除"
package/package.json CHANGED
@@ -1,15 +1,47 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-template",
3
- "version": "0.0.1",
3
+ "version": "37.1.0",
4
4
  "description": "Template feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
7
7
  "ckeditor5",
8
8
  "ckeditor 5",
9
- "ckeditor5-lib"
9
+ "ckeditor5-feature",
10
+ "ckeditor5-plugin",
11
+ "WYSIWYG",
12
+ "text",
13
+ "rich-text",
14
+ "richtext",
15
+ "ckeditor",
16
+ "editor",
17
+ "editing",
18
+ "html",
19
+ "contentEditable",
20
+ "template"
10
21
  ],
22
+ "main": "src/index.js",
23
+ "dependencies": {
24
+ "ckeditor5": "^37.1.0",
25
+ "@ckeditor/ckeditor5-ui": "^37.1.0",
26
+ "lodash-es": "^4.17.15"
27
+ },
28
+ "license": "SEE LICENSE IN LICENSE.md",
11
29
  "author": "CKSource (http://cksource.com/)",
12
- "license": "GPL-2.0-or-later",
13
30
  "homepage": "https://ckeditor.com/ckeditor-5",
14
- "bugs": "https://github.com/ckeditor/ckeditor5/issues"
31
+ "files": [
32
+ "lang",
33
+ "src/**/*.js",
34
+ "src/**/*.d.ts",
35
+ "theme",
36
+ "build",
37
+ "ckeditor5-metadata.json",
38
+ "CHANGELOG.md"
39
+ ],
40
+ "scripts": {
41
+ "build": "tsc -p ./tsconfig.json",
42
+ "postversion": "npm run build",
43
+ "dll:build": "webpack"
44
+ },
45
+ "types": "src/index.d.ts",
46
+ "obfuscated": true
15
47
  }
@@ -0,0 +1,23 @@
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 { Template, TemplateCommand, TemplateEditing, TemplateUI, TemplateConfig } from './index';
6
+ declare module '@ckeditor/ckeditor5-core' {
7
+ interface PluginsMap {
8
+ [Template.pluginName]: Template;
9
+ [TemplateEditing.pluginName]: TemplateEditing;
10
+ [TemplateUI.pluginName]: TemplateUI;
11
+ }
12
+ interface CommandsMap {
13
+ insertTemplate: TemplateCommand;
14
+ }
15
+ interface EditorConfig {
16
+ /**
17
+ * The configuration of the {@link module:template/template~Template} feature.
18
+ *
19
+ * Read more in {@link module:template/template~TemplateConfig}.
20
+ */
21
+ template?: TemplateConfig;
22
+ }
23
+ }
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ *
4
+ *
5
+ *
6
+ *
7
+ * +---------------------------------------------------------------------------------+
8
+ * | |
9
+ * | Hello stranger! |
10
+ * | |
11
+ * | |
12
+ * | What you're currently looking at is the source code of a legally protected, |
13
+ * | proprietary software. Any attempts to deobfuscate / disassemble this code |
14
+ * | are forbidden and will result in legal consequences. |
15
+ * | |
16
+ * | |
17
+ * +---------------------------------------------------------------------------------+
18
+ *
19
+ *
20
+ *
21
+ *
22
+ */
23
+ export{};
package/src/index.d.ts ADDED
@@ -0,0 +1,13 @@
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 { default as Template } from './template';
6
+ export { default as TemplateCommand } from './templatecommand';
7
+ export { default as TemplateEditing } from './templateediting';
8
+ export { default as TemplateUI } from './templateui';
9
+ export type { TemplateConfig } from './template';
10
+ export declare const icons: {
11
+ templateIcon: string;
12
+ };
13
+ import './augmentation';
package/src/index.js ADDED
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ *
4
+ *
5
+ *
6
+ *
7
+ * +---------------------------------------------------------------------------------+
8
+ * | |
9
+ * | Hello stranger! |
10
+ * | |
11
+ * | |
12
+ * | What you're currently looking at is the source code of a legally protected, |
13
+ * | proprietary software. Any attempts to deobfuscate / disassemble this code |
14
+ * | are forbidden and will result in legal consequences. |
15
+ * | |
16
+ * | |
17
+ * +---------------------------------------------------------------------------------+
18
+ *
19
+ *
20
+ *
21
+ *
22
+ */
23
+ import _0x5d2ca7 from'./../theme/icons/template.svg';export{default as Template}from'./template';export{default as TemplateCommand}from'./templatecommand';export{default as TemplateEditing}from'./templateediting';export{default as TemplateUI}from'./templateui';export const icons={'templateIcon':_0x5d2ca7};import'./augmentation';
@@ -0,0 +1,113 @@
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 template/template
7
+ * @publicApi
8
+ */
9
+ import { type PluginDependencies, Plugin } from 'ckeditor5/src/core';
10
+ /**
11
+ * The template feature.
12
+ *
13
+ * For a detailed overview, check the {@glink features/template Content templates} feature guide.
14
+ */
15
+ export default class Template extends Plugin {
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ static get requires(): PluginDependencies;
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ static get pluginName(): 'Template';
24
+ }
25
+ /**
26
+ * The configuration of the template feature.
27
+ *
28
+ * ```ts
29
+ * ClassicEditor
30
+ * .create( {
31
+ * template: ... // Template feature configuration.
32
+ * } )
33
+ * .then( ... )
34
+ * .catch( ... );
35
+ *```
36
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
37
+ */
38
+ export interface TemplateConfig {
39
+ /**
40
+ * A list of all template definitions to be displayed in the `'insertTemplate'` UI dropdown.
41
+ *
42
+ * An example configuration:
43
+ *
44
+ * ```json
45
+ * {
46
+ * template: {
47
+ * definitions: [
48
+ * {
49
+ * title: 'Issue acknowledgement (plain text)',
50
+ * data: 'Dear customer, thank you for your report! The issue is currently being worked on by our development team.'
51
+ * },
52
+ * {
53
+ * title: 'Signature (multi-line)',
54
+ * data: '<p><b>Jane Doe</b></p><p>Marketing Specialist at <a href="https://example.com>Example.com</a></p>',
55
+ * description: 'Author signature with the link to the website.'
56
+ * },
57
+ * {
58
+ * title: 'Example table',
59
+ * data: '<table><tr><td>Cell #1</td><td></td></tr><tr><td></td><td>Cell #2</td></tr></table>',
60
+ * icon: '<svg viewBox="0 0 45 45" xmlns="http://www.w3.org/2000/svg">...</svg>',
61
+ * description: 'This template inserts a table.'
62
+ * },
63
+ * {
64
+ * title: 'Insert userAgent data',
65
+ * data: navigator.userAgent
66
+ * },
67
+ * {
68
+ * title: 'Insert translate to English link (function)',
69
+ * data: () => '<a href="' + location.href + '/en" title="Translate to English">Translate to English</a>'
70
+ * },
71
+ * // ...
72
+ * ]
73
+ * }
74
+ * }
75
+ * ```
76
+ */
77
+ definitions?: Array<TemplateDefinition>;
78
+ }
79
+ /**
80
+ * An object describing a single template definition.
81
+ *
82
+ * ```json
83
+ * {
84
+ * // Mandatory fields:
85
+ * title: 'Example template',
86
+ * data: '<table><tr><td>Cell #1</td><td></td></tr><tr><td></td><td>Cell #2</td></tr></table>',
87
+ *
88
+ * // Optional configuration:
89
+ * icon: '<svg viewBox="0 0 45 45" xmlns="http://www.w3.org/2000/svg">...</svg>',
90
+ * description: 'This template inserts a table.'
91
+ * }
92
+ * ```
93
+ */
94
+ export type TemplateDefinition = {
95
+ /**
96
+ * The title of the template.
97
+ */
98
+ title: string;
99
+ /**
100
+ * An HTML string to be inserted into the document or a callback function that returns an HTML string
101
+ * to be inserted into the document when the template is selected.
102
+ */
103
+ data: () => string | string;
104
+ /**
105
+ * An optional SVG string representing the icon of the template. The default size of the icon is 45x45 pixels.
106
+ * Be sure to set the correct `viewBox` attribute in the icon source. If not provided, a generic icon will be used instead.
107
+ */
108
+ icon?: string;
109
+ /**
110
+ * An optional long description of the template presented to the users.
111
+ */
112
+ description?: string;
113
+ };
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ *
4
+ *
5
+ *
6
+ *
7
+ * +---------------------------------------------------------------------------------+
8
+ * | |
9
+ * | Hello stranger! |
10
+ * | |
11
+ * | |
12
+ * | What you're currently looking at is the source code of a legally protected, |
13
+ * | proprietary software. Any attempts to deobfuscate / disassemble this code |
14
+ * | are forbidden and will result in legal consequences. |
15
+ * | |
16
+ * | |
17
+ * +---------------------------------------------------------------------------------+
18
+ *
19
+ *
20
+ *
21
+ *
22
+ */
23
+ var _0x10b8=['Template'];(function(_0xcf9fb,_0x10b846){var _0x3fdf66=function(_0x1c08ed){while(--_0x1c08ed){_0xcf9fb['push'](_0xcf9fb['shift']());}};_0x3fdf66(++_0x10b846);}(_0x10b8,0x67));var _0x3fdf=function(_0xcf9fb,_0x10b846){_0xcf9fb=_0xcf9fb-0x0;var _0x3fdf66=_0x10b8[_0xcf9fb];return _0x3fdf66;};import{Plugin as _0x15c8c8}from'ckeditor5/src/core';import _0x547da5 from'./templateediting';import _0xecc7fb from'./templateui';export default class o extends _0x15c8c8{static get['requires'](){return[_0x547da5,_0xecc7fb];}static get['pluginName'](){return _0x3fdf('0x0');}}
@@ -0,0 +1,23 @@
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 template/templatecommand
7
+ * @publicApi
8
+ */
9
+ import { Command } from 'ckeditor5/src/core';
10
+ /**
11
+ * The template command.
12
+ *
13
+ * Inserts a template into the editor content.
14
+ */
15
+ export default class TemplateCommand extends Command {
16
+ /**
17
+ * Inserts the template data at the position of the selection.
18
+ *
19
+ * @fires execute
20
+ * @param templateData Template data should be a raw HTML string or a function that returns one.
21
+ */
22
+ execute(templateData: string | Function): void;
23
+ }
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ *
4
+ *
5
+ *
6
+ *
7
+ * +---------------------------------------------------------------------------------+
8
+ * | |
9
+ * | Hello stranger! |
10
+ * | |
11
+ * | |
12
+ * | What you're currently looking at is the source code of a legally protected, |
13
+ * | proprietary software. Any attempts to deobfuscate / disassemble this code |
14
+ * | are forbidden and will result in legal consequences. |
15
+ * | |
16
+ * | |
17
+ * +---------------------------------------------------------------------------------+
18
+ *
19
+ *
20
+ *
21
+ *
22
+ */
23
+ const _0xe6f9=['editor','htmlProcessor','toModel','execute','change','data','toView','string','insertContent'];(function(_0xd5ab9d,_0xe6f9fd){const _0x28a57b=function(_0x3175b3){while(--_0x3175b3){_0xd5ab9d['push'](_0xd5ab9d['shift']());}};_0x28a57b(++_0xe6f9fd);}(_0xe6f9,0x9c));const _0x28a5=function(_0xd5ab9d,_0xe6f9fd){_0xd5ab9d=_0xd5ab9d-0x0;let _0x28a57b=_0xe6f9[_0xd5ab9d];return _0x28a57b;};import{Command as _0x20fc01}from'ckeditor5/src/core';export default class c extends _0x20fc01{[_0x28a5('0x0')](_0x5509c5){const {model:_0x114b80}=this[_0x28a5('0x6')];let _0x26a9d2;switch(typeof _0x5509c5){case'string':_0x26a9d2=_0x5509c5;break;case'function':_0x26a9d2=_0x5509c5();}_0x28a5('0x4')==typeof _0x26a9d2&&_0x114b80[_0x28a5('0x1')](()=>{const _0x2ccb26=this['editor'][_0x28a5('0x2')][_0x28a5('0x7')][_0x28a5('0x3')](_0x26a9d2),_0x6a33c3=this[_0x28a5('0x6')]['data'][_0x28a5('0x8')](_0x2ccb26);_0x114b80[_0x28a5('0x5')](_0x6a33c3);});}}
@@ -0,0 +1,26 @@
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 template/templateediting
7
+ */
8
+ import { Plugin, type Editor } from 'ckeditor5/src/core';
9
+ /**
10
+ * The template editing plugin.
11
+ */
12
+ export default class TemplateEditing extends Plugin {
13
+ licenseKey: string;
14
+ /**
15
+ * @inheritDoc
16
+ */
17
+ static get pluginName(): 'TemplateEditing';
18
+ /**
19
+ * @inheritDoc
20
+ */
21
+ constructor(editor: Editor);
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ init(): void;
26
+ }
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ *
4
+ *
5
+ *
6
+ *
7
+ * +---------------------------------------------------------------------------------+
8
+ * | |
9
+ * | Hello stranger! |
10
+ * | |
11
+ * | |
12
+ * | What you're currently looking at is the source code of a legally protected, |
13
+ * | proprietary software. Any attempts to deobfuscate / disassemble this code |
14
+ * | are forbidden and will result in legal consequences. |
15
+ * | |
16
+ * | |
17
+ * +---------------------------------------------------------------------------------+
18
+ *
19
+ *
20
+ *
21
+ *
22
+ */
23
+ const _0x22ed=['_licenseKeyCheckInterval','config','templateLicenseKeyTrial','templateLicenseKeyValid','TemplateEditing','licenseKey','templateLicenseKeyInvalid','init','get','templateLicenseKeyTrialLimit:operations','pluginName','editor','info','You\x20are\x20using\x20the\x20trial\x20version\x20of\x20CKEditor\x205\x20template\x20plugin\x20with\x20limited\x20usage.\x20Make\x20sure\x20you\x20will\x20not\x20use\x20it\x20in\x20the\x20production\x20environment.','template-invalid-license-key','add'];(function(_0x233ece,_0x22edc6){const _0x407f19=function(_0x59e0de){while(--_0x59e0de){_0x233ece['push'](_0x233ece['shift']());}};_0x407f19(++_0x22edc6);}(_0x22ed,0xf8));const _0x407f=function(_0x233ece,_0x22edc6){_0x233ece=_0x233ece-0x0;let _0x407f19=_0x22ed[_0x233ece];return _0x407f19;};import{Plugin as _0xb765d2}from'ckeditor5/src/core';import{CKEditorError as _0x271377}from'ckeditor5/src/utils';import _0x996b8c from'./templatecommand';export default class i extends _0xb765d2{static get[_0x407f('0x2')](){return _0x407f('0xc');}constructor(_0x56099f){super(_0x56099f),this['_licenseKeyCheckInterval']=null;}[_0x407f('0xf')](){const {editor:_0x74999a}=this;_0x74999a['commands'][_0x407f('0x7')]('insertTemplate',new _0x996b8c(_0x74999a)),this[_0x407f('0xd')]=_0x74999a[_0x407f('0x9')][_0x407f('0x0')](_0x407f('0xd'));const _0x11c3c7=this[_0x407f('0x3')];this[_0x407f('0x8')]=setInterval(()=>{let _0x1c42db;for(const _0x4ea2a0 in _0x11c3c7){const _0x317e3e=_0x4ea2a0,_0x5976f2=_0x11c3c7[_0x317e3e];if(_0x407f('0xa')===_0x5976f2||'templateLicenseKeyInvalid'===_0x5976f2||_0x407f('0xb')===_0x5976f2||_0x407f('0x1')===_0x5976f2){delete _0x11c3c7[_0x317e3e],_0x1c42db=_0x5976f2;break;}}if(_0x407f('0xe')===_0x1c42db)throw clearInterval(this[_0x407f('0x8')]),new _0x271377(_0x407f('0x6'),null);if(_0x407f('0xa')===_0x1c42db&&console[_0x407f('0x4')](_0x407f('0x5')),_0x407f('0x1')===_0x1c42db)throw clearInterval(this[_0x407f('0x8')]),new _0x271377('template-trial-license-key-reached-limit-changes',null);'templateLicenseKeyValid'===_0x1c42db&&clearInterval(this['_licenseKeyCheckInterval']);},0x3e8);}}