@ckeditor/ckeditor5-ckbox 36.0.1 → 37.0.0-alpha.1
Sign up to get free protection for your applications and to get access to all the features.
- package/build/ckbox.js +1 -1
- package/ckeditor5-metadata.json +1 -1
- package/package.json +24 -19
- package/src/augmentation.d.ts +22 -0
- package/src/augmentation.js +5 -0
- package/src/ckbox.d.ts +31 -0
- package/src/ckbox.js +12 -218
- package/src/ckboxcommand.d.ts +111 -0
- package/src/ckboxcommand.js +281 -372
- package/src/ckboxconfig.d.ts +272 -0
- package/src/ckboxconfig.js +5 -0
- package/src/ckboxediting.d.ts +51 -0
- package/src/ckboxediting.js +343 -446
- package/src/ckboxui.d.ts +21 -0
- package/src/ckboxui.js +32 -47
- package/src/ckboxuploadadapter.d.ts +36 -0
- package/src/ckboxuploadadapter.js +247 -365
- package/src/index.d.ts +13 -0
- package/src/index.js +1 -2
- package/src/utils.d.ts +31 -0
- package/src/utils.js +70 -114
package/src/ckboxui.d.ts
ADDED
@@ -0,0 +1,21 @@
|
|
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 ckbox/ckboxui
|
7
|
+
*/
|
8
|
+
import { Plugin } from 'ckeditor5/src/core';
|
9
|
+
/**
|
10
|
+
* The CKBoxUI plugin. It introduces the `'ckbox'` toolbar button.
|
11
|
+
*/
|
12
|
+
export default class CKBoxUI extends Plugin {
|
13
|
+
/**
|
14
|
+
* @inheritDoc
|
15
|
+
*/
|
16
|
+
static get pluginName(): 'CKBoxUI';
|
17
|
+
/**
|
18
|
+
* @inheritDoc
|
19
|
+
*/
|
20
|
+
afterInit(): void;
|
21
|
+
}
|
package/src/ckboxui.js
CHANGED
@@ -2,61 +2,46 @@
|
|
2
2
|
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
4
|
*/
|
5
|
-
|
6
5
|
/**
|
7
6
|
* @module ckbox/ckboxui
|
8
7
|
*/
|
9
|
-
|
10
8
|
import { Plugin } from 'ckeditor5/src/core';
|
11
9
|
import { ButtonView } from 'ckeditor5/src/ui';
|
12
|
-
|
13
10
|
import browseFilesIcon from '../theme/icons/browse-files.svg';
|
14
|
-
|
15
11
|
/**
|
16
12
|
* The CKBoxUI plugin. It introduces the `'ckbox'` toolbar button.
|
17
|
-
*
|
18
|
-
* @extends module:core/plugin~Plugin
|
19
13
|
*/
|
20
14
|
export default class CKBoxUI extends Plugin {
|
21
|
-
|
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
|
-
button.bind( 'isOn', 'isEnabled' ).to( command, 'value', 'isEnabled' );
|
54
|
-
|
55
|
-
button.on( 'execute', () => {
|
56
|
-
editor.execute( 'ckbox' );
|
57
|
-
} );
|
58
|
-
|
59
|
-
return button;
|
60
|
-
} );
|
61
|
-
}
|
15
|
+
/**
|
16
|
+
* @inheritDoc
|
17
|
+
*/
|
18
|
+
static get pluginName() {
|
19
|
+
return 'CKBoxUI';
|
20
|
+
}
|
21
|
+
/**
|
22
|
+
* @inheritDoc
|
23
|
+
*/
|
24
|
+
afterInit() {
|
25
|
+
const editor = this.editor;
|
26
|
+
const command = editor.commands.get('ckbox');
|
27
|
+
// Do not register the `ckbox` button if the command does not exist.
|
28
|
+
if (!command) {
|
29
|
+
return;
|
30
|
+
}
|
31
|
+
const t = editor.t;
|
32
|
+
const componentFactory = editor.ui.componentFactory;
|
33
|
+
componentFactory.add('ckbox', locale => {
|
34
|
+
const button = new ButtonView(locale);
|
35
|
+
button.set({
|
36
|
+
label: t('Open file manager'),
|
37
|
+
icon: browseFilesIcon,
|
38
|
+
tooltip: true
|
39
|
+
});
|
40
|
+
button.bind('isOn', 'isEnabled').to(command, 'value', 'isEnabled');
|
41
|
+
button.on('execute', () => {
|
42
|
+
editor.execute('ckbox');
|
43
|
+
});
|
44
|
+
return button;
|
45
|
+
});
|
46
|
+
}
|
62
47
|
}
|
@@ -0,0 +1,36 @@
|
|
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 ckbox/ckboxuploadadapter
|
7
|
+
*/
|
8
|
+
import { Plugin, type PluginDependencies } from 'ckeditor5/src/core';
|
9
|
+
/**
|
10
|
+
* A plugin that enables file uploads in CKEditor 5 using the CKBox server–side connector.
|
11
|
+
* See the {@glink features/images/image-upload/ckbox CKBox file manager integration} guide to learn how to configure
|
12
|
+
* and use this feature as well as find out more about the full integration with the file manager
|
13
|
+
* provided by the {@link module:ckbox/ckbox~CKBox} plugin.
|
14
|
+
*
|
15
|
+
* Check out the {@glink features/images/image-upload/image-upload Image upload overview} guide to learn about
|
16
|
+
* other ways to upload images into CKEditor 5.
|
17
|
+
*/
|
18
|
+
export default class CKBoxUploadAdapter extends Plugin {
|
19
|
+
/**
|
20
|
+
* @inheritDoc
|
21
|
+
*/
|
22
|
+
static get requires(): PluginDependencies;
|
23
|
+
/**
|
24
|
+
* @inheritDoc
|
25
|
+
*/
|
26
|
+
static get pluginName(): 'CKBoxUploadAdapter';
|
27
|
+
/**
|
28
|
+
* @inheritDoc
|
29
|
+
*/
|
30
|
+
afterInit(): Promise<void>;
|
31
|
+
}
|
32
|
+
export interface AvailableCategory {
|
33
|
+
id: string;
|
34
|
+
name: string;
|
35
|
+
extensions: Array<string>;
|
36
|
+
}
|