@ckeditor/ckeditor5-slash-command 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 (63) hide show
  1. package/LICENSE.md +2 -2
  2. package/README.md +7 -7
  3. package/build/slash-command.js +1 -1
  4. package/build/translations/pt-br.js +1 -1
  5. package/lang/contexts.json +2 -1
  6. package/lang/translations/ar.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.po +1 -0
  13. package/lang/translations/el.po +1 -0
  14. package/lang/translations/en-au.po +1 -0
  15. package/lang/translations/en.po +1 -0
  16. package/lang/translations/es.po +1 -0
  17. package/lang/translations/et.po +1 -0
  18. package/lang/translations/fi.po +1 -0
  19. package/lang/translations/fr.po +1 -0
  20. package/lang/translations/gl.po +1 -0
  21. package/lang/translations/he.po +1 -0
  22. package/lang/translations/hi.po +1 -0
  23. package/lang/translations/hr.po +1 -0
  24. package/lang/translations/hu.po +1 -0
  25. package/lang/translations/id.po +1 -0
  26. package/lang/translations/it.po +1 -0
  27. package/lang/translations/ja.po +1 -0
  28. package/lang/translations/ko.po +1 -0
  29. package/lang/translations/lt.po +1 -0
  30. package/lang/translations/lv.po +1 -0
  31. package/lang/translations/ms.po +1 -0
  32. package/lang/translations/nl.po +1 -0
  33. package/lang/translations/no.po +1 -0
  34. package/lang/translations/pl.po +1 -0
  35. package/lang/translations/pt-br.po +3 -2
  36. package/lang/translations/pt.po +1 -0
  37. package/lang/translations/ro.po +1 -0
  38. package/lang/translations/ru.po +1 -0
  39. package/lang/translations/sk.po +1 -0
  40. package/lang/translations/sr.po +1 -0
  41. package/lang/translations/sv.po +1 -0
  42. package/lang/translations/th.po +1 -0
  43. package/lang/translations/tr.po +1 -0
  44. package/lang/translations/uk.po +1 -0
  45. package/lang/translations/uz.po +1 -0
  46. package/lang/translations/vi.po +1 -0
  47. package/lang/translations/zh-cn.po +1 -0
  48. package/lang/translations/zh.po +1 -0
  49. package/package.json +14 -17
  50. package/src/augmentation.d.ts +21 -21
  51. package/src/index.d.ts +13 -13
  52. package/src/slashcommand.d.ts +29 -29
  53. package/src/slashcommand.js +1 -1
  54. package/src/slashcommandconfig.d.ts +242 -242
  55. package/src/slashcommandconfig.js +1 -1
  56. package/src/slashcommandediting.d.ts +41 -41
  57. package/src/slashcommandediting.js +1 -1
  58. package/src/slashcommandeditorconfig.d.ts +96 -96
  59. package/src/slashcommandui.d.ts +33 -33
  60. package/src/slashcommandui.js +1 -1
  61. package/src/ui/slashcommandbuttonview.d.ts +31 -31
  62. package/src/ui/slashcommandbuttonview.js +1 -1
  63. package/theme/slashcommand.css +4 -0
@@ -1,242 +1,242 @@
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 slash-command/slashcommandconfig
7
- * @publicApi
8
- */
9
- import { Plugin, type Editor } from 'ckeditor5/src/core';
10
- import './slashcommandeditorconfig';
11
- /**
12
- * This plugin takes care of the configuration for {@link module:slash-command/slashcommand~SlashCommand}:
13
- *
14
- * * It manages the configuration of slash commands in the editor.
15
- * * It provides default slash commands for common editor features.
16
- * * It allows defining extra commands and reducing the list of defaults using the editor configuration.
17
- * See {@link module:slash-command/slashcommandconfig~SlashCommandConfig} to learn more.
18
- *
19
- * @extends module:core/plugin~Plugin
20
- */
21
- export default class SlashCommandConfig extends Plugin {
22
- /**
23
- * @inheritDoc
24
- */
25
- static get pluginName(): "SlashCommandConfig";
26
- /**
27
- * @inheritDoc
28
- */
29
- constructor(editor: Editor);
30
- /**
31
- * @inheritDoc
32
- */
33
- afterInit(): void;
34
- /**
35
- * Returns an array of slash command definitions enabled in the editor.
36
- *
37
- * This method takes into account the following:
38
- * * The {@link module:slash-command/slashcommandconfig~SlashCommandConfig#getDefaultCommands list of default commands}.
39
- * * The presence of {@link module:core/editor/editorconfig~EditorConfig#plugins editor features} (plugins).
40
- * * The {@link module:slash-command/slashcommandeditorconfig~SlashCommandEditorConfig#removeCommands} configuration.
41
- * * The {@link module:slash-command/slashcommandeditorconfig~SlashCommandEditorConfig#extraCommands} configuration.
42
- */
43
- getAllowedCommands(): Array<SlashCommandDefinition>;
44
- /**
45
- * Returns a list of default slash command {@link module:slash-command/slashcommandconfig~SlashCommandDefinition definitions}
46
- * for common editor features. The available definitions are as follows:
47
- *
48
- * ```js
49
- * [
50
- * {
51
- * id: 'blockQuote',
52
- * commandName: 'blockQuote',
53
- * title: t( 'Block quote' ),
54
- * // ...
55
- * },
56
- * {
57
- * id: 'bulletedList',
58
- * commandName: 'bulletedList',
59
- * title: t( 'Bulleted list' ),
60
- * // ...
61
- * },
62
- * {
63
- * id: 'codeBlock',
64
- * commandName: 'codeBlock',
65
- * title: t( 'Insert code block' ),
66
- * // ...
67
- * },
68
- * {
69
- * id: 'ckbox',
70
- * commandName: 'ckbox',
71
- * title: t( 'Open file manager' ),
72
- * // ...
73
- * },
74
- * {
75
- * id: 'ckfinder',
76
- * commandName: 'ckfinder',
77
- * title: t( 'Insert image' ),
78
- * // ...
79
- * },
80
- * {
81
- * id: 'heading1',
82
- * commandName: 'heading',
83
- * title: t( 'Heading 1' ),
84
- * // ...
85
- * },
86
- * {
87
- * id: 'heading2',
88
- * commandName: 'heading',
89
- * title: t( 'Heading 2' ),
90
- * // ...
91
- * },
92
- * {
93
- * id: 'heading3',
94
- * commandName: 'heading',
95
- * title: t( 'Heading 3' ),
96
- * // ...
97
- * },
98
- * {
99
- * id: 'heading4',
100
- * commandName: 'heading',
101
- * title: t( 'Heading 4' ),
102
- * // ...
103
- * },
104
- * {
105
- * id: 'heading5',
106
- * commandName: 'heading',
107
- * title: t( 'Heading 5' ),
108
- * // ...
109
- * },
110
- * {
111
- * id: 'heading6',
112
- * commandName: 'heading',
113
- * title: t( 'Heading 6' ),
114
- * // ...
115
- * },
116
- * {
117
- * id: 'horizontalLine',
118
- * commandName: 'horizontalLine',
119
- * title: t( 'Horizontal line' ),
120
- * // ...
121
- * },
122
- * {
123
- * id: 'htmlEmbed',
124
- * commandName: 'htmlEmbed',
125
- * title: t( 'Insert HTML' ),
126
- * // ...
127
- * },
128
- * {
129
- * id: 'indent',
130
- * commandName: 'indent',
131
- * title: t( 'Increase indent' ),
132
- * // ...
133
- * },
134
- * {
135
- * id: 'insertMermaidCommand',
136
- * commandName: 'insertMermaidCommand',
137
- * title: t( 'Insert Mermaid diagram' ),
138
- * // ...
139
- * },
140
- * {
141
- * id: 'insertTable',
142
- * commandName: 'insertTable',
143
- * title: t( 'Insert table' ),
144
- * // ...
145
- * },
146
- * {
147
- * id: 'insertTableOfContents',
148
- * commandName: 'insertTableOfContents',
149
- * title: t( 'Table of contents' ),
150
- * // ...
151
- * },
152
- * {
153
- * id: 'numberedList',
154
- * commandName: 'numberedList',
155
- * title: t( 'Numbered list' ),
156
- * // ...
157
- * },
158
- * {
159
- * id: 'outdent',
160
- * commandName: 'outdent',
161
- * title: t( 'Decrease indent' ),
162
- * // ...
163
- * },
164
- * {
165
- * id: 'paragraph',
166
- * commandName: 'paragraph',
167
- * title: t( 'Paragraph' ),
168
- * // ...
169
- * },
170
- * {
171
- * id: 'todoList',
172
- * commandName: 'todoList',
173
- * title: t( 'To-do list' ),
174
- * // ...
175
- * }
176
- * ]
177
- */
178
- getDefaultCommands(): Array<SlashCommandDefinition>;
179
- }
180
- /**
181
- * An object describing a single command definition in the configuration.
182
- */
183
- export interface SlashCommandDefinition {
184
- /**
185
- * A unique ID matched with the text that follows the slash ("/") character typed by the user,
186
- * e.g. 'blockQuote', 'heading1'. See {@link module:slash-command/slashcommandconfig~SlashCommandDefinition#aliases}
187
- * to learn about slash command aliases that provide a similar functionality.
188
- */
189
- id: string;
190
- /**
191
- * The name of the command to be executed if the `execute` property was not provided,
192
- * for example, 'blockQuote', 'heading'. See {@link module:core/editor/editor~Editor#commands} to learn more about available commands.
193
- */
194
- commandName?: string;
195
- /**
196
- * A meaningful title for the command displayed in a dropdown list of possible commands. It can be a string
197
- * or a callback function returning a string.
198
- */
199
- title: Function | string;
200
- /**
201
- * An optional description for the command. Useful when the title is not descriptive enough.
202
- */
203
- description?: string;
204
- /**
205
- * An SVG string representing the icon of the command. If not provided, a generic icon will be used instead.
206
- * The default size of the icon is 20x20 pixels. Be sure to set the correct `viewBox` attribute in the icon source.
207
- *
208
- * See {@link module:slash-command/slashcommandconfig~SlashCommandDefinition#isIconColorInherited}.
209
- */
210
- icon?: string;
211
- /**
212
- * By default, slash command icons are monochromatic and inherit the color of the text in the editor UI.
213
- * Setting this property to `false` disables this inheritance and allows the use of complex (colorful) icons.
214
- *
215
- * Learn more in {@link module:ui/icon/iconview~IconView#isColorInherited}.
216
- */
217
- isIconColorInherited?: boolean;
218
- /**
219
- * An optional list of aliases (extending the base
220
- * {@link module:slash-command/slashcommandconfig~SlashCommandDefinition#id}) to be used when filtering the list of slash commands
221
- * based on the text that follows the slash ("/") character.
222
- */
223
- aliases?: Array<string>;
224
- /**
225
- * A callback function defining custom logic to decide if the command should be displayed
226
- * in the dropdown list. If not provided, the default command's {@link module:core/command~Command#isEnabled} property is used instead.
227
- * If it's also unavailable, it falls back to `true`. This property is checked when a user types the slash ("/") character
228
- * or changes the text that follows it.
229
- *
230
- * This callback gets an {@link module:core/editor/editor~Editor} instance as a parameter.
231
- */
232
- isEnabled?: Function;
233
- /**
234
- * A callback function defining custom logic for executing the command. If not provided, the default
235
- * command's {@link module:core/command~Command#execute} is used instead. Custom logic is useful especially when the slash command
236
- * requires some arguments (acts like a wrapper) or combines some complex logic. This property is obligatory if
237
- * {@link module:slash-command/slashcommandconfig~SlashCommandDefinition#commandName} was not passed.
238
- *
239
- * This callback gets an {@link module:core/editor/editor~Editor} instance as a parameter.
240
- */
241
- execute?: Function;
242
- }
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 slash-command/slashcommandconfig
7
+ * @publicApi
8
+ */
9
+ import { Plugin, type Editor } from 'ckeditor5/src/core';
10
+ import './slashcommandeditorconfig';
11
+ /**
12
+ * This plugin takes care of the configuration for {@link module:slash-command/slashcommand~SlashCommand}:
13
+ *
14
+ * * It manages the configuration of slash commands in the editor.
15
+ * * It provides default slash commands for common editor features.
16
+ * * It allows defining extra commands and reducing the list of defaults using the editor configuration.
17
+ * See {@link module:slash-command/slashcommandconfig~SlashCommandConfig} to learn more.
18
+ *
19
+ * @extends module:core/plugin~Plugin
20
+ */
21
+ export default class SlashCommandConfig extends Plugin {
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ static get pluginName(): "SlashCommandConfig";
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ constructor(editor: Editor);
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ afterInit(): void;
34
+ /**
35
+ * Returns an array of slash command definitions enabled in the editor.
36
+ *
37
+ * This method takes into account the following:
38
+ * * The {@link module:slash-command/slashcommandconfig~SlashCommandConfig#getDefaultCommands list of default commands}.
39
+ * * The presence of {@link module:core/editor/editorconfig~EditorConfig#plugins editor features} (plugins).
40
+ * * The {@link module:slash-command/slashcommandeditorconfig~SlashCommandEditorConfig#removeCommands} configuration.
41
+ * * The {@link module:slash-command/slashcommandeditorconfig~SlashCommandEditorConfig#extraCommands} configuration.
42
+ */
43
+ getAllowedCommands(): Array<SlashCommandDefinition>;
44
+ /**
45
+ * Returns a list of default slash command {@link module:slash-command/slashcommandconfig~SlashCommandDefinition definitions}
46
+ * for common editor features. The available definitions are as follows:
47
+ *
48
+ * ```js
49
+ * [
50
+ * {
51
+ * id: 'blockQuote',
52
+ * commandName: 'blockQuote',
53
+ * title: t( 'Block quote' ),
54
+ * // ...
55
+ * },
56
+ * {
57
+ * id: 'bulletedList',
58
+ * commandName: 'bulletedList',
59
+ * title: t( 'Bulleted list' ),
60
+ * // ...
61
+ * },
62
+ * {
63
+ * id: 'codeBlock',
64
+ * commandName: 'codeBlock',
65
+ * title: t( 'Insert code block' ),
66
+ * // ...
67
+ * },
68
+ * {
69
+ * id: 'ckbox',
70
+ * commandName: 'ckbox',
71
+ * title: t( 'Open file manager' ),
72
+ * // ...
73
+ * },
74
+ * {
75
+ * id: 'ckfinder',
76
+ * commandName: 'ckfinder',
77
+ * title: t( 'Insert image' ),
78
+ * // ...
79
+ * },
80
+ * {
81
+ * id: 'heading1',
82
+ * commandName: 'heading',
83
+ * title: t( 'Heading 1' ),
84
+ * // ...
85
+ * },
86
+ * {
87
+ * id: 'heading2',
88
+ * commandName: 'heading',
89
+ * title: t( 'Heading 2' ),
90
+ * // ...
91
+ * },
92
+ * {
93
+ * id: 'heading3',
94
+ * commandName: 'heading',
95
+ * title: t( 'Heading 3' ),
96
+ * // ...
97
+ * },
98
+ * {
99
+ * id: 'heading4',
100
+ * commandName: 'heading',
101
+ * title: t( 'Heading 4' ),
102
+ * // ...
103
+ * },
104
+ * {
105
+ * id: 'heading5',
106
+ * commandName: 'heading',
107
+ * title: t( 'Heading 5' ),
108
+ * // ...
109
+ * },
110
+ * {
111
+ * id: 'heading6',
112
+ * commandName: 'heading',
113
+ * title: t( 'Heading 6' ),
114
+ * // ...
115
+ * },
116
+ * {
117
+ * id: 'horizontalLine',
118
+ * commandName: 'horizontalLine',
119
+ * title: t( 'Horizontal line' ),
120
+ * // ...
121
+ * },
122
+ * {
123
+ * id: 'htmlEmbed',
124
+ * commandName: 'htmlEmbed',
125
+ * title: t( 'Insert HTML' ),
126
+ * // ...
127
+ * },
128
+ * {
129
+ * id: 'indent',
130
+ * commandName: 'indent',
131
+ * title: t( 'Increase indent' ),
132
+ * // ...
133
+ * },
134
+ * {
135
+ * id: 'insertMermaidCommand',
136
+ * commandName: 'insertMermaidCommand',
137
+ * title: t( 'Insert Mermaid diagram' ),
138
+ * // ...
139
+ * },
140
+ * {
141
+ * id: 'insertTable',
142
+ * commandName: 'insertTable',
143
+ * title: t( 'Insert table' ),
144
+ * // ...
145
+ * },
146
+ * {
147
+ * id: 'insertTableOfContents',
148
+ * commandName: 'insertTableOfContents',
149
+ * title: t( 'Table of contents' ),
150
+ * // ...
151
+ * },
152
+ * {
153
+ * id: 'numberedList',
154
+ * commandName: 'numberedList',
155
+ * title: t( 'Numbered list' ),
156
+ * // ...
157
+ * },
158
+ * {
159
+ * id: 'outdent',
160
+ * commandName: 'outdent',
161
+ * title: t( 'Decrease indent' ),
162
+ * // ...
163
+ * },
164
+ * {
165
+ * id: 'paragraph',
166
+ * commandName: 'paragraph',
167
+ * title: t( 'Paragraph' ),
168
+ * // ...
169
+ * },
170
+ * {
171
+ * id: 'todoList',
172
+ * commandName: 'todoList',
173
+ * title: t( 'To-do list' ),
174
+ * // ...
175
+ * }
176
+ * ]
177
+ */
178
+ getDefaultCommands(): Array<SlashCommandDefinition>;
179
+ }
180
+ /**
181
+ * An object describing a single command definition in the configuration.
182
+ */
183
+ export interface SlashCommandDefinition {
184
+ /**
185
+ * A unique ID matched with the text that follows the slash ("/") character typed by the user,
186
+ * e.g. 'blockQuote', 'heading1'. See {@link module:slash-command/slashcommandconfig~SlashCommandDefinition#aliases}
187
+ * to learn about slash command aliases that provide a similar functionality.
188
+ */
189
+ id: string;
190
+ /**
191
+ * The name of the command to be executed if the `execute` property was not provided,
192
+ * for example, 'blockQuote', 'heading'. See {@link module:core/editor/editor~Editor#commands} to learn more about available commands.
193
+ */
194
+ commandName?: string;
195
+ /**
196
+ * A meaningful title for the command displayed in a dropdown list of possible commands. It can be a string
197
+ * or a callback function returning a string.
198
+ */
199
+ title: Function | string;
200
+ /**
201
+ * An optional description for the command. Useful when the title is not descriptive enough.
202
+ */
203
+ description?: string;
204
+ /**
205
+ * An SVG string representing the icon of the command. If not provided, a generic icon will be used instead.
206
+ * The default size of the icon is 20x20 pixels. Be sure to set the correct `viewBox` attribute in the icon source.
207
+ *
208
+ * See {@link module:slash-command/slashcommandconfig~SlashCommandDefinition#isIconColorInherited}.
209
+ */
210
+ icon?: string;
211
+ /**
212
+ * By default, slash command icons are monochromatic and inherit the color of the text in the editor UI.
213
+ * Setting this property to `false` disables this inheritance and allows the use of complex (colorful) icons.
214
+ *
215
+ * Learn more in {@link module:ui/icon/iconview~IconView#isColorInherited}.
216
+ */
217
+ isIconColorInherited?: boolean;
218
+ /**
219
+ * An optional list of aliases (extending the base
220
+ * {@link module:slash-command/slashcommandconfig~SlashCommandDefinition#id}) to be used when filtering the list of slash commands
221
+ * based on the text that follows the slash ("/") character.
222
+ */
223
+ aliases?: Array<string>;
224
+ /**
225
+ * A callback function defining custom logic to decide if the command should be displayed
226
+ * in the dropdown list. If not provided, the default command's {@link module:core/command~Command#isEnabled} property is used instead.
227
+ * If it's also unavailable, it falls back to `true`. This property is checked when a user types the slash ("/") character
228
+ * or changes the text that follows it.
229
+ *
230
+ * This callback gets an {@link module:core/editor/editor~Editor} instance as a parameter.
231
+ */
232
+ isEnabled?: Function;
233
+ /**
234
+ * A callback function defining custom logic for executing the command. If not provided, the default
235
+ * command's {@link module:core/command~Command#execute} is used instead. Custom logic is useful especially when the slash command
236
+ * requires some arguments (acts like a wrapper) or combines some complex logic. This property is obligatory if
237
+ * {@link module:slash-command/slashcommandconfig~SlashCommandDefinition#commandName} was not passed.
238
+ *
239
+ * This callback gets an {@link module:core/editor/editor~Editor} instance as a parameter.
240
+ */
241
+ execute?: Function;
242
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- import{Plugin as _0x1d0cc4,icons as _0x5f0ce9}from'ckeditor5/src/core';import{CKEditorError as _0x486596}from'ckeditor5/src/utils';import _0x8009b7 from'@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg';import _0x4caf3b from'@ckeditor/ckeditor5-code-block/theme/icons/codeblock.svg';import _0x9cf3ae from'@ckeditor/ckeditor5-ckbox/theme/icons/browse-files.svg';import _0x31bf1f from'@ckeditor/ckeditor5-ckfinder/theme/icons/browse-files.svg';import _0x1f006f from'@ckeditor/ckeditor5-heading/theme/icons/heading1.svg';import _0x137b08 from'@ckeditor/ckeditor5-heading/theme/icons/heading2.svg';import _0x1fe488 from'@ckeditor/ckeditor5-heading/theme/icons/heading3.svg';import _0x540840 from'@ckeditor/ckeditor5-heading/theme/icons/heading4.svg';import _0xa51c26 from'@ckeditor/ckeditor5-heading/theme/icons/heading5.svg';import _0xfea84 from'@ckeditor/ckeditor5-heading/theme/icons/heading6.svg';import _0x4562c0 from'@ckeditor/ckeditor5-horizontal-line/theme/icons/horizontalline.svg';import _0x5da4a8 from'@ckeditor/ckeditor5-html-embed/theme/icons/html.svg';import _0x5ec3ec from'@ckeditor/ckeditor5-indent/theme/icons/indent.svg';import _0x11473e from'@ckeditor/ckeditor5-table/theme/icons/table.svg';import _0x45a28b from'@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg';import _0x3164b3 from'@ckeditor/ckeditor5-indent/theme/icons/outdent.svg';import _0x41c5a5 from'@ckeditor/ckeditor5-document-outline/theme/icons/table-of-contents.svg';import _0x332649 from'@ckeditor/ckeditor5-list/theme/icons/todolist.svg';import'./slashcommandeditorconfig';export default class T extends _0x1d0cc4{static get['pluginName'](){return'SlashCommandConfig';}constructor(_0x2643da){super(_0x2643da),this['_allowedCommands']=null;}['afterInit'](){const _0x19c6ab=this['editor']['config']['get']('slashCommand.removeCommands')||[],_0x3f66b8=function(_0x2504c3){let _0x44892b=['heading4','heading5','heading6'];if(_0x2504c3){const _0x59c45e=_0x2504c3['map'](_0x5a183e=>_0x5a183e['model']);_0x44892b=['heading1','heading2','heading3','heading4','heading5','heading6']['filter'](_0x15ba3a=>!_0x59c45e['includes'](_0x15ba3a));}return _0x44892b;}(this['editor']['config']['get']('heading.options'));let _0x15713=this['getDefaultCommands']()['filter'](_0x32f4bb=>!_0x3f66b8['includes'](_0x32f4bb['id']))['filter'](_0x3332f9=>!_0x19c6ab['includes'](_0x3332f9['commandName']));const _0x3b462f=this['editor']['config']['get']('slashCommand.extraCommands');_0x3b462f&&_0x3b462f['length']&&(_0x15713=_0x15713['concat'](_0x3b462f));const _0x3ab755=this['editor']['config']['get']('template.definitions');_0x3ab755&&_0x3ab755['length']&&(_0x15713=_0x15713['concat'](function(_0x26b741){return _0x26b741['map'](_0x29c654=>{const {title:_0x5e7e15,icon:_0x57e33b,description:_0x4913c8,data:_0x1d86c2}=_0x29c654,_0x12a601={'id':H(_0x5e7e15,'template'),'commandName':'insertTemplate','execute':_0x25beac=>{_0x25beac['execute']('insertTemplate',_0x1d86c2);},'description':_0x4913c8,'icon':_0x57e33b,'title':_0x5e7e15};return _0x57e33b&&(_0x12a601['isIconColorInherited']=!0x1),_0x12a601;});}(_0x3ab755)));const _0x2cbec0=this['editor']['config']['get']('style.definitions');_0x2cbec0&&_0x2cbec0['length']&&(_0x15713=_0x15713['concat'](function(_0x496f17){return _0x496f17['map'](_0x4390c0=>({'id':H(_0x4390c0['name'],'style'),'commandName':'style','execute':_0x247fff=>{_0x247fff['execute']('style',{'styleName':_0x4390c0['name']});},'isEnabled':_0x543910=>{const _0x1ab3ad=_0x543910['commands']['get']('style');return _0x1ab3ad['isEnabled']&&_0x1ab3ad['enabledStyles']['includes'](_0x4390c0['name']);},'title':_0x4390c0['name']}));}(_0x2cbec0)));const _0x116493=_0x15713['filter'](_0x29e126=>!_0x29e126['commandName']||void 0x0!==this['editor']['commands']['get'](_0x29e126['commandName'])),_0x2b20f7=[];for(const _0xe298ad of _0x116493)_0x2b20f7['push']({'id':_0xe298ad['id'],'commandName':_0xe298ad['commandName'],'title':'function'==typeof _0xe298ad['title']?_0xe298ad['title'](this['editor']):_0xe298ad['title'],'description':_0xe298ad['description'],'icon':_0xe298ad['icon'],'isIconColorInherited':_0xe298ad['isIconColorInherited'],'aliases':_0xe298ad['aliases'],'isEnabled':()=>this['_proxyIsEnabled'](_0xe298ad),'execute':()=>this['_proxyExecute'](_0xe298ad)});this['_allowedCommands']=_0x2b20f7['sort'](y);}['getAllowedCommands'](){return this['_allowedCommands'];}['getDefaultCommands'](){const t=this['editor']['t'],_0x39754b=this['editor']['locale']['t'];return[{'id':'blockQuote','commandName':'blockQuote','icon':_0x5f0ce9['quote'],'title':_0x39754b('Block\x20quote'),'description':t('Create\x20a\x20block\x20quote')},{'id':'bulletedList','commandName':'bulletedList','icon':_0x8009b7,'title':_0x39754b('Bulleted\x20list'),'description':t('Create\x20a\x20bulleted\x20list')},{'id':'codeBlock','commandName':'codeBlock','icon':_0x4caf3b,'title':_0x39754b('Insert\x20code\x20block'),'description':t('Create\x20a\x20code\x20block')},{'id':'ckbox','commandName':'ckbox','icon':_0x9cf3ae,'title':_0x39754b('Open\x20file\x20manager'),'description':t('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckfinder','filemanager','upload']},{'id':'ckfinder','commandName':'ckfinder','icon':_0x31bf1f,'title':_0x39754b('Insert\x20image'),'description':t('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckbox','filemanager','upload']},{'id':'heading1','commandName':'heading','icon':_0x1f006f,'title':_0x39754b('Heading\x201'),'description':t('Create\x20a\x20heading\x20level\x201'),'execute':_0x5d5cc3=>{_0x5d5cc3['execute']('heading',{'value':'heading1'});}},{'id':'heading2','commandName':'heading','icon':_0x137b08,'title':_0x39754b('Heading\x202'),'description':t('Create\x20a\x20heading\x20level\x202'),'execute':_0x162e04=>{_0x162e04['execute']('heading',{'value':'heading2'});}},{'id':'heading3','commandName':'heading','icon':_0x1fe488,'title':_0x39754b('Heading\x203'),'description':t('Create\x20a\x20heading\x20level\x203'),'execute':_0x27200f=>{_0x27200f['execute']('heading',{'value':'heading3'});}},{'id':'heading4','commandName':'heading','icon':_0x540840,'title':_0x39754b('Heading\x204'),'description':t('Create\x20a\x20heading\x20level\x204'),'execute':_0x4af718=>{_0x4af718['execute']('heading',{'value':'heading4'});}},{'id':'heading5','commandName':'heading','icon':_0xa51c26,'title':_0x39754b('Heading\x205'),'description':t('Create\x20a\x20heading\x20level\x205'),'execute':_0x1b4420=>{_0x1b4420['execute']('heading',{'value':'heading5'});}},{'id':'heading6','commandName':'heading','icon':_0xfea84,'title':_0x39754b('Heading\x206'),'description':t('Create\x20a\x20heading\x20level\x206'),'execute':_0x131656=>{_0x131656['execute']('heading',{'value':'heading6'});}},{'id':'horizontalLine','commandName':'horizontalLine','icon':_0x4562c0,'title':_0x39754b('Horizontal\x20line'),'description':t('Insert\x20a\x20horizontal\x20line')},{'id':'htmlEmbed','commandName':'htmlEmbed','icon':_0x5da4a8,'title':_0x39754b('Insert\x20HTML'),'description':t('Insert\x20an\x20HTML\x20snippet')},{'id':'indent','commandName':'indent','icon':_0x5ec3ec,'title':_0x39754b('Increase\x20indent'),'description':t('Increase\x20the\x20indentation')},{'id':'insertMermaidCommand','commandName':'insertMermaidCommand','title':t('Insert\x20Mermaid\x20diagram'),'description':t('Insert\x20the\x20Mermaid\x20diagram')},{'id':'insertTable','commandName':'insertTable','icon':_0x11473e,'title':_0x39754b('Insert\x20table'),'description':t('Create\x20a\x20table')},{'id':'insertTableOfContents','commandName':'insertTableOfContents','icon':_0x41c5a5,'title':_0x39754b('Table\x20of\x20contents'),'description':t('Insert\x20table\x20of\x20contents'),'aliases':['toc']},{'id':'numberedList','commandName':'numberedList','icon':_0x45a28b,'title':_0x39754b('Numbered\x20list'),'description':t('Create\x20a\x20numbered\x20list')},{'id':'outdent','commandName':'outdent','icon':_0x3164b3,'title':_0x39754b('Decrease\x20indent'),'description':t('Decrease\x20the\x20indentation')},{'id':'paragraph','commandName':'paragraph','icon':_0x5f0ce9['paragraph'],'title':_0x39754b('Paragraph'),'description':t('Insert\x20a\x20paragraph')},{'id':'todoList','commandName':'todoList','icon':_0x332649,'title':_0x39754b('To-do\x20list'),'description':t('Create\x20a\x20to-do\x20list')}];}['_proxyIsEnabled'](_0x27a9b1){return _0x27a9b1['isEnabled']?_0x27a9b1['isEnabled'](this['editor']):!_0x27a9b1['commandName']||this['editor']['commands']['get'](_0x27a9b1['commandName'])['isEnabled'];}['_proxyExecute'](_0x2a7ed2){if(_0x2a7ed2['execute'])_0x2a7ed2['execute'](this['editor']);else{if(!_0x2a7ed2['commandName'])throw new _0x486596('slash-command-execute-missing',this['editor'],{'commandDefinition':_0x2a7ed2});this['editor']['execute'](_0x2a7ed2['commandName']);}}}function y(_0x60d030,_0x5288fe){return _0x60d030['title']<_0x5288fe['title']?-0x1:_0x60d030['title']>_0x5288fe['title']?0x1:0x0;}function H(_0x3b6d93,_0x43f70a){return _0x43f70a+'-'+_0x3b6d93['toLowerCase']()['split']('\x20')['join']('-');}
23
+ import{Plugin as _0x24f1bb,icons as _0x3c83ef}from'ckeditor5/src/core';import{CKEditorError as _0x3ea42a}from'ckeditor5/src/utils';import _0x454eff from'@ckeditor/ckeditor5-list/theme/icons/bulletedlist.svg';import _0x48508c from'@ckeditor/ckeditor5-code-block/theme/icons/codeblock.svg';import _0x34a19a from'@ckeditor/ckeditor5-ckbox/theme/icons/browse-files.svg';import _0x5b8763 from'@ckeditor/ckeditor5-ckfinder/theme/icons/browse-files.svg';import _0x19ae7b from'@ckeditor/ckeditor5-heading/theme/icons/heading1.svg';import _0x16ad69 from'@ckeditor/ckeditor5-heading/theme/icons/heading2.svg';import _0x2b842c from'@ckeditor/ckeditor5-heading/theme/icons/heading3.svg';import _0x45743e from'@ckeditor/ckeditor5-heading/theme/icons/heading4.svg';import _0x283f2e from'@ckeditor/ckeditor5-heading/theme/icons/heading5.svg';import _0x5de381 from'@ckeditor/ckeditor5-heading/theme/icons/heading6.svg';import _0x3fd35b from'@ckeditor/ckeditor5-horizontal-line/theme/icons/horizontalline.svg';import _0x36fb0f from'@ckeditor/ckeditor5-html-embed/theme/icons/html.svg';import _0x458e81 from'@ckeditor/ckeditor5-indent/theme/icons/indent.svg';import _0x47c6a5 from'@ckeditor/ckeditor5-table/theme/icons/table.svg';import _0xe8eb0a from'@ckeditor/ckeditor5-list/theme/icons/numberedlist.svg';import _0xe56d78 from'@ckeditor/ckeditor5-indent/theme/icons/outdent.svg';import _0x282d52 from'@ckeditor/ckeditor5-document-outline/theme/icons/table-of-contents.svg';import _0x5530af from'@ckeditor/ckeditor5-list/theme/icons/todolist.svg';import _0x20783f from'@ckeditor/ckeditor5-ai/theme/icons/robot-pencil.svg';import'./slashcommandeditorconfig';export default class L extends _0x24f1bb{static get['pluginName'](){return'SlashCommandConfig';}constructor(_0x1c6e1f){super(_0x1c6e1f),this['_allowedCommands']=null;}['afterInit'](){const _0x562f39=this['editor']['config']['get']('slashCommand.removeCommands')||[],_0x2131b8=function(_0x2655bc){let _0x337822=['heading4','heading5','heading6'];if(_0x2655bc){const _0x1fb6e6=_0x2655bc['map'](_0x474323=>_0x474323['model']);_0x337822=['heading1','heading2','heading3','heading4','heading5','heading6']['filter'](_0x641cbc=>!_0x1fb6e6['includes'](_0x641cbc));}return _0x337822;}(this['editor']['config']['get']('heading.options'));let _0x3895a4=this['getDefaultCommands']()['filter'](_0x578eef=>!_0x2131b8['includes'](_0x578eef['id']))['filter'](_0x3d6bef=>!_0x562f39['includes'](_0x3d6bef['commandName']));const _0x259788=this['editor']['config']['get']('slashCommand.extraCommands');_0x259788&&_0x259788['length']&&(_0x3895a4=_0x3895a4['concat'](_0x259788));const _0x381a05=this['editor']['config']['get']('template.definitions');_0x381a05&&_0x381a05['length']&&(_0x3895a4=_0x3895a4['concat'](function(_0x182acb){return _0x182acb['map'](_0x13703d=>{const {title:_0x4a2da8,icon:_0x528328,description:_0x87e9bf,data:_0x253d05}=_0x13703d,_0xcb2127={'id':H(_0x4a2da8,'template'),'commandName':'insertTemplate','execute':_0x278eb8=>{_0x278eb8['execute']('insertTemplate',_0x253d05);},'description':_0x87e9bf,'icon':_0x528328,'title':_0x4a2da8};return _0x528328&&(_0xcb2127['isIconColorInherited']=!0x1),_0xcb2127;});}(_0x381a05)));const _0x44a46f=this['editor']['config']['get']('style.definitions');_0x44a46f&&_0x44a46f['length']&&(_0x3895a4=_0x3895a4['concat'](function(_0x3b2451){return _0x3b2451['map'](_0x134d05=>({'id':H(_0x134d05['name'],'style'),'commandName':'style','execute':_0x40346a=>{_0x40346a['execute']('style',{'styleName':_0x134d05['name']});},'isEnabled':_0x166518=>{const _0x236458=_0x166518['commands']['get']('style');return _0x236458['isEnabled']&&_0x236458['enabledStyles']['includes'](_0x134d05['name']);},'title':_0x134d05['name']}));}(_0x44a46f)));const _0x91e21f=_0x3895a4['filter'](_0x57b39d=>!_0x57b39d['commandName']||void 0x0!==this['editor']['commands']['get'](_0x57b39d['commandName'])),_0x3ac43a=[];for(const _0x2a08dc of _0x91e21f)_0x3ac43a['push']({'id':_0x2a08dc['id'],'commandName':_0x2a08dc['commandName'],'title':'function'==typeof _0x2a08dc['title']?_0x2a08dc['title'](this['editor']):_0x2a08dc['title'],'description':_0x2a08dc['description'],'icon':_0x2a08dc['icon'],'isIconColorInherited':_0x2a08dc['isIconColorInherited'],'aliases':_0x2a08dc['aliases'],'isEnabled':()=>this['_proxyIsEnabled'](_0x2a08dc),'execute':()=>this['_proxyExecute'](_0x2a08dc)});this['_allowedCommands']=_0x3ac43a['sort'](y);}['getAllowedCommands'](){return this['_allowedCommands'];}['getDefaultCommands'](){const t=this['editor']['t'],_0x246474=this['editor']['locale']['t'];return[{'id':'aiAssistant','commandName':'showAIAssistant','icon':_0x20783f,'title':_0x246474('AI\x20Assistant'),'description':t('Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content'),'execute':_0x3c0776=>{setTimeout(()=>_0x3c0776['execute']('showAIAssistant'));}},{'id':'blockQuote','commandName':'blockQuote','icon':_0x3c83ef['quote'],'title':_0x246474('Block\x20quote'),'description':t('Create\x20a\x20block\x20quote')},{'id':'bulletedList','commandName':'bulletedList','icon':_0x454eff,'title':_0x246474('Bulleted\x20list'),'description':t('Create\x20a\x20bulleted\x20list')},{'id':'codeBlock','commandName':'codeBlock','icon':_0x48508c,'title':_0x246474('Insert\x20code\x20block'),'description':t('Create\x20a\x20code\x20block')},{'id':'ckbox','commandName':'ckbox','icon':_0x34a19a,'title':_0x246474('Open\x20file\x20manager'),'description':t('Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckfinder','filemanager','upload']},{'id':'ckfinder','commandName':'ckfinder','icon':_0x5b8763,'title':_0x246474('Insert\x20image'),'description':t('Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file'),'aliases':['ckbox','filemanager','upload']},{'id':'heading1','commandName':'heading','icon':_0x19ae7b,'title':_0x246474('Heading\x201'),'description':t('Create\x20a\x20heading\x20level\x201'),'execute':_0x34c29f=>{_0x34c29f['execute']('heading',{'value':'heading1'});}},{'id':'heading2','commandName':'heading','icon':_0x16ad69,'title':_0x246474('Heading\x202'),'description':t('Create\x20a\x20heading\x20level\x202'),'execute':_0x449758=>{_0x449758['execute']('heading',{'value':'heading2'});}},{'id':'heading3','commandName':'heading','icon':_0x2b842c,'title':_0x246474('Heading\x203'),'description':t('Create\x20a\x20heading\x20level\x203'),'execute':_0x1181e9=>{_0x1181e9['execute']('heading',{'value':'heading3'});}},{'id':'heading4','commandName':'heading','icon':_0x45743e,'title':_0x246474('Heading\x204'),'description':t('Create\x20a\x20heading\x20level\x204'),'execute':_0x1b06d1=>{_0x1b06d1['execute']('heading',{'value':'heading4'});}},{'id':'heading5','commandName':'heading','icon':_0x283f2e,'title':_0x246474('Heading\x205'),'description':t('Create\x20a\x20heading\x20level\x205'),'execute':_0x184f04=>{_0x184f04['execute']('heading',{'value':'heading5'});}},{'id':'heading6','commandName':'heading','icon':_0x5de381,'title':_0x246474('Heading\x206'),'description':t('Create\x20a\x20heading\x20level\x206'),'execute':_0x1c4b0e=>{_0x1c4b0e['execute']('heading',{'value':'heading6'});}},{'id':'horizontalLine','commandName':'horizontalLine','icon':_0x3fd35b,'title':_0x246474('Horizontal\x20line'),'description':t('Insert\x20a\x20horizontal\x20line')},{'id':'htmlEmbed','commandName':'htmlEmbed','icon':_0x36fb0f,'title':_0x246474('Insert\x20HTML'),'description':t('Insert\x20an\x20HTML\x20snippet')},{'id':'indent','commandName':'indent','icon':_0x458e81,'title':_0x246474('Increase\x20indent'),'description':t('Increase\x20the\x20indentation')},{'id':'insertMermaidCommand','commandName':'insertMermaidCommand','title':t('Insert\x20Mermaid\x20diagram'),'description':t('Insert\x20the\x20Mermaid\x20diagram')},{'id':'insertTable','commandName':'insertTable','icon':_0x47c6a5,'title':_0x246474('Insert\x20table'),'description':t('Create\x20a\x20table')},{'id':'insertTableOfContents','commandName':'insertTableOfContents','icon':_0x282d52,'title':_0x246474('Table\x20of\x20contents'),'description':t('Insert\x20table\x20of\x20contents'),'aliases':['toc']},{'id':'numberedList','commandName':'numberedList','icon':_0xe8eb0a,'title':_0x246474('Numbered\x20list'),'description':t('Create\x20a\x20numbered\x20list')},{'id':'outdent','commandName':'outdent','icon':_0xe56d78,'title':_0x246474('Decrease\x20indent'),'description':t('Decrease\x20the\x20indentation')},{'id':'paragraph','commandName':'paragraph','icon':_0x3c83ef['paragraph'],'title':_0x246474('Paragraph'),'description':t('Insert\x20a\x20paragraph')},{'id':'todoList','commandName':'todoList','icon':_0x5530af,'title':_0x246474('To-do\x20list'),'description':t('Create\x20a\x20to-do\x20list')}];}['_proxyIsEnabled'](_0x3bf0da){return _0x3bf0da['isEnabled']?_0x3bf0da['isEnabled'](this['editor']):!_0x3bf0da['commandName']||this['editor']['commands']['get'](_0x3bf0da['commandName'])['isEnabled'];}['_proxyExecute'](_0x286584){if(_0x286584['execute'])_0x286584['execute'](this['editor']);else{if(!_0x286584['commandName'])throw new _0x3ea42a('slash-command-execute-missing',this['editor'],{'commandDefinition':_0x286584});this['editor']['execute'](_0x286584['commandName']);}}}function y(_0x1d5485,_0x28a0c7){return _0x1d5485['title']<_0x28a0c7['title']?-0x1:_0x1d5485['title']>_0x28a0c7['title']?0x1:0x0;}function H(_0x2b4682,_0x316113){return _0x316113+'-'+_0x2b4682['toLowerCase']()['split']('\x20')['join']('-');}
@@ -1,41 +1,41 @@
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 slash-command/slashcommandediting
7
- */
8
- import { Plugin, type Editor } from 'ckeditor5/src/core';
9
- import SlashCommandConfig, { type SlashCommandDefinition } from './slashcommandconfig';
10
- /**
11
- * Provides the editing functionality of the {@link module:slash-command/slashcommand~SlashCommand} feature.
12
- *
13
- * @extends module:core/plugin~Plugin
14
- */
15
- export default class SlashCommandEditing extends Plugin {
16
- licenseKey: string;
17
- /**
18
- * @inheritDoc
19
- */
20
- static get pluginName(): "SlashCommandEditing";
21
- /**
22
- * @inheritDoc
23
- */
24
- static get requires(): readonly [typeof SlashCommandConfig];
25
- /**
26
- * @inheritDoc
27
- */
28
- constructor(editor: Editor);
29
- /**
30
- * @inheritDoc
31
- */
32
- init(): void;
33
- /**
34
- * @inheritDoc
35
- */
36
- destroy(): void;
37
- /**
38
- * Returns the list of matching enabled command definitions for the specific query text case-insensitively.
39
- */
40
- getMatchingCommands(queryString: string): Array<SlashCommandDefinition>;
41
- }
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 slash-command/slashcommandediting
7
+ */
8
+ import { Plugin, type Editor } from 'ckeditor5/src/core';
9
+ import SlashCommandConfig, { type SlashCommandDefinition } from './slashcommandconfig';
10
+ /**
11
+ * Provides the editing functionality of the {@link module:slash-command/slashcommand~SlashCommand} feature.
12
+ *
13
+ * @extends module:core/plugin~Plugin
14
+ */
15
+ export default class SlashCommandEditing extends Plugin {
16
+ licenseKey: string;
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ static get pluginName(): "SlashCommandEditing";
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get requires(): readonly [typeof SlashCommandConfig];
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ constructor(editor: Editor);
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ init(): void;
33
+ /**
34
+ * @inheritDoc
35
+ */
36
+ destroy(): void;
37
+ /**
38
+ * Returns the list of matching enabled command definitions for the specific query text case-insensitively.
39
+ */
40
+ getMatchingCommands(queryString: string): Array<SlashCommandDefinition>;
41
+ }