@ckeditor/ckeditor5-image 47.6.1-alpha.1 → 48.0.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/LICENSE.md +1 -1
- package/ckeditor5-metadata.json +25 -25
- package/{src → dist}/autoimage.d.ts +4 -4
- package/{src → dist}/image/converters.d.ts +1 -1
- package/{src → dist}/image/imageblockediting.d.ts +2 -2
- package/{src → dist}/image/imageediting.d.ts +1 -1
- package/{src → dist}/image/imageinlineediting.d.ts +2 -2
- package/{src → dist}/image/imageloadobserver.d.ts +1 -1
- package/{src → dist}/image/imageplaceholder.d.ts +1 -1
- package/{src → dist}/image/imagetypecommand.d.ts +2 -2
- package/{src → dist}/image/insertimagecommand.d.ts +2 -2
- package/{src → dist}/image/replaceimagesourcecommand.d.ts +2 -2
- package/{src → dist}/image/ui/utils.d.ts +2 -2
- package/{src → dist}/image/utils.d.ts +2 -2
- package/{src → dist}/image.d.ts +1 -1
- package/{src → dist}/imageblock.d.ts +2 -2
- package/{src → dist}/imagecaption/imagecaptionediting.d.ts +2 -2
- package/{src → dist}/imagecaption/imagecaptionui.d.ts +1 -1
- package/{src → dist}/imagecaption/imagecaptionutils.d.ts +2 -2
- package/{src → dist}/imagecaption/toggleimagecaptioncommand.d.ts +1 -1
- package/{src → dist}/imagecaption.d.ts +1 -1
- package/{src → dist}/imageconfig.d.ts +25 -16
- package/{src → dist}/imageinline.d.ts +2 -2
- package/{src → dist}/imageinsert/imageinsertui.d.ts +3 -3
- package/{src → dist}/imageinsert/imageinsertviaurlui.d.ts +2 -2
- package/{src → dist}/imageinsert/ui/imageinsertformview.d.ts +2 -2
- package/{src → dist}/imageinsert/ui/imageinserturlview.d.ts +2 -2
- package/{src → dist}/imageinsert.d.ts +1 -1
- package/{src → dist}/imageinsertviaurl.d.ts +1 -1
- package/{src → dist}/imageresize/imagecustomresizeui.d.ts +2 -2
- package/{src → dist}/imageresize/imageresizebuttons.d.ts +1 -1
- package/{src → dist}/imageresize/imageresizeediting.d.ts +1 -1
- package/{src → dist}/imageresize/imageresizehandles.d.ts +2 -2
- package/{src → dist}/imageresize/resizeimagecommand.d.ts +1 -1
- package/{src → dist}/imageresize/ui/imagecustomresizeformview.d.ts +2 -4
- package/{src → dist}/imageresize/utils/getselectedimageeditornodes.d.ts +2 -2
- package/{src → dist}/imageresize/utils/getselectedimagepossibleresizerange.d.ts +1 -1
- package/{src → dist}/imageresize/utils/getselectedimagewidthinunits.d.ts +1 -1
- package/{src → dist}/imageresize.d.ts +1 -1
- package/{src → dist}/imagesizeattributes.d.ts +1 -1
- package/{src → dist}/imagestyle/converters.d.ts +2 -2
- package/{src → dist}/imagestyle/imagestylecommand.d.ts +2 -2
- package/{src → dist}/imagestyle/imagestyleediting.d.ts +1 -1
- package/{src → dist}/imagestyle/imagestyleui.d.ts +1 -1
- package/{src → dist}/imagestyle/utils.d.ts +1 -1
- package/{src → dist}/imagestyle.d.ts +1 -1
- package/{src → dist}/imagetextalternative/imagetextalternativecommand.d.ts +1 -1
- package/{src → dist}/imagetextalternative/imagetextalternativeediting.d.ts +1 -1
- package/{src → dist}/imagetextalternative/imagetextalternativeui.d.ts +2 -2
- package/{src → dist}/imagetextalternative/ui/textalternativeformview.d.ts +2 -4
- package/{src → dist}/imagetextalternative.d.ts +1 -1
- package/{src → dist}/imagetoolbar.d.ts +2 -2
- package/{src → dist}/imageupload/imageuploadediting.d.ts +5 -5
- package/{src → dist}/imageupload/imageuploadprogress.d.ts +1 -1
- package/{src → dist}/imageupload/imageuploadui.d.ts +1 -1
- package/{src → dist}/imageupload/uploadimagecommand.d.ts +2 -2
- package/{src → dist}/imageupload/utils.d.ts +1 -1
- package/{src → dist}/imageupload.d.ts +1 -1
- package/{src → dist}/imageutils.d.ts +2 -2
- package/dist/index-content.css +97 -100
- package/dist/index-editor.css +313 -190
- package/dist/index.css +388 -458
- package/dist/index.css.map +1 -1
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/{src → dist}/pictureediting.d.ts +1 -1
- package/package.json +29 -53
- package/build/image.js +0 -5
- package/build/translations/af.js +0 -1
- package/build/translations/ar.js +0 -1
- package/build/translations/ast.js +0 -1
- package/build/translations/az.js +0 -1
- package/build/translations/be.js +0 -1
- package/build/translations/bg.js +0 -1
- package/build/translations/bn.js +0 -1
- package/build/translations/bs.js +0 -1
- package/build/translations/ca.js +0 -1
- package/build/translations/cs.js +0 -1
- package/build/translations/da.js +0 -1
- package/build/translations/de-ch.js +0 -1
- package/build/translations/de.js +0 -1
- package/build/translations/el.js +0 -1
- package/build/translations/en-au.js +0 -1
- package/build/translations/en-gb.js +0 -1
- package/build/translations/eo.js +0 -1
- package/build/translations/es-co.js +0 -1
- package/build/translations/es.js +0 -1
- package/build/translations/et.js +0 -1
- package/build/translations/eu.js +0 -1
- package/build/translations/fa.js +0 -1
- package/build/translations/fi.js +0 -1
- package/build/translations/fr.js +0 -1
- package/build/translations/gl.js +0 -1
- package/build/translations/gu.js +0 -1
- package/build/translations/he.js +0 -1
- package/build/translations/hi.js +0 -1
- package/build/translations/hr.js +0 -1
- package/build/translations/hu.js +0 -1
- package/build/translations/hy.js +0 -1
- package/build/translations/id.js +0 -1
- package/build/translations/it.js +0 -1
- package/build/translations/ja.js +0 -1
- package/build/translations/jv.js +0 -1
- package/build/translations/kk.js +0 -1
- package/build/translations/km.js +0 -1
- package/build/translations/kn.js +0 -1
- package/build/translations/ko.js +0 -1
- package/build/translations/ku.js +0 -1
- package/build/translations/lt.js +0 -1
- package/build/translations/lv.js +0 -1
- package/build/translations/ms.js +0 -1
- package/build/translations/nb.js +0 -1
- package/build/translations/ne.js +0 -1
- package/build/translations/nl.js +0 -1
- package/build/translations/no.js +0 -1
- package/build/translations/oc.js +0 -1
- package/build/translations/pl.js +0 -1
- package/build/translations/pt-br.js +0 -1
- package/build/translations/pt.js +0 -1
- package/build/translations/ro.js +0 -1
- package/build/translations/ru.js +0 -1
- package/build/translations/si.js +0 -1
- package/build/translations/sk.js +0 -1
- package/build/translations/sl.js +0 -1
- package/build/translations/sq.js +0 -1
- package/build/translations/sr-latn.js +0 -1
- package/build/translations/sr.js +0 -1
- package/build/translations/sv.js +0 -1
- package/build/translations/th.js +0 -1
- package/build/translations/ti.js +0 -1
- package/build/translations/tk.js +0 -1
- package/build/translations/tr.js +0 -1
- package/build/translations/tt.js +0 -1
- package/build/translations/ug.js +0 -1
- package/build/translations/uk.js +0 -1
- package/build/translations/ur.js +0 -1
- package/build/translations/uz.js +0 -1
- package/build/translations/vi.js +0 -1
- package/build/translations/zh-cn.js +0 -1
- package/build/translations/zh.js +0 -1
- package/lang/contexts.json +0 -48
- package/lang/translations/af.po +0 -196
- package/lang/translations/ar.po +0 -196
- package/lang/translations/ast.po +0 -196
- package/lang/translations/az.po +0 -196
- package/lang/translations/be.po +0 -196
- package/lang/translations/bg.po +0 -196
- package/lang/translations/bn.po +0 -196
- package/lang/translations/bs.po +0 -196
- package/lang/translations/ca.po +0 -196
- package/lang/translations/cs.po +0 -196
- package/lang/translations/da.po +0 -196
- package/lang/translations/de-ch.po +0 -196
- package/lang/translations/de.po +0 -196
- package/lang/translations/el.po +0 -196
- package/lang/translations/en-au.po +0 -196
- package/lang/translations/en-gb.po +0 -196
- package/lang/translations/en.po +0 -196
- package/lang/translations/eo.po +0 -196
- package/lang/translations/es-co.po +0 -196
- package/lang/translations/es.po +0 -196
- package/lang/translations/et.po +0 -196
- package/lang/translations/eu.po +0 -196
- package/lang/translations/fa.po +0 -196
- package/lang/translations/fi.po +0 -196
- package/lang/translations/fr.po +0 -196
- package/lang/translations/gl.po +0 -196
- package/lang/translations/gu.po +0 -196
- package/lang/translations/he.po +0 -196
- package/lang/translations/hi.po +0 -196
- package/lang/translations/hr.po +0 -196
- package/lang/translations/hu.po +0 -196
- package/lang/translations/hy.po +0 -196
- package/lang/translations/id.po +0 -196
- package/lang/translations/it.po +0 -196
- package/lang/translations/ja.po +0 -196
- package/lang/translations/jv.po +0 -196
- package/lang/translations/kk.po +0 -196
- package/lang/translations/km.po +0 -196
- package/lang/translations/kn.po +0 -196
- package/lang/translations/ko.po +0 -196
- package/lang/translations/ku.po +0 -196
- package/lang/translations/lt.po +0 -196
- package/lang/translations/lv.po +0 -196
- package/lang/translations/ms.po +0 -196
- package/lang/translations/nb.po +0 -196
- package/lang/translations/ne.po +0 -196
- package/lang/translations/nl.po +0 -196
- package/lang/translations/no.po +0 -196
- package/lang/translations/oc.po +0 -196
- package/lang/translations/pl.po +0 -196
- package/lang/translations/pt-br.po +0 -196
- package/lang/translations/pt.po +0 -196
- package/lang/translations/ro.po +0 -196
- package/lang/translations/ru.po +0 -196
- package/lang/translations/si.po +0 -196
- package/lang/translations/sk.po +0 -196
- package/lang/translations/sl.po +0 -196
- package/lang/translations/sq.po +0 -196
- package/lang/translations/sr-latn.po +0 -196
- package/lang/translations/sr.po +0 -196
- package/lang/translations/sv.po +0 -196
- package/lang/translations/th.po +0 -196
- package/lang/translations/ti.po +0 -196
- package/lang/translations/tk.po +0 -196
- package/lang/translations/tr.po +0 -196
- package/lang/translations/tt.po +0 -196
- package/lang/translations/ug.po +0 -196
- package/lang/translations/uk.po +0 -196
- package/lang/translations/ur.po +0 -196
- package/lang/translations/uz.po +0 -196
- package/lang/translations/vi.po +0 -196
- package/lang/translations/zh-cn.po +0 -196
- package/lang/translations/zh.po +0 -196
- package/src/augmentation.js +0 -5
- package/src/autoimage.js +0 -148
- package/src/image/converters.js +0 -236
- package/src/image/imageblockediting.js +0 -159
- package/src/image/imageediting.js +0 -69
- package/src/image/imageinlineediting.js +0 -178
- package/src/image/imageloadobserver.js +0 -52
- package/src/image/imageplaceholder.js +0 -119
- package/src/image/imagetypecommand.js +0 -84
- package/src/image/insertimagecommand.js +0 -125
- package/src/image/replaceimagesourcecommand.js +0 -75
- package/src/image/ui/utils.js +0 -46
- package/src/image/utils.js +0 -125
- package/src/image.js +0 -44
- package/src/imageblock.js +0 -44
- package/src/imagecaption/imagecaptionediting.js +0 -238
- package/src/imagecaption/imagecaptionui.js +0 -68
- package/src/imagecaption/imagecaptionutils.js +0 -68
- package/src/imagecaption/toggleimagecaptioncommand.js +0 -138
- package/src/imagecaption.js +0 -36
- package/src/imageconfig.js +0 -5
- package/src/imageinline.js +0 -44
- package/src/imageinsert/imageinsertui.js +0 -216
- package/src/imageinsert/imageinsertviaurlui.js +0 -175
- package/src/imageinsert/ui/imageinsertformview.js +0 -117
- package/src/imageinsert/ui/imageinserturlview.js +0 -102
- package/src/imageinsert.js +0 -43
- package/src/imageinsertviaurl.js +0 -41
- package/src/imageresize/imagecustomresizeui.js +0 -177
- package/src/imageresize/imageresizebuttons.js +0 -303
- package/src/imageresize/imageresizeediting.js +0 -206
- package/src/imageresize/imageresizehandles.js +0 -118
- package/src/imageresize/resizeimagecommand.js +0 -63
- package/src/imageresize/ui/imagecustomresizeformview.js +0 -264
- package/src/imageresize/utils/getselectedimageeditornodes.js +0 -25
- package/src/imageresize/utils/getselectedimagepossibleresizerange.js +0 -33
- package/src/imageresize/utils/getselectedimagewidthinunits.js +0 -42
- package/src/imageresize/utils/tryparsedimensionwithunit.js +0 -58
- package/src/imageresize.js +0 -38
- package/src/imagesizeattributes.js +0 -163
- package/src/imagestyle/converters.js +0 -118
- package/src/imagestyle/imagestylecommand.js +0 -117
- package/src/imagestyle/imagestyleediting.js +0 -127
- package/src/imagestyle/imagestyleui.js +0 -198
- package/src/imagestyle/utils.js +0 -333
- package/src/imagestyle.js +0 -42
- package/src/imagetextalternative/imagetextalternativecommand.js +0 -44
- package/src/imagetextalternative/imagetextalternativeediting.js +0 -41
- package/src/imagetextalternative/imagetextalternativeui.js +0 -183
- package/src/imagetextalternative/ui/textalternativeformview.js +0 -193
- package/src/imagetextalternative.js +0 -39
- package/src/imagetoolbar.js +0 -63
- package/src/imageupload/imageuploadediting.js +0 -482
- package/src/imageupload/imageuploadprogress.js +0 -222
- package/src/imageupload/imageuploadui.js +0 -135
- package/src/imageupload/uploadimagecommand.js +0 -110
- package/src/imageupload/utils.js +0 -114
- package/src/imageupload.js +0 -42
- package/src/imageutils.js +0 -309
- package/src/index.js +0 -67
- package/src/pictureediting.js +0 -136
- package/theme/image.css +0 -143
- package/theme/imagecaption.css +0 -53
- package/theme/imagecustomresizeform.css +0 -4
- package/theme/imageinsert.css +0 -14
- package/theme/imageplaceholder.css +0 -10
- package/theme/imageresize.css +0 -53
- package/theme/imagestyle.css +0 -120
- package/theme/imageuploadicon.css +0 -23
- package/theme/imageuploadloader.css +0 -18
- package/theme/imageuploadprogress.css +0 -19
- package/theme/textalternativeform.css +0 -4
- /package/{src → dist}/augmentation.d.ts +0 -0
- /package/{src → dist}/imageresize/utils/tryparsedimensionwithunit.d.ts +0 -0
- /package/{src → dist}/index.d.ts +0 -0
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module image/imageinsert/imageinsertui
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { logWarning } from 'ckeditor5/src/utils.js';
|
|
10
|
-
import { createDropdown, MenuBarMenuListItemView, MenuBarMenuListView, MenuBarMenuView, SplitButtonView } from 'ckeditor5/src/ui.js';
|
|
11
|
-
import { IconImage } from 'ckeditor5/src/icons.js';
|
|
12
|
-
import { ImageInsertFormView } from './ui/imageinsertformview.js';
|
|
13
|
-
import { ImageUtils } from '../imageutils.js';
|
|
14
|
-
/**
|
|
15
|
-
* The image insert dropdown plugin.
|
|
16
|
-
*
|
|
17
|
-
* For a detailed overview, check the {@glink features/images/image-upload/image-upload Image upload feature}
|
|
18
|
-
* and {@glink features/images/images-inserting Insert images via source URL} documentation.
|
|
19
|
-
*
|
|
20
|
-
* Adds the `'insertImage'` dropdown to the {@link module:ui/componentfactory~ComponentFactory UI component factory}
|
|
21
|
-
* and also the `imageInsert` dropdown as an alias for backward compatibility.
|
|
22
|
-
*
|
|
23
|
-
* Adds the `'menuBar:insertImage'` sub-menu to the {@link module:ui/componentfactory~ComponentFactory UI component factory}, which is
|
|
24
|
-
* by default added to the `'Insert'` menu.
|
|
25
|
-
*/
|
|
26
|
-
export class ImageInsertUI extends Plugin {
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
static get pluginName() {
|
|
31
|
-
return 'ImageInsertUI';
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @inheritDoc
|
|
35
|
-
*/
|
|
36
|
-
static get isOfficialPlugin() {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* @inheritDoc
|
|
41
|
-
*/
|
|
42
|
-
static get requires() {
|
|
43
|
-
return [ImageUtils];
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* The dropdown view responsible for displaying the image insert UI.
|
|
47
|
-
*/
|
|
48
|
-
dropdownView;
|
|
49
|
-
/**
|
|
50
|
-
* Registered integrations map.
|
|
51
|
-
*/
|
|
52
|
-
_integrations = new Map();
|
|
53
|
-
/**
|
|
54
|
-
* @inheritDoc
|
|
55
|
-
*/
|
|
56
|
-
constructor(editor) {
|
|
57
|
-
super(editor);
|
|
58
|
-
editor.config.define('image.insert.integrations', [
|
|
59
|
-
'upload',
|
|
60
|
-
'assetManager',
|
|
61
|
-
'url'
|
|
62
|
-
]);
|
|
63
|
-
}
|
|
64
|
-
/**
|
|
65
|
-
* @inheritDoc
|
|
66
|
-
*/
|
|
67
|
-
init() {
|
|
68
|
-
const editor = this.editor;
|
|
69
|
-
const selection = editor.model.document.selection;
|
|
70
|
-
const imageUtils = editor.plugins.get('ImageUtils');
|
|
71
|
-
this.set('isImageSelected', false);
|
|
72
|
-
this.listenTo(editor.model.document, 'change', () => {
|
|
73
|
-
this.isImageSelected = imageUtils.isImage(selection.getSelectedElement());
|
|
74
|
-
});
|
|
75
|
-
const componentCreator = (locale) => this._createToolbarComponent(locale);
|
|
76
|
-
const menuBarComponentCreator = (locale) => this._createMenuBarComponent(locale);
|
|
77
|
-
// Register `insertImage` dropdown and add `imageInsert` dropdown as an alias for backward compatibility.
|
|
78
|
-
editor.ui.componentFactory.add('insertImage', componentCreator);
|
|
79
|
-
editor.ui.componentFactory.add('imageInsert', componentCreator);
|
|
80
|
-
editor.ui.componentFactory.add('menuBar:insertImage', menuBarComponentCreator);
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Registers the insert image dropdown integration.
|
|
84
|
-
*/
|
|
85
|
-
registerIntegration({ name, observable, buttonViewCreator, formViewCreator, menuBarButtonViewCreator, requiresForm = false, override = false }) {
|
|
86
|
-
if (this._integrations.has(name) && !override) {
|
|
87
|
-
/**
|
|
88
|
-
* There are two insert-image integrations registered with the same name.
|
|
89
|
-
*
|
|
90
|
-
* Make sure that you do not load multiple asset manager plugins.
|
|
91
|
-
*
|
|
92
|
-
* @error image-insert-integration-exists
|
|
93
|
-
*/
|
|
94
|
-
logWarning('image-insert-integration-exists', { name });
|
|
95
|
-
}
|
|
96
|
-
this._integrations.set(name, {
|
|
97
|
-
observable,
|
|
98
|
-
buttonViewCreator,
|
|
99
|
-
menuBarButtonViewCreator,
|
|
100
|
-
formViewCreator,
|
|
101
|
-
requiresForm
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Creates the toolbar component.
|
|
106
|
-
*/
|
|
107
|
-
_createToolbarComponent(locale) {
|
|
108
|
-
const editor = this.editor;
|
|
109
|
-
const t = locale.t;
|
|
110
|
-
const integrations = this._prepareIntegrations();
|
|
111
|
-
if (!integrations.length) {
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
let dropdownButton;
|
|
115
|
-
const firstIntegration = integrations[0];
|
|
116
|
-
if (integrations.length == 1) {
|
|
117
|
-
// Do not use dropdown for a single integration button (integration that does not require form view).
|
|
118
|
-
if (!firstIntegration.requiresForm) {
|
|
119
|
-
return firstIntegration.buttonViewCreator(true);
|
|
120
|
-
}
|
|
121
|
-
dropdownButton = firstIntegration.buttonViewCreator(true);
|
|
122
|
-
}
|
|
123
|
-
else {
|
|
124
|
-
const actionButton = firstIntegration.buttonViewCreator(false);
|
|
125
|
-
dropdownButton = new SplitButtonView(locale, actionButton);
|
|
126
|
-
dropdownButton.tooltip = true;
|
|
127
|
-
dropdownButton.bind('label').to(this, 'isImageSelected', isImageSelected => isImageSelected ?
|
|
128
|
-
t('Replace image') :
|
|
129
|
-
t('Insert image'));
|
|
130
|
-
}
|
|
131
|
-
const dropdownView = this.dropdownView = createDropdown(locale, dropdownButton);
|
|
132
|
-
const observables = integrations.map(({ observable }) => typeof observable == 'function' ? observable() : observable);
|
|
133
|
-
dropdownView.bind('isEnabled').toMany(observables, 'isEnabled', (...isEnabled) => (isEnabled.some(isEnabled => isEnabled)));
|
|
134
|
-
dropdownView.once('change:isOpen', () => {
|
|
135
|
-
const integrationViews = integrations.flatMap(({ formViewCreator }) => formViewCreator(integrations.length == 1));
|
|
136
|
-
const imageInsertFormView = new ImageInsertFormView(editor.locale, integrationViews);
|
|
137
|
-
dropdownView.panelView.children.add(imageInsertFormView);
|
|
138
|
-
});
|
|
139
|
-
return dropdownView;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Creates the menu bar component.
|
|
143
|
-
*/
|
|
144
|
-
_createMenuBarComponent(locale) {
|
|
145
|
-
const t = locale.t;
|
|
146
|
-
const integrations = this._prepareIntegrations();
|
|
147
|
-
if (!integrations.length) {
|
|
148
|
-
return null;
|
|
149
|
-
}
|
|
150
|
-
const integrationViews = integrations.flatMap(({ menuBarButtonViewCreator }) => menuBarButtonViewCreator(integrations.length == 1));
|
|
151
|
-
const resultView = new MenuBarMenuView(locale);
|
|
152
|
-
const listView = new MenuBarMenuListView(locale);
|
|
153
|
-
resultView.panelView.children.add(listView);
|
|
154
|
-
resultView.buttonView.set({
|
|
155
|
-
icon: IconImage,
|
|
156
|
-
label: t('Image')
|
|
157
|
-
});
|
|
158
|
-
for (const integrationView of integrationViews) {
|
|
159
|
-
const listItemView = new MenuBarMenuListItemView(locale, resultView);
|
|
160
|
-
listItemView.children.add(integrationView);
|
|
161
|
-
listView.items.add(listItemView);
|
|
162
|
-
integrationView.delegate('execute').to(resultView);
|
|
163
|
-
}
|
|
164
|
-
return resultView;
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Validates the integrations list.
|
|
168
|
-
*/
|
|
169
|
-
_prepareIntegrations() {
|
|
170
|
-
const editor = this.editor;
|
|
171
|
-
const items = editor.config.get('image.insert.integrations');
|
|
172
|
-
const result = [];
|
|
173
|
-
if (!items.length) {
|
|
174
|
-
/**
|
|
175
|
-
* The insert image feature requires a list of integrations to be provided in the editor configuration.
|
|
176
|
-
*
|
|
177
|
-
* The default list of integrations is `upload`, `assetManager`, `url`. Those integrations are included
|
|
178
|
-
* in the insert image dropdown if the given feature plugin is loaded. You should omit the `integrations`
|
|
179
|
-
* configuration key to use the default set or provide a selected list of integrations that should be used.
|
|
180
|
-
*
|
|
181
|
-
* @error image-insert-integrations-not-specified
|
|
182
|
-
*/
|
|
183
|
-
logWarning('image-insert-integrations-not-specified');
|
|
184
|
-
return result;
|
|
185
|
-
}
|
|
186
|
-
for (const item of items) {
|
|
187
|
-
if (!this._integrations.has(item)) {
|
|
188
|
-
if (!['upload', 'assetManager', 'url'].includes(item)) {
|
|
189
|
-
/**
|
|
190
|
-
* The specified insert image integration name is unknown or the providing plugin is not loaded in the editor.
|
|
191
|
-
*
|
|
192
|
-
* @error image-insert-unknown-integration
|
|
193
|
-
*/
|
|
194
|
-
logWarning('image-insert-unknown-integration', { item });
|
|
195
|
-
}
|
|
196
|
-
continue;
|
|
197
|
-
}
|
|
198
|
-
result.push(this._integrations.get(item));
|
|
199
|
-
}
|
|
200
|
-
if (!result.length) {
|
|
201
|
-
/**
|
|
202
|
-
* The image insert feature requires integrations to be registered by separate features.
|
|
203
|
-
*
|
|
204
|
-
* The `insertImage` toolbar button requires integrations to be registered by other features.
|
|
205
|
-
* For example {@link module:image/imageupload~ImageUpload ImageUpload},
|
|
206
|
-
* {@link module:image/imageinsert~ImageInsert ImageInsert},
|
|
207
|
-
* {@link module:image/imageinsertviaurl~ImageInsertViaUrl ImageInsertViaUrl},
|
|
208
|
-
* {@link module:ckbox/ckbox~CKBox CKBox}
|
|
209
|
-
*
|
|
210
|
-
* @error image-insert-integrations-not-registered
|
|
211
|
-
*/
|
|
212
|
-
logWarning('image-insert-integrations-not-registered');
|
|
213
|
-
}
|
|
214
|
-
return result;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
@@ -1,175 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module image/imageinsert/imageinsertviaurlui
|
|
7
|
-
*/
|
|
8
|
-
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
-
import { ButtonView, Dialog, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
|
|
10
|
-
import { IconImageUrl } from 'ckeditor5/src/icons.js';
|
|
11
|
-
import { ImageInsertUI } from './imageinsertui.js';
|
|
12
|
-
import { ImageInsertUrlView } from './ui/imageinserturlview.js';
|
|
13
|
-
/**
|
|
14
|
-
* The image insert via URL plugin (UI part).
|
|
15
|
-
*
|
|
16
|
-
* The plugin introduces two UI components to the {@link module:ui/componentfactory~ComponentFactory UI component factory}:
|
|
17
|
-
*
|
|
18
|
-
* * the `'insertImageViaUrl'` toolbar button,
|
|
19
|
-
* * the `'menuBar:insertImageViaUrl'` menu bar component.
|
|
20
|
-
*
|
|
21
|
-
* It also integrates with the `insertImage` toolbar component and `menuBar:insertImage` menu component, which are default components
|
|
22
|
-
* through which inserting image via URL is available.
|
|
23
|
-
*/
|
|
24
|
-
export class ImageInsertViaUrlUI extends Plugin {
|
|
25
|
-
_imageInsertUI;
|
|
26
|
-
_formView;
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
static get pluginName() {
|
|
31
|
-
return 'ImageInsertViaUrlUI';
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* @inheritDoc
|
|
35
|
-
*/
|
|
36
|
-
static get isOfficialPlugin() {
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* @inheritDoc
|
|
41
|
-
*/
|
|
42
|
-
static get requires() {
|
|
43
|
-
return [ImageInsertUI, Dialog];
|
|
44
|
-
}
|
|
45
|
-
init() {
|
|
46
|
-
this.editor.ui.componentFactory.add('insertImageViaUrl', () => this._createToolbarButton());
|
|
47
|
-
this.editor.ui.componentFactory.add('menuBar:insertImageViaUrl', () => this._createMenuBarButton('standalone'));
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* @inheritDoc
|
|
51
|
-
*/
|
|
52
|
-
afterInit() {
|
|
53
|
-
this._imageInsertUI = this.editor.plugins.get('ImageInsertUI');
|
|
54
|
-
this._imageInsertUI.registerIntegration({
|
|
55
|
-
name: 'url',
|
|
56
|
-
observable: () => this.editor.commands.get('insertImage'),
|
|
57
|
-
buttonViewCreator: () => this._createToolbarButton(),
|
|
58
|
-
formViewCreator: () => this._createDropdownButton(),
|
|
59
|
-
menuBarButtonViewCreator: isOnly => this._createMenuBarButton(isOnly ? 'insertOnly' : 'insertNested')
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Creates the base for various kinds of the button component provided by this feature.
|
|
64
|
-
*/
|
|
65
|
-
_createInsertUrlButton(ButtonClass) {
|
|
66
|
-
const button = new ButtonClass(this.editor.locale);
|
|
67
|
-
button.icon = IconImageUrl;
|
|
68
|
-
button.on('execute', () => {
|
|
69
|
-
this._showModal();
|
|
70
|
-
});
|
|
71
|
-
return button;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Creates a simple toolbar button, with an icon and a tooltip.
|
|
75
|
-
*/
|
|
76
|
-
_createToolbarButton() {
|
|
77
|
-
const t = this.editor.locale.t;
|
|
78
|
-
const button = this._createInsertUrlButton(ButtonView);
|
|
79
|
-
button.tooltip = true;
|
|
80
|
-
button.bind('label').to(this._imageInsertUI, 'isImageSelected', isImageSelected => isImageSelected ? t('Update image URL') : t('Insert image via URL'));
|
|
81
|
-
return button;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Creates a button for the dropdown view, with an icon, text and no tooltip.
|
|
85
|
-
*/
|
|
86
|
-
_createDropdownButton() {
|
|
87
|
-
const t = this.editor.locale.t;
|
|
88
|
-
const button = this._createInsertUrlButton(ButtonView);
|
|
89
|
-
button.withText = true;
|
|
90
|
-
button.bind('label').to(this._imageInsertUI, 'isImageSelected', isImageSelected => isImageSelected ? t('Update image URL') : t('Insert via URL'));
|
|
91
|
-
return button;
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Creates a button for the menu bar.
|
|
95
|
-
*/
|
|
96
|
-
_createMenuBarButton(type) {
|
|
97
|
-
const t = this.editor.locale.t;
|
|
98
|
-
const button = this._createInsertUrlButton(MenuBarMenuListItemButtonView);
|
|
99
|
-
button.withText = true;
|
|
100
|
-
switch (type) {
|
|
101
|
-
case 'standalone':
|
|
102
|
-
button.label = t('Image via URL');
|
|
103
|
-
break;
|
|
104
|
-
case 'insertOnly':
|
|
105
|
-
button.label = t('Image');
|
|
106
|
-
break;
|
|
107
|
-
case 'insertNested':
|
|
108
|
-
button.label = t('Via URL');
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
return button;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Creates the form view used to submit the image URL.
|
|
115
|
-
*/
|
|
116
|
-
_createInsertUrlView() {
|
|
117
|
-
const editor = this.editor;
|
|
118
|
-
const locale = editor.locale;
|
|
119
|
-
const replaceImageSourceCommand = editor.commands.get('replaceImageSource');
|
|
120
|
-
const insertImageCommand = editor.commands.get('insertImage');
|
|
121
|
-
const imageInsertUrlView = new ImageInsertUrlView(locale);
|
|
122
|
-
imageInsertUrlView.bind('isImageSelected').to(this._imageInsertUI);
|
|
123
|
-
imageInsertUrlView.bind('isEnabled').toMany([insertImageCommand, replaceImageSourceCommand], 'isEnabled', (...isEnabled) => (isEnabled.some(isCommandEnabled => isCommandEnabled)));
|
|
124
|
-
return imageInsertUrlView;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Shows the insert image via URL form view in a modal.
|
|
128
|
-
*/
|
|
129
|
-
_showModal() {
|
|
130
|
-
const editor = this.editor;
|
|
131
|
-
const locale = editor.locale;
|
|
132
|
-
const t = locale.t;
|
|
133
|
-
const dialog = editor.plugins.get('Dialog');
|
|
134
|
-
if (!this._formView) {
|
|
135
|
-
this._formView = this._createInsertUrlView();
|
|
136
|
-
this._formView.on('submit', () => this._handleSave());
|
|
137
|
-
}
|
|
138
|
-
const replaceImageSourceCommand = editor.commands.get('replaceImageSource');
|
|
139
|
-
this._formView.imageURLInputValue = replaceImageSourceCommand.value || '';
|
|
140
|
-
dialog.show({
|
|
141
|
-
id: 'insertImageViaUrl',
|
|
142
|
-
title: t('Image via URL'),
|
|
143
|
-
isModal: true,
|
|
144
|
-
content: this._formView,
|
|
145
|
-
actionButtons: [
|
|
146
|
-
{
|
|
147
|
-
label: t('Cancel'),
|
|
148
|
-
withText: true,
|
|
149
|
-
onExecute: () => dialog.hide()
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
label: this._imageInsertUI.isImageSelected ? t('Save') : t('Insert'),
|
|
153
|
-
class: 'ck-button-action',
|
|
154
|
-
withText: true,
|
|
155
|
-
onExecute: () => this._handleSave()
|
|
156
|
-
}
|
|
157
|
-
]
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Executes appropriate command depending on selection and form value.
|
|
162
|
-
*/
|
|
163
|
-
_handleSave() {
|
|
164
|
-
const replaceImageSourceCommand = this.editor.commands.get('replaceImageSource');
|
|
165
|
-
// If an image element is currently selected, we want to replace its source attribute (instead of inserting a new image).
|
|
166
|
-
// We detect if an image is selected by checking `replaceImageSource` command state.
|
|
167
|
-
if (replaceImageSourceCommand.isEnabled) {
|
|
168
|
-
this.editor.execute('replaceImageSource', { source: this._formView.imageURLInputValue });
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
this.editor.execute('insertImage', { source: this._formView.imageURLInputValue });
|
|
172
|
-
}
|
|
173
|
-
this.editor.plugins.get('Dialog').hide();
|
|
174
|
-
}
|
|
175
|
-
}
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module image/imageinsert/ui/imageinsertformview
|
|
7
|
-
*/
|
|
8
|
-
import { View, ViewCollection, submitHandler, FocusCycler, CollapsibleView } from 'ckeditor5/src/ui.js';
|
|
9
|
-
import { FocusTracker, KeystrokeHandler } 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
|
-
* @internal
|
|
17
|
-
*/
|
|
18
|
-
export class ImageInsertFormView extends View {
|
|
19
|
-
/**
|
|
20
|
-
* Tracks information about DOM focus in the form.
|
|
21
|
-
*/
|
|
22
|
-
focusTracker;
|
|
23
|
-
/**
|
|
24
|
-
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
25
|
-
*/
|
|
26
|
-
keystrokes;
|
|
27
|
-
/**
|
|
28
|
-
* A collection of views that can be focused in the form.
|
|
29
|
-
*/
|
|
30
|
-
_focusables;
|
|
31
|
-
/**
|
|
32
|
-
* Helps cycling over {@link #_focusables} in the form.
|
|
33
|
-
*/
|
|
34
|
-
_focusCycler;
|
|
35
|
-
/**
|
|
36
|
-
* A collection of the defined integrations for inserting the images.
|
|
37
|
-
*/
|
|
38
|
-
children;
|
|
39
|
-
/**
|
|
40
|
-
* Creates a view for the dropdown panel of {@link module:image/imageinsert/imageinsertui~ImageInsertUI}.
|
|
41
|
-
*
|
|
42
|
-
* @param locale The localization services instance.
|
|
43
|
-
* @param integrations An integrations object that contains components (or tokens for components) to be shown in the panel view.
|
|
44
|
-
*/
|
|
45
|
-
constructor(locale, integrations = []) {
|
|
46
|
-
super(locale);
|
|
47
|
-
this.focusTracker = new FocusTracker();
|
|
48
|
-
this.keystrokes = new KeystrokeHandler();
|
|
49
|
-
this._focusables = new ViewCollection();
|
|
50
|
-
this.children = this.createCollection();
|
|
51
|
-
this._focusCycler = new FocusCycler({
|
|
52
|
-
focusables: this._focusables,
|
|
53
|
-
focusTracker: this.focusTracker,
|
|
54
|
-
keystrokeHandler: this.keystrokes,
|
|
55
|
-
actions: {
|
|
56
|
-
// Navigate form fields backwards using the Shift + Tab keystroke.
|
|
57
|
-
focusPrevious: 'shift + tab',
|
|
58
|
-
// Navigate form fields forwards using the Tab key.
|
|
59
|
-
focusNext: 'tab'
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
for (const view of integrations) {
|
|
63
|
-
this.children.add(view);
|
|
64
|
-
this._focusables.add(view);
|
|
65
|
-
if (view instanceof CollapsibleView) {
|
|
66
|
-
this._focusables.addMany(view.children);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
this.setTemplate({
|
|
70
|
-
tag: 'form',
|
|
71
|
-
attributes: {
|
|
72
|
-
class: [
|
|
73
|
-
'ck',
|
|
74
|
-
'ck-image-insert-form'
|
|
75
|
-
],
|
|
76
|
-
tabindex: -1
|
|
77
|
-
},
|
|
78
|
-
children: this.children
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* @inheritDoc
|
|
83
|
-
*/
|
|
84
|
-
render() {
|
|
85
|
-
super.render();
|
|
86
|
-
submitHandler({
|
|
87
|
-
view: this
|
|
88
|
-
});
|
|
89
|
-
for (const view of this._focusables) {
|
|
90
|
-
this.focusTracker.add(view.element);
|
|
91
|
-
}
|
|
92
|
-
// Start listening for the keystrokes coming from #element.
|
|
93
|
-
this.keystrokes.listenTo(this.element);
|
|
94
|
-
const stopPropagation = (data) => data.stopPropagation();
|
|
95
|
-
// Since the form is in the dropdown panel which is a child of the toolbar, the toolbar's
|
|
96
|
-
// keystroke handler would take over the key management in the URL input. We need to prevent
|
|
97
|
-
// this ASAP. Otherwise, the basic caret movement using the arrow keys will be impossible.
|
|
98
|
-
this.keystrokes.set('arrowright', stopPropagation);
|
|
99
|
-
this.keystrokes.set('arrowleft', stopPropagation);
|
|
100
|
-
this.keystrokes.set('arrowup', stopPropagation);
|
|
101
|
-
this.keystrokes.set('arrowdown', stopPropagation);
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* @inheritDoc
|
|
105
|
-
*/
|
|
106
|
-
destroy() {
|
|
107
|
-
super.destroy();
|
|
108
|
-
this.focusTracker.destroy();
|
|
109
|
-
this.keystrokes.destroy();
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Focuses the first {@link #_focusables focusable} in the form.
|
|
113
|
-
*/
|
|
114
|
-
focus() {
|
|
115
|
-
this._focusCycler.focusFirst();
|
|
116
|
-
}
|
|
117
|
-
}
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module image/imageinsert/ui/imageinserturlview
|
|
7
|
-
*/
|
|
8
|
-
import { View, LabeledFieldView, createLabeledInputText, submitHandler } from 'ckeditor5/src/ui.js';
|
|
9
|
-
import { KeystrokeHandler } from 'ckeditor5/src/utils.js';
|
|
10
|
-
/**
|
|
11
|
-
* The insert an image via URL view.
|
|
12
|
-
*
|
|
13
|
-
* See {@link module:image/imageinsert/imageinsertviaurlui~ImageInsertViaUrlUI}.
|
|
14
|
-
*
|
|
15
|
-
* @internal
|
|
16
|
-
*/
|
|
17
|
-
export class ImageInsertUrlView extends View {
|
|
18
|
-
/**
|
|
19
|
-
* The URL input field view.
|
|
20
|
-
*/
|
|
21
|
-
urlInputView;
|
|
22
|
-
/**
|
|
23
|
-
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
24
|
-
*/
|
|
25
|
-
keystrokes;
|
|
26
|
-
/**
|
|
27
|
-
* Creates a view for the dropdown panel of {@link module:image/imageinsert/imageinsertui~ImageInsertUI}.
|
|
28
|
-
*
|
|
29
|
-
* @param locale The localization services instance.
|
|
30
|
-
*/
|
|
31
|
-
constructor(locale) {
|
|
32
|
-
super(locale);
|
|
33
|
-
this.set('imageURLInputValue', '');
|
|
34
|
-
this.set('isImageSelected', false);
|
|
35
|
-
this.set('isEnabled', true);
|
|
36
|
-
this.keystrokes = new KeystrokeHandler();
|
|
37
|
-
this.urlInputView = this._createUrlInputView();
|
|
38
|
-
this.setTemplate({
|
|
39
|
-
tag: 'form',
|
|
40
|
-
attributes: {
|
|
41
|
-
class: [
|
|
42
|
-
'ck',
|
|
43
|
-
'ck-image-insert-url'
|
|
44
|
-
],
|
|
45
|
-
tabindex: '-1'
|
|
46
|
-
},
|
|
47
|
-
children: [
|
|
48
|
-
this.urlInputView,
|
|
49
|
-
{
|
|
50
|
-
tag: 'div',
|
|
51
|
-
attributes: {
|
|
52
|
-
class: [
|
|
53
|
-
'ck',
|
|
54
|
-
'ck-image-insert-url__action-row'
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* @inheritDoc
|
|
63
|
-
*/
|
|
64
|
-
render() {
|
|
65
|
-
super.render();
|
|
66
|
-
submitHandler({
|
|
67
|
-
view: this
|
|
68
|
-
});
|
|
69
|
-
// Start listening for the keystrokes coming from #element.
|
|
70
|
-
this.keystrokes.listenTo(this.element);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* @inheritDoc
|
|
74
|
-
*/
|
|
75
|
-
destroy() {
|
|
76
|
-
super.destroy();
|
|
77
|
-
this.keystrokes.destroy();
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Creates the {@link #urlInputView}.
|
|
81
|
-
*/
|
|
82
|
-
_createUrlInputView() {
|
|
83
|
-
const locale = this.locale;
|
|
84
|
-
const t = locale.t;
|
|
85
|
-
const urlInputView = new LabeledFieldView(locale, createLabeledInputText);
|
|
86
|
-
urlInputView.bind('label').to(this, 'isImageSelected', value => value ? t('Update image URL') : t('Insert image via URL'));
|
|
87
|
-
urlInputView.bind('isEnabled').to(this);
|
|
88
|
-
urlInputView.fieldView.inputMode = 'url';
|
|
89
|
-
urlInputView.fieldView.placeholder = 'https://example.com/image.png';
|
|
90
|
-
urlInputView.fieldView.bind('value').to(this, 'imageURLInputValue', (value) => value || '');
|
|
91
|
-
urlInputView.fieldView.on('input', () => {
|
|
92
|
-
this.imageURLInputValue = urlInputView.fieldView.element.value.trim();
|
|
93
|
-
});
|
|
94
|
-
return urlInputView;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Focuses the view.
|
|
98
|
-
*/
|
|
99
|
-
focus() {
|
|
100
|
-
this.urlInputView.focus();
|
|
101
|
-
}
|
|
102
|
-
}
|
package/src/imageinsert.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module 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 class ImageInsert extends Plugin {
|
|
25
|
-
/**
|
|
26
|
-
* @inheritDoc
|
|
27
|
-
*/
|
|
28
|
-
static get pluginName() {
|
|
29
|
-
return 'ImageInsert';
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* @inheritDoc
|
|
33
|
-
*/
|
|
34
|
-
static get isOfficialPlugin() {
|
|
35
|
-
return true;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* @inheritDoc
|
|
39
|
-
*/
|
|
40
|
-
static get requires() {
|
|
41
|
-
return [ImageUpload, ImageInsertViaUrl, ImageInsertUI];
|
|
42
|
-
}
|
|
43
|
-
}
|
package/src/imageinsertviaurl.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module 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 class ImageInsertViaUrl extends Plugin {
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
static get pluginName() {
|
|
27
|
-
return 'ImageInsertViaUrl';
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
static get isOfficialPlugin() {
|
|
33
|
-
return true;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* @inheritDoc
|
|
37
|
-
*/
|
|
38
|
-
static get requires() {
|
|
39
|
-
return [ImageInsertViaUrlUI, ImageInsertUI];
|
|
40
|
-
}
|
|
41
|
-
}
|