@ckeditor/ckeditor5-ckbox 36.0.0 → 37.0.0-alpha.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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
- * @inheritDoc
23
- */
24
- static get pluginName() {
25
- return 'CKBoxUI';
26
- }
27
-
28
- /**
29
- * @inheritDoc
30
- */
31
- afterInit() {
32
- const editor = this.editor;
33
-
34
- // Do not register the `ckbox` button if the command does not exist.
35
- if ( !editor.commands.get( 'ckbox' ) ) {
36
- return;
37
- }
38
-
39
- const t = editor.t;
40
- const componentFactory = editor.ui.componentFactory;
41
-
42
- componentFactory.add( 'ckbox', locale => {
43
- const command = editor.commands.get( 'ckbox' );
44
-
45
- const button = new ButtonView( locale );
46
-
47
- button.set( {
48
- label: t( 'Open file manager' ),
49
- icon: browseFilesIcon,
50
- tooltip: true
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,37 @@
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
+ import './ckboxconfig';
10
+ /**
11
+ * A plugin that enables file uploads in CKEditor 5 using the CKBox server–side connector.
12
+ * See the {@glink features/images/image-upload/ckbox CKBox file manager integration} guide to learn how to configure
13
+ * and use this feature as well as find out more about the full integration with the file manager
14
+ * provided by the {@link module:ckbox/ckbox~CKBox} plugin.
15
+ *
16
+ * Check out the {@glink features/images/image-upload/image-upload Image upload overview} guide to learn about
17
+ * other ways to upload images into CKEditor 5.
18
+ */
19
+ export default class CKBoxUploadAdapter extends Plugin {
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ static get requires(): PluginDependencies;
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get pluginName(): 'CKBoxUploadAdapter';
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ afterInit(): Promise<void>;
32
+ }
33
+ export interface AvailableCategory {
34
+ id: string;
35
+ name: string;
36
+ extensions: Array<string>;
37
+ }