@ckeditor/ckeditor5-ckbox 48.2.0 → 48.3.0-alpha.1

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.
@@ -1,456 +1,456 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module ckbox/ckboxconfig
7
- */
8
- import type { TokenUrl } from '@ckeditor/ckeditor5-cloud-services';
9
- import type { ArrayOrItem } from '@ckeditor/ckeditor5-utils';
6
+ * @module ckbox/ckboxconfig
7
+ */
8
+ import type { TokenUrl } from "@ckeditor/ckeditor5-cloud-services";
9
+ import type { ArrayOrItem } from "@ckeditor/ckeditor5-utils";
10
10
  /**
11
- * The configuration of the {@link module:ckbox/ckbox~CKBox CKBox feature}.
12
- *
13
- * The minimal configuration for the CKBox feature requires providing the
14
- * {@link module:ckbox/ckboxconfig~CKBoxConfig#tokenUrl `config.ckbox.tokenUrl`}:
15
- *
16
- * ```ts
17
- * ClassicEditor
18
- * .create( {
19
- * ckbox: {
20
- * tokenUrl: 'https://example.com/cs-token-endpoint'
21
- * }
22
- * } )
23
- * .then( ... )
24
- * .catch( ... );
25
- * ```
26
- *
27
- * Hovewer, you can also adjust the feature to fit your needs:
28
- *
29
- * ```ts
30
- * ClassicEditor
31
- * .create( {
32
- * ckbox: {
33
- * defaultUploadCategories: {
34
- * Bitmaps: [ 'bmp' ],
35
- * Pictures: [ 'jpg', 'jpeg' ],
36
- * Scans: [ 'png', 'tiff' ]
37
- * },
38
- * ignoreDataId: true,
39
- * serviceOrigin: 'https://example.com/',
40
- * tokenUrl: 'https://example.com/cs-token-endpoint'
41
- * }
42
- * } )
43
- * .then( ... )
44
- * .catch( ... );
45
- * ```
46
- *
47
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
48
- */
11
+ * The configuration of the {@link module:ckbox/ckbox~CKBox CKBox feature}.
12
+ *
13
+ * The minimal configuration for the CKBox feature requires providing the
14
+ * {@link module:ckbox/ckboxconfig~CKBoxConfig#tokenUrl `config.ckbox.tokenUrl`}:
15
+ *
16
+ * ```ts
17
+ * ClassicEditor
18
+ * .create( {
19
+ * ckbox: {
20
+ * tokenUrl: 'https://example.com/cs-token-endpoint'
21
+ * }
22
+ * } )
23
+ * .then( ... )
24
+ * .catch( ... );
25
+ * ```
26
+ *
27
+ * Hovewer, you can also adjust the feature to fit your needs:
28
+ *
29
+ * ```ts
30
+ * ClassicEditor
31
+ * .create( {
32
+ * ckbox: {
33
+ * defaultUploadCategories: {
34
+ * Bitmaps: [ 'bmp' ],
35
+ * Pictures: [ 'jpg', 'jpeg' ],
36
+ * Scans: [ 'png', 'tiff' ]
37
+ * },
38
+ * ignoreDataId: true,
39
+ * serviceOrigin: 'https://example.com/',
40
+ * tokenUrl: 'https://example.com/cs-token-endpoint'
41
+ * }
42
+ * } )
43
+ * .then( ... )
44
+ * .catch( ... );
45
+ * ```
46
+ *
47
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
48
+ */
49
49
  export interface CKBoxConfig {
50
- /**
51
- * The authentication token URL for CKBox feature.
52
- *
53
- * Defaults to {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl `config.cloudServices.tokenUrl`}
54
- */
55
- tokenUrl?: TokenUrl;
56
- /**
57
- * The theme for CKBox dialog.
58
- */
59
- theme?: string;
60
- /**
61
- * Defines the categories to which the uploaded images will be assigned.
62
- * If configured, it overrides the category mappings defined on the cloud service.
63
- * The value of this option should be an object, where the keys define categories and their values are the types of images
64
- * that will be uploaded to these categories. The categories might be referenced by their name or ID.
65
- *
66
- * Example:
67
- *
68
- * ```ts
69
- * const ckboxConfig = {
70
- * defaultUploadCategories: {
71
- * Bitmaps: [ 'bmp' ],
72
- * Pictures: [ 'jpg', 'jpeg' ],
73
- * Scans: [ 'png', 'tiff' ],
74
- * // The category below is referenced by its ID.
75
- * 'fdf2a647-b67f-4a6c-b692-5ba1dc1ed87b': [ 'gif' ]
76
- * }
77
- * };
78
- * ```
79
- *
80
- * @default null
81
- */
82
- defaultUploadCategories?: Record<string, Array<string>> | null;
83
- /**
84
- * Defines the workspace id to use during upload when the user has access to more than one workspace.
85
- *
86
- * If defined, it is an error, when the user has no access to the specified workspace.
87
- */
88
- defaultUploadWorkspaceId?: string;
89
- /**
90
- * Enforces displaying the "Powered by CKBox" link regardless of the CKBox plan used.
91
- */
92
- forceDemoLabel?: boolean;
93
- /**
94
- * Allows editing images that are not hosted in CKBox service.
95
- *
96
- * This configuration option should whitelist URL(s) of images that should be editable.
97
- * Make sure that allowed image resources have CORS enabled.
98
- *
99
- * The image is editable if this option is:
100
- * * a regular expression and it matches the image URL, or
101
- * * a custom function that returns `true` for the image URL, or
102
- * * `'origin'` literal and the image URL is from the same origin, or
103
- * * an array of the above and the image URL matches one of the array elements.
104
- *
105
- * Images hosted in CKBox are always editable.
106
- *
107
- * @default []
108
- */
109
- allowExternalImagesEditing?: ArrayOrItem<RegExp | 'origin' | ((src: string) => boolean)>;
110
- /**
111
- * Inserts the unique asset ID as the `data-ckbox-resource-id` attribute. To disable this behavior, set it to `true`.
112
- *
113
- * @default false
114
- */
115
- ignoreDataId?: boolean;
116
- /**
117
- * Configures the base URL of the API service. Required only in on-premises installations.
118
- *
119
- * @default 'https://api.ckbox.io'
120
- */
121
- serviceOrigin?: string;
122
- /**
123
- * Configures the language for the CKBox dialog.
124
- *
125
- * Defaults to {@link module:utils/locale~Locale#uiLanguage `Locale#uiLanguage`}
126
- */
127
- language?: string;
128
- /**
129
- * This option allows opening CKBox in dialog mode. It takes a configuration object with
130
- * the width and height attributes.
131
- */
132
- dialog?: CKBoxDialogConfig;
133
- /**
134
- * Allows setting custom icons for categories.
135
- */
136
- categories?: CKBoxCategoriesConfig;
137
- /**
138
- * Configures the view of CKBox.
139
- */
140
- view?: CKBoxViewConfig;
141
- /**
142
- * Configures when dialog should be minimized and hidden.
143
- */
144
- upload?: CKBoxUploadConfig;
145
- /**
146
- * Specifies the file extensions considered valid for user interaction. Whith this
147
- * option developers can restrict user interaction to only those assets whose file
148
- * extensions match those listed in the array. Assets whose file
149
- * extensions are not listed in the `choosableFileExtensions` array are
150
- * automatically disabled within the CKBox interface.
151
- *
152
- * ```ts
153
- * const ckboxConfig = {
154
- * choosableFileExtensions: ['jpg', 'png']
155
- * };
156
- * ```
157
- */
158
- choosableFileExtensions?: Array<string>;
159
- /**
160
- * Controls when to enable the download attribute for inserted links.
161
- *
162
- * By default, files are downloadable.
163
- *
164
- * ```ts
165
- * const ckboxConfig = {
166
- * downloadableFiles: asset => asset.data.extension !== 'pdf'
167
- * };
168
- * ```
169
- */
170
- downloadableFiles?: (asset: CKBoxRawAssetDefinition) => boolean;
50
+ /**
51
+ * The authentication token URL for CKBox feature.
52
+ *
53
+ * Defaults to {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl `config.cloudServices.tokenUrl`}
54
+ */
55
+ tokenUrl?: TokenUrl;
56
+ /**
57
+ * The theme for CKBox dialog.
58
+ */
59
+ theme?: string;
60
+ /**
61
+ * Defines the categories to which the uploaded images will be assigned.
62
+ * If configured, it overrides the category mappings defined on the cloud service.
63
+ * The value of this option should be an object, where the keys define categories and their values are the types of images
64
+ * that will be uploaded to these categories. The categories might be referenced by their name or ID.
65
+ *
66
+ * Example:
67
+ *
68
+ * ```ts
69
+ * const ckboxConfig = {
70
+ * defaultUploadCategories: {
71
+ * Bitmaps: [ 'bmp' ],
72
+ * Pictures: [ 'jpg', 'jpeg' ],
73
+ * Scans: [ 'png', 'tiff' ],
74
+ * // The category below is referenced by its ID.
75
+ * 'fdf2a647-b67f-4a6c-b692-5ba1dc1ed87b': [ 'gif' ]
76
+ * }
77
+ * };
78
+ * ```
79
+ *
80
+ * @default null
81
+ */
82
+ defaultUploadCategories?: Record<string, Array<string>> | null;
83
+ /**
84
+ * Defines the workspace id to use during upload when the user has access to more than one workspace.
85
+ *
86
+ * If defined, it is an error, when the user has no access to the specified workspace.
87
+ */
88
+ defaultUploadWorkspaceId?: string;
89
+ /**
90
+ * Enforces displaying the "Powered by CKBox" link regardless of the CKBox plan used.
91
+ */
92
+ forceDemoLabel?: boolean;
93
+ /**
94
+ * Allows editing images that are not hosted in CKBox service.
95
+ *
96
+ * This configuration option should whitelist URL(s) of images that should be editable.
97
+ * Make sure that allowed image resources have CORS enabled.
98
+ *
99
+ * The image is editable if this option is:
100
+ * * a regular expression and it matches the image URL, or
101
+ * * a custom function that returns `true` for the image URL, or
102
+ * * `'origin'` literal and the image URL is from the same origin, or
103
+ * * an array of the above and the image URL matches one of the array elements.
104
+ *
105
+ * Images hosted in CKBox are always editable.
106
+ *
107
+ * @default []
108
+ */
109
+ allowExternalImagesEditing?: ArrayOrItem<RegExp | "origin" | ((src: string) => boolean)>;
110
+ /**
111
+ * Inserts the unique asset ID as the `data-ckbox-resource-id` attribute. To disable this behavior, set it to `true`.
112
+ *
113
+ * @default false
114
+ */
115
+ ignoreDataId?: boolean;
116
+ /**
117
+ * Configures the base URL of the API service. Required only in on-premises installations.
118
+ *
119
+ * @default 'https://api.ckbox.io'
120
+ */
121
+ serviceOrigin?: string;
122
+ /**
123
+ * Configures the language for the CKBox dialog.
124
+ *
125
+ * Defaults to {@link module:utils/locale~Locale#uiLanguage `Locale#uiLanguage`}
126
+ */
127
+ language?: string;
128
+ /**
129
+ * This option allows opening CKBox in dialog mode. It takes a configuration object with
130
+ * the width and height attributes.
131
+ */
132
+ dialog?: CKBoxDialogConfig;
133
+ /**
134
+ * Allows setting custom icons for categories.
135
+ */
136
+ categories?: CKBoxCategoriesConfig;
137
+ /**
138
+ * Configures the view of CKBox.
139
+ */
140
+ view?: CKBoxViewConfig;
141
+ /**
142
+ * Configures when dialog should be minimized and hidden.
143
+ */
144
+ upload?: CKBoxUploadConfig;
145
+ /**
146
+ * Specifies the file extensions considered valid for user interaction. Whith this
147
+ * option developers can restrict user interaction to only those assets whose file
148
+ * extensions match those listed in the array. Assets whose file
149
+ * extensions are not listed in the `choosableFileExtensions` array are
150
+ * automatically disabled within the CKBox interface.
151
+ *
152
+ * ```ts
153
+ * const ckboxConfig = {
154
+ * choosableFileExtensions: ['jpg', 'png']
155
+ * };
156
+ * ```
157
+ */
158
+ choosableFileExtensions?: Array<string>;
159
+ /**
160
+ * Controls when to enable the download attribute for inserted links.
161
+ *
162
+ * By default, files are downloadable.
163
+ *
164
+ * ```ts
165
+ * const ckboxConfig = {
166
+ * downloadableFiles: asset => asset.data.extension !== 'pdf'
167
+ * };
168
+ * ```
169
+ */
170
+ downloadableFiles?: (asset: CKBoxRawAssetDefinition) => boolean;
171
171
  }
172
172
  export interface CKBoxDialogConfig {
173
- /**
174
- * The dialog width in pixels.
175
- */
176
- width: number;
177
- /**
178
- * The dialog height in pixels.
179
- */
180
- height: number;
173
+ /**
174
+ * The dialog width in pixels.
175
+ */
176
+ width: number;
177
+ /**
178
+ * The dialog height in pixels.
179
+ */
180
+ height: number;
181
181
  }
182
182
  export interface CKBoxCategoriesConfig {
183
- /**
184
- * This option takes an object with categories and icons that should be used instead
185
- * of the default ones. Categories can be defined using either their name or id.
186
- * Icons should be defined as strings containing the SVG images, or as React components.
187
- *
188
- * ```ts
189
- * const ckboxConfig = {
190
- * categories: {
191
- * icons: {
192
- * Images: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path ... /></svg>',
193
- * // Category can be referenced by ID
194
- * // 'fdf2a647-b67f-4a6c-b692-5ba1dc1ed87b': '<svg...'
195
- * }
196
- * }
197
- * }
198
- * ```
199
- */
200
- icons?: {
201
- [key: string]: string;
202
- };
183
+ /**
184
+ * This option takes an object with categories and icons that should be used instead
185
+ * of the default ones. Categories can be defined using either their name or id.
186
+ * Icons should be defined as strings containing the SVG images, or as React components.
187
+ *
188
+ * ```ts
189
+ * const ckboxConfig = {
190
+ * categories: {
191
+ * icons: {
192
+ * Images: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path ... /></svg>',
193
+ * // Category can be referenced by ID
194
+ * // 'fdf2a647-b67f-4a6c-b692-5ba1dc1ed87b': '<svg...'
195
+ * }
196
+ * }
197
+ * }
198
+ * ```
199
+ */
200
+ icons?: {
201
+ [key: string]: string;
202
+ };
203
203
  }
204
204
  export interface CKBoxViewConfig {
205
- /**
206
- * If it is set to `false` the last view visited by the user will not be reopened on
207
- * the next startup.
208
- */
209
- openLastView?: boolean;
210
- /**
211
- * Sets the ID of the folder that will be opened on startup. This option can be paired
212
- * with setting `view.openLastView` to `false` to enforce CKBox to always open in a given
213
- * folder at startup.
214
- */
215
- startupFolderId?: string;
216
- /**
217
- * Sets the ID of the category that will be opened on startup. This option can be paired
218
- * with setting `view.openLastView` to `false` to enforce CKBox to always open in a given
219
- * category at startup. If `view.startupCategoryId` is passed along with the
220
- * `view.startupFolderId` option, CKBox will prioritize opening category view on the startup.
221
- */
222
- startupCategoryId?: string;
223
- /**
224
- * Sets whether to hide the ‘Maximize’ button. By default, the button is shown and enabling
225
- * this option will hide it.
226
- */
227
- hideMaximizeButton?: boolean;
205
+ /**
206
+ * If it is set to `false` the last view visited by the user will not be reopened on
207
+ * the next startup.
208
+ */
209
+ openLastView?: boolean;
210
+ /**
211
+ * Sets the ID of the folder that will be opened on startup. This option can be paired
212
+ * with setting `view.openLastView` to `false` to enforce CKBox to always open in a given
213
+ * folder at startup.
214
+ */
215
+ startupFolderId?: string;
216
+ /**
217
+ * Sets the ID of the category that will be opened on startup. This option can be paired
218
+ * with setting `view.openLastView` to `false` to enforce CKBox to always open in a given
219
+ * category at startup. If `view.startupCategoryId` is passed along with the
220
+ * `view.startupFolderId` option, CKBox will prioritize opening category view on the startup.
221
+ */
222
+ startupCategoryId?: string;
223
+ /**
224
+ * Sets whether to hide the ‘Maximize’ button. By default, the button is shown and enabling
225
+ * this option will hide it.
226
+ */
227
+ hideMaximizeButton?: boolean;
228
228
  }
229
229
  export interface CKBoxUploadConfig {
230
- /**
231
- * Sets timeout (in milliseconds) after which upload components (dialog and indicator) are
232
- * hidden. By default, these components hide automatically after 10 seconds.
233
- *
234
- * Read more: https://ckeditor.com/docs/ckbox/latest/guides/configuration/configuration-options.html#uploadcomponentshidetimeout
235
- */
236
- componentsHideTimeout?: number;
237
- /**
238
- * Sets timeout (in milliseconds) after which upload dialog is minimized once upload is
239
- * finished and all uploads were successful. By default, upload dialog is never minimized
240
- * automatically.
241
- *
242
- * Read more: https://ckeditor.com/docs/ckbox/latest/guides/configuration/configuration-options.html#uploaddialogminimizetimeout
243
- */
244
- dialogMinimizeTimeout?: number;
230
+ /**
231
+ * Sets timeout (in milliseconds) after which upload components (dialog and indicator) are
232
+ * hidden. By default, these components hide automatically after 10 seconds.
233
+ *
234
+ * Read more: https://ckeditor.com/docs/ckbox/latest/guides/configuration/configuration-options.html#uploadcomponentshidetimeout
235
+ */
236
+ componentsHideTimeout?: number;
237
+ /**
238
+ * Sets timeout (in milliseconds) after which upload dialog is minimized once upload is
239
+ * finished and all uploads were successful. By default, upload dialog is never minimized
240
+ * automatically.
241
+ *
242
+ * Read more: https://ckeditor.com/docs/ckbox/latest/guides/configuration/configuration-options.html#uploaddialogminimizetimeout
243
+ */
244
+ dialogMinimizeTimeout?: number;
245
245
  }
246
246
  /**
247
- * Asset definition.
248
- *
249
- * The definition contains the unique `id`, asset `type` and an `attributes` definition.
250
- *
251
- * @internal
252
- */
247
+ * Asset definition.
248
+ *
249
+ * The definition contains the unique `id`, asset `type` and an `attributes` definition.
250
+ *
251
+ * @internal
252
+ */
253
253
  export type CKBoxAssetDefinition = CKBoxAssetImageDefinition | CKBoxAssetLinkDefinition;
254
254
  /**
255
- * Image asset definition.
256
- *
257
- * The definition contains the unique `id`, asset `type` and an `attributes` definition.
258
- *
259
- * @internal
260
- */
255
+ * Image asset definition.
256
+ *
257
+ * The definition contains the unique `id`, asset `type` and an `attributes` definition.
258
+ *
259
+ * @internal
260
+ */
261
261
  export interface CKBoxAssetImageDefinition {
262
- /**
263
- * An unique asset id.
264
- */
265
- id: string;
266
- /**
267
- * Asset type.
268
- */
269
- type: 'image';
270
- /**
271
- * Asset attributes.
272
- */
273
- attributes: CKBoxAssetImageAttributesDefinition;
262
+ /**
263
+ * An unique asset id.
264
+ */
265
+ id: string;
266
+ /**
267
+ * Asset type.
268
+ */
269
+ type: "image";
270
+ /**
271
+ * Asset attributes.
272
+ */
273
+ attributes: CKBoxAssetImageAttributesDefinition;
274
274
  }
275
275
  /**
276
- * Link asset definition.
277
- *
278
- * The definition contains the unique `id`, asset `type` and an `attributes` definition.
279
- *
280
- * @internal
281
- */
276
+ * Link asset definition.
277
+ *
278
+ * The definition contains the unique `id`, asset `type` and an `attributes` definition.
279
+ *
280
+ * @internal
281
+ */
282
282
  export interface CKBoxAssetLinkDefinition {
283
- /**
284
- * An unique asset id.
285
- */
286
- id: string;
287
- /**
288
- * Asset type.
289
- */
290
- type: 'link';
291
- /**
292
- * Asset attributes.
293
- */
294
- attributes: CKBoxAssetLinkAttributesDefinition;
283
+ /**
284
+ * An unique asset id.
285
+ */
286
+ id: string;
287
+ /**
288
+ * Asset type.
289
+ */
290
+ type: "link";
291
+ /**
292
+ * Asset attributes.
293
+ */
294
+ attributes: CKBoxAssetLinkAttributesDefinition;
295
295
  }
296
296
  /**
297
- * Asset attributes definition for an image.
298
- *
299
- * The definition contains the `imageFallbackUrl`, an `imageSources` array with one image source definition object and the
300
- * `imageTextAlternative`.
301
- *
302
- * ```ts
303
- * {
304
- * imageFallbackUrl: 'https://example.com/assets/asset-id/images/1000.png',
305
- * imageSources: [
306
- * {
307
- * sizes: '1000px',
308
- * srcset:
309
- * 'https://example.com/assets/asset-id/images/100.webp 100w,' +
310
- * 'https://example.com/assets/asset-id/images/200.webp 200w,' +
311
- * 'https://example.com/assets/asset-id/images/300.webp 300w,' +
312
- * 'https://example.com/assets/asset-id/images/400.webp 400w,' +
313
- * 'https://example.com/assets/asset-id/images/500.webp 500w,' +
314
- * 'https://example.com/assets/asset-id/images/600.webp 600w,' +
315
- * 'https://example.com/assets/asset-id/images/700.webp 700w,' +
316
- * 'https://example.com/assets/asset-id/images/800.webp 800w,' +
317
- * 'https://example.com/assets/asset-id/images/900.webp 900w,' +
318
- * 'https://example.com/assets/asset-id/images/1000.webp 1000w',
319
- * type: 'image/webp'
320
- * }
321
- * ],
322
- * imageTextAlternative: 'An alternative text for the image'
323
- * }
324
- * ```
325
- *
326
- * @internal
327
- */
297
+ * Asset attributes definition for an image.
298
+ *
299
+ * The definition contains the `imageFallbackUrl`, an `imageSources` array with one image source definition object and the
300
+ * `imageTextAlternative`.
301
+ *
302
+ * ```ts
303
+ * {
304
+ * imageFallbackUrl: 'https://example.com/assets/asset-id/images/1000.png',
305
+ * imageSources: [
306
+ * {
307
+ * sizes: '1000px',
308
+ * srcset:
309
+ * 'https://example.com/assets/asset-id/images/100.webp 100w,' +
310
+ * 'https://example.com/assets/asset-id/images/200.webp 200w,' +
311
+ * 'https://example.com/assets/asset-id/images/300.webp 300w,' +
312
+ * 'https://example.com/assets/asset-id/images/400.webp 400w,' +
313
+ * 'https://example.com/assets/asset-id/images/500.webp 500w,' +
314
+ * 'https://example.com/assets/asset-id/images/600.webp 600w,' +
315
+ * 'https://example.com/assets/asset-id/images/700.webp 700w,' +
316
+ * 'https://example.com/assets/asset-id/images/800.webp 800w,' +
317
+ * 'https://example.com/assets/asset-id/images/900.webp 900w,' +
318
+ * 'https://example.com/assets/asset-id/images/1000.webp 1000w',
319
+ * type: 'image/webp'
320
+ * }
321
+ * ],
322
+ * imageTextAlternative: 'An alternative text for the image'
323
+ * }
324
+ * ```
325
+ *
326
+ * @internal
327
+ */
328
328
  export interface CKBoxAssetImageAttributesDefinition {
329
- /**
330
- * A fallback URL for browsers that do not support the "webp" format.
331
- */
332
- imageFallbackUrl: string;
333
- /**
334
- * An array containing one image source definition object.
335
- */
336
- imageSources: Array<{
337
- srcset: string;
338
- sizes: string;
339
- type: string;
340
- }>;
341
- /**
342
- * An alternative text for an image.
343
- */
344
- imageTextAlternative: string;
345
- /**
346
- * Image width.
347
- */
348
- imageWidth?: number;
349
- /**
350
- * Image height.
351
- */
352
- imageHeight?: number;
353
- /**
354
- * Image placeholder image.
355
- */
356
- imagePlaceholder?: string;
329
+ /**
330
+ * A fallback URL for browsers that do not support the "webp" format.
331
+ */
332
+ imageFallbackUrl: string;
333
+ /**
334
+ * An array containing one image source definition object.
335
+ */
336
+ imageSources: Array<{
337
+ srcset: string;
338
+ sizes: string;
339
+ type: string;
340
+ }>;
341
+ /**
342
+ * An alternative text for an image.
343
+ */
344
+ imageTextAlternative: string;
345
+ /**
346
+ * Image width.
347
+ */
348
+ imageWidth?: number;
349
+ /**
350
+ * Image height.
351
+ */
352
+ imageHeight?: number;
353
+ /**
354
+ * Image placeholder image.
355
+ */
356
+ imagePlaceholder?: string;
357
357
  }
358
358
  /**
359
- * Asset attributes definition for a link.
360
- *
361
- * The definition contains the `linkName` and `linkHref` strings.
362
- *
363
- * ```ts
364
- * {
365
- * linkName: 'File name',
366
- * linkHref: 'https://example.com/assets/asset-id/file.pdf'
367
- * }
368
- * ```
369
- *
370
- * @internal
371
- */
359
+ * Asset attributes definition for a link.
360
+ *
361
+ * The definition contains the `linkName` and `linkHref` strings.
362
+ *
363
+ * ```ts
364
+ * {
365
+ * linkName: 'File name',
366
+ * linkHref: 'https://example.com/assets/asset-id/file.pdf'
367
+ * }
368
+ * ```
369
+ *
370
+ * @internal
371
+ */
372
372
  export interface CKBoxAssetLinkAttributesDefinition {
373
- /**
374
- * A link name.
375
- */
376
- linkName: string;
377
- /**
378
- * An URL for the asset.
379
- */
380
- linkHref: string;
373
+ /**
374
+ * A link name.
375
+ */
376
+ linkName: string;
377
+ /**
378
+ * An URL for the asset.
379
+ */
380
+ linkHref: string;
381
381
  }
382
382
  /**
383
- * The source set of the responsive image provided by the CKBox backend.
384
- *
385
- * Each numeric key corresponds to display width of the image.
386
- */
383
+ * The source set of the responsive image provided by the CKBox backend.
384
+ *
385
+ * Each numeric key corresponds to display width of the image.
386
+ */
387
387
  export interface CKBoxImageUrls {
388
- [width: number]: string;
389
- /**
390
- * A fallback URL for browsers that do not support the "webp" format.
391
- */
392
- default: string;
388
+ [width: number]: string;
389
+ /**
390
+ * A fallback URL for browsers that do not support the "webp" format.
391
+ */
392
+ default: string;
393
393
  }
394
394
  /**
395
- * Raw asset definition that is received from the CKBox feature.
396
- */
395
+ * Raw asset definition that is received from the CKBox feature.
396
+ */
397
397
  export interface CKBoxRawAssetDefinition {
398
- /**
399
- * A raw asset data definition.
400
- */
401
- data: CKBoxRawAssetDataDefinition;
398
+ /**
399
+ * A raw asset data definition.
400
+ */
401
+ data: CKBoxRawAssetDataDefinition;
402
402
  }
403
403
  /**
404
- * Part of raw asset data that is received from the CKBox feature.
405
- */
404
+ * Part of raw asset data that is received from the CKBox feature.
405
+ */
406
406
  export interface CKBoxRawAssetDataDefinition {
407
- /**
408
- * An unique asset id.
409
- */
410
- id: string;
411
- /**
412
- * An asset name.
413
- */
414
- name: string;
415
- /**
416
- * A raw asset metadata definition.
417
- */
418
- metadata?: CKBoxRawAssetMetadataDefinition;
419
- /**
420
- * The source set of the responsive image.
421
- */
422
- imageUrls?: CKBoxImageUrls;
423
- /**
424
- * The asset location.
425
- */
426
- url: string;
427
- /**
428
- * The asset type.
429
- */
430
- extension?: string;
407
+ /**
408
+ * An unique asset id.
409
+ */
410
+ id: string;
411
+ /**
412
+ * An asset name.
413
+ */
414
+ name: string;
415
+ /**
416
+ * A raw asset metadata definition.
417
+ */
418
+ metadata?: CKBoxRawAssetMetadataDefinition;
419
+ /**
420
+ * The source set of the responsive image.
421
+ */
422
+ imageUrls?: CKBoxImageUrls;
423
+ /**
424
+ * The asset location.
425
+ */
426
+ url: string;
427
+ /**
428
+ * The asset type.
429
+ */
430
+ extension?: string;
431
431
  }
432
432
  /**
433
- * Part of raw asset data that is received from the CKBox feature. Properties are set only if the chosen asset is an image.
434
- */
433
+ * Part of raw asset data that is received from the CKBox feature. Properties are set only if the chosen asset is an image.
434
+ */
435
435
  export interface CKBoxRawAssetMetadataDefinition {
436
- /**
437
- * Image description.
438
- */
439
- description?: string;
440
- /**
441
- * Image width.
442
- */
443
- width?: number;
444
- /**
445
- * Image height.
446
- */
447
- height?: number;
448
- /**
449
- * The blurhash placeholder value.
450
- */
451
- blurHash?: string;
452
- /**
453
- * The processing status of the asset.
454
- */
455
- metadataProcessingStatus?: string;
436
+ /**
437
+ * Image description.
438
+ */
439
+ description?: string;
440
+ /**
441
+ * Image width.
442
+ */
443
+ width?: number;
444
+ /**
445
+ * Image height.
446
+ */
447
+ height?: number;
448
+ /**
449
+ * The blurhash placeholder value.
450
+ */
451
+ blurHash?: string;
452
+ /**
453
+ * The processing status of the asset.
454
+ */
455
+ metadataProcessingStatus?: string;
456
456
  }