@ckeditor/ckeditor5-media-embed 48.2.0 → 48.3.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.
- package/ckeditor5-metadata.json +1 -1
- package/dist/augmentation.d.ts +33 -31
- package/dist/automediaembed.d.ts +50 -50
- package/dist/converters.d.ts +37 -37
- package/dist/index-editor.css +26 -0
- package/dist/index.css +26 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +29 -26
- package/dist/index.js +2601 -1956
- package/dist/index.js.map +1 -1
- package/dist/mediaembed.d.ts +33 -33
- package/dist/mediaembedcommand.d.ts +32 -32
- package/dist/mediaembedconfig.d.ts +564 -483
- package/dist/mediaembedediting.d.ts +30 -30
- package/dist/mediaembedresize/constants.d.ts +13 -13
- package/dist/mediaembedresize/mediaembedcustomresizeui.d.ts +64 -0
- package/dist/mediaembedresize/mediaembedresizebuttons.d.ts +54 -0
- package/dist/mediaembedresize/mediaembedresizeediting.d.ts +47 -43
- package/dist/mediaembedresize/mediaembedresizehandles.d.ts +38 -38
- package/dist/mediaembedresize/resizemediaembedcommand.d.ts +35 -35
- package/dist/mediaembedresize/ui/mediaembedcustomresizeformview.d.ts +118 -0
- package/dist/mediaembedresize/utils/getselectedmediaembededitornodes.d.ts +23 -0
- package/dist/mediaembedresize/utils/getselectedmediaembedpossibleresizerange.d.ts +25 -0
- package/dist/mediaembedresize/utils/getselectedmediaembedwidthinunits.d.ts +21 -0
- package/dist/mediaembedresize.d.ts +28 -25
- package/dist/mediaembedstyle/constants.d.ts +22 -22
- package/dist/mediaembedstyle/mediaembedstylecommand.d.ts +67 -67
- package/dist/mediaembedstyle/mediaembedstyleediting.d.ts +39 -39
- package/dist/mediaembedstyle/mediaembedstyleui.d.ts +76 -76
- package/dist/mediaembedstyle/utils.d.ts +18 -18
- package/dist/mediaembedstyle.d.ts +29 -29
- package/dist/mediaembedtoolbar.d.ts +28 -28
- package/dist/mediaembedui.d.ts +33 -33
- package/dist/mediaregistry.d.ts +59 -59
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/dist/ui/mediaformview.d.ts +83 -83
- package/dist/utils.d.ts +61 -61
- package/package.json +10 -10
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin } from
|
|
9
|
-
import { MediaEmbedResizeEditing } from
|
|
10
|
-
import { MediaEmbedResizeHandles } from
|
|
11
|
-
import
|
|
6
|
+
* @module media-embed/mediaembedresize
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { MediaEmbedResizeEditing } from "./mediaembedresize/mediaembedresizeediting.js";
|
|
10
|
+
import { MediaEmbedResizeHandles } from "./mediaembedresize/mediaembedresizehandles.js";
|
|
11
|
+
import { MediaEmbedResizeButtons } from "./mediaembedresize/mediaembedresizebuttons.js";
|
|
12
|
+
import { MediaEmbedCustomResizeUI } from "./mediaembedresize/mediaembedcustomresizeui.js";
|
|
13
|
+
import "../theme/mediaembedresize.css";
|
|
12
14
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
* The media embed resize plugin.
|
|
16
|
+
*
|
|
17
|
+
* It adds a possibility to resize each media embed using handles, toolbar buttons,
|
|
18
|
+
* or a balloon-hosted custom-width input.
|
|
19
|
+
*/
|
|
17
20
|
export declare class MediaEmbedResize extends Plugin {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
static get requires(): PluginDependenciesOf<[MediaEmbedResizeEditing, MediaEmbedResizeHandles, MediaEmbedCustomResizeUI, MediaEmbedResizeButtons]>;
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get pluginName(): "MediaEmbedResize";
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
static override get isOfficialPlugin(): true;
|
|
30
33
|
}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import type { MediaStyleDropdownDefinition, NormalizedMediaStyleOption } from
|
|
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 { MediaStyleDropdownDefinition, NormalizedMediaStyleOption } from "../mediaembedconfig.js";
|
|
6
6
|
/**
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
* Built-in style options provided by the plugin. Integrators can refer to these by
|
|
8
|
+
* name in {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#styles `config.mediaEmbed.styles`}
|
|
9
|
+
* to opt out, override individual fields, or coexist with custom styles.
|
|
10
|
+
*
|
|
11
|
+
* @internal
|
|
12
|
+
*/
|
|
13
13
|
export declare const DEFAULT_OPTIONS: Record<string, NormalizedMediaStyleOption>;
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
* Short icon-name aliases that can be used as the `icon` value in a media style
|
|
16
|
+
* option definition. Matches the alias set exposed by the image styles feature so
|
|
17
|
+
* the two APIs feel symmetrical.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
21
|
export declare const DEFAULT_ICONS: Record<string, string>;
|
|
22
22
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
23
|
+
* Built-in dropdown groupings. Each entry references built-in style component names. If any
|
|
24
|
+
* items are filtered out by configuration, the dropdown is rebuilt from the remaining names
|
|
25
|
+
* (or skipped entirely if fewer than two remain).
|
|
26
|
+
*
|
|
27
|
+
* @internal
|
|
28
|
+
*/
|
|
29
29
|
export declare const DEFAULT_DROPDOWN_DEFINITIONS: Array<MediaStyleDropdownDefinition>;
|
|
@@ -1,72 +1,72 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import { Command, type Editor } from
|
|
9
|
-
import type { NormalizedMediaStyleOption } from
|
|
6
|
+
* @module media-embed/mediaembedstyle/mediaembedstylecommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command, type Editor } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import type { NormalizedMediaStyleOption } from "../mediaembedconfig.js";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
* The media embed style command. It is used to apply a style option (e.g. an alignment) to a
|
|
12
|
+
* selected media embed.
|
|
13
|
+
*
|
|
14
|
+
* The set of accepted style values comes from the resolved
|
|
15
|
+
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#styles `config.mediaEmbed.styles`}
|
|
16
|
+
* options. Values not in that set are silently rejected by {@link #execute}.
|
|
17
|
+
*/
|
|
18
18
|
export declare class MediaEmbedStyleCommand extends Command {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
19
|
+
/**
|
|
20
|
+
* The currently-applied style name. `false` when no style applies — either no media is
|
|
21
|
+
* selected, or the selected media has no `mediaStyle` attribute and no style in
|
|
22
|
+
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#styles `config.mediaEmbed.styles`}
|
|
23
|
+
* is marked `isDefault: true`.
|
|
24
|
+
*/
|
|
25
|
+
value: string | false;
|
|
26
|
+
/**
|
|
27
|
+
* Resolved styles indexed by `name`. Used to look up the `isDefault` flag at execute time
|
|
28
|
+
* (any default-marked style clears the attribute) and to validate that a requested style
|
|
29
|
+
* is part of the resolved options list.
|
|
30
|
+
*/
|
|
31
|
+
private readonly _styles;
|
|
32
|
+
/**
|
|
33
|
+
* The `name` of the first style with `isDefault: true` in the resolved options, or `null`
|
|
34
|
+
* when the integrator did not designate a default. Exposed via {@link #value} when the
|
|
35
|
+
* selected media has no `mediaStyle` attribute, so the default-state UI button can light up.
|
|
36
|
+
* Does not gate the "clear attribute" branch in {@link #execute} — that uses the per-style
|
|
37
|
+
* `isDefault` flag so multi-default configs behave consistently with the downcast.
|
|
38
|
+
*/
|
|
39
|
+
private readonly _defaultStyleName;
|
|
40
|
+
/**
|
|
41
|
+
* Creates an instance of the media embed style command.
|
|
42
|
+
*
|
|
43
|
+
* @param editor The editor instance.
|
|
44
|
+
* @param styles The resolved list of style options that this command will accept.
|
|
45
|
+
*/
|
|
46
|
+
constructor(editor: Editor, styles: Array<NormalizedMediaStyleOption>);
|
|
47
|
+
/**
|
|
48
|
+
* @inheritDoc
|
|
49
|
+
*/
|
|
50
|
+
override refresh(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Executes the command and applies the chosen style to the currently selected media embed.
|
|
53
|
+
*
|
|
54
|
+
* ```ts
|
|
55
|
+
* editor.execute( 'mediaStyle', { value: 'alignLeft' } );
|
|
56
|
+
* editor.execute( 'mediaStyle', { value: 'alignCenter' } ); // removes the attribute — alignCenter is the built-in default
|
|
57
|
+
* editor.execute( 'mediaStyle', { value: null } ); // removes the attribute
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* The default style is encoded on the model as the absence of the `mediaStyle` attribute.
|
|
61
|
+
* Passing any `isDefault: true` style name (or `null`) therefore clears the attribute. Values
|
|
62
|
+
* that are neither falsy, an `isDefault` style, nor present in the resolved options list are
|
|
63
|
+
* silently rejected.
|
|
64
|
+
*
|
|
65
|
+
* @param options
|
|
66
|
+
* @param options.value The name of the style to apply, or `null` to clear the alignment.
|
|
67
|
+
* @fires execute
|
|
68
|
+
*/
|
|
69
|
+
override execute(options: {
|
|
70
|
+
value: string | null;
|
|
71
|
+
}): void;
|
|
72
72
|
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { Plugin } from
|
|
6
|
-
import { MediaEmbedEditing } from
|
|
7
|
-
import type { NormalizedMediaStyleOption } from
|
|
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 { MediaEmbedEditing } from "../mediaembedediting.js";
|
|
7
|
+
import type { NormalizedMediaStyleOption } from "../mediaembedconfig.js";
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
* The media embed style engine plugin. It extends the schema with the `mediaStyle` attribute,
|
|
10
|
+
* registers the {@link module:media-embed/mediaembedstyle/mediaembedstylecommand~MediaEmbedStyleCommand} command,
|
|
11
|
+
* and adds the converters that apply alignment CSS classes to the figure.
|
|
12
|
+
*/
|
|
13
13
|
export declare class MediaEmbedStyleEditing extends Plugin {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
14
|
+
/**
|
|
15
|
+
* The resolved list of media style options. Built once from
|
|
16
|
+
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#styles `config.mediaEmbed.styles`}
|
|
17
|
+
* during {@link #init} and consumed by both the command and the UI plugin (single source of truth).
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
* @readonly
|
|
21
|
+
*/
|
|
22
|
+
normalizedStyles: Array<NormalizedMediaStyleOption>;
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get requires(): PluginDependenciesOf<[MediaEmbedEditing]>;
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static get pluginName(): "MediaEmbedStyleEditing";
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
static override get isOfficialPlugin(): true;
|
|
35
|
+
/**
|
|
36
|
+
* @inheritDoc
|
|
37
|
+
*/
|
|
38
|
+
init(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Registers the downcast and upcast converters for the `mediaStyle` attribute.
|
|
41
|
+
*/
|
|
42
|
+
private _registerConverters;
|
|
43
43
|
}
|
|
@@ -1,81 +1,81 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin } from
|
|
9
|
-
import { MediaEmbedStyleEditing } from
|
|
6
|
+
* @module media-embed/mediaembedstyle/mediaembedstyleui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { MediaEmbedStyleEditing } from "./mediaembedstyleediting.js";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
* The media embed style UI plugin.
|
|
12
|
+
*
|
|
13
|
+
* It registers a button for every style in the resolved
|
|
14
|
+
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#styles `config.mediaEmbed.styles`}
|
|
15
|
+
* list, and the default split-button dropdowns (`mediaEmbed:wrapText`, `mediaEmbed:breakText`)
|
|
16
|
+
* — filtered to the styles that survived configuration. The resulting components can be placed
|
|
17
|
+
* in the {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#toolbar media embed toolbar}.
|
|
18
|
+
*/
|
|
19
19
|
export declare class MediaEmbedStyleUI extends Plugin {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
static get requires(): PluginDependenciesOf<[MediaEmbedStyleEditing]>;
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
static get pluginName(): "MediaEmbedStyleUI";
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
static override get isOfficialPlugin(): true;
|
|
32
|
+
/**
|
|
33
|
+
* @inheritDoc
|
|
34
|
+
*/
|
|
35
|
+
init(): void;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the alignment button definitions sourced from the resolved options list.
|
|
38
|
+
*/
|
|
39
|
+
private _getButtonDefinitions;
|
|
40
|
+
/**
|
|
41
|
+
* Returns the localized titles of the built-in styles and dropdowns.
|
|
42
|
+
*/
|
|
43
|
+
private _getLocalizedTitles;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the split-button dropdown definitions, filtered to the styles present in the
|
|
46
|
+
* resolved options list. Combines the {@link module:media-embed/mediaembedstyle/constants~DEFAULT_DROPDOWN_DEFINITIONS
|
|
47
|
+
* built-in dropdowns} with custom dropdowns declared inline in
|
|
48
|
+
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig#toolbar `config.mediaEmbed.toolbar`}.
|
|
49
|
+
*
|
|
50
|
+
* A dropdown with fewer than two items is skipped — a single-item dropdown carries no value
|
|
51
|
+
* over the flat button. If the configured `defaultItem` was filtered out, the first surviving
|
|
52
|
+
* item becomes the default.
|
|
53
|
+
*
|
|
54
|
+
* When a *custom* dropdown's items reference styles that are not in the resolved options list,
|
|
55
|
+
* a console warning is emitted (the integrator's config was not fully honored). Built-in
|
|
56
|
+
* dropdowns auto-skip silently — they are added by the plugin, not the integrator.
|
|
57
|
+
*/
|
|
58
|
+
private _getDropdownDefinitions;
|
|
59
|
+
/**
|
|
60
|
+
* Scans `config.mediaEmbed.toolbar` for entries shaped like a dropdown definition
|
|
61
|
+
* (objects with both `items` and `defaultItem`) and returns the valid ones. `defaultItem`
|
|
62
|
+
* is the discriminator between our split-button dropdowns and generic toolbar groupings
|
|
63
|
+
* (which use `items` + `label` and have no `defaultItem`).
|
|
64
|
+
*
|
|
65
|
+
* Invalid entries (wrong name prefix, `defaultItem` missing from `items`) are warned and
|
|
66
|
+
* dropped here. Items that reference filtered-out styles are filtered later by
|
|
67
|
+
* {@link #_getDropdownDefinitions}, alongside the same logic that applies to built-in
|
|
68
|
+
* dropdowns.
|
|
69
|
+
*/
|
|
70
|
+
private _collectCustomDropdowns;
|
|
71
|
+
/**
|
|
72
|
+
* Registers a single alignment toggle button in the component factory.
|
|
73
|
+
*/
|
|
74
|
+
private _createButton;
|
|
75
|
+
/**
|
|
76
|
+
* Registers a split-button dropdown grouping a set of alignment buttons. The action button
|
|
77
|
+
* reflects whichever child option is currently `isOn`, falling back to the dropdown's
|
|
78
|
+
* `defaultItem` when nothing is active.
|
|
79
|
+
*/
|
|
80
|
+
private _createDropdown;
|
|
81
81
|
}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import type { ToolbarConfigItem } from
|
|
6
|
-
import type { MediaStyleConfig, MediaStyleDropdownDefinition, NormalizedMediaStyleOption } from
|
|
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 { ToolbarConfigItem } from "@ckeditor/ckeditor5-core";
|
|
6
|
+
import type { MediaStyleConfig, MediaStyleDropdownDefinition, NormalizedMediaStyleOption } from "../mediaembedconfig.js";
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
* Normalizes the {@link module:media-embed/mediaembedconfig~MediaStyleConfig#options style options}
|
|
9
|
+
* provided by the integrator. Each entry is resolved into a full
|
|
10
|
+
* {@link module:media-embed/mediaembedconfig~MediaStyleOptionDefinition} and invalid entries
|
|
11
|
+
* are filtered out with a console warning.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
15
|
export declare function normalizeStyles(configuredStyles: MediaStyleConfig): Array<NormalizedMediaStyleOption>;
|
|
16
16
|
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
* Type guard for toolbar config entries shaped like a media style dropdown definition. The
|
|
18
|
+
* discriminator is `defaultItem` — generic toolbar groupings use `items` + `label` and never
|
|
19
|
+
* carry a `defaultItem` field.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
23
|
export declare function isMediaStyleDropdown(item: ToolbarConfigItem | MediaStyleDropdownDefinition): item is MediaStyleDropdownDefinition;
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
import { Plugin } from
|
|
9
|
-
import { MediaEmbedStyleEditing } from
|
|
10
|
-
import { MediaEmbedStyleUI } from
|
|
11
|
-
import
|
|
6
|
+
* @module media-embed/mediaembedstyle
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { MediaEmbedStyleEditing } from "./mediaembedstyle/mediaembedstyleediting.js";
|
|
10
|
+
import { MediaEmbedStyleUI } from "./mediaembedstyle/mediaembedstyleui.js";
|
|
11
|
+
import "../theme/mediaembedstyle.css";
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
* The media embed style plugin.
|
|
14
|
+
*
|
|
15
|
+
* This is a "glue" plugin which loads the following plugins:
|
|
16
|
+
* * {@link module:media-embed/mediaembedstyle/mediaembedstyleediting~MediaEmbedStyleEditing},
|
|
17
|
+
* * {@link module:media-embed/mediaembedstyle/mediaembedstyleui~MediaEmbedStyleUI}
|
|
18
|
+
*
|
|
19
|
+
* For a detailed overview, check the {@glink features/media-embed/media-embed-styles Media embed styles feature documentation}.
|
|
20
|
+
*/
|
|
21
21
|
export declare class MediaEmbedStyle extends Plugin {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get requires(): PluginDependenciesOf<[MediaEmbedStyleEditing, MediaEmbedStyleUI]>;
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get pluginName(): "MediaEmbedStyle";
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
static override get isOfficialPlugin(): true;
|
|
34
34
|
}
|