@ckeditor/ckeditor5-ckbox 41.2.0 → 41.3.0-alpha.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/content-index.css +4 -0
- package/dist/editor-index.css +31 -0
- package/dist/index.css +55 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +1713 -0
- package/dist/index.js.map +1 -0
- package/dist/types/augmentation.d.ts +32 -0
- package/dist/types/ckbox.d.ts +33 -0
- package/dist/types/ckboxcommand.d.ts +114 -0
- package/dist/types/ckboxconfig.d.ts +325 -0
- package/dist/types/ckboxediting.d.ts +54 -0
- package/dist/types/ckboximageedit/ckboximageeditcommand.d.ts +97 -0
- package/dist/types/ckboximageedit/ckboximageeditediting.d.ts +28 -0
- package/dist/types/ckboximageedit/ckboximageeditui.d.ts +24 -0
- package/dist/types/ckboximageedit/utils.d.ts +10 -0
- package/dist/types/ckboximageedit.d.ts +24 -0
- package/dist/types/ckboxui.d.ts +21 -0
- package/dist/types/ckboxuploadadapter.d.ts +33 -0
- package/dist/types/ckboxutils.d.ts +50 -0
- package/dist/types/index.d.ts +17 -0
- package/dist/types/utils.d.ts +63 -0
- package/package.json +3 -2
@@ -0,0 +1,24 @@
|
|
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
|
+
* @module ckbox/ckboximageedit/ckboximageeditui
|
7
|
+
*/
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
9
|
+
/**
|
10
|
+
* The UI plugin of the CKBox image edit feature.
|
11
|
+
*
|
12
|
+
* It registers the `'ckboxImageEdit'` UI button in the editor's {@link module:ui/componentfactory~ComponentFactory component factory}
|
13
|
+
* that allows you to open the CKBox dialog and edit the image.
|
14
|
+
*/
|
15
|
+
export default class CKBoxImageEditUI extends Plugin {
|
16
|
+
/**
|
17
|
+
* @inheritDoc
|
18
|
+
*/
|
19
|
+
static get pluginName(): "CKBoxImageEditUI";
|
20
|
+
/**
|
21
|
+
* @inheritDoc
|
22
|
+
*/
|
23
|
+
init(): void;
|
24
|
+
}
|
@@ -0,0 +1,10 @@
|
|
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
|
+
import type { Element } from 'ckeditor5/src/engine.js';
|
6
|
+
import type { CKBoxConfig } from '../ckboxconfig.js';
|
7
|
+
/**
|
8
|
+
* @internal
|
9
|
+
*/
|
10
|
+
export declare function createEditabilityChecker(allowExternalImagesEditing: CKBoxConfig['allowExternalImagesEditing']): (element: Element) => boolean;
|
@@ -0,0 +1,24 @@
|
|
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
|
+
* @module ckbox/ckboximageedit
|
7
|
+
*/
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
9
|
+
import CKBoxImageEditEditing from './ckboximageedit/ckboximageeditediting.js';
|
10
|
+
import CKBoxImageEditUI from './ckboximageedit/ckboximageeditui.js';
|
11
|
+
import '../theme/ckboximageedit.css';
|
12
|
+
/**
|
13
|
+
* The CKBox image edit feature.
|
14
|
+
*/
|
15
|
+
export default class CKBoxImageEdit extends Plugin {
|
16
|
+
/**
|
17
|
+
* @inheritDoc
|
18
|
+
*/
|
19
|
+
static get pluginName(): "CKBoxImageEdit";
|
20
|
+
/**
|
21
|
+
* @inheritDoc
|
22
|
+
*/
|
23
|
+
static get requires(): readonly [typeof CKBoxImageEditEditing, typeof CKBoxImageEditUI];
|
24
|
+
}
|
@@ -0,0 +1,21 @@
|
|
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
|
+
* @module ckbox/ckboxui
|
7
|
+
*/
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
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
|
+
}
|
@@ -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
|
+
* @module ckbox/ckboxuploadadapter
|
7
|
+
*/
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
9
|
+
import { FileRepository } from 'ckeditor5/src/upload.js';
|
10
|
+
import CKBoxEditing from './ckboxediting.js';
|
11
|
+
/**
|
12
|
+
* A plugin that enables file uploads in CKEditor 5 using the CKBox server–side connector.
|
13
|
+
* See the {@glink features/file-management/ckbox CKBox file manager integration} guide to learn how to configure
|
14
|
+
* and use this feature as well as find out more about the full integration with the file manager
|
15
|
+
* provided by the {@link module:ckbox/ckbox~CKBox} plugin.
|
16
|
+
*
|
17
|
+
* Check out the {@glink features/images/image-upload/image-upload Image upload overview} guide to learn about
|
18
|
+
* other ways to upload images into CKEditor 5.
|
19
|
+
*/
|
20
|
+
export default class CKBoxUploadAdapter extends Plugin {
|
21
|
+
/**
|
22
|
+
* @inheritDoc
|
23
|
+
*/
|
24
|
+
static get requires(): readonly ["ImageUploadEditing", "ImageUploadProgress", typeof FileRepository, typeof CKBoxEditing];
|
25
|
+
/**
|
26
|
+
* @inheritDoc
|
27
|
+
*/
|
28
|
+
static get pluginName(): "CKBoxUploadAdapter";
|
29
|
+
/**
|
30
|
+
* @inheritDoc
|
31
|
+
*/
|
32
|
+
afterInit(): Promise<void>;
|
33
|
+
}
|
@@ -0,0 +1,50 @@
|
|
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
|
+
* @module ckbox/ckboxutils
|
7
|
+
*/
|
8
|
+
import type { InitializedToken } from '@ckeditor/ckeditor5-cloud-services';
|
9
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
10
|
+
/**
|
11
|
+
* The CKBox utilities plugin.
|
12
|
+
*/
|
13
|
+
export default class CKBoxUtils extends Plugin {
|
14
|
+
/**
|
15
|
+
* CKEditor Cloud Services access token.
|
16
|
+
*/
|
17
|
+
private _token;
|
18
|
+
/**
|
19
|
+
* @inheritDoc
|
20
|
+
*/
|
21
|
+
static get pluginName(): "CKBoxUtils";
|
22
|
+
/**
|
23
|
+
* @inheritDoc
|
24
|
+
*/
|
25
|
+
static get requires(): readonly ["CloudServices"];
|
26
|
+
/**
|
27
|
+
* @inheritDoc
|
28
|
+
*/
|
29
|
+
init(): Promise<void>;
|
30
|
+
/**
|
31
|
+
* Returns a token used by the CKBox plugin for communication with the CKBox service.
|
32
|
+
*/
|
33
|
+
getToken(): InitializedToken;
|
34
|
+
/**
|
35
|
+
* The ID of workspace to use when uploading an image.
|
36
|
+
*/
|
37
|
+
getWorkspaceId(): string;
|
38
|
+
/**
|
39
|
+
* Resolves a promise with an object containing a category with which the uploaded file is associated or an error code.
|
40
|
+
*/
|
41
|
+
getCategoryIdForFile(fileOrUrl: File | string, options: {
|
42
|
+
signal: AbortSignal;
|
43
|
+
}): Promise<string>;
|
44
|
+
/**
|
45
|
+
* Resolves a promise with an array containing available categories with which the uploaded file can be associated.
|
46
|
+
*
|
47
|
+
* If the API returns limited results, the method will collect all items.
|
48
|
+
*/
|
49
|
+
private _getAvailableCategories;
|
50
|
+
}
|
@@ -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
|
+
* @module ckbox
|
7
|
+
*/
|
8
|
+
export { default as CKBox } from './ckbox.js';
|
9
|
+
export { default as CKBoxEditing } from './ckboxediting.js';
|
10
|
+
export { default as CKBoxUI } from './ckboxui.js';
|
11
|
+
export { default as CKBoxImageEditEditing } from './ckboximageedit/ckboximageeditediting.js';
|
12
|
+
export { default as CKBoxImageEditUI } from './ckboximageedit/ckboximageeditui.js';
|
13
|
+
export { default as CKBoxImageEdit } from './ckboximageedit.js';
|
14
|
+
export type { default as CKBoxCommand } from './ckboxcommand.js';
|
15
|
+
export type { default as CKBoxImageEditCommand } from './ckboximageedit/ckboximageeditcommand.js';
|
16
|
+
export type { CKBoxConfig } from './ckboxconfig.js';
|
17
|
+
import './augmentation.js';
|
@@ -0,0 +1,63 @@
|
|
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
|
+
* @module ckbox/utils
|
7
|
+
*/
|
8
|
+
import type { InitializedToken } from '@ckeditor/ckeditor5-cloud-services';
|
9
|
+
import type { CKBoxImageUrls } from './ckboxconfig.js';
|
10
|
+
/**
|
11
|
+
* Converts image source set provided by the CKBox into an object containing:
|
12
|
+
* - responsive URLs for the "webp" image format,
|
13
|
+
* - one fallback URL for browsers that do not support the "webp" format.
|
14
|
+
*/
|
15
|
+
export declare function getImageUrls(imageUrls: CKBoxImageUrls): {
|
16
|
+
imageFallbackUrl: string;
|
17
|
+
imageSources: Array<{
|
18
|
+
srcset: string;
|
19
|
+
sizes: string;
|
20
|
+
type: string;
|
21
|
+
}>;
|
22
|
+
};
|
23
|
+
/**
|
24
|
+
* Returns a workspace id to use for communication with the CKBox service.
|
25
|
+
*
|
26
|
+
* @param defaultWorkspaceId The default workspace to use taken from editor config.
|
27
|
+
*/
|
28
|
+
export declare function getWorkspaceId(token: InitializedToken, defaultWorkspaceId?: string): string | null;
|
29
|
+
/**
|
30
|
+
* Generates an image data URL from its `blurhash` representation.
|
31
|
+
*/
|
32
|
+
export declare function blurHashToDataUrl(hash?: string): string | undefined;
|
33
|
+
/**
|
34
|
+
* Sends the HTTP request.
|
35
|
+
*
|
36
|
+
* @internal
|
37
|
+
* @param config.url the URL where the request will be sent.
|
38
|
+
* @param config.method The HTTP method.
|
39
|
+
* @param config.data Additional data to send.
|
40
|
+
* @param config.onUploadProgress A callback informing about the upload progress.
|
41
|
+
*/
|
42
|
+
export declare function sendHttpRequest({ url, method, data, onUploadProgress, signal, authorization }: {
|
43
|
+
url: URL;
|
44
|
+
signal: AbortSignal;
|
45
|
+
authorization: string;
|
46
|
+
method?: 'GET' | 'POST';
|
47
|
+
data?: FormData | null;
|
48
|
+
onUploadProgress?: (evt: ProgressEvent) => void;
|
49
|
+
}): Promise<any>;
|
50
|
+
/**
|
51
|
+
* Returns an extension a typical file in the specified `mimeType` format would have.
|
52
|
+
*/
|
53
|
+
export declare function convertMimeTypeToExtension(mimeType: string): string;
|
54
|
+
/**
|
55
|
+
* Tries to fetch the given `url` and returns 'content-type' of the response.
|
56
|
+
*/
|
57
|
+
export declare function getContentTypeOfUrl(url: string, options: {
|
58
|
+
signal: AbortSignal;
|
59
|
+
}): Promise<string>;
|
60
|
+
/**
|
61
|
+
* Returns an extension from the given value.
|
62
|
+
*/
|
63
|
+
export declare function getFileExtension(file: File): string;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-ckbox",
|
3
|
-
"version": "41.
|
3
|
+
"version": "41.3.0-alpha.0",
|
4
4
|
"description": "CKBox integration for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -13,7 +13,7 @@
|
|
13
13
|
"type": "module",
|
14
14
|
"main": "src/index.js",
|
15
15
|
"dependencies": {
|
16
|
-
"ckeditor5": "41.
|
16
|
+
"ckeditor5": "41.3.0-alpha.0",
|
17
17
|
"blurhash": "2.0.5",
|
18
18
|
"lodash-es": "4.17.21"
|
19
19
|
},
|
@@ -27,6 +27,7 @@
|
|
27
27
|
"directory": "packages/ckeditor5-ckbox"
|
28
28
|
},
|
29
29
|
"files": [
|
30
|
+
"dist",
|
30
31
|
"lang",
|
31
32
|
"src/**/*.js",
|
32
33
|
"src/**/*.d.ts",
|