@ckeditor/ckeditor5-uploadcare 48.2.0-alpha.7 → 48.3.0-alpha.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.
Files changed (173) hide show
  1. package/dist/augmentation.d.ts +28 -28
  2. package/dist/index.d.ts +16 -16
  3. package/dist/index.js +3 -3
  4. package/dist/translations/af.js +1 -1
  5. package/dist/translations/af.umd.js +1 -1
  6. package/dist/translations/ar.js +1 -1
  7. package/dist/translations/ar.umd.js +1 -1
  8. package/dist/translations/ast.js +1 -1
  9. package/dist/translations/ast.umd.js +1 -1
  10. package/dist/translations/az.js +1 -1
  11. package/dist/translations/az.umd.js +1 -1
  12. package/dist/translations/be.js +1 -1
  13. package/dist/translations/be.umd.js +1 -1
  14. package/dist/translations/bg.js +1 -1
  15. package/dist/translations/bg.umd.js +1 -1
  16. package/dist/translations/bn.js +1 -1
  17. package/dist/translations/bn.umd.js +1 -1
  18. package/dist/translations/bs.js +1 -1
  19. package/dist/translations/bs.umd.js +1 -1
  20. package/dist/translations/ca.js +1 -1
  21. package/dist/translations/ca.umd.js +1 -1
  22. package/dist/translations/cs.js +1 -1
  23. package/dist/translations/cs.umd.js +1 -1
  24. package/dist/translations/da.js +1 -1
  25. package/dist/translations/da.umd.js +1 -1
  26. package/dist/translations/de-ch.js +1 -1
  27. package/dist/translations/de-ch.umd.js +1 -1
  28. package/dist/translations/de.js +1 -1
  29. package/dist/translations/de.umd.js +1 -1
  30. package/dist/translations/el.js +1 -1
  31. package/dist/translations/el.umd.js +1 -1
  32. package/dist/translations/en-au.js +1 -1
  33. package/dist/translations/en-au.umd.js +1 -1
  34. package/dist/translations/en-gb.js +1 -1
  35. package/dist/translations/en-gb.umd.js +1 -1
  36. package/dist/translations/en.js +1 -1
  37. package/dist/translations/en.umd.js +1 -1
  38. package/dist/translations/eo.js +1 -1
  39. package/dist/translations/eo.umd.js +1 -1
  40. package/dist/translations/es-co.js +1 -1
  41. package/dist/translations/es-co.umd.js +1 -1
  42. package/dist/translations/es.js +1 -1
  43. package/dist/translations/es.umd.js +1 -1
  44. package/dist/translations/et.js +1 -1
  45. package/dist/translations/et.umd.js +1 -1
  46. package/dist/translations/eu.js +1 -1
  47. package/dist/translations/eu.umd.js +1 -1
  48. package/dist/translations/fa.js +1 -1
  49. package/dist/translations/fa.umd.js +1 -1
  50. package/dist/translations/fi.js +1 -1
  51. package/dist/translations/fi.umd.js +1 -1
  52. package/dist/translations/fr.js +1 -1
  53. package/dist/translations/fr.umd.js +1 -1
  54. package/dist/translations/gl.js +1 -1
  55. package/dist/translations/gl.umd.js +1 -1
  56. package/dist/translations/gu.js +1 -1
  57. package/dist/translations/gu.umd.js +1 -1
  58. package/dist/translations/he.js +1 -1
  59. package/dist/translations/he.umd.js +1 -1
  60. package/dist/translations/hi.js +1 -1
  61. package/dist/translations/hi.umd.js +1 -1
  62. package/dist/translations/hr.js +1 -1
  63. package/dist/translations/hr.umd.js +1 -1
  64. package/dist/translations/hu.js +1 -1
  65. package/dist/translations/hu.umd.js +1 -1
  66. package/dist/translations/hy.js +1 -1
  67. package/dist/translations/hy.umd.js +1 -1
  68. package/dist/translations/id.js +1 -1
  69. package/dist/translations/id.umd.js +1 -1
  70. package/dist/translations/it.js +1 -1
  71. package/dist/translations/it.umd.js +1 -1
  72. package/dist/translations/ja.js +1 -1
  73. package/dist/translations/ja.umd.js +1 -1
  74. package/dist/translations/jv.js +1 -1
  75. package/dist/translations/jv.umd.js +1 -1
  76. package/dist/translations/kk.js +1 -1
  77. package/dist/translations/kk.umd.js +1 -1
  78. package/dist/translations/km.js +1 -1
  79. package/dist/translations/km.umd.js +1 -1
  80. package/dist/translations/kn.js +1 -1
  81. package/dist/translations/kn.umd.js +1 -1
  82. package/dist/translations/ko.js +1 -1
  83. package/dist/translations/ko.umd.js +1 -1
  84. package/dist/translations/ku.js +1 -1
  85. package/dist/translations/ku.umd.js +1 -1
  86. package/dist/translations/lt.js +1 -1
  87. package/dist/translations/lt.umd.js +1 -1
  88. package/dist/translations/lv.js +1 -1
  89. package/dist/translations/lv.umd.js +1 -1
  90. package/dist/translations/ms.js +1 -1
  91. package/dist/translations/ms.umd.js +1 -1
  92. package/dist/translations/nb.js +1 -1
  93. package/dist/translations/nb.umd.js +1 -1
  94. package/dist/translations/ne.js +1 -1
  95. package/dist/translations/ne.umd.js +1 -1
  96. package/dist/translations/nl.js +1 -1
  97. package/dist/translations/nl.umd.js +1 -1
  98. package/dist/translations/no.js +1 -1
  99. package/dist/translations/no.umd.js +1 -1
  100. package/dist/translations/oc.js +1 -1
  101. package/dist/translations/oc.umd.js +1 -1
  102. package/dist/translations/pl.js +1 -1
  103. package/dist/translations/pl.umd.js +1 -1
  104. package/dist/translations/pt-br.js +1 -1
  105. package/dist/translations/pt-br.umd.js +1 -1
  106. package/dist/translations/pt.js +1 -1
  107. package/dist/translations/pt.umd.js +1 -1
  108. package/dist/translations/ro.js +1 -1
  109. package/dist/translations/ro.umd.js +1 -1
  110. package/dist/translations/ru.js +1 -1
  111. package/dist/translations/ru.umd.js +1 -1
  112. package/dist/translations/si.js +1 -1
  113. package/dist/translations/si.umd.js +1 -1
  114. package/dist/translations/sk.js +1 -1
  115. package/dist/translations/sk.umd.js +1 -1
  116. package/dist/translations/sl.js +1 -1
  117. package/dist/translations/sl.umd.js +1 -1
  118. package/dist/translations/sq.js +1 -1
  119. package/dist/translations/sq.umd.js +1 -1
  120. package/dist/translations/sr-latn.js +1 -1
  121. package/dist/translations/sr-latn.umd.js +1 -1
  122. package/dist/translations/sr.js +1 -1
  123. package/dist/translations/sr.umd.js +1 -1
  124. package/dist/translations/sv.js +1 -1
  125. package/dist/translations/sv.umd.js +1 -1
  126. package/dist/translations/th.js +1 -1
  127. package/dist/translations/th.umd.js +1 -1
  128. package/dist/translations/ti.js +1 -1
  129. package/dist/translations/ti.umd.js +1 -1
  130. package/dist/translations/tk.js +1 -1
  131. package/dist/translations/tk.umd.js +1 -1
  132. package/dist/translations/tr.js +1 -1
  133. package/dist/translations/tr.umd.js +1 -1
  134. package/dist/translations/tt.js +1 -1
  135. package/dist/translations/tt.umd.js +1 -1
  136. package/dist/translations/ug.js +1 -1
  137. package/dist/translations/ug.umd.js +1 -1
  138. package/dist/translations/uk.js +1 -1
  139. package/dist/translations/uk.umd.js +1 -1
  140. package/dist/translations/ur.js +1 -1
  141. package/dist/translations/ur.umd.js +1 -1
  142. package/dist/translations/uz.js +1 -1
  143. package/dist/translations/uz.umd.js +1 -1
  144. package/dist/translations/vi.js +1 -1
  145. package/dist/translations/vi.umd.js +1 -1
  146. package/dist/translations/zh-cn.js +1 -1
  147. package/dist/translations/zh-cn.umd.js +1 -1
  148. package/dist/translations/zh.js +1 -1
  149. package/dist/translations/zh.umd.js +1 -1
  150. package/dist/ui/uploadcarecontroller.d.ts +20 -22
  151. package/dist/ui/uploadcareformview.d.ts +18 -18
  152. package/dist/uploadcare.d.ts +41 -41
  153. package/dist/uploadcarecommand.d.ts +33 -33
  154. package/dist/uploadcareconfig.d.ts +246 -246
  155. package/dist/uploadcareediting.d.ts +55 -55
  156. package/dist/uploadcareimageedit/ui/uploadcareimageeditcontroller.d.ts +75 -74
  157. package/dist/uploadcareimageedit/ui/uploadcareimageeditformeditingview.d.ts +20 -20
  158. package/dist/uploadcareimageedit/ui/uploadcareimageeditformerrorview.d.ts +20 -20
  159. package/dist/uploadcareimageedit/ui/uploadcareimageeditformloadingview.d.ts +19 -19
  160. package/dist/uploadcareimageedit/ui/uploadcareimageeditformview.d.ts +27 -27
  161. package/dist/uploadcareimageedit/uploadcareimageeditcommand.d.ts +44 -44
  162. package/dist/uploadcareimageedit/uploadcareimageeditediting.d.ts +34 -34
  163. package/dist/uploadcareimageedit/uploadcareimageeditui.d.ts +40 -40
  164. package/dist/uploadcareimageedit/uploadcareimagereplacecommand.d.ts +18 -18
  165. package/dist/uploadcareimageedit.d.ts +27 -27
  166. package/dist/uploadcareui.d.ts +36 -36
  167. package/dist/uploadcareuploadadapter.d.ts +35 -35
  168. package/dist/utils/common-translations.d.ts +0 -4
  169. package/dist/utils/dialogfocusmanagerview.d.ts +24 -24
  170. package/dist/utils/editingutils.d.ts +0 -4
  171. package/dist/utils/isancestor.d.ts +5 -5
  172. package/dist/utils/uploadutils.d.ts +0 -4
  173. package/package.json +8 -8
@@ -1,38 +1,38 @@
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 uploadcare/uploadcarecommand
7
- * @publicApi
8
- */
9
- import { Command, type Editor } from '@ckeditor/ckeditor5-core';
10
- import { Dialog } from '@ckeditor/ckeditor5-ui';
11
- import { UploadcareEditing } from './uploadcareediting.js';
12
- import type { UploadcareSource } from './uploadcareconfig.js';
6
+ * @module uploadcare/uploadcarecommand
7
+ * @publicApi
8
+ */
9
+ import { Command, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
10
+ import { Dialog } from "@ckeditor/ckeditor5-ui";
11
+ import { UploadcareEditing } from "./uploadcareediting.js";
12
+ import type { UploadcareSource } from "./uploadcareconfig.js";
13
13
  /**
14
- * The Uploadcare command. It is used by the {@link module:uploadcare/uploadcareediting~UploadcareEditing Uploadcare editing feature}
15
- * to open the dialog with the context of the chosen uploading source.
16
- *
17
- * ```ts
18
- * editor.execute( 'uploadcare' );
19
- * ```
20
- */
14
+ * The Uploadcare command. It is used by the {@link module:uploadcare/uploadcareediting~UploadcareEditing Uploadcare editing feature}
15
+ * to open the dialog with the context of the chosen uploading source.
16
+ *
17
+ * ```ts
18
+ * editor.execute( 'uploadcare' );
19
+ * ```
20
+ */
21
21
  export declare class UploadcareCommand extends Command {
22
- /**
23
- * @inheritDoc
24
- */
25
- static get requires(): readonly [typeof Dialog, typeof UploadcareEditing];
26
- /**
27
- * @inheritDoc
28
- */
29
- constructor(editor: Editor);
30
- /**
31
- * @inheritDoc
32
- */
33
- refresh(): void;
34
- /**
35
- * @inheritDoc
36
- */
37
- execute(type: UploadcareSource): void;
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ static get requires(): PluginDependenciesOf<[Dialog, UploadcareEditing]>;
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ constructor(editor: Editor);
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ override refresh(): void;
34
+ /**
35
+ * @inheritDoc
36
+ */
37
+ override execute(type: UploadcareSource): void;
38
38
  }
@@ -1,269 +1,269 @@
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 uploadcare/uploadcareconfig
7
- * @publicApi
8
- */
9
- import type { ArrayOrItem } from '@ckeditor/ckeditor5-utils';
10
- import type { ConfigType } from '@uploadcare/file-uploader/web/file-uploader.min.js';
11
- import type _default from '@uploadcare/file-uploader/locales/file-uploader/en.js';
6
+ * @module uploadcare/uploadcareconfig
7
+ * @publicApi
8
+ */
9
+ import type { ArrayOrItem } from "@ckeditor/ckeditor5-utils";
10
+ import type { ConfigType } from "@uploadcare/file-uploader/web/file-uploader.min.js";
11
+ import type _default from "@uploadcare/file-uploader/locales/file-uploader/en.js";
12
12
  /**
13
- * Locale definition type matching Uploadcare `LocaleDefinition` type.
14
- * A plain object with translation keys and values.
15
- */
13
+ * Locale definition type matching Uploadcare `LocaleDefinition` type.
14
+ * A plain object with translation keys and values.
15
+ */
16
16
  export type UploadcareLocaleDefinition = typeof _default;
17
17
  /**
18
- * Locale definition resolver type matching Uploadcare `LocaleDefinitionResolver` type.
19
- * A function that returns a Promise with `LocaleDefinition`.
20
- */
18
+ * Locale definition resolver type matching Uploadcare `LocaleDefinitionResolver` type.
19
+ * A function that returns a Promise with `LocaleDefinition`.
20
+ */
21
21
  export type UploadcareLocaleDefinitionResolver = () => Promise<UploadcareLocaleDefinition>;
22
22
  /**
23
- * The configuration of the {@link module:uploadcare/uploadcare~Uploadcare Uploadcare feature}.
24
- *
25
- * The minimal configuration for the Uploadcare feature requires providing the
26
- * {@link module:uploadcare/uploadcareconfig~UploadcareConfig#pubkey `config.uploadcare.pubkey`}:
27
- *
28
- * ```ts
29
- * ClassicEditor
30
- * .create( {
31
- * uploadcare: {
32
- * pubkey: 'YOUR_PUBLIC_KEY'
33
- * }
34
- * } )
35
- * .then( ... )
36
- * .catch( ... );
37
- * ```
38
- *
39
- * However, you can also adjust the feature to fit your needs:
40
- *
41
- * ```ts
42
- * ClassicEditor
43
- * .create( {
44
- * uploadcare: {
45
- * uploader: {
46
- * sourceList: [
47
- * 'local',
48
- * 'url',
49
- * 'gdrive'
50
- * ],
51
- * },
52
- * pubkey: 'YOUR_PUBLIC_KEY'
53
- * }
54
- * } )
55
- * .then( ... )
56
- * .catch( ... );
57
- * ```
58
- *
59
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
60
- */
23
+ * The configuration of the {@link module:uploadcare/uploadcare~Uploadcare Uploadcare feature}.
24
+ *
25
+ * The minimal configuration for the Uploadcare feature requires providing the
26
+ * {@link module:uploadcare/uploadcareconfig~UploadcareConfig#pubkey `config.uploadcare.pubkey`}:
27
+ *
28
+ * ```ts
29
+ * ClassicEditor
30
+ * .create( {
31
+ * uploadcare: {
32
+ * pubkey: 'YOUR_PUBLIC_KEY'
33
+ * }
34
+ * } )
35
+ * .then( ... )
36
+ * .catch( ... );
37
+ * ```
38
+ *
39
+ * However, you can also adjust the feature to fit your needs:
40
+ *
41
+ * ```ts
42
+ * ClassicEditor
43
+ * .create( {
44
+ * uploadcare: {
45
+ * uploader: {
46
+ * sourceList: [
47
+ * 'local',
48
+ * 'url',
49
+ * 'gdrive'
50
+ * ],
51
+ * },
52
+ * pubkey: 'YOUR_PUBLIC_KEY'
53
+ * }
54
+ * } )
55
+ * .then( ... )
56
+ * .catch( ... );
57
+ * ```
58
+ *
59
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
60
+ */
61
61
  export interface UploadcareConfig {
62
- /**
63
- * The public key used for communication with the Uploadcare services.
64
- *
65
- * It will be used by both the File Uploader and Image Editor components.
66
- */
67
- pubkey: string;
68
- /**
69
- * Configuration that will be passed to the File Uploader component.
70
- *
71
- * You can find detailed information in the [Uploadcare documentation](https://uploadcare.com/docs/file-uploader/options/).
72
- *
73
- * Please note that the source list is limited to the following values:
74
- * * 'local'
75
- * * 'url'
76
- * * 'dropbox'
77
- * * 'gdrive'
78
- * * 'facebook'
79
- * * 'gphotos'
80
- * * 'onedrive'
81
- *
82
- * Additionally, below options are not supported:
83
- * * `imgOnly` - It's `true` by default.
84
- * * `removeCopyright` - It's `true` by default.
85
- * * `localeName` - Custom translations can be provided via the `locale` config option.
86
- * * `confirmUpload` - It's `false` by default.
87
- * * `cameraMirror` - The `camera` source is not supported.
88
- * * `cameraCapture` - The `camera` source is not supported.
89
- * * `showEmptyList` - It's `false` by default.
90
- *
91
- * All other options documented in the Uploadcare documentation are supported.
92
- */
93
- uploader?: UploadcareUploaderConfig;
94
- /**
95
- * Configuration for the Image Editor component. The component allows editing existing images in the CKEditor.
96
- *
97
- * You can find detailed information in the
98
- * [Uploadcare documentation](https://uploadcare.com/docs/file-uploader/image-editor/#configuration).
99
- *
100
- * Please note that the `cdn-url` and `uuid` attributes are automatically handled by the Uploadcare plugin and
101
- * are not supported in the config options.
102
- */
103
- editor?: UploadcareEditorConfig;
104
- /**
105
- * Allows editing images that are not hosted in Uploadcare service.
106
- *
107
- * This configuration option should whitelist URL(s) of images that should be editable.
108
- *
109
- * The image is editable if this option is:
110
- * * a regular expression and it matches the image URL, or
111
- * * a custom function that returns `true` for the image URL, or
112
- * * `'origin'` literal and the image URL is from the same origin, or
113
- * * an array of the above and the image URL matches one of the array elements.
114
- *
115
- * Images hosted in Uploadcare are always editable.
116
- *
117
- * @default []
118
- */
119
- allowExternalImagesEditing?: ArrayOrItem<RegExp | 'origin' | ((src: string) => boolean)>;
120
- /**
121
- * Locale configuration for Uploadcare components.
122
- *
123
- * The plugin automatically uses the editor's language (`editor.locale.contentLanguage`) as the locale name.
124
- * If the editor language is different from 'en', you need to provide translations for that language.
125
- * This property is used only to supply translations that will be used by Uploadcare components.
126
- *
127
- * For information on how to configure the editor's language, see the
128
- * [CKEditor 5 localization documentation](https://ckeditor.com/docs/ckeditor5/latest/framework/deep-dive/ui/localization.html).
129
- *
130
- * Example with `UploadcareLocaleDefinition`:
131
- * ```ts
132
- * uploadcare: {
133
- * pubkey: 'YOUR_PUBLIC_KEY',
134
- * locale: {
135
- * 'locale-id': 'de',
136
- * 'social-source-lang': 'de',
137
- * 'upload-file': 'Datei hochladen',
138
- * 'file__one': 'Datei',
139
- * 'file__other': 'Dateien',
140
- * 'header-uploading': 'Lade {{count}} {{plural:file(count)}} hoch'
141
- * }
142
- * }
143
- * ```
144
- *
145
- * Example with `UploadcareLocaleDefinitionResolver` (for CDN loading):
146
- * ```ts
147
- * uploadcare: {
148
- * pubkey: 'YOUR_PUBLIC_KEY',
149
- * locale: () => import('https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@v1/locales/file-uploader/de.js')
150
- * .then( module => module.default )
151
- * }
152
- * ```
153
- *
154
- * For detailed information about locale definition format, available languages, and CDN translations,
155
- * see the [Uploadcare localization documentation](https://uploadcare.com/docs/file-uploader/localization/).
156
- *
157
- * When translations are provided, they will be automatically applied to the Uploadcare
158
- * components using `UC.defineLocale()` with the editor's language as the locale name.
159
- *
160
- * @default undefined
161
- */
162
- locale?: UploadcareLocaleDefinition | UploadcareLocaleDefinitionResolver;
62
+ /**
63
+ * The public key used for communication with the Uploadcare services.
64
+ *
65
+ * It will be used by both the File Uploader and Image Editor components.
66
+ */
67
+ pubkey: string;
68
+ /**
69
+ * Configuration that will be passed to the File Uploader component.
70
+ *
71
+ * You can find detailed information in the [Uploadcare documentation](https://uploadcare.com/docs/file-uploader/options/).
72
+ *
73
+ * Please note that the source list is limited to the following values:
74
+ * * 'local'
75
+ * * 'url'
76
+ * * 'dropbox'
77
+ * * 'gdrive'
78
+ * * 'facebook'
79
+ * * 'gphotos'
80
+ * * 'onedrive'
81
+ *
82
+ * Additionally, below options are not supported:
83
+ * * `imgOnly` - It's `true` by default.
84
+ * * `removeCopyright` - It's `true` by default.
85
+ * * `localeName` - Custom translations can be provided via the `locale` config option.
86
+ * * `confirmUpload` - It's `false` by default.
87
+ * * `cameraMirror` - The `camera` source is not supported.
88
+ * * `cameraCapture` - The `camera` source is not supported.
89
+ * * `showEmptyList` - It's `false` by default.
90
+ *
91
+ * All other options documented in the Uploadcare documentation are supported.
92
+ */
93
+ uploader?: UploadcareUploaderConfig;
94
+ /**
95
+ * Configuration for the Image Editor component. The component allows editing existing images in the CKEditor.
96
+ *
97
+ * You can find detailed information in the
98
+ * [Uploadcare documentation](https://uploadcare.com/docs/file-uploader/image-editor/#configuration).
99
+ *
100
+ * Please note that the `cdn-url` and `uuid` attributes are automatically handled by the Uploadcare plugin and
101
+ * are not supported in the config options.
102
+ */
103
+ editor?: UploadcareEditorConfig;
104
+ /**
105
+ * Allows editing images that are not hosted in Uploadcare service.
106
+ *
107
+ * This configuration option should whitelist URL(s) of images that should be editable.
108
+ *
109
+ * The image is editable if this option is:
110
+ * * a regular expression and it matches the image URL, or
111
+ * * a custom function that returns `true` for the image URL, or
112
+ * * `'origin'` literal and the image URL is from the same origin, or
113
+ * * an array of the above and the image URL matches one of the array elements.
114
+ *
115
+ * Images hosted in Uploadcare are always editable.
116
+ *
117
+ * @default []
118
+ */
119
+ allowExternalImagesEditing?: ArrayOrItem<RegExp | "origin" | ((src: string) => boolean)>;
120
+ /**
121
+ * Locale configuration for Uploadcare components.
122
+ *
123
+ * The plugin automatically uses the editor's language (`editor.locale.contentLanguage`) as the locale name.
124
+ * If the editor language is different from 'en', you need to provide translations for that language.
125
+ * This property is used only to supply translations that will be used by Uploadcare components.
126
+ *
127
+ * For information on how to configure the editor's language, see the
128
+ * [CKEditor 5 localization documentation](https://ckeditor.com/docs/ckeditor5/latest/framework/deep-dive/ui/localization.html).
129
+ *
130
+ * Example with `UploadcareLocaleDefinition`:
131
+ * ```ts
132
+ * uploadcare: {
133
+ * pubkey: 'YOUR_PUBLIC_KEY',
134
+ * locale: {
135
+ * 'locale-id': 'de',
136
+ * 'social-source-lang': 'de',
137
+ * 'upload-file': 'Datei hochladen',
138
+ * 'file__one': 'Datei',
139
+ * 'file__other': 'Dateien',
140
+ * 'header-uploading': 'Lade {{count}} {{plural:file(count)}} hoch'
141
+ * }
142
+ * }
143
+ * ```
144
+ *
145
+ * Example with `UploadcareLocaleDefinitionResolver` (for CDN loading):
146
+ * ```ts
147
+ * uploadcare: {
148
+ * pubkey: 'YOUR_PUBLIC_KEY',
149
+ * locale: () => import('https://cdn.jsdelivr.net/npm/@uploadcare/file-uploader@v1/locales/file-uploader/de.js')
150
+ * .then( module => module.default )
151
+ * }
152
+ * ```
153
+ *
154
+ * For detailed information about locale definition format, available languages, and CDN translations,
155
+ * see the [Uploadcare localization documentation](https://uploadcare.com/docs/file-uploader/localization/).
156
+ *
157
+ * When translations are provided, they will be automatically applied to the Uploadcare
158
+ * components using `UC.defineLocale()` with the editor's language as the locale name.
159
+ *
160
+ * @default undefined
161
+ */
162
+ locale?: UploadcareLocaleDefinition | UploadcareLocaleDefinitionResolver;
163
163
  }
164
164
  /**
165
- * Configuration interface for the Uploadcare File Uploader component.
166
- *
167
- * This interface extends the Uploadcare config, excluding certain keys that are either not supported or have been modified.
168
- *
169
- * You can find detailed information in the [Uploadcare documentation](https://uploadcare.com/docs/file-uploader/options/).
165
+ * Configuration interface for the Uploadcare File Uploader component.
166
+ *
167
+ * This interface extends the Uploadcare config, excluding certain keys that are either not supported or have been modified.
168
+ *
169
+ * You can find detailed information in the [Uploadcare documentation](https://uploadcare.com/docs/file-uploader/options/).
170
170
  */
171
- export interface UploadcareUploaderConfig extends Partial<Omit<ConfigType, UploadcareExcludedKeys | 'sourceList'>> {
172
- /**
173
- * Comma-separated list of file sources.
174
- *
175
- * @default [ 'local', 'url' ]
176
- */
177
- sourceList?: Array<UploadcareSource>;
171
+ export interface UploadcareUploaderConfig extends Partial<Omit<ConfigType, UploadcareExcludedKeys | "sourceList">> {
172
+ /**
173
+ * Comma-separated list of file sources.
174
+ *
175
+ * @default [ 'local', 'url' ]
176
+ */
177
+ sourceList?: Array<UploadcareSource>;
178
178
  }
179
179
  /**
180
- * Configuration for the Uploadcare Image Editor component.
181
- *
182
- * You can find detailed information in the
183
- * [Uploadcare documentation](https://uploadcare.com/docs/file-uploader/image-editor/#configuration).
184
- */
180
+ * Configuration for the Uploadcare Image Editor component.
181
+ *
182
+ * You can find detailed information in the
183
+ * [Uploadcare documentation](https://uploadcare.com/docs/file-uploader/image-editor/#configuration).
184
+ */
185
185
  export interface UploadcareEditorConfig {
186
- 'crop-preset'?: string;
187
- tabs?: string;
186
+ "crop-preset"?: string;
187
+ tabs?: string;
188
188
  }
189
189
  /**
190
- * All not supported config options.
191
- */
192
- export type UploadcareExcludedKeys = 'imgOnly' | 'removeCopyright' | 'localeName' | 'confirmUpload' | 'cameraMirror' | 'cameraCapture' | 'showEmptyList';
190
+ * All not supported config options.
191
+ */
192
+ export type UploadcareExcludedKeys = "imgOnly" | "removeCopyright" | "localeName" | "confirmUpload" | "cameraMirror" | "cameraCapture" | "showEmptyList";
193
193
  /**
194
- * Definition of all available upload sources.
195
- */
196
- export type UploadcareSource = 'local' | 'url' | 'dropbox' | 'gdrive' | 'facebook' | 'gphotos' | 'onedrive';
194
+ * Definition of all available upload sources.
195
+ */
196
+ export type UploadcareSource = "local" | "url" | "dropbox" | "gdrive" | "facebook" | "gphotos" | "onedrive";
197
197
  /**
198
- * Image asset definition.
199
- *
200
- * The definition contains the unique `id`, asset `type`, `url` and `attributes`.
201
- */
198
+ * Image asset definition.
199
+ *
200
+ * The definition contains the unique `id`, asset `type`, `url` and `attributes`.
201
+ */
202
202
  export interface UploadcareAssetImageDefinition {
203
- /**
204
- * An unique asset id.
205
- */
206
- id: string;
207
- /**
208
- * Asset type.
209
- */
210
- type: 'image';
211
- /**
212
- * Asset attributes.
213
- */
214
- attributes: UploadcareAssetImageAttributesDefinition;
203
+ /**
204
+ * An unique asset id.
205
+ */
206
+ id: string;
207
+ /**
208
+ * Asset type.
209
+ */
210
+ type: "image";
211
+ /**
212
+ * Asset attributes.
213
+ */
214
+ attributes: UploadcareAssetImageAttributesDefinition;
215
215
  }
216
216
  /**
217
- * Asset attributes definition for an image.
218
- *
219
- * The definition contains the `imageFallbackUrl`, an `imageSources` array with one image source definition object and the
220
- * `imageTextAlternative`.
221
- *
222
- * ```ts
223
- * {
224
- * imageFallbackUrl: 'https://example.com/assets/asset-id/images/1000.png',
225
- * imageSources: [
226
- * {
227
- * sizes: '1000px',
228
- * srcset:
229
- * 'https://example.com/assets/asset-id/images/100.webp 100w,' +
230
- * 'https://example.com/assets/asset-id/images/200.webp 200w,' +
231
- * 'https://example.com/assets/asset-id/images/300.webp 300w,' +
232
- * 'https://example.com/assets/asset-id/images/400.webp 400w,' +
233
- * 'https://example.com/assets/asset-id/images/500.webp 500w,' +
234
- * 'https://example.com/assets/asset-id/images/600.webp 600w,' +
235
- * 'https://example.com/assets/asset-id/images/700.webp 700w,' +
236
- * 'https://example.com/assets/asset-id/images/800.webp 800w,' +
237
- * 'https://example.com/assets/asset-id/images/900.webp 900w,' +
238
- * 'https://example.com/assets/asset-id/images/1000.webp 1000w',
239
- * type: 'image/webp'
240
- * }
241
- * ]
242
- * }
243
- * ```
244
- */
217
+ * Asset attributes definition for an image.
218
+ *
219
+ * The definition contains the `imageFallbackUrl`, an `imageSources` array with one image source definition object and the
220
+ * `imageTextAlternative`.
221
+ *
222
+ * ```ts
223
+ * {
224
+ * imageFallbackUrl: 'https://example.com/assets/asset-id/images/1000.png',
225
+ * imageSources: [
226
+ * {
227
+ * sizes: '1000px',
228
+ * srcset:
229
+ * 'https://example.com/assets/asset-id/images/100.webp 100w,' +
230
+ * 'https://example.com/assets/asset-id/images/200.webp 200w,' +
231
+ * 'https://example.com/assets/asset-id/images/300.webp 300w,' +
232
+ * 'https://example.com/assets/asset-id/images/400.webp 400w,' +
233
+ * 'https://example.com/assets/asset-id/images/500.webp 500w,' +
234
+ * 'https://example.com/assets/asset-id/images/600.webp 600w,' +
235
+ * 'https://example.com/assets/asset-id/images/700.webp 700w,' +
236
+ * 'https://example.com/assets/asset-id/images/800.webp 800w,' +
237
+ * 'https://example.com/assets/asset-id/images/900.webp 900w,' +
238
+ * 'https://example.com/assets/asset-id/images/1000.webp 1000w',
239
+ * type: 'image/webp'
240
+ * }
241
+ * ]
242
+ * }
243
+ * ```
244
+ */
245
245
  export interface UploadcareAssetImageAttributesDefinition {
246
- /**
247
- * A fallback URL for browsers that do not support the "webp" format.
248
- */
249
- imageFallbackUrl: string;
250
- /**
251
- * An array containing one image source definition object.
252
- */
253
- imageSources: Array<{
254
- srcset: string;
255
- sizes: string;
256
- type: string;
257
- }>;
258
- /**
259
- * An alternative text for an image.
260
- */
261
- imageTextAlternative?: string;
262
- /**
263
- * An image dimension (width and height).
264
- */
265
- imageDimension: {
266
- width: number;
267
- height: number;
268
- };
246
+ /**
247
+ * A fallback URL for browsers that do not support the "webp" format.
248
+ */
249
+ imageFallbackUrl: string;
250
+ /**
251
+ * An array containing one image source definition object.
252
+ */
253
+ imageSources: Array<{
254
+ srcset: string;
255
+ sizes: string;
256
+ type: string;
257
+ }>;
258
+ /**
259
+ * An alternative text for an image.
260
+ */
261
+ imageTextAlternative?: string;
262
+ /**
263
+ * An image dimension (width and height).
264
+ */
265
+ imageDimension: {
266
+ width: number;
267
+ height: number;
268
+ };
269
269
  }