@ckeditor/ckeditor5-image 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/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
package/dist/augmentation.d.ts
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import type { ImageConfig, AutoImage, Image, ImageBlock, ImageCaption, ImageInline, ImageInsert, ImageInsertViaUrl, ImageResize, ImageStyle, ImageTextAlternative, ImageToolbar, ImageUpload, ImageUtils, ImageBlockEditing, ImageEditing, ImageCaptionEditing, ImageCaptionUI, ImageCaptionUtils, ImageInsertUI, ImageResizeEditing, ImageCustomResizeUI, ImageSizeAttributes, ImageStyleEditing, ImageStyleUI, ImageTextAlternativeEditing, ImageTextAlternativeUI, ImageUploadEditing, ImageUploadProgress, ImageUploadUI, ImageTypeCommand, InsertImageCommand, ReplaceImageSourceCommand, ToggleImageCaptionCommand, ResizeImageCommand, ImageStyleCommand, ImageTextAlternativeCommand, UploadImageCommand } from
|
|
6
|
-
declare module
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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 { ImageConfig, AutoImage, Image, ImageBlock, ImageCaption, ImageInline, ImageInsert, ImageInsertViaUrl, ImageResize, ImageStyle, ImageTextAlternative, ImageToolbar, ImageUpload, ImageUtils, ImageBlockEditing, ImageEditing, ImageCaptionEditing, ImageCaptionUI, ImageCaptionUtils, ImageInsertUI, ImageResizeEditing, ImageCustomResizeUI, ImageSizeAttributes, ImageStyleEditing, ImageStyleUI, ImageTextAlternativeEditing, ImageTextAlternativeUI, ImageUploadEditing, ImageUploadProgress, ImageUploadUI, ImageTypeCommand, InsertImageCommand, ReplaceImageSourceCommand, ToggleImageCaptionCommand, ResizeImageCommand, ImageStyleCommand, ImageTextAlternativeCommand, UploadImageCommand } from "./index.js";
|
|
6
|
+
declare module "@ckeditor/ckeditor5-core" {
|
|
7
|
+
interface EditorConfig {
|
|
8
|
+
/**
|
|
9
|
+
* The configuration of the image features. Used by the image features in the `@ckeditor/ckeditor5-image` package.
|
|
10
|
+
*
|
|
11
|
+
* Read more in {@link module:image/imageconfig~ImageConfig}.
|
|
12
|
+
*/
|
|
13
|
+
image?: ImageConfig;
|
|
14
|
+
}
|
|
15
|
+
interface PluginsMap {
|
|
16
|
+
[AutoImage.pluginName]: AutoImage;
|
|
17
|
+
[Image.pluginName]: Image;
|
|
18
|
+
[ImageBlock.pluginName]: ImageBlock;
|
|
19
|
+
[ImageCaption.pluginName]: ImageCaption;
|
|
20
|
+
[ImageInline.pluginName]: ImageInline;
|
|
21
|
+
[ImageInsert.pluginName]: ImageInsert;
|
|
22
|
+
[ImageInsertViaUrl.pluginName]: ImageInsertViaUrl;
|
|
23
|
+
[ImageResize.pluginName]: ImageResize;
|
|
24
|
+
[ImageStyle.pluginName]: ImageStyle;
|
|
25
|
+
[ImageTextAlternative.pluginName]: ImageTextAlternative;
|
|
26
|
+
[ImageToolbar.pluginName]: ImageToolbar;
|
|
27
|
+
[ImageUpload.pluginName]: ImageUpload;
|
|
28
|
+
[ImageUtils.pluginName]: ImageUtils;
|
|
29
|
+
[ImageBlockEditing.pluginName]: ImageBlockEditing;
|
|
30
|
+
[ImageEditing.pluginName]: ImageEditing;
|
|
31
|
+
[ImageCaptionEditing.pluginName]: ImageCaptionEditing;
|
|
32
|
+
[ImageCaptionUI.pluginName]: ImageCaptionUI;
|
|
33
|
+
[ImageCaptionUtils.pluginName]: ImageCaptionUtils;
|
|
34
|
+
[ImageInsertUI.pluginName]: ImageInsertUI;
|
|
35
|
+
[ImageResizeEditing.pluginName]: ImageResizeEditing;
|
|
36
|
+
[ImageCustomResizeUI.pluginName]: ImageCustomResizeUI;
|
|
37
|
+
[ImageSizeAttributes.pluginName]: ImageSizeAttributes;
|
|
38
|
+
[ImageStyleEditing.pluginName]: ImageStyleEditing;
|
|
39
|
+
[ImageStyleUI.pluginName]: ImageStyleUI;
|
|
40
|
+
[ImageTextAlternativeEditing.pluginName]: ImageTextAlternativeEditing;
|
|
41
|
+
[ImageTextAlternativeUI.pluginName]: ImageTextAlternativeUI;
|
|
42
|
+
[ImageUploadEditing.pluginName]: ImageUploadEditing;
|
|
43
|
+
[ImageUploadProgress.pluginName]: ImageUploadProgress;
|
|
44
|
+
[ImageUploadUI.pluginName]: ImageUploadUI;
|
|
45
|
+
}
|
|
46
|
+
interface CommandsMap {
|
|
47
|
+
imageTypeBlock: ImageTypeCommand;
|
|
48
|
+
imageTypeInline: ImageTypeCommand;
|
|
49
|
+
insertImage: InsertImageCommand;
|
|
50
|
+
replaceImageSource: ReplaceImageSourceCommand;
|
|
51
|
+
toggleImageCaption: ToggleImageCaptionCommand;
|
|
52
|
+
resizeImage: ResizeImageCommand;
|
|
53
|
+
imageStyle: ImageStyleCommand;
|
|
54
|
+
imageTextAlternative: ImageTextAlternativeCommand;
|
|
55
|
+
uploadImage: UploadImageCommand;
|
|
56
|
+
}
|
|
57
57
|
}
|
package/dist/autoimage.d.ts
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
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 { Clipboard } from
|
|
10
|
-
import { Undo } from
|
|
11
|
-
import { Delete } from
|
|
12
|
-
import { ImageUtils } from
|
|
6
|
+
* @module image/autoimage
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { Clipboard } from "@ckeditor/ckeditor5-clipboard";
|
|
10
|
+
import { Undo } from "@ckeditor/ckeditor5-undo";
|
|
11
|
+
import { Delete } from "@ckeditor/ckeditor5-typing";
|
|
12
|
+
import { ImageUtils } from "./imageutils.js";
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
* The auto-image plugin. It recognizes image links in the pasted content and embeds
|
|
15
|
+
* them shortly after they are injected into the document.
|
|
16
|
+
*/
|
|
17
17
|
export declare class AutoImage extends Plugin {
|
|
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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get requires(): PluginDependenciesOf<[Clipboard, ImageUtils, Undo, Delete]>;
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName(): "AutoImage";
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static override get isOfficialPlugin(): true;
|
|
30
|
+
/**
|
|
31
|
+
* The paste–to–embed `setTimeout` ID. Stored as a property to allow
|
|
32
|
+
* cleaning of the timeout.
|
|
33
|
+
*/
|
|
34
|
+
private _timeoutId;
|
|
35
|
+
/**
|
|
36
|
+
* The position where the `<imageBlock>` element will be inserted after the timeout,
|
|
37
|
+
* determined each time a new content is pasted into the document.
|
|
38
|
+
*/
|
|
39
|
+
private _positionToInsert;
|
|
40
|
+
/**
|
|
41
|
+
* @inheritDoc
|
|
42
|
+
*/
|
|
43
|
+
constructor(editor: Editor);
|
|
44
|
+
/**
|
|
45
|
+
* @inheritDoc
|
|
46
|
+
*/
|
|
47
|
+
init(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Analyzes the part of the document between provided positions in search for a URL representing an image.
|
|
50
|
+
* When the URL is found, it is automatically converted into an image.
|
|
51
|
+
*
|
|
52
|
+
* @param leftPosition Left position of the selection.
|
|
53
|
+
* @param rightPosition Right position of the selection.
|
|
54
|
+
*/
|
|
55
|
+
private _embedImageBetweenPositions;
|
|
56
56
|
}
|
|
@@ -1,66 +1,88 @@
|
|
|
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 { type ImageUtils } from
|
|
6
|
+
* @module image/image/converters
|
|
7
|
+
*/
|
|
8
|
+
import { type DowncastDispatcher, type UpcastDispatcher } from "@ckeditor/ckeditor5-engine";
|
|
9
|
+
import { type ImageUtils } from "../imageutils.js";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
11
|
+
* Returns a function that converts the image view representation:
|
|
12
|
+
*
|
|
13
|
+
* ```html
|
|
14
|
+
* <figure class="image"><img src="..." alt="..."></img></figure>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* to the model representation:
|
|
18
|
+
*
|
|
19
|
+
* ```html
|
|
20
|
+
* <imageBlock src="..." alt="..."></imageBlock>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* The entire content of the `<figure>` element except the first `<img>` is being converted as children
|
|
24
|
+
* of the `<imageBlock>` model element.
|
|
25
|
+
*
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
28
|
export declare function upcastImageFigure(imageUtils: ImageUtils): (dispatcher: UpcastDispatcher) => void;
|
|
29
29
|
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
* Returns a function that upcasts an `<img>` element to either an `imageBlock` or an `imageInline` model element.
|
|
31
|
+
*
|
|
32
|
+
* The image type is first determined from the view structure (see {@link module:image/image/utils~getViewImageType}):
|
|
33
|
+
* an `<img>` wrapped in a `<figure class="image">` or styled with `display: block` becomes an `imageBlock`, otherwise
|
|
34
|
+
* an `imageInline`.
|
|
35
|
+
*
|
|
36
|
+
* That structural type is then verified against the schema at the insertion position. If it cannot be placed there -
|
|
37
|
+
* neither directly (or after hoisting to an allowed ancestor) nor wrapped in an auto-created paragraph - the converter
|
|
38
|
+
* falls back to `matchImageType`. This is what allows a block image to degrade to an inline image inside an inline root
|
|
39
|
+
* (and, symmetrically, an inline image to become a block image in a context that only accepts block images) instead of
|
|
40
|
+
* being dropped.
|
|
41
|
+
*
|
|
42
|
+
* Both `ImageBlockEditing` and `ImageInlineEditing` register this converter, each passing the type it falls back to.
|
|
43
|
+
* When only one of them is loaded, that single type is always produced.
|
|
44
|
+
*
|
|
45
|
+
* @internal
|
|
46
|
+
* @param matchImageType The image type to fall back to when the type resolved from the view cannot be placed at the
|
|
47
|
+
* insertion position.
|
|
48
|
+
* @param imageUtils The `ImageUtils` plugin instance.
|
|
49
|
+
*/
|
|
50
|
+
export declare function upcastImg(matchImageType: "imageBlock" | "imageInline", imageUtils: ImageUtils): (dispatcher: UpcastDispatcher) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Returns a function that converts the image view representation:
|
|
53
|
+
*
|
|
54
|
+
* ```html
|
|
55
|
+
* <picture><source ... /><source ... />...<img ... /></picture>
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* to the model representation as the `sources` attribute:
|
|
59
|
+
*
|
|
60
|
+
* ```html
|
|
61
|
+
* <image[Block|Inline] ... sources="..."></image[Block|Inline]>
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @internal
|
|
65
|
+
*/
|
|
44
66
|
export declare function upcastPicture(imageUtils: ImageUtils): (dispatcher: UpcastDispatcher) => void;
|
|
45
67
|
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
export declare function downcastSrcsetAttribute(imageUtils: ImageUtils, imageType:
|
|
68
|
+
* Converter used to convert the `srcset` model image attribute to the `srcset` and `sizes` attributes in the view.
|
|
69
|
+
*
|
|
70
|
+
* @internal
|
|
71
|
+
* @param imageType The type of the image.
|
|
72
|
+
*/
|
|
73
|
+
export declare function downcastSrcsetAttribute(imageUtils: ImageUtils, imageType: "imageBlock" | "imageInline"): (dispatcher: DowncastDispatcher) => void;
|
|
52
74
|
/**
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
75
|
+
* Converts the `source` model attribute to the `<picture><source /><source />...<img /></picture>`
|
|
76
|
+
* view structure.
|
|
77
|
+
*
|
|
78
|
+
* @internal
|
|
79
|
+
*/
|
|
58
80
|
export declare function downcastSourcesAttribute(imageUtils: ImageUtils): (dispatcher: DowncastDispatcher) => void;
|
|
59
81
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
export declare function downcastImageAttribute(imageUtils: ImageUtils, imageType:
|
|
82
|
+
* Converter used to convert a given image attribute from the model to the view.
|
|
83
|
+
*
|
|
84
|
+
* @internal
|
|
85
|
+
* @param imageType The type of the image.
|
|
86
|
+
* @param attributeKey The name of the attribute to convert.
|
|
87
|
+
*/
|
|
88
|
+
export declare function downcastImageAttribute(imageUtils: ImageUtils, imageType: "imageBlock" | "imageInline", attributeKey: string): (dispatcher: DowncastDispatcher) => void;
|
|
@@ -1,63 +1,63 @@
|
|
|
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/imageblockediting
|
|
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 block plugin.
|
|
16
|
+
*
|
|
17
|
+
* It registers:
|
|
18
|
+
*
|
|
19
|
+
* * `<imageBlock>` as a block 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 `'imageTypeBlock'`} command that converts inline images into
|
|
22
|
+
* block images.
|
|
23
|
+
*/
|
|
24
24
|
export declare class ImageBlockEditing 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
|
-
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get requires(): PluginDependenciesOf<[ImageEditing, ImageSizeAttributes, ImageUtils, ImagePlaceholder, ClipboardPipeline]>;
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
static get pluginName(): "ImageBlockEditing";
|
|
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
|
+
* block images (block 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 **inline** image is
|
|
50
|
+
* pasted or dropped. If such an image is pasted/dropped:
|
|
51
|
+
*
|
|
52
|
+
* * into an empty block (e.g. an empty paragraph),
|
|
53
|
+
* * on another object (e.g. some block widget).
|
|
54
|
+
*
|
|
55
|
+
* it gets converted into a block image on the fly. We assume this is the user's intent
|
|
56
|
+
* if they decided to put their image there.
|
|
57
|
+
*
|
|
58
|
+
* See the `ImageInlineEditing` for the similar integration that works in the opposite direction.
|
|
59
|
+
*
|
|
60
|
+
* The feature also sets image `width` and `height` attributes on paste.
|
|
61
|
+
*/
|
|
62
|
+
private _setupClipboardIntegration;
|
|
63
63
|
}
|
|
@@ -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 { ImageUtils } from
|
|
6
|
+
* @module image/image/imageediting
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { ImageUtils } from "../imageutils.js";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
* The image engine plugin. This module loads common code shared between
|
|
12
|
+
* {@link module:image/image/imageinlineediting~ImageInlineEditing} and
|
|
13
|
+
* {@link module:image/image/imageblockediting~ImageBlockEditing} plugins.
|
|
14
|
+
*
|
|
15
|
+
* This plugin registers the {@link module:image/image/insertimagecommand~InsertImageCommand 'insertImage'} command.
|
|
16
|
+
*/
|
|
17
17
|
export declare class ImageEditing extends Plugin {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get requires(): PluginDependenciesOf<[ImageUtils]>;
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName(): "ImageEditing";
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static override get isOfficialPlugin(): true;
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
init(): void;
|
|
34
34
|
}
|