@ckeditor/ckeditor5-ckbox 0.0.0-internal-20241017.0 → 0.0.0-internal-20241206.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 (260) hide show
  1. package/LICENSE.md +7 -2
  2. package/README.md +22 -7
  3. package/build/ckbox.js +1 -1
  4. package/build/translations/af.js +1 -0
  5. package/build/translations/ast.js +1 -0
  6. package/build/translations/bs.js +1 -0
  7. package/build/translations/de-ch.js +1 -0
  8. package/build/translations/en-gb.js +1 -0
  9. package/build/translations/eo.js +1 -0
  10. package/build/translations/eu.js +1 -0
  11. package/build/translations/gu.js +1 -0
  12. package/build/translations/hy.js +1 -0
  13. package/build/translations/jv.js +1 -0
  14. package/build/translations/kk.js +1 -0
  15. package/build/translations/km.js +1 -0
  16. package/build/translations/kn.js +1 -0
  17. package/build/translations/ku.js +1 -0
  18. package/build/translations/nb.js +1 -0
  19. package/build/translations/ne.js +1 -0
  20. package/build/translations/oc.js +1 -0
  21. package/build/translations/si.js +1 -0
  22. package/build/translations/sl.js +1 -0
  23. package/build/translations/ti.js +1 -0
  24. package/build/translations/tk.js +1 -0
  25. package/build/translations/tt.js +1 -0
  26. package/dist/index.css +1 -1
  27. package/dist/index.css.map +1 -1
  28. package/dist/index.js +270 -295
  29. package/dist/index.js.map +1 -1
  30. package/dist/translations/af.d.ts +8 -0
  31. package/dist/translations/af.js +5 -0
  32. package/dist/translations/af.umd.js +11 -0
  33. package/dist/translations/ar.js +1 -1
  34. package/dist/translations/ar.umd.js +1 -1
  35. package/dist/translations/ast.d.ts +8 -0
  36. package/dist/translations/ast.js +5 -0
  37. package/dist/translations/ast.umd.js +11 -0
  38. package/dist/translations/bs.d.ts +8 -0
  39. package/dist/translations/bs.js +5 -0
  40. package/dist/translations/bs.umd.js +11 -0
  41. package/dist/translations/cs.js +1 -1
  42. package/dist/translations/cs.umd.js +1 -1
  43. package/dist/translations/de-ch.d.ts +8 -0
  44. package/dist/translations/de-ch.js +5 -0
  45. package/dist/translations/de-ch.umd.js +11 -0
  46. package/dist/translations/en-gb.d.ts +8 -0
  47. package/dist/translations/en-gb.js +5 -0
  48. package/dist/translations/en-gb.umd.js +11 -0
  49. package/dist/translations/en.js +1 -1
  50. package/dist/translations/en.umd.js +1 -1
  51. package/dist/translations/eo.d.ts +8 -0
  52. package/dist/translations/eo.js +5 -0
  53. package/dist/translations/eo.umd.js +11 -0
  54. package/dist/translations/es-co.js +1 -1
  55. package/dist/translations/es-co.umd.js +1 -1
  56. package/dist/translations/es.js +1 -1
  57. package/dist/translations/es.umd.js +1 -1
  58. package/dist/translations/eu.d.ts +8 -0
  59. package/dist/translations/eu.js +5 -0
  60. package/dist/translations/eu.umd.js +11 -0
  61. package/dist/translations/fa.js +1 -1
  62. package/dist/translations/fa.umd.js +1 -1
  63. package/dist/translations/fr.js +1 -1
  64. package/dist/translations/fr.umd.js +1 -1
  65. package/dist/translations/gu.d.ts +8 -0
  66. package/dist/translations/gu.js +5 -0
  67. package/dist/translations/gu.umd.js +11 -0
  68. package/dist/translations/he.js +1 -1
  69. package/dist/translations/he.umd.js +1 -1
  70. package/dist/translations/hr.js +1 -1
  71. package/dist/translations/hr.umd.js +1 -1
  72. package/dist/translations/hy.d.ts +8 -0
  73. package/dist/translations/hy.js +5 -0
  74. package/dist/translations/hy.umd.js +11 -0
  75. package/dist/translations/it.js +1 -1
  76. package/dist/translations/it.umd.js +1 -1
  77. package/dist/translations/jv.d.ts +8 -0
  78. package/dist/translations/jv.js +5 -0
  79. package/dist/translations/jv.umd.js +11 -0
  80. package/dist/translations/kk.d.ts +8 -0
  81. package/dist/translations/kk.js +5 -0
  82. package/dist/translations/kk.umd.js +11 -0
  83. package/dist/translations/km.d.ts +8 -0
  84. package/dist/translations/km.js +5 -0
  85. package/dist/translations/km.umd.js +11 -0
  86. package/dist/translations/kn.d.ts +8 -0
  87. package/dist/translations/kn.js +5 -0
  88. package/dist/translations/kn.umd.js +11 -0
  89. package/dist/translations/ku.d.ts +8 -0
  90. package/dist/translations/ku.js +5 -0
  91. package/dist/translations/ku.umd.js +11 -0
  92. package/dist/translations/lt.js +1 -1
  93. package/dist/translations/lt.umd.js +1 -1
  94. package/dist/translations/lv.js +1 -1
  95. package/dist/translations/lv.umd.js +1 -1
  96. package/dist/translations/nb.d.ts +8 -0
  97. package/dist/translations/nb.js +5 -0
  98. package/dist/translations/nb.umd.js +11 -0
  99. package/dist/translations/ne.d.ts +8 -0
  100. package/dist/translations/ne.js +5 -0
  101. package/dist/translations/ne.umd.js +11 -0
  102. package/dist/translations/oc.d.ts +8 -0
  103. package/dist/translations/oc.js +5 -0
  104. package/dist/translations/oc.umd.js +11 -0
  105. package/dist/translations/pl.js +1 -1
  106. package/dist/translations/pl.umd.js +1 -1
  107. package/dist/translations/pt-br.js +1 -1
  108. package/dist/translations/pt-br.umd.js +1 -1
  109. package/dist/translations/pt.js +1 -1
  110. package/dist/translations/pt.umd.js +1 -1
  111. package/dist/translations/ro.js +1 -1
  112. package/dist/translations/ro.umd.js +1 -1
  113. package/dist/translations/ru.js +1 -1
  114. package/dist/translations/ru.umd.js +1 -1
  115. package/dist/translations/si.d.ts +8 -0
  116. package/dist/translations/si.js +5 -0
  117. package/dist/translations/si.umd.js +11 -0
  118. package/dist/translations/sk.js +1 -1
  119. package/dist/translations/sk.umd.js +1 -1
  120. package/dist/translations/sl.d.ts +8 -0
  121. package/dist/translations/sl.js +5 -0
  122. package/dist/translations/sl.umd.js +11 -0
  123. package/dist/translations/sr-latn.js +1 -1
  124. package/dist/translations/sr-latn.umd.js +1 -1
  125. package/dist/translations/sr.js +1 -1
  126. package/dist/translations/sr.umd.js +1 -1
  127. package/dist/translations/ti.d.ts +8 -0
  128. package/dist/translations/ti.js +5 -0
  129. package/dist/translations/ti.umd.js +11 -0
  130. package/dist/translations/tk.d.ts +8 -0
  131. package/dist/translations/tk.js +5 -0
  132. package/dist/translations/tk.umd.js +11 -0
  133. package/dist/translations/tt.d.ts +8 -0
  134. package/dist/translations/tt.js +5 -0
  135. package/dist/translations/tt.umd.js +11 -0
  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/uz.js +1 -1
  141. package/dist/translations/uz.umd.js +1 -1
  142. package/lang/translations/af.po +44 -0
  143. package/lang/translations/ar.po +4 -10
  144. package/lang/translations/ast.po +44 -0
  145. package/lang/translations/az.po +3 -9
  146. package/lang/translations/bg.po +3 -9
  147. package/lang/translations/bn.po +3 -9
  148. package/lang/translations/bs.po +44 -0
  149. package/lang/translations/ca.po +3 -9
  150. package/lang/translations/cs.po +4 -10
  151. package/lang/translations/da.po +3 -9
  152. package/lang/translations/de-ch.po +44 -0
  153. package/lang/translations/de.po +3 -9
  154. package/lang/translations/el.po +3 -9
  155. package/lang/translations/en-au.po +3 -9
  156. package/lang/translations/en-gb.po +44 -0
  157. package/lang/translations/en.po +5 -11
  158. package/lang/translations/eo.po +44 -0
  159. package/lang/translations/es-co.po +4 -10
  160. package/lang/translations/es.po +4 -10
  161. package/lang/translations/et.po +3 -9
  162. package/lang/translations/eu.po +44 -0
  163. package/lang/translations/fa.po +4 -10
  164. package/lang/translations/fi.po +3 -9
  165. package/lang/translations/fr.po +4 -10
  166. package/lang/translations/gl.po +3 -9
  167. package/lang/translations/gu.po +44 -0
  168. package/lang/translations/he.po +4 -10
  169. package/lang/translations/hi.po +3 -9
  170. package/lang/translations/hr.po +4 -10
  171. package/lang/translations/hu.po +3 -9
  172. package/lang/translations/hy.po +44 -0
  173. package/lang/translations/id.po +3 -9
  174. package/lang/translations/it.po +4 -10
  175. package/lang/translations/ja.po +3 -9
  176. package/lang/translations/jv.po +44 -0
  177. package/lang/translations/kk.po +44 -0
  178. package/lang/translations/km.po +44 -0
  179. package/lang/translations/kn.po +44 -0
  180. package/lang/translations/ko.po +3 -9
  181. package/lang/translations/ku.po +44 -0
  182. package/lang/translations/lt.po +4 -10
  183. package/lang/translations/lv.po +4 -10
  184. package/lang/translations/ms.po +3 -9
  185. package/lang/translations/nb.po +44 -0
  186. package/lang/translations/ne.po +44 -0
  187. package/lang/translations/nl.po +3 -9
  188. package/lang/translations/no.po +3 -9
  189. package/lang/translations/oc.po +44 -0
  190. package/lang/translations/pl.po +4 -10
  191. package/lang/translations/pt-br.po +4 -10
  192. package/lang/translations/pt.po +4 -10
  193. package/lang/translations/ro.po +4 -10
  194. package/lang/translations/ru.po +4 -10
  195. package/lang/translations/si.po +44 -0
  196. package/lang/translations/sk.po +4 -10
  197. package/lang/translations/sl.po +44 -0
  198. package/lang/translations/sq.po +3 -9
  199. package/lang/translations/sr-latn.po +4 -10
  200. package/lang/translations/sr.po +4 -10
  201. package/lang/translations/sv.po +3 -9
  202. package/lang/translations/th.po +3 -9
  203. package/lang/translations/ti.po +44 -0
  204. package/lang/translations/tk.po +44 -0
  205. package/lang/translations/tr.po +3 -9
  206. package/lang/translations/tt.po +44 -0
  207. package/lang/translations/ug.po +4 -10
  208. package/lang/translations/uk.po +4 -10
  209. package/lang/translations/ur.po +3 -9
  210. package/lang/translations/uz.po +4 -10
  211. package/lang/translations/vi.po +3 -9
  212. package/lang/translations/zh-cn.po +3 -9
  213. package/lang/translations/zh.po +3 -9
  214. package/package.json +28 -9
  215. package/src/augmentation.d.ts +1 -1
  216. package/src/augmentation.js +1 -1
  217. package/src/ckbox.d.ts +1 -1
  218. package/src/ckbox.js +1 -1
  219. package/src/ckboxcommand.d.ts +1 -1
  220. package/src/ckboxcommand.js +1 -1
  221. package/src/ckboxconfig.d.ts +1 -1
  222. package/src/ckboxconfig.js +1 -1
  223. package/src/ckboxediting.d.ts +1 -1
  224. package/src/ckboxediting.js +1 -1
  225. package/src/ckboximageedit/ckboximageeditcommand.d.ts +1 -1
  226. package/src/ckboximageedit/ckboximageeditcommand.js +1 -1
  227. package/src/ckboximageedit/ckboximageeditediting.d.ts +1 -1
  228. package/src/ckboximageedit/ckboximageeditediting.js +1 -1
  229. package/src/ckboximageedit/ckboximageeditui.d.ts +1 -1
  230. package/src/ckboximageedit/ckboximageeditui.js +1 -1
  231. package/src/ckboximageedit/utils.d.ts +1 -1
  232. package/src/ckboximageedit/utils.js +1 -1
  233. package/src/ckboximageedit.d.ts +1 -1
  234. package/src/ckboximageedit.js +1 -1
  235. package/src/ckboxui.d.ts +1 -1
  236. package/src/ckboxui.js +4 -2
  237. package/src/ckboxuploadadapter.d.ts +1 -1
  238. package/src/ckboxuploadadapter.js +1 -1
  239. package/src/ckboxutils.d.ts +1 -1
  240. package/src/ckboxutils.js +1 -1
  241. package/src/index.d.ts +1 -1
  242. package/src/index.js +1 -1
  243. package/src/utils.d.ts +1 -1
  244. package/src/utils.js +1 -1
  245. package/theme/ckboximageedit.css +1 -1
  246. package/dist/augmentation.d.ts +0 -36
  247. package/dist/ckbox.d.ts +0 -41
  248. package/dist/ckboxcommand.d.ts +0 -130
  249. package/dist/ckboxconfig.d.ts +0 -434
  250. package/dist/ckboxediting.d.ts +0 -65
  251. package/dist/ckboximageedit/ckboximageeditcommand.d.ts +0 -109
  252. package/dist/ckboximageedit/ckboximageeditediting.d.ts +0 -36
  253. package/dist/ckboximageedit/ckboximageeditui.d.ts +0 -32
  254. package/dist/ckboximageedit/utils.d.ts +0 -14
  255. package/dist/ckboximageedit.d.ts +0 -32
  256. package/dist/ckboxui.d.ts +0 -60
  257. package/dist/ckboxuploadadapter.d.ts +0 -41
  258. package/dist/ckboxutils.d.ts +0 -58
  259. package/dist/index.d.ts +0 -21
  260. package/dist/utils.d.ts +0 -67
@@ -1,434 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module ckbox/ckboxconfig
11
- */
12
- import type { TokenUrl } from '@ckeditor/ckeditor5-cloud-services';
13
- import type { ArrayOrItem } from 'ckeditor5/src/utils.js';
14
- /**
15
- * The configuration of the {@link module:ckbox/ckbox~CKBox CKBox feature}.
16
- *
17
- * The minimal configuration for the CKBox feature requires providing the
18
- * {@link module:ckbox/ckboxconfig~CKBoxConfig#tokenUrl `config.ckbox.tokenUrl`}:
19
- *
20
- * ```ts
21
- * ClassicEditor
22
- * .create( editorElement, {
23
- * ckbox: {
24
- * tokenUrl: 'https://example.com/cs-token-endpoint'
25
- * }
26
- * } )
27
- * .then( ... )
28
- * .catch( ... );
29
- * ```
30
- *
31
- * Hovewer, you can also adjust the feature to fit your needs:
32
- *
33
- * ```ts
34
- * ClassicEditor
35
- * .create( editorElement, {
36
- * ckbox: {
37
- * defaultUploadCategories: {
38
- * Bitmaps: [ 'bmp' ],
39
- * Pictures: [ 'jpg', 'jpeg' ],
40
- * Scans: [ 'png', 'tiff' ]
41
- * },
42
- * ignoreDataId: true,
43
- * serviceOrigin: 'https://example.com/',
44
- * tokenUrl: 'https://example.com/cs-token-endpoint'
45
- * }
46
- * } )
47
- * .then( ... )
48
- * .catch( ... );
49
- * ```
50
- *
51
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
52
- */
53
- export interface CKBoxConfig {
54
- /**
55
- * The authentication token URL for CKBox feature.
56
- *
57
- * Defaults to {@link module:cloud-services/cloudservicesconfig~CloudServicesConfig#tokenUrl `config.cloudServices.tokenUrl`}
58
- */
59
- tokenUrl?: TokenUrl;
60
- /**
61
- * The theme for CKBox dialog.
62
- */
63
- theme?: string;
64
- /**
65
- * Defines the categories to which the uploaded images will be assigned.
66
- * If configured, it overrides the category mappings defined on the cloud service.
67
- * The value of this option should be an object, where the keys define categories and their values are the types of images
68
- * that will be uploaded to these categories. The categories might be referenced by their name or ID.
69
- *
70
- * Example:
71
- *
72
- * ```ts
73
- * const ckboxConfig = {
74
- * defaultUploadCategories: {
75
- * Bitmaps: [ 'bmp' ],
76
- * Pictures: [ 'jpg', 'jpeg' ],
77
- * Scans: [ 'png', 'tiff' ],
78
- * // The category below is referenced by its ID.
79
- * 'fdf2a647-b67f-4a6c-b692-5ba1dc1ed87b': [ 'gif' ]
80
- * }
81
- * };
82
- * ```
83
- *
84
- * @default null
85
- */
86
- defaultUploadCategories?: Record<string, Array<string>> | null;
87
- /**
88
- * Defines the workspace id to use during upload when the user has access to more than one workspace.
89
- *
90
- * If defined, it is an error, when the user has no access to the specified workspace.
91
- */
92
- defaultUploadWorkspaceId?: string;
93
- /**
94
- * Enforces displaying the "Powered by CKBox" link regardless of the CKBox plan used.
95
- */
96
- forceDemoLabel?: boolean;
97
- /**
98
- * Allows editing images that are not hosted in CKBox service.
99
- *
100
- * This configuration option should whitelist URL(s) of images that should be editable.
101
- * Make sure that allowed image resources have CORS enabled.
102
- *
103
- * The image is editable if this option is:
104
- * * a regular expression and it matches the image URL, or
105
- * * a custom function that returns `true` for the image URL, or
106
- * * `'origin'` literal and the image URL is from the same origin, or
107
- * * an array of the above and the image URL matches one of the array elements.
108
- *
109
- * Images hosted in CKBox are always editable.
110
- *
111
- * @default []
112
- */
113
- allowExternalImagesEditing?: ArrayOrItem<RegExp | 'origin' | ((src: string) => boolean)>;
114
- /**
115
- * Inserts the unique asset ID as the `data-ckbox-resource-id` attribute. To disable this behavior, set it to `true`.
116
- *
117
- * @default false
118
- */
119
- ignoreDataId?: boolean;
120
- /**
121
- * Configures the base URL of the API service. Required only in on-premises installations.
122
- *
123
- * @default 'https://api.ckbox.io'
124
- */
125
- serviceOrigin?: string;
126
- /**
127
- * Configures the language for the CKBox dialog.
128
- *
129
- * Defaults to {@link module:utils/locale~Locale#uiLanguage `Locale#uiLanguage`}
130
- */
131
- language?: string;
132
- /**
133
- * This option allows opening CKBox in dialog mode. It takes a configuration object with
134
- * the width and height attributes.
135
- */
136
- dialog?: CKBoxDialogConfig;
137
- /**
138
- * Allows setting custom icons for categories.
139
- */
140
- categories?: CKBoxCategoriesConfig;
141
- /**
142
- * Configures the view of CKBox.
143
- */
144
- view?: CKBoxViewConfig;
145
- /**
146
- * Configures when dialog should be minimized and hidden.
147
- */
148
- upload?: CKBoxUploadConfig;
149
- /**
150
- * Specifies the file extensions considered valid for user interaction. Whith this
151
- * option developers can restrict user interaction to only those assets whose file
152
- * extensions match those listed in the array. Assets whose file
153
- * extensions are not listed in the `choosableFileExtensions` array are
154
- * automatically disabled within the CKBox interface.
155
- *
156
- * ```ts
157
- * const ckboxConfig = {
158
- * choosableFileExtensions: ['jpg', 'png']
159
- * };
160
- * ```
161
- */
162
- choosableFileExtensions?: Array<string>;
163
- }
164
- export interface CKBoxDialogConfig {
165
- /**
166
- * The dialog width in pixels.
167
- */
168
- width: number;
169
- /**
170
- * The dialog height in pixels.
171
- */
172
- height: number;
173
- }
174
- export interface CKBoxCategoriesConfig {
175
- /**
176
- * This option takes an object with categories and icons that should be used instead
177
- * of the default ones. Categories can be defined using either their name or id.
178
- * Icons should be defined as strings containing the SVG images, or as React components.
179
- *
180
- * ```ts
181
- * const ckboxConfig = {
182
- * categories: {
183
- * icons: {
184
- * Images: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path ... /></svg>',
185
- * // Category can be referenced by ID
186
- * // 'fdf2a647-b67f-4a6c-b692-5ba1dc1ed87b': '<svg...'
187
- * }
188
- * }
189
- * }
190
- * ```
191
- */
192
- icons?: {
193
- [key: string]: string;
194
- };
195
- }
196
- export interface CKBoxViewConfig {
197
- /**
198
- * If it is set to `false` the last view visited by the user will not be reopened on
199
- * the next startup.
200
- */
201
- openLastView?: boolean;
202
- /**
203
- * Sets the ID of the folder that will be opened on startup. This option can be paired
204
- * with setting `view.openLastView` to `false` to enforce CKBox to always open in a given
205
- * folder at startup.
206
- */
207
- startupFolderId?: string;
208
- /**
209
- * Sets the ID of the category that will be opened on startup. This option can be paired
210
- * with setting `view.openLastView` to `false` to enforce CKBox to always open in a given
211
- * category at startup. If `view.startupCategoryId` is passed along with the
212
- * `view.startupFolderId` option, CKBox will prioritize opening category view on the startup.
213
- */
214
- startupCategoryId?: string;
215
- /**
216
- * Sets whether to hide the ‘Maximize’ button. By default, the button is shown and enabling
217
- * this option will hide it.
218
- */
219
- hideMaximizeButton?: boolean;
220
- }
221
- export interface CKBoxUploadConfig {
222
- /**
223
- * Sets timeout (in milliseconds) after which upload components (dialog and indicator) are
224
- * hidden. By default, these components hide automatically after 10 seconds.
225
- *
226
- * Read more: https://ckeditor.com/docs/ckbox/latest/guides/configuration/configuration-options.html#uploadcomponentshidetimeout
227
- */
228
- componentsHideTimeout?: number;
229
- /**
230
- * Sets timeout (in milliseconds) after which upload dialog is minimized once upload is
231
- * finished and all uploads were successful. By default, upload dialog is never minimized
232
- * automatically.
233
- *
234
- * Read more: https://ckeditor.com/docs/ckbox/latest/guides/configuration/configuration-options.html#uploaddialogminimizetimeout
235
- */
236
- dialogMinimizeTimeout?: number;
237
- }
238
- /**
239
- * Asset definition.
240
- *
241
- * The definition contains the unique `id`, asset `type` and an `attributes` definition.
242
- */
243
- export type CKBoxAssetDefinition = CKBoxAssetImageDefinition | CKBoxAssetLinkDefinition;
244
- /**
245
- * Image asset definition.
246
- *
247
- * The definition contains the unique `id`, asset `type` and an `attributes` definition.
248
- */
249
- export interface CKBoxAssetImageDefinition {
250
- /**
251
- * An unique asset id.
252
- */
253
- id: string;
254
- /**
255
- * Asset type.
256
- */
257
- type: 'image';
258
- /**
259
- * Asset attributes.
260
- */
261
- attributes: CKBoxAssetImageAttributesDefinition;
262
- }
263
- /**
264
- * Link asset definition.
265
- *
266
- * The definition contains the unique `id`, asset `type` and an `attributes` definition.
267
- */
268
- export interface CKBoxAssetLinkDefinition {
269
- /**
270
- * An unique asset id.
271
- */
272
- id: string;
273
- /**
274
- * Asset type.
275
- */
276
- type: 'link';
277
- /**
278
- * Asset attributes.
279
- */
280
- attributes: CKBoxAssetLinkAttributesDefinition;
281
- }
282
- /**
283
- * Asset attributes definition for an image.
284
- *
285
- * The definition contains the `imageFallbackUrl`, an `imageSources` array with one image source definition object and the
286
- * `imageTextAlternative`.
287
- *
288
- * ```ts
289
- * {
290
- * imageFallbackUrl: 'https://example.com/assets/asset-id/images/1000.png',
291
- * imageSources: [
292
- * {
293
- * sizes: '1000px',
294
- * srcset:
295
- * 'https://example.com/assets/asset-id/images/100.webp 100w,' +
296
- * 'https://example.com/assets/asset-id/images/200.webp 200w,' +
297
- * 'https://example.com/assets/asset-id/images/300.webp 300w,' +
298
- * 'https://example.com/assets/asset-id/images/400.webp 400w,' +
299
- * 'https://example.com/assets/asset-id/images/500.webp 500w,' +
300
- * 'https://example.com/assets/asset-id/images/600.webp 600w,' +
301
- * 'https://example.com/assets/asset-id/images/700.webp 700w,' +
302
- * 'https://example.com/assets/asset-id/images/800.webp 800w,' +
303
- * 'https://example.com/assets/asset-id/images/900.webp 900w,' +
304
- * 'https://example.com/assets/asset-id/images/1000.webp 1000w',
305
- * type: 'image/webp'
306
- * }
307
- * ],
308
- * imageTextAlternative: 'An alternative text for the image'
309
- * }
310
- * ```
311
- */
312
- export interface CKBoxAssetImageAttributesDefinition {
313
- /**
314
- * A fallback URL for browsers that do not support the "webp" format.
315
- */
316
- imageFallbackUrl: string;
317
- /**
318
- * An array containing one image source definition object.
319
- */
320
- imageSources: Array<{
321
- srcset: string;
322
- sizes: string;
323
- type: string;
324
- }>;
325
- /**
326
- * An alternative text for an image.
327
- */
328
- imageTextAlternative: string;
329
- /**
330
- * Image width.
331
- */
332
- imageWidth?: number;
333
- /**
334
- * Image height.
335
- */
336
- imageHeight?: number;
337
- /**
338
- * Image placeholder image.
339
- */
340
- imagePlaceholder?: string;
341
- }
342
- /**
343
- * Asset attributes definition for a link.
344
- *
345
- * The definition contains the `linkName` and `linkHref` strings.
346
- *
347
- * ```ts
348
- * {
349
- * linkName: 'File name',
350
- * linkHref: 'https://example.com/assets/asset-id/file.pdf'
351
- * }
352
- * ```
353
- */
354
- export interface CKBoxAssetLinkAttributesDefinition {
355
- /**
356
- * A link name.
357
- */
358
- linkName: string;
359
- /**
360
- * An URL for the asset.
361
- */
362
- linkHref: string;
363
- }
364
- /**
365
- * The source set of the responsive image provided by the CKBox backend.
366
- *
367
- * Each numeric key corresponds to display width of the image.
368
- */
369
- export interface CKBoxImageUrls {
370
- [width: number]: string;
371
- /**
372
- * A fallback URL for browsers that do not support the "webp" format.
373
- */
374
- default: string;
375
- }
376
- /**
377
- * Raw asset definition that is received from the CKBox feature.
378
- */
379
- export interface CKBoxRawAssetDefinition {
380
- /**
381
- * A raw asset data definition.
382
- */
383
- data: CKBoxRawAssetDataDefinition;
384
- }
385
- /**
386
- * Part of raw asset data that is received from the CKBox feature.
387
- */
388
- export interface CKBoxRawAssetDataDefinition {
389
- /**
390
- * An unique asset id.
391
- */
392
- id: string;
393
- /**
394
- * An asset name.
395
- */
396
- name: string;
397
- /**
398
- * A raw asset metadata definition.
399
- */
400
- metadata?: CKBoxRawAssetMetadataDefinition;
401
- /**
402
- * The source set of the responsive image.
403
- */
404
- imageUrls?: CKBoxImageUrls;
405
- /**
406
- * The asset location.
407
- */
408
- url: string;
409
- }
410
- /**
411
- * Part of raw asset data that is received from the CKBox feature. Properties are set only if the chosen asset is an image.
412
- */
413
- export interface CKBoxRawAssetMetadataDefinition {
414
- /**
415
- * Image description.
416
- */
417
- description?: string;
418
- /**
419
- * Image width.
420
- */
421
- width?: number;
422
- /**
423
- * Image height.
424
- */
425
- height?: number;
426
- /**
427
- * The blurhash placeholder value.
428
- */
429
- blurHash?: string;
430
- /**
431
- * The processing status of the asset.
432
- */
433
- metadataProcessingStatus?: string;
434
- }
@@ -1,65 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module ckbox/ckboxediting
11
- */
12
- import { Plugin } from 'ckeditor5/src/core.js';
13
- import CKBoxUploadAdapter from './ckboxuploadadapter.js';
14
- import CKBoxUtils from './ckboxutils.js';
15
- /**
16
- * The CKBox editing feature. It introduces the {@link module:ckbox/ckboxcommand~CKBoxCommand CKBox command} and
17
- * {@link module:ckbox/ckboxuploadadapter~CKBoxUploadAdapter CKBox upload adapter}.
18
- */
19
- export default class CKBoxEditing extends Plugin {
20
- /**
21
- * @inheritDoc
22
- */
23
- static get pluginName(): "CKBoxEditing";
24
- /**
25
- * @inheritDoc
26
- */
27
- static get isOfficialPlugin(): true;
28
- /**
29
- * @inheritDoc
30
- */
31
- static get requires(): readonly ["LinkEditing", "PictureEditing", typeof CKBoxUploadAdapter, typeof CKBoxUtils];
32
- /**
33
- * @inheritDoc
34
- */
35
- init(): void;
36
- /**
37
- * @inheritDoc
38
- */
39
- afterInit(): void;
40
- /**
41
- * Returns true only when the integrator intentionally wants to use the plugin, i.e. when the `config.ckbox` exists or
42
- * the CKBox JavaScript library is loaded.
43
- */
44
- private _shouldBeInitialised;
45
- /**
46
- * Blocks `uploadImage` and `ckboxImageEdit` commands.
47
- */
48
- private _blockImageCommands;
49
- /**
50
- * Checks if at least one image plugin is loaded.
51
- */
52
- private _checkImagePlugins;
53
- /**
54
- * Extends the schema to allow the `ckboxImageId` and `ckboxLinkId` attributes for links and images.
55
- */
56
- private _initSchema;
57
- /**
58
- * Configures the upcast and downcast conversions for the `ckboxImageId` and `ckboxLinkId` attributes.
59
- */
60
- private _initConversion;
61
- /**
62
- * Registers post-fixers that add or remove the `ckboxLinkId` and `ckboxImageId` attributes.
63
- */
64
- private _initFixers;
65
- }
@@ -1,109 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module ckbox/ckboximageedit/ckboximageeditcommand
11
- */
12
- import { Command, type Editor } from 'ckeditor5/src/core.js';
13
- /**
14
- * The CKBox edit image command.
15
- *
16
- * Opens the CKBox dialog for editing the image.
17
- */
18
- export default class CKBoxImageEditCommand extends Command {
19
- /**
20
- * Flag indicating whether the command is active, i.e. dialog is open.
21
- */
22
- value: boolean;
23
- /**
24
- * The DOM element that acts as a mounting point for the CKBox Edit Image dialog.
25
- */
26
- private _wrapper;
27
- /**
28
- * The states of image processing in progress.
29
- */
30
- private _processInProgress;
31
- /**
32
- * Determines if the element can be edited.
33
- */
34
- private _canEdit;
35
- /**
36
- * A wrapper function to prepare mount options. Ensures that at most one preparation is in-flight.
37
- */
38
- private _prepareOptions;
39
- /**
40
- * CKBox's onClose function runs before the final cleanup, potentially causing
41
- * page layout changes after it finishes. To address this, we use a setTimeout hack
42
- * to ensure that floating elements on the page maintain their correct position.
43
- *
44
- * See: https://github.com/ckeditor/ckeditor5/issues/16153.
45
- */
46
- private _updateUiDelayed;
47
- /**
48
- * @inheritDoc
49
- */
50
- constructor(editor: Editor);
51
- /**
52
- * @inheritDoc
53
- */
54
- refresh(): void;
55
- /**
56
- * Opens the CKBox Image Editor dialog for editing the image.
57
- */
58
- execute(): void;
59
- /**
60
- * @inheritDoc
61
- */
62
- destroy(): void;
63
- /**
64
- * Indicates if the CKBox Image Editor dialog is already opened.
65
- */
66
- private _getValue;
67
- /**
68
- * Creates the options object for the CKBox Image Editor dialog.
69
- */
70
- private _prepareOptionsAbortable;
71
- /**
72
- * Initializes event lister for an event of removing an image.
73
- */
74
- private _prepareListeners;
75
- /**
76
- * Gets processing states of images that have been deleted in the mean time.
77
- */
78
- private _getProcessingStatesOfDeletedImages;
79
- private _checkIfElementIsBeingProcessed;
80
- /**
81
- * Closes the CKBox Image Editor dialog.
82
- */
83
- private _handleImageEditorClose;
84
- /**
85
- * Save edited image. In case server respond with "success" replace with edited image,
86
- * otherwise show notification error.
87
- */
88
- private _handleImageEditorSave;
89
- /**
90
- * Get asset's status on server. If server responds with "success" status then
91
- * image is already proceeded and ready for saving.
92
- */
93
- private _getAssetStatusFromServer;
94
- /**
95
- * Waits for an asset to be processed.
96
- * It retries retrieving asset status from the server in case of failure.
97
- */
98
- private _waitForAssetProcessed;
99
- /**
100
- * Shows processing indicator while image is processing.
101
- *
102
- * @param asset Data about certain asset.
103
- */
104
- private _showImageProcessingIndicator;
105
- /**
106
- * Replace the edited image with the new one.
107
- */
108
- private _replaceImage;
109
- }
@@ -1,36 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module ckbox/ckboximageedit/ckboximageeditediting
11
- */
12
- import { PendingActions, Plugin } from 'ckeditor5/src/core.js';
13
- import { Notification } from 'ckeditor5/src/ui.js';
14
- import CKBoxEditing from '../ckboxediting.js';
15
- import CKBoxUtils from '../ckboxutils.js';
16
- /**
17
- * The CKBox image edit editing plugin.
18
- */
19
- export default class CKBoxImageEditEditing extends Plugin {
20
- /**
21
- * @inheritDoc
22
- */
23
- static get pluginName(): "CKBoxImageEditEditing";
24
- /**
25
- * @inheritDoc
26
- */
27
- static get isOfficialPlugin(): true;
28
- /**
29
- * @inheritDoc
30
- */
31
- static get requires(): readonly [typeof CKBoxEditing, typeof CKBoxUtils, typeof PendingActions, typeof Notification, "ImageUtils", "ImageEditing"];
32
- /**
33
- * @inheritDoc
34
- */
35
- init(): void;
36
- }
@@ -1,32 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module ckbox/ckboximageedit/ckboximageeditui
11
- */
12
- import { Plugin } from 'ckeditor5/src/core.js';
13
- /**
14
- * The UI plugin of the CKBox image edit feature.
15
- *
16
- * It registers the `'ckboxImageEdit'` UI button in the editor's {@link module:ui/componentfactory~ComponentFactory component factory}
17
- * that allows you to open the CKBox dialog and edit the image.
18
- */
19
- export default class CKBoxImageEditUI extends Plugin {
20
- /**
21
- * @inheritDoc
22
- */
23
- static get pluginName(): "CKBoxImageEditUI";
24
- /**
25
- * @inheritDoc
26
- */
27
- static get isOfficialPlugin(): true;
28
- /**
29
- * @inheritDoc
30
- */
31
- init(): void;
32
- }
@@ -1,14 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- import type { Element } from 'ckeditor5/src/engine.js';
10
- import type { CKBoxConfig } from '../ckboxconfig.js';
11
- /**
12
- * @internal
13
- */
14
- export declare function createEditabilityChecker(allowExternalImagesEditing: CKBoxConfig['allowExternalImagesEditing']): (element: Element) => boolean;