@ckbox/core 2.1.1 → 2.2.0-rc.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/README.md +3 -3
- package/dist/index.d.ts +84 -28
- package/dist/index.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/es-la.js +1 -1
- package/dist/translations/es-mx.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fr-ca.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/mr.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/zh-tw.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ Using a build served from the CDN is the simplest and fastest way of embedding C
|
|
|
13
13
|
To start using CKBox on your website, embed the following `script` element in the HTML code of the page:
|
|
14
14
|
|
|
15
15
|
```html
|
|
16
|
-
<script src="https://cdn.ckbox.io/ckbox/2.
|
|
16
|
+
<script src="https://cdn.ckbox.io/ckbox/2.2.0-rc.0/ckbox.js"></script>
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
Quick implementation example:
|
|
@@ -23,7 +23,7 @@ Quick implementation example:
|
|
|
23
23
|
<html>
|
|
24
24
|
<head>
|
|
25
25
|
<meta charset="UTF-8" />
|
|
26
|
-
<script src="https://cdn.ckbox.io/ckbox/2.
|
|
26
|
+
<script src="https://cdn.ckbox.io/ckbox/2.2.0-rc.0/ckbox.js"></script>
|
|
27
27
|
</head>
|
|
28
28
|
<body>
|
|
29
29
|
<div id="ckbox"></div>
|
|
@@ -49,7 +49,7 @@ The code snippet below presents the simplest scenario for integration of CKEdito
|
|
|
49
49
|
<head>
|
|
50
50
|
<meta charset="UTF-8" />
|
|
51
51
|
<script src="https://cdn.ckeditor.com/ckeditor5/39.0.0/classic/ckeditor.js"></script>
|
|
52
|
-
<script src="https://cdn.ckbox.io/ckbox/2.
|
|
52
|
+
<script src="https://cdn.ckbox.io/ckbox/2.2.0-rc.0/ckbox.js"></script>
|
|
53
53
|
</head>
|
|
54
54
|
<body>
|
|
55
55
|
<div id="editor"></div>
|
package/dist/index.d.ts
CHANGED
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
4
4
|
*/
|
|
5
|
-
import * as React from 'react';
|
|
6
5
|
import { IconRenderProp } from '@ckbox/components';
|
|
6
|
+
import * as React from 'react';
|
|
7
7
|
|
|
8
8
|
type ApiAssetImageProcessingStatus = 'queued' | 'success' | 'error';
|
|
9
9
|
|
|
10
|
+
type TokenCallback = () => Promise<string>;
|
|
11
|
+
type TokenUrl = string | TokenCallback;
|
|
12
|
+
|
|
10
13
|
interface ParsedAssetMetadata extends Record<string, unknown> {
|
|
11
14
|
/**
|
|
12
15
|
* Asset blurhash.
|
|
@@ -166,6 +169,20 @@ type CategoriesConfig = {
|
|
|
166
169
|
icons?: Record<string, IconRenderProp>;
|
|
167
170
|
};
|
|
168
171
|
|
|
172
|
+
interface ImageEditingOnSaveParams {
|
|
173
|
+
/**
|
|
174
|
+
* Saved asset.
|
|
175
|
+
*/
|
|
176
|
+
data: ParsedAsset;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
interface ImageEditingConfig {
|
|
180
|
+
/**
|
|
181
|
+
* Determines whether to show file overwrite checkbox in image editor.
|
|
182
|
+
*/
|
|
183
|
+
allowOverwrite?: boolean;
|
|
184
|
+
}
|
|
185
|
+
|
|
169
186
|
type LanguageConfig = string;
|
|
170
187
|
|
|
171
188
|
type NavigationViewType = 'category' | 'fallback' | 'folder' | 'recent' | 'search' | 'settings';
|
|
@@ -235,7 +252,38 @@ interface DialogModeProps {
|
|
|
235
252
|
type DialogProps = boolean | DialogModeProps;
|
|
236
253
|
|
|
237
254
|
type Asset = AssetsConfigOnChooseParams;
|
|
238
|
-
|
|
255
|
+
type CoreBaseProps = {
|
|
256
|
+
/**
|
|
257
|
+
* Unique ID used to distinguish various app instances.
|
|
258
|
+
* If not set, app instances will share common user preferences.
|
|
259
|
+
*/
|
|
260
|
+
id?: string;
|
|
261
|
+
/**
|
|
262
|
+
* Language options.
|
|
263
|
+
*/
|
|
264
|
+
language?: LanguageConfig;
|
|
265
|
+
/**
|
|
266
|
+
* Origin of the backend API service.
|
|
267
|
+
*/
|
|
268
|
+
serviceOrigin?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Theme to use.
|
|
271
|
+
*/
|
|
272
|
+
theme?: string;
|
|
273
|
+
/**
|
|
274
|
+
* Endpoint address to download the token or a callback that provides the token.
|
|
275
|
+
*/
|
|
276
|
+
tokenUrl: TokenUrl;
|
|
277
|
+
/**
|
|
278
|
+
* Allows to always display demo label.
|
|
279
|
+
*/
|
|
280
|
+
forceDemoLabel?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Configures Image Editing feature.
|
|
283
|
+
*/
|
|
284
|
+
imageEditing?: ImageEditingConfig;
|
|
285
|
+
};
|
|
286
|
+
type CoreCKBoxProps = {
|
|
239
287
|
/**
|
|
240
288
|
* Configures assets options.
|
|
241
289
|
*/
|
|
@@ -248,15 +296,6 @@ interface CoreContext {
|
|
|
248
296
|
* Dialog mode options.
|
|
249
297
|
*/
|
|
250
298
|
dialog?: DialogProps;
|
|
251
|
-
/**
|
|
252
|
-
* Unique ID used to distinguish various app instances.
|
|
253
|
-
* If not set, app instances will share common user preferences.
|
|
254
|
-
*/
|
|
255
|
-
id?: string;
|
|
256
|
-
/**
|
|
257
|
-
* Language options.
|
|
258
|
-
*/
|
|
259
|
-
language?: LanguageConfig;
|
|
260
299
|
/**
|
|
261
300
|
* If set to `false`, last selected view will not be re-opened on startup.
|
|
262
301
|
*
|
|
@@ -265,10 +304,6 @@ interface CoreContext {
|
|
|
265
304
|
* @deprecated
|
|
266
305
|
*/
|
|
267
306
|
openLastView?: NavigationProviderConfig['openLastView'];
|
|
268
|
-
/**
|
|
269
|
-
* Origin of the backend API service.
|
|
270
|
-
*/
|
|
271
|
-
serviceOrigin?: string;
|
|
272
307
|
/**
|
|
273
308
|
* ID of the category that will be opened on startup.
|
|
274
309
|
* This option can be paired with setting `openLastView` to `false` to enforce CKBox to always open in a given category at start.
|
|
@@ -287,31 +322,52 @@ interface CoreContext {
|
|
|
287
322
|
* @deprecated
|
|
288
323
|
*/
|
|
289
324
|
startupFolderId?: NavigationProviderConfig['startupFolderId'];
|
|
290
|
-
/**
|
|
291
|
-
* Theme to use.
|
|
292
|
-
*/
|
|
293
|
-
theme?: string;
|
|
294
|
-
/**
|
|
295
|
-
* Token endpoint URL.
|
|
296
|
-
*/
|
|
297
|
-
tokenUrl: string;
|
|
298
325
|
/**
|
|
299
326
|
* Configures view and navigation-related options.
|
|
300
327
|
*/
|
|
301
328
|
view?: NavigationProviderConfig;
|
|
329
|
+
/**
|
|
330
|
+
* Upload config options.
|
|
331
|
+
*/
|
|
302
332
|
upload?: {
|
|
303
333
|
dialogMinimizeTimeout?: number;
|
|
304
334
|
componentsHideTimeout?: number;
|
|
305
335
|
};
|
|
306
|
-
}
|
|
307
|
-
|
|
336
|
+
};
|
|
337
|
+
type Props = CoreCKBoxProps & CoreBaseProps;
|
|
338
|
+
type CoreImageEditorProps = {
|
|
339
|
+
/**
|
|
340
|
+
* ID of an asset to open.
|
|
341
|
+
*/
|
|
342
|
+
assetId: string;
|
|
343
|
+
/**
|
|
344
|
+
* Whether image editor should be open.
|
|
345
|
+
*/
|
|
346
|
+
open: boolean;
|
|
347
|
+
/**
|
|
348
|
+
* Callback invoked upon closing image editor.
|
|
349
|
+
*/
|
|
350
|
+
onClose?: () => void;
|
|
351
|
+
/**
|
|
352
|
+
* Callback invoked upon successfully saving edited image.
|
|
353
|
+
*
|
|
354
|
+
* @param data saved data
|
|
355
|
+
*/
|
|
356
|
+
onSave?: (data: ImageEditingOnSaveParams) => void;
|
|
357
|
+
};
|
|
358
|
+
type ImageEditorProps = CoreImageEditorProps & CoreBaseProps;
|
|
359
|
+
|
|
360
|
+
declare const CoreImageEditor: React.FC<ImageEditorProps>;
|
|
308
361
|
|
|
309
|
-
|
|
310
|
-
|
|
362
|
+
/**
|
|
363
|
+
* `CoreApp` is meant to hold all providers that are workspace-agnostic.
|
|
364
|
+
* These providers should be mounted once in CKBox instance's lifetime.
|
|
365
|
+
*/
|
|
366
|
+
declare const CoreApp: React.FC<Props>;
|
|
311
367
|
|
|
312
368
|
/**
|
|
313
369
|
* Current version of the package.
|
|
314
370
|
*/
|
|
315
371
|
declare const CKBOX_VERSION: string | undefined;
|
|
316
372
|
|
|
317
|
-
export { Asset,
|
|
373
|
+
export { type Asset, CoreApp as CKBox, CoreImageEditor as CKBoxImageEditor, type ImageEditorProps, type Props, CKBOX_VERSION as version };
|