@ckeditor/ckeditor5-image 44.3.0 → 45.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/build/image.js +2 -2
- package/build/translations/af.js +1 -1
- package/build/translations/ar.js +1 -1
- package/build/translations/ast.js +1 -1
- package/build/translations/az.js +1 -1
- package/build/translations/be.js +1 -0
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.js +1 -1
- package/build/translations/bs.js +1 -1
- package/build/translations/ca.js +1 -1
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de-ch.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/en-gb.js +1 -1
- package/build/translations/eo.js +1 -1
- package/build/translations/es-co.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/eu.js +1 -1
- package/build/translations/fa.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/gl.js +1 -1
- package/build/translations/gu.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hr.js +1 -1
- package/build/translations/hu.js +1 -1
- package/build/translations/hy.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/jv.js +1 -1
- package/build/translations/kk.js +1 -1
- package/build/translations/km.js +1 -1
- package/build/translations/kn.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/ku.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -1
- package/build/translations/nb.js +1 -1
- package/build/translations/ne.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -1
- package/build/translations/oc.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ro.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/si.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sl.js +1 -1
- package/build/translations/sq.js +1 -1
- package/build/translations/sr-latn.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/ti.js +1 -1
- package/build/translations/tk.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/tt.js +1 -1
- package/build/translations/ug.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/ur.js +1 -1
- package/build/translations/uz.js +1 -1
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/ckeditor5-metadata.json +9 -9
- package/dist/index-editor.css +72 -59
- package/dist/index.css +90 -79
- package/dist/index.css.map +1 -1
- package/dist/index.js +178 -120
- package/dist/index.js.map +1 -1
- 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.d.ts +8 -0
- package/dist/translations/be.js +5 -0
- package/dist/translations/be.umd.js +11 -0
- 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/lang/contexts.json +4 -2
- package/lang/translations/af.po +8 -0
- package/lang/translations/ar.po +8 -0
- package/lang/translations/ast.po +8 -0
- package/lang/translations/az.po +8 -0
- package/lang/translations/be.po +196 -0
- package/lang/translations/bg.po +8 -0
- package/lang/translations/bn.po +8 -0
- package/lang/translations/bs.po +8 -0
- package/lang/translations/ca.po +8 -0
- package/lang/translations/cs.po +8 -0
- package/lang/translations/da.po +8 -0
- package/lang/translations/de-ch.po +8 -0
- package/lang/translations/de.po +8 -0
- package/lang/translations/el.po +8 -0
- package/lang/translations/en-au.po +8 -0
- package/lang/translations/en-gb.po +8 -0
- package/lang/translations/en.po +8 -0
- package/lang/translations/eo.po +8 -0
- package/lang/translations/es-co.po +8 -0
- package/lang/translations/es.po +8 -0
- package/lang/translations/et.po +8 -0
- package/lang/translations/eu.po +8 -0
- package/lang/translations/fa.po +8 -0
- package/lang/translations/fi.po +8 -0
- package/lang/translations/fr.po +8 -0
- package/lang/translations/gl.po +8 -0
- package/lang/translations/gu.po +8 -0
- package/lang/translations/he.po +8 -0
- package/lang/translations/hi.po +8 -0
- package/lang/translations/hr.po +8 -0
- package/lang/translations/hu.po +8 -0
- package/lang/translations/hy.po +8 -0
- package/lang/translations/id.po +8 -0
- package/lang/translations/it.po +8 -0
- package/lang/translations/ja.po +8 -0
- package/lang/translations/jv.po +8 -0
- package/lang/translations/kk.po +8 -0
- package/lang/translations/km.po +8 -0
- package/lang/translations/kn.po +8 -0
- package/lang/translations/ko.po +8 -0
- package/lang/translations/ku.po +8 -0
- package/lang/translations/lt.po +8 -0
- package/lang/translations/lv.po +8 -0
- package/lang/translations/ms.po +8 -0
- package/lang/translations/nb.po +8 -0
- package/lang/translations/ne.po +8 -0
- package/lang/translations/nl.po +8 -0
- package/lang/translations/no.po +8 -0
- package/lang/translations/oc.po +8 -0
- package/lang/translations/pl.po +8 -0
- package/lang/translations/pt-br.po +8 -0
- package/lang/translations/pt.po +8 -0
- package/lang/translations/ro.po +8 -0
- package/lang/translations/ru.po +8 -0
- package/lang/translations/si.po +8 -0
- package/lang/translations/sk.po +8 -0
- package/lang/translations/sl.po +8 -0
- package/lang/translations/sq.po +8 -0
- package/lang/translations/sr-latn.po +8 -0
- package/lang/translations/sr.po +8 -0
- package/lang/translations/sv.po +8 -0
- package/lang/translations/th.po +8 -0
- package/lang/translations/ti.po +8 -0
- package/lang/translations/tk.po +8 -0
- package/lang/translations/tr.po +8 -0
- package/lang/translations/tt.po +8 -0
- package/lang/translations/ug.po +8 -0
- package/lang/translations/uk.po +8 -0
- package/lang/translations/ur.po +8 -0
- package/lang/translations/uz.po +8 -0
- package/lang/translations/vi.po +8 -0
- package/lang/translations/zh-cn.po +8 -0
- package/lang/translations/zh.po +8 -0
- package/package.json +13 -12
- package/src/autoimage.js +10 -0
- package/src/image/imagetypecommand.js +4 -0
- package/src/imagecaption/imagecaptionediting.js +7 -0
- package/src/imagecaption/imagecaptionui.js +3 -2
- package/src/imageinsert/imageinsertui.js +11 -6
- package/src/imageinsert/imageinsertviaurlui.js +7 -6
- package/src/imageinsert/ui/imageinsertformview.js +20 -0
- package/src/imageinsert/ui/imageinserturlview.js +8 -0
- package/src/imageresize/imagecustomresizeui.js +8 -5
- package/src/imageresize/imageresizebuttons.d.ts +3 -0
- package/src/imageresize/imageresizebuttons.js +21 -13
- package/src/imageresize/resizeimagecommand.d.ts +1 -1
- package/src/imageresize/ui/imagecustomresizeformview.d.ts +19 -12
- package/src/imageresize/ui/imagecustomresizeformview.js +112 -36
- package/src/imagestyle/imagestylecommand.js +10 -0
- package/src/imagestyle/imagestyleediting.js +12 -0
- package/src/imagestyle/imagestyleui.js +1 -1
- package/src/imagestyle/utils.d.ts +1 -4
- package/src/imagestyle/utils.js +16 -16
- package/src/imagetextalternative/imagetextalternativeui.js +11 -7
- package/src/imagetextalternative/ui/textalternativeformview.d.ts +17 -10
- package/src/imagetextalternative/ui/textalternativeformview.js +105 -35
- package/src/imagetoolbar.js +1 -1
- package/src/imageupload/imageuploadediting.js +17 -7
- package/src/imageupload/imageuploadprogress.js +59 -53
- package/src/imageupload/imageuploadui.js +3 -2
- package/src/imageutils.js +4 -7
- package/theme/imagecustomresizeform.css +0 -29
- package/theme/textalternativeform.css +0 -28
package/lang/translations/uz.po
CHANGED
|
@@ -186,3 +186,11 @@ msgstr ""
|
|
|
186
186
|
msgctxt "Label for the widget inserted by the image feature (as in 'insert image')"
|
|
187
187
|
msgid "Image"
|
|
188
188
|
msgstr ""
|
|
189
|
+
|
|
190
|
+
msgctxt "The label for the header of the image resize balloon."
|
|
191
|
+
msgid "Image Resize"
|
|
192
|
+
msgstr ""
|
|
193
|
+
|
|
194
|
+
msgctxt "The label of the input field for the text alternative of the image."
|
|
195
|
+
msgid "Text Alternative"
|
|
196
|
+
msgstr ""
|
package/lang/translations/vi.po
CHANGED
|
@@ -186,3 +186,11 @@ msgstr "Xảy ra lỗi trong quá trình tải hình ảnh lên"
|
|
|
186
186
|
msgctxt "Label for the widget inserted by the image feature (as in 'insert image')"
|
|
187
187
|
msgid "Image"
|
|
188
188
|
msgstr "Hình ảnh"
|
|
189
|
+
|
|
190
|
+
msgctxt "The label for the header of the image resize balloon."
|
|
191
|
+
msgid "Image Resize"
|
|
192
|
+
msgstr ""
|
|
193
|
+
|
|
194
|
+
msgctxt "The label of the input field for the text alternative of the image."
|
|
195
|
+
msgid "Text Alternative"
|
|
196
|
+
msgstr ""
|
|
@@ -186,3 +186,11 @@ msgstr "图片上传时出错"
|
|
|
186
186
|
msgctxt "Label for the widget inserted by the image feature (as in 'insert image')"
|
|
187
187
|
msgid "Image"
|
|
188
188
|
msgstr "图像"
|
|
189
|
+
|
|
190
|
+
msgctxt "The label for the header of the image resize balloon."
|
|
191
|
+
msgid "Image Resize"
|
|
192
|
+
msgstr ""
|
|
193
|
+
|
|
194
|
+
msgctxt "The label of the input field for the text alternative of the image."
|
|
195
|
+
msgid "Text Alternative"
|
|
196
|
+
msgstr ""
|
package/lang/translations/zh.po
CHANGED
|
@@ -186,3 +186,11 @@ msgstr "圖片上傳期間發生錯誤"
|
|
|
186
186
|
msgctxt "Label for the widget inserted by the image feature (as in 'insert image')"
|
|
187
187
|
msgid "Image"
|
|
188
188
|
msgstr "圖片"
|
|
189
|
+
|
|
190
|
+
msgctxt "The label for the header of the image resize balloon."
|
|
191
|
+
msgid "Image Resize"
|
|
192
|
+
msgstr ""
|
|
193
|
+
|
|
194
|
+
msgctxt "The label of the input field for the text alternative of the image."
|
|
195
|
+
msgid "Text Alternative"
|
|
196
|
+
msgstr ""
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-image",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "45.0.0-alpha.0",
|
|
4
4
|
"description": "Image feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -13,17 +13,18 @@
|
|
|
13
13
|
"type": "module",
|
|
14
14
|
"main": "src/index.js",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@ckeditor/ckeditor5-clipboard": "
|
|
17
|
-
"@ckeditor/ckeditor5-core": "
|
|
18
|
-
"@ckeditor/ckeditor5-engine": "
|
|
19
|
-
"@ckeditor/ckeditor5-
|
|
20
|
-
"@ckeditor/ckeditor5-
|
|
21
|
-
"@ckeditor/ckeditor5-
|
|
22
|
-
"@ckeditor/ckeditor5-
|
|
23
|
-
"@ckeditor/ckeditor5-
|
|
24
|
-
"@ckeditor/ckeditor5-
|
|
25
|
-
"ckeditor5": "
|
|
26
|
-
"
|
|
16
|
+
"@ckeditor/ckeditor5-clipboard": "45.0.0-alpha.0",
|
|
17
|
+
"@ckeditor/ckeditor5-core": "45.0.0-alpha.0",
|
|
18
|
+
"@ckeditor/ckeditor5-engine": "45.0.0-alpha.0",
|
|
19
|
+
"@ckeditor/ckeditor5-icons": "45.0.0-alpha.0",
|
|
20
|
+
"@ckeditor/ckeditor5-typing": "45.0.0-alpha.0",
|
|
21
|
+
"@ckeditor/ckeditor5-ui": "45.0.0-alpha.0",
|
|
22
|
+
"@ckeditor/ckeditor5-undo": "45.0.0-alpha.0",
|
|
23
|
+
"@ckeditor/ckeditor5-upload": "45.0.0-alpha.0",
|
|
24
|
+
"@ckeditor/ckeditor5-utils": "45.0.0-alpha.0",
|
|
25
|
+
"@ckeditor/ckeditor5-widget": "45.0.0-alpha.0",
|
|
26
|
+
"ckeditor5": "45.0.0-alpha.0",
|
|
27
|
+
"es-toolkit": "1.32.0"
|
|
27
28
|
},
|
|
28
29
|
"author": "CKSource (http://cksource.com/)",
|
|
29
30
|
"license": "SEE LICENSE IN LICENSE.md",
|
package/src/autoimage.js
CHANGED
|
@@ -40,6 +40,16 @@ export default class AutoImage extends Plugin {
|
|
|
40
40
|
static get isOfficialPlugin() {
|
|
41
41
|
return true;
|
|
42
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* The paste–to–embed `setTimeout` ID. Stored as a property to allow
|
|
45
|
+
* cleaning of the timeout.
|
|
46
|
+
*/
|
|
47
|
+
_timeoutId;
|
|
48
|
+
/**
|
|
49
|
+
* The position where the `<imageBlock>` element will be inserted after the timeout,
|
|
50
|
+
* determined each time a new content is pasted into the document.
|
|
51
|
+
*/
|
|
52
|
+
_positionToInsert;
|
|
43
53
|
/**
|
|
44
54
|
* @inheritDoc
|
|
45
55
|
*/
|
|
@@ -7,6 +7,10 @@ import { Command } from 'ckeditor5/src/core.js';
|
|
|
7
7
|
* The image type command. It changes the type of a selected image, depending on the configuration.
|
|
8
8
|
*/
|
|
9
9
|
export default class ImageTypeCommand extends Command {
|
|
10
|
+
/**
|
|
11
|
+
* Model element name the command converts to.
|
|
12
|
+
*/
|
|
13
|
+
_modelElementName;
|
|
10
14
|
/**
|
|
11
15
|
* @inheritDoc
|
|
12
16
|
*
|
|
@@ -37,6 +37,13 @@ export default class ImageCaptionEditing extends Plugin {
|
|
|
37
37
|
static get isOfficialPlugin() {
|
|
38
38
|
return true;
|
|
39
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* A map that keeps saved JSONified image captions and image model elements they are
|
|
42
|
+
* associated with.
|
|
43
|
+
*
|
|
44
|
+
* To learn more about this system, see {@link #_saveCaption}.
|
|
45
|
+
*/
|
|
46
|
+
_savedCaptionsMap;
|
|
40
47
|
/**
|
|
41
48
|
* @inheritDoc
|
|
42
49
|
*/
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module image/imagecaption/imagecaptionui
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
9
|
import { ButtonView } from 'ckeditor5/src/ui.js';
|
|
10
|
+
import { IconCaption } from 'ckeditor5/src/icons.js';
|
|
10
11
|
import ImageCaptionUtils from './imagecaptionutils.js';
|
|
11
12
|
/**
|
|
12
13
|
* The image caption UI plugin. It introduces the `'toggleImageCaption'` UI button.
|
|
@@ -42,7 +43,7 @@ export default class ImageCaptionUI extends Plugin {
|
|
|
42
43
|
const command = editor.commands.get('toggleImageCaption');
|
|
43
44
|
const view = new ButtonView(locale);
|
|
44
45
|
view.set({
|
|
45
|
-
icon:
|
|
46
|
+
icon: IconCaption,
|
|
46
47
|
tooltip: true,
|
|
47
48
|
isToggleable: true
|
|
48
49
|
});
|
|
@@ -5,9 +5,10 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module image/imageinsert/imageinsertui
|
|
7
7
|
*/
|
|
8
|
-
import { Plugin
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
9
|
import { logWarning } from 'ckeditor5/src/utils.js';
|
|
10
10
|
import { createDropdown, MenuBarMenuListItemView, MenuBarMenuListView, MenuBarMenuView, SplitButtonView } from 'ckeditor5/src/ui.js';
|
|
11
|
+
import { IconImage } from 'ckeditor5/src/icons.js';
|
|
11
12
|
import ImageInsertFormView from './ui/imageinsertformview.js';
|
|
12
13
|
import ImageUtils from '../imageutils.js';
|
|
13
14
|
/**
|
|
@@ -41,15 +42,19 @@ export default class ImageInsertUI extends Plugin {
|
|
|
41
42
|
static get requires() {
|
|
42
43
|
return [ImageUtils];
|
|
43
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();
|
|
44
53
|
/**
|
|
45
54
|
* @inheritDoc
|
|
46
55
|
*/
|
|
47
56
|
constructor(editor) {
|
|
48
57
|
super(editor);
|
|
49
|
-
/**
|
|
50
|
-
* Registered integrations map.
|
|
51
|
-
*/
|
|
52
|
-
this._integrations = new Map();
|
|
53
58
|
editor.config.define('image.insert.integrations', [
|
|
54
59
|
'upload',
|
|
55
60
|
'assetManager',
|
|
@@ -147,7 +152,7 @@ export default class ImageInsertUI extends Plugin {
|
|
|
147
152
|
const listView = new MenuBarMenuListView(locale);
|
|
148
153
|
resultView.panelView.children.add(listView);
|
|
149
154
|
resultView.buttonView.set({
|
|
150
|
-
icon:
|
|
155
|
+
icon: IconImage,
|
|
151
156
|
label: t('Image')
|
|
152
157
|
});
|
|
153
158
|
for (const integrationView of integrationViews) {
|
|
@@ -5,8 +5,9 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module image/imageinsert/imageinsertviaurlui
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
9
|
import { ButtonView, Dialog, MenuBarMenuListItemButtonView } from 'ckeditor5/src/ui.js';
|
|
10
|
+
import { IconImageUrl } from 'ckeditor5/src/icons.js';
|
|
10
11
|
import ImageInsertUI from './imageinsertui.js';
|
|
11
12
|
import ImageInsertUrlView from './ui/imageinserturlview.js';
|
|
12
13
|
/**
|
|
@@ -21,6 +22,8 @@ import ImageInsertUrlView from './ui/imageinserturlview.js';
|
|
|
21
22
|
* through which inserting image via URL is available.
|
|
22
23
|
*/
|
|
23
24
|
export default class ImageInsertViaUrlUI extends Plugin {
|
|
25
|
+
_imageInsertUI;
|
|
26
|
+
_formView;
|
|
24
27
|
/**
|
|
25
28
|
* @inheritDoc
|
|
26
29
|
*/
|
|
@@ -61,7 +64,7 @@ export default class ImageInsertViaUrlUI extends Plugin {
|
|
|
61
64
|
*/
|
|
62
65
|
_createInsertUrlButton(ButtonClass) {
|
|
63
66
|
const button = new ButtonClass(this.editor.locale);
|
|
64
|
-
button.icon =
|
|
67
|
+
button.icon = IconImageUrl;
|
|
65
68
|
button.on('execute', () => {
|
|
66
69
|
this._showModal();
|
|
67
70
|
});
|
|
@@ -136,9 +139,7 @@ export default class ImageInsertViaUrlUI extends Plugin {
|
|
|
136
139
|
this._formView.imageURLInputValue = replaceImageSourceCommand.value || '';
|
|
137
140
|
dialog.show({
|
|
138
141
|
id: 'insertImageViaUrl',
|
|
139
|
-
title:
|
|
140
|
-
t('Update image URL') :
|
|
141
|
-
t('Insert image via URL'),
|
|
142
|
+
title: t('Image via URL'),
|
|
142
143
|
isModal: true,
|
|
143
144
|
content: this._formView,
|
|
144
145
|
actionButtons: [
|
|
@@ -148,7 +149,7 @@ export default class ImageInsertViaUrlUI extends Plugin {
|
|
|
148
149
|
onExecute: () => dialog.hide()
|
|
149
150
|
},
|
|
150
151
|
{
|
|
151
|
-
label: t('
|
|
152
|
+
label: this._imageInsertUI.isImageSelected ? t('Save') : t('Insert'),
|
|
152
153
|
class: 'ck-button-action',
|
|
153
154
|
withText: true,
|
|
154
155
|
onExecute: () => this._handleSave()
|
|
@@ -14,6 +14,26 @@ import '../../../theme/imageinsert.css';
|
|
|
14
14
|
* See {@link module:image/imageinsert/imageinsertui~ImageInsertUI}.
|
|
15
15
|
*/
|
|
16
16
|
export default class ImageInsertFormView extends View {
|
|
17
|
+
/**
|
|
18
|
+
* Tracks information about DOM focus in the form.
|
|
19
|
+
*/
|
|
20
|
+
focusTracker;
|
|
21
|
+
/**
|
|
22
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
23
|
+
*/
|
|
24
|
+
keystrokes;
|
|
25
|
+
/**
|
|
26
|
+
* A collection of views that can be focused in the form.
|
|
27
|
+
*/
|
|
28
|
+
_focusables;
|
|
29
|
+
/**
|
|
30
|
+
* Helps cycling over {@link #_focusables} in the form.
|
|
31
|
+
*/
|
|
32
|
+
_focusCycler;
|
|
33
|
+
/**
|
|
34
|
+
* A collection of the defined integrations for inserting the images.
|
|
35
|
+
*/
|
|
36
|
+
children;
|
|
17
37
|
/**
|
|
18
38
|
* Creates a view for the dropdown panel of {@link module:image/imageinsert/imageinsertui~ImageInsertUI}.
|
|
19
39
|
*
|
|
@@ -13,6 +13,14 @@ import { KeystrokeHandler } from 'ckeditor5/src/utils.js';
|
|
|
13
13
|
* See {@link module:image/imageinsert/imageinsertviaurlui~ImageInsertViaUrlUI}.
|
|
14
14
|
*/
|
|
15
15
|
export default class ImageInsertUrlView extends View {
|
|
16
|
+
/**
|
|
17
|
+
* The URL input field view.
|
|
18
|
+
*/
|
|
19
|
+
urlInputView;
|
|
20
|
+
/**
|
|
21
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
22
|
+
*/
|
|
23
|
+
keystrokes;
|
|
16
24
|
/**
|
|
17
25
|
* Creates a view for the dropdown panel of {@link module:image/imageinsert/imageinsertui~ImageInsertUI}.
|
|
18
26
|
*
|
|
@@ -17,6 +17,14 @@ import { getSelectedImagePossibleResizeRange } from './utils/getselectedimagepos
|
|
|
17
17
|
* The plugin uses the {@link module:ui/panel/balloon/contextualballoon~ContextualBalloon}.
|
|
18
18
|
*/
|
|
19
19
|
export default class ImageCustomResizeUI extends Plugin {
|
|
20
|
+
/**
|
|
21
|
+
* The contextual balloon plugin instance.
|
|
22
|
+
*/
|
|
23
|
+
_balloon;
|
|
24
|
+
/**
|
|
25
|
+
* A form containing a textarea and buttons, used to change the `alt` text value.
|
|
26
|
+
*/
|
|
27
|
+
_form;
|
|
20
28
|
/**
|
|
21
29
|
* @inheritDoc
|
|
22
30
|
*/
|
|
@@ -70,11 +78,6 @@ export default class ImageCustomResizeUI extends Plugin {
|
|
|
70
78
|
this.listenTo(this._form, 'cancel', () => {
|
|
71
79
|
this._hideForm(true);
|
|
72
80
|
});
|
|
73
|
-
// Close the form on Esc key press.
|
|
74
|
-
this._form.keystrokes.set('Esc', (data, cancel) => {
|
|
75
|
-
this._hideForm(true);
|
|
76
|
-
cancel();
|
|
77
|
-
});
|
|
78
81
|
// Close on click outside of balloon panel element.
|
|
79
82
|
clickOutsideHandler({
|
|
80
83
|
emitter: this._form,
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* @license Copyright (c) 2003-2025, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
3
|
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
4
|
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module image/imageresize/imageresizebuttons
|
|
7
|
+
*/
|
|
5
8
|
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
6
9
|
import ImageResizeEditing from './imageresizeediting.js';
|
|
7
10
|
/**
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
/**
|
|
6
6
|
* @module image/imageresize/imageresizebuttons
|
|
7
7
|
*/
|
|
8
|
-
import {
|
|
9
|
-
import { Plugin, icons } from 'ckeditor5/src/core.js';
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
10
9
|
import { ButtonView, DropdownButtonView, ViewModel, createDropdown, addListToDropdown } from 'ckeditor5/src/ui.js';
|
|
11
10
|
import { CKEditorError, Collection } from 'ckeditor5/src/utils.js';
|
|
11
|
+
import { IconObjectSizeCustom, IconObjectSizeFull, IconObjectSizeLarge, IconObjectSizeMedium, IconObjectSizeSmall } from 'ckeditor5/src/icons.js';
|
|
12
12
|
import ImageResizeEditing from './imageresizeediting.js';
|
|
13
13
|
const RESIZE_ICONS = /* #__PURE__ */ (() => ({
|
|
14
|
-
small:
|
|
15
|
-
medium:
|
|
16
|
-
large:
|
|
17
|
-
custom:
|
|
18
|
-
original:
|
|
14
|
+
small: IconObjectSizeSmall,
|
|
15
|
+
medium: IconObjectSizeMedium,
|
|
16
|
+
large: IconObjectSizeLarge,
|
|
17
|
+
custom: IconObjectSizeCustom,
|
|
18
|
+
original: IconObjectSizeFull
|
|
19
19
|
}))();
|
|
20
20
|
/**
|
|
21
21
|
* The image resize buttons plugin.
|
|
@@ -41,6 +41,11 @@ export default class ImageResizeButtons extends Plugin {
|
|
|
41
41
|
static get isOfficialPlugin() {
|
|
42
42
|
return true;
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* The resize unit.
|
|
46
|
+
* @default '%'
|
|
47
|
+
*/
|
|
48
|
+
_resizeUnit;
|
|
44
49
|
/**
|
|
45
50
|
* @inheritDoc
|
|
46
51
|
*/
|
|
@@ -103,7 +108,7 @@ export default class ImageResizeButtons extends Plugin {
|
|
|
103
108
|
}
|
|
104
109
|
else {
|
|
105
110
|
const optionValueWithUnit = value ? value + this._resizeUnit : null;
|
|
106
|
-
button.bind('isOn').to(command, 'value', getIsOnButtonCallback(optionValueWithUnit));
|
|
111
|
+
button.bind('isOn').to(command, 'value', command, 'isEnabled', getIsOnButtonCallback(optionValueWithUnit));
|
|
107
112
|
this.listenTo(button, 'execute', () => {
|
|
108
113
|
editor.execute('resizeImage', { width: optionValueWithUnit });
|
|
109
114
|
});
|
|
@@ -246,8 +251,8 @@ export default class ImageResizeButtons extends Plugin {
|
|
|
246
251
|
}
|
|
247
252
|
})
|
|
248
253
|
};
|
|
249
|
-
const allDropdownValues = map(
|
|
250
|
-
definition.model.bind('isOn').to(command, 'value', getIsOnCustomButtonCallback(allDropdownValues));
|
|
254
|
+
const allDropdownValues = Object.values(optionsWithSerializedValues).map(option => option.valueWithUnits);
|
|
255
|
+
definition.model.bind('isOn').to(command, 'value', command, 'isEnabled', getIsOnCustomButtonCallback(allDropdownValues));
|
|
251
256
|
}
|
|
252
257
|
else {
|
|
253
258
|
definition = {
|
|
@@ -261,7 +266,7 @@ export default class ImageResizeButtons extends Plugin {
|
|
|
261
266
|
icon: null
|
|
262
267
|
})
|
|
263
268
|
};
|
|
264
|
-
definition.model.bind('isOn').to(command, 'value', getIsOnButtonCallback(option.valueWithUnits));
|
|
269
|
+
definition.model.bind('isOn').to(command, 'value', command, 'isEnabled', getIsOnButtonCallback(option.valueWithUnits));
|
|
265
270
|
}
|
|
266
271
|
definition.model.bind('isEnabled').to(command, 'isEnabled');
|
|
267
272
|
itemDefinitions.add(definition);
|
|
@@ -279,8 +284,11 @@ function isCustomImageResizeOption(option) {
|
|
|
279
284
|
* A helper function for setting the `isOn` state of buttons in value bindings.
|
|
280
285
|
*/
|
|
281
286
|
function getIsOnButtonCallback(value) {
|
|
282
|
-
return (commandValue) => {
|
|
287
|
+
return (commandValue, isEnabled) => {
|
|
283
288
|
const objectCommandValue = commandValue;
|
|
289
|
+
if (objectCommandValue === undefined || !isEnabled) {
|
|
290
|
+
return false;
|
|
291
|
+
}
|
|
284
292
|
if (value === null && objectCommandValue === value) {
|
|
285
293
|
return true;
|
|
286
294
|
}
|
|
@@ -291,5 +299,5 @@ function getIsOnButtonCallback(value) {
|
|
|
291
299
|
* A helper function for setting the `isOn` state of custom size button in value bindings.
|
|
292
300
|
*/
|
|
293
301
|
function getIsOnCustomButtonCallback(allDropdownValues) {
|
|
294
|
-
return (commandValue) => !allDropdownValues.some(dropdownValue => getIsOnButtonCallback(dropdownValue)(commandValue));
|
|
302
|
+
return (commandValue, isEnabled) => !allDropdownValues.some(dropdownValue => getIsOnButtonCallback(dropdownValue)(commandValue, isEnabled));
|
|
295
303
|
}
|
|
@@ -9,6 +9,7 @@ import { ButtonView, FocusCycler, LabeledFieldView, View, ViewCollection, type F
|
|
|
9
9
|
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
|
|
10
10
|
import '../../../theme/imagecustomresizeform.css';
|
|
11
11
|
import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
|
|
12
|
+
import '@ckeditor/ckeditor5-ui/theme/components/form/form.css';
|
|
12
13
|
/**
|
|
13
14
|
* The ImageCustomResizeFormView class.
|
|
14
15
|
*/
|
|
@@ -26,17 +27,21 @@ export default class ImageCustomResizeFormView extends View {
|
|
|
26
27
|
*/
|
|
27
28
|
readonly unit: string;
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
+
* The Back button view displayed in the header.
|
|
30
31
|
*/
|
|
31
|
-
|
|
32
|
+
backButtonView: ButtonView;
|
|
32
33
|
/**
|
|
33
34
|
* A button used to submit the form.
|
|
34
35
|
*/
|
|
35
36
|
saveButtonView: ButtonView;
|
|
36
37
|
/**
|
|
37
|
-
*
|
|
38
|
+
* An input with a label.
|
|
39
|
+
*/
|
|
40
|
+
labeledInput: LabeledFieldView<InputNumberView>;
|
|
41
|
+
/**
|
|
42
|
+
* A collection of child views.
|
|
38
43
|
*/
|
|
39
|
-
|
|
44
|
+
readonly children: ViewCollection;
|
|
40
45
|
/**
|
|
41
46
|
* A collection of views which can be focused in the form.
|
|
42
47
|
*/
|
|
@@ -62,15 +67,17 @@ export default class ImageCustomResizeFormView extends View {
|
|
|
62
67
|
*/
|
|
63
68
|
destroy(): void;
|
|
64
69
|
/**
|
|
65
|
-
* Creates
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
*
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
* Creates a back button view that cancels the form.
|
|
71
|
+
*/
|
|
72
|
+
private _createBackButton;
|
|
73
|
+
/**
|
|
74
|
+
* Creates a save button view that resize the image.
|
|
75
|
+
*/
|
|
76
|
+
private _createSaveButton;
|
|
77
|
+
/**
|
|
78
|
+
* Creates a header view for the form.
|
|
72
79
|
*/
|
|
73
|
-
private
|
|
80
|
+
private _createHeaderView;
|
|
74
81
|
/**
|
|
75
82
|
* Creates an input with a label.
|
|
76
83
|
*
|