@ckeditor/ckeditor5-image 44.3.0-alpha.7 → 45.0.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/LICENSE.md +1 -1
  2. package/build/image.js +2 -2
  3. package/build/translations/af.js +1 -1
  4. package/build/translations/ar.js +1 -1
  5. package/build/translations/ast.js +1 -1
  6. package/build/translations/az.js +1 -1
  7. package/build/translations/be.js +1 -0
  8. package/build/translations/bg.js +1 -1
  9. package/build/translations/bn.js +1 -1
  10. package/build/translations/bs.js +1 -1
  11. package/build/translations/ca.js +1 -1
  12. package/build/translations/cs.js +1 -1
  13. package/build/translations/da.js +1 -1
  14. package/build/translations/de-ch.js +1 -1
  15. package/build/translations/de.js +1 -1
  16. package/build/translations/el.js +1 -1
  17. package/build/translations/en-au.js +1 -1
  18. package/build/translations/en-gb.js +1 -1
  19. package/build/translations/eo.js +1 -1
  20. package/build/translations/es-co.js +1 -1
  21. package/build/translations/es.js +1 -1
  22. package/build/translations/et.js +1 -1
  23. package/build/translations/eu.js +1 -1
  24. package/build/translations/fa.js +1 -1
  25. package/build/translations/fi.js +1 -1
  26. package/build/translations/fr.js +1 -1
  27. package/build/translations/gl.js +1 -1
  28. package/build/translations/gu.js +1 -1
  29. package/build/translations/he.js +1 -1
  30. package/build/translations/hi.js +1 -1
  31. package/build/translations/hr.js +1 -1
  32. package/build/translations/hu.js +1 -1
  33. package/build/translations/hy.js +1 -1
  34. package/build/translations/id.js +1 -1
  35. package/build/translations/it.js +1 -1
  36. package/build/translations/ja.js +1 -1
  37. package/build/translations/jv.js +1 -1
  38. package/build/translations/kk.js +1 -1
  39. package/build/translations/km.js +1 -1
  40. package/build/translations/kn.js +1 -1
  41. package/build/translations/ko.js +1 -1
  42. package/build/translations/ku.js +1 -1
  43. package/build/translations/lt.js +1 -1
  44. package/build/translations/lv.js +1 -1
  45. package/build/translations/ms.js +1 -1
  46. package/build/translations/nb.js +1 -1
  47. package/build/translations/ne.js +1 -1
  48. package/build/translations/nl.js +1 -1
  49. package/build/translations/no.js +1 -1
  50. package/build/translations/oc.js +1 -1
  51. package/build/translations/pl.js +1 -1
  52. package/build/translations/pt-br.js +1 -1
  53. package/build/translations/pt.js +1 -1
  54. package/build/translations/ro.js +1 -1
  55. package/build/translations/ru.js +1 -1
  56. package/build/translations/si.js +1 -1
  57. package/build/translations/sk.js +1 -1
  58. package/build/translations/sl.js +1 -1
  59. package/build/translations/sq.js +1 -1
  60. package/build/translations/sr-latn.js +1 -1
  61. package/build/translations/sr.js +1 -1
  62. package/build/translations/sv.js +1 -1
  63. package/build/translations/th.js +1 -1
  64. package/build/translations/ti.js +1 -1
  65. package/build/translations/tk.js +1 -1
  66. package/build/translations/tr.js +1 -1
  67. package/build/translations/tt.js +1 -1
  68. package/build/translations/ug.js +1 -1
  69. package/build/translations/uk.js +1 -1
  70. package/build/translations/ur.js +1 -1
  71. package/build/translations/uz.js +1 -1
  72. package/build/translations/vi.js +1 -1
  73. package/build/translations/zh-cn.js +1 -1
  74. package/build/translations/zh.js +1 -1
  75. package/ckeditor5-metadata.json +9 -9
  76. package/dist/index-editor.css +72 -59
  77. package/dist/index.css +90 -79
  78. package/dist/index.css.map +1 -1
  79. package/dist/index.js +178 -120
  80. package/dist/index.js.map +1 -1
  81. package/dist/translations/af.js +1 -1
  82. package/dist/translations/af.umd.js +1 -1
  83. package/dist/translations/ar.js +1 -1
  84. package/dist/translations/ar.umd.js +1 -1
  85. package/dist/translations/ast.js +1 -1
  86. package/dist/translations/ast.umd.js +1 -1
  87. package/dist/translations/az.js +1 -1
  88. package/dist/translations/az.umd.js +1 -1
  89. package/dist/translations/be.d.ts +8 -0
  90. package/dist/translations/be.js +5 -0
  91. package/dist/translations/be.umd.js +11 -0
  92. package/dist/translations/bg.js +1 -1
  93. package/dist/translations/bg.umd.js +1 -1
  94. package/dist/translations/bn.js +1 -1
  95. package/dist/translations/bn.umd.js +1 -1
  96. package/dist/translations/bs.js +1 -1
  97. package/dist/translations/bs.umd.js +1 -1
  98. package/dist/translations/ca.js +1 -1
  99. package/dist/translations/ca.umd.js +1 -1
  100. package/dist/translations/cs.js +1 -1
  101. package/dist/translations/cs.umd.js +1 -1
  102. package/dist/translations/da.js +1 -1
  103. package/dist/translations/da.umd.js +1 -1
  104. package/dist/translations/de-ch.js +1 -1
  105. package/dist/translations/de-ch.umd.js +1 -1
  106. package/dist/translations/de.js +1 -1
  107. package/dist/translations/de.umd.js +1 -1
  108. package/dist/translations/el.js +1 -1
  109. package/dist/translations/el.umd.js +1 -1
  110. package/dist/translations/en-au.js +1 -1
  111. package/dist/translations/en-au.umd.js +1 -1
  112. package/dist/translations/en-gb.js +1 -1
  113. package/dist/translations/en-gb.umd.js +1 -1
  114. package/dist/translations/en.js +1 -1
  115. package/dist/translations/en.umd.js +1 -1
  116. package/dist/translations/eo.js +1 -1
  117. package/dist/translations/eo.umd.js +1 -1
  118. package/dist/translations/es-co.js +1 -1
  119. package/dist/translations/es-co.umd.js +1 -1
  120. package/dist/translations/es.js +1 -1
  121. package/dist/translations/es.umd.js +1 -1
  122. package/dist/translations/et.js +1 -1
  123. package/dist/translations/et.umd.js +1 -1
  124. package/dist/translations/eu.js +1 -1
  125. package/dist/translations/eu.umd.js +1 -1
  126. package/dist/translations/fa.js +1 -1
  127. package/dist/translations/fa.umd.js +1 -1
  128. package/dist/translations/fi.js +1 -1
  129. package/dist/translations/fi.umd.js +1 -1
  130. package/dist/translations/fr.js +1 -1
  131. package/dist/translations/fr.umd.js +1 -1
  132. package/dist/translations/gl.js +1 -1
  133. package/dist/translations/gl.umd.js +1 -1
  134. package/dist/translations/gu.js +1 -1
  135. package/dist/translations/gu.umd.js +1 -1
  136. package/dist/translations/he.js +1 -1
  137. package/dist/translations/he.umd.js +1 -1
  138. package/dist/translations/hi.js +1 -1
  139. package/dist/translations/hi.umd.js +1 -1
  140. package/dist/translations/hr.js +1 -1
  141. package/dist/translations/hr.umd.js +1 -1
  142. package/dist/translations/hu.js +1 -1
  143. package/dist/translations/hu.umd.js +1 -1
  144. package/dist/translations/hy.js +1 -1
  145. package/dist/translations/hy.umd.js +1 -1
  146. package/dist/translations/id.js +1 -1
  147. package/dist/translations/id.umd.js +1 -1
  148. package/dist/translations/it.js +1 -1
  149. package/dist/translations/it.umd.js +1 -1
  150. package/dist/translations/ja.js +1 -1
  151. package/dist/translations/ja.umd.js +1 -1
  152. package/dist/translations/jv.js +1 -1
  153. package/dist/translations/jv.umd.js +1 -1
  154. package/dist/translations/kk.js +1 -1
  155. package/dist/translations/kk.umd.js +1 -1
  156. package/dist/translations/km.js +1 -1
  157. package/dist/translations/km.umd.js +1 -1
  158. package/dist/translations/kn.js +1 -1
  159. package/dist/translations/kn.umd.js +1 -1
  160. package/dist/translations/ko.js +1 -1
  161. package/dist/translations/ko.umd.js +1 -1
  162. package/dist/translations/ku.js +1 -1
  163. package/dist/translations/ku.umd.js +1 -1
  164. package/dist/translations/lt.js +1 -1
  165. package/dist/translations/lt.umd.js +1 -1
  166. package/dist/translations/lv.js +1 -1
  167. package/dist/translations/lv.umd.js +1 -1
  168. package/dist/translations/ms.js +1 -1
  169. package/dist/translations/ms.umd.js +1 -1
  170. package/dist/translations/nb.js +1 -1
  171. package/dist/translations/nb.umd.js +1 -1
  172. package/dist/translations/ne.js +1 -1
  173. package/dist/translations/ne.umd.js +1 -1
  174. package/dist/translations/nl.js +1 -1
  175. package/dist/translations/nl.umd.js +1 -1
  176. package/dist/translations/no.js +1 -1
  177. package/dist/translations/no.umd.js +1 -1
  178. package/dist/translations/oc.js +1 -1
  179. package/dist/translations/oc.umd.js +1 -1
  180. package/dist/translations/pl.js +1 -1
  181. package/dist/translations/pl.umd.js +1 -1
  182. package/dist/translations/pt-br.js +1 -1
  183. package/dist/translations/pt-br.umd.js +1 -1
  184. package/dist/translations/pt.js +1 -1
  185. package/dist/translations/pt.umd.js +1 -1
  186. package/dist/translations/ro.js +1 -1
  187. package/dist/translations/ro.umd.js +1 -1
  188. package/dist/translations/ru.js +1 -1
  189. package/dist/translations/ru.umd.js +1 -1
  190. package/dist/translations/si.js +1 -1
  191. package/dist/translations/si.umd.js +1 -1
  192. package/dist/translations/sk.js +1 -1
  193. package/dist/translations/sk.umd.js +1 -1
  194. package/dist/translations/sl.js +1 -1
  195. package/dist/translations/sl.umd.js +1 -1
  196. package/dist/translations/sq.js +1 -1
  197. package/dist/translations/sq.umd.js +1 -1
  198. package/dist/translations/sr-latn.js +1 -1
  199. package/dist/translations/sr-latn.umd.js +1 -1
  200. package/dist/translations/sr.js +1 -1
  201. package/dist/translations/sr.umd.js +1 -1
  202. package/dist/translations/sv.js +1 -1
  203. package/dist/translations/sv.umd.js +1 -1
  204. package/dist/translations/th.js +1 -1
  205. package/dist/translations/th.umd.js +1 -1
  206. package/dist/translations/ti.js +1 -1
  207. package/dist/translations/ti.umd.js +1 -1
  208. package/dist/translations/tk.js +1 -1
  209. package/dist/translations/tk.umd.js +1 -1
  210. package/dist/translations/tr.js +1 -1
  211. package/dist/translations/tr.umd.js +1 -1
  212. package/dist/translations/tt.js +1 -1
  213. package/dist/translations/tt.umd.js +1 -1
  214. package/dist/translations/ug.js +1 -1
  215. package/dist/translations/ug.umd.js +1 -1
  216. package/dist/translations/uk.js +1 -1
  217. package/dist/translations/uk.umd.js +1 -1
  218. package/dist/translations/ur.js +1 -1
  219. package/dist/translations/ur.umd.js +1 -1
  220. package/dist/translations/uz.js +1 -1
  221. package/dist/translations/uz.umd.js +1 -1
  222. package/dist/translations/vi.js +1 -1
  223. package/dist/translations/vi.umd.js +1 -1
  224. package/dist/translations/zh-cn.js +1 -1
  225. package/dist/translations/zh-cn.umd.js +1 -1
  226. package/dist/translations/zh.js +1 -1
  227. package/dist/translations/zh.umd.js +1 -1
  228. package/lang/contexts.json +4 -2
  229. package/lang/translations/af.po +8 -0
  230. package/lang/translations/ar.po +8 -0
  231. package/lang/translations/ast.po +8 -0
  232. package/lang/translations/az.po +8 -0
  233. package/lang/translations/be.po +196 -0
  234. package/lang/translations/bg.po +8 -0
  235. package/lang/translations/bn.po +8 -0
  236. package/lang/translations/bs.po +8 -0
  237. package/lang/translations/ca.po +8 -0
  238. package/lang/translations/cs.po +8 -0
  239. package/lang/translations/da.po +8 -0
  240. package/lang/translations/de-ch.po +8 -0
  241. package/lang/translations/de.po +8 -0
  242. package/lang/translations/el.po +8 -0
  243. package/lang/translations/en-au.po +8 -0
  244. package/lang/translations/en-gb.po +8 -0
  245. package/lang/translations/en.po +8 -0
  246. package/lang/translations/eo.po +8 -0
  247. package/lang/translations/es-co.po +8 -0
  248. package/lang/translations/es.po +8 -0
  249. package/lang/translations/et.po +8 -0
  250. package/lang/translations/eu.po +8 -0
  251. package/lang/translations/fa.po +8 -0
  252. package/lang/translations/fi.po +8 -0
  253. package/lang/translations/fr.po +8 -0
  254. package/lang/translations/gl.po +8 -0
  255. package/lang/translations/gu.po +8 -0
  256. package/lang/translations/he.po +8 -0
  257. package/lang/translations/hi.po +8 -0
  258. package/lang/translations/hr.po +8 -0
  259. package/lang/translations/hu.po +8 -0
  260. package/lang/translations/hy.po +8 -0
  261. package/lang/translations/id.po +8 -0
  262. package/lang/translations/it.po +8 -0
  263. package/lang/translations/ja.po +8 -0
  264. package/lang/translations/jv.po +8 -0
  265. package/lang/translations/kk.po +8 -0
  266. package/lang/translations/km.po +8 -0
  267. package/lang/translations/kn.po +8 -0
  268. package/lang/translations/ko.po +8 -0
  269. package/lang/translations/ku.po +8 -0
  270. package/lang/translations/lt.po +8 -0
  271. package/lang/translations/lv.po +8 -0
  272. package/lang/translations/ms.po +8 -0
  273. package/lang/translations/nb.po +8 -0
  274. package/lang/translations/ne.po +8 -0
  275. package/lang/translations/nl.po +8 -0
  276. package/lang/translations/no.po +8 -0
  277. package/lang/translations/oc.po +8 -0
  278. package/lang/translations/pl.po +8 -0
  279. package/lang/translations/pt-br.po +8 -0
  280. package/lang/translations/pt.po +8 -0
  281. package/lang/translations/ro.po +8 -0
  282. package/lang/translations/ru.po +8 -0
  283. package/lang/translations/si.po +8 -0
  284. package/lang/translations/sk.po +8 -0
  285. package/lang/translations/sl.po +8 -0
  286. package/lang/translations/sq.po +8 -0
  287. package/lang/translations/sr-latn.po +8 -0
  288. package/lang/translations/sr.po +8 -0
  289. package/lang/translations/sv.po +8 -0
  290. package/lang/translations/th.po +8 -0
  291. package/lang/translations/ti.po +8 -0
  292. package/lang/translations/tk.po +8 -0
  293. package/lang/translations/tr.po +8 -0
  294. package/lang/translations/tt.po +8 -0
  295. package/lang/translations/ug.po +8 -0
  296. package/lang/translations/uk.po +8 -0
  297. package/lang/translations/ur.po +8 -0
  298. package/lang/translations/uz.po +8 -0
  299. package/lang/translations/vi.po +8 -0
  300. package/lang/translations/zh-cn.po +8 -0
  301. package/lang/translations/zh.po +8 -0
  302. package/package.json +13 -12
  303. package/src/autoimage.js +10 -0
  304. package/src/image/imagetypecommand.js +4 -0
  305. package/src/imagecaption/imagecaptionediting.js +7 -0
  306. package/src/imagecaption/imagecaptionui.js +3 -2
  307. package/src/imageinsert/imageinsertui.js +11 -6
  308. package/src/imageinsert/imageinsertviaurlui.js +7 -6
  309. package/src/imageinsert/ui/imageinsertformview.js +20 -0
  310. package/src/imageinsert/ui/imageinserturlview.js +8 -0
  311. package/src/imageresize/imagecustomresizeui.js +8 -5
  312. package/src/imageresize/imageresizebuttons.d.ts +3 -0
  313. package/src/imageresize/imageresizebuttons.js +21 -13
  314. package/src/imageresize/resizeimagecommand.d.ts +1 -1
  315. package/src/imageresize/ui/imagecustomresizeformview.d.ts +19 -12
  316. package/src/imageresize/ui/imagecustomresizeformview.js +112 -36
  317. package/src/imagestyle/imagestylecommand.js +10 -0
  318. package/src/imagestyle/imagestyleediting.js +12 -0
  319. package/src/imagestyle/imagestyleui.js +1 -1
  320. package/src/imagestyle/utils.d.ts +1 -4
  321. package/src/imagestyle/utils.js +16 -16
  322. package/src/imagetextalternative/imagetextalternativeui.js +11 -7
  323. package/src/imagetextalternative/ui/textalternativeformview.d.ts +17 -10
  324. package/src/imagetextalternative/ui/textalternativeformview.js +105 -35
  325. package/src/imagetoolbar.js +1 -1
  326. package/src/imageupload/imageuploadediting.js +17 -7
  327. package/src/imageupload/imageuploadprogress.js +59 -53
  328. package/src/imageupload/imageuploadui.js +3 -2
  329. package/src/imageutils.js +4 -7
  330. package/theme/imagecustomresizeform.css +0 -29
  331. package/theme/textalternativeform.css +0 -28
@@ -5,32 +5,90 @@
5
5
  /**
6
6
  * @module image/imageresize/ui/imagecustomresizeformview
7
7
  */
8
- import { ButtonView, FocusCycler, LabeledFieldView, View, ViewCollection, createLabeledInputNumber, submitHandler } from 'ckeditor5/src/ui.js';
8
+ import { ButtonView, FocusCycler, FormHeaderView, FormRowView, LabeledFieldView, View, ViewCollection, createLabeledInputNumber, submitHandler } from 'ckeditor5/src/ui.js';
9
9
  import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils.js';
10
- import { icons } from 'ckeditor5/src/core.js';
10
+ import { IconPreviousArrow } from 'ckeditor5/src/icons.js';
11
11
  import '../../../theme/imagecustomresizeform.css';
12
12
  // See: #8833.
13
13
  // eslint-disable-next-line ckeditor5-rules/ckeditor-imports
14
14
  import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
15
+ // eslint-disable-next-line ckeditor5-rules/ckeditor-imports
16
+ import '@ckeditor/ckeditor5-ui/theme/components/form/form.css';
15
17
  /**
16
18
  * The ImageCustomResizeFormView class.
17
19
  */
18
20
  export default class ImageCustomResizeFormView extends View {
21
+ /**
22
+ * Tracks information about the DOM focus in the form.
23
+ */
24
+ focusTracker;
25
+ /**
26
+ * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
27
+ */
28
+ keystrokes;
29
+ /**
30
+ * Resize unit shortcut.
31
+ */
32
+ unit;
33
+ /**
34
+ * The Back button view displayed in the header.
35
+ */
36
+ backButtonView;
37
+ /**
38
+ * A button used to submit the form.
39
+ */
40
+ saveButtonView;
41
+ /**
42
+ * An input with a label.
43
+ */
44
+ labeledInput;
45
+ /**
46
+ * A collection of child views.
47
+ */
48
+ children;
49
+ /**
50
+ * A collection of views which can be focused in the form.
51
+ */
52
+ _focusables;
53
+ /**
54
+ * Helps cycling over {@link #_focusables} in the form.
55
+ */
56
+ _focusCycler;
57
+ /**
58
+ * An array of form validators used by {@link #isValid}.
59
+ */
60
+ _validators;
19
61
  /**
20
62
  * @inheritDoc
21
63
  */
22
64
  constructor(locale, unit, validators) {
23
65
  super(locale);
24
- const t = this.locale.t;
25
66
  this.focusTracker = new FocusTracker();
26
67
  this.keystrokes = new KeystrokeHandler();
27
68
  this.unit = unit;
69
+ // Create buttons.
70
+ this.backButtonView = this._createBackButton();
71
+ this.saveButtonView = this._createSaveButton();
72
+ // Create input fields.
28
73
  this.labeledInput = this._createLabeledInputView();
29
- this.saveButtonView = this._createButton(t('Save'), icons.check, 'ck-button-save');
30
- this.saveButtonView.type = 'submit';
31
- this.cancelButtonView = this._createButton(t('Cancel'), icons.cancel, 'ck-button-cancel', 'cancel');
74
+ this.children = this.createCollection([this._createHeaderView()]);
75
+ this.children.add(new FormRowView(locale, {
76
+ children: [
77
+ this.labeledInput,
78
+ this.saveButtonView
79
+ ],
80
+ class: [
81
+ 'ck-form__row_with-submit',
82
+ 'ck-form__row_large-top-padding'
83
+ ]
84
+ }));
32
85
  this._focusables = new ViewCollection();
33
86
  this._validators = validators;
87
+ // Close the panel on esc key press when the **form has focus**.
88
+ this.keystrokes.set('Esc', (data, cancel) => {
89
+ this.fire('cancel');
90
+ cancel();
91
+ });
34
92
  this._focusCycler = new FocusCycler({
35
93
  focusables: this._focusables,
36
94
  focusTracker: this.focusTracker,
@@ -47,17 +105,14 @@ export default class ImageCustomResizeFormView extends View {
47
105
  attributes: {
48
106
  class: [
49
107
  'ck',
108
+ 'ck-form',
50
109
  'ck-image-custom-resize-form',
51
110
  'ck-responsive-form'
52
111
  ],
53
112
  // https://github.com/ckeditor/ckeditor5-image/issues/40
54
113
  tabindex: '-1'
55
114
  },
56
- children: [
57
- this.labeledInput,
58
- this.saveButtonView,
59
- this.cancelButtonView
60
- ]
115
+ children: this.children
61
116
  });
62
117
  }
63
118
  /**
@@ -65,15 +120,21 @@ export default class ImageCustomResizeFormView extends View {
65
120
  */
66
121
  render() {
67
122
  super.render();
68
- this.keystrokes.listenTo(this.element);
69
- submitHandler({ view: this });
70
- [this.labeledInput, this.saveButtonView, this.cancelButtonView]
71
- .forEach(v => {
123
+ submitHandler({
124
+ view: this
125
+ });
126
+ const childViews = [
127
+ this.backButtonView,
128
+ this.labeledInput,
129
+ this.saveButtonView
130
+ ];
131
+ childViews.forEach(v => {
72
132
  // Register the view as focusable.
73
133
  this._focusables.add(v);
74
134
  // Register the view in the focus tracker.
75
135
  this.focusTracker.add(v.element);
76
136
  });
137
+ this.keystrokes.listenTo(this.element);
77
138
  }
78
139
  /**
79
140
  * @inheritDoc
@@ -84,30 +145,44 @@ export default class ImageCustomResizeFormView extends View {
84
145
  this.keystrokes.destroy();
85
146
  }
86
147
  /**
87
- * Creates the button view.
88
- *
89
- * @param label The button label
90
- * @param icon The button's icon.
91
- * @param className The additional button CSS class name.
92
- * @param eventName The event name that the ButtonView#execute event will be delegated to.
93
- * @returns The button view instance.
94
- */
95
- _createButton(label, icon, className, eventName) {
96
- const button = new ButtonView(this.locale);
97
- button.set({
98
- label,
99
- icon,
148
+ * Creates a back button view that cancels the form.
149
+ */
150
+ _createBackButton() {
151
+ const t = this.locale.t;
152
+ const backButton = new ButtonView(this.locale);
153
+ backButton.set({
154
+ class: 'ck-button-back',
155
+ label: t('Back'),
156
+ icon: IconPreviousArrow,
100
157
  tooltip: true
101
158
  });
102
- button.extendTemplate({
103
- attributes: {
104
- class: className
105
- }
159
+ backButton.delegate('execute').to(this, 'cancel');
160
+ return backButton;
161
+ }
162
+ /**
163
+ * Creates a save button view that resize the image.
164
+ */
165
+ _createSaveButton() {
166
+ const t = this.locale.t;
167
+ const saveButton = new ButtonView(this.locale);
168
+ saveButton.set({
169
+ label: t('Save'),
170
+ withText: true,
171
+ type: 'submit',
172
+ class: 'ck-button-action ck-button-bold'
106
173
  });
107
- if (eventName) {
108
- button.delegate('execute').to(this, eventName);
109
- }
110
- return button;
174
+ return saveButton;
175
+ }
176
+ /**
177
+ * Creates a header view for the form.
178
+ */
179
+ _createHeaderView() {
180
+ const t = this.locale.t;
181
+ const header = new FormHeaderView(this.locale, {
182
+ label: t('Image Resize')
183
+ });
184
+ header.children.add(this.backButtonView, 0);
185
+ return header;
111
186
  }
112
187
  /**
113
188
  * Creates an input with a label.
@@ -118,6 +193,7 @@ export default class ImageCustomResizeFormView extends View {
118
193
  const t = this.locale.t;
119
194
  const labeledInput = new LabeledFieldView(this.locale, createLabeledInputNumber);
120
195
  labeledInput.label = t('Resize image (in %0)', this.unit);
196
+ labeledInput.class = 'ck-labeled-field-view_full-width';
121
197
  labeledInput.fieldView.set({
122
198
  step: 0.1
123
199
  });
@@ -11,6 +11,16 @@ import { Command } from 'ckeditor5/src/core.js';
11
11
  * type. See {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand#execute} to learn more.
12
12
  */
13
13
  export default class ImageStyleCommand extends Command {
14
+ /**
15
+ * An object containing names of default style options for the inline and block images.
16
+ * If there is no default style option for the given image type in the configuration,
17
+ * the name will be `false`.
18
+ */
19
+ _defaultStyles;
20
+ /**
21
+ * The styles handled by this command.
22
+ */
23
+ _styles;
14
24
  /**
15
25
  * Creates an instance of the image style command. When executed, the command applies one of
16
26
  * {@link module:image/imageconfig~ImageStyleConfig#options style options} to the currently selected image.
@@ -33,6 +33,18 @@ export default class ImageStyleEditing extends Plugin {
33
33
  static get requires() {
34
34
  return [ImageUtils];
35
35
  }
36
+ /**
37
+ * It contains a list of the normalized and validated style options.
38
+ *
39
+ * * Each option contains a complete icon markup.
40
+ * * The style options not supported by any of the loaded image editing plugins (
41
+ * {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`} or
42
+ * {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`}) are filtered out.
43
+ *
44
+ * @internal
45
+ * @readonly
46
+ */
47
+ normalizedStyles;
36
48
  /**
37
49
  * @inheritDoc
38
50
  */
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { Plugin } from 'ckeditor5/src/core.js';
9
9
  import { ButtonView, createDropdown, addToolbarToDropdown, SplitButtonView } from 'ckeditor5/src/ui.js';
10
- import { isObject, identity } from 'lodash-es';
10
+ import { isObject, identity } from 'es-toolkit/compat';
11
11
  import ImageStyleEditing from './imagestyleediting.js';
12
12
  import utils from './utils.js';
13
13
  import '../../theme/imagestyle.css';
@@ -2,10 +2,7 @@
2
2
  * @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
3
3
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
4
  */
5
- /**
6
- * @module image/imagestyle/utils
7
- */
8
- import { type Editor, type PluginCollection } from 'ckeditor5/src/core.js';
5
+ import type { Editor, PluginCollection } from 'ckeditor5/src/core.js';
9
6
  import type { ImageStyleConfig, ImageStyleDropdownDefinition, ImageStyleOptionDefinition } from '../imageconfig.js';
10
7
  /**
11
8
  * Default image style options provided by the plugin that can be referred in the {@link module:image/imageconfig~ImageConfig#styles}
@@ -5,8 +5,8 @@
5
5
  /**
6
6
  * @module image/imagestyle/utils
7
7
  */
8
- import { icons } from 'ckeditor5/src/core.js';
9
8
  import { logWarning } from 'ckeditor5/src/utils.js';
9
+ import { IconObjectCenter, IconObjectFullWidth, IconObjectInline, IconObjectInlineLeft, IconObjectInlineRight, IconObjectLeft, IconObjectRight } from 'ckeditor5/src/icons.js';
10
10
  /**
11
11
  * Default image style options provided by the plugin that can be referred in the {@link module:image/imageconfig~ImageConfig#styles}
12
12
  * configuration.
@@ -31,7 +31,7 @@ export const DEFAULT_OPTIONS = {
31
31
  return {
32
32
  name: 'inline',
33
33
  title: 'In line',
34
- icon: icons.objectInline,
34
+ icon: IconObjectInline,
35
35
  modelElements: ['imageInline'],
36
36
  isDefault: true
37
37
  };
@@ -41,7 +41,7 @@ export const DEFAULT_OPTIONS = {
41
41
  return {
42
42
  name: 'alignLeft',
43
43
  title: 'Left aligned image',
44
- icon: icons.objectLeft,
44
+ icon: IconObjectInlineLeft,
45
45
  modelElements: ['imageBlock', 'imageInline'],
46
46
  className: 'image-style-align-left'
47
47
  };
@@ -51,7 +51,7 @@ export const DEFAULT_OPTIONS = {
51
51
  return {
52
52
  name: 'alignBlockLeft',
53
53
  title: 'Left aligned image',
54
- icon: icons.objectBlockLeft,
54
+ icon: IconObjectLeft,
55
55
  modelElements: ['imageBlock'],
56
56
  className: 'image-style-block-align-left'
57
57
  };
@@ -61,7 +61,7 @@ export const DEFAULT_OPTIONS = {
61
61
  return {
62
62
  name: 'alignCenter',
63
63
  title: 'Centered image',
64
- icon: icons.objectCenter,
64
+ icon: IconObjectCenter,
65
65
  modelElements: ['imageBlock'],
66
66
  className: 'image-style-align-center'
67
67
  };
@@ -71,7 +71,7 @@ export const DEFAULT_OPTIONS = {
71
71
  return {
72
72
  name: 'alignRight',
73
73
  title: 'Right aligned image',
74
- icon: icons.objectRight,
74
+ icon: IconObjectInlineRight,
75
75
  modelElements: ['imageBlock', 'imageInline'],
76
76
  className: 'image-style-align-right'
77
77
  };
@@ -81,7 +81,7 @@ export const DEFAULT_OPTIONS = {
81
81
  return {
82
82
  name: 'alignBlockRight',
83
83
  title: 'Right aligned image',
84
- icon: icons.objectBlockRight,
84
+ icon: IconObjectRight,
85
85
  modelElements: ['imageBlock'],
86
86
  className: 'image-style-block-align-right'
87
87
  };
@@ -91,7 +91,7 @@ export const DEFAULT_OPTIONS = {
91
91
  return {
92
92
  name: 'block',
93
93
  title: 'Centered image',
94
- icon: icons.objectCenter,
94
+ icon: IconObjectCenter,
95
95
  modelElements: ['imageBlock'],
96
96
  isDefault: true
97
97
  };
@@ -101,7 +101,7 @@ export const DEFAULT_OPTIONS = {
101
101
  return {
102
102
  name: 'side',
103
103
  title: 'Side image',
104
- icon: icons.objectRight,
104
+ icon: IconObjectInlineRight,
105
105
  modelElements: ['imageBlock'],
106
106
  className: 'image-style-side'
107
107
  };
@@ -116,13 +116,13 @@ export const DEFAULT_OPTIONS = {
116
116
  * There are 7 default icons available: `'full'`, `'left'`, `'inlineLeft'`, `'center'`, `'right'`, `'inlineRight'`, and `'inline'`.
117
117
  */
118
118
  export const DEFAULT_ICONS = /* #__PURE__ */ (() => ({
119
- full: icons.objectFullWidth,
120
- left: icons.objectBlockLeft,
121
- right: icons.objectBlockRight,
122
- center: icons.objectCenter,
123
- inlineLeft: icons.objectLeft,
124
- inlineRight: icons.objectRight,
125
- inline: icons.objectInline
119
+ full: IconObjectFullWidth,
120
+ left: IconObjectLeft,
121
+ right: IconObjectRight,
122
+ center: IconObjectCenter,
123
+ inlineLeft: IconObjectInlineLeft,
124
+ inlineRight: IconObjectInlineRight,
125
+ inline: IconObjectInline
126
126
  }))();
127
127
  /**
128
128
  * Default drop-downs provided by the plugin that can be referred in the {@link module:image/imageconfig~ImageConfig#toolbar}
@@ -5,8 +5,9 @@
5
5
  /**
6
6
  * @module image/imagetextalternative/imagetextalternativeui
7
7
  */
8
- import { Plugin, icons } from 'ckeditor5/src/core.js';
8
+ import { Plugin } from 'ckeditor5/src/core.js';
9
9
  import { ButtonView, ContextualBalloon, clickOutsideHandler, CssTransitionDisablerMixin } from 'ckeditor5/src/ui.js';
10
+ import { IconTextAlternative } from 'ckeditor5/src/icons.js';
10
11
  import TextAlternativeFormView from './ui/textalternativeformview.js';
11
12
  import { repositionContextualBalloon, getBalloonPositionData } from '../image/ui/utils.js';
12
13
  /**
@@ -15,6 +16,14 @@ import { repositionContextualBalloon, getBalloonPositionData } from '../image/ui
15
16
  * The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
16
17
  */
17
18
  export default class ImageTextAlternativeUI extends Plugin {
19
+ /**
20
+ * The contextual balloon plugin instance.
21
+ */
22
+ _balloon;
23
+ /**
24
+ * A form containing a textarea and buttons, used to change the `alt` text value.
25
+ */
26
+ _form;
18
27
  /**
19
28
  * @inheritDoc
20
29
  */
@@ -61,7 +70,7 @@ export default class ImageTextAlternativeUI extends Plugin {
61
70
  const view = new ButtonView(locale);
62
71
  view.set({
63
72
  label: t('Change image text alternative'),
64
- icon: icons.textAlternative,
73
+ icon: IconTextAlternative,
65
74
  tooltip: true
66
75
  });
67
76
  view.bind('isEnabled').to(command, 'isEnabled');
@@ -94,11 +103,6 @@ export default class ImageTextAlternativeUI extends Plugin {
94
103
  this.listenTo(this._form, 'cancel', () => {
95
104
  this._hideForm(true);
96
105
  });
97
- // Close the form on Esc key press.
98
- this._form.keystrokes.set('Esc', (data, cancel) => {
99
- this._hideForm(true);
100
- cancel();
101
- });
102
106
  // Reposition the balloon or hide the form if an image widget is no longer selected.
103
107
  this.listenTo(editor.ui, 'update', () => {
104
108
  if (!imageUtils.getClosestSelectedImageWidget(viewDocument.selection)) {
@@ -9,6 +9,7 @@ import { ButtonView, FocusCycler, LabeledFieldView, View, ViewCollection, type I
9
9
  import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
10
10
  import '../../../theme/textalternativeform.css';
11
11
  import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
12
+ import '@ckeditor/ckeditor5-ui/theme/components/form/form.css';
12
13
  /**
13
14
  * The TextAlternativeFormView class.
14
15
  */
@@ -25,14 +26,18 @@ export default class TextAlternativeFormView extends View {
25
26
  * An input with a label.
26
27
  */
27
28
  labeledInput: LabeledFieldView<InputView>;
29
+ /**
30
+ * The Back button view displayed in the header.
31
+ */
32
+ backButtonView: ButtonView;
28
33
  /**
29
34
  * A button used to submit the form.
30
35
  */
31
36
  saveButtonView: ButtonView;
32
37
  /**
33
- * A button used to cancel the form.
38
+ * A collection of child views.
34
39
  */
35
- cancelButtonView: ButtonView;
40
+ readonly children: ViewCollection;
36
41
  /**
37
42
  * A collection of views which can be focused in the form.
38
43
  */
@@ -54,15 +59,17 @@ export default class TextAlternativeFormView extends View {
54
59
  */
55
60
  destroy(): void;
56
61
  /**
57
- * Creates the button view.
58
- *
59
- * @param label The button label
60
- * @param icon The button's icon.
61
- * @param className The additional button CSS class name.
62
- * @param eventName The event name that the ButtonView#execute event will be delegated to.
63
- * @returns The button view instance.
62
+ * Creates a back button view that cancels the form.
63
+ */
64
+ private _createBackButton;
65
+ /**
66
+ * Creates a save button view that text alternative the image.
67
+ */
68
+ private _createSaveButton;
69
+ /**
70
+ * Creates a header view for the form.
64
71
  */
65
- private _createButton;
72
+ private _createHeaderView;
66
73
  /**
67
74
  * Creates an input with a label.
68
75
  *