@ckeditor/ckeditor5-slash-command 41.3.0 → 41.4.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/slash-command.js +1 -1
- package/dist/index-content.css +4 -0
- package/dist/index-editor.css +57 -0
- package/dist/index.css +84 -0
- package/dist/index.js +23 -0
- package/dist/translations/ar.d.ts +8 -0
- package/dist/translations/ar.js +23 -0
- package/dist/translations/bg.d.ts +8 -0
- package/dist/translations/bg.js +23 -0
- package/dist/translations/bn.d.ts +8 -0
- package/dist/translations/bn.js +23 -0
- package/dist/translations/ca.d.ts +8 -0
- package/dist/translations/ca.js +23 -0
- package/dist/translations/cs.d.ts +8 -0
- package/dist/translations/cs.js +23 -0
- package/dist/translations/da.d.ts +8 -0
- package/dist/translations/da.js +23 -0
- package/dist/translations/de.d.ts +8 -0
- package/dist/translations/de.js +23 -0
- package/dist/translations/el.d.ts +8 -0
- package/dist/translations/el.js +23 -0
- package/dist/translations/en-au.d.ts +8 -0
- package/dist/translations/en-au.js +23 -0
- package/dist/translations/en.d.ts +8 -0
- package/dist/translations/en.js +23 -0
- package/dist/translations/es.d.ts +8 -0
- package/dist/translations/es.js +23 -0
- package/dist/translations/et.d.ts +8 -0
- package/dist/translations/et.js +23 -0
- package/dist/translations/fi.d.ts +8 -0
- package/dist/translations/fi.js +23 -0
- package/dist/translations/fr.d.ts +8 -0
- package/dist/translations/fr.js +23 -0
- package/dist/translations/gl.d.ts +8 -0
- package/dist/translations/gl.js +23 -0
- package/dist/translations/he.d.ts +8 -0
- package/dist/translations/he.js +23 -0
- package/dist/translations/hi.d.ts +8 -0
- package/dist/translations/hi.js +23 -0
- package/dist/translations/hr.d.ts +8 -0
- package/dist/translations/hr.js +23 -0
- package/dist/translations/hu.d.ts +8 -0
- package/dist/translations/hu.js +23 -0
- package/dist/translations/id.d.ts +8 -0
- package/dist/translations/id.js +23 -0
- package/dist/translations/it.d.ts +8 -0
- package/dist/translations/it.js +23 -0
- package/dist/translations/ja.d.ts +8 -0
- package/dist/translations/ja.js +23 -0
- package/dist/translations/ko.d.ts +8 -0
- package/dist/translations/ko.js +23 -0
- package/dist/translations/lt.d.ts +8 -0
- package/dist/translations/lt.js +23 -0
- package/dist/translations/lv.d.ts +8 -0
- package/dist/translations/lv.js +23 -0
- package/dist/translations/ms.d.ts +8 -0
- package/dist/translations/ms.js +23 -0
- package/dist/translations/nl.d.ts +8 -0
- package/dist/translations/nl.js +23 -0
- package/dist/translations/no.d.ts +8 -0
- package/dist/translations/no.js +23 -0
- package/dist/translations/pl.d.ts +8 -0
- package/dist/translations/pl.js +23 -0
- package/dist/translations/pt-br.d.ts +8 -0
- package/dist/translations/pt-br.js +23 -0
- package/dist/translations/pt.d.ts +8 -0
- package/dist/translations/pt.js +23 -0
- package/dist/translations/ro.d.ts +8 -0
- package/dist/translations/ro.js +23 -0
- package/dist/translations/ru.d.ts +8 -0
- package/dist/translations/ru.js +23 -0
- package/dist/translations/sk.d.ts +8 -0
- package/dist/translations/sk.js +23 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +23 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +23 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +23 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +23 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +23 -0
- package/dist/translations/uz.d.ts +8 -0
- package/dist/translations/uz.js +23 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +23 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +23 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +23 -0
- package/dist/types/augmentation.d.ts +25 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/slashcommand.d.ts +33 -0
- package/dist/types/slashcommandconfig.d.ts +246 -0
- package/dist/types/slashcommandediting.d.ts +45 -0
- package/dist/types/slashcommandeditorconfig.d.ts +100 -0
- package/dist/types/slashcommandui.d.ts +37 -0
- package/dist/types/ui/slashcommandbuttonview.d.ts +35 -0
- package/package.json +5 -4
- package/src/index.js +1 -1
- package/src/slashcommand.js +1 -1
- package/src/slashcommandconfig.js +1 -1
- package/src/slashcommandediting.js +1 -1
- package/src/slashcommandui.js +1 -1
- package/src/ui/slashcommandbuttonview.js +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
import type { Translations } from 'ckeditor5';
|
|
7
|
+
declare const translations: Translations;
|
|
8
|
+
export default translations;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, 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 default{'uz':{'dictionary':{'Create\x20a\x20block\x20quote':'','Create\x20a\x20bulleted\x20list':'','Create\x20a\x20code\x20block':'','Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file':'','Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file':'','Create\x20a\x20heading\x20level\x201':'','Create\x20a\x20heading\x20level\x202':'','Create\x20a\x20heading\x20level\x203':'','Create\x20a\x20heading\x20level\x204':'','Create\x20a\x20heading\x20level\x205':'','Create\x20a\x20heading\x20level\x206':'','Insert\x20a\x20horizontal\x20line':'','Insert\x20an\x20HTML\x20snippet':'','Increase\x20the\x20indentation':'','Insert\x20Mermaid\x20diagram':'','Insert\x20the\x20Mermaid\x20diagram':'','Create\x20a\x20table':'Jadval\x20yaratish','Insert\x20table\x20of\x20contents':'','Create\x20a\x20numbered\x20list':'Raqamlangan\x20ro\x27yxat\x20yaratish','Decrease\x20the\x20indentation':'','Insert\x20a\x20paragraph':'Paragrafni\x20kiritish','Create\x20a\x20to-do\x20list':'Vazifalar\x20roʻyxatini\x20yaratish','Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content':''},'getPluralForm':_0x20e9f1=>0x0}};
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
import type { Translations } from 'ckeditor5';
|
|
7
|
+
declare const translations: Translations;
|
|
8
|
+
export default translations;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, 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 default{'vi':{'dictionary':{'Create\x20a\x20block\x20quote':'Tạo\x20khối\x20trích\x20dẫn','Create\x20a\x20bulleted\x20list':'Tạo\x20danh\x20sách\x20đánh\x20dấu\x20đầu\x20dòng','Create\x20a\x20code\x20block':'Tạo\x20khối\x20mã','Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file':'Mở\x20trình\x20quản\x20lý\x20tệp\x20để\x20chèn\x20ảnh\x20hoặc\x20tệp','Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file':'Mở\x20trình\x20duyệt\x20tệp\x20để\x20chèn\x20ảnh\x20hoặc\x20tệp','Create\x20a\x20heading\x20level\x201':'Tạo\x20tiêu\x20đề\x20cấp\x201','Create\x20a\x20heading\x20level\x202':'Tạo\x20tiêu\x20đề\x20cấp\x202','Create\x20a\x20heading\x20level\x203':'Tạo\x20tiêu\x20đề\x20cấp\x203','Create\x20a\x20heading\x20level\x204':'Tạo\x20tiêu\x20đề\x20cấp\x204','Create\x20a\x20heading\x20level\x205':'Tạo\x20tiêu\x20đề\x20cấp\x205','Create\x20a\x20heading\x20level\x206':'Tạo\x20tiêu\x20đề\x20cấp\x206','Insert\x20a\x20horizontal\x20line':'Chèn\x20dòng\x20ngang','Insert\x20an\x20HTML\x20snippet':'Chèn\x20đoạn\x20HTML','Increase\x20the\x20indentation':'Tăng\x20thụt\x20lề','Insert\x20Mermaid\x20diagram':'Chèn\x20biểu\x20đồ\x20Mermaid','Insert\x20the\x20Mermaid\x20diagram':'Chèn\x20biểu\x20đồ\x20Mermaid','Create\x20a\x20table':'Tạo\x20bảng','Insert\x20table\x20of\x20contents':'Chèn\x20mục\x20lục','Create\x20a\x20numbered\x20list':'Tạo\x20danh\x20sách\x20đánh\x20số\x20đầu\x20dòng','Decrease\x20the\x20indentation':'Giảm\x20thụt\x20lề','Insert\x20a\x20paragraph':'Chèn\x20đoạn\x20văn','Create\x20a\x20to-do\x20list':'Tạo\x20danh\x20sách\x20việc\x20cần\x20làm','Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content':'Hãy\x20mở\x20Trợ\x20lý\x20AI\x20để\x20tạo\x20nội\x20dung'},'getPluralForm':_0x95b3b1=>0x0}};
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
import type { Translations } from 'ckeditor5';
|
|
7
|
+
declare const translations: Translations;
|
|
8
|
+
export default translations;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, 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 default{'zh-cn':{'dictionary':{'Create\x20a\x20block\x20quote':'创建一个块引用','Create\x20a\x20bulleted\x20list':'创建一个带圆点的列表','Create\x20a\x20code\x20block':'创建一个代码块','Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file':'打开文件管理器,插入一个图像或文件','Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file':'打开文件浏览器,插入一个图像或文件','Create\x20a\x20heading\x20level\x201':'创建一个一级标题','Create\x20a\x20heading\x20level\x202':'创建一个二级标题','Create\x20a\x20heading\x20level\x203':'创建一个三级标题','Create\x20a\x20heading\x20level\x204':'创建一个四级标题','Create\x20a\x20heading\x20level\x205':'创建一个五级标题','Create\x20a\x20heading\x20level\x206':'创建一个六级标题','Insert\x20a\x20horizontal\x20line':'插入一条横线','Insert\x20an\x20HTML\x20snippet':'插入一个HTML片段','Increase\x20the\x20indentation':'增加缩进','Insert\x20Mermaid\x20diagram':'插入\x20\x22美人鱼\x20\x22图示','Insert\x20the\x20Mermaid\x20diagram':'插入\x20\x22美人鱼\x20\x22图示','Create\x20a\x20table':'创建一个表格','Insert\x20table\x20of\x20contents':'插入目录','Create\x20a\x20numbered\x20list':'创建一个带编号的列表','Decrease\x20the\x20indentation':'减少缩进','Insert\x20a\x20paragraph':'插入一个段落','Create\x20a\x20to-do\x20list':'创建一个待办事项清单','Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content':'打开\x20AI\x20助手生成内容'},'getPluralForm':_0x107815=>0x0}};
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
import type { Translations } from 'ckeditor5';
|
|
7
|
+
declare const translations: Translations;
|
|
8
|
+
export default translations;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2003-2024, 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 default{'zh':{'dictionary':{'Create\x20a\x20block\x20quote':'建立區塊引述','Create\x20a\x20bulleted\x20list':'建立項目清單','Create\x20a\x20code\x20block':'建立程式碼區塊','Open\x20file\x20manager\x20to\x20insert\x20an\x20image\x20or\x20a\x20file':'開啟檔案管理員來插入圖片或檔案','Open\x20file\x20browser\x20to\x20insert\x20an\x20image\x20or\x20a\x20file':'開啟檔案瀏覽工具來插入圖片或檔案','Create\x20a\x20heading\x20level\x201':'建立標題層級\x201','Create\x20a\x20heading\x20level\x202':'建立標題層級\x202','Create\x20a\x20heading\x20level\x203':'建立標題層級\x203','Create\x20a\x20heading\x20level\x204':'建立標題層級\x204','Create\x20a\x20heading\x20level\x205':'建立標題層級\x205','Create\x20a\x20heading\x20level\x206':'建立標題層級\x206','Insert\x20a\x20horizontal\x20line':'插入水平線','Insert\x20an\x20HTML\x20snippet':'插入\x20HTML\x20程式碼片段','Increase\x20the\x20indentation':'增加縮排','Insert\x20Mermaid\x20diagram':'插入\x20Mermaid\x20圖表','Insert\x20the\x20Mermaid\x20diagram':'插入\x20Mermaid\x20圖表','Create\x20a\x20table':'建立表格','Insert\x20table\x20of\x20contents':'插入內容目錄','Create\x20a\x20numbered\x20list':'建立數字清單','Decrease\x20the\x20indentation':'減少縮排','Insert\x20a\x20paragraph':'插入段落','Create\x20a\x20to-do\x20list':'建立待辦清單','Open\x20the\x20AI\x20Assistant\x20to\x20generate\x20content':'開啟\x20AI\x20助理來生成內容'},'getPluralForm':_0x59b473=>0x0}};
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
import type { SlashCommand, SlashCommandConfig, SlashCommandEditing, SlashCommandUI, SlashCommandEditorConfig } from './index.js';
|
|
10
|
+
declare module '@ckeditor/ckeditor5-core' {
|
|
11
|
+
interface EditorConfig {
|
|
12
|
+
/**
|
|
13
|
+
* The configuration of the {@link module:slash-command/slashcommand~SlashCommand} feature.
|
|
14
|
+
*
|
|
15
|
+
* Read more in {@link module:slash-command/slashcommandeditorconfig~SlashCommandEditorConfig}.
|
|
16
|
+
*/
|
|
17
|
+
slashCommand?: SlashCommandEditorConfig;
|
|
18
|
+
}
|
|
19
|
+
interface PluginsMap {
|
|
20
|
+
[SlashCommand.pluginName]: SlashCommand;
|
|
21
|
+
[SlashCommandConfig.pluginName]: SlashCommandConfig;
|
|
22
|
+
[SlashCommandEditing.pluginName]: SlashCommandEditing;
|
|
23
|
+
[SlashCommandUI.pluginName]: SlashCommandUI;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
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
|
|
11
|
+
*/
|
|
12
|
+
export { default as SlashCommand } from './slashcommand.js';
|
|
13
|
+
export { default as SlashCommandConfig } from './slashcommandconfig.js';
|
|
14
|
+
export { default as SlashCommandEditing } from './slashcommandediting.js';
|
|
15
|
+
export { default as SlashCommandUI } from './slashcommandui.js';
|
|
16
|
+
export { type SlashCommandEditorConfig } from './slashcommandeditorconfig.js';
|
|
17
|
+
import './augmentation.js';
|
|
@@ -0,0 +1,33 @@
|
|
|
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/slashcommand
|
|
11
|
+
* @publicApi
|
|
12
|
+
*/
|
|
13
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
14
|
+
import SlashCommandEditing from './slashcommandediting.js';
|
|
15
|
+
import SlashCommandUI from './slashcommandui.js';
|
|
16
|
+
/**
|
|
17
|
+
* The slash command feature.
|
|
18
|
+
* It allows for an easy access to a predefined list of editor commands by typing `/` inside the editor.
|
|
19
|
+
*
|
|
20
|
+
* For a detailed overview, check the {@glink features/slash-commands Slash command} feature guide.
|
|
21
|
+
*
|
|
22
|
+
* @extends module:core/plugin~Plugin
|
|
23
|
+
*/
|
|
24
|
+
export default class SlashCommand extends Plugin {
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get requires(): readonly ["Mention", typeof SlashCommandEditing, typeof SlashCommandUI];
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
static get pluginName(): "SlashCommand";
|
|
33
|
+
}
|
|
@@ -0,0 +1,246 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
}
|