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