@ckeditor/ckeditor5-ckbox 0.0.0-nightly-20250610.0 → 0.0.0-nightly-20250611.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/ckbox.js +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/package.json +10 -10
- package/src/ckboxconfig.d.ts +10 -0
- package/src/index.d.ts +4 -0
- package/src/index.js +3 -0
- package/src/utils.d.ts +11 -0
- package/src/utils.js +11 -0
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-ckbox",
|
3
|
-
"version": "0.0.0-nightly-
|
3
|
+
"version": "0.0.0-nightly-20250611.0",
|
4
4
|
"description": "CKBox integration for CKEditor 5.",
|
5
5
|
"keywords": [
|
6
6
|
"ckeditor",
|
@@ -13,15 +13,15 @@
|
|
13
13
|
"type": "module",
|
14
14
|
"main": "src/index.js",
|
15
15
|
"dependencies": {
|
16
|
-
"@ckeditor/ckeditor5-cloud-services": "0.0.0-nightly-
|
17
|
-
"@ckeditor/ckeditor5-core": "0.0.0-nightly-
|
18
|
-
"@ckeditor/ckeditor5-engine": "0.0.0-nightly-
|
19
|
-
"@ckeditor/ckeditor5-icons": "0.0.0-nightly-
|
20
|
-
"@ckeditor/ckeditor5-image": "0.0.0-nightly-
|
21
|
-
"@ckeditor/ckeditor5-ui": "0.0.0-nightly-
|
22
|
-
"@ckeditor/ckeditor5-upload": "0.0.0-nightly-
|
23
|
-
"@ckeditor/ckeditor5-utils": "0.0.0-nightly-
|
24
|
-
"ckeditor5": "0.0.0-nightly-
|
16
|
+
"@ckeditor/ckeditor5-cloud-services": "0.0.0-nightly-20250611.0",
|
17
|
+
"@ckeditor/ckeditor5-core": "0.0.0-nightly-20250611.0",
|
18
|
+
"@ckeditor/ckeditor5-engine": "0.0.0-nightly-20250611.0",
|
19
|
+
"@ckeditor/ckeditor5-icons": "0.0.0-nightly-20250611.0",
|
20
|
+
"@ckeditor/ckeditor5-image": "0.0.0-nightly-20250611.0",
|
21
|
+
"@ckeditor/ckeditor5-ui": "0.0.0-nightly-20250611.0",
|
22
|
+
"@ckeditor/ckeditor5-upload": "0.0.0-nightly-20250611.0",
|
23
|
+
"@ckeditor/ckeditor5-utils": "0.0.0-nightly-20250611.0",
|
24
|
+
"ckeditor5": "0.0.0-nightly-20250611.0",
|
25
25
|
"blurhash": "2.0.5",
|
26
26
|
"es-toolkit": "1.38.0"
|
27
27
|
},
|
package/src/ckboxconfig.d.ts
CHANGED
@@ -247,12 +247,16 @@ export interface CKBoxUploadConfig {
|
|
247
247
|
* Asset definition.
|
248
248
|
*
|
249
249
|
* The definition contains the unique `id`, asset `type` and an `attributes` definition.
|
250
|
+
*
|
251
|
+
* @internal
|
250
252
|
*/
|
251
253
|
export type CKBoxAssetDefinition = CKBoxAssetImageDefinition | CKBoxAssetLinkDefinition;
|
252
254
|
/**
|
253
255
|
* Image asset definition.
|
254
256
|
*
|
255
257
|
* The definition contains the unique `id`, asset `type` and an `attributes` definition.
|
258
|
+
*
|
259
|
+
* @internal
|
256
260
|
*/
|
257
261
|
export interface CKBoxAssetImageDefinition {
|
258
262
|
/**
|
@@ -272,6 +276,8 @@ export interface CKBoxAssetImageDefinition {
|
|
272
276
|
* Link asset definition.
|
273
277
|
*
|
274
278
|
* The definition contains the unique `id`, asset `type` and an `attributes` definition.
|
279
|
+
*
|
280
|
+
* @internal
|
275
281
|
*/
|
276
282
|
export interface CKBoxAssetLinkDefinition {
|
277
283
|
/**
|
@@ -316,6 +322,8 @@ export interface CKBoxAssetLinkDefinition {
|
|
316
322
|
* imageTextAlternative: 'An alternative text for the image'
|
317
323
|
* }
|
318
324
|
* ```
|
325
|
+
*
|
326
|
+
* @internal
|
319
327
|
*/
|
320
328
|
export interface CKBoxAssetImageAttributesDefinition {
|
321
329
|
/**
|
@@ -358,6 +366,8 @@ export interface CKBoxAssetImageAttributesDefinition {
|
|
358
366
|
* linkHref: 'https://example.com/assets/asset-id/file.pdf'
|
359
367
|
* }
|
360
368
|
* ```
|
369
|
+
*
|
370
|
+
* @internal
|
361
371
|
*/
|
362
372
|
export interface CKBoxAssetLinkAttributesDefinition {
|
363
373
|
/**
|
package/src/index.d.ts
CHANGED
@@ -14,4 +14,8 @@ export { CKBoxImageEdit } from './ckboximageedit.js';
|
|
14
14
|
export { CKBoxCommand } from './ckboxcommand.js';
|
15
15
|
export { CKBoxImageEditCommand } from './ckboximageedit/ckboximageeditcommand.js';
|
16
16
|
export type { CKBoxConfig } from './ckboxconfig.js';
|
17
|
+
export { getImageUrls as _getCKBoxImageUrls, getWorkspaceId as _getCKBoxWorkspaceId, blurHashToDataUrl as _ckboxBlurHashToDataUrl, sendHttpRequest as _sendCKBoxHttpRequest, convertMimeTypeToExtension as _ckBoxConvertMimeTypeToExtension, getContentTypeOfUrl as _getCKBoxContentTypeOfUrl, getFileExtension as _getCKBoxFileExtension } from './utils.js';
|
18
|
+
export type { CKBoxAssetDefinition as _CKBoxAssetDefinition, CKBoxAssetImageDefinition as _CKBoxAssetImageDefinition, CKBoxAssetLinkDefinition as _CKBoxAssetLinkDefinition, CKBoxAssetImageAttributesDefinition as _CKBoxAssetImageAttributesDefinition, CKBoxAssetLinkAttributesDefinition as _CKBoxAssetLinkAttributesDefinition } from './ckboxconfig.js';
|
19
|
+
export { createEditabilityChecker as _createCKBoxEditabilityChecker } from './ckboximageedit/utils.js';
|
20
|
+
export { prepareImageAssetAttributes as _prepareCKBoxImageAssetAttributes } from './ckboxcommand.js';
|
17
21
|
import './augmentation.js';
|
package/src/index.js
CHANGED
@@ -13,4 +13,7 @@ export { CKBoxImageEditUI } from './ckboximageedit/ckboximageeditui.js';
|
|
13
13
|
export { CKBoxImageEdit } from './ckboximageedit.js';
|
14
14
|
export { CKBoxCommand } from './ckboxcommand.js';
|
15
15
|
export { CKBoxImageEditCommand } from './ckboximageedit/ckboximageeditcommand.js';
|
16
|
+
export { getImageUrls as _getCKBoxImageUrls, getWorkspaceId as _getCKBoxWorkspaceId, blurHashToDataUrl as _ckboxBlurHashToDataUrl, sendHttpRequest as _sendCKBoxHttpRequest, convertMimeTypeToExtension as _ckBoxConvertMimeTypeToExtension, getContentTypeOfUrl as _getCKBoxContentTypeOfUrl, getFileExtension as _getCKBoxFileExtension } from './utils.js';
|
17
|
+
export { createEditabilityChecker as _createCKBoxEditabilityChecker } from './ckboximageedit/utils.js';
|
18
|
+
export { prepareImageAssetAttributes as _prepareCKBoxImageAssetAttributes } from './ckboxcommand.js';
|
16
19
|
import './augmentation.js';
|
package/src/utils.d.ts
CHANGED
@@ -11,6 +11,8 @@ import type { CKBoxImageUrls } from './ckboxconfig.js';
|
|
11
11
|
* Converts image source set provided by the CKBox into an object containing:
|
12
12
|
* - responsive URLs for the "webp" image format,
|
13
13
|
* - one fallback URL for browsers that do not support the "webp" format.
|
14
|
+
*
|
15
|
+
* @internal
|
14
16
|
*/
|
15
17
|
export declare function getImageUrls(imageUrls: CKBoxImageUrls): {
|
16
18
|
imageFallbackUrl: string;
|
@@ -24,10 +26,13 @@ export declare function getImageUrls(imageUrls: CKBoxImageUrls): {
|
|
24
26
|
* Returns a workspace id to use for communication with the CKBox service.
|
25
27
|
*
|
26
28
|
* @param defaultWorkspaceId The default workspace to use taken from editor config.
|
29
|
+
* @internal
|
27
30
|
*/
|
28
31
|
export declare function getWorkspaceId(token: InitializedToken, defaultWorkspaceId?: string): string | null;
|
29
32
|
/**
|
30
33
|
* Generates an image data URL from its `blurhash` representation.
|
34
|
+
*
|
35
|
+
* @internal
|
31
36
|
*/
|
32
37
|
export declare function blurHashToDataUrl(hash?: string): string | undefined;
|
33
38
|
/**
|
@@ -52,15 +57,21 @@ export declare function sendHttpRequest({ url, method, data, onUploadProgress, s
|
|
52
57
|
}): Promise<any>;
|
53
58
|
/**
|
54
59
|
* Returns an extension a typical file in the specified `mimeType` format would have.
|
60
|
+
*
|
61
|
+
* @internal
|
55
62
|
*/
|
56
63
|
export declare function convertMimeTypeToExtension(mimeType: string): string;
|
57
64
|
/**
|
58
65
|
* Tries to fetch the given `url` and returns 'content-type' of the response.
|
66
|
+
*
|
67
|
+
* @internal
|
59
68
|
*/
|
60
69
|
export declare function getContentTypeOfUrl(url: string, options: {
|
61
70
|
signal: AbortSignal;
|
62
71
|
}): Promise<string>;
|
63
72
|
/**
|
64
73
|
* Returns an extension from the given value.
|
74
|
+
*
|
75
|
+
* @internal
|
65
76
|
*/
|
66
77
|
export declare function getFileExtension(file: File): string;
|
package/src/utils.js
CHANGED
@@ -7,6 +7,8 @@ import { decode } from 'blurhash';
|
|
7
7
|
* Converts image source set provided by the CKBox into an object containing:
|
8
8
|
* - responsive URLs for the "webp" image format,
|
9
9
|
* - one fallback URL for browsers that do not support the "webp" format.
|
10
|
+
*
|
11
|
+
* @internal
|
10
12
|
*/
|
11
13
|
export function getImageUrls(imageUrls) {
|
12
14
|
const responsiveUrls = [];
|
@@ -34,6 +36,7 @@ export function getImageUrls(imageUrls) {
|
|
34
36
|
* Returns a workspace id to use for communication with the CKBox service.
|
35
37
|
*
|
36
38
|
* @param defaultWorkspaceId The default workspace to use taken from editor config.
|
39
|
+
* @internal
|
37
40
|
*/
|
38
41
|
export function getWorkspaceId(token, defaultWorkspaceId) {
|
39
42
|
const [, binaryTokenPayload] = token.value.split('.');
|
@@ -54,6 +57,8 @@ export function getWorkspaceId(token, defaultWorkspaceId) {
|
|
54
57
|
const BLUR_RESOLUTION = 32;
|
55
58
|
/**
|
56
59
|
* Generates an image data URL from its `blurhash` representation.
|
60
|
+
*
|
61
|
+
* @internal
|
57
62
|
*/
|
58
63
|
export function blurHashToDataUrl(hash) {
|
59
64
|
if (!hash) {
|
@@ -143,12 +148,16 @@ const MIME_TO_EXTENSION = {
|
|
143
148
|
};
|
144
149
|
/**
|
145
150
|
* Returns an extension a typical file in the specified `mimeType` format would have.
|
151
|
+
*
|
152
|
+
* @internal
|
146
153
|
*/
|
147
154
|
export function convertMimeTypeToExtension(mimeType) {
|
148
155
|
return MIME_TO_EXTENSION[mimeType];
|
149
156
|
}
|
150
157
|
/**
|
151
158
|
* Tries to fetch the given `url` and returns 'content-type' of the response.
|
159
|
+
*
|
160
|
+
* @internal
|
152
161
|
*/
|
153
162
|
export async function getContentTypeOfUrl(url, options) {
|
154
163
|
try {
|
@@ -168,6 +177,8 @@ export async function getContentTypeOfUrl(url, options) {
|
|
168
177
|
}
|
169
178
|
/**
|
170
179
|
* Returns an extension from the given value.
|
180
|
+
*
|
181
|
+
* @internal
|
171
182
|
*/
|
172
183
|
export function getFileExtension(file) {
|
173
184
|
const fileName = file.name;
|