@ckeditor/ckeditor5-media-embed 48.8.1-alpha.4 → 49.0.0-alpha.1

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 (186) hide show
  1. package/ckeditor5-metadata.json +108 -12
  2. package/dist/augmentation.d.ts +33 -23
  3. package/dist/automediaembed.d.ts +50 -50
  4. package/dist/converters.d.ts +37 -37
  5. package/dist/index-content.css +54 -6
  6. package/dist/index-content.css.map +1 -0
  7. package/dist/index-editor.css +145 -111
  8. package/dist/index-editor.css.map +1 -0
  9. package/dist/index.css +179 -101
  10. package/dist/index.css.map +1 -1
  11. package/dist/index.d.ts +31 -18
  12. package/dist/index.js +2645 -1087
  13. package/dist/index.js.map +1 -1
  14. package/dist/mediaembed.d.ts +32 -33
  15. package/dist/mediaembedcommand.d.ts +32 -32
  16. package/dist/mediaembedconfig.d.ts +574 -270
  17. package/dist/mediaembedediting.d.ts +29 -30
  18. package/dist/mediaembedresize/constants.d.ts +17 -0
  19. package/dist/mediaembedresize/mediaembedcustomresizeui.d.ts +64 -0
  20. package/dist/mediaembedresize/mediaembedresizebuttons.d.ts +54 -0
  21. package/dist/mediaembedresize/mediaembedresizeediting.d.ts +51 -0
  22. package/dist/mediaembedresize/mediaembedresizehandles.d.ts +42 -0
  23. package/dist/mediaembedresize/resizemediaembedcommand.d.ts +40 -0
  24. package/dist/mediaembedresize/ui/mediaembedcustomresizeformview.d.ts +117 -0
  25. package/dist/mediaembedresize/utils/getselectedmediaembededitornodes.d.ts +23 -0
  26. package/dist/mediaembedresize/utils/getselectedmediaembedpossibleresizerange.d.ts +25 -0
  27. package/dist/mediaembedresize/utils/getselectedmediaembedwidthinunits.d.ts +21 -0
  28. package/dist/mediaembedresize.d.ts +32 -0
  29. package/dist/mediaembedstyle/constants.d.ts +29 -0
  30. package/dist/mediaembedstyle/mediaembedstylecommand.d.ts +72 -0
  31. package/dist/mediaembedstyle/mediaembedstyleediting.d.ts +43 -0
  32. package/dist/mediaembedstyle/mediaembedstyleui.d.ts +81 -0
  33. package/dist/mediaembedstyle/utils.d.ts +23 -0
  34. package/dist/mediaembedstyle.d.ts +33 -0
  35. package/dist/mediaembedtoolbar.d.ts +28 -29
  36. package/dist/mediaembedui.d.ts +33 -33
  37. package/dist/mediaregistry.d.ts +59 -59
  38. package/dist/translations/af.js +1 -1
  39. package/dist/translations/af.umd.js +5 -3
  40. package/dist/translations/ar.js +1 -1
  41. package/dist/translations/ar.umd.js +5 -3
  42. package/dist/translations/ast.js +1 -1
  43. package/dist/translations/ast.umd.js +5 -3
  44. package/dist/translations/az.js +1 -1
  45. package/dist/translations/az.umd.js +5 -3
  46. package/dist/translations/be.js +1 -1
  47. package/dist/translations/be.umd.js +5 -3
  48. package/dist/translations/bg.js +1 -1
  49. package/dist/translations/bg.umd.js +5 -3
  50. package/dist/translations/bn.js +1 -1
  51. package/dist/translations/bn.umd.js +5 -3
  52. package/dist/translations/bs.js +1 -1
  53. package/dist/translations/bs.umd.js +5 -3
  54. package/dist/translations/ca.js +1 -1
  55. package/dist/translations/ca.umd.js +5 -3
  56. package/dist/translations/cs.js +1 -1
  57. package/dist/translations/cs.umd.js +5 -3
  58. package/dist/translations/da.js +1 -1
  59. package/dist/translations/da.umd.js +5 -3
  60. package/dist/translations/de-ch.js +1 -1
  61. package/dist/translations/de-ch.umd.js +5 -3
  62. package/dist/translations/de.js +1 -1
  63. package/dist/translations/de.umd.js +5 -3
  64. package/dist/translations/el.js +1 -1
  65. package/dist/translations/el.umd.js +5 -3
  66. package/dist/translations/en-au.js +1 -1
  67. package/dist/translations/en-au.umd.js +5 -3
  68. package/dist/translations/en-gb.js +1 -1
  69. package/dist/translations/en-gb.umd.js +5 -3
  70. package/dist/translations/en.js +1 -1
  71. package/dist/translations/en.umd.js +5 -3
  72. package/dist/translations/eo.js +1 -1
  73. package/dist/translations/eo.umd.js +5 -3
  74. package/dist/translations/es-co.js +1 -1
  75. package/dist/translations/es-co.umd.js +5 -3
  76. package/dist/translations/es.js +1 -1
  77. package/dist/translations/es.umd.js +5 -3
  78. package/dist/translations/et.js +1 -1
  79. package/dist/translations/et.umd.js +5 -3
  80. package/dist/translations/eu.js +1 -1
  81. package/dist/translations/eu.umd.js +5 -3
  82. package/dist/translations/fa.js +1 -1
  83. package/dist/translations/fa.umd.js +5 -3
  84. package/dist/translations/fi.js +1 -1
  85. package/dist/translations/fi.umd.js +5 -3
  86. package/dist/translations/fr.js +1 -1
  87. package/dist/translations/fr.umd.js +5 -3
  88. package/dist/translations/gl.js +1 -1
  89. package/dist/translations/gl.umd.js +5 -3
  90. package/dist/translations/gu.js +1 -1
  91. package/dist/translations/gu.umd.js +5 -3
  92. package/dist/translations/he.js +1 -1
  93. package/dist/translations/he.umd.js +5 -3
  94. package/dist/translations/hi.js +1 -1
  95. package/dist/translations/hi.umd.js +5 -3
  96. package/dist/translations/hr.js +1 -1
  97. package/dist/translations/hr.umd.js +5 -3
  98. package/dist/translations/hu.js +1 -1
  99. package/dist/translations/hu.umd.js +5 -3
  100. package/dist/translations/hy.js +1 -1
  101. package/dist/translations/hy.umd.js +5 -3
  102. package/dist/translations/id.js +1 -1
  103. package/dist/translations/id.umd.js +5 -3
  104. package/dist/translations/it.js +1 -1
  105. package/dist/translations/it.umd.js +5 -3
  106. package/dist/translations/ja.js +1 -1
  107. package/dist/translations/ja.umd.js +5 -3
  108. package/dist/translations/jv.js +1 -1
  109. package/dist/translations/jv.umd.js +5 -3
  110. package/dist/translations/kk.js +1 -1
  111. package/dist/translations/kk.umd.js +5 -3
  112. package/dist/translations/km.js +1 -1
  113. package/dist/translations/km.umd.js +5 -3
  114. package/dist/translations/kn.js +1 -1
  115. package/dist/translations/kn.umd.js +5 -3
  116. package/dist/translations/ko.js +1 -1
  117. package/dist/translations/ko.umd.js +5 -3
  118. package/dist/translations/ku.js +1 -1
  119. package/dist/translations/ku.umd.js +5 -3
  120. package/dist/translations/lt.js +1 -1
  121. package/dist/translations/lt.umd.js +5 -3
  122. package/dist/translations/lv.js +1 -1
  123. package/dist/translations/lv.umd.js +5 -3
  124. package/dist/translations/ms.js +1 -1
  125. package/dist/translations/ms.umd.js +5 -3
  126. package/dist/translations/nb.js +1 -1
  127. package/dist/translations/nb.umd.js +5 -3
  128. package/dist/translations/ne.js +1 -1
  129. package/dist/translations/ne.umd.js +5 -3
  130. package/dist/translations/nl.js +1 -1
  131. package/dist/translations/nl.umd.js +5 -3
  132. package/dist/translations/no.js +1 -1
  133. package/dist/translations/no.umd.js +5 -3
  134. package/dist/translations/oc.js +1 -1
  135. package/dist/translations/oc.umd.js +5 -3
  136. package/dist/translations/pl.js +1 -1
  137. package/dist/translations/pl.umd.js +5 -3
  138. package/dist/translations/pt-br.js +1 -1
  139. package/dist/translations/pt-br.umd.js +5 -3
  140. package/dist/translations/pt.js +1 -1
  141. package/dist/translations/pt.umd.js +5 -3
  142. package/dist/translations/ro.js +1 -1
  143. package/dist/translations/ro.umd.js +5 -3
  144. package/dist/translations/ru.js +1 -1
  145. package/dist/translations/ru.umd.js +5 -3
  146. package/dist/translations/si.js +1 -1
  147. package/dist/translations/si.umd.js +5 -3
  148. package/dist/translations/sk.js +1 -1
  149. package/dist/translations/sk.umd.js +5 -3
  150. package/dist/translations/sl.js +1 -1
  151. package/dist/translations/sl.umd.js +5 -3
  152. package/dist/translations/sq.js +1 -1
  153. package/dist/translations/sq.umd.js +5 -3
  154. package/dist/translations/sr-latn.js +1 -1
  155. package/dist/translations/sr-latn.umd.js +5 -3
  156. package/dist/translations/sr.js +1 -1
  157. package/dist/translations/sr.umd.js +5 -3
  158. package/dist/translations/sv.js +1 -1
  159. package/dist/translations/sv.umd.js +5 -3
  160. package/dist/translations/th.js +1 -1
  161. package/dist/translations/th.umd.js +5 -3
  162. package/dist/translations/ti.js +1 -1
  163. package/dist/translations/ti.umd.js +5 -3
  164. package/dist/translations/tk.js +1 -1
  165. package/dist/translations/tk.umd.js +5 -3
  166. package/dist/translations/tr.js +1 -1
  167. package/dist/translations/tr.umd.js +5 -3
  168. package/dist/translations/tt.js +1 -1
  169. package/dist/translations/tt.umd.js +5 -3
  170. package/dist/translations/ug.js +1 -1
  171. package/dist/translations/ug.umd.js +5 -3
  172. package/dist/translations/uk.js +1 -1
  173. package/dist/translations/uk.umd.js +5 -3
  174. package/dist/translations/ur.js +1 -1
  175. package/dist/translations/ur.umd.js +5 -3
  176. package/dist/translations/uz.js +1 -1
  177. package/dist/translations/uz.umd.js +5 -3
  178. package/dist/translations/vi.js +1 -1
  179. package/dist/translations/vi.umd.js +5 -3
  180. package/dist/translations/zh-cn.js +1 -1
  181. package/dist/translations/zh-cn.umd.js +5 -3
  182. package/dist/translations/zh.js +1 -1
  183. package/dist/translations/zh.umd.js +5 -3
  184. package/dist/ui/mediaformview.d.ts +82 -83
  185. package/dist/utils.d.ts +61 -61
  186. package/package.json +10 -10
@@ -4,7 +4,7 @@
4
4
  "name": "Media embed",
5
5
  "className": "MediaEmbed",
6
6
  "description": "Allows for inserting embeddable media such as YouTube or Vimeo videos, Instagram posts and tweets or Google Maps into your rich-text content.",
7
- "docs": "features/media-embed.html",
7
+ "docs": "features/media-embed/media-embed.html",
8
8
  "path": "src/mediaembed.ts",
9
9
  "uiComponents": [
10
10
  {
@@ -37,27 +37,25 @@
37
37
  },
38
38
  {
39
39
  "elements": "div",
40
- "styles": [
41
- "height",
42
- "padding-bottom",
43
- "position"
44
- ],
45
40
  "isAlternative": true,
46
- "_comment": "If `config.mediaEmbed.previewsInData` is turned on, the media preview is displayed in the view."
41
+ "_comment": "A plain wrapper element placed between the outer `<div data-oembed-url>` and the preview `<iframe>`."
47
42
  },
48
43
  {
49
44
  "elements": "iframe",
50
45
  "styles": [
46
+ "aspect-ratio",
47
+ "border",
48
+ "display",
51
49
  "height",
52
- "left",
53
- "position",
54
- "top",
55
50
  "width"
56
51
  ],
57
52
  "attributes": [
58
53
  "*allow*",
59
54
  "frameborder",
60
- "src"
55
+ "height",
56
+ "referrerpolicy",
57
+ "src",
58
+ "width"
61
59
  ],
62
60
  "isAlternative": true,
63
61
  "_comment": "If `config.mediaEmbed.previewsInData` is turned on, the media preview is displayed in the view."
@@ -72,11 +70,109 @@
72
70
  }
73
71
  ]
74
72
  },
73
+ {
74
+ "name": "Media embed resize",
75
+ "className": "MediaEmbedResize",
76
+ "description": "Allows for resizing media embeds using drag handles, a toolbar dropdown, or standalone buttons for predefined sizes plus a custom-width balloon.",
77
+ "docs": "features/media-embed/media-embed-resize.html",
78
+ "path": "src/mediaembedresize.ts",
79
+ "requires": [
80
+ "MediaEmbed"
81
+ ],
82
+ "htmlOutput": [
83
+ {
84
+ "elements": "figure",
85
+ "classes": "media_resized",
86
+ "styles": [
87
+ "width"
88
+ ]
89
+ }
90
+ ]
91
+ },
92
+ {
93
+ "name": "Media embed style",
94
+ "className": "MediaEmbedStyle",
95
+ "description": "Adds configurable styles (such as alignments) to media embeds.",
96
+ "docs": "features/media-embed/media-embed-styles.html",
97
+ "path": "src/mediaembedstyle.ts",
98
+ "requires": [
99
+ "MediaEmbed"
100
+ ],
101
+ "uiComponents": [
102
+ {
103
+ "type": "Button",
104
+ "name": "mediaEmbed:alignLeft",
105
+ "toolbars": [
106
+ "mediaEmbed.toolbar"
107
+ ],
108
+ "iconName": "IconObjectInlineLeft"
109
+ },
110
+ {
111
+ "type": "Button",
112
+ "name": "mediaEmbed:alignBlockLeft",
113
+ "toolbars": [
114
+ "mediaEmbed.toolbar"
115
+ ],
116
+ "iconName": "IconObjectLeft"
117
+ },
118
+ {
119
+ "type": "Button",
120
+ "name": "mediaEmbed:alignCenter",
121
+ "toolbars": [
122
+ "mediaEmbed.toolbar"
123
+ ],
124
+ "iconName": "IconObjectCenter"
125
+ },
126
+ {
127
+ "type": "Button",
128
+ "name": "mediaEmbed:alignBlockRight",
129
+ "toolbars": [
130
+ "mediaEmbed.toolbar"
131
+ ],
132
+ "iconName": "IconObjectRight"
133
+ },
134
+ {
135
+ "type": "Button",
136
+ "name": "mediaEmbed:alignRight",
137
+ "toolbars": [
138
+ "mediaEmbed.toolbar"
139
+ ],
140
+ "iconName": "IconObjectInlineRight"
141
+ },
142
+ {
143
+ "type": "SplitButton",
144
+ "name": "mediaEmbed:wrapText",
145
+ "toolbars": [
146
+ "mediaEmbed.toolbar"
147
+ ],
148
+ "iconName": "IconObjectInlineLeft"
149
+ },
150
+ {
151
+ "type": "SplitButton",
152
+ "name": "mediaEmbed:breakText",
153
+ "toolbars": [
154
+ "mediaEmbed.toolbar"
155
+ ],
156
+ "iconName": "IconObjectCenter"
157
+ }
158
+ ],
159
+ "htmlOutput": [
160
+ {
161
+ "elements": "figure",
162
+ "classes": [
163
+ "media-style-align-left",
164
+ "media-style-block-align-left",
165
+ "media-style-block-align-right",
166
+ "media-style-align-right"
167
+ ]
168
+ }
169
+ ]
170
+ },
75
171
  {
76
172
  "name": "Media embed toolbar",
77
173
  "className": "MediaEmbedToolbar",
78
174
  "description": "Implements an optional toolbar for media embed that shows when the media element is selected.",
79
- "docs": "features/media-embed.html",
175
+ "docs": "features/media-embed/media-embed.html",
80
176
  "path": "src/mediaembedtoolbar.ts",
81
177
  "requires": [
82
178
  "MediaEmbed"
@@ -1,25 +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
- */
5
- import type { MediaEmbedConfig, AutoMediaEmbed, MediaEmbed, MediaEmbedEditing, MediaEmbedToolbar, MediaEmbedUI, MediaEmbedCommand } from './index.js';
6
- declare module '@ckeditor/ckeditor5-core' {
7
- interface EditorConfig {
8
- /**
9
- * The configuration of the {@link module:media-embed/mediaembed~MediaEmbed} feature.
10
- *
11
- * Read more in {@link module:media-embed/mediaembedconfig~MediaEmbedConfig}.
12
- */
13
- mediaEmbed?: MediaEmbedConfig;
14
- }
15
- interface PluginsMap {
16
- [AutoMediaEmbed.pluginName]: AutoMediaEmbed;
17
- [MediaEmbed.pluginName]: MediaEmbed;
18
- [MediaEmbedEditing.pluginName]: MediaEmbedEditing;
19
- [MediaEmbedToolbar.pluginName]: MediaEmbedToolbar;
20
- [MediaEmbedUI.pluginName]: MediaEmbedUI;
21
- }
22
- interface CommandsMap {
23
- mediaEmbed: MediaEmbedCommand;
24
- }
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 type { MediaEmbedConfig, AutoMediaEmbed, MediaEmbed, MediaEmbedEditing, MediaEmbedToolbar, MediaEmbedUI, MediaEmbedCommand, MediaEmbedResize, MediaEmbedResizeEditing, MediaEmbedResizeHandles, MediaEmbedResizeButtons, MediaEmbedCustomResizeUI, ResizeMediaEmbedCommand, MediaEmbedStyle, MediaEmbedStyleEditing, MediaEmbedStyleUI, MediaEmbedStyleCommand } from "./index.js";
6
+ declare module "@ckeditor/ckeditor5-core" {
7
+ interface EditorConfig {
8
+ /**
9
+ * The configuration of the {@link module:media-embed/mediaembed~MediaEmbed} feature.
10
+ *
11
+ * Read more in {@link module:media-embed/mediaembedconfig~MediaEmbedConfig}.
12
+ */
13
+ mediaEmbed?: MediaEmbedConfig;
14
+ }
15
+ interface PluginsMap {
16
+ [AutoMediaEmbed.pluginName]: AutoMediaEmbed;
17
+ [MediaEmbed.pluginName]: MediaEmbed;
18
+ [MediaEmbedEditing.pluginName]: MediaEmbedEditing;
19
+ [MediaEmbedToolbar.pluginName]: MediaEmbedToolbar;
20
+ [MediaEmbedUI.pluginName]: MediaEmbedUI;
21
+ [MediaEmbedResize.pluginName]: MediaEmbedResize;
22
+ [MediaEmbedResizeEditing.pluginName]: MediaEmbedResizeEditing;
23
+ [MediaEmbedResizeHandles.pluginName]: MediaEmbedResizeHandles;
24
+ [MediaEmbedResizeButtons.pluginName]: MediaEmbedResizeButtons;
25
+ [MediaEmbedCustomResizeUI.pluginName]: MediaEmbedCustomResizeUI;
26
+ [MediaEmbedStyle.pluginName]: MediaEmbedStyle;
27
+ [MediaEmbedStyleEditing.pluginName]: MediaEmbedStyleEditing;
28
+ [MediaEmbedStyleUI.pluginName]: MediaEmbedStyleUI;
29
+ }
30
+ interface CommandsMap {
31
+ mediaEmbed: MediaEmbedCommand;
32
+ resizeMediaEmbed: ResizeMediaEmbedCommand;
33
+ mediaStyle: MediaEmbedStyleCommand;
34
+ }
25
35
  }
@@ -1,55 +1,55 @@
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/automediaembed
7
- */
8
- import { type Editor, Plugin } from '@ckeditor/ckeditor5-core';
9
- import { Clipboard } from '@ckeditor/ckeditor5-clipboard';
10
- import { Delete } from '@ckeditor/ckeditor5-typing';
11
- import { Undo } from '@ckeditor/ckeditor5-undo';
6
+ * @module media-embed/automediaembed
7
+ */
8
+ import { type Editor, Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
9
+ import { Clipboard } from "@ckeditor/ckeditor5-clipboard";
10
+ import { Delete } from "@ckeditor/ckeditor5-typing";
11
+ import { Undo } from "@ckeditor/ckeditor5-undo";
12
12
  /**
13
- * The auto-media embed plugin. It recognizes media links in the pasted content and embeds
14
- * them shortly after they are injected into the document.
15
- */
13
+ * The auto-media embed plugin. It recognizes media links in the pasted content and embeds
14
+ * them shortly after they are injected into the document.
15
+ */
16
16
  export declare class AutoMediaEmbed extends Plugin {
17
- /**
18
- * @inheritDoc
19
- */
20
- static get requires(): readonly [typeof Clipboard, typeof Delete, typeof Undo];
21
- /**
22
- * @inheritDoc
23
- */
24
- static get pluginName(): "AutoMediaEmbed";
25
- /**
26
- * @inheritDoc
27
- */
28
- static get isOfficialPlugin(): true;
29
- /**
30
- * The paste–to–embed `setTimeout` ID. Stored as a property to allow
31
- * cleaning of the timeout.
32
- */
33
- private _timeoutId;
34
- /**
35
- * The position where the `<media>` element will be inserted after the timeout,
36
- * determined each time the new content is pasted into the document.
37
- */
38
- private _positionToInsert;
39
- /**
40
- * @inheritDoc
41
- */
42
- constructor(editor: Editor);
43
- /**
44
- * @inheritDoc
45
- */
46
- init(): void;
47
- /**
48
- * Analyzes the part of the document between provided positions in search for a URL representing media.
49
- * When the URL is found, it is automatically converted into media.
50
- *
51
- * @param leftPosition Left position of the selection.
52
- * @param rightPosition Right position of the selection.
53
- */
54
- private _embedMediaBetweenPositions;
17
+ /**
18
+ * @inheritDoc
19
+ */
20
+ static get requires(): PluginDependenciesOf<[Clipboard, Delete, Undo]>;
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get pluginName(): "AutoMediaEmbed";
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ static override get isOfficialPlugin(): true;
29
+ /**
30
+ * The paste–to–embed `setTimeout` ID. Stored as a property to allow
31
+ * cleaning of the timeout.
32
+ */
33
+ private _timeoutId;
34
+ /**
35
+ * The position where the `<media>` element will be inserted after the timeout,
36
+ * determined each time the new content is pasted into the document.
37
+ */
38
+ private _positionToInsert;
39
+ /**
40
+ * @inheritDoc
41
+ */
42
+ constructor(editor: Editor);
43
+ /**
44
+ * @inheritDoc
45
+ */
46
+ init(): void;
47
+ /**
48
+ * Analyzes the part of the document between provided positions in search for a URL representing media.
49
+ * When the URL is found, it is automatically converted into media.
50
+ *
51
+ * @param leftPosition Left position of the selection.
52
+ * @param rightPosition Right position of the selection.
53
+ */
54
+ private _embedMediaBetweenPositions;
55
55
  }
@@ -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
- */
5
- import type { DowncastDispatcher } from '@ckeditor/ckeditor5-engine';
6
- import { type MediaRegistry } from './mediaregistry.js';
7
- import type { MediaOptions } from './utils.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 type { DowncastDispatcher } from "@ckeditor/ckeditor5-engine";
6
+ import { type MediaRegistry } from "./mediaregistry.js";
7
+ import type { MediaOptions } from "./utils.js";
8
8
  /**
9
- * Returns a function that converts the model "url" attribute to the view representation.
10
- *
11
- * Depending on the configuration, the view representation can be "semantic" (for the data pipeline):
12
- *
13
- * ```html
14
- * <figure class="media">
15
- * <oembed url="foo"></oembed>
16
- * </figure>
17
- * ```
18
- *
19
- * or "non-semantic" (for the editing view pipeline):
20
- *
21
- * ```html
22
- * <figure class="media">
23
- * <div data-oembed-url="foo">[ non-semantic media preview for "foo" ]</div>
24
- * </figure>
25
- * ```
26
- *
27
- * **Note:** Changing the model "url" attribute replaces the entire content of the
28
- * `<figure>` in the view.
29
- *
30
- * @param registry The registry providing
31
- * the media and their content.
32
- * @param options options object with following properties:
33
- * - elementName When set, overrides the default element name for semantic media embeds.
34
- * - renderMediaPreview When `true`, the converter will create the view in the non-semantic form.
35
- * - renderForEditingView When `true`, the converter will create a view specific for the
36
- * editing pipeline (e.g. including CSS classes, content placeholders).
37
- *
38
- * @internal
39
- */
9
+ * Returns a function that converts the model "url" attribute to the view representation.
10
+ *
11
+ * Depending on the configuration, the view representation can be "semantic" (for the data pipeline):
12
+ *
13
+ * ```html
14
+ * <figure class="media">
15
+ * <oembed url="foo"></oembed>
16
+ * </figure>
17
+ * ```
18
+ *
19
+ * or "non-semantic" (for the editing view pipeline):
20
+ *
21
+ * ```html
22
+ * <figure class="media">
23
+ * <div data-oembed-url="foo">[ non-semantic media preview for "foo" ]</div>
24
+ * </figure>
25
+ * ```
26
+ *
27
+ * **Note:** Changing the model "url" attribute replaces the entire content of the
28
+ * `<figure>` in the view.
29
+ *
30
+ * @param registry The registry providing
31
+ * the media and their content.
32
+ * @param options options object with following properties:
33
+ * - elementName When set, overrides the default element name for semantic media embeds.
34
+ * - renderMediaPreview When `true`, the converter will create the view in the non-semantic form.
35
+ * - renderForEditingView When `true`, the converter will create a view specific for the
36
+ * editing pipeline (e.g. including CSS classes, content placeholders).
37
+ *
38
+ * @internal
39
+ */
40
40
  export declare function modelToViewUrlAttributeConverter(registry: MediaRegistry, options: MediaOptions): (dispatcher: DowncastDispatcher) => void;
@@ -2,9 +2,57 @@
2
2
  * @license Copyright (c) 2003-2026, 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
- .ck-content .media{
6
- clear:both;
7
- min-width:15em;
8
- margin:.9em 0;
9
- display:block;
10
- }
5
+ .ck-content .media {
6
+ clear: both;
7
+ min-width: 15em;
8
+ margin: .9em auto;
9
+ display: block;
10
+ }
11
+
12
+ .ck-content .media:has( > div[data-oembed-url*="open.spotify.com"]) {
13
+ width: 300px;
14
+ min-width: 286px;
15
+ }
16
+
17
+ .ck-content .media.media_resized {
18
+ box-sizing: border-box;
19
+ max-width: 100%;
20
+ display: block;
21
+
22
+ & > div[data-oembed-url] {
23
+ width: 100%;
24
+ }
25
+ }
26
+
27
+ :root, :host {
28
+ --ck-content-media-style-spacing: 1.5em;
29
+ }
30
+
31
+ .ck-content {
32
+ & .media.media-style-align-left, & .media.media-style-align-right {
33
+ clear: none;
34
+ width: 100%;
35
+ }
36
+
37
+ & .media.media-style-align-left {
38
+ float: left;
39
+ margin-right: var(--ck-content-media-style-spacing);
40
+ }
41
+
42
+ & .media.media-style-align-right {
43
+ float: right;
44
+ margin-left: var(--ck-content-media-style-spacing);
45
+ }
46
+
47
+ & .media.media-style-block-align-left {
48
+ margin-left: 0;
49
+ margin-right: auto;
50
+ }
51
+
52
+ & .media.media-style-block-align-right {
53
+ margin-left: auto;
54
+ margin-right: 0;
55
+ }
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M,CAAC,KAAK,CAAC,CAAC,IAAI;AACtB,CAAC,CAAC;;AAEF,CAAC,CDgCA,CAAA,CAAA,CAAA,KAAA,CAAA,KAAA,CAAA,KAAA,CAAA,KAAA,CAAA,KAAA,CAAA,KAAA,CAAA;AC/BD,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI;AACrB,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACnB,CAAC,CAAC;AACF;;AAEA,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC","file":"index-content.css.map","sourcesContent":["/*\n * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.\n * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options\n */\n\n.ck-content .media {\n\t/* Don't allow floated content overlap the media.\n\thttps://github.com/ckeditor/ckeditor5-media-embed/issues/53 */\n\tclear: both;\n\n\t/* Make sure there is some space between the content and the media. */\n\t/* The first value should be equal to --ck-spacing-large variable if used in the editor context\n\tto avoid the content jumping (See https://github.com/ckeditor/ckeditor5/issues/9825). */\n\tmargin: 0.9em auto;\n\n\t/* Make sure media is not overriden with Bootstrap default `flex` value.\n\tSee: https://github.com/ckeditor/ckeditor5/issues/1373. */\n\tdisplay: block;\n\n\t/* Give the media some minimal width in the content to prevent them\n\tfrom being \"squashed\" in tight spaces, e.g. in table cells (https://github.com/ckeditor/ckeditor5-media-embed/issues/44) */\n\tmin-width: 15em;\n}\n\n/* Preserve the historical 300px default size for unresized Spotify embeds (backward\n compatibility). Set on the figure so the selection outline hugs the embed; an inline\n `style=\"width: X%\"` from resize beats this rule.\n Spotify's responsive breakpoint is 280px — below it the embed's internal layout\n switches and the iframe's declared aspect ratio no longer matches. The 286px min-width\n reserves 3px per side for the widget border that track changes suggestion markers\n (insertion, deletion, formatInline) paint on the figure, so the iframe interior stays\n at or above 280px even with an active marker. */\n.ck-content .media:has(> div[data-oembed-url*=\"open.spotify.com\"]) {\n\twidth: 300px;\n\tmin-width: 286px;\n}\n.ck-content .media.media_resized {\n\tdisplay: block;\n\tbox-sizing: border-box;\n\tmax-width: 100%;\n\n\t/* The wrapper should fill the figure when an explicit width is set. */\n\t& > div[data-oembed-url] {\n\t\twidth: 100%;\n\t}\n}\n:root,\n:host {\n\t/* Side spacing between a floated media and surrounding text. */\n\t--ck-content-media-style-spacing: 1.5em;\n}\n.ck-content {\n\t/* `clear: none` lets multiple floats stack horizontally. `width: 100%` keeps float\n\t from collapsing the iframe to its 300×150 default; resize's inline `style=\"width: …\"`\n\t and Spotify's `:has()` rule in mediaembedediting.css both win on specificity. */\n\t& .media.media-style-align-left,\n\t& .media.media-style-align-right {\n\t\tclear: none;\n\t\twidth: 100%;\n\t}\n\n\t& .media.media-style-align-left {\n\t\tfloat: left;\n\t\tmargin-right: var(--ck-content-media-style-spacing);\n\t}\n\n\t& .media.media-style-align-right {\n\t\tfloat: right;\n\t\tmargin-left: var(--ck-content-media-style-spacing);\n\t}\n\n\t/* Margin-auto shifts a width-constrained figure within its line — a no-op for full-width\n\t figures, visible once a width constraint applies (resize's inline width, or Spotify's\n\t backward-compat 300px). */\n\t& .media.media-style-block-align-left {\n\t\tmargin-left: 0;\n\t\tmargin-right: auto;\n\t}\n\n\t& .media.media-style-block-align-right {\n\t\tmargin-left: auto;\n\t\tmargin-right: 0;\n\t}\n}\n",".ck-content .media {\n clear: both;\n min-width: 15em;\n margin: .9em auto;\n display: block;\n}\n\n.ck-content .media:has( > div[data-oembed-url*=\"open.spotify.com\"]) {\n width: 300px;\n min-width: 286px;\n}\n\n.ck-content .media.media_resized {\n box-sizing: border-box;\n max-width: 100%;\n display: block;\n\n & > div[data-oembed-url] {\n width: 100%;\n }\n}\n\n:root, :host {\n --ck-content-media-style-spacing: 1.5em;\n}\n\n.ck-content {\n & .media.media-style-align-left, & .media.media-style-align-right {\n clear: none;\n width: 100%;\n }\n\n & .media.media-style-align-left {\n float: left;\n margin-right: var(--ck-content-media-style-spacing);\n }\n\n & .media.media-style-align-right {\n float: right;\n margin-left: var(--ck-content-media-style-spacing);\n }\n\n & .media.media-style-block-align-left {\n margin-left: 0;\n margin-right: auto;\n }\n\n & .media.media-style-block-align-right {\n margin-left: auto;\n margin-right: 0;\n }\n}\n\n/*# sourceMappingURL=index-content.css.map */"]}