@ckeditor/ckeditor5-image 41.3.1 → 41.4.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 (424) hide show
  1. package/build/image.js +2 -2
  2. package/build/translations/ar.js +1 -1
  3. package/build/translations/ast.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/bs.js +1 -1
  8. package/build/translations/ca.js +1 -1
  9. package/build/translations/cs.js +1 -1
  10. package/build/translations/da.js +1 -1
  11. package/build/translations/de-ch.js +1 -1
  12. package/build/translations/de.js +1 -1
  13. package/build/translations/el.js +1 -1
  14. package/build/translations/en-au.js +1 -1
  15. package/build/translations/en-gb.js +1 -1
  16. package/build/translations/eo.js +1 -1
  17. package/build/translations/es-co.js +1 -1
  18. package/build/translations/es.js +1 -1
  19. package/build/translations/et.js +1 -1
  20. package/build/translations/eu.js +1 -1
  21. package/build/translations/fa.js +1 -1
  22. package/build/translations/fi.js +1 -1
  23. package/build/translations/fr.js +1 -1
  24. package/build/translations/gl.js +1 -1
  25. package/build/translations/he.js +1 -1
  26. package/build/translations/hi.js +1 -1
  27. package/build/translations/hr.js +1 -1
  28. package/build/translations/hu.js +1 -1
  29. package/build/translations/id.js +1 -1
  30. package/build/translations/it.js +1 -1
  31. package/build/translations/ja.js +1 -1
  32. package/build/translations/jv.js +1 -1
  33. package/build/translations/km.js +1 -1
  34. package/build/translations/kn.js +1 -1
  35. package/build/translations/ko.js +1 -1
  36. package/build/translations/ku.js +1 -1
  37. package/build/translations/lt.js +1 -1
  38. package/build/translations/lv.js +1 -1
  39. package/build/translations/ms.js +1 -1
  40. package/build/translations/nb.js +1 -1
  41. package/build/translations/ne.js +1 -1
  42. package/build/translations/nl.js +1 -1
  43. package/build/translations/no.js +1 -1
  44. package/build/translations/pl.js +1 -1
  45. package/build/translations/pt-br.js +1 -1
  46. package/build/translations/pt.js +1 -1
  47. package/build/translations/ro.js +1 -1
  48. package/build/translations/ru.js +1 -1
  49. package/build/translations/si.js +1 -1
  50. package/build/translations/sk.js +1 -1
  51. package/build/translations/sq.js +1 -1
  52. package/build/translations/sr-latn.js +1 -1
  53. package/build/translations/sr.js +1 -1
  54. package/build/translations/sv.js +1 -1
  55. package/build/translations/th.js +1 -1
  56. package/build/translations/ti.js +1 -0
  57. package/build/translations/tk.js +1 -1
  58. package/build/translations/tr.js +1 -1
  59. package/build/translations/tt.js +1 -1
  60. package/build/translations/ug.js +1 -1
  61. package/build/translations/uk.js +1 -1
  62. package/build/translations/ur.js +1 -1
  63. package/build/translations/uz.js +1 -1
  64. package/build/translations/vi.js +1 -1
  65. package/build/translations/zh-cn.js +1 -1
  66. package/build/translations/zh.js +1 -1
  67. package/ckeditor5-metadata.json +1 -1
  68. package/dist/index-content.css +105 -0
  69. package/dist/index-editor.css +129 -0
  70. package/dist/index.css +562 -0
  71. package/dist/index.css.map +1 -0
  72. package/dist/index.js +5637 -0
  73. package/dist/index.js.map +1 -0
  74. package/dist/translations/ar.d.ts +8 -0
  75. package/dist/translations/ar.js +5 -0
  76. package/dist/translations/ar.umd.js +11 -0
  77. package/dist/translations/ast.d.ts +8 -0
  78. package/dist/translations/ast.js +5 -0
  79. package/dist/translations/ast.umd.js +11 -0
  80. package/dist/translations/az.d.ts +8 -0
  81. package/dist/translations/az.js +5 -0
  82. package/dist/translations/az.umd.js +11 -0
  83. package/dist/translations/bg.d.ts +8 -0
  84. package/dist/translations/bg.js +5 -0
  85. package/dist/translations/bg.umd.js +11 -0
  86. package/dist/translations/bn.d.ts +8 -0
  87. package/dist/translations/bn.js +5 -0
  88. package/dist/translations/bn.umd.js +11 -0
  89. package/dist/translations/bs.d.ts +8 -0
  90. package/dist/translations/bs.js +5 -0
  91. package/dist/translations/bs.umd.js +11 -0
  92. package/dist/translations/ca.d.ts +8 -0
  93. package/dist/translations/ca.js +5 -0
  94. package/dist/translations/ca.umd.js +11 -0
  95. package/dist/translations/cs.d.ts +8 -0
  96. package/dist/translations/cs.js +5 -0
  97. package/dist/translations/cs.umd.js +11 -0
  98. package/dist/translations/da.d.ts +8 -0
  99. package/dist/translations/da.js +5 -0
  100. package/dist/translations/da.umd.js +11 -0
  101. package/dist/translations/de-ch.d.ts +8 -0
  102. package/dist/translations/de-ch.js +5 -0
  103. package/dist/translations/de-ch.umd.js +11 -0
  104. package/dist/translations/de.d.ts +8 -0
  105. package/dist/translations/de.js +5 -0
  106. package/dist/translations/de.umd.js +11 -0
  107. package/dist/translations/el.d.ts +8 -0
  108. package/dist/translations/el.js +5 -0
  109. package/dist/translations/el.umd.js +11 -0
  110. package/dist/translations/en-au.d.ts +8 -0
  111. package/dist/translations/en-au.js +5 -0
  112. package/dist/translations/en-au.umd.js +11 -0
  113. package/dist/translations/en-gb.d.ts +8 -0
  114. package/dist/translations/en-gb.js +5 -0
  115. package/dist/translations/en-gb.umd.js +11 -0
  116. package/dist/translations/en.d.ts +8 -0
  117. package/dist/translations/en.js +5 -0
  118. package/dist/translations/en.umd.js +11 -0
  119. package/dist/translations/eo.d.ts +8 -0
  120. package/dist/translations/eo.js +5 -0
  121. package/dist/translations/eo.umd.js +11 -0
  122. package/dist/translations/es-co.d.ts +8 -0
  123. package/dist/translations/es-co.js +5 -0
  124. package/dist/translations/es-co.umd.js +11 -0
  125. package/dist/translations/es.d.ts +8 -0
  126. package/dist/translations/es.js +5 -0
  127. package/dist/translations/es.umd.js +11 -0
  128. package/dist/translations/et.d.ts +8 -0
  129. package/dist/translations/et.js +5 -0
  130. package/dist/translations/et.umd.js +11 -0
  131. package/dist/translations/eu.d.ts +8 -0
  132. package/dist/translations/eu.js +5 -0
  133. package/dist/translations/eu.umd.js +11 -0
  134. package/dist/translations/fa.d.ts +8 -0
  135. package/dist/translations/fa.js +5 -0
  136. package/dist/translations/fa.umd.js +11 -0
  137. package/dist/translations/fi.d.ts +8 -0
  138. package/dist/translations/fi.js +5 -0
  139. package/dist/translations/fi.umd.js +11 -0
  140. package/dist/translations/fr.d.ts +8 -0
  141. package/dist/translations/fr.js +5 -0
  142. package/dist/translations/fr.umd.js +11 -0
  143. package/dist/translations/gl.d.ts +8 -0
  144. package/dist/translations/gl.js +5 -0
  145. package/dist/translations/gl.umd.js +11 -0
  146. package/dist/translations/he.d.ts +8 -0
  147. package/dist/translations/he.js +5 -0
  148. package/dist/translations/he.umd.js +11 -0
  149. package/dist/translations/hi.d.ts +8 -0
  150. package/dist/translations/hi.js +5 -0
  151. package/dist/translations/hi.umd.js +11 -0
  152. package/dist/translations/hr.d.ts +8 -0
  153. package/dist/translations/hr.js +5 -0
  154. package/dist/translations/hr.umd.js +11 -0
  155. package/dist/translations/hu.d.ts +8 -0
  156. package/dist/translations/hu.js +5 -0
  157. package/dist/translations/hu.umd.js +11 -0
  158. package/dist/translations/id.d.ts +8 -0
  159. package/dist/translations/id.js +5 -0
  160. package/dist/translations/id.umd.js +11 -0
  161. package/dist/translations/it.d.ts +8 -0
  162. package/dist/translations/it.js +5 -0
  163. package/dist/translations/it.umd.js +11 -0
  164. package/dist/translations/ja.d.ts +8 -0
  165. package/dist/translations/ja.js +5 -0
  166. package/dist/translations/ja.umd.js +11 -0
  167. package/dist/translations/jv.d.ts +8 -0
  168. package/dist/translations/jv.js +5 -0
  169. package/dist/translations/jv.umd.js +11 -0
  170. package/dist/translations/km.d.ts +8 -0
  171. package/dist/translations/km.js +5 -0
  172. package/dist/translations/km.umd.js +11 -0
  173. package/dist/translations/kn.d.ts +8 -0
  174. package/dist/translations/kn.js +5 -0
  175. package/dist/translations/kn.umd.js +11 -0
  176. package/dist/translations/ko.d.ts +8 -0
  177. package/dist/translations/ko.js +5 -0
  178. package/dist/translations/ko.umd.js +11 -0
  179. package/dist/translations/ku.d.ts +8 -0
  180. package/dist/translations/ku.js +5 -0
  181. package/dist/translations/ku.umd.js +11 -0
  182. package/dist/translations/lt.d.ts +8 -0
  183. package/dist/translations/lt.js +5 -0
  184. package/dist/translations/lt.umd.js +11 -0
  185. package/dist/translations/lv.d.ts +8 -0
  186. package/dist/translations/lv.js +5 -0
  187. package/dist/translations/lv.umd.js +11 -0
  188. package/dist/translations/ms.d.ts +8 -0
  189. package/dist/translations/ms.js +5 -0
  190. package/dist/translations/ms.umd.js +11 -0
  191. package/dist/translations/nb.d.ts +8 -0
  192. package/dist/translations/nb.js +5 -0
  193. package/dist/translations/nb.umd.js +11 -0
  194. package/dist/translations/ne.d.ts +8 -0
  195. package/dist/translations/ne.js +5 -0
  196. package/dist/translations/ne.umd.js +11 -0
  197. package/dist/translations/nl.d.ts +8 -0
  198. package/dist/translations/nl.js +5 -0
  199. package/dist/translations/nl.umd.js +11 -0
  200. package/dist/translations/no.d.ts +8 -0
  201. package/dist/translations/no.js +5 -0
  202. package/dist/translations/no.umd.js +11 -0
  203. package/dist/translations/pl.d.ts +8 -0
  204. package/dist/translations/pl.js +5 -0
  205. package/dist/translations/pl.umd.js +11 -0
  206. package/dist/translations/pt-br.d.ts +8 -0
  207. package/dist/translations/pt-br.js +5 -0
  208. package/dist/translations/pt-br.umd.js +11 -0
  209. package/dist/translations/pt.d.ts +8 -0
  210. package/dist/translations/pt.js +5 -0
  211. package/dist/translations/pt.umd.js +11 -0
  212. package/dist/translations/ro.d.ts +8 -0
  213. package/dist/translations/ro.js +5 -0
  214. package/dist/translations/ro.umd.js +11 -0
  215. package/dist/translations/ru.d.ts +8 -0
  216. package/dist/translations/ru.js +5 -0
  217. package/dist/translations/ru.umd.js +11 -0
  218. package/dist/translations/si.d.ts +8 -0
  219. package/dist/translations/si.js +5 -0
  220. package/dist/translations/si.umd.js +11 -0
  221. package/dist/translations/sk.d.ts +8 -0
  222. package/dist/translations/sk.js +5 -0
  223. package/dist/translations/sk.umd.js +11 -0
  224. package/dist/translations/sq.d.ts +8 -0
  225. package/dist/translations/sq.js +5 -0
  226. package/dist/translations/sq.umd.js +11 -0
  227. package/dist/translations/sr-latn.d.ts +8 -0
  228. package/dist/translations/sr-latn.js +5 -0
  229. package/dist/translations/sr-latn.umd.js +11 -0
  230. package/dist/translations/sr.d.ts +8 -0
  231. package/dist/translations/sr.js +5 -0
  232. package/dist/translations/sr.umd.js +11 -0
  233. package/dist/translations/sv.d.ts +8 -0
  234. package/dist/translations/sv.js +5 -0
  235. package/dist/translations/sv.umd.js +11 -0
  236. package/dist/translations/th.d.ts +8 -0
  237. package/dist/translations/th.js +5 -0
  238. package/dist/translations/th.umd.js +11 -0
  239. package/dist/translations/ti.d.ts +8 -0
  240. package/dist/translations/ti.js +5 -0
  241. package/dist/translations/ti.umd.js +11 -0
  242. package/dist/translations/tk.d.ts +8 -0
  243. package/dist/translations/tk.js +5 -0
  244. package/dist/translations/tk.umd.js +11 -0
  245. package/dist/translations/tr.d.ts +8 -0
  246. package/dist/translations/tr.js +5 -0
  247. package/dist/translations/tr.umd.js +11 -0
  248. package/dist/translations/tt.d.ts +8 -0
  249. package/dist/translations/tt.js +5 -0
  250. package/dist/translations/tt.umd.js +11 -0
  251. package/dist/translations/ug.d.ts +8 -0
  252. package/dist/translations/ug.js +5 -0
  253. package/dist/translations/ug.umd.js +11 -0
  254. package/dist/translations/uk.d.ts +8 -0
  255. package/dist/translations/uk.js +5 -0
  256. package/dist/translations/uk.umd.js +11 -0
  257. package/dist/translations/ur.d.ts +8 -0
  258. package/dist/translations/ur.js +5 -0
  259. package/dist/translations/ur.umd.js +11 -0
  260. package/dist/translations/uz.d.ts +8 -0
  261. package/dist/translations/uz.js +5 -0
  262. package/dist/translations/uz.umd.js +11 -0
  263. package/dist/translations/vi.d.ts +8 -0
  264. package/dist/translations/vi.js +5 -0
  265. package/dist/translations/vi.umd.js +11 -0
  266. package/dist/translations/zh-cn.d.ts +8 -0
  267. package/dist/translations/zh-cn.js +5 -0
  268. package/dist/translations/zh-cn.umd.js +11 -0
  269. package/dist/translations/zh.d.ts +8 -0
  270. package/dist/translations/zh.js +5 -0
  271. package/dist/translations/zh.umd.js +11 -0
  272. package/dist/types/augmentation.d.ts +61 -0
  273. package/dist/types/autoimage.d.ts +56 -0
  274. package/dist/types/image/converters.d.ts +70 -0
  275. package/dist/types/image/imageblockediting.d.ts +63 -0
  276. package/dist/types/image/imageediting.d.ts +34 -0
  277. package/dist/types/image/imageinlineediting.d.ts +64 -0
  278. package/dist/types/image/imageloadobserver.d.ts +52 -0
  279. package/dist/types/image/imageplaceholder.d.ts +43 -0
  280. package/dist/types/image/imagetypecommand.d.ts +48 -0
  281. package/dist/types/image/insertimagecommand.d.ts +70 -0
  282. package/dist/types/image/replaceimagesourcecommand.d.ts +55 -0
  283. package/dist/types/image/ui/utils.d.ts +29 -0
  284. package/dist/types/image/utils.d.ts +68 -0
  285. package/dist/types/image.d.ts +38 -0
  286. package/dist/types/imageblock.d.ts +38 -0
  287. package/dist/types/imagecaption/imagecaptionediting.d.ts +93 -0
  288. package/dist/types/imagecaption/imagecaptionui.d.ts +30 -0
  289. package/dist/types/imagecaption/imagecaptionutils.d.ts +42 -0
  290. package/dist/types/imagecaption/toggleimagecaptioncommand.d.ts +70 -0
  291. package/dist/types/imagecaption.d.ts +30 -0
  292. package/dist/types/imageconfig.d.ts +716 -0
  293. package/dist/types/imageinline.d.ts +38 -0
  294. package/dist/types/imageinsert/imageinsertui.d.ts +78 -0
  295. package/dist/types/imageinsert/imageinsertviaurlui.d.ts +48 -0
  296. package/dist/types/imageinsert/ui/imageinsertformview.d.ts +60 -0
  297. package/dist/types/imageinsert/ui/imageinserturlview.d.ts +111 -0
  298. package/dist/types/imageinsert.d.ts +37 -0
  299. package/dist/types/imageinsertviaurl.d.ts +35 -0
  300. package/dist/types/imageresize/imagecustomresizeui.d.ts +65 -0
  301. package/dist/types/imageresize/imageresizebuttons.d.ts +68 -0
  302. package/dist/types/imageresize/imageresizeediting.d.ts +45 -0
  303. package/dist/types/imageresize/imageresizehandles.d.ts +35 -0
  304. package/dist/types/imageresize/resizeimagecommand.d.ts +46 -0
  305. package/dist/types/imageresize/ui/imagecustomresizeformview.d.ts +133 -0
  306. package/dist/types/imageresize/utils/getselectedimageeditornodes.d.ts +28 -0
  307. package/dist/types/imageresize/utils/getselectedimagepossibleresizerange.d.ts +28 -0
  308. package/dist/types/imageresize/utils/getselectedimagewidthinunits.d.ts +22 -0
  309. package/dist/types/imageresize/utils/tryparsedimensionwithunit.d.ts +41 -0
  310. package/dist/types/imageresize.d.ts +32 -0
  311. package/dist/types/imagesizeattributes.d.ts +38 -0
  312. package/dist/types/imagestyle/converters.d.ts +28 -0
  313. package/dist/types/imagestyle/imagestylecommand.d.ts +72 -0
  314. package/dist/types/imagestyle/imagestyleediting.d.ts +54 -0
  315. package/dist/types/imagestyle/imagestyleui.d.ts +60 -0
  316. package/dist/types/imagestyle/utils.d.ts +105 -0
  317. package/dist/types/imagestyle.d.ts +36 -0
  318. package/dist/types/imagetextalternative/imagetextalternativecommand.d.ts +38 -0
  319. package/dist/types/imagetextalternative/imagetextalternativeediting.d.ts +32 -0
  320. package/dist/types/imagetextalternative/imagetextalternativeui.d.ts +72 -0
  321. package/dist/types/imagetextalternative/ui/textalternativeformview.d.ts +94 -0
  322. package/dist/types/imagetextalternative.d.ts +33 -0
  323. package/dist/types/imagetoolbar.d.ts +39 -0
  324. package/dist/types/imageupload/imageuploadediting.d.ts +115 -0
  325. package/dist/types/imageupload/imageuploadprogress.d.ts +46 -0
  326. package/dist/types/imageupload/imageuploadui.d.ts +34 -0
  327. package/dist/types/imageupload/uploadimagecommand.d.ts +64 -0
  328. package/dist/types/imageupload/utils.d.ts +37 -0
  329. package/dist/types/imageupload.d.ts +36 -0
  330. package/dist/types/imageutils.d.ts +129 -0
  331. package/dist/types/index.d.ts +53 -0
  332. package/dist/types/pictureediting.d.ts +92 -0
  333. package/lang/contexts.json +9 -1
  334. package/lang/translations/ar.po +32 -0
  335. package/lang/translations/ast.po +32 -0
  336. package/lang/translations/az.po +32 -0
  337. package/lang/translations/bg.po +32 -0
  338. package/lang/translations/bn.po +32 -0
  339. package/lang/translations/bs.po +32 -0
  340. package/lang/translations/ca.po +32 -0
  341. package/lang/translations/cs.po +32 -0
  342. package/lang/translations/da.po +32 -0
  343. package/lang/translations/de-ch.po +32 -0
  344. package/lang/translations/de.po +32 -0
  345. package/lang/translations/el.po +32 -0
  346. package/lang/translations/en-au.po +32 -0
  347. package/lang/translations/en-gb.po +32 -0
  348. package/lang/translations/en.po +32 -0
  349. package/lang/translations/eo.po +32 -0
  350. package/lang/translations/es-co.po +32 -0
  351. package/lang/translations/es.po +32 -0
  352. package/lang/translations/et.po +32 -0
  353. package/lang/translations/eu.po +32 -0
  354. package/lang/translations/fa.po +32 -0
  355. package/lang/translations/fi.po +32 -0
  356. package/lang/translations/fr.po +32 -0
  357. package/lang/translations/gl.po +32 -0
  358. package/lang/translations/he.po +32 -0
  359. package/lang/translations/hi.po +32 -0
  360. package/lang/translations/hr.po +32 -0
  361. package/lang/translations/hu.po +32 -0
  362. package/lang/translations/id.po +32 -0
  363. package/lang/translations/it.po +32 -0
  364. package/lang/translations/ja.po +32 -0
  365. package/lang/translations/jv.po +32 -0
  366. package/lang/translations/km.po +32 -0
  367. package/lang/translations/kn.po +32 -0
  368. package/lang/translations/ko.po +32 -0
  369. package/lang/translations/ku.po +32 -0
  370. package/lang/translations/lt.po +32 -0
  371. package/lang/translations/lv.po +32 -0
  372. package/lang/translations/ms.po +32 -0
  373. package/lang/translations/nb.po +32 -0
  374. package/lang/translations/ne.po +32 -0
  375. package/lang/translations/nl.po +32 -0
  376. package/lang/translations/no.po +32 -0
  377. package/lang/translations/pl.po +32 -0
  378. package/lang/translations/pt-br.po +32 -0
  379. package/lang/translations/pt.po +32 -0
  380. package/lang/translations/ro.po +32 -0
  381. package/lang/translations/ru.po +32 -0
  382. package/lang/translations/si.po +32 -0
  383. package/lang/translations/sk.po +32 -0
  384. package/lang/translations/sq.po +32 -0
  385. package/lang/translations/sr-latn.po +32 -0
  386. package/lang/translations/sr.po +32 -0
  387. package/lang/translations/sv.po +32 -0
  388. package/lang/translations/th.po +32 -0
  389. package/lang/translations/ti.po +178 -0
  390. package/lang/translations/tk.po +32 -0
  391. package/lang/translations/tr.po +32 -0
  392. package/lang/translations/tt.po +32 -0
  393. package/lang/translations/ug.po +32 -0
  394. package/lang/translations/uk.po +32 -0
  395. package/lang/translations/ur.po +32 -0
  396. package/lang/translations/uz.po +32 -0
  397. package/lang/translations/vi.po +32 -0
  398. package/lang/translations/zh-cn.po +32 -0
  399. package/lang/translations/zh.po +32 -0
  400. package/package.json +4 -3
  401. package/src/augmentation.d.ts +2 -1
  402. package/src/imageresize/imagecustomresizeui.d.ts +61 -0
  403. package/src/imageresize/imagecustomresizeui.js +168 -0
  404. package/src/imageresize/imageresizebuttons.d.ts +0 -3
  405. package/src/imageresize/imageresizebuttons.js +95 -23
  406. package/src/imageresize/imageresizeediting.js +9 -2
  407. package/src/imageresize/imageresizehandles.js +1 -2
  408. package/src/imageresize/ui/imagecustomresizeformview.d.ts +129 -0
  409. package/src/imageresize/ui/imagecustomresizeformview.js +186 -0
  410. package/src/imageresize/utils/getselectedimageeditornodes.d.ts +24 -0
  411. package/src/imageresize/utils/getselectedimageeditornodes.js +24 -0
  412. package/src/imageresize/utils/getselectedimagepossibleresizerange.d.ts +24 -0
  413. package/src/imageresize/utils/getselectedimagepossibleresizerange.js +32 -0
  414. package/src/imageresize/utils/getselectedimagewidthinunits.d.ts +18 -0
  415. package/src/imageresize/utils/getselectedimagewidthinunits.js +41 -0
  416. package/src/imageresize/utils/tryparsedimensionwithunit.d.ts +37 -0
  417. package/src/imageresize/utils/tryparsedimensionwithunit.js +56 -0
  418. package/src/imageresize.d.ts +2 -1
  419. package/src/imageresize.js +2 -1
  420. package/src/imageupload/imageuploadediting.js +9 -0
  421. package/src/index.d.ts +1 -0
  422. package/src/index.js +1 -0
  423. package/theme/imagecaption.css +15 -1
  424. package/theme/imagecustomresizeform.css +33 -0
@@ -0,0 +1,36 @@
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 image/imagestyle
11
+ */
12
+ import { Plugin } from 'ckeditor5/src/core.js';
13
+ import ImageStyleEditing from './imagestyle/imagestyleediting.js';
14
+ import ImageStyleUI from './imagestyle/imagestyleui.js';
15
+ /**
16
+ * The image style plugin.
17
+ *
18
+ * For a detailed overview of the image styles feature, check the {@glink features/images/images-styles documentation}.
19
+ *
20
+ * This is a "glue" plugin which loads the following plugins:
21
+ * * {@link module:image/imagestyle/imagestyleediting~ImageStyleEditing},
22
+ * * {@link module:image/imagestyle/imagestyleui~ImageStyleUI}
23
+ *
24
+ * It provides a default configuration, which can be extended or overwritten.
25
+ * Read more about the {@link module:image/imageconfig~ImageConfig#styles image styles configuration}.
26
+ */
27
+ export default class ImageStyle extends Plugin {
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ static get requires(): readonly [typeof ImageStyleEditing, typeof ImageStyleUI];
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ static get pluginName(): "ImageStyle";
36
+ }
@@ -0,0 +1,38 @@
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 image/imagetextalternative/imagetextalternativecommand
11
+ */
12
+ import { Command } from 'ckeditor5/src/core.js';
13
+ /**
14
+ * The image text alternative command. It is used to change the `alt` attribute of `<imageBlock>` and `<imageInline>` model elements.
15
+ */
16
+ export default class ImageTextAlternativeCommand extends Command {
17
+ /**
18
+ * The command value: `false` if there is no `alt` attribute, otherwise the value of the `alt` attribute.
19
+ *
20
+ * @readonly
21
+ * @observable
22
+ */
23
+ value: string | false;
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ refresh(): void;
28
+ /**
29
+ * Executes the command.
30
+ *
31
+ * @fires execute
32
+ * @param options
33
+ * @param options.newValue The new value of the `alt` attribute to set.
34
+ */
35
+ execute(options: {
36
+ newValue: string;
37
+ }): void;
38
+ }
@@ -0,0 +1,32 @@
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 image/imagetextalternative/imagetextalternativeediting
11
+ */
12
+ import { Plugin } from 'ckeditor5/src/core.js';
13
+ import ImageUtils from '../imageutils.js';
14
+ /**
15
+ * The image text alternative editing plugin.
16
+ *
17
+ * Registers the `'imageTextAlternative'` command.
18
+ */
19
+ export default class ImageTextAlternativeEditing extends Plugin {
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ static get requires(): readonly [typeof ImageUtils];
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get pluginName(): "ImageTextAlternativeEditing";
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ init(): void;
32
+ }
@@ -0,0 +1,72 @@
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 image/imagetextalternative/imagetextalternativeui
11
+ */
12
+ import { Plugin } from 'ckeditor5/src/core.js';
13
+ import { ContextualBalloon } from 'ckeditor5/src/ui.js';
14
+ /**
15
+ * The image text alternative UI plugin.
16
+ *
17
+ * The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
18
+ */
19
+ export default class ImageTextAlternativeUI extends Plugin {
20
+ /**
21
+ * The contextual balloon plugin instance.
22
+ */
23
+ private _balloon?;
24
+ /**
25
+ * A form containing a textarea and buttons, used to change the `alt` text value.
26
+ */
27
+ private _form?;
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ static get requires(): readonly [typeof ContextualBalloon];
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ static get pluginName(): "ImageTextAlternativeUI";
36
+ /**
37
+ * @inheritDoc
38
+ */
39
+ init(): void;
40
+ /**
41
+ * @inheritDoc
42
+ */
43
+ destroy(): void;
44
+ /**
45
+ * Creates a button showing the balloon panel for changing the image text alternative and
46
+ * registers it in the editor {@link module:ui/componentfactory~ComponentFactory ComponentFactory}.
47
+ */
48
+ private _createButton;
49
+ /**
50
+ * Creates the {@link module:image/imagetextalternative/ui/textalternativeformview~TextAlternativeFormView}
51
+ * form.
52
+ */
53
+ private _createForm;
54
+ /**
55
+ * Shows the {@link #_form} in the {@link #_balloon}.
56
+ */
57
+ private _showForm;
58
+ /**
59
+ * Removes the {@link #_form} from the {@link #_balloon}.
60
+ *
61
+ * @param focusEditable Controls whether the editing view is focused afterwards.
62
+ */
63
+ private _hideForm;
64
+ /**
65
+ * Returns `true` when the {@link #_form} is the visible view in the {@link #_balloon}.
66
+ */
67
+ private get _isVisible();
68
+ /**
69
+ * Returns `true` when the {@link #_form} is in the {@link #_balloon}.
70
+ */
71
+ private get _isInBalloon();
72
+ }
@@ -0,0 +1,94 @@
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 image/imagetextalternative/ui/textalternativeformview
11
+ */
12
+ import { ButtonView, FocusCycler, LabeledFieldView, View, ViewCollection, type InputView, type FocusableView } from 'ckeditor5/src/ui.js';
13
+ import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
14
+ import '../../../theme/textalternativeform.css';
15
+ import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
16
+ /**
17
+ * The TextAlternativeFormView class.
18
+ */
19
+ export default class TextAlternativeFormView extends View {
20
+ /**
21
+ * Tracks information about the DOM focus in the form.
22
+ */
23
+ readonly focusTracker: FocusTracker;
24
+ /**
25
+ * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
26
+ */
27
+ readonly keystrokes: KeystrokeHandler;
28
+ /**
29
+ * An input with a label.
30
+ */
31
+ labeledInput: LabeledFieldView<InputView>;
32
+ /**
33
+ * A button used to submit the form.
34
+ */
35
+ saveButtonView: ButtonView;
36
+ /**
37
+ * A button used to cancel the form.
38
+ */
39
+ cancelButtonView: ButtonView;
40
+ /**
41
+ * A collection of views which can be focused in the form.
42
+ */
43
+ protected readonly _focusables: ViewCollection<FocusableView>;
44
+ /**
45
+ * Helps cycling over {@link #_focusables} in the form.
46
+ */
47
+ protected readonly _focusCycler: FocusCycler;
48
+ /**
49
+ * @inheritDoc
50
+ */
51
+ constructor(locale: Locale);
52
+ /**
53
+ * @inheritDoc
54
+ */
55
+ render(): void;
56
+ /**
57
+ * @inheritDoc
58
+ */
59
+ destroy(): void;
60
+ /**
61
+ * Creates the button view.
62
+ *
63
+ * @param label The button label
64
+ * @param icon The button's icon.
65
+ * @param className The additional button CSS class name.
66
+ * @param eventName The event name that the ButtonView#execute event will be delegated to.
67
+ * @returns The button view instance.
68
+ */
69
+ private _createButton;
70
+ /**
71
+ * Creates an input with a label.
72
+ *
73
+ * @returns Labeled field view instance.
74
+ */
75
+ private _createLabeledInputView;
76
+ }
77
+ /**
78
+ * Fired when the form view is submitted.
79
+ *
80
+ * @eventName ~TextAlternativeFormView#submit
81
+ */
82
+ export type TextAlternativeFormViewSubmitEvent = {
83
+ name: 'submit';
84
+ args: [];
85
+ };
86
+ /**
87
+ * Fired when the form view is canceled.
88
+ *
89
+ * @eventName ~TextAlternativeFormView#cancel
90
+ */
91
+ export type TextAlternativeFormViewCancelEvent = {
92
+ name: 'cancel';
93
+ args: [];
94
+ };
@@ -0,0 +1,33 @@
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 image/imagetextalternative
11
+ */
12
+ import { Plugin } from 'ckeditor5/src/core.js';
13
+ import ImageTextAlternativeEditing from './imagetextalternative/imagetextalternativeediting.js';
14
+ import ImageTextAlternativeUI from './imagetextalternative/imagetextalternativeui.js';
15
+ /**
16
+ * The image text alternative plugin.
17
+ *
18
+ * For a detailed overview, check the {@glink features/images/images-styles image styles} documentation.
19
+ *
20
+ * This is a "glue" plugin which loads the
21
+ * {@link module:image/imagetextalternative/imagetextalternativeediting~ImageTextAlternativeEditing}
22
+ * and {@link module:image/imagetextalternative/imagetextalternativeui~ImageTextAlternativeUI} plugins.
23
+ */
24
+ export default class ImageTextAlternative extends Plugin {
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ static get requires(): readonly [typeof ImageTextAlternativeEditing, typeof ImageTextAlternativeUI];
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ static get pluginName(): "ImageTextAlternative";
33
+ }
@@ -0,0 +1,39 @@
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 image/imagetoolbar
11
+ */
12
+ import { Plugin } from 'ckeditor5/src/core.js';
13
+ import { WidgetToolbarRepository } from 'ckeditor5/src/widget.js';
14
+ import ImageUtils from './imageutils.js';
15
+ /**
16
+ * The image toolbar plugin. It creates and manages the image toolbar (the toolbar displayed when an image is selected).
17
+ *
18
+ * For an overview, check the {@glink features/images/images-overview#image-contextual-toolbar image contextual toolbar} documentation.
19
+ *
20
+ * Instances of toolbar components (e.g. buttons) are created using the editor's
21
+ * {@link module:ui/componentfactory~ComponentFactory component factory}
22
+ * based on the {@link module:image/imageconfig~ImageConfig#toolbar `image.toolbar` configuration option}.
23
+ *
24
+ * The toolbar uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
25
+ */
26
+ export default class ImageToolbar extends Plugin {
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ static get requires(): readonly [typeof WidgetToolbarRepository, typeof ImageUtils];
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ static get pluginName(): "ImageToolbar";
35
+ /**
36
+ * @inheritDoc
37
+ */
38
+ afterInit(): void;
39
+ }
@@ -0,0 +1,115 @@
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 image/imageupload/imageuploadediting
11
+ */
12
+ import { Plugin, type Editor } from 'ckeditor5/src/core.js';
13
+ import { type Element, type Writer, type DataTransfer } from 'ckeditor5/src/engine.js';
14
+ import { Notification } from 'ckeditor5/src/ui.js';
15
+ import { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';
16
+ import { FileRepository, type UploadResponse, type FileLoader } from 'ckeditor5/src/upload.js';
17
+ import ImageUtils from '../imageutils.js';
18
+ /**
19
+ * The editing part of the image upload feature. It registers the `'uploadImage'` command
20
+ * and the `imageUpload` command as an aliased name.
21
+ *
22
+ * When an image is uploaded, it fires the {@link ~ImageUploadEditing#event:uploadComplete `uploadComplete`} event
23
+ * that allows adding custom attributes to the {@link module:engine/model/element~Element image element}.
24
+ */
25
+ export default class ImageUploadEditing extends Plugin {
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ static get requires(): readonly [typeof FileRepository, typeof Notification, typeof ClipboardPipeline, typeof ImageUtils];
30
+ static get pluginName(): "ImageUploadEditing";
31
+ /**
32
+ * An internal mapping of {@link module:upload/filerepository~FileLoader#id file loader UIDs} and
33
+ * model elements during the upload.
34
+ *
35
+ * Model element of the uploaded image can change, for instance, when {@link module:image/image/imagetypecommand~ImageTypeCommand}
36
+ * is executed as a result of adding caption or changing image style. As a result, the upload logic must keep track of the model
37
+ * element (reference) and resolve the upload for the correct model element (instead of the one that landed in the `$graveyard`
38
+ * after image type changed).
39
+ */
40
+ private readonly _uploadImageElements;
41
+ /**
42
+ * @inheritDoc
43
+ */
44
+ constructor(editor: Editor);
45
+ /**
46
+ * @inheritDoc
47
+ */
48
+ init(): void;
49
+ /**
50
+ * @inheritDoc
51
+ */
52
+ afterInit(): void;
53
+ /**
54
+ * Reads and uploads an image.
55
+ *
56
+ * The image is read from the disk and as a Base64-encoded string it is set temporarily to
57
+ * `image[src]`. When the image is successfully uploaded, the temporary data is replaced with the target
58
+ * image's URL (the URL to the uploaded image on the server).
59
+ */
60
+ protected _readAndUpload(loader: FileLoader): Promise<void>;
61
+ /**
62
+ * Creates the `srcset` attribute based on a given file upload response and sets it as an attribute to a specific image element.
63
+ *
64
+ * @param data Data object from which `srcset` will be created.
65
+ * @param image The image element on which the `srcset` attribute will be set.
66
+ */
67
+ protected _parseAndSetSrcsetAttributeOnImage(data: Record<string, unknown>, image: Element, writer: Writer): void;
68
+ }
69
+ /**
70
+ * Returns `true` if non-empty `text/html` is included in the data transfer.
71
+ */
72
+ export declare function isHtmlIncluded(dataTransfer: DataTransfer): boolean;
73
+ /**
74
+ * An event fired when an image is uploaded. You can hook into this event to provide
75
+ * custom attributes to the {@link module:engine/model/element~Element image element} based on the data from
76
+ * the server.
77
+ *
78
+ * ```ts
79
+ * const imageUploadEditing = editor.plugins.get( 'ImageUploadEditing' );
80
+ *
81
+ * imageUploadEditing.on( 'uploadComplete', ( evt, { data, imageElement } ) => {
82
+ * editor.model.change( writer => {
83
+ * writer.setAttribute( 'someAttribute', 'foo', imageElement );
84
+ * } );
85
+ * } );
86
+ * ```
87
+ *
88
+ * You can also stop the default handler that sets the `src` and `srcset` attributes
89
+ * if you want to provide custom values for these attributes.
90
+ *
91
+ * ```ts
92
+ * imageUploadEditing.on( 'uploadComplete', ( evt, { data, imageElement } ) => {
93
+ * evt.stop();
94
+ * } );
95
+ * ```
96
+ *
97
+ * **Note**: This event is fired by the {@link module:image/imageupload/imageuploadediting~ImageUploadEditing} plugin.
98
+ *
99
+ * @eventName ~ImageUploadEditing#uploadComplete
100
+ * @param data The `uploadComplete` event data.
101
+ */
102
+ export type ImageUploadCompleteEvent = {
103
+ name: 'uploadComplete';
104
+ args: [data: ImageUploadCompleteData];
105
+ };
106
+ export type ImageUploadCompleteData = {
107
+ /**
108
+ * The data coming from the upload adapter.
109
+ */
110
+ data: UploadResponse;
111
+ /**
112
+ * The model {@link module:engine/model/element~Element image element} that can be customized.
113
+ */
114
+ imageElement: Element;
115
+ };
@@ -0,0 +1,46 @@
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 image/imageupload/imageuploadprogress
11
+ */
12
+ import { type Editor, Plugin } from 'ckeditor5/src/core.js';
13
+ import '../../theme/imageuploadprogress.css';
14
+ import '../../theme/imageuploadicon.css';
15
+ import '../../theme/imageuploadloader.css';
16
+ /**
17
+ * The image upload progress plugin.
18
+ * It shows a placeholder when the image is read from the disk and a progress bar while the image is uploading.
19
+ */
20
+ export default class ImageUploadProgress extends Plugin {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get pluginName(): "ImageUploadProgress";
25
+ /**
26
+ * The image placeholder that is displayed before real image data can be accessed.
27
+ *
28
+ * For the record, this image is a 1x1 px GIF with an aspect ratio set by CSS.
29
+ */
30
+ private placeholder;
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ constructor(editor: Editor);
35
+ /**
36
+ * @inheritDoc
37
+ */
38
+ init(): void;
39
+ /**
40
+ * This method is called each time the image `uploadStatus` attribute is changed.
41
+ *
42
+ * @param evt An object containing information about the fired event.
43
+ * @param data Additional information about the change.
44
+ */
45
+ private uploadStatusChange;
46
+ }
@@ -0,0 +1,34 @@
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 image/imageupload/imageuploadui
11
+ */
12
+ import { Plugin } from 'ckeditor5/src/core.js';
13
+ /**
14
+ * The image upload button plugin.
15
+ *
16
+ * For a detailed overview, check the {@glink features/images/image-upload/image-upload Image upload feature} documentation.
17
+ *
18
+ * Adds the `'uploadImage'` button to the {@link module:ui/componentfactory~ComponentFactory UI component factory}
19
+ * and also the `imageUpload` button as an alias for backward compatibility.
20
+ */
21
+ export default class ImageUploadUI extends Plugin {
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ static get pluginName(): "ImageUploadUI";
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ init(): void;
30
+ /**
31
+ * Creates a button for image upload command to use either in toolbar or in menu bar.
32
+ */
33
+ private _createButton;
34
+ }
@@ -0,0 +1,64 @@
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 { Command } from 'ckeditor5/src/core.js';
10
+ import { type ArrayOrItem } from 'ckeditor5/src/utils.js';
11
+ /**
12
+ * @module image/imageupload/uploadimagecommand
13
+ */
14
+ /**
15
+ * The upload image command.
16
+ *
17
+ * The command is registered by the {@link module:image/imageupload/imageuploadediting~ImageUploadEditing} plugin as `uploadImage`
18
+ * and it is also available via aliased `imageUpload` name.
19
+ *
20
+ * In order to upload an image at the current selection position
21
+ * (according to the {@link module:widget/utils~findOptimalInsertionRange} algorithm),
22
+ * execute the command and pass the native image file instance:
23
+ *
24
+ * ```ts
25
+ * this.listenTo( editor.editing.view.document, 'clipboardInput', ( evt, data ) => {
26
+ * // Assuming that only images were pasted:
27
+ * const images = Array.from( data.dataTransfer.files );
28
+ *
29
+ * // Upload the first image:
30
+ * editor.execute( 'uploadImage', { file: images[ 0 ] } );
31
+ * } );
32
+ * ```
33
+ *
34
+ * It is also possible to insert multiple images at once:
35
+ *
36
+ * ```ts
37
+ * editor.execute( 'uploadImage', {
38
+ * file: [
39
+ * file1,
40
+ * file2
41
+ * ]
42
+ * } );
43
+ * ```
44
+ */
45
+ export default class UploadImageCommand extends Command {
46
+ /**
47
+ * @inheritDoc
48
+ */
49
+ refresh(): void;
50
+ /**
51
+ * Executes the command.
52
+ *
53
+ * @fires execute
54
+ * @param options Options for the executed command.
55
+ * @param options.file The image file or an array of image files to upload.
56
+ */
57
+ execute(options: {
58
+ file: ArrayOrItem<File>;
59
+ }): void;
60
+ /**
61
+ * Handles uploading single file.
62
+ */
63
+ private _uploadImage;
64
+ }
@@ -0,0 +1,37 @@
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 image/imageupload/utils
11
+ */
12
+ import type { ViewElement } from 'ckeditor5/src/engine.js';
13
+ import type ImageUtils from '../imageutils.js';
14
+ /**
15
+ * Creates a regular expression used to test for image files.
16
+ *
17
+ * ```ts
18
+ * const imageType = createImageTypeRegExp( [ 'png', 'jpeg', 'svg+xml', 'vnd.microsoft.icon' ] );
19
+ *
20
+ * console.log( 'is supported image', imageType.test( file.type ) );
21
+ * ```
22
+ */
23
+ export declare function createImageTypeRegExp(types: Array<string>): RegExp;
24
+ /**
25
+ * Creates a promise that fetches the image local source (Base64 or blob) and resolves with a `File` object.
26
+ *
27
+ * @param image Image whose source to fetch.
28
+ * @returns A promise which resolves when an image source is fetched and converted to a `File` instance.
29
+ * It resolves with a `File` object. If there were any errors during file processing, the promise will be rejected.
30
+ */
31
+ export declare function fetchLocalImage(image: ViewElement): Promise<File>;
32
+ /**
33
+ * Checks whether a given node is an image element with a local source (Base64 or blob).
34
+ *
35
+ * @param node The node to check.
36
+ */
37
+ export declare function isLocalImage(imageUtils: ImageUtils, node: ViewElement): boolean;