@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
@@ -113,10 +113,22 @@ msgctxt "The accessibility label of the standalone image resize reset option but
113
113
  msgid "Resize image to the original size"
114
114
  msgstr ""
115
115
 
116
+ msgctxt "The label for image resize balloon input."
117
+ msgid "Resize image (in %0)"
118
+ msgstr ""
119
+
116
120
  msgctxt "The default label for the resize option that resets the size of the image."
117
121
  msgid "Original"
118
122
  msgstr ""
119
123
 
124
+ msgctxt "The accessibility label of the standalone image resize custom option button in the image toolbar for screen readers."
125
+ msgid "Custom image size"
126
+ msgstr ""
127
+
128
+ msgctxt "The label for the resize option that allows user to enter custom size of the image."
129
+ msgid "Custom"
130
+ msgstr ""
131
+
120
132
  msgctxt "The accessibility label of the image resize dropdown for screen readers."
121
133
  msgid "Image resize list"
122
134
  msgstr ""
@@ -144,3 +156,23 @@ msgstr ""
144
156
  msgctxt "Text used by screen readers do describe an image when there is a text alternative available, e.g. 'Caption for image: this is a description of the image.'"
145
157
  msgid "Caption for image: %0"
146
158
  msgstr ""
159
+
160
+ msgctxt "Text used as error label when user submitted custom image resize form with blank value."
161
+ msgid "The value must not be empty."
162
+ msgstr ""
163
+
164
+ msgctxt "Text used as error label when user submitted custom image resize form with incorrect value."
165
+ msgid "The value should be a plain number."
166
+ msgstr ""
167
+
168
+ msgctxt "Aria status message indicating that the image is being uploaded. Example: 'Uploading image'."
169
+ msgid "Uploading image"
170
+ msgstr ""
171
+
172
+ msgctxt "Aria status message indicating that the image has been uploaded successfully. Example: 'Image upload complete'."
173
+ msgid "Image upload complete"
174
+ msgstr ""
175
+
176
+ msgctxt "Aria status message indicating that an error has occurred during image upload. Example: 'Error during image upload'."
177
+ msgid "Error during image upload"
178
+ msgstr ""
@@ -113,10 +113,22 @@ msgctxt "The accessibility label of the standalone image resize reset option but
113
113
  msgid "Resize image to the original size"
114
114
  msgstr "Розтягнути зображення до оригінального розміру"
115
115
 
116
+ msgctxt "The label for image resize balloon input."
117
+ msgid "Resize image (in %0)"
118
+ msgstr "Змінити розмір зображення (у %0)"
119
+
116
120
  msgctxt "The default label for the resize option that resets the size of the image."
117
121
  msgid "Original"
118
122
  msgstr "Оригінал"
119
123
 
124
+ msgctxt "The accessibility label of the standalone image resize custom option button in the image toolbar for screen readers."
125
+ msgid "Custom image size"
126
+ msgstr "Власний розмір зображення"
127
+
128
+ msgctxt "The label for the resize option that allows user to enter custom size of the image."
129
+ msgid "Custom"
130
+ msgstr "Власний"
131
+
120
132
  msgctxt "The accessibility label of the image resize dropdown for screen readers."
121
133
  msgid "Image resize list"
122
134
  msgstr "Перелік розмірів"
@@ -144,3 +156,23 @@ msgstr "Підпис до зображення"
144
156
  msgctxt "Text used by screen readers do describe an image when there is a text alternative available, e.g. 'Caption for image: this is a description of the image.'"
145
157
  msgid "Caption for image: %0"
146
158
  msgstr "Підпис до зображення: %0"
159
+
160
+ msgctxt "Text used as error label when user submitted custom image resize form with blank value."
161
+ msgid "The value must not be empty."
162
+ msgstr "Значення не може бути порожнім."
163
+
164
+ msgctxt "Text used as error label when user submitted custom image resize form with incorrect value."
165
+ msgid "The value should be a plain number."
166
+ msgstr "Значення має виражатись простим числом."
167
+
168
+ msgctxt "Aria status message indicating that the image is being uploaded. Example: 'Uploading image'."
169
+ msgid "Uploading image"
170
+ msgstr "Зображення завантажується"
171
+
172
+ msgctxt "Aria status message indicating that the image has been uploaded successfully. Example: 'Image upload complete'."
173
+ msgid "Image upload complete"
174
+ msgstr "Завантаження зображення завершено"
175
+
176
+ msgctxt "Aria status message indicating that an error has occurred during image upload. Example: 'Error during image upload'."
177
+ msgid "Error during image upload"
178
+ msgstr "Під час завантаження зображення сталася помилка"
@@ -113,10 +113,22 @@ msgctxt "The accessibility label of the standalone image resize reset option but
113
113
  msgid "Resize image to the original size"
114
114
  msgstr ""
115
115
 
116
+ msgctxt "The label for image resize balloon input."
117
+ msgid "Resize image (in %0)"
118
+ msgstr ""
119
+
116
120
  msgctxt "The default label for the resize option that resets the size of the image."
117
121
  msgid "Original"
118
122
  msgstr ""
119
123
 
124
+ msgctxt "The accessibility label of the standalone image resize custom option button in the image toolbar for screen readers."
125
+ msgid "Custom image size"
126
+ msgstr ""
127
+
128
+ msgctxt "The label for the resize option that allows user to enter custom size of the image."
129
+ msgid "Custom"
130
+ msgstr ""
131
+
120
132
  msgctxt "The accessibility label of the image resize dropdown for screen readers."
121
133
  msgid "Image resize list"
122
134
  msgstr ""
@@ -144,3 +156,23 @@ msgstr ""
144
156
  msgctxt "Text used by screen readers do describe an image when there is a text alternative available, e.g. 'Caption for image: this is a description of the image.'"
145
157
  msgid "Caption for image: %0"
146
158
  msgstr ""
159
+
160
+ msgctxt "Text used as error label when user submitted custom image resize form with blank value."
161
+ msgid "The value must not be empty."
162
+ msgstr ""
163
+
164
+ msgctxt "Text used as error label when user submitted custom image resize form with incorrect value."
165
+ msgid "The value should be a plain number."
166
+ msgstr ""
167
+
168
+ msgctxt "Aria status message indicating that the image is being uploaded. Example: 'Uploading image'."
169
+ msgid "Uploading image"
170
+ msgstr ""
171
+
172
+ msgctxt "Aria status message indicating that the image has been uploaded successfully. Example: 'Image upload complete'."
173
+ msgid "Image upload complete"
174
+ msgstr ""
175
+
176
+ msgctxt "Aria status message indicating that an error has occurred during image upload. Example: 'Error during image upload'."
177
+ msgid "Error during image upload"
178
+ msgstr ""
@@ -113,10 +113,22 @@ msgctxt "The accessibility label of the standalone image resize reset option but
113
113
  msgid "Resize image to the original size"
114
114
  msgstr "Rasmning o'lchamini asl o'lchamiga o'zgartiring"
115
115
 
116
+ msgctxt "The label for image resize balloon input."
117
+ msgid "Resize image (in %0)"
118
+ msgstr ""
119
+
116
120
  msgctxt "The default label for the resize option that resets the size of the image."
117
121
  msgid "Original"
118
122
  msgstr "Asl"
119
123
 
124
+ msgctxt "The accessibility label of the standalone image resize custom option button in the image toolbar for screen readers."
125
+ msgid "Custom image size"
126
+ msgstr ""
127
+
128
+ msgctxt "The label for the resize option that allows user to enter custom size of the image."
129
+ msgid "Custom"
130
+ msgstr ""
131
+
120
132
  msgctxt "The accessibility label of the image resize dropdown for screen readers."
121
133
  msgid "Image resize list"
122
134
  msgstr "Hajmlar ro'yxati"
@@ -144,3 +156,23 @@ msgstr ""
144
156
  msgctxt "Text used by screen readers do describe an image when there is a text alternative available, e.g. 'Caption for image: this is a description of the image.'"
145
157
  msgid "Caption for image: %0"
146
158
  msgstr ""
159
+
160
+ msgctxt "Text used as error label when user submitted custom image resize form with blank value."
161
+ msgid "The value must not be empty."
162
+ msgstr ""
163
+
164
+ msgctxt "Text used as error label when user submitted custom image resize form with incorrect value."
165
+ msgid "The value should be a plain number."
166
+ msgstr ""
167
+
168
+ msgctxt "Aria status message indicating that the image is being uploaded. Example: 'Uploading image'."
169
+ msgid "Uploading image"
170
+ msgstr ""
171
+
172
+ msgctxt "Aria status message indicating that the image has been uploaded successfully. Example: 'Image upload complete'."
173
+ msgid "Image upload complete"
174
+ msgstr ""
175
+
176
+ msgctxt "Aria status message indicating that an error has occurred during image upload. Example: 'Error during image upload'."
177
+ msgid "Error during image upload"
178
+ msgstr ""
@@ -113,10 +113,22 @@ msgctxt "The accessibility label of the standalone image resize reset option but
113
113
  msgid "Resize image to the original size"
114
114
  msgstr "Chỉnh về ảnh kích cỡ nguyên gốc"
115
115
 
116
+ msgctxt "The label for image resize balloon input."
117
+ msgid "Resize image (in %0)"
118
+ msgstr "Đặt lại kích thước hình ảnh (bằng %0)"
119
+
116
120
  msgctxt "The default label for the resize option that resets the size of the image."
117
121
  msgid "Original"
118
122
  msgstr "Nguyên bản"
119
123
 
124
+ msgctxt "The accessibility label of the standalone image resize custom option button in the image toolbar for screen readers."
125
+ msgid "Custom image size"
126
+ msgstr "Tùy chỉnh kích thước hình ảnh"
127
+
128
+ msgctxt "The label for the resize option that allows user to enter custom size of the image."
129
+ msgid "Custom"
130
+ msgstr "Tùy chỉnh"
131
+
120
132
  msgctxt "The accessibility label of the image resize dropdown for screen readers."
121
133
  msgid "Image resize list"
122
134
  msgstr "Danh sách ảnh đã chỉnh kích thước"
@@ -144,3 +156,23 @@ msgstr "Chú thích cho hình ảnh"
144
156
  msgctxt "Text used by screen readers do describe an image when there is a text alternative available, e.g. 'Caption for image: this is a description of the image.'"
145
157
  msgid "Caption for image: %0"
146
158
  msgstr "Chú thích cho hình ảnh: %0"
159
+
160
+ msgctxt "Text used as error label when user submitted custom image resize form with blank value."
161
+ msgid "The value must not be empty."
162
+ msgstr "Không được để trống giá trị này."
163
+
164
+ msgctxt "Text used as error label when user submitted custom image resize form with incorrect value."
165
+ msgid "The value should be a plain number."
166
+ msgstr "Giá trị này phải là một số thường."
167
+
168
+ msgctxt "Aria status message indicating that the image is being uploaded. Example: 'Uploading image'."
169
+ msgid "Uploading image"
170
+ msgstr "Đang tải hình ảnh lên"
171
+
172
+ msgctxt "Aria status message indicating that the image has been uploaded successfully. Example: 'Image upload complete'."
173
+ msgid "Image upload complete"
174
+ msgstr "Hoàn tất quá trình tải hình ảnh lên"
175
+
176
+ msgctxt "Aria status message indicating that an error has occurred during image upload. Example: 'Error during image upload'."
177
+ msgid "Error during image upload"
178
+ msgstr "Xảy ra lỗi trong quá trình tải hình ảnh lên"
@@ -113,10 +113,22 @@ msgctxt "The accessibility label of the standalone image resize reset option but
113
113
  msgid "Resize image to the original size"
114
114
  msgstr "调整图像大小为原始大小"
115
115
 
116
+ msgctxt "The label for image resize balloon input."
117
+ msgid "Resize image (in %0)"
118
+ msgstr "调整图片大小(单位为 %0)"
119
+
116
120
  msgctxt "The default label for the resize option that resets the size of the image."
117
121
  msgid "Original"
118
122
  msgstr "原始大小"
119
123
 
124
+ msgctxt "The accessibility label of the standalone image resize custom option button in the image toolbar for screen readers."
125
+ msgid "Custom image size"
126
+ msgstr "自定义图片大小"
127
+
128
+ msgctxt "The label for the resize option that allows user to enter custom size of the image."
129
+ msgid "Custom"
130
+ msgstr "自定义"
131
+
120
132
  msgctxt "The accessibility label of the image resize dropdown for screen readers."
121
133
  msgid "Image resize list"
122
134
  msgstr "图片大小列表"
@@ -144,3 +156,23 @@ msgstr "图片说明:"
144
156
  msgctxt "Text used by screen readers do describe an image when there is a text alternative available, e.g. 'Caption for image: this is a description of the image.'"
145
157
  msgid "Caption for image: %0"
146
158
  msgstr "图片说明:%0"
159
+
160
+ msgctxt "Text used as error label when user submitted custom image resize form with blank value."
161
+ msgid "The value must not be empty."
162
+ msgstr "该值不能为空。"
163
+
164
+ msgctxt "Text used as error label when user submitted custom image resize form with incorrect value."
165
+ msgid "The value should be a plain number."
166
+ msgstr "该值应当为纯数字。"
167
+
168
+ msgctxt "Aria status message indicating that the image is being uploaded. Example: 'Uploading image'."
169
+ msgid "Uploading image"
170
+ msgstr "正在上传图片"
171
+
172
+ msgctxt "Aria status message indicating that the image has been uploaded successfully. Example: 'Image upload complete'."
173
+ msgid "Image upload complete"
174
+ msgstr "图片上传完成"
175
+
176
+ msgctxt "Aria status message indicating that an error has occurred during image upload. Example: 'Error during image upload'."
177
+ msgid "Error during image upload"
178
+ msgstr "图片上传时出错"
@@ -113,10 +113,22 @@ msgctxt "The accessibility label of the standalone image resize reset option but
113
113
  msgid "Resize image to the original size"
114
114
  msgstr "縮放圖片到原始尺寸"
115
115
 
116
+ msgctxt "The label for image resize balloon input."
117
+ msgid "Resize image (in %0)"
118
+ msgstr "調整圖片大小(單位為 %0)"
119
+
116
120
  msgctxt "The default label for the resize option that resets the size of the image."
117
121
  msgid "Original"
118
122
  msgstr "原始圖片"
119
123
 
124
+ msgctxt "The accessibility label of the standalone image resize custom option button in the image toolbar for screen readers."
125
+ msgid "Custom image size"
126
+ msgstr "自訂圖片大小"
127
+
128
+ msgctxt "The label for the resize option that allows user to enter custom size of the image."
129
+ msgid "Custom"
130
+ msgstr "自訂"
131
+
120
132
  msgctxt "The accessibility label of the image resize dropdown for screen readers."
121
133
  msgid "Image resize list"
122
134
  msgstr "圖片縮放清單"
@@ -144,3 +156,23 @@ msgstr "影像的標題"
144
156
  msgctxt "Text used by screen readers do describe an image when there is a text alternative available, e.g. 'Caption for image: this is a description of the image.'"
145
157
  msgid "Caption for image: %0"
146
158
  msgstr "影像標題:%0"
159
+
160
+ msgctxt "Text used as error label when user submitted custom image resize form with blank value."
161
+ msgid "The value must not be empty."
162
+ msgstr "數值不得為空白。"
163
+
164
+ msgctxt "Text used as error label when user submitted custom image resize form with incorrect value."
165
+ msgid "The value should be a plain number."
166
+ msgstr "數值應為純數字。"
167
+
168
+ msgctxt "Aria status message indicating that the image is being uploaded. Example: 'Uploading image'."
169
+ msgid "Uploading image"
170
+ msgstr "正在上傳圖片"
171
+
172
+ msgctxt "Aria status message indicating that the image has been uploaded successfully. Example: 'Image upload complete'."
173
+ msgid "Image upload complete"
174
+ msgstr "圖片上傳完成"
175
+
176
+ msgctxt "Aria status message indicating that an error has occurred during image upload. Example: 'Error during image upload'."
177
+ msgid "Error during image upload"
178
+ msgstr "圖片上傳期間發生錯誤"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ckeditor/ckeditor5-image",
3
- "version": "41.3.1",
3
+ "version": "41.4.0",
4
4
  "description": "Image feature for CKEditor 5.",
5
5
  "keywords": [
6
6
  "ckeditor",
@@ -13,8 +13,8 @@
13
13
  "type": "module",
14
14
  "main": "src/index.js",
15
15
  "dependencies": {
16
- "@ckeditor/ckeditor5-ui": "41.3.1",
17
- "ckeditor5": "41.3.1",
16
+ "@ckeditor/ckeditor5-ui": "41.4.0",
17
+ "ckeditor5": "41.4.0",
18
18
  "lodash-es": "4.17.21"
19
19
  },
20
20
  "author": "CKSource (http://cksource.com/)",
@@ -27,6 +27,7 @@
27
27
  "directory": "packages/ckeditor5-image"
28
28
  },
29
29
  "files": [
30
+ "dist",
30
31
  "lang",
31
32
  "src/**/*.js",
32
33
  "src/**/*.d.ts",
@@ -2,7 +2,7 @@
2
2
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- import type { ImageConfig, AutoImage, Image, ImageBlock, ImageCaption, ImageInline, ImageInsert, ImageInsertViaUrl, ImageResize, ImageStyle, ImageTextAlternative, ImageToolbar, ImageUpload, ImageUtils, ImageBlockEditing, ImageEditing, ImageCaptionEditing, ImageCaptionUI, ImageCaptionUtils, ImageInsertUI, ImageResizeEditing, ImageSizeAttributes, ImageStyleEditing, ImageStyleUI, ImageTextAlternativeEditing, ImageTextAlternativeUI, ImageUploadEditing, ImageUploadProgress, ImageUploadUI, ImageTypeCommand, InsertImageCommand, ReplaceImageSourceCommand, ToggleImageCaptionCommand, ResizeImageCommand, ImageStyleCommand, ImageTextAlternativeCommand, UploadImageCommand } from './index.js';
5
+ import type { ImageConfig, AutoImage, Image, ImageBlock, ImageCaption, ImageInline, ImageInsert, ImageInsertViaUrl, ImageResize, ImageStyle, ImageTextAlternative, ImageToolbar, ImageUpload, ImageUtils, ImageBlockEditing, ImageEditing, ImageCaptionEditing, ImageCaptionUI, ImageCaptionUtils, ImageInsertUI, ImageResizeEditing, ImageCustomResizeUI, ImageSizeAttributes, ImageStyleEditing, ImageStyleUI, ImageTextAlternativeEditing, ImageTextAlternativeUI, ImageUploadEditing, ImageUploadProgress, ImageUploadUI, ImageTypeCommand, InsertImageCommand, ReplaceImageSourceCommand, ToggleImageCaptionCommand, ResizeImageCommand, ImageStyleCommand, ImageTextAlternativeCommand, UploadImageCommand } from './index.js';
6
6
  declare module '@ckeditor/ckeditor5-core' {
7
7
  interface EditorConfig {
8
8
  /**
@@ -33,6 +33,7 @@ declare module '@ckeditor/ckeditor5-core' {
33
33
  [ImageCaptionUtils.pluginName]: ImageCaptionUtils;
34
34
  [ImageInsertUI.pluginName]: ImageInsertUI;
35
35
  [ImageResizeEditing.pluginName]: ImageResizeEditing;
36
+ [ImageCustomResizeUI.pluginName]: ImageCustomResizeUI;
36
37
  [ImageSizeAttributes.pluginName]: ImageSizeAttributes;
37
38
  [ImageStyleEditing.pluginName]: ImageStyleEditing;
38
39
  [ImageStyleUI.pluginName]: ImageStyleUI;
@@ -0,0 +1,61 @@
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
+ * @module image/imageresize/imagecustomresizeui
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import { ContextualBalloon } from 'ckeditor5/src/ui.js';
10
+ /**
11
+ * The custom resize image UI plugin.
12
+ *
13
+ * The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
14
+ */
15
+ export default class ImageCustomResizeUI extends Plugin {
16
+ /**
17
+ * The contextual balloon plugin instance.
18
+ */
19
+ private _balloon?;
20
+ /**
21
+ * A form containing a textarea and buttons, used to change the `alt` text value.
22
+ */
23
+ private _form?;
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get requires(): readonly [typeof ContextualBalloon];
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ static get pluginName(): "ImageCustomResizeUI";
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ destroy(): void;
36
+ /**
37
+ * Creates the {@link module:image/imageresize/ui/imagecustomresizeformview~ImageCustomResizeFormView}
38
+ * form.
39
+ */
40
+ private _createForm;
41
+ /**
42
+ * Shows the {@link #_form} in the {@link #_balloon}.
43
+ *
44
+ * @internal
45
+ */
46
+ _showForm(unit: string): void;
47
+ /**
48
+ * Removes the {@link #_form} from the {@link #_balloon}.
49
+ *
50
+ * @param focusEditable Controls whether the editing view is focused afterwards.
51
+ */
52
+ private _hideForm;
53
+ /**
54
+ * Returns `true` when the {@link #_form} is the visible view in the {@link #_balloon}.
55
+ */
56
+ private get _isVisible();
57
+ /**
58
+ * Returns `true` when the {@link #_form} is in the {@link #_balloon}.
59
+ */
60
+ private get _isInBalloon();
61
+ }
@@ -0,0 +1,168 @@
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
+ * @module image/imageresize/imagecustomresizeui
7
+ */
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
+ import { ContextualBalloon, clickOutsideHandler, CssTransitionDisablerMixin } from 'ckeditor5/src/ui.js';
10
+ import { getBalloonPositionData } from '../image/ui/utils.js';
11
+ import { getSelectedImageWidthInUnits } from './utils/getselectedimagewidthinunits.js';
12
+ import ImageCustomResizeFormView from './ui/imagecustomresizeformview.js';
13
+ import { getSelectedImagePossibleResizeRange } from './utils/getselectedimagepossibleresizerange.js';
14
+ /**
15
+ * The custom resize image UI plugin.
16
+ *
17
+ * The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
18
+ */
19
+ export default class ImageCustomResizeUI extends Plugin {
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ static get requires() {
24
+ return [ContextualBalloon];
25
+ }
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ static get pluginName() {
30
+ return 'ImageCustomResizeUI';
31
+ }
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ destroy() {
36
+ super.destroy();
37
+ // Destroy created UI components as they are not automatically destroyed (see ckeditor5#1341).
38
+ if (this._form) {
39
+ this._form.destroy();
40
+ }
41
+ }
42
+ /**
43
+ * Creates the {@link module:image/imageresize/ui/imagecustomresizeformview~ImageCustomResizeFormView}
44
+ * form.
45
+ */
46
+ _createForm(unit) {
47
+ const editor = this.editor;
48
+ this._balloon = this.editor.plugins.get('ContextualBalloon');
49
+ this._form = new (CssTransitionDisablerMixin(ImageCustomResizeFormView))(editor.locale, unit, getFormValidators(editor));
50
+ // Render the form so its #element is available for clickOutsideHandler.
51
+ this._form.render();
52
+ this.listenTo(this._form, 'submit', () => {
53
+ if (this._form.isValid()) {
54
+ editor.execute('resizeImage', {
55
+ width: this._form.sizeWithUnits
56
+ });
57
+ this._hideForm(true);
58
+ }
59
+ });
60
+ // Update balloon position when form error label is added .
61
+ this.listenTo(this._form.labeledInput, 'change:errorText', () => {
62
+ editor.ui.update();
63
+ });
64
+ this.listenTo(this._form, 'cancel', () => {
65
+ this._hideForm(true);
66
+ });
67
+ // Close the form on Esc key press.
68
+ this._form.keystrokes.set('Esc', (data, cancel) => {
69
+ this._hideForm(true);
70
+ cancel();
71
+ });
72
+ // Close on click outside of balloon panel element.
73
+ clickOutsideHandler({
74
+ emitter: this._form,
75
+ activator: () => this._isVisible,
76
+ contextElements: () => [this._balloon.view.element],
77
+ callback: () => this._hideForm()
78
+ });
79
+ }
80
+ /**
81
+ * Shows the {@link #_form} in the {@link #_balloon}.
82
+ *
83
+ * @internal
84
+ */
85
+ _showForm(unit) {
86
+ if (this._isVisible) {
87
+ return;
88
+ }
89
+ if (!this._form) {
90
+ this._createForm(unit);
91
+ }
92
+ const editor = this.editor;
93
+ const labeledInput = this._form.labeledInput;
94
+ this._form.disableCssTransitions();
95
+ this._form.resetFormStatus();
96
+ if (!this._isInBalloon) {
97
+ this._balloon.add({
98
+ view: this._form,
99
+ position: getBalloonPositionData(editor)
100
+ });
101
+ }
102
+ // Make sure that each time the panel shows up, the field remains in sync with the value of
103
+ // the command. If the user typed in the input, then canceled the balloon (`labeledInput#value`
104
+ // stays unaltered) and re-opened it without changing the value of the command, they would see the
105
+ // old value instead of the actual value of the command.
106
+ const currentParsedWidth = getSelectedImageWidthInUnits(editor, unit);
107
+ const initialInputValue = currentParsedWidth ? currentParsedWidth.value.toFixed(1) : '';
108
+ const possibleRange = getSelectedImagePossibleResizeRange(editor, unit);
109
+ labeledInput.fieldView.value = labeledInput.fieldView.element.value = initialInputValue;
110
+ if (possibleRange) {
111
+ Object.assign(labeledInput.fieldView, {
112
+ min: possibleRange.lower.toFixed(1),
113
+ max: Math.ceil(possibleRange.upper).toFixed(1)
114
+ });
115
+ }
116
+ this._form.labeledInput.fieldView.select();
117
+ this._form.enableCssTransitions();
118
+ }
119
+ /**
120
+ * Removes the {@link #_form} from the {@link #_balloon}.
121
+ *
122
+ * @param focusEditable Controls whether the editing view is focused afterwards.
123
+ */
124
+ _hideForm(focusEditable = false) {
125
+ if (!this._isInBalloon) {
126
+ return;
127
+ }
128
+ // Blur the input element before removing it from DOM to prevent issues in some browsers.
129
+ // See https://github.com/ckeditor/ckeditor5/issues/1501.
130
+ if (this._form.focusTracker.isFocused) {
131
+ this._form.saveButtonView.focus();
132
+ }
133
+ this._balloon.remove(this._form);
134
+ if (focusEditable) {
135
+ this.editor.editing.view.focus();
136
+ }
137
+ }
138
+ /**
139
+ * Returns `true` when the {@link #_form} is the visible view in the {@link #_balloon}.
140
+ */
141
+ get _isVisible() {
142
+ return !!this._balloon && this._balloon.visibleView === this._form;
143
+ }
144
+ /**
145
+ * Returns `true` when the {@link #_form} is in the {@link #_balloon}.
146
+ */
147
+ get _isInBalloon() {
148
+ return !!this._balloon && this._balloon.hasView(this._form);
149
+ }
150
+ }
151
+ /**
152
+ * Returns image resize form validation callbacks.
153
+ *
154
+ * @param editor Editor instance.
155
+ */
156
+ function getFormValidators(editor) {
157
+ const t = editor.t;
158
+ return [
159
+ form => {
160
+ if (form.rawSize.trim() === '') {
161
+ return t('The value must not be empty.');
162
+ }
163
+ if (form.parsedSize === null) {
164
+ return t('The value should be a plain number.');
165
+ }
166
+ }
167
+ ];
168
+ }
@@ -2,9 +2,6 @@
2
2
  * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
4
  */
5
- /**
6
- * @module image/imageresize/imageresizebuttons
7
- */
8
5
  import { Plugin, type Editor } from 'ckeditor5/src/core.js';
9
6
  import ImageResizeEditing from './imageresizeediting.js';
10
7
  /**