@ckeditor/ckeditor5-media-embed 48.2.0-alpha.7 → 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.
- 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,35 +1,35 @@
|
|
|
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, type Editor } from
|
|
9
|
-
import { MediaRegistry } from
|
|
10
|
-
import
|
|
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
|
-
|
|
13
|
-
|
|
12
|
+
* The media embed editing feature.
|
|
13
|
+
*/
|
|
14
14
|
export declare class MediaEmbedEditing extends Plugin {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
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
|
-
|
|
6
|
+
* @module media-embed/mediaembedresize/constants
|
|
7
|
+
*/
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { Plugin } from
|
|
6
|
-
import { MediaEmbedEditing } 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 Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
6
|
+
import { MediaEmbedEditing } from "../mediaembedediting.js";
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { Plugin } from
|
|
6
|
-
import { WidgetResize } 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 { WidgetResize } from "@ckeditor/ckeditor5-widget";
|
|
7
7
|
/**
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 } from
|
|
6
|
+
* @module media-embed/mediaembedresize/resizemediaembedcommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from "@ckeditor/ckeditor5-core";
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* The resize media embed command.
|
|
11
|
+
*/
|
|
12
12
|
export declare class ResizeMediaEmbedCommand extends Command {
|
|
13
|
-
|
|
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
|
-
|
|
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;
|