@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
package/dist/image/ui/utils.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
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 { DomOptimalPositionOptions } from
|
|
9
|
-
import type { Editor } from
|
|
6
|
+
* @module image/image/ui/utils
|
|
7
|
+
*/
|
|
8
|
+
import type { DomOptimalPositionOptions } from "@ckeditor/ckeditor5-utils";
|
|
9
|
+
import type { Editor } from "@ckeditor/ckeditor5-core";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
* A helper utility that positions the
|
|
12
|
+
* {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} instance
|
|
13
|
+
* with respect to the image in the editor content, if one is selected.
|
|
14
|
+
*
|
|
15
|
+
* @param editor The editor instance.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
18
|
export declare function repositionContextualBalloon(editor: Editor): void;
|
|
19
19
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
* Returns the positioning options that control the geometry of the
|
|
21
|
+
* {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon contextual balloon} with respect
|
|
22
|
+
* to the selected element in the editor content.
|
|
23
|
+
*
|
|
24
|
+
* @param editor The editor instance.
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
27
|
export declare function getBalloonPositionData(editor: Editor): Partial<DomOptimalPositionOptions>;
|
package/dist/image/utils.d.ts
CHANGED
|
@@ -1,68 +1,101 @@
|
|
|
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 { Editor } from
|
|
6
|
+
* @module image/image/utils
|
|
7
|
+
*/
|
|
8
|
+
import { type ModelDocumentSelection, type MatcherPattern, type ModelPosition, type ModelSchema, type ModelSelection, type ViewContainerElement, type ViewDowncastWriter, type ViewElement } from "@ckeditor/ckeditor5-engine";
|
|
9
|
+
import type { Editor } from "@ckeditor/ckeditor5-core";
|
|
10
|
+
import { type ImageUtils } from "../imageutils.js";
|
|
10
11
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
* Creates a view element representing the inline image.
|
|
13
|
+
*
|
|
14
|
+
* ```html
|
|
15
|
+
* <span class="image-inline"><img></img></span>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Note that `alt` and `src` attributes are converted separately, so they are not included.
|
|
19
|
+
*
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
21
22
|
export declare function createInlineImageViewElement(writer: ViewDowncastWriter): ViewContainerElement;
|
|
22
23
|
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
* Creates a view element representing the block image.
|
|
25
|
+
*
|
|
26
|
+
* ```html
|
|
27
|
+
* <figure class="image"><img></img></figure>
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* Note that `alt` and `src` attributes are converted separately, so they are not included.
|
|
31
|
+
*
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
33
34
|
export declare function createBlockImageViewElement(writer: ViewDowncastWriter): ViewContainerElement;
|
|
34
35
|
/**
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
* A function returning a `MatcherPattern` for a particular type of View images.
|
|
37
|
+
*
|
|
38
|
+
* @deprecated
|
|
39
|
+
* @internal
|
|
40
|
+
* @param matchImageType The type of created image.
|
|
41
|
+
*/
|
|
42
|
+
export declare function getImgViewElementMatcher(editor: Editor, matchImageType: "imageBlock" | "imageInline"): MatcherPattern;
|
|
41
43
|
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
* Resolves the model image type (`'imageBlock'` or `'imageInline'`) that a given `<img>` view element represents,
|
|
45
|
+
* based purely on its view structure.
|
|
46
|
+
*
|
|
47
|
+
* An `<img>` is treated as a block image when it has a `display: block` style or is wrapped in a block image figure
|
|
48
|
+
* (`<figure class="image">`, also `<figure class="image"><a>...</a></figure>` added by the `LinkImage` plugin).
|
|
49
|
+
* Otherwise it is treated as an inline image.
|
|
50
|
+
*
|
|
51
|
+
* Note that this only reflects the view representation - it does not check whether the resolved type is allowed by the
|
|
52
|
+
* schema at the insertion position.
|
|
53
|
+
*
|
|
54
|
+
* @internal
|
|
55
|
+
* @param element The `<img>` view element to resolve the type for.
|
|
56
|
+
* @param imageUtils The `ImageUtils` plugin instance.
|
|
57
|
+
*/
|
|
58
|
+
export declare function getViewImageType(element: ViewElement, imageUtils: ImageUtils): "imageBlock" | "imageInline";
|
|
53
59
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
* Checks whether the given image type can be placed at the specified position - either directly (or after hoisting
|
|
61
|
+
* to an allowed ancestor) or, for inline images, wrapped in an auto-created paragraph.
|
|
62
|
+
*
|
|
63
|
+
* This is the predicate that decides whether a block image may land at a position or must degrade to an inline image
|
|
64
|
+
* (for example, inside an `$inlineRoot` that disallows block content) and, symmetrically, whether an inline image may
|
|
65
|
+
* become a block image. `isParagraphable()` is always `false` for `imageBlock` (a block object never fits in a
|
|
66
|
+
* paragraph), so the auto-paragraph relaxation only applies to the inline target.
|
|
67
|
+
*
|
|
68
|
+
* @internal
|
|
69
|
+
* @param schema The model schema to check against.
|
|
70
|
+
* @param position The position at which the image type should be placed.
|
|
71
|
+
* @param imageType The image type to check.
|
|
72
|
+
*/
|
|
73
|
+
export declare function isImageTypePlaceable(schema: ModelSchema, position: ModelPosition, imageType: "imageBlock" | "imageInline"): boolean;
|
|
74
|
+
/**
|
|
75
|
+
* Considering the current model selection, it returns the name of the model image element
|
|
76
|
+
* (`'imageBlock'` or `'imageInline'`) that will make most sense from the UX perspective if a new
|
|
77
|
+
* image was inserted (also: uploaded, dropped, pasted) at that selection.
|
|
78
|
+
*
|
|
79
|
+
* The assumption is that inserting images into empty blocks or on other block widgets should
|
|
80
|
+
* produce block images. Inline images should be inserted in other cases, e.g. in paragraphs
|
|
81
|
+
* that already contain some text.
|
|
82
|
+
*
|
|
83
|
+
* @internal
|
|
84
|
+
*/
|
|
85
|
+
export declare function determineImageTypeForInsertionAtSelection(schema: ModelSchema, selection: ModelSelection | ModelDocumentSelection): "imageBlock" | "imageInline";
|
|
86
|
+
/**
|
|
87
|
+
* Returns parsed value of the size, but only if it contains unit: px.
|
|
88
|
+
*
|
|
89
|
+
* @internal
|
|
90
|
+
*/
|
|
58
91
|
export declare function getSizeValueIfInPx(size: string | undefined): number | null;
|
|
59
92
|
/**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
93
|
+
* Returns true if both styles (width and height) are set.
|
|
94
|
+
*
|
|
95
|
+
* If both image styles: width & height are set, they will override the image width & height attributes in the
|
|
96
|
+
* browser. In this case, the image looks the same as if these styles were applied to attributes instead of styles.
|
|
97
|
+
* That's why we can upcast these styles to width & height attributes instead of resizedWidth and resizedHeight.
|
|
98
|
+
*
|
|
99
|
+
* @internal
|
|
100
|
+
*/
|
|
68
101
|
export declare function widthAndHeightStylesAreBothSet(viewElement: ViewElement): boolean;
|
package/dist/image.d.ts
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
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 { ImageBlock } from
|
|
10
|
-
import { ImageInline } from
|
|
11
|
-
import
|
|
6
|
+
* @module image/image
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { ImageBlock } from "./imageblock.js";
|
|
10
|
+
import { ImageInline } from "./imageinline.js";
|
|
11
|
+
import "../theme/image.css";
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
* The image plugin.
|
|
14
|
+
*
|
|
15
|
+
* For a detailed overview, check the {@glink features/images/images-overview image feature} documentation.
|
|
16
|
+
*
|
|
17
|
+
* This is a "glue" plugin which loads the following plugins:
|
|
18
|
+
*
|
|
19
|
+
* * {@link module:image/imageblock~ImageBlock},
|
|
20
|
+
* * {@link module:image/imageinline~ImageInline},
|
|
21
|
+
*
|
|
22
|
+
* Usually, it is used in conjunction with other plugins from this package. See the {@glink api/image package page}
|
|
23
|
+
* for more information.
|
|
24
|
+
*/
|
|
25
25
|
export declare class Image extends Plugin {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get requires(): PluginDependenciesOf<[ImageBlock, ImageInline]>;
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
static get pluginName(): "Image";
|
|
34
|
+
/**
|
|
35
|
+
* @inheritDoc
|
|
36
|
+
*/
|
|
37
|
+
static override get isOfficialPlugin(): true;
|
|
38
38
|
}
|
package/dist/imageblock.d.ts
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
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 { Widget } from
|
|
10
|
-
import { ImageTextAlternative } from
|
|
11
|
-
import { ImageBlockEditing } from
|
|
12
|
-
import { ImageInsertUI } from
|
|
13
|
-
import
|
|
6
|
+
* @module image/imageblock
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { Widget } from "@ckeditor/ckeditor5-widget";
|
|
10
|
+
import { ImageTextAlternative } from "./imagetextalternative.js";
|
|
11
|
+
import { ImageBlockEditing } from "./image/imageblockediting.js";
|
|
12
|
+
import { ImageInsertUI } from "./imageinsert/imageinsertui.js";
|
|
13
|
+
import "../theme/image.css";
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
* The image block plugin.
|
|
16
|
+
*
|
|
17
|
+
* This is a "glue" plugin which loads the following plugins:
|
|
18
|
+
*
|
|
19
|
+
* * {@link module:image/image/imageblockediting~ImageBlockEditing},
|
|
20
|
+
* * {@link module:image/imagetextalternative~ImageTextAlternative}.
|
|
21
|
+
*
|
|
22
|
+
* Usually, it is used in conjunction with other plugins from this package. See the {@glink api/image package page}
|
|
23
|
+
* for more information.
|
|
24
|
+
*/
|
|
25
25
|
export declare class ImageBlock extends Plugin {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get requires(): PluginDependenciesOf<[ImageBlockEditing, Widget, ImageTextAlternative, ImageInsertUI]>;
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
static get pluginName(): "ImageBlock";
|
|
34
|
+
/**
|
|
35
|
+
* @inheritDoc
|
|
36
|
+
*/
|
|
37
|
+
static override get isOfficialPlugin(): true;
|
|
38
38
|
}
|
|
@@ -1,93 +1,93 @@
|
|
|
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 Editor, Plugin } from
|
|
9
|
-
import { ModelElement } from
|
|
10
|
-
import { ImageUtils } from
|
|
11
|
-
import { ImageCaptionUtils } from
|
|
6
|
+
* @module image/imagecaption/imagecaptionediting
|
|
7
|
+
*/
|
|
8
|
+
import { type Editor, Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { ModelElement } from "@ckeditor/ckeditor5-engine";
|
|
10
|
+
import { ImageUtils } from "../imageutils.js";
|
|
11
|
+
import { ImageCaptionUtils } from "./imagecaptionutils.js";
|
|
12
12
|
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
* The image caption engine plugin. It is responsible for:
|
|
14
|
+
*
|
|
15
|
+
* * registering converters for the caption element,
|
|
16
|
+
* * registering converters for the caption model attribute,
|
|
17
|
+
* * registering the {@link module:image/imagecaption/toggleimagecaptioncommand~ToggleImageCaptionCommand `toggleImageCaption`} command.
|
|
18
|
+
*/
|
|
19
19
|
export declare class ImageCaptionEditing 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
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
static get requires(): PluginDependenciesOf<[ImageUtils, ImageCaptionUtils]>;
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
static get pluginName(): "ImageCaptionEditing";
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
static override get isOfficialPlugin(): true;
|
|
32
|
+
/**
|
|
33
|
+
* A map that keeps saved JSONified image captions and image model elements they are
|
|
34
|
+
* associated with.
|
|
35
|
+
*
|
|
36
|
+
* To learn more about this system, see {@link #_saveCaption}.
|
|
37
|
+
*/
|
|
38
|
+
private _savedCaptionsMap;
|
|
39
|
+
/**
|
|
40
|
+
* @inheritDoc
|
|
41
|
+
*/
|
|
42
|
+
constructor(editor: Editor);
|
|
43
|
+
/**
|
|
44
|
+
* @inheritDoc
|
|
45
|
+
*/
|
|
46
|
+
init(): void;
|
|
47
|
+
/**
|
|
48
|
+
* Configures conversion pipelines to support upcasting and downcasting
|
|
49
|
+
* image captions.
|
|
50
|
+
*/
|
|
51
|
+
private _setupConversion;
|
|
52
|
+
/**
|
|
53
|
+
* Integrates with {@link module:image/image/imagetypecommand~ImageTypeCommand image type commands}
|
|
54
|
+
* to make sure the caption is preserved when the type of an image changes so it can be restored
|
|
55
|
+
* in the future if the user decides they want their caption back.
|
|
56
|
+
*/
|
|
57
|
+
private _setupImageTypeCommandsIntegration;
|
|
58
|
+
/**
|
|
59
|
+
* Returns the saved {@link module:engine/model/element~ModelElement#toJSON JSONified} caption
|
|
60
|
+
* of an image model element.
|
|
61
|
+
*
|
|
62
|
+
* See {@link #_saveCaption}.
|
|
63
|
+
*
|
|
64
|
+
* @internal
|
|
65
|
+
* @param imageModelElement The model element the caption should be returned for.
|
|
66
|
+
* @returns The model caption element or `null` if there is none.
|
|
67
|
+
*/
|
|
68
|
+
_getSavedCaption(imageModelElement: ModelElement): ModelElement | null;
|
|
69
|
+
/**
|
|
70
|
+
* Saves a {@link module:engine/model/element~ModelElement#toJSON JSONified} caption for
|
|
71
|
+
* an image element to allow restoring it in the future.
|
|
72
|
+
*
|
|
73
|
+
* A caption is saved every time it gets hidden and/or the type of an image changes. The
|
|
74
|
+
* user should be able to restore it on demand.
|
|
75
|
+
*
|
|
76
|
+
* **Note**: The caption cannot be stored in the image model element attribute because,
|
|
77
|
+
* for instance, when the model state propagates to collaborators, the attribute would get
|
|
78
|
+
* lost (mainly because it does not convert to anything when the caption is hidden) and
|
|
79
|
+
* the states of collaborators' models would de-synchronize causing numerous issues.
|
|
80
|
+
*
|
|
81
|
+
* See {@link #_getSavedCaption}.
|
|
82
|
+
*
|
|
83
|
+
* @internal
|
|
84
|
+
* @param imageModelElement The model element the caption is saved for.
|
|
85
|
+
* @param caption The caption model element to be saved.
|
|
86
|
+
*/
|
|
87
|
+
_saveCaption(imageModelElement: ModelElement, caption: ModelElement): void;
|
|
88
|
+
/**
|
|
89
|
+
* Reconverts image caption when image alt attribute changes.
|
|
90
|
+
* The change of alt attribute is reflected in caption's aria-label attribute.
|
|
91
|
+
*/
|
|
92
|
+
private _registerCaptionReconversion;
|
|
93
93
|
}
|
|
@@ -1,30 +1,30 @@
|
|
|
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 { ImageCaptionUtils } from
|
|
6
|
+
* @module image/imagecaption/imagecaptionui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
|
|
9
|
+
import { ImageCaptionUtils } from "./imagecaptionutils.js";
|
|
10
10
|
/**
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
* The image caption UI plugin. It introduces the `'toggleImageCaption'` UI button.
|
|
12
|
+
*/
|
|
13
13
|
export declare class ImageCaptionUI extends Plugin {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
static get requires(): PluginDependenciesOf<[ImageCaptionUtils]>;
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get pluginName(): "ImageCaptionUI";
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static override get isOfficialPlugin(): true;
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
init(): void;
|
|
30
30
|
}
|