@ckeditor/ckeditor5-ckbox 40.0.0 → 40.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. package/LICENSE.md +6 -2
  2. package/build/ckbox.js +2 -2
  3. package/build/translations/ar.js +1 -1
  4. package/build/translations/az.js +1 -1
  5. package/build/translations/bg.js +1 -1
  6. package/build/translations/bn.js +1 -1
  7. package/build/translations/ca.js +1 -1
  8. package/build/translations/cs.js +1 -1
  9. package/build/translations/da.js +1 -1
  10. package/build/translations/de.js +1 -1
  11. package/build/translations/el.js +1 -1
  12. package/build/translations/en-au.js +1 -1
  13. package/build/translations/es-co.js +1 -1
  14. package/build/translations/es.js +1 -1
  15. package/build/translations/et.js +1 -1
  16. package/build/translations/fa.js +1 -1
  17. package/build/translations/fi.js +1 -1
  18. package/build/translations/fr.js +1 -1
  19. package/build/translations/gl.js +1 -1
  20. package/build/translations/he.js +1 -1
  21. package/build/translations/hi.js +1 -1
  22. package/build/translations/hr.js +1 -1
  23. package/build/translations/hu.js +1 -1
  24. package/build/translations/id.js +1 -1
  25. package/build/translations/it.js +1 -1
  26. package/build/translations/ja.js +1 -1
  27. package/build/translations/ko.js +1 -1
  28. package/build/translations/lt.js +1 -1
  29. package/build/translations/lv.js +1 -1
  30. package/build/translations/ms.js +1 -1
  31. package/build/translations/nl.js +1 -1
  32. package/build/translations/no.js +1 -1
  33. package/build/translations/pl.js +1 -1
  34. package/build/translations/pt-br.js +1 -1
  35. package/build/translations/pt.js +1 -1
  36. package/build/translations/ro.js +1 -1
  37. package/build/translations/ru.js +1 -1
  38. package/build/translations/sk.js +1 -1
  39. package/build/translations/sq.js +1 -1
  40. package/build/translations/sr-latn.js +1 -1
  41. package/build/translations/sr.js +1 -1
  42. package/build/translations/sv.js +1 -1
  43. package/build/translations/th.js +1 -1
  44. package/build/translations/tr.js +1 -1
  45. package/build/translations/ug.js +1 -1
  46. package/build/translations/uk.js +1 -1
  47. package/build/translations/ur.js +1 -1
  48. package/build/translations/uz.js +1 -1
  49. package/build/translations/vi.js +1 -1
  50. package/build/translations/zh-cn.js +1 -1
  51. package/build/translations/zh.js +1 -1
  52. package/ckeditor5-metadata.json +17 -0
  53. package/lang/contexts.json +6 -2
  54. package/lang/translations/ar.po +18 -2
  55. package/lang/translations/az.po +18 -2
  56. package/lang/translations/bg.po +18 -2
  57. package/lang/translations/bn.po +18 -2
  58. package/lang/translations/ca.po +18 -2
  59. package/lang/translations/cs.po +18 -2
  60. package/lang/translations/da.po +18 -2
  61. package/lang/translations/de.po +18 -2
  62. package/lang/translations/el.po +18 -2
  63. package/lang/translations/en-au.po +18 -2
  64. package/lang/translations/en.po +18 -2
  65. package/lang/translations/es-co.po +18 -2
  66. package/lang/translations/es.po +18 -2
  67. package/lang/translations/et.po +18 -2
  68. package/lang/translations/fa.po +18 -2
  69. package/lang/translations/fi.po +18 -2
  70. package/lang/translations/fr.po +18 -2
  71. package/lang/translations/gl.po +18 -2
  72. package/lang/translations/he.po +18 -2
  73. package/lang/translations/hi.po +18 -2
  74. package/lang/translations/hr.po +18 -2
  75. package/lang/translations/hu.po +18 -2
  76. package/lang/translations/id.po +18 -2
  77. package/lang/translations/it.po +18 -2
  78. package/lang/translations/ja.po +18 -2
  79. package/lang/translations/ko.po +18 -2
  80. package/lang/translations/lt.po +18 -2
  81. package/lang/translations/lv.po +18 -2
  82. package/lang/translations/ms.po +18 -2
  83. package/lang/translations/nl.po +18 -2
  84. package/lang/translations/no.po +18 -2
  85. package/lang/translations/pl.po +18 -2
  86. package/lang/translations/pt-br.po +18 -2
  87. package/lang/translations/pt.po +18 -2
  88. package/lang/translations/ro.po +18 -2
  89. package/lang/translations/ru.po +18 -2
  90. package/lang/translations/sk.po +18 -2
  91. package/lang/translations/sq.po +18 -2
  92. package/lang/translations/sr-latn.po +18 -2
  93. package/lang/translations/sr.po +18 -2
  94. package/lang/translations/sv.po +18 -2
  95. package/lang/translations/th.po +18 -2
  96. package/lang/translations/tr.po +18 -2
  97. package/lang/translations/ug.po +18 -2
  98. package/lang/translations/uk.po +18 -2
  99. package/lang/translations/ur.po +18 -2
  100. package/lang/translations/uz.po +18 -2
  101. package/lang/translations/vi.po +18 -2
  102. package/lang/translations/zh-cn.po +18 -2
  103. package/lang/translations/zh.po +18 -2
  104. package/package.json +4 -2
  105. package/src/augmentation.d.ts +32 -22
  106. package/src/augmentation.js +5 -5
  107. package/src/ckbox.d.ts +33 -33
  108. package/src/ckbox.js +37 -37
  109. package/src/ckboxcommand.d.ts +114 -110
  110. package/src/ckboxcommand.js +332 -302
  111. package/src/ckboxconfig.d.ts +325 -283
  112. package/src/ckboxconfig.js +5 -5
  113. package/src/ckboxediting.d.ts +45 -52
  114. package/src/ckboxediting.js +321 -362
  115. package/src/ckboximageedit/ckboximageeditcommand.d.ts +97 -0
  116. package/src/ckboximageedit/ckboximageeditcommand.js +298 -0
  117. package/src/ckboximageedit/ckboximageeditediting.d.ts +28 -0
  118. package/src/ckboximageedit/ckboximageeditediting.js +36 -0
  119. package/src/ckboximageedit/ckboximageeditui.d.ts +24 -0
  120. package/src/ckboximageedit/ckboximageeditui.js +48 -0
  121. package/src/ckboximageedit/utils.d.ts +10 -0
  122. package/src/ckboximageedit/utils.js +48 -0
  123. package/src/ckboximageedit.d.ts +24 -0
  124. package/src/ckboximageedit.js +28 -0
  125. package/src/ckboxui.d.ts +21 -21
  126. package/src/ckboxui.js +74 -47
  127. package/src/ckboxuploadadapter.d.ts +33 -38
  128. package/src/ckboxuploadadapter.js +130 -275
  129. package/src/ckboxutils.d.ts +50 -0
  130. package/src/ckboxutils.js +183 -0
  131. package/src/index.d.ts +17 -13
  132. package/src/index.js +14 -11
  133. package/src/utils.d.ts +63 -28
  134. package/src/utils.js +175 -49
  135. package/theme/ckboximageedit.css +53 -0
  136. package/theme/icons/ckbox-image-edit.svg +1 -0
  137. package/build/ckbox.js.map +0 -1
@@ -1,283 +1,325 @@
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/ckboxconfig
7
- */
8
- import type { TokenUrl } from '@ckeditor/ckeditor5-cloud-services';
9
- /**
10
- * The configuration of the {@link module:ckbox/ckbox~CKBox CKBox feature}.
11
- *
12
- * The minimal configuration for the CKBox feature requires providing the
13
- * {@link module:ckbox/ckboxconfig~CKBoxConfig#tokenUrl `config.ckbox.tokenUrl`}:
14
- *
15
- * ```ts
16
- * ClassicEditor
17
- * .create( editorElement, {
18
- * ckbox: {
19
- * tokenUrl: 'https://example.com/cs-token-endpoint'
20
- * }
21
- * } )
22
- * .then( ... )
23
- * .catch( ... );
24
- * ```
25
- *
26
- * Hovewer, you can also adjust the feature to fit your needs:
27
- *
28
- * ```ts
29
- * ClassicEditor
30
- * .create( editorElement, {
31
- * ckbox: {
32
- * defaultUploadCategories: {
33
- * Bitmaps: [ 'bmp' ],
34
- * Pictures: [ 'jpg', 'jpeg' ],
35
- * Scans: [ 'png', 'tiff' ]
36
- * },
37
- * ignoreDataId: true,
38
- * serviceOrigin: 'https://example.com/',
39
- * tokenUrl: 'https://example.com/cs-token-endpoint'
40
- * }
41
- * } )
42
- * .then( ... )
43
- * .catch( ... );
44
- * ```
45
- *
46
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
47
- */
48
- export interface CKBoxConfig {
49
- /**
50
- * The authentication token URL for CKBox feature.
51
- *
52
- * Defaults to {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl `config.cloudServices.tokenUrl`}
53
- */
54
- tokenUrl?: TokenUrl;
55
- /**
56
- * The theme for CKBox dialog.
57
- */
58
- theme?: string;
59
- /**
60
- * Defines the categories to which the uploaded images will be assigned.
61
- * If configured, it overrides the category mappings defined on the cloud service.
62
- * The value of this option should be an object, where the keys define categories and their values are the types of images
63
- * that will be uploaded to these categories. The categories might be referenced by their name or ID.
64
- *
65
- * Example:
66
- *
67
- * ```ts
68
- * const ckboxConfig = {
69
- * defaultUploadCategories: {
70
- * Bitmaps: [ 'bmp' ],
71
- * Pictures: [ 'jpg', 'jpeg' ],
72
- * Scans: [ 'png', 'tiff' ],
73
- * // The category below is referenced by its ID.
74
- * 'fdf2a647-b67f-4a6c-b692-5ba1dc1ed87b': [ 'gif' ]
75
- * }
76
- * };
77
- * ```
78
- *
79
- * @default null
80
- */
81
- defaultUploadCategories?: Record<string, Array<string>> | null;
82
- /**
83
- * Defines the workspace id to use during upload when the user has access to more than one workspace.
84
- *
85
- * If defined, it is an error, when the user has no access to the specified workspace.
86
- */
87
- defaultUploadWorkspaceId?: string;
88
- /**
89
- * Inserts the unique asset ID as the `data-ckbox-resource-id` attribute. To disable this behavior, set it to `true`.
90
- *
91
- * @default false
92
- */
93
- ignoreDataId?: boolean;
94
- /**
95
- * Configures the base URL of the API service. Required only in on-premises installations.
96
- *
97
- * @default 'https://api.ckbox.io'
98
- */
99
- serviceOrigin?: string;
100
- /**
101
- * Configures the language for the CKBox dialog.
102
- *
103
- * Defaults to {@link module:utils/locale~Locale#uiLanguage `Locale#uiLanguage`}
104
- */
105
- language?: string;
106
- }
107
- /**
108
- * Asset definition.
109
- *
110
- * The definition contains the unique `id`, asset `type` and an `attributes` definition.
111
- */
112
- export type CKBoxAssetDefinition = CKBoxAssetImageDefinition | CKBoxAssetLinkDefinition;
113
- /**
114
- * Image asset definition.
115
- *
116
- * The definition contains the unique `id`, asset `type` and an `attributes` definition.
117
- */
118
- export interface CKBoxAssetImageDefinition {
119
- /**
120
- * An unique asset id.
121
- */
122
- id: string;
123
- /**
124
- * Asset type.
125
- */
126
- type: 'image';
127
- /**
128
- * Asset attributes.
129
- */
130
- attributes: CKBoxAssetImageAttributesDefinition;
131
- }
132
- /**
133
- * Link asset definition.
134
- *
135
- * The definition contains the unique `id`, asset `type` and an `attributes` definition.
136
- */
137
- export interface CKBoxAssetLinkDefinition {
138
- /**
139
- * An unique asset id.
140
- */
141
- id: string;
142
- /**
143
- * Asset type.
144
- */
145
- type: 'link';
146
- /**
147
- * Asset attributes.
148
- */
149
- attributes: CKBoxAssetLinkAttributesDefinition;
150
- }
151
- /**
152
- * Asset attributes definition for an image.
153
- *
154
- * The definition contains the `imageFallbackUrl`, an `imageSources` array with one image source definition object and the
155
- * `imageTextAlternative`.
156
- *
157
- * ```ts
158
- * {
159
- * imageFallbackUrl: 'https://example.com/assets/asset-id/images/1000.png',
160
- * imageSources: [
161
- * {
162
- * sizes: '1000px',
163
- * srcset:
164
- * 'https://example.com/assets/asset-id/images/100.webp 100w,' +
165
- * 'https://example.com/assets/asset-id/images/200.webp 200w,' +
166
- * 'https://example.com/assets/asset-id/images/300.webp 300w,' +
167
- * 'https://example.com/assets/asset-id/images/400.webp 400w,' +
168
- * 'https://example.com/assets/asset-id/images/500.webp 500w,' +
169
- * 'https://example.com/assets/asset-id/images/600.webp 600w,' +
170
- * 'https://example.com/assets/asset-id/images/700.webp 700w,' +
171
- * 'https://example.com/assets/asset-id/images/800.webp 800w,' +
172
- * 'https://example.com/assets/asset-id/images/900.webp 900w,' +
173
- * 'https://example.com/assets/asset-id/images/1000.webp 1000w',
174
- * type: 'image/webp'
175
- * }
176
- * ],
177
- * imageTextAlternative: 'An alternative text for the image'
178
- * }
179
- * ```
180
- */
181
- export interface CKBoxAssetImageAttributesDefinition {
182
- /**
183
- * A fallback URL for browsers that do not support the "webp" format.
184
- */
185
- imageFallbackUrl: string;
186
- /**
187
- * An array containing one image source definition object.
188
- */
189
- imageSources: Array<{
190
- srcset: string;
191
- sizes: string;
192
- type: string;
193
- }>;
194
- /**
195
- * An alternative text for an image.
196
- */
197
- imageTextAlternative: string;
198
- }
199
- /**
200
- * Asset attributes definition for a link.
201
- *
202
- * The definition contains the `linkName` and `linkHref` strings.
203
- *
204
- * ```ts
205
- * {
206
- * linkName: 'File name',
207
- * linkHref: 'https://example.com/assets/asset-id/file.pdf'
208
- * }
209
- * ```
210
- */
211
- export interface CKBoxAssetLinkAttributesDefinition {
212
- /**
213
- * A link name.
214
- */
215
- linkName: string;
216
- /**
217
- * An URL for the asset.
218
- */
219
- linkHref: string;
220
- }
221
- /**
222
- * The source set of the responsive image provided by the CKBox backend.
223
- *
224
- * Each numeric key corresponds to display width of the image.
225
- */
226
- export interface CKBoxImageUrls {
227
- [width: number]: string;
228
- /**
229
- * A fallback URL for browsers that do not support the "webp" format.
230
- */
231
- default: string;
232
- }
233
- /**
234
- * Raw asset definition that is received from the CKBox feature.
235
- */
236
- export interface CKBoxRawAssetDefinition {
237
- /**
238
- * A raw asset data definition.
239
- */
240
- data: CKBoxRawAssetDataDefinition;
241
- }
242
- /**
243
- * Part of raw asset data that is received from the CKBox feature.
244
- */
245
- export interface CKBoxRawAssetDataDefinition {
246
- /**
247
- * An unique asset id.
248
- */
249
- id: string;
250
- /**
251
- * An asset name.
252
- */
253
- name: string;
254
- /**
255
- * A raw asset metadata definition.
256
- */
257
- metadata?: CKBoxRawAssetMetadataDefinition;
258
- /**
259
- * The source set of the responsive image.
260
- */
261
- imageUrls?: CKBoxImageUrls;
262
- /**
263
- * The asset location.
264
- */
265
- url: string;
266
- }
267
- /**
268
- * Part of raw asset data that is received from the CKBox feature. Properties are set only if the chosen asset is an image.
269
- */
270
- export interface CKBoxRawAssetMetadataDefinition {
271
- /**
272
- * Image description.
273
- */
274
- description?: string;
275
- /**
276
- * Image width.
277
- */
278
- width?: number;
279
- /**
280
- * Image height.
281
- */
282
- height?: number;
283
- }
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/ckboxconfig
7
+ */
8
+ import type { TokenUrl } from '@ckeditor/ckeditor5-cloud-services';
9
+ import type { ArrayOrItem } from 'ckeditor5/src/utils';
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( editorElement, {
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( editorElement, {
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
+ 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
+ /**
130
+ * Asset definition.
131
+ *
132
+ * The definition contains the unique `id`, asset `type` and an `attributes` definition.
133
+ */
134
+ export type CKBoxAssetDefinition = CKBoxAssetImageDefinition | CKBoxAssetLinkDefinition;
135
+ /**
136
+ * Image asset definition.
137
+ *
138
+ * The definition contains the unique `id`, asset `type` and an `attributes` definition.
139
+ */
140
+ export interface CKBoxAssetImageDefinition {
141
+ /**
142
+ * An unique asset id.
143
+ */
144
+ id: string;
145
+ /**
146
+ * Asset type.
147
+ */
148
+ type: 'image';
149
+ /**
150
+ * Asset attributes.
151
+ */
152
+ attributes: CKBoxAssetImageAttributesDefinition;
153
+ }
154
+ /**
155
+ * Link asset definition.
156
+ *
157
+ * The definition contains the unique `id`, asset `type` and an `attributes` definition.
158
+ */
159
+ export interface CKBoxAssetLinkDefinition {
160
+ /**
161
+ * An unique asset id.
162
+ */
163
+ id: string;
164
+ /**
165
+ * Asset type.
166
+ */
167
+ type: 'link';
168
+ /**
169
+ * Asset attributes.
170
+ */
171
+ attributes: CKBoxAssetLinkAttributesDefinition;
172
+ }
173
+ /**
174
+ * Asset attributes definition for an image.
175
+ *
176
+ * The definition contains the `imageFallbackUrl`, an `imageSources` array with one image source definition object and the
177
+ * `imageTextAlternative`.
178
+ *
179
+ * ```ts
180
+ * {
181
+ * imageFallbackUrl: 'https://example.com/assets/asset-id/images/1000.png',
182
+ * imageSources: [
183
+ * {
184
+ * sizes: '1000px',
185
+ * srcset:
186
+ * 'https://example.com/assets/asset-id/images/100.webp 100w,' +
187
+ * 'https://example.com/assets/asset-id/images/200.webp 200w,' +
188
+ * 'https://example.com/assets/asset-id/images/300.webp 300w,' +
189
+ * 'https://example.com/assets/asset-id/images/400.webp 400w,' +
190
+ * 'https://example.com/assets/asset-id/images/500.webp 500w,' +
191
+ * 'https://example.com/assets/asset-id/images/600.webp 600w,' +
192
+ * 'https://example.com/assets/asset-id/images/700.webp 700w,' +
193
+ * 'https://example.com/assets/asset-id/images/800.webp 800w,' +
194
+ * 'https://example.com/assets/asset-id/images/900.webp 900w,' +
195
+ * 'https://example.com/assets/asset-id/images/1000.webp 1000w',
196
+ * type: 'image/webp'
197
+ * }
198
+ * ],
199
+ * imageTextAlternative: 'An alternative text for the image'
200
+ * }
201
+ * ```
202
+ */
203
+ export interface CKBoxAssetImageAttributesDefinition {
204
+ /**
205
+ * A fallback URL for browsers that do not support the "webp" format.
206
+ */
207
+ imageFallbackUrl: string;
208
+ /**
209
+ * An array containing one image source definition object.
210
+ */
211
+ imageSources: Array<{
212
+ srcset: string;
213
+ sizes: string;
214
+ type: string;
215
+ }>;
216
+ /**
217
+ * An alternative text for an image.
218
+ */
219
+ imageTextAlternative: string;
220
+ /**
221
+ * Image width.
222
+ */
223
+ imageWidth?: number;
224
+ /**
225
+ * Image height.
226
+ */
227
+ imageHeight?: number;
228
+ /**
229
+ * Image placeholder image.
230
+ */
231
+ imagePlaceholder?: string;
232
+ }
233
+ /**
234
+ * Asset attributes definition for a link.
235
+ *
236
+ * The definition contains the `linkName` and `linkHref` strings.
237
+ *
238
+ * ```ts
239
+ * {
240
+ * linkName: 'File name',
241
+ * linkHref: 'https://example.com/assets/asset-id/file.pdf'
242
+ * }
243
+ * ```
244
+ */
245
+ export interface CKBoxAssetLinkAttributesDefinition {
246
+ /**
247
+ * A link name.
248
+ */
249
+ linkName: string;
250
+ /**
251
+ * An URL for the asset.
252
+ */
253
+ linkHref: string;
254
+ }
255
+ /**
256
+ * The source set of the responsive image provided by the CKBox backend.
257
+ *
258
+ * Each numeric key corresponds to display width of the image.
259
+ */
260
+ export interface CKBoxImageUrls {
261
+ [width: number]: string;
262
+ /**
263
+ * A fallback URL for browsers that do not support the "webp" format.
264
+ */
265
+ default: string;
266
+ }
267
+ /**
268
+ * Raw asset definition that is received from the CKBox feature.
269
+ */
270
+ export interface CKBoxRawAssetDefinition {
271
+ /**
272
+ * A raw asset data definition.
273
+ */
274
+ data: CKBoxRawAssetDataDefinition;
275
+ }
276
+ /**
277
+ * Part of raw asset data that is received from the CKBox feature.
278
+ */
279
+ export interface CKBoxRawAssetDataDefinition {
280
+ /**
281
+ * An unique asset id.
282
+ */
283
+ id: string;
284
+ /**
285
+ * An asset name.
286
+ */
287
+ name: string;
288
+ /**
289
+ * A raw asset metadata definition.
290
+ */
291
+ metadata?: CKBoxRawAssetMetadataDefinition;
292
+ /**
293
+ * The source set of the responsive image.
294
+ */
295
+ imageUrls?: CKBoxImageUrls;
296
+ /**
297
+ * The asset location.
298
+ */
299
+ url: string;
300
+ }
301
+ /**
302
+ * Part of raw asset data that is received from the CKBox feature. Properties are set only if the chosen asset is an image.
303
+ */
304
+ export interface CKBoxRawAssetMetadataDefinition {
305
+ /**
306
+ * Image description.
307
+ */
308
+ description?: string;
309
+ /**
310
+ * Image width.
311
+ */
312
+ width?: number;
313
+ /**
314
+ * Image height.
315
+ */
316
+ height?: number;
317
+ /**
318
+ * The blurhash placeholder value.
319
+ */
320
+ blurHash?: string;
321
+ /**
322
+ * The processing status of the asset.
323
+ */
324
+ metadataProcessingStatus?: string;
325
+ }
@@ -1,5 +1,5 @@
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
- export {};
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
+ export {};