@ckeditor/ckeditor5-image 41.1.0 → 41.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/build/image.js +1 -1
- package/dist/content-index.css +105 -0
- package/dist/editor-index.css +108 -0
- package/dist/index.css +462 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +5860 -0
- package/dist/index.js.map +1 -0
- package/dist/types/augmentation.d.ts +56 -0
- package/dist/types/autoimage.d.ts +52 -0
- package/dist/types/image/converters.d.ts +66 -0
- package/dist/types/image/imageblockediting.d.ts +59 -0
- package/dist/types/image/imageediting.d.ts +30 -0
- package/dist/types/image/imageinlineediting.d.ts +60 -0
- package/dist/types/image/imageloadobserver.d.ts +48 -0
- package/dist/types/image/imageplaceholder.d.ts +39 -0
- package/dist/types/image/imagetypecommand.d.ts +44 -0
- package/dist/types/image/insertimagecommand.d.ts +66 -0
- package/dist/types/image/replaceimagesourcecommand.d.ts +51 -0
- package/dist/types/image/ui/utils.d.ts +25 -0
- package/dist/types/image/utils.d.ts +64 -0
- package/dist/types/image.d.ts +34 -0
- package/dist/types/imageblock.d.ts +34 -0
- package/dist/types/imagecaption/imagecaptionediting.d.ts +89 -0
- package/dist/types/imagecaption/imagecaptionui.d.ts +26 -0
- package/dist/types/imagecaption/imagecaptionutils.d.ts +38 -0
- package/dist/types/imagecaption/toggleimagecaptioncommand.d.ts +66 -0
- package/dist/types/imagecaption.d.ts +26 -0
- package/dist/types/imageconfig.d.ts +712 -0
- package/dist/types/imageinline.d.ts +34 -0
- package/dist/types/imageinsert/imageinsertui.d.ts +74 -0
- package/dist/types/imageinsert/imageinsertviaurlui.d.ts +44 -0
- package/dist/types/imageinsert/ui/imageinsertformview.d.ts +56 -0
- package/dist/types/imageinsert/ui/imageinserturlview.d.ts +107 -0
- package/dist/types/imageinsert.d.ts +33 -0
- package/dist/types/imageinsertviaurl.d.ts +31 -0
- package/dist/types/imageresize/imageresizebuttons.d.ts +67 -0
- package/dist/types/imageresize/imageresizeediting.d.ts +37 -0
- package/dist/types/imageresize/imageresizehandles.d.ts +31 -0
- package/dist/types/imageresize/resizeimagecommand.d.ts +42 -0
- package/dist/types/imageresize.d.ts +27 -0
- package/dist/types/imagesizeattributes.d.ts +34 -0
- package/dist/types/imagestyle/converters.d.ts +24 -0
- package/dist/types/imagestyle/imagestylecommand.d.ts +68 -0
- package/dist/types/imagestyle/imagestyleediting.d.ts +50 -0
- package/dist/types/imagestyle/imagestyleui.d.ts +56 -0
- package/dist/types/imagestyle/utils.d.ts +101 -0
- package/dist/types/imagestyle.d.ts +32 -0
- package/dist/types/imagetextalternative/imagetextalternativecommand.d.ts +34 -0
- package/dist/types/imagetextalternative/imagetextalternativeediting.d.ts +28 -0
- package/dist/types/imagetextalternative/imagetextalternativeui.d.ts +68 -0
- package/dist/types/imagetextalternative/ui/textalternativeformview.d.ts +90 -0
- package/dist/types/imagetextalternative.d.ts +29 -0
- package/dist/types/imagetoolbar.d.ts +35 -0
- package/dist/types/imageupload/imageuploadediting.d.ts +111 -0
- package/dist/types/imageupload/imageuploadprogress.d.ts +42 -0
- package/dist/types/imageupload/imageuploadui.d.ts +23 -0
- package/dist/types/imageupload/uploadimagecommand.d.ts +60 -0
- package/dist/types/imageupload/utils.d.ts +33 -0
- package/dist/types/imageupload.d.ts +32 -0
- package/dist/types/imageutils.d.ts +125 -0
- package/dist/types/index.d.ts +48 -0
- package/dist/types/pictureediting.d.ts +88 -0
- package/lang/translations/he.po +1 -1
- package/package.json +4 -3
- package/src/augmentation.d.ts +1 -1
- package/src/imageinsert/imageinsertui.d.ts +4 -2
- package/src/imageinsert/imageinsertui.js +1 -1
- package/src/imageinsert/imageinsertviaurlui.d.ts +1 -1
- package/src/imageinsert/imageinsertviaurlui.js +2 -3
- package/src/imageresize/imageresizehandles.js +1 -2
- package/src/imageupload/imageuploadui.js +1 -2
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module image/imageinline
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { Widget } from 'ckeditor5/src/widget.js';
|
|
10
|
+
import ImageTextAlternative from './imagetextalternative.js';
|
|
11
|
+
import ImageInlineEditing from './image/imageinlineediting.js';
|
|
12
|
+
import ImageInsertUI from './imageinsert/imageinsertui.js';
|
|
13
|
+
import '../theme/image.css';
|
|
14
|
+
/**
|
|
15
|
+
* The image inline plugin.
|
|
16
|
+
*
|
|
17
|
+
* This is a "glue" plugin which loads the following plugins:
|
|
18
|
+
*
|
|
19
|
+
* * {@link module:image/image/imageinlineediting~ImageInlineEditing},
|
|
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
|
+
export default class ImageInline extends Plugin {
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get requires(): readonly [typeof ImageInlineEditing, typeof Widget, typeof ImageTextAlternative, typeof ImageInsertUI];
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
static get pluginName(): "ImageInline";
|
|
34
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module image/imageinsert/imageinsertui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { type Observable } from 'ckeditor5/src/utils.js';
|
|
10
|
+
import { type ButtonView, type DropdownView, type FocusableView } from 'ckeditor5/src/ui.js';
|
|
11
|
+
import ImageUtils from '../imageutils.js';
|
|
12
|
+
/**
|
|
13
|
+
* The image insert dropdown plugin.
|
|
14
|
+
*
|
|
15
|
+
* For a detailed overview, check the {@glink features/images/image-upload/image-upload Image upload feature}
|
|
16
|
+
* and {@glink features/images/images-inserting Insert images via source URL} documentation.
|
|
17
|
+
*
|
|
18
|
+
* Adds the `'insertImage'` dropdown to the {@link module:ui/componentfactory~ComponentFactory UI component factory}
|
|
19
|
+
* and also the `imageInsert` dropdown as an alias for backward compatibility.
|
|
20
|
+
*/
|
|
21
|
+
export default class ImageInsertUI extends Plugin {
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName(): "ImageInsertUI";
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get requires(): readonly [typeof ImageUtils];
|
|
30
|
+
/**
|
|
31
|
+
* The dropdown view responsible for displaying the image insert UI.
|
|
32
|
+
*/
|
|
33
|
+
dropdownView?: DropdownView;
|
|
34
|
+
/**
|
|
35
|
+
* Observable property used to alter labels while some image is selected and when it is not.
|
|
36
|
+
*
|
|
37
|
+
* @observable
|
|
38
|
+
*/
|
|
39
|
+
isImageSelected: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Registered integrations map.
|
|
42
|
+
*/
|
|
43
|
+
private _integrations;
|
|
44
|
+
/**
|
|
45
|
+
* @inheritDoc
|
|
46
|
+
*/
|
|
47
|
+
constructor(editor: Editor);
|
|
48
|
+
/**
|
|
49
|
+
* @inheritDoc
|
|
50
|
+
*/
|
|
51
|
+
init(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Registers the insert image dropdown integration.
|
|
54
|
+
*/
|
|
55
|
+
registerIntegration({ name, observable, buttonViewCreator, formViewCreator, requiresForm }: {
|
|
56
|
+
name: string;
|
|
57
|
+
observable: (Observable & {
|
|
58
|
+
isEnabled: boolean;
|
|
59
|
+
}) | (() => Observable & {
|
|
60
|
+
isEnabled: boolean;
|
|
61
|
+
});
|
|
62
|
+
buttonViewCreator: (isOnlyOne: boolean) => ButtonView;
|
|
63
|
+
formViewCreator: (isOnlyOne: boolean) => FocusableView;
|
|
64
|
+
requiresForm?: boolean;
|
|
65
|
+
}): void;
|
|
66
|
+
/**
|
|
67
|
+
* Creates the toolbar component.
|
|
68
|
+
*/
|
|
69
|
+
private _createToolbarComponent;
|
|
70
|
+
/**
|
|
71
|
+
* Validates the integrations list.
|
|
72
|
+
*/
|
|
73
|
+
private _prepareIntegrations;
|
|
74
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module image/imageinsert/imageinsertviaurlui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import ImageInsertUI from './imageinsertui.js';
|
|
10
|
+
/**
|
|
11
|
+
* The image insert via URL plugin (UI part).
|
|
12
|
+
*
|
|
13
|
+
* For a detailed overview, check the {@glink features/images/images-inserting
|
|
14
|
+
* Insert images via source URL} documentation.
|
|
15
|
+
*
|
|
16
|
+
* This plugin registers the {@link module:image/imageinsert/imageinsertui~ImageInsertUI} integration for `url`.
|
|
17
|
+
*/
|
|
18
|
+
export default class ImageInsertViaUrlUI extends Plugin {
|
|
19
|
+
private _imageInsertUI;
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
static get pluginName(): "ImageInsertViaUrlUI";
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
static get requires(): readonly [typeof ImageInsertUI];
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
afterInit(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Creates the view displayed in the dropdown.
|
|
34
|
+
*/
|
|
35
|
+
private _createInsertUrlView;
|
|
36
|
+
/**
|
|
37
|
+
* Creates the toolbar button.
|
|
38
|
+
*/
|
|
39
|
+
private _createInsertUrlButton;
|
|
40
|
+
/**
|
|
41
|
+
* Closes the dropdown.
|
|
42
|
+
*/
|
|
43
|
+
private _closePanel;
|
|
44
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module image/imageinsert/ui/imageinsertformview
|
|
7
|
+
*/
|
|
8
|
+
import { View, ViewCollection, FocusCycler, type FocusableView } from 'ckeditor5/src/ui.js';
|
|
9
|
+
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
|
|
10
|
+
import '../../../theme/imageinsert.css';
|
|
11
|
+
/**
|
|
12
|
+
* The view displayed in the insert image dropdown.
|
|
13
|
+
*
|
|
14
|
+
* See {@link module:image/imageinsert/imageinsertui~ImageInsertUI}.
|
|
15
|
+
*/
|
|
16
|
+
export default class ImageInsertFormView extends View {
|
|
17
|
+
/**
|
|
18
|
+
* Tracks information about 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
|
+
* A collection of views that can be focused in the form.
|
|
27
|
+
*/
|
|
28
|
+
protected readonly _focusables: ViewCollection<FocusableView>;
|
|
29
|
+
/**
|
|
30
|
+
* Helps cycling over {@link #_focusables} in the form.
|
|
31
|
+
*/
|
|
32
|
+
protected readonly _focusCycler: FocusCycler;
|
|
33
|
+
/**
|
|
34
|
+
* A collection of the defined integrations for inserting the images.
|
|
35
|
+
*/
|
|
36
|
+
private readonly children;
|
|
37
|
+
/**
|
|
38
|
+
* Creates a view for the dropdown panel of {@link module:image/imageinsert/imageinsertui~ImageInsertUI}.
|
|
39
|
+
*
|
|
40
|
+
* @param locale The localization services instance.
|
|
41
|
+
* @param integrations An integrations object that contains components (or tokens for components) to be shown in the panel view.
|
|
42
|
+
*/
|
|
43
|
+
constructor(locale: Locale, integrations?: Array<FocusableView>);
|
|
44
|
+
/**
|
|
45
|
+
* @inheritDoc
|
|
46
|
+
*/
|
|
47
|
+
render(): void;
|
|
48
|
+
/**
|
|
49
|
+
* @inheritDoc
|
|
50
|
+
*/
|
|
51
|
+
destroy(): void;
|
|
52
|
+
/**
|
|
53
|
+
* Focuses the first {@link #_focusables focusable} in the form.
|
|
54
|
+
*/
|
|
55
|
+
focus(): void;
|
|
56
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
import { ButtonView, View, FocusCycler, LabeledFieldView, type InputTextView } from 'ckeditor5/src/ui.js';
|
|
6
|
+
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
|
|
7
|
+
/**
|
|
8
|
+
* The insert an image via URL view.
|
|
9
|
+
*
|
|
10
|
+
* See {@link module:image/imageinsert/imageinsertviaurlui~ImageInsertViaUrlUI}.
|
|
11
|
+
*/
|
|
12
|
+
export default class ImageInsertUrlView extends View {
|
|
13
|
+
/**
|
|
14
|
+
* The URL input field view.
|
|
15
|
+
*/
|
|
16
|
+
urlInputView: LabeledFieldView<InputTextView>;
|
|
17
|
+
/**
|
|
18
|
+
* The "insert/update" button view.
|
|
19
|
+
*/
|
|
20
|
+
insertButtonView: ButtonView;
|
|
21
|
+
/**
|
|
22
|
+
* The "cancel" button view.
|
|
23
|
+
*/
|
|
24
|
+
cancelButtonView: ButtonView;
|
|
25
|
+
/**
|
|
26
|
+
* The value of the URL input.
|
|
27
|
+
*
|
|
28
|
+
* @observable
|
|
29
|
+
*/
|
|
30
|
+
imageURLInputValue: string;
|
|
31
|
+
/**
|
|
32
|
+
* Observable property used to alter labels while some image is selected and when it is not.
|
|
33
|
+
*
|
|
34
|
+
* @observable
|
|
35
|
+
*/
|
|
36
|
+
isImageSelected: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Observable property indicating whether the form interactive elements should be enabled.
|
|
39
|
+
*
|
|
40
|
+
* @observable
|
|
41
|
+
*/
|
|
42
|
+
isEnabled: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* Tracks information about DOM focus in the form.
|
|
45
|
+
*/
|
|
46
|
+
readonly focusTracker: FocusTracker;
|
|
47
|
+
/**
|
|
48
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
49
|
+
*/
|
|
50
|
+
readonly keystrokes: KeystrokeHandler;
|
|
51
|
+
/**
|
|
52
|
+
* Helps cycling over {@link #_focusables} in the form.
|
|
53
|
+
*/
|
|
54
|
+
readonly focusCycler: FocusCycler;
|
|
55
|
+
/**
|
|
56
|
+
* A collection of views that can be focused in the form.
|
|
57
|
+
*/
|
|
58
|
+
private readonly _focusables;
|
|
59
|
+
/**
|
|
60
|
+
* Creates a view for the dropdown panel of {@link module:image/imageinsert/imageinsertui~ImageInsertUI}.
|
|
61
|
+
*
|
|
62
|
+
* @param locale The localization services instance.
|
|
63
|
+
*/
|
|
64
|
+
constructor(locale: Locale);
|
|
65
|
+
/**
|
|
66
|
+
* @inheritDoc
|
|
67
|
+
*/
|
|
68
|
+
render(): void;
|
|
69
|
+
/**
|
|
70
|
+
* @inheritDoc
|
|
71
|
+
*/
|
|
72
|
+
destroy(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Creates the {@link #urlInputView}.
|
|
75
|
+
*/
|
|
76
|
+
private _createUrlInputView;
|
|
77
|
+
/**
|
|
78
|
+
* Creates the {@link #insertButtonView}.
|
|
79
|
+
*/
|
|
80
|
+
private _createInsertButton;
|
|
81
|
+
/**
|
|
82
|
+
* Creates the {@link #cancelButtonView}.
|
|
83
|
+
*/
|
|
84
|
+
private _createCancelButton;
|
|
85
|
+
/**
|
|
86
|
+
* Focuses the view.
|
|
87
|
+
*/
|
|
88
|
+
focus(direction: 1 | -1): void;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Fired when the form view is submitted.
|
|
92
|
+
*
|
|
93
|
+
* @eventName ~ImageInsertUrlView#submit
|
|
94
|
+
*/
|
|
95
|
+
export type ImageInsertUrlViewSubmitEvent = {
|
|
96
|
+
name: 'submit';
|
|
97
|
+
args: [];
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Fired when the form view is canceled.
|
|
101
|
+
*
|
|
102
|
+
* @eventName ~ImageInsertUrlView#cancel
|
|
103
|
+
*/
|
|
104
|
+
export type ImageInsertUrlViewCancelEvent = {
|
|
105
|
+
name: 'cancel';
|
|
106
|
+
args: [];
|
|
107
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module image/imageinsert
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import ImageUpload from './imageupload.js';
|
|
10
|
+
import ImageInsertViaUrl from './imageinsertviaurl.js';
|
|
11
|
+
import ImageInsertUI from './imageinsert/imageinsertui.js';
|
|
12
|
+
/**
|
|
13
|
+
* The image insert plugin.
|
|
14
|
+
*
|
|
15
|
+
* For a detailed overview, check the {@glink features/images/image-upload/image-upload Image upload feature}
|
|
16
|
+
* and {@glink features/images/images-inserting Insert images via source URL} documentation.
|
|
17
|
+
*
|
|
18
|
+
* This plugin does not do anything directly, but it loads a set of specific plugins
|
|
19
|
+
* to enable image uploading or inserting via implemented integrations:
|
|
20
|
+
*
|
|
21
|
+
* * {@link module:image/imageupload~ImageUpload}
|
|
22
|
+
* * {@link module:image/imageinsert/imageinsertui~ImageInsertUI}
|
|
23
|
+
*/
|
|
24
|
+
export default class ImageInsert extends Plugin {
|
|
25
|
+
/**
|
|
26
|
+
* @inheritDoc
|
|
27
|
+
*/
|
|
28
|
+
static get pluginName(): "ImageInsert";
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
static get requires(): readonly [typeof ImageUpload, typeof ImageInsertViaUrl, typeof ImageInsertUI];
|
|
33
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module image/imageinsertviaurl
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import ImageInsertUI from './imageinsert/imageinsertui.js';
|
|
10
|
+
import ImageInsertViaUrlUI from './imageinsert/imageinsertviaurlui.js';
|
|
11
|
+
/**
|
|
12
|
+
* The image insert via URL plugin.
|
|
13
|
+
*
|
|
14
|
+
* For a detailed overview, check the {@glink features/images/images-inserting
|
|
15
|
+
* Insert images via source URL} documentation.
|
|
16
|
+
*
|
|
17
|
+
* This plugin does not do anything directly, but it loads a set of specific plugins
|
|
18
|
+
* to enable image inserting via implemented integrations:
|
|
19
|
+
*
|
|
20
|
+
* * {@link module:image/imageinsert/imageinsertui~ImageInsertUI},
|
|
21
|
+
*/
|
|
22
|
+
export default class ImageInsertViaUrl extends Plugin {
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get pluginName(): "ImageInsertViaUrl";
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static get requires(): readonly [typeof ImageInsertViaUrlUI, typeof ImageInsertUI];
|
|
31
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module image/imageresize/imageresizebuttons
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
9
|
+
import ImageResizeEditing from './imageresizeediting.js';
|
|
10
|
+
/**
|
|
11
|
+
* The image resize buttons plugin.
|
|
12
|
+
*
|
|
13
|
+
* It adds a possibility to resize images using the toolbar dropdown or individual buttons, depending on the plugin configuration.
|
|
14
|
+
*/
|
|
15
|
+
export default class ImageResizeButtons extends Plugin {
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
static get requires(): readonly [typeof ImageResizeEditing];
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
static get pluginName(): "ImageResizeButtons";
|
|
24
|
+
/**
|
|
25
|
+
* The resize unit.
|
|
26
|
+
* @default '%'
|
|
27
|
+
*/
|
|
28
|
+
private readonly _resizeUnit;
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
constructor(editor: Editor);
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
init(): void;
|
|
37
|
+
/**
|
|
38
|
+
* A helper function that creates a standalone button component for the plugin.
|
|
39
|
+
*
|
|
40
|
+
* @param resizeOption A model of the resize option.
|
|
41
|
+
*/
|
|
42
|
+
private _registerImageResizeButton;
|
|
43
|
+
/**
|
|
44
|
+
* A helper function that creates a dropdown component for the plugin containing all the resize options defined in
|
|
45
|
+
* the editor configuration.
|
|
46
|
+
*
|
|
47
|
+
* @param options An array of configured options.
|
|
48
|
+
*/
|
|
49
|
+
private _registerImageResizeDropdown;
|
|
50
|
+
/**
|
|
51
|
+
* A helper function for creating an option label value string.
|
|
52
|
+
*
|
|
53
|
+
* @param option A resize option object.
|
|
54
|
+
* @param forTooltip An optional flag for creating a tooltip label.
|
|
55
|
+
* @returns A user-defined label combined from the numeric value and the resize unit or the default label
|
|
56
|
+
* for reset options (`Original`).
|
|
57
|
+
*/
|
|
58
|
+
private _getOptionLabelValue;
|
|
59
|
+
/**
|
|
60
|
+
* A helper function that parses the resize options and returns list item definitions ready for use in the dropdown.
|
|
61
|
+
*
|
|
62
|
+
* @param options The resize options.
|
|
63
|
+
* @param command The resize image command.
|
|
64
|
+
* @returns Dropdown item definitions.
|
|
65
|
+
*/
|
|
66
|
+
private _getResizeDropdownListItemDefinitions;
|
|
67
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
import { type Editor, Plugin } from 'ckeditor5/src/core.js';
|
|
6
|
+
import ImageUtils from '../imageutils.js';
|
|
7
|
+
/**
|
|
8
|
+
* The image resize editing feature.
|
|
9
|
+
*
|
|
10
|
+
* It adds the ability to resize each image using handles or manually by
|
|
11
|
+
* {@link module:image/imageresize/imageresizebuttons~ImageResizeButtons} buttons.
|
|
12
|
+
*/
|
|
13
|
+
export default class ImageResizeEditing extends Plugin {
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
static get requires(): readonly [typeof ImageUtils];
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get pluginName(): "ImageResizeEditing";
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
constructor(editor: Editor);
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
init(): void;
|
|
30
|
+
private _registerSchema;
|
|
31
|
+
/**
|
|
32
|
+
* Registers image resize converters.
|
|
33
|
+
*
|
|
34
|
+
* @param imageType The type of the image.
|
|
35
|
+
*/
|
|
36
|
+
private _registerConverters;
|
|
37
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
6
|
+
import { WidgetResize } from 'ckeditor5/src/widget.js';
|
|
7
|
+
import ImageUtils from '../imageutils.js';
|
|
8
|
+
/**
|
|
9
|
+
* The image resize by handles feature.
|
|
10
|
+
*
|
|
11
|
+
* It adds the ability to resize each image using handles or manually by
|
|
12
|
+
* {@link module:image/imageresize/imageresizebuttons~ImageResizeButtons} buttons.
|
|
13
|
+
*/
|
|
14
|
+
export default class ImageResizeHandles extends Plugin {
|
|
15
|
+
/**
|
|
16
|
+
* @inheritDoc
|
|
17
|
+
*/
|
|
18
|
+
static get requires(): readonly [typeof WidgetResize, typeof ImageUtils];
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get pluginName(): "ImageResizeHandles";
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
init(): void;
|
|
27
|
+
/**
|
|
28
|
+
* Attaches the listeners responsible for creating a resizer for each image, except for images inside the HTML embed preview.
|
|
29
|
+
*/
|
|
30
|
+
private _setupResizerCreator;
|
|
31
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module image/imageresize/resizeimagecommand
|
|
7
|
+
*/
|
|
8
|
+
import { Command } from 'ckeditor5/src/core.js';
|
|
9
|
+
/**
|
|
10
|
+
* The resize image command. Currently, it only supports the width attribute.
|
|
11
|
+
*/
|
|
12
|
+
export default class ResizeImageCommand extends Command {
|
|
13
|
+
/**
|
|
14
|
+
* Desired image width and height.
|
|
15
|
+
*/
|
|
16
|
+
value: null | {
|
|
17
|
+
width: string | null;
|
|
18
|
+
height: string | null;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
refresh(): void;
|
|
24
|
+
/**
|
|
25
|
+
* Executes the command.
|
|
26
|
+
*
|
|
27
|
+
* ```ts
|
|
28
|
+
* // Sets the width to 50%:
|
|
29
|
+
* editor.execute( 'resizeImage', { width: '50%' } );
|
|
30
|
+
*
|
|
31
|
+
* // Removes the width attribute:
|
|
32
|
+
* editor.execute( 'resizeImage', { width: null } );
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @param options
|
|
36
|
+
* @param options.width The new width of the image.
|
|
37
|
+
* @fires execute
|
|
38
|
+
*/
|
|
39
|
+
execute(options: {
|
|
40
|
+
width: string | null;
|
|
41
|
+
}): void;
|
|
42
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module image/imageresize
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import ImageResizeButtons from './imageresize/imageresizebuttons.js';
|
|
10
|
+
import ImageResizeEditing from './imageresize/imageresizeediting.js';
|
|
11
|
+
import ImageResizeHandles from './imageresize/imageresizehandles.js';
|
|
12
|
+
import '../theme/imageresize.css';
|
|
13
|
+
/**
|
|
14
|
+
* The image resize plugin.
|
|
15
|
+
*
|
|
16
|
+
* It adds a possibility to resize each image using handles.
|
|
17
|
+
*/
|
|
18
|
+
export default class ImageResize extends Plugin {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get requires(): readonly [typeof ImageResizeEditing, typeof ImageResizeHandles, typeof ImageResizeButtons];
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get pluginName(): "ImageResize";
|
|
27
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module image/imagesizeattributes
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import ImageUtils from './imageutils.js';
|
|
10
|
+
/**
|
|
11
|
+
* This plugin enables `width` and `height` attributes in inline and block image elements.
|
|
12
|
+
*/
|
|
13
|
+
export default class ImageSizeAttributes extends Plugin {
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
static get requires(): readonly [typeof ImageUtils];
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get pluginName(): "ImageSizeAttributes";
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
afterInit(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Registers the `width` and `height` attributes for inline and block images.
|
|
28
|
+
*/
|
|
29
|
+
private _registerSchema;
|
|
30
|
+
/**
|
|
31
|
+
* Registers converters for `width` and `height` attributes.
|
|
32
|
+
*/
|
|
33
|
+
private _registerConverters;
|
|
34
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
import type { DowncastAttributeEvent, UpcastElementEvent } from 'ckeditor5/src/engine.js';
|
|
6
|
+
import { type GetCallback } from 'ckeditor5/src/utils.js';
|
|
7
|
+
import type { ImageStyleOptionDefinition } from '../imageconfig.js';
|
|
8
|
+
/**
|
|
9
|
+
* @module image/imagestyle/converters
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Returns a converter for the `imageStyle` attribute. It can be used for adding, changing and removing the attribute.
|
|
13
|
+
*
|
|
14
|
+
* @param styles An array containing available image style options.
|
|
15
|
+
* @returns A model-to-view attribute converter.
|
|
16
|
+
*/
|
|
17
|
+
export declare function modelToViewStyleAttribute(styles: Array<ImageStyleOptionDefinition>): GetCallback<DowncastAttributeEvent>;
|
|
18
|
+
/**
|
|
19
|
+
* Returns a view-to-model converter converting image CSS classes to a proper value in the model.
|
|
20
|
+
*
|
|
21
|
+
* @param styles Image style options for which the converter is created.
|
|
22
|
+
* @returns A view-to-model converter.
|
|
23
|
+
*/
|
|
24
|
+
export declare function viewToModelStyleAttribute(styles: Array<ImageStyleOptionDefinition>): GetCallback<UpcastElementEvent>;
|