@ckeditor/ckeditor5-image 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.
- package/dist/augmentation.d.ts +55 -55
- package/dist/autoimage.d.ts +51 -51
- package/dist/image/converters.d.ts +78 -56
- package/dist/image/imageblockediting.d.ts +58 -58
- package/dist/image/imageediting.d.ts +29 -29
- package/dist/image/imageinlineediting.d.ts +59 -59
- package/dist/image/imageloadobserver.d.ts +40 -40
- package/dist/image/imageplaceholder.d.ts +38 -38
- package/dist/image/imagetypecommand.d.ts +39 -39
- package/dist/image/insertimagecommand.d.ts +65 -65
- package/dist/image/replaceimagesourcecommand.d.ts +46 -46
- package/dist/image/ui/utils.d.ts +21 -21
- package/dist/image/utils.d.ts +89 -56
- package/dist/image.d.ts +33 -33
- package/dist/imageblock.d.ts +33 -33
- package/dist/imagecaption/imagecaptionediting.d.ts +88 -88
- package/dist/imagecaption/imagecaptionui.d.ts +25 -25
- package/dist/imagecaption/imagecaptionutils.d.ts +37 -37
- package/dist/imagecaption/toggleimagecaptioncommand.d.ts +62 -62
- package/dist/imagecaption.d.ts +25 -25
- package/dist/imageconfig.d.ts +698 -698
- package/dist/imageinline.d.ts +33 -33
- package/dist/imageinsert/imageinsertui.d.ts +82 -82
- package/dist/imageinsert/imageinsertviaurlui.d.ts +65 -65
- package/dist/imageinsert/ui/imageinsertformview.d.ts +53 -53
- package/dist/imageinsert/ui/imageinserturlview.d.ts +61 -61
- package/dist/imageinsert.d.ts +32 -32
- package/dist/imageinsertviaurl.d.ts +30 -30
- package/dist/imageresize/imagecustomresizeui.d.ts +60 -60
- package/dist/imageresize/imageresizebuttons.d.ts +66 -66
- package/dist/imageresize/imageresizeediting.d.ts +50 -50
- package/dist/imageresize/imageresizehandles.d.ts +31 -31
- package/dist/imageresize/resizeimagecommand.d.ts +37 -37
- package/dist/imageresize/ui/imagecustomresizeformview.d.ts +125 -125
- package/dist/imageresize/utils/getselectedimageeditornodes.d.ts +17 -17
- package/dist/imageresize/utils/getselectedimagepossibleresizerange.d.ts +18 -18
- package/dist/imageresize/utils/getselectedimagewidthinunits.d.ts +20 -17
- package/dist/imageresize.d.ts +27 -27
- package/dist/imagesizeattributes.d.ts +33 -33
- package/dist/imagestyle/converters.d.ts +18 -18
- package/dist/imagestyle/imagestylecommand.d.ts +73 -63
- package/dist/imagestyle/imagestyleediting.d.ts +49 -49
- package/dist/imagestyle/imagestyleui.d.ts +55 -55
- package/dist/imagestyle/utils.d.ts +88 -88
- package/dist/imagestyle.d.ts +31 -31
- package/dist/imagetextalternative/imagetextalternativecommand.d.ts +29 -29
- package/dist/imagetextalternative/imagetextalternativeediting.d.ts +27 -27
- package/dist/imagetextalternative/imagetextalternativeui.d.ts +67 -67
- package/dist/imagetextalternative/ui/textalternativeformview.d.ts +88 -88
- package/dist/imagetextalternative.d.ts +28 -28
- package/dist/imagetoolbar.d.ts +34 -34
- package/dist/imageupload/imageuploadediting.d.ts +118 -118
- package/dist/imageupload/imageuploadprogress.d.ts +41 -41
- package/dist/imageupload/imageuploadui.d.ts +46 -46
- package/dist/imageupload/uploadimagecommand.d.ts +67 -67
- package/dist/imageupload/utils.d.ts +27 -27
- package/dist/imageupload.d.ts +31 -31
- package/dist/imageutils.d.ts +124 -124
- package/dist/index.css.map +1 -1
- package/dist/index.d.ts +68 -70
- package/dist/index.js +6032 -6533
- package/dist/index.js.map +1 -1
- package/dist/pictureediting.d.ts +87 -87
- 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/package.json +11 -11
- package/dist/imageresize/utils/tryparsedimensionwithunit.d.ts +0 -39
|
@@ -1,64 +1,64 @@
|
|
|
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 { ClipboardPipeline } from
|
|
10
|
-
import { ImageEditing } from
|
|
11
|
-
import { ImageSizeAttributes } from
|
|
12
|
-
import { ImageUtils } from
|
|
13
|
-
import { ImagePlaceholder } from
|
|
6
|
+
* @module image/image/imageinlineediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { ClipboardPipeline } from "@ckeditor/ckeditor5-clipboard";
|
|
10
|
+
import { ImageEditing } from "./imageediting.js";
|
|
11
|
+
import { ImageSizeAttributes } from "../imagesizeattributes.js";
|
|
12
|
+
import { ImageUtils } from "../imageutils.js";
|
|
13
|
+
import { ImagePlaceholder } from "./imageplaceholder.js";
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
* The image inline plugin.
|
|
16
|
+
*
|
|
17
|
+
* It registers:
|
|
18
|
+
*
|
|
19
|
+
* * `<imageInline>` as an inline element in the document schema, and allows `alt`, `src` and `srcset` attributes.
|
|
20
|
+
* * converters for editing and data pipelines.
|
|
21
|
+
* * {@link module:image/image/imagetypecommand~ImageTypeCommand `'imageTypeInline'`} command that converts block images into
|
|
22
|
+
* inline images.
|
|
23
|
+
*/
|
|
24
24
|
export declare class ImageInlineEditing extends Plugin {
|
|
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
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get requires(): PluginDependenciesOf<[ImageEditing, ImageSizeAttributes, ImageUtils, ImagePlaceholder, ClipboardPipeline]>;
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
static get pluginName(): "ImageInlineEditing";
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
static override get isOfficialPlugin(): true;
|
|
37
|
+
/**
|
|
38
|
+
* @inheritDoc
|
|
39
|
+
*/
|
|
40
|
+
init(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Configures conversion pipelines to support upcasting and downcasting
|
|
43
|
+
* inline images (inline image widgets) and their attributes.
|
|
44
|
+
*/
|
|
45
|
+
private _setupConversion;
|
|
46
|
+
/**
|
|
47
|
+
* Integrates the plugin with the clipboard pipeline.
|
|
48
|
+
*
|
|
49
|
+
* Idea is that the feature should recognize the user's intent when an **block** image is
|
|
50
|
+
* pasted or dropped. If such an image is pasted/dropped into a non-empty block
|
|
51
|
+
* (e.g. a paragraph with some text) it gets converted into an inline image on the fly.
|
|
52
|
+
*
|
|
53
|
+
* We assume this is the user's intent if they decided to put their image there.
|
|
54
|
+
*
|
|
55
|
+
* **Note**: If a block image has a caption, it will not be converted to an inline image
|
|
56
|
+
* to avoid the confusion. Captions are added on purpose and they should never be lost
|
|
57
|
+
* in the clipboard pipeline.
|
|
58
|
+
*
|
|
59
|
+
* See the `ImageBlockEditing` for the similar integration that works in the opposite direction.
|
|
60
|
+
*
|
|
61
|
+
* The feature also sets image `width` and `height` attributes when pasting.
|
|
62
|
+
*/
|
|
63
|
+
private _setupClipboardIntegration;
|
|
64
64
|
}
|
|
@@ -1,48 +1,48 @@
|
|
|
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 { Observer } from
|
|
6
|
+
* @module image/image/imageloadobserver
|
|
7
|
+
*/
|
|
8
|
+
import { Observer } from "@ckeditor/ckeditor5-engine";
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
* Observes all new images added to the {@link module:engine/view/document~ViewDocument},
|
|
11
|
+
* fires {@link module:engine/view/document~ViewDocument#event:imageLoaded} and
|
|
12
|
+
* {@link module:engine/view/document~ViewDocument#event:layoutChanged} event every time when the new image
|
|
13
|
+
* has been loaded.
|
|
14
|
+
*
|
|
15
|
+
* **Note:** This event is not fired for images that has been added to the document and rendered as `complete` (already loaded).
|
|
16
|
+
*/
|
|
17
17
|
export declare class ImageLoadObserver extends Observer {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
observe(domRoot: HTMLElement): void;
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
override stopObserving(domRoot: HTMLElement): void;
|
|
26
|
+
/**
|
|
27
|
+
* Fires {@link module:engine/view/document~ViewDocument#event:layoutChanged} and
|
|
28
|
+
* {@link module:engine/view/document~ViewDocument#event:imageLoaded}
|
|
29
|
+
* if observer {@link #isEnabled is enabled}.
|
|
30
|
+
*
|
|
31
|
+
* @param domEvent The DOM event.
|
|
32
|
+
*/
|
|
33
|
+
private _fireEvents;
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
* Fired when an <img/> DOM element has been loaded in the DOM root.
|
|
37
|
+
*
|
|
38
|
+
* Introduced by {@link module:image/image/imageloadobserver~ImageLoadObserver}.
|
|
39
|
+
*
|
|
40
|
+
* @see module:image/image/imageloadobserver~ImageLoadObserver
|
|
41
|
+
*
|
|
42
|
+
* @eventName module:engine/view/document~ViewDocument#imageLoaded
|
|
43
|
+
* @param data Event data.
|
|
44
|
+
*/
|
|
45
45
|
export type ImageLoadedEvent = {
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
name: "imageLoaded";
|
|
47
|
+
args: [Event];
|
|
48
48
|
};
|
|
@@ -1,43 +1,43 @@
|
|
|
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 { ImageUtils } from
|
|
10
|
-
import
|
|
6
|
+
* @module image/image/imageplaceholder
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { ImageUtils } from "../imageutils.js";
|
|
10
|
+
import "../../theme/imageplaceholder.css";
|
|
11
11
|
/**
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
* Adds support for image placeholder that is automatically removed when the image is loaded.
|
|
13
|
+
*/
|
|
14
14
|
export declare class ImagePlaceholder extends Plugin {
|
|
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
|
-
|
|
15
|
+
/**
|
|
16
|
+
* @inheritDoc
|
|
17
|
+
*/
|
|
18
|
+
static get requires(): PluginDependenciesOf<[ImageUtils]>;
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get pluginName(): "ImagePlaceholder";
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static override get isOfficialPlugin(): true;
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
afterInit(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Extends model schema.
|
|
33
|
+
*/
|
|
34
|
+
private _setupSchema;
|
|
35
|
+
/**
|
|
36
|
+
* Registers converters.
|
|
37
|
+
*/
|
|
38
|
+
private _setupConversion;
|
|
39
|
+
/**
|
|
40
|
+
* Prepares listener for image load.
|
|
41
|
+
*/
|
|
42
|
+
private _setupLoadListener;
|
|
43
43
|
}
|
|
@@ -1,44 +1,44 @@
|
|
|
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 type
|
|
9
|
-
import { Command, type Editor } from
|
|
6
|
+
* @module image/image/imagetypecommand
|
|
7
|
+
*/
|
|
8
|
+
import { type ModelElement } from "@ckeditor/ckeditor5-engine";
|
|
9
|
+
import { Command, type Editor } from "@ckeditor/ckeditor5-core";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
* The image type command. It changes the type of a selected image, depending on the configuration.
|
|
12
|
+
*/
|
|
13
13
|
export declare class ImageTypeCommand extends Command {
|
|
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
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Model element name the command converts to.
|
|
16
|
+
*/
|
|
17
|
+
private readonly _modelElementName;
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*
|
|
21
|
+
* @param modelElementName Model element name the command converts to.
|
|
22
|
+
*/
|
|
23
|
+
constructor(editor: Editor, modelElementName: "imageBlock" | "imageInline");
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
override refresh(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Executes the command and changes the type of a selected image.
|
|
30
|
+
*
|
|
31
|
+
* @fires execute
|
|
32
|
+
* @param options.setImageSizes Specifies whether the image `width` and `height` attributes should be set automatically.
|
|
33
|
+
* The default is `true`.
|
|
34
|
+
* @returns An object containing references to old and new model image elements
|
|
35
|
+
* (for before and after the change) so external integrations can hook into the decorated
|
|
36
|
+
* `execute` event and handle this change. `null` if the type change failed.
|
|
37
|
+
*/
|
|
38
|
+
override execute(options?: {
|
|
39
|
+
setImageSizes?: boolean;
|
|
40
|
+
}): {
|
|
41
|
+
oldElement: ModelElement;
|
|
42
|
+
newElement: ModelElement;
|
|
43
|
+
} | null;
|
|
44
44
|
}
|
|
@@ -1,70 +1,70 @@
|
|
|
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 ArrayOrItem } from
|
|
6
|
+
* @module image/image/insertimagecommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command, type Editor } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { type ArrayOrItem } from "@ckeditor/ckeditor5-utils";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
11
|
+
* Insert image command.
|
|
12
|
+
*
|
|
13
|
+
* The command is registered by the {@link module:image/image/imageediting~ImageEditing} plugin as `insertImage`
|
|
14
|
+
* and it is also available via aliased `imageInsert` name.
|
|
15
|
+
*
|
|
16
|
+
* In order to insert an image at the current selection position
|
|
17
|
+
* (according to the {@link module:widget/utils~findOptimalInsertionRange} algorithm),
|
|
18
|
+
* execute the command and specify the image source:
|
|
19
|
+
*
|
|
20
|
+
* ```ts
|
|
21
|
+
* editor.execute( 'insertImage', { source: 'http://url.to.the/image' } );
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* It is also possible to insert multiple images at once:
|
|
25
|
+
*
|
|
26
|
+
* ```ts
|
|
27
|
+
* editor.execute( 'insertImage', {
|
|
28
|
+
* source: [
|
|
29
|
+
* 'path/to/image.jpg',
|
|
30
|
+
* 'path/to/other-image.jpg'
|
|
31
|
+
* ]
|
|
32
|
+
* } );
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* If you want to take the full control over the process, you can specify individual model attributes:
|
|
36
|
+
*
|
|
37
|
+
* ```ts
|
|
38
|
+
* editor.execute( 'insertImage', {
|
|
39
|
+
* source: [
|
|
40
|
+
* { src: 'path/to/image.jpg', alt: 'First alt text' },
|
|
41
|
+
* { src: 'path/to/other-image.jpg', alt: 'Second alt text', customAttribute: 'My attribute value' }
|
|
42
|
+
* ]
|
|
43
|
+
* } );
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
46
|
export declare class InsertImageCommand extends Command {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
47
|
+
/**
|
|
48
|
+
* @inheritDoc
|
|
49
|
+
*/
|
|
50
|
+
constructor(editor: Editor);
|
|
51
|
+
/**
|
|
52
|
+
* @inheritDoc
|
|
53
|
+
*/
|
|
54
|
+
override refresh(): void;
|
|
55
|
+
/**
|
|
56
|
+
* Executes the command.
|
|
57
|
+
*
|
|
58
|
+
* @fires execute
|
|
59
|
+
* @param options Options for the executed command.
|
|
60
|
+
* @param options.imageType The type of the image to insert. If not specified, the type will be determined automatically.
|
|
61
|
+
* @param options.source The image source or an array of image sources to insert.
|
|
62
|
+
* @param options.breakBlock If set to `true`, the block at the selection start will be broken before inserting the image.
|
|
63
|
+
* See the documentation of the command to learn more about accepted formats.
|
|
64
|
+
*/
|
|
65
|
+
override execute(options: {
|
|
66
|
+
source: ArrayOrItem<string | Record<string, unknown>>;
|
|
67
|
+
imageType?: "imageBlock" | "imageInline" | null;
|
|
68
|
+
breakBlock?: boolean;
|
|
69
|
+
}): void;
|
|
70
70
|
}
|
|
@@ -1,51 +1,51 @@
|
|
|
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 { ModelWriter, ModelElement } from
|
|
6
|
+
* @module image/image/replaceimagesourcecommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command, type Editor } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import type { ModelWriter, ModelElement } from "@ckeditor/ckeditor5-engine";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
* Replace image source command.
|
|
12
|
+
*
|
|
13
|
+
* Changes image source to the one provided. Can be executed as follows:
|
|
14
|
+
*
|
|
15
|
+
* ```ts
|
|
16
|
+
* editor.execute( 'replaceImageSource', { source: 'http://url.to.the/image' } );
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
19
|
export declare class ReplaceImageSourceCommand extends Command {
|
|
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
|
-
|
|
20
|
+
value: string | null;
|
|
21
|
+
constructor(editor: Editor);
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
override refresh(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Executes the command.
|
|
28
|
+
*
|
|
29
|
+
* @fires execute
|
|
30
|
+
* @param options Options for the executed command.
|
|
31
|
+
* @param options.source The image source to replace.
|
|
32
|
+
*/
|
|
33
|
+
override execute(options: {
|
|
34
|
+
source: string;
|
|
35
|
+
}): void;
|
|
36
|
+
/**
|
|
37
|
+
* Cleanup image attributes that are not relevant to the new source.
|
|
38
|
+
*
|
|
39
|
+
* Removed attributes are: 'srcset', 'sizes', 'sources', 'width', 'height', 'alt'.
|
|
40
|
+
*
|
|
41
|
+
* This method is decorated, to allow custom cleanup logic.
|
|
42
|
+
* For example, to remove 'myImageId' attribute after 'src' has changed:
|
|
43
|
+
*
|
|
44
|
+
* ```ts
|
|
45
|
+
* replaceImageSourceCommand.on( 'cleanupImage', ( eventInfo, [ writer, image ] ) => {
|
|
46
|
+
* writer.removeAttribute( 'myImageId', image );
|
|
47
|
+
* } );
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
cleanupImage(writer: ModelWriter, image: ModelElement): void;
|
|
51
51
|
}
|