@ckeditor/ckeditor5-media-embed 48.2.0 → 48.3.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/ckeditor5-metadata.json +1 -1
  2. package/dist/augmentation.d.ts +33 -31
  3. package/dist/automediaembed.d.ts +50 -50
  4. package/dist/converters.d.ts +37 -37
  5. package/dist/index-editor.css +26 -0
  6. package/dist/index.css +26 -0
  7. package/dist/index.css.map +1 -1
  8. package/dist/index.d.ts +29 -26
  9. package/dist/index.js +2601 -1956
  10. package/dist/index.js.map +1 -1
  11. package/dist/mediaembed.d.ts +33 -33
  12. package/dist/mediaembedcommand.d.ts +32 -32
  13. package/dist/mediaembedconfig.d.ts +564 -483
  14. package/dist/mediaembedediting.d.ts +30 -30
  15. package/dist/mediaembedresize/constants.d.ts +13 -13
  16. package/dist/mediaembedresize/mediaembedcustomresizeui.d.ts +64 -0
  17. package/dist/mediaembedresize/mediaembedresizebuttons.d.ts +54 -0
  18. package/dist/mediaembedresize/mediaembedresizeediting.d.ts +47 -43
  19. package/dist/mediaembedresize/mediaembedresizehandles.d.ts +38 -38
  20. package/dist/mediaembedresize/resizemediaembedcommand.d.ts +35 -35
  21. package/dist/mediaembedresize/ui/mediaembedcustomresizeformview.d.ts +118 -0
  22. package/dist/mediaembedresize/utils/getselectedmediaembededitornodes.d.ts +23 -0
  23. package/dist/mediaembedresize/utils/getselectedmediaembedpossibleresizerange.d.ts +25 -0
  24. package/dist/mediaembedresize/utils/getselectedmediaembedwidthinunits.d.ts +21 -0
  25. package/dist/mediaembedresize.d.ts +28 -25
  26. package/dist/mediaembedstyle/constants.d.ts +22 -22
  27. package/dist/mediaembedstyle/mediaembedstylecommand.d.ts +67 -67
  28. package/dist/mediaembedstyle/mediaembedstyleediting.d.ts +39 -39
  29. package/dist/mediaembedstyle/mediaembedstyleui.d.ts +76 -76
  30. package/dist/mediaembedstyle/utils.d.ts +18 -18
  31. package/dist/mediaembedstyle.d.ts +29 -29
  32. package/dist/mediaembedtoolbar.d.ts +28 -28
  33. package/dist/mediaembedui.d.ts +33 -33
  34. package/dist/mediaregistry.d.ts +59 -59
  35. package/dist/translations/af.js +1 -1
  36. package/dist/translations/af.umd.js +1 -1
  37. package/dist/translations/ar.js +1 -1
  38. package/dist/translations/ar.umd.js +1 -1
  39. package/dist/translations/ast.js +1 -1
  40. package/dist/translations/ast.umd.js +1 -1
  41. package/dist/translations/az.js +1 -1
  42. package/dist/translations/az.umd.js +1 -1
  43. package/dist/translations/be.js +1 -1
  44. package/dist/translations/be.umd.js +1 -1
  45. package/dist/translations/bg.js +1 -1
  46. package/dist/translations/bg.umd.js +1 -1
  47. package/dist/translations/bn.js +1 -1
  48. package/dist/translations/bn.umd.js +1 -1
  49. package/dist/translations/bs.js +1 -1
  50. package/dist/translations/bs.umd.js +1 -1
  51. package/dist/translations/ca.js +1 -1
  52. package/dist/translations/ca.umd.js +1 -1
  53. package/dist/translations/cs.js +1 -1
  54. package/dist/translations/cs.umd.js +1 -1
  55. package/dist/translations/da.js +1 -1
  56. package/dist/translations/da.umd.js +1 -1
  57. package/dist/translations/de-ch.js +1 -1
  58. package/dist/translations/de-ch.umd.js +1 -1
  59. package/dist/translations/de.js +1 -1
  60. package/dist/translations/de.umd.js +1 -1
  61. package/dist/translations/el.js +1 -1
  62. package/dist/translations/el.umd.js +1 -1
  63. package/dist/translations/en-au.js +1 -1
  64. package/dist/translations/en-au.umd.js +1 -1
  65. package/dist/translations/en-gb.js +1 -1
  66. package/dist/translations/en-gb.umd.js +1 -1
  67. package/dist/translations/en.js +1 -1
  68. package/dist/translations/en.umd.js +1 -1
  69. package/dist/translations/eo.js +1 -1
  70. package/dist/translations/eo.umd.js +1 -1
  71. package/dist/translations/es-co.js +1 -1
  72. package/dist/translations/es-co.umd.js +1 -1
  73. package/dist/translations/es.js +1 -1
  74. package/dist/translations/es.umd.js +1 -1
  75. package/dist/translations/et.js +1 -1
  76. package/dist/translations/et.umd.js +1 -1
  77. package/dist/translations/eu.js +1 -1
  78. package/dist/translations/eu.umd.js +1 -1
  79. package/dist/translations/fa.js +1 -1
  80. package/dist/translations/fa.umd.js +1 -1
  81. package/dist/translations/fi.js +1 -1
  82. package/dist/translations/fi.umd.js +1 -1
  83. package/dist/translations/fr.js +1 -1
  84. package/dist/translations/fr.umd.js +1 -1
  85. package/dist/translations/gl.js +1 -1
  86. package/dist/translations/gl.umd.js +1 -1
  87. package/dist/translations/gu.js +1 -1
  88. package/dist/translations/gu.umd.js +1 -1
  89. package/dist/translations/he.js +1 -1
  90. package/dist/translations/he.umd.js +1 -1
  91. package/dist/translations/hi.js +1 -1
  92. package/dist/translations/hi.umd.js +1 -1
  93. package/dist/translations/hr.js +1 -1
  94. package/dist/translations/hr.umd.js +1 -1
  95. package/dist/translations/hu.js +1 -1
  96. package/dist/translations/hu.umd.js +1 -1
  97. package/dist/translations/hy.js +1 -1
  98. package/dist/translations/hy.umd.js +1 -1
  99. package/dist/translations/id.js +1 -1
  100. package/dist/translations/id.umd.js +1 -1
  101. package/dist/translations/it.js +1 -1
  102. package/dist/translations/it.umd.js +1 -1
  103. package/dist/translations/ja.js +1 -1
  104. package/dist/translations/ja.umd.js +1 -1
  105. package/dist/translations/jv.js +1 -1
  106. package/dist/translations/jv.umd.js +1 -1
  107. package/dist/translations/kk.js +1 -1
  108. package/dist/translations/kk.umd.js +1 -1
  109. package/dist/translations/km.js +1 -1
  110. package/dist/translations/km.umd.js +1 -1
  111. package/dist/translations/kn.js +1 -1
  112. package/dist/translations/kn.umd.js +1 -1
  113. package/dist/translations/ko.js +1 -1
  114. package/dist/translations/ko.umd.js +1 -1
  115. package/dist/translations/ku.js +1 -1
  116. package/dist/translations/ku.umd.js +1 -1
  117. package/dist/translations/lt.js +1 -1
  118. package/dist/translations/lt.umd.js +1 -1
  119. package/dist/translations/lv.js +1 -1
  120. package/dist/translations/lv.umd.js +1 -1
  121. package/dist/translations/ms.js +1 -1
  122. package/dist/translations/ms.umd.js +1 -1
  123. package/dist/translations/nb.js +1 -1
  124. package/dist/translations/nb.umd.js +1 -1
  125. package/dist/translations/ne.js +1 -1
  126. package/dist/translations/ne.umd.js +1 -1
  127. package/dist/translations/nl.js +1 -1
  128. package/dist/translations/nl.umd.js +1 -1
  129. package/dist/translations/no.js +1 -1
  130. package/dist/translations/no.umd.js +1 -1
  131. package/dist/translations/oc.js +1 -1
  132. package/dist/translations/oc.umd.js +1 -1
  133. package/dist/translations/pl.js +1 -1
  134. package/dist/translations/pl.umd.js +1 -1
  135. package/dist/translations/pt-br.js +1 -1
  136. package/dist/translations/pt-br.umd.js +1 -1
  137. package/dist/translations/pt.js +1 -1
  138. package/dist/translations/pt.umd.js +1 -1
  139. package/dist/translations/ro.js +1 -1
  140. package/dist/translations/ro.umd.js +1 -1
  141. package/dist/translations/ru.js +1 -1
  142. package/dist/translations/ru.umd.js +1 -1
  143. package/dist/translations/si.js +1 -1
  144. package/dist/translations/si.umd.js +1 -1
  145. package/dist/translations/sk.js +1 -1
  146. package/dist/translations/sk.umd.js +1 -1
  147. package/dist/translations/sl.js +1 -1
  148. package/dist/translations/sl.umd.js +1 -1
  149. package/dist/translations/sq.js +1 -1
  150. package/dist/translations/sq.umd.js +1 -1
  151. package/dist/translations/sr-latn.js +1 -1
  152. package/dist/translations/sr-latn.umd.js +1 -1
  153. package/dist/translations/sr.js +1 -1
  154. package/dist/translations/sr.umd.js +1 -1
  155. package/dist/translations/sv.js +1 -1
  156. package/dist/translations/sv.umd.js +1 -1
  157. package/dist/translations/th.js +1 -1
  158. package/dist/translations/th.umd.js +1 -1
  159. package/dist/translations/ti.js +1 -1
  160. package/dist/translations/ti.umd.js +1 -1
  161. package/dist/translations/tk.js +1 -1
  162. package/dist/translations/tk.umd.js +1 -1
  163. package/dist/translations/tr.js +1 -1
  164. package/dist/translations/tr.umd.js +1 -1
  165. package/dist/translations/tt.js +1 -1
  166. package/dist/translations/tt.umd.js +1 -1
  167. package/dist/translations/ug.js +1 -1
  168. package/dist/translations/ug.umd.js +1 -1
  169. package/dist/translations/uk.js +1 -1
  170. package/dist/translations/uk.umd.js +1 -1
  171. package/dist/translations/ur.js +1 -1
  172. package/dist/translations/ur.umd.js +1 -1
  173. package/dist/translations/uz.js +1 -1
  174. package/dist/translations/uz.umd.js +1 -1
  175. package/dist/translations/vi.js +1 -1
  176. package/dist/translations/vi.umd.js +1 -1
  177. package/dist/translations/zh-cn.js +1 -1
  178. package/dist/translations/zh-cn.umd.js +1 -1
  179. package/dist/translations/zh.js +1 -1
  180. package/dist/translations/zh.umd.js +1 -1
  181. package/dist/ui/mediaformview.d.ts +83 -83
  182. package/dist/utils.d.ts +61 -61
  183. package/package.json +10 -10
@@ -1,35 +1,35 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module media-embed/mediaembedediting
7
- */
8
- import { Plugin, type Editor } from '@ckeditor/ckeditor5-core';
9
- import { MediaRegistry } from './mediaregistry.js';
10
- import '../theme/mediaembedediting.css';
6
+ * @module media-embed/mediaembedediting
7
+ */
8
+ import { Plugin, type Editor } from "@ckeditor/ckeditor5-core";
9
+ import { MediaRegistry } from "./mediaregistry.js";
10
+ import "../theme/mediaembedediting.css";
11
11
  /**
12
- * The media embed editing feature.
13
- */
12
+ * The media embed editing feature.
13
+ */
14
14
  export declare class MediaEmbedEditing extends Plugin {
15
- /**
16
- * @inheritDoc
17
- */
18
- static get pluginName(): "MediaEmbedEditing";
19
- /**
20
- * @inheritDoc
21
- */
22
- static get isOfficialPlugin(): true;
23
- /**
24
- * The media registry managing the media providers in the editor.
25
- */
26
- registry: MediaRegistry;
27
- /**
28
- * @inheritDoc
29
- */
30
- constructor(editor: Editor);
31
- /**
32
- * @inheritDoc
33
- */
34
- init(): void;
15
+ /**
16
+ * @inheritDoc
17
+ */
18
+ static get pluginName(): "MediaEmbedEditing";
19
+ /**
20
+ * @inheritDoc
21
+ */
22
+ static override get isOfficialPlugin(): true;
23
+ /**
24
+ * The media registry managing the media providers in the editor.
25
+ */
26
+ registry: MediaRegistry;
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ constructor(editor: Editor);
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ init(): void;
35
35
  }
@@ -1,17 +1,17 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module media-embed/mediaembedresize/constants
7
- */
6
+ * @module media-embed/mediaembedresize/constants
7
+ */
8
8
  /**
9
- * The view class applied to a resized media embed figure.
10
- *
11
- * Shared between the editing plugin (which toggles it via downcast of `resizedWidth` and consumes
12
- * it on upcast) and the handles plugin (which adds it during drag and strips it on commit), so
13
- * both layers agree on the exact class name.
14
- *
15
- * @internal
16
- */
9
+ * The view class applied to a resized media embed figure.
10
+ *
11
+ * Shared between the editing plugin (which toggles it via downcast of `resizedWidth` and consumes
12
+ * it on upcast) and the handles plugin (which adds it during drag and strips it on commit), so
13
+ * both layers agree on the exact class name.
14
+ *
15
+ * @internal
16
+ */
17
17
  export declare const RESIZED_MEDIA_CLASS = "media_resized";
@@ -0,0 +1,64 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ /**
6
+ * @module media-embed/mediaembedresize/mediaembedcustomresizeui
7
+ */
8
+ import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
+ import { ContextualBalloon } from "@ckeditor/ckeditor5-ui";
10
+ /**
11
+ * The custom resize media embed UI plugin.
12
+ *
13
+ * The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
14
+ */
15
+ export declare class MediaEmbedCustomResizeUI extends Plugin {
16
+ /**
17
+ * The contextual balloon plugin instance.
18
+ */
19
+ private _balloon?;
20
+ /**
21
+ * A form used to set the custom resize width.
22
+ */
23
+ private _form?;
24
+ /**
25
+ * @inheritDoc
26
+ */
27
+ static get requires(): PluginDependenciesOf<[ContextualBalloon]>;
28
+ /**
29
+ * @inheritDoc
30
+ */
31
+ static get pluginName(): "MediaEmbedCustomResizeUI";
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ static override get isOfficialPlugin(): true;
36
+ /**
37
+ * @inheritDoc
38
+ */
39
+ override destroy(): void;
40
+ /**
41
+ * Creates the {@link module:media-embed/mediaembedresize/ui/mediaembedcustomresizeformview~MediaEmbedCustomResizeFormView} form.
42
+ */
43
+ private _createForm;
44
+ /**
45
+ * Shows the {@link #_form} in the {@link #_balloon}.
46
+ *
47
+ * @internal
48
+ */
49
+ _showForm(unit: string): void;
50
+ /**
51
+ * Removes the {@link #_form} from the {@link #_balloon}.
52
+ *
53
+ * @param focusEditable Controls whether the editing view is focused afterwards.
54
+ */
55
+ private _hideForm;
56
+ /**
57
+ * Returns `true` when the {@link #_form} is the visible view in the {@link #_balloon}.
58
+ */
59
+ private get _isVisible();
60
+ /**
61
+ * Returns `true` when the {@link #_form} is in the {@link #_balloon}.
62
+ */
63
+ private get _isInBalloon();
64
+ }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ /**
6
+ * @module media-embed/mediaembedresize/mediaembedresizebuttons
7
+ */
8
+ import { Plugin, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
+ import { MediaEmbedResizeEditing } from "./mediaembedresizeediting.js";
10
+ /**
11
+ * The media embed resize buttons plugin.
12
+ *
13
+ * It adds a possibility to resize media embeds using the toolbar dropdown or individual buttons,
14
+ * depending on the plugin configuration.
15
+ */
16
+ export declare class MediaEmbedResizeButtons extends Plugin {
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ static get requires(): PluginDependenciesOf<[MediaEmbedResizeEditing]>;
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get pluginName(): "MediaEmbedResizeButtons";
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ static override get isOfficialPlugin(): true;
29
+ private readonly _resizeUnit;
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ constructor(editor: Editor);
34
+ /**
35
+ * @inheritDoc
36
+ */
37
+ init(): void;
38
+ /**
39
+ * Creates a standalone button component for the given resize option.
40
+ */
41
+ private _registerMediaEmbedResizeButton;
42
+ /**
43
+ * Creates the dropdown component containing all resize options.
44
+ */
45
+ private _registerMediaEmbedResizeDropdown;
46
+ /**
47
+ * Returns a label for the given resize option.
48
+ */
49
+ private _getOptionLabelValue;
50
+ /**
51
+ * Returns list item definitions for the resize dropdown.
52
+ */
53
+ private _getResizeDropdownListItemDefinitions;
54
+ }
@@ -1,47 +1,51 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- import { Plugin } from '@ckeditor/ckeditor5-core';
6
- import { MediaEmbedEditing } from '../mediaembedediting.js';
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ import { Plugin, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
6
+ import { MediaEmbedEditing } from "../mediaembedediting.js";
7
7
  /**
8
- * The media embed resize editing feature.
9
- *
10
- * It adds the ability to resize each media embed using handles.
11
- */
8
+ * The media embed resize editing feature.
9
+ *
10
+ * It adds the ability to resize each media embed using handles.
11
+ */
12
12
  export declare class MediaEmbedResizeEditing extends Plugin {
13
- /**
14
- * @inheritDoc
15
- */
16
- static get requires(): readonly [typeof MediaEmbedEditing];
17
- /**
18
- * @inheritDoc
19
- */
20
- static get pluginName(): "MediaEmbedResizeEditing";
21
- /**
22
- * @inheritDoc
23
- * @internal
24
- */
25
- static get licenseFeatureCode(): string;
26
- /**
27
- * @inheritDoc
28
- */
29
- static get isOfficialPlugin(): true;
30
- /**
31
- * @inheritDoc
32
- */
33
- static get isPremiumPlugin(): true;
34
- /**
35
- * @inheritDoc
36
- */
37
- init(): void;
38
- /**
39
- * @inheritDoc
40
- */
41
- afterInit(): void;
42
- private _registerSchema;
43
- /**
44
- * Registers media embed resize converters.
45
- */
46
- private _registerConverters;
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ static get requires(): PluginDependenciesOf<[MediaEmbedEditing]>;
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ static get pluginName(): "MediaEmbedResizeEditing";
21
+ /**
22
+ * @inheritDoc
23
+ * @internal
24
+ */
25
+ static get licenseFeatureCode(): string;
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ static override get isOfficialPlugin(): true;
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ static override get isPremiumPlugin(): true;
34
+ /**
35
+ * @inheritDoc
36
+ */
37
+ constructor(editor: Editor);
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ init(): void;
42
+ /**
43
+ * @inheritDoc
44
+ */
45
+ afterInit(): void;
46
+ private _registerSchema;
47
+ /**
48
+ * Registers media embed resize converters.
49
+ */
50
+ private _registerConverters;
47
51
  }
@@ -1,42 +1,42 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
5
- import { Plugin } from '@ckeditor/ckeditor5-core';
6
- import { WidgetResize } from '@ckeditor/ckeditor5-widget';
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
6
+ import { WidgetResize } from "@ckeditor/ckeditor5-widget";
7
7
  /**
8
- * The media embed resize by handles feature.
9
- *
10
- * It adds the ability to resize each media embed using handles.
11
- */
8
+ * The media embed resize by handles feature.
9
+ *
10
+ * It adds the ability to resize each media embed using handles.
11
+ */
12
12
  export declare class MediaEmbedResizeHandles extends Plugin {
13
- /**
14
- * @inheritDoc
15
- */
16
- static get requires(): readonly [typeof WidgetResize];
17
- /**
18
- * @inheritDoc
19
- */
20
- static get pluginName(): "MediaEmbedResizeHandles";
21
- /**
22
- * @inheritDoc
23
- */
24
- static get isOfficialPlugin(): true;
25
- /**
26
- * @inheritDoc
27
- */
28
- init(): void;
29
- /**
30
- * Attaches a resizer to every newly inserted media widget. Walks only the ranges
31
- * reported by the differ — never the whole document — so unrelated inserts (e.g.
32
- * pressing Enter to create a paragraph) cost only the differ check.
33
- *
34
- * Each resizer's `isEnabled` is bound to the plugin in {@link #_attachResizer},
35
- * so it auto-tracks the resize command's state.
36
- */
37
- private _setupResizerCreator;
38
- /**
39
- * Attaches a resizer to a single media widget.
40
- */
41
- private _attachResizer;
13
+ /**
14
+ * @inheritDoc
15
+ */
16
+ static get requires(): PluginDependenciesOf<[WidgetResize]>;
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ static get pluginName(): "MediaEmbedResizeHandles";
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static override get isOfficialPlugin(): true;
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ init(): void;
29
+ /**
30
+ * Attaches a resizer to every newly inserted media widget. Walks only the ranges
31
+ * reported by the differ — never the whole document — so unrelated inserts (e.g.
32
+ * pressing Enter to create a paragraph) cost only the differ check.
33
+ *
34
+ * Each resizer's `isEnabled` is bound to the plugin in {@link #_attachResizer},
35
+ * so it auto-tracks the resize command's state.
36
+ */
37
+ private _setupResizerCreator;
38
+ /**
39
+ * Attaches a resizer to a single media widget.
40
+ */
41
+ private _attachResizer;
42
42
  }
@@ -1,40 +1,40 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module media-embed/mediaembedresize/resizemediaembedcommand
7
- */
8
- import { Command } from '@ckeditor/ckeditor5-core';
6
+ * @module media-embed/mediaembedresize/resizemediaembedcommand
7
+ */
8
+ import { Command } from "@ckeditor/ckeditor5-core";
9
9
  /**
10
- * The resize media embed command.
11
- */
10
+ * The resize media embed command.
11
+ */
12
12
  export declare class ResizeMediaEmbedCommand extends Command {
13
- /**
14
- * The current width of the selected media embed, or `null` if not resized.
15
- */
16
- value: string | null;
17
- /**
18
- * @inheritDoc
19
- */
20
- refresh(): void;
21
- /**
22
- * Executes the command.
23
- *
24
- * ```ts
25
- * // Sets the width as a percentage of the parent width:
26
- * editor.execute( 'resizeMediaEmbed', { width: '50%' } );
27
- *
28
- * // Removes the resize and restores the default width:
29
- * editor.execute( 'resizeMediaEmbed', { width: null } );
30
- * ```
31
- *
32
- * @param options
33
- * @param options.width The new width of the media embed as a CSS `width` value
34
- * (e.g. `'50%'`), or `null` to remove the resize.
35
- * @fires execute
36
- */
37
- execute(options: {
38
- width: string | null;
39
- }): void;
13
+ /**
14
+ * The current width of the selected media embed, or `null` if not resized.
15
+ */
16
+ value: string | null;
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ override refresh(): void;
21
+ /**
22
+ * Executes the command.
23
+ *
24
+ * ```ts
25
+ * // Sets the width as a percentage of the parent width:
26
+ * editor.execute( 'resizeMediaEmbed', { width: '50%' } );
27
+ *
28
+ * // Removes the resize and restores the default width:
29
+ * editor.execute( 'resizeMediaEmbed', { width: null } );
30
+ * ```
31
+ *
32
+ * @param options
33
+ * @param options.width The new width of the media embed as a CSS `width` value
34
+ * (e.g. `'50%'`), or `null` to remove the resize.
35
+ * @fires execute
36
+ */
37
+ override execute(options: {
38
+ width: string | null;
39
+ }): void;
40
40
  }
@@ -0,0 +1,118 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ /**
6
+ * @module media-embed/mediaembedresize/ui/mediaembedcustomresizeformview
7
+ */
8
+ import { ButtonView, FocusCycler, LabeledFieldView, View, ViewCollection, type FocusableView, type InputNumberView } from "@ckeditor/ckeditor5-ui";
9
+ import { FocusTracker, KeystrokeHandler, type Locale } from "@ckeditor/ckeditor5-utils";
10
+ import "../../../theme/mediaembedcustomresizeform.css";
11
+ /**
12
+ * The MediaEmbedCustomResizeFormView class.
13
+ *
14
+ * @internal
15
+ */
16
+ export declare class MediaEmbedCustomResizeFormView extends View {
17
+ /**
18
+ * Tracks information about the DOM focus in the form.
19
+ */
20
+ readonly focusTracker: FocusTracker;
21
+ /**
22
+ * An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
23
+ */
24
+ readonly keystrokes: KeystrokeHandler;
25
+ /**
26
+ * Resize unit shortcut.
27
+ */
28
+ readonly unit: string;
29
+ /**
30
+ * The Back button view displayed in the header.
31
+ */
32
+ backButtonView: ButtonView;
33
+ /**
34
+ * A button used to submit the form.
35
+ */
36
+ saveButtonView: ButtonView;
37
+ /**
38
+ * An input with a label.
39
+ */
40
+ labeledInput: LabeledFieldView<InputNumberView>;
41
+ /**
42
+ * A collection of child views.
43
+ */
44
+ readonly children: ViewCollection;
45
+ /**
46
+ * A collection of views which can be focused in the form.
47
+ */
48
+ protected readonly _focusables: ViewCollection<FocusableView>;
49
+ /**
50
+ * Helps cycling over {@link #_focusables} in the form.
51
+ */
52
+ protected readonly _focusCycler: FocusCycler;
53
+ /**
54
+ * An array of form validators used by {@link #isValid}.
55
+ */
56
+ private readonly _validators;
57
+ /**
58
+ * @inheritDoc
59
+ */
60
+ constructor(locale: Locale, unit: string, validators: Array<MediaEmbedCustomResizeFormValidatorCallback>);
61
+ /**
62
+ * @inheritDoc
63
+ */
64
+ override render(): void;
65
+ /**
66
+ * @inheritDoc
67
+ */
68
+ override destroy(): void;
69
+ private _createBackButton;
70
+ private _createSaveButton;
71
+ private _createHeaderView;
72
+ private _createLabeledInputView;
73
+ /**
74
+ * Validates the form and returns `false` when some fields are invalid.
75
+ */
76
+ isValid(): boolean;
77
+ /**
78
+ * Cleans up error and information text of {@link #labeledInput}.
79
+ */
80
+ resetFormStatus(): void;
81
+ /**
82
+ * The native DOM `value` of the input element of {@link #labeledInput}.
83
+ */
84
+ get rawSize(): string | null;
85
+ /**
86
+ * Get numeric value of size. Returns `null` if value is not a number.
87
+ */
88
+ get parsedSize(): number | null;
89
+ /**
90
+ * Returns serialized media embed input size with unit.
91
+ * Returns `null` if value is not a number.
92
+ */
93
+ get sizeWithUnits(): string | null;
94
+ }
95
+ /**
96
+ * Callback used by {@link ~MediaEmbedCustomResizeFormView} to check if passed form value is valid.
97
+ *
98
+ * @internal
99
+ */
100
+ export type MediaEmbedCustomResizeFormValidatorCallback = (form: MediaEmbedCustomResizeFormView) => string | undefined;
101
+ /**
102
+ * Fired when the form view is submitted.
103
+ *
104
+ * @eventName ~MediaEmbedCustomResizeFormView#submit
105
+ */
106
+ export type MediaEmbedCustomResizeFormViewSubmitEvent = {
107
+ name: "submit";
108
+ args: [];
109
+ };
110
+ /**
111
+ * Fired when the form view is canceled.
112
+ *
113
+ * @eventName ~MediaEmbedCustomResizeFormView#cancel
114
+ */
115
+ export type MediaEmbedCustomResizeFormViewCancelEvent = {
116
+ name: "cancel";
117
+ args: [];
118
+ };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ /**
6
+ * @module media-embed/mediaembedresize/utils/getselectedmediaembededitornodes
7
+ */
8
+ import type { ViewElement, ModelElement } from "@ckeditor/ckeditor5-engine";
9
+ import type { Editor } from "@ckeditor/ckeditor5-core";
10
+ /**
11
+ * Finds model, view and DOM element for selected media embed element.
12
+ * Returns `null` if there is no media embed selected.
13
+ *
14
+ * @param editor Editor instance.
15
+ * @internal
16
+ */
17
+ export declare function getSelectedMediaEmbedEditorNodes(editor: Editor): MediaEmbedEditorNodes | null;
18
+ type MediaEmbedEditorNodes = {
19
+ model: ModelElement;
20
+ view: ViewElement;
21
+ dom: HTMLElement;
22
+ };
23
+ export {};
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ /**
6
+ * @module media-embed/mediaembedresize/utils/getselectedmediaembedpossibleresizerange
7
+ */
8
+ import type { Editor } from "@ckeditor/ckeditor5-core";
9
+ /**
10
+ * Returns the min and max resize values for the selected media embed in the specified unit.
11
+ *
12
+ * @param editor Editor instance.
13
+ * @param targetUnit Unit in which dimension will be returned.
14
+ * @returns Possible resize range in numeric form.
15
+ * @internal
16
+ */
17
+ export declare function getSelectedMediaEmbedPossibleResizeRange(editor: Editor, targetUnit: string): PossibleResizeMediaEmbedRange | null;
18
+ /**
19
+ * @internal
20
+ */
21
+ export type PossibleResizeMediaEmbedRange = {
22
+ unit: string;
23
+ lower: number;
24
+ upper: number;
25
+ };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
+ /**
6
+ * @module media-embed/mediaembedresize/utils/getselectedmediaembedwidthinunits
7
+ */
8
+ import { type _DimensionWithUnit } from "@ckeditor/ckeditor5-utils";
9
+ import type { Editor } from "@ckeditor/ckeditor5-core";
10
+ /**
11
+ * Returns media embed width in specified units after resize.
12
+ *
13
+ * * If no media embed is selected or command is disabled, `null` will be returned.
14
+ * * If `targetUnit` percentage is passed then it will return width percentage relative to its ancestor.
15
+ *
16
+ * @param editor Editor instance.
17
+ * @param targetUnit Unit in which dimension will be returned.
18
+ * @returns Parsed media embed width after resize (with unit).
19
+ * @internal
20
+ */
21
+ export declare function getSelectedMediaEmbedWidthInUnits(editor: Editor, targetUnit: string): _DimensionWithUnit | null;