@ckeditor/ckeditor5-slash-command 41.3.0-alpha.3 → 41.3.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 (105) hide show
  1. package/build/slash-command.js +1 -1
  2. package/package.json +4 -5
  3. package/src/index.js +1 -1
  4. package/src/slashcommand.js +1 -1
  5. package/src/slashcommandconfig.js +1 -1
  6. package/src/slashcommandediting.js +1 -1
  7. package/src/slashcommandui.js +1 -1
  8. package/src/ui/slashcommandbuttonview.js +1 -1
  9. package/dist/content-index.css +0 -332
  10. package/dist/editor-index.css +0 -363
  11. package/dist/index.css +0 -1032
  12. package/dist/translations/ar.d.ts +0 -8
  13. package/dist/translations/ar.js +0 -23
  14. package/dist/translations/bg.d.ts +0 -8
  15. package/dist/translations/bg.js +0 -23
  16. package/dist/translations/bn.d.ts +0 -8
  17. package/dist/translations/bn.js +0 -23
  18. package/dist/translations/ca.d.ts +0 -8
  19. package/dist/translations/ca.js +0 -23
  20. package/dist/translations/cs.d.ts +0 -8
  21. package/dist/translations/cs.js +0 -23
  22. package/dist/translations/da.d.ts +0 -8
  23. package/dist/translations/da.js +0 -23
  24. package/dist/translations/de.d.ts +0 -8
  25. package/dist/translations/de.js +0 -23
  26. package/dist/translations/el.d.ts +0 -8
  27. package/dist/translations/el.js +0 -23
  28. package/dist/translations/en-au.d.ts +0 -8
  29. package/dist/translations/en-au.js +0 -23
  30. package/dist/translations/en.d.ts +0 -8
  31. package/dist/translations/en.js +0 -23
  32. package/dist/translations/es.d.ts +0 -8
  33. package/dist/translations/es.js +0 -23
  34. package/dist/translations/et.d.ts +0 -8
  35. package/dist/translations/et.js +0 -23
  36. package/dist/translations/fi.d.ts +0 -8
  37. package/dist/translations/fi.js +0 -23
  38. package/dist/translations/fr.d.ts +0 -8
  39. package/dist/translations/fr.js +0 -23
  40. package/dist/translations/gl.d.ts +0 -8
  41. package/dist/translations/gl.js +0 -23
  42. package/dist/translations/he.d.ts +0 -8
  43. package/dist/translations/he.js +0 -23
  44. package/dist/translations/hi.d.ts +0 -8
  45. package/dist/translations/hi.js +0 -23
  46. package/dist/translations/hr.d.ts +0 -8
  47. package/dist/translations/hr.js +0 -23
  48. package/dist/translations/hu.d.ts +0 -8
  49. package/dist/translations/hu.js +0 -23
  50. package/dist/translations/id.d.ts +0 -8
  51. package/dist/translations/id.js +0 -23
  52. package/dist/translations/it.d.ts +0 -8
  53. package/dist/translations/it.js +0 -23
  54. package/dist/translations/ja.d.ts +0 -8
  55. package/dist/translations/ja.js +0 -23
  56. package/dist/translations/ko.d.ts +0 -8
  57. package/dist/translations/ko.js +0 -23
  58. package/dist/translations/lt.d.ts +0 -8
  59. package/dist/translations/lt.js +0 -23
  60. package/dist/translations/lv.d.ts +0 -8
  61. package/dist/translations/lv.js +0 -23
  62. package/dist/translations/ms.d.ts +0 -8
  63. package/dist/translations/ms.js +0 -23
  64. package/dist/translations/nl.d.ts +0 -8
  65. package/dist/translations/nl.js +0 -23
  66. package/dist/translations/no.d.ts +0 -8
  67. package/dist/translations/no.js +0 -23
  68. package/dist/translations/pl.d.ts +0 -8
  69. package/dist/translations/pl.js +0 -23
  70. package/dist/translations/pt-br.d.ts +0 -8
  71. package/dist/translations/pt-br.js +0 -23
  72. package/dist/translations/pt.d.ts +0 -8
  73. package/dist/translations/pt.js +0 -23
  74. package/dist/translations/ro.d.ts +0 -8
  75. package/dist/translations/ro.js +0 -23
  76. package/dist/translations/ru.d.ts +0 -8
  77. package/dist/translations/ru.js +0 -23
  78. package/dist/translations/sk.d.ts +0 -8
  79. package/dist/translations/sk.js +0 -23
  80. package/dist/translations/sr.d.ts +0 -8
  81. package/dist/translations/sr.js +0 -23
  82. package/dist/translations/sv.d.ts +0 -8
  83. package/dist/translations/sv.js +0 -23
  84. package/dist/translations/th.d.ts +0 -8
  85. package/dist/translations/th.js +0 -23
  86. package/dist/translations/tr.d.ts +0 -8
  87. package/dist/translations/tr.js +0 -23
  88. package/dist/translations/uk.d.ts +0 -8
  89. package/dist/translations/uk.js +0 -23
  90. package/dist/translations/uz.d.ts +0 -8
  91. package/dist/translations/uz.js +0 -23
  92. package/dist/translations/vi.d.ts +0 -8
  93. package/dist/translations/vi.js +0 -23
  94. package/dist/translations/zh-cn.d.ts +0 -8
  95. package/dist/translations/zh-cn.js +0 -23
  96. package/dist/translations/zh.d.ts +0 -8
  97. package/dist/translations/zh.js +0 -23
  98. package/dist/types/augmentation.d.ts +0 -25
  99. package/dist/types/index.d.ts +0 -17
  100. package/dist/types/slashcommand.d.ts +0 -33
  101. package/dist/types/slashcommandconfig.d.ts +0 -246
  102. package/dist/types/slashcommandediting.d.ts +0 -45
  103. package/dist/types/slashcommandeditorconfig.d.ts +0 -100
  104. package/dist/types/slashcommandui.d.ts +0 -37
  105. package/dist/types/ui/slashcommandbuttonview.d.ts +0 -35
@@ -1,246 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module slash-command/slashcommandconfig
11
- * @publicApi
12
- */
13
- import { Plugin, type Editor } from 'ckeditor5/src/core.js';
14
- import './slashcommandeditorconfig.js';
15
- /**
16
- * This plugin takes care of the configuration for {@link module:slash-command/slashcommand~SlashCommand}:
17
- *
18
- * * It manages the configuration of slash commands in the editor.
19
- * * It provides default slash commands for common editor features.
20
- * * It allows defining extra commands and reducing the list of defaults using the editor configuration.
21
- * See {@link module:slash-command/slashcommandconfig~SlashCommandConfig} to learn more.
22
- *
23
- * @extends module:core/plugin~Plugin
24
- */
25
- export default class SlashCommandConfig extends Plugin {
26
- /**
27
- * @inheritDoc
28
- */
29
- static get pluginName(): "SlashCommandConfig";
30
- /**
31
- * @inheritDoc
32
- */
33
- constructor(editor: Editor);
34
- /**
35
- * @inheritDoc
36
- */
37
- afterInit(): void;
38
- /**
39
- * Returns an array of slash command definitions enabled in the editor.
40
- *
41
- * This method takes into account the following:
42
- * * The {@link module:slash-command/slashcommandconfig~SlashCommandConfig#getDefaultCommands list of default commands}.
43
- * * The presence of {@link module:core/editor/editorconfig~EditorConfig#plugins editor features} (plugins).
44
- * * The {@link module:slash-command/slashcommandeditorconfig~SlashCommandEditorConfig#removeCommands} configuration.
45
- * * The {@link module:slash-command/slashcommandeditorconfig~SlashCommandEditorConfig#extraCommands} configuration.
46
- */
47
- getAllowedCommands(): Array<SlashCommandDefinition>;
48
- /**
49
- * Returns a list of default slash command {@link module:slash-command/slashcommandconfig~SlashCommandDefinition definitions}
50
- * for common editor features. The available definitions are as follows:
51
- *
52
- * ```js
53
- * [
54
- * {
55
- * id: 'blockQuote',
56
- * commandName: 'blockQuote',
57
- * title: t( 'Block quote' ),
58
- * // ...
59
- * },
60
- * {
61
- * id: 'bulletedList',
62
- * commandName: 'bulletedList',
63
- * title: t( 'Bulleted list' ),
64
- * // ...
65
- * },
66
- * {
67
- * id: 'codeBlock',
68
- * commandName: 'codeBlock',
69
- * title: t( 'Insert code block' ),
70
- * // ...
71
- * },
72
- * {
73
- * id: 'ckbox',
74
- * commandName: 'ckbox',
75
- * title: t( 'Open file manager' ),
76
- * // ...
77
- * },
78
- * {
79
- * id: 'ckfinder',
80
- * commandName: 'ckfinder',
81
- * title: t( 'Insert image' ),
82
- * // ...
83
- * },
84
- * {
85
- * id: 'heading1',
86
- * commandName: 'heading',
87
- * title: t( 'Heading 1' ),
88
- * // ...
89
- * },
90
- * {
91
- * id: 'heading2',
92
- * commandName: 'heading',
93
- * title: t( 'Heading 2' ),
94
- * // ...
95
- * },
96
- * {
97
- * id: 'heading3',
98
- * commandName: 'heading',
99
- * title: t( 'Heading 3' ),
100
- * // ...
101
- * },
102
- * {
103
- * id: 'heading4',
104
- * commandName: 'heading',
105
- * title: t( 'Heading 4' ),
106
- * // ...
107
- * },
108
- * {
109
- * id: 'heading5',
110
- * commandName: 'heading',
111
- * title: t( 'Heading 5' ),
112
- * // ...
113
- * },
114
- * {
115
- * id: 'heading6',
116
- * commandName: 'heading',
117
- * title: t( 'Heading 6' ),
118
- * // ...
119
- * },
120
- * {
121
- * id: 'horizontalLine',
122
- * commandName: 'horizontalLine',
123
- * title: t( 'Horizontal line' ),
124
- * // ...
125
- * },
126
- * {
127
- * id: 'htmlEmbed',
128
- * commandName: 'htmlEmbed',
129
- * title: t( 'Insert HTML' ),
130
- * // ...
131
- * },
132
- * {
133
- * id: 'indent',
134
- * commandName: 'indent',
135
- * title: t( 'Increase indent' ),
136
- * // ...
137
- * },
138
- * {
139
- * id: 'insertMermaidCommand',
140
- * commandName: 'insertMermaidCommand',
141
- * title: t( 'Insert Mermaid diagram' ),
142
- * // ...
143
- * },
144
- * {
145
- * id: 'insertTable',
146
- * commandName: 'insertTable',
147
- * title: t( 'Insert table' ),
148
- * // ...
149
- * },
150
- * {
151
- * id: 'insertTableOfContents',
152
- * commandName: 'insertTableOfContents',
153
- * title: t( 'Table of contents' ),
154
- * // ...
155
- * },
156
- * {
157
- * id: 'numberedList',
158
- * commandName: 'numberedList',
159
- * title: t( 'Numbered list' ),
160
- * // ...
161
- * },
162
- * {
163
- * id: 'outdent',
164
- * commandName: 'outdent',
165
- * title: t( 'Decrease indent' ),
166
- * // ...
167
- * },
168
- * {
169
- * id: 'paragraph',
170
- * commandName: 'paragraph',
171
- * title: t( 'Paragraph' ),
172
- * // ...
173
- * },
174
- * {
175
- * id: 'todoList',
176
- * commandName: 'todoList',
177
- * title: t( 'To-do list' ),
178
- * // ...
179
- * }
180
- * ]
181
- */
182
- getDefaultCommands(): Array<SlashCommandDefinition>;
183
- }
184
- /**
185
- * An object describing a single command definition in the configuration.
186
- */
187
- export interface SlashCommandDefinition {
188
- /**
189
- * A unique ID matched with the text that follows the slash ("/") character typed by the user,
190
- * e.g. 'blockQuote', 'heading1'. See {@link module:slash-command/slashcommandconfig~SlashCommandDefinition#aliases}
191
- * to learn about slash command aliases that provide a similar functionality.
192
- */
193
- id: string;
194
- /**
195
- * The name of the command to be executed if the `execute` property was not provided,
196
- * for example, 'blockQuote', 'heading'. See {@link module:core/editor/editor~Editor#commands} to learn more about available commands.
197
- */
198
- commandName?: string;
199
- /**
200
- * A meaningful title for the command displayed in a dropdown list of possible commands. It can be a string
201
- * or a callback function returning a string.
202
- */
203
- title: Function | string;
204
- /**
205
- * An optional description for the command. Useful when the title is not descriptive enough.
206
- */
207
- description?: string;
208
- /**
209
- * An SVG string representing the icon of the command. If not provided, a generic icon will be used instead.
210
- * The default size of the icon is 20x20 pixels. Be sure to set the correct `viewBox` attribute in the icon source.
211
- *
212
- * See {@link module:slash-command/slashcommandconfig~SlashCommandDefinition#isIconColorInherited}.
213
- */
214
- icon?: string;
215
- /**
216
- * By default, slash command icons are monochromatic and inherit the color of the text in the editor UI.
217
- * Setting this property to `false` disables this inheritance and allows the use of complex (colorful) icons.
218
- *
219
- * Learn more in {@link module:ui/icon/iconview~IconView#isColorInherited}.
220
- */
221
- isIconColorInherited?: boolean;
222
- /**
223
- * An optional list of aliases (extending the base
224
- * {@link module:slash-command/slashcommandconfig~SlashCommandDefinition#id}) to be used when filtering the list of slash commands
225
- * based on the text that follows the slash ("/") character.
226
- */
227
- aliases?: Array<string>;
228
- /**
229
- * A callback function defining custom logic to decide if the command should be displayed
230
- * in the dropdown list. If not provided, the default command's {@link module:core/command~Command#isEnabled} property is used instead.
231
- * If it's also unavailable, it falls back to `true`. This property is checked when a user types the slash ("/") character
232
- * or changes the text that follows it.
233
- *
234
- * This callback gets an {@link module:core/editor/editor~Editor} instance as a parameter.
235
- */
236
- isEnabled?: Function;
237
- /**
238
- * A callback function defining custom logic for executing the command. If not provided, the default
239
- * command's {@link module:core/command~Command#execute} is used instead. Custom logic is useful especially when the slash command
240
- * requires some arguments (acts like a wrapper) or combines some complex logic. This property is obligatory if
241
- * {@link module:slash-command/slashcommandconfig~SlashCommandDefinition#commandName} was not passed.
242
- *
243
- * This callback gets an {@link module:core/editor/editor~Editor} instance as a parameter.
244
- */
245
- execute?: Function;
246
- }
@@ -1,45 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module slash-command/slashcommandediting
11
- */
12
- import { Plugin, type Editor } from 'ckeditor5/src/core.js';
13
- import SlashCommandConfig, { type SlashCommandDefinition } from './slashcommandconfig.js';
14
- /**
15
- * Provides the editing functionality of the {@link module:slash-command/slashcommand~SlashCommand} feature.
16
- *
17
- * @extends module:core/plugin~Plugin
18
- */
19
- export default class SlashCommandEditing extends Plugin {
20
- licenseKey: string;
21
- /**
22
- * @inheritDoc
23
- */
24
- static get pluginName(): "SlashCommandEditing";
25
- /**
26
- * @inheritDoc
27
- */
28
- static get requires(): readonly [typeof SlashCommandConfig];
29
- /**
30
- * @inheritDoc
31
- */
32
- constructor(editor: Editor);
33
- /**
34
- * @inheritDoc
35
- */
36
- init(): void;
37
- /**
38
- * @inheritDoc
39
- */
40
- destroy(): void;
41
- /**
42
- * Returns the list of matching enabled command definitions for the specific query text case-insensitively.
43
- */
44
- getMatchingCommands(queryString: string): Array<SlashCommandDefinition>;
45
- }
@@ -1,100 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module slash-command/slashcommandeditorconfig
11
- * @publicApi
12
- */
13
- import type { SlashCommandDefinition } from './slashcommandconfig.js';
14
- /**
15
- * The configuration of the slash command feature.
16
- *
17
- * Read more about {@glink features/slash-commands#configuration configuring the slash command feature}.
18
- *
19
- * ```ts
20
- * ClassicEditor
21
- * .create( editorElement, {
22
- * slashCommand: ... // Slash command feature options.
23
- * } )
24
- * .then( ... )
25
- * .catch( ... );
26
- * ```
27
- *
28
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
29
- */
30
- export interface SlashCommandEditorConfig {
31
- /**
32
- * The list of commands to be removed from the default command list. Commands specified by this configuration will not
33
- * appear in the user interface upon writing the slash ("/") character.
34
- *
35
- * * Each entry must be a unique name of a command registered in the
36
- * {@link module:core/editor/editor~Editor#commands editor's command collection}.
37
- * * Check out the list of the {@link module:slash-command/slashcommandconfig~SlashCommandConfig#getDefaultCommands default commands}
38
- * supported by the slash command feature to learn which commands can be removed.
39
- *
40
- * ```ts
41
- * ClassicEditor
42
- * .create( editorElement, {
43
- * plugins: [ SlashCommand, ... ],
44
- * slashCommand: {
45
- * removeCommands: [ 'heading', 'paragraph', ... ]
46
- * // ...
47
- * }
48
- * } )
49
- * .then( ... )
50
- * .catch( ... );
51
- * ```
52
- */
53
- removeCommands: Array<string>;
54
- /**
55
- * Additional commands to be added to the
56
- * {@link module:slash-command/slashcommandconfig~SlashCommandConfig#getDefaultCommands list of defaults} supported
57
- * by the slash command feature. It allows the feature to work with third-party commands and make them appear in the user interface
58
- * upon writing the slash ("/") character.
59
- *
60
- * ```ts
61
- * ClassicEditor
62
- * .create( editorElement, {
63
- * plugins: [ SlashCommand, ... ],
64
- * slashCommand: {
65
- * extraCommands: [
66
- * {
67
- * id: 'bold',
68
- * commandName: 'bold',
69
- * title: 'Bold',
70
- * // ...
71
- * },
72
- * // ...
73
- * ]
74
- * // ...
75
- * }
76
- * } )
77
- * .then( ... )
78
- * .catch( ... );
79
- * ```
80
- */
81
- extraCommands: Array<SlashCommandDefinition>;
82
- /**
83
- * The maximum number of commands displayed in the dropdown list of slash commands.
84
- *
85
- * ```ts
86
- * ClassicEditor
87
- * .create( editorElement, {
88
- * plugins: [ SlashCommand, ... ],
89
- * slashCommand: {
90
- * dropdownLimit: 4
91
- * // More of editor configuration.
92
- * // ...
93
- * }
94
- * } )
95
- * .then( ... )
96
- * .catch( ... );
97
- * ```
98
- */
99
- dropdownLimit: number;
100
- }
@@ -1,37 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module slash-command/slashcommandui
11
- */
12
- import { Plugin, type Editor } from 'ckeditor5/src/core.js';
13
- import './slashcommandeditorconfig.js';
14
- import '../theme/slashcommand.css';
15
- /**
16
- * Provides the UI functionality of the {@link module:slash-command/slashcommand~SlashCommand} feature.
17
- *
18
- * @extends module:core/plugin~Plugin
19
- */
20
- export default class SlashCommandUI extends Plugin {
21
- /**
22
- * @inheritDoc
23
- */
24
- static get pluginName(): "SlashCommandUI";
25
- /**
26
- * @inheritDoc
27
- */
28
- constructor(editor: Editor);
29
- /**
30
- * @inheritDoc
31
- */
32
- init(): void;
33
- /**
34
- * @inheritDoc
35
- */
36
- afterInit(): void;
37
- }
@@ -1,35 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module slash-command/ui/slashcommandbuttonview
11
- */
12
- import type { Locale } from 'ckeditor5/src/utils.js';
13
- import { View, ButtonView } from 'ckeditor5/src/ui.js';
14
- import type { SlashCommandDefinition } from '../slashcommandconfig.js';
15
- /**
16
- * A class representing an individual button (slash command) in the list.
17
- *
18
- * @extends module:ui/button/buttonview~ButtonView
19
- */
20
- export default class SlashCommandButtonView extends ButtonView {
21
- /**
22
- * The view rendering the text part of the slash command button consisting of a title and an optional description.
23
- *
24
- * @protected
25
- */
26
- textPartView: View;
27
- /**
28
- * Creates an instance of the {@link module:slash-command/ui/slashcommandbuttonview~SlashCommandButtonView} class.
29
- */
30
- constructor(locale: Locale, commandDefinition: SlashCommandDefinition);
31
- /**
32
- * @inheritDoc
33
- */
34
- render(): void;
35
- }