@ckeditor/ckeditor5-image 41.3.1 → 41.4.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 +2 -2
- package/build/translations/ar.js +1 -1
- package/build/translations/ast.js +1 -1
- package/build/translations/az.js +1 -1
- 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/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/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/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/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/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 -0
- 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 +1 -1
- package/dist/index-content.css +105 -0
- package/dist/index-editor.css +129 -0
- package/dist/index.css +562 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +5637 -0
- package/dist/index.js.map +1 -0
- package/dist/translations/ar.d.ts +8 -0
- package/dist/translations/ar.js +5 -0
- package/dist/translations/ar.umd.js +11 -0
- package/dist/translations/ast.d.ts +8 -0
- package/dist/translations/ast.js +5 -0
- package/dist/translations/ast.umd.js +11 -0
- package/dist/translations/az.d.ts +8 -0
- package/dist/translations/az.js +5 -0
- package/dist/translations/az.umd.js +11 -0
- package/dist/translations/bg.d.ts +8 -0
- package/dist/translations/bg.js +5 -0
- package/dist/translations/bg.umd.js +11 -0
- package/dist/translations/bn.d.ts +8 -0
- package/dist/translations/bn.js +5 -0
- package/dist/translations/bn.umd.js +11 -0
- package/dist/translations/bs.d.ts +8 -0
- package/dist/translations/bs.js +5 -0
- package/dist/translations/bs.umd.js +11 -0
- package/dist/translations/ca.d.ts +8 -0
- package/dist/translations/ca.js +5 -0
- package/dist/translations/ca.umd.js +11 -0
- package/dist/translations/cs.d.ts +8 -0
- package/dist/translations/cs.js +5 -0
- package/dist/translations/cs.umd.js +11 -0
- package/dist/translations/da.d.ts +8 -0
- package/dist/translations/da.js +5 -0
- package/dist/translations/da.umd.js +11 -0
- package/dist/translations/de-ch.d.ts +8 -0
- package/dist/translations/de-ch.js +5 -0
- package/dist/translations/de-ch.umd.js +11 -0
- package/dist/translations/de.d.ts +8 -0
- package/dist/translations/de.js +5 -0
- package/dist/translations/de.umd.js +11 -0
- package/dist/translations/el.d.ts +8 -0
- package/dist/translations/el.js +5 -0
- package/dist/translations/el.umd.js +11 -0
- package/dist/translations/en-au.d.ts +8 -0
- package/dist/translations/en-au.js +5 -0
- package/dist/translations/en-au.umd.js +11 -0
- package/dist/translations/en-gb.d.ts +8 -0
- package/dist/translations/en-gb.js +5 -0
- package/dist/translations/en-gb.umd.js +11 -0
- package/dist/translations/en.d.ts +8 -0
- package/dist/translations/en.js +5 -0
- package/dist/translations/en.umd.js +11 -0
- package/dist/translations/eo.d.ts +8 -0
- package/dist/translations/eo.js +5 -0
- package/dist/translations/eo.umd.js +11 -0
- package/dist/translations/es-co.d.ts +8 -0
- package/dist/translations/es-co.js +5 -0
- package/dist/translations/es-co.umd.js +11 -0
- package/dist/translations/es.d.ts +8 -0
- package/dist/translations/es.js +5 -0
- package/dist/translations/es.umd.js +11 -0
- package/dist/translations/et.d.ts +8 -0
- package/dist/translations/et.js +5 -0
- package/dist/translations/et.umd.js +11 -0
- package/dist/translations/eu.d.ts +8 -0
- package/dist/translations/eu.js +5 -0
- package/dist/translations/eu.umd.js +11 -0
- package/dist/translations/fa.d.ts +8 -0
- package/dist/translations/fa.js +5 -0
- package/dist/translations/fa.umd.js +11 -0
- package/dist/translations/fi.d.ts +8 -0
- package/dist/translations/fi.js +5 -0
- package/dist/translations/fi.umd.js +11 -0
- package/dist/translations/fr.d.ts +8 -0
- package/dist/translations/fr.js +5 -0
- package/dist/translations/fr.umd.js +11 -0
- package/dist/translations/gl.d.ts +8 -0
- package/dist/translations/gl.js +5 -0
- package/dist/translations/gl.umd.js +11 -0
- package/dist/translations/he.d.ts +8 -0
- package/dist/translations/he.js +5 -0
- package/dist/translations/he.umd.js +11 -0
- package/dist/translations/hi.d.ts +8 -0
- package/dist/translations/hi.js +5 -0
- package/dist/translations/hi.umd.js +11 -0
- package/dist/translations/hr.d.ts +8 -0
- package/dist/translations/hr.js +5 -0
- package/dist/translations/hr.umd.js +11 -0
- package/dist/translations/hu.d.ts +8 -0
- package/dist/translations/hu.js +5 -0
- package/dist/translations/hu.umd.js +11 -0
- package/dist/translations/id.d.ts +8 -0
- package/dist/translations/id.js +5 -0
- package/dist/translations/id.umd.js +11 -0
- package/dist/translations/it.d.ts +8 -0
- package/dist/translations/it.js +5 -0
- package/dist/translations/it.umd.js +11 -0
- package/dist/translations/ja.d.ts +8 -0
- package/dist/translations/ja.js +5 -0
- package/dist/translations/ja.umd.js +11 -0
- package/dist/translations/jv.d.ts +8 -0
- package/dist/translations/jv.js +5 -0
- package/dist/translations/jv.umd.js +11 -0
- package/dist/translations/km.d.ts +8 -0
- package/dist/translations/km.js +5 -0
- package/dist/translations/km.umd.js +11 -0
- package/dist/translations/kn.d.ts +8 -0
- package/dist/translations/kn.js +5 -0
- package/dist/translations/kn.umd.js +11 -0
- package/dist/translations/ko.d.ts +8 -0
- package/dist/translations/ko.js +5 -0
- package/dist/translations/ko.umd.js +11 -0
- package/dist/translations/ku.d.ts +8 -0
- package/dist/translations/ku.js +5 -0
- package/dist/translations/ku.umd.js +11 -0
- package/dist/translations/lt.d.ts +8 -0
- package/dist/translations/lt.js +5 -0
- package/dist/translations/lt.umd.js +11 -0
- package/dist/translations/lv.d.ts +8 -0
- package/dist/translations/lv.js +5 -0
- package/dist/translations/lv.umd.js +11 -0
- package/dist/translations/ms.d.ts +8 -0
- package/dist/translations/ms.js +5 -0
- package/dist/translations/ms.umd.js +11 -0
- package/dist/translations/nb.d.ts +8 -0
- package/dist/translations/nb.js +5 -0
- package/dist/translations/nb.umd.js +11 -0
- package/dist/translations/ne.d.ts +8 -0
- package/dist/translations/ne.js +5 -0
- package/dist/translations/ne.umd.js +11 -0
- package/dist/translations/nl.d.ts +8 -0
- package/dist/translations/nl.js +5 -0
- package/dist/translations/nl.umd.js +11 -0
- package/dist/translations/no.d.ts +8 -0
- package/dist/translations/no.js +5 -0
- package/dist/translations/no.umd.js +11 -0
- package/dist/translations/pl.d.ts +8 -0
- package/dist/translations/pl.js +5 -0
- package/dist/translations/pl.umd.js +11 -0
- package/dist/translations/pt-br.d.ts +8 -0
- package/dist/translations/pt-br.js +5 -0
- package/dist/translations/pt-br.umd.js +11 -0
- package/dist/translations/pt.d.ts +8 -0
- package/dist/translations/pt.js +5 -0
- package/dist/translations/pt.umd.js +11 -0
- package/dist/translations/ro.d.ts +8 -0
- package/dist/translations/ro.js +5 -0
- package/dist/translations/ro.umd.js +11 -0
- package/dist/translations/ru.d.ts +8 -0
- package/dist/translations/ru.js +5 -0
- package/dist/translations/ru.umd.js +11 -0
- package/dist/translations/si.d.ts +8 -0
- package/dist/translations/si.js +5 -0
- package/dist/translations/si.umd.js +11 -0
- package/dist/translations/sk.d.ts +8 -0
- package/dist/translations/sk.js +5 -0
- package/dist/translations/sk.umd.js +11 -0
- package/dist/translations/sq.d.ts +8 -0
- package/dist/translations/sq.js +5 -0
- package/dist/translations/sq.umd.js +11 -0
- package/dist/translations/sr-latn.d.ts +8 -0
- package/dist/translations/sr-latn.js +5 -0
- package/dist/translations/sr-latn.umd.js +11 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +5 -0
- package/dist/translations/sr.umd.js +11 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +5 -0
- package/dist/translations/sv.umd.js +11 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +5 -0
- package/dist/translations/th.umd.js +11 -0
- package/dist/translations/ti.d.ts +8 -0
- package/dist/translations/ti.js +5 -0
- package/dist/translations/ti.umd.js +11 -0
- package/dist/translations/tk.d.ts +8 -0
- package/dist/translations/tk.js +5 -0
- package/dist/translations/tk.umd.js +11 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +5 -0
- package/dist/translations/tr.umd.js +11 -0
- package/dist/translations/tt.d.ts +8 -0
- package/dist/translations/tt.js +5 -0
- package/dist/translations/tt.umd.js +11 -0
- package/dist/translations/ug.d.ts +8 -0
- package/dist/translations/ug.js +5 -0
- package/dist/translations/ug.umd.js +11 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +5 -0
- package/dist/translations/uk.umd.js +11 -0
- package/dist/translations/ur.d.ts +8 -0
- package/dist/translations/ur.js +5 -0
- package/dist/translations/ur.umd.js +11 -0
- package/dist/translations/uz.d.ts +8 -0
- package/dist/translations/uz.js +5 -0
- package/dist/translations/uz.umd.js +11 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +5 -0
- package/dist/translations/vi.umd.js +11 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +5 -0
- package/dist/translations/zh-cn.umd.js +11 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +5 -0
- package/dist/translations/zh.umd.js +11 -0
- package/dist/types/augmentation.d.ts +61 -0
- package/dist/types/autoimage.d.ts +56 -0
- package/dist/types/image/converters.d.ts +70 -0
- package/dist/types/image/imageblockediting.d.ts +63 -0
- package/dist/types/image/imageediting.d.ts +34 -0
- package/dist/types/image/imageinlineediting.d.ts +64 -0
- package/dist/types/image/imageloadobserver.d.ts +52 -0
- package/dist/types/image/imageplaceholder.d.ts +43 -0
- package/dist/types/image/imagetypecommand.d.ts +48 -0
- package/dist/types/image/insertimagecommand.d.ts +70 -0
- package/dist/types/image/replaceimagesourcecommand.d.ts +55 -0
- package/dist/types/image/ui/utils.d.ts +29 -0
- package/dist/types/image/utils.d.ts +68 -0
- package/dist/types/image.d.ts +38 -0
- package/dist/types/imageblock.d.ts +38 -0
- package/dist/types/imagecaption/imagecaptionediting.d.ts +93 -0
- package/dist/types/imagecaption/imagecaptionui.d.ts +30 -0
- package/dist/types/imagecaption/imagecaptionutils.d.ts +42 -0
- package/dist/types/imagecaption/toggleimagecaptioncommand.d.ts +70 -0
- package/dist/types/imagecaption.d.ts +30 -0
- package/dist/types/imageconfig.d.ts +716 -0
- package/dist/types/imageinline.d.ts +38 -0
- package/dist/types/imageinsert/imageinsertui.d.ts +78 -0
- package/dist/types/imageinsert/imageinsertviaurlui.d.ts +48 -0
- package/dist/types/imageinsert/ui/imageinsertformview.d.ts +60 -0
- package/dist/types/imageinsert/ui/imageinserturlview.d.ts +111 -0
- package/dist/types/imageinsert.d.ts +37 -0
- package/dist/types/imageinsertviaurl.d.ts +35 -0
- package/dist/types/imageresize/imagecustomresizeui.d.ts +65 -0
- package/dist/types/imageresize/imageresizebuttons.d.ts +68 -0
- package/dist/types/imageresize/imageresizeediting.d.ts +45 -0
- package/dist/types/imageresize/imageresizehandles.d.ts +35 -0
- package/dist/types/imageresize/resizeimagecommand.d.ts +46 -0
- package/dist/types/imageresize/ui/imagecustomresizeformview.d.ts +133 -0
- package/dist/types/imageresize/utils/getselectedimageeditornodes.d.ts +28 -0
- package/dist/types/imageresize/utils/getselectedimagepossibleresizerange.d.ts +28 -0
- package/dist/types/imageresize/utils/getselectedimagewidthinunits.d.ts +22 -0
- package/dist/types/imageresize/utils/tryparsedimensionwithunit.d.ts +41 -0
- package/dist/types/imageresize.d.ts +32 -0
- package/dist/types/imagesizeattributes.d.ts +38 -0
- package/dist/types/imagestyle/converters.d.ts +28 -0
- package/dist/types/imagestyle/imagestylecommand.d.ts +72 -0
- package/dist/types/imagestyle/imagestyleediting.d.ts +54 -0
- package/dist/types/imagestyle/imagestyleui.d.ts +60 -0
- package/dist/types/imagestyle/utils.d.ts +105 -0
- package/dist/types/imagestyle.d.ts +36 -0
- package/dist/types/imagetextalternative/imagetextalternativecommand.d.ts +38 -0
- package/dist/types/imagetextalternative/imagetextalternativeediting.d.ts +32 -0
- package/dist/types/imagetextalternative/imagetextalternativeui.d.ts +72 -0
- package/dist/types/imagetextalternative/ui/textalternativeformview.d.ts +94 -0
- package/dist/types/imagetextalternative.d.ts +33 -0
- package/dist/types/imagetoolbar.d.ts +39 -0
- package/dist/types/imageupload/imageuploadediting.d.ts +115 -0
- package/dist/types/imageupload/imageuploadprogress.d.ts +46 -0
- package/dist/types/imageupload/imageuploadui.d.ts +34 -0
- package/dist/types/imageupload/uploadimagecommand.d.ts +64 -0
- package/dist/types/imageupload/utils.d.ts +37 -0
- package/dist/types/imageupload.d.ts +36 -0
- package/dist/types/imageutils.d.ts +129 -0
- package/dist/types/index.d.ts +53 -0
- package/dist/types/pictureediting.d.ts +92 -0
- package/lang/contexts.json +9 -1
- package/lang/translations/ar.po +32 -0
- package/lang/translations/ast.po +32 -0
- package/lang/translations/az.po +32 -0
- package/lang/translations/bg.po +32 -0
- package/lang/translations/bn.po +32 -0
- package/lang/translations/bs.po +32 -0
- package/lang/translations/ca.po +32 -0
- package/lang/translations/cs.po +32 -0
- package/lang/translations/da.po +32 -0
- package/lang/translations/de-ch.po +32 -0
- package/lang/translations/de.po +32 -0
- package/lang/translations/el.po +32 -0
- package/lang/translations/en-au.po +32 -0
- package/lang/translations/en-gb.po +32 -0
- package/lang/translations/en.po +32 -0
- package/lang/translations/eo.po +32 -0
- package/lang/translations/es-co.po +32 -0
- package/lang/translations/es.po +32 -0
- package/lang/translations/et.po +32 -0
- package/lang/translations/eu.po +32 -0
- package/lang/translations/fa.po +32 -0
- package/lang/translations/fi.po +32 -0
- package/lang/translations/fr.po +32 -0
- package/lang/translations/gl.po +32 -0
- package/lang/translations/he.po +32 -0
- package/lang/translations/hi.po +32 -0
- package/lang/translations/hr.po +32 -0
- package/lang/translations/hu.po +32 -0
- package/lang/translations/id.po +32 -0
- package/lang/translations/it.po +32 -0
- package/lang/translations/ja.po +32 -0
- package/lang/translations/jv.po +32 -0
- package/lang/translations/km.po +32 -0
- package/lang/translations/kn.po +32 -0
- package/lang/translations/ko.po +32 -0
- package/lang/translations/ku.po +32 -0
- package/lang/translations/lt.po +32 -0
- package/lang/translations/lv.po +32 -0
- package/lang/translations/ms.po +32 -0
- package/lang/translations/nb.po +32 -0
- package/lang/translations/ne.po +32 -0
- package/lang/translations/nl.po +32 -0
- package/lang/translations/no.po +32 -0
- package/lang/translations/pl.po +32 -0
- package/lang/translations/pt-br.po +32 -0
- package/lang/translations/pt.po +32 -0
- package/lang/translations/ro.po +32 -0
- package/lang/translations/ru.po +32 -0
- package/lang/translations/si.po +32 -0
- package/lang/translations/sk.po +32 -0
- package/lang/translations/sq.po +32 -0
- package/lang/translations/sr-latn.po +32 -0
- package/lang/translations/sr.po +32 -0
- package/lang/translations/sv.po +32 -0
- package/lang/translations/th.po +32 -0
- package/lang/translations/ti.po +178 -0
- package/lang/translations/tk.po +32 -0
- package/lang/translations/tr.po +32 -0
- package/lang/translations/tt.po +32 -0
- package/lang/translations/ug.po +32 -0
- package/lang/translations/uk.po +32 -0
- package/lang/translations/ur.po +32 -0
- package/lang/translations/uz.po +32 -0
- package/lang/translations/vi.po +32 -0
- package/lang/translations/zh-cn.po +32 -0
- package/lang/translations/zh.po +32 -0
- package/package.json +4 -3
- package/src/augmentation.d.ts +2 -1
- package/src/imageresize/imagecustomresizeui.d.ts +61 -0
- package/src/imageresize/imagecustomresizeui.js +168 -0
- package/src/imageresize/imageresizebuttons.d.ts +0 -3
- package/src/imageresize/imageresizebuttons.js +95 -23
- package/src/imageresize/imageresizeediting.js +9 -2
- package/src/imageresize/imageresizehandles.js +1 -2
- package/src/imageresize/ui/imagecustomresizeformview.d.ts +129 -0
- package/src/imageresize/ui/imagecustomresizeformview.js +186 -0
- package/src/imageresize/utils/getselectedimageeditornodes.d.ts +24 -0
- package/src/imageresize/utils/getselectedimageeditornodes.js +24 -0
- package/src/imageresize/utils/getselectedimagepossibleresizerange.d.ts +24 -0
- package/src/imageresize/utils/getselectedimagepossibleresizerange.js +32 -0
- package/src/imageresize/utils/getselectedimagewidthinunits.d.ts +18 -0
- package/src/imageresize/utils/getselectedimagewidthinunits.js +41 -0
- package/src/imageresize/utils/tryparsedimensionwithunit.d.ts +37 -0
- package/src/imageresize/utils/tryparsedimensionwithunit.js +56 -0
- package/src/imageresize.d.ts +2 -1
- package/src/imageresize.js +2 -1
- package/src/imageupload/imageuploadediting.js +9 -0
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/theme/imagecaption.css +15 -1
- package/theme/imagecustomresizeform.css +33 -0
|
@@ -0,0 +1,133 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module image/imageresize/ui/imagecustomresizeformview
|
|
11
|
+
*/
|
|
12
|
+
import { ButtonView, FocusCycler, LabeledFieldView, View, ViewCollection, type FocusableView, type InputNumberView } from 'ckeditor5/src/ui.js';
|
|
13
|
+
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
|
|
14
|
+
import '../../../theme/imagecustomresizeform.css';
|
|
15
|
+
import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
|
|
16
|
+
/**
|
|
17
|
+
* The ImageCustomResizeFormView class.
|
|
18
|
+
*/
|
|
19
|
+
export default class ImageCustomResizeFormView extends View {
|
|
20
|
+
/**
|
|
21
|
+
* Tracks information about the DOM focus in the form.
|
|
22
|
+
*/
|
|
23
|
+
readonly focusTracker: FocusTracker;
|
|
24
|
+
/**
|
|
25
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
26
|
+
*/
|
|
27
|
+
readonly keystrokes: KeystrokeHandler;
|
|
28
|
+
/**
|
|
29
|
+
* Resize unit shortcut.
|
|
30
|
+
*/
|
|
31
|
+
readonly unit: string;
|
|
32
|
+
/**
|
|
33
|
+
* An input with a label.
|
|
34
|
+
*/
|
|
35
|
+
labeledInput: LabeledFieldView<InputNumberView>;
|
|
36
|
+
/**
|
|
37
|
+
* A button used to submit the form.
|
|
38
|
+
*/
|
|
39
|
+
saveButtonView: ButtonView;
|
|
40
|
+
/**
|
|
41
|
+
* A button used to cancel the form.
|
|
42
|
+
*/
|
|
43
|
+
cancelButtonView: ButtonView;
|
|
44
|
+
/**
|
|
45
|
+
* A collection of views which can be focused in the form.
|
|
46
|
+
*/
|
|
47
|
+
protected readonly _focusables: ViewCollection<FocusableView>;
|
|
48
|
+
/**
|
|
49
|
+
* Helps cycling over {@link #_focusables} in the form.
|
|
50
|
+
*/
|
|
51
|
+
protected readonly _focusCycler: FocusCycler;
|
|
52
|
+
/**
|
|
53
|
+
* An array of form validators used by {@link #isValid}.
|
|
54
|
+
*/
|
|
55
|
+
private readonly _validators;
|
|
56
|
+
/**
|
|
57
|
+
* @inheritDoc
|
|
58
|
+
*/
|
|
59
|
+
constructor(locale: Locale, unit: string, validators: Array<ImageCustomResizeFormValidatorCallback>);
|
|
60
|
+
/**
|
|
61
|
+
* @inheritDoc
|
|
62
|
+
*/
|
|
63
|
+
render(): void;
|
|
64
|
+
/**
|
|
65
|
+
* @inheritDoc
|
|
66
|
+
*/
|
|
67
|
+
destroy(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Creates the button view.
|
|
70
|
+
*
|
|
71
|
+
* @param label The button label
|
|
72
|
+
* @param icon The button's icon.
|
|
73
|
+
* @param className The additional button CSS class name.
|
|
74
|
+
* @param eventName The event name that the ButtonView#execute event will be delegated to.
|
|
75
|
+
* @returns The button view instance.
|
|
76
|
+
*/
|
|
77
|
+
private _createButton;
|
|
78
|
+
/**
|
|
79
|
+
* Creates an input with a label.
|
|
80
|
+
*
|
|
81
|
+
* @returns Labeled field view instance.
|
|
82
|
+
*/
|
|
83
|
+
private _createLabeledInputView;
|
|
84
|
+
/**
|
|
85
|
+
* Validates the form and returns `false` when some fields are invalid.
|
|
86
|
+
*/
|
|
87
|
+
isValid(): boolean;
|
|
88
|
+
/**
|
|
89
|
+
* Cleans up the supplementary error and information text of the {@link #labeledInput}
|
|
90
|
+
* bringing them back to the state when the form has been displayed for the first time.
|
|
91
|
+
*
|
|
92
|
+
* See {@link #isValid}.
|
|
93
|
+
*/
|
|
94
|
+
resetFormStatus(): void;
|
|
95
|
+
/**
|
|
96
|
+
* The native DOM `value` of the input element of {@link #labeledInput}.
|
|
97
|
+
*/
|
|
98
|
+
get rawSize(): string | null;
|
|
99
|
+
/**
|
|
100
|
+
* Get numeric value of size. Returns `null` if value of size input element in {@link #labeledInput}.is not a number.
|
|
101
|
+
*/
|
|
102
|
+
get parsedSize(): number | null;
|
|
103
|
+
/**
|
|
104
|
+
* Returns serialized image input size with unit.
|
|
105
|
+
* Returns `null` if value of size input element in {@link #labeledInput}.is not a number.
|
|
106
|
+
*/
|
|
107
|
+
get sizeWithUnits(): string | null;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Callback used by {@link ~ImageCustomResizeFormView} to check if passed form value is valid.
|
|
111
|
+
*
|
|
112
|
+
* * If `undefined` is returned, it is assumed that the form value is correct and there is no error.
|
|
113
|
+
* * If string is returned, it is assumed that the form value is incorrect and the returned string is displayed in the error label
|
|
114
|
+
*/
|
|
115
|
+
export type ImageCustomResizeFormValidatorCallback = (form: ImageCustomResizeFormView) => string | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* Fired when the form view is submitted.
|
|
118
|
+
*
|
|
119
|
+
* @eventName ~ImageCustomResizeFormView#submit
|
|
120
|
+
*/
|
|
121
|
+
export type ImageCustomResizeFormViewSubmitEvent = {
|
|
122
|
+
name: 'submit';
|
|
123
|
+
args: [];
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Fired when the form view is canceled.
|
|
127
|
+
*
|
|
128
|
+
* @eventName ~ImageCustomResizeFormView#cancel
|
|
129
|
+
*/
|
|
130
|
+
export type ImageCustomResizeFormViewCancelEvent = {
|
|
131
|
+
name: 'cancel';
|
|
132
|
+
args: [];
|
|
133
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module image/imageresize/utils/getselectedimageeditornodes
|
|
11
|
+
*/
|
|
12
|
+
import type { ViewElement, Element } from 'ckeditor5/src/engine.js';
|
|
13
|
+
import type { Editor } from 'ckeditor5/src/core.js';
|
|
14
|
+
/**
|
|
15
|
+
* Finds model, view and DOM element for selected image element. Returns `null` if there is no image selected.
|
|
16
|
+
*
|
|
17
|
+
* @param editor Editor instance.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getSelectedImageEditorNodes(editor: Editor): ImageEditorNodes | null;
|
|
20
|
+
/**
|
|
21
|
+
* @internal;
|
|
22
|
+
*/
|
|
23
|
+
type ImageEditorNodes = {
|
|
24
|
+
model: Element;
|
|
25
|
+
view: ViewElement;
|
|
26
|
+
dom: HTMLElement;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module image/imageresize/utils/getselectedimagepossibleresizerange
|
|
11
|
+
*/
|
|
12
|
+
import type { Editor } from 'ckeditor5/src/core.js';
|
|
13
|
+
/**
|
|
14
|
+
* Returns min and max value of resize image in specified unit.
|
|
15
|
+
*
|
|
16
|
+
* @param editor Editor instance.
|
|
17
|
+
* @param targetUnit Unit in which dimension will be returned.
|
|
18
|
+
* @returns Possible resize range in numeric form.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getSelectedImagePossibleResizeRange(editor: Editor, targetUnit: string): PossibleResizeImageRange | null;
|
|
21
|
+
/**
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export type PossibleResizeImageRange = {
|
|
25
|
+
unit: string;
|
|
26
|
+
lower: number;
|
|
27
|
+
upper: number;
|
|
28
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
import type { Editor } from 'ckeditor5/src/core.js';
|
|
10
|
+
import { type DimensionWithUnit } from './tryparsedimensionwithunit.js';
|
|
11
|
+
/**
|
|
12
|
+
* Returns image width in specified units. It is width of image after resize.
|
|
13
|
+
*
|
|
14
|
+
* * If image is not selected or command is disabled then `null` will be returned.
|
|
15
|
+
* * If image is not fully loaded (and it is impossible to determine its natural size) then `null` will be returned.
|
|
16
|
+
* * If `targetUnit` percentage is passed then it will return width percentage of image related to its accessors.
|
|
17
|
+
*
|
|
18
|
+
* @param editor Editor instance.
|
|
19
|
+
* @param targetUnit Unit in which dimension will be returned.
|
|
20
|
+
* @returns Parsed image width after resize (with unit).
|
|
21
|
+
*/
|
|
22
|
+
export declare function getSelectedImageWidthInUnits(editor: Editor, targetUnit: string): DimensionWithUnit | null;
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module image/imageresize/utils/tryparsedimensionwithunit
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Parses provided string with dimension value and returns extracted numeric value and unit.
|
|
14
|
+
*
|
|
15
|
+
* * If non-string dimension is passed then `null` value is returned.
|
|
16
|
+
* * If unit is missing then `null` is returned.
|
|
17
|
+
* * If numeric value part of string is not a number then `null` is returned.
|
|
18
|
+
*
|
|
19
|
+
* Example:
|
|
20
|
+
* `"222px"` => `{ value: 222, unit: "px" }`
|
|
21
|
+
* `"99%"` => `{ value: 99, unit: "%" }`
|
|
22
|
+
|
|
23
|
+
* @param dimension Unsafe string with dimension.
|
|
24
|
+
* @returns Parsed dimension with extracted numeric value and units.
|
|
25
|
+
*/
|
|
26
|
+
export declare function tryParseDimensionWithUnit(dimension: string | null | undefined): DimensionWithUnit | null;
|
|
27
|
+
/**
|
|
28
|
+
* Converts dimension between `px` -> `%` and `%` -> `px`.
|
|
29
|
+
*
|
|
30
|
+
* @param parentDimensionPx Dimension of parent element that contains measured element.
|
|
31
|
+
* @param dimension Measured element dimension.
|
|
32
|
+
* @returns Casted dimension.
|
|
33
|
+
*/
|
|
34
|
+
export declare function tryCastDimensionsToUnit(parentDimensionPx: number, dimension: DimensionWithUnit, targetUnit: string): DimensionWithUnit;
|
|
35
|
+
/**
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
38
|
+
export type DimensionWithUnit = {
|
|
39
|
+
value: number;
|
|
40
|
+
unit: string;
|
|
41
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module image/imageresize
|
|
11
|
+
*/
|
|
12
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
13
|
+
import ImageResizeButtons from './imageresize/imageresizebuttons.js';
|
|
14
|
+
import ImageResizeEditing from './imageresize/imageresizeediting.js';
|
|
15
|
+
import ImageResizeHandles from './imageresize/imageresizehandles.js';
|
|
16
|
+
import ImageCustomResizeUI from './imageresize/imagecustomresizeui.js';
|
|
17
|
+
import '../theme/imageresize.css';
|
|
18
|
+
/**
|
|
19
|
+
* The image resize plugin.
|
|
20
|
+
*
|
|
21
|
+
* It adds a possibility to resize each image using handles.
|
|
22
|
+
*/
|
|
23
|
+
export default class ImageResize extends Plugin {
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
static get requires(): readonly [typeof ImageResizeEditing, typeof ImageResizeHandles, typeof ImageCustomResizeUI, typeof ImageResizeButtons];
|
|
28
|
+
/**
|
|
29
|
+
* @inheritDoc
|
|
30
|
+
*/
|
|
31
|
+
static get pluginName(): "ImageResize";
|
|
32
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module image/imagesizeattributes
|
|
11
|
+
*/
|
|
12
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
13
|
+
import ImageUtils from './imageutils.js';
|
|
14
|
+
/**
|
|
15
|
+
* This plugin enables `width` and `height` attributes in inline and block image elements.
|
|
16
|
+
*/
|
|
17
|
+
export default class ImageSizeAttributes extends Plugin {
|
|
18
|
+
/**
|
|
19
|
+
* @inheritDoc
|
|
20
|
+
*/
|
|
21
|
+
static get requires(): readonly [typeof ImageUtils];
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get pluginName(): "ImageSizeAttributes";
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
afterInit(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Registers the `width` and `height` attributes for inline and block images.
|
|
32
|
+
*/
|
|
33
|
+
private _registerSchema;
|
|
34
|
+
/**
|
|
35
|
+
* Registers converters for `width` and `height` attributes.
|
|
36
|
+
*/
|
|
37
|
+
private _registerConverters;
|
|
38
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
import type { DowncastAttributeEvent, UpcastElementEvent } from 'ckeditor5/src/engine.js';
|
|
10
|
+
import { type GetCallback } from 'ckeditor5/src/utils.js';
|
|
11
|
+
import type { ImageStyleOptionDefinition } from '../imageconfig.js';
|
|
12
|
+
/**
|
|
13
|
+
* @module image/imagestyle/converters
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Returns a converter for the `imageStyle` attribute. It can be used for adding, changing and removing the attribute.
|
|
17
|
+
*
|
|
18
|
+
* @param styles An array containing available image style options.
|
|
19
|
+
* @returns A model-to-view attribute converter.
|
|
20
|
+
*/
|
|
21
|
+
export declare function modelToViewStyleAttribute(styles: Array<ImageStyleOptionDefinition>): GetCallback<DowncastAttributeEvent>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns a view-to-model converter converting image CSS classes to a proper value in the model.
|
|
24
|
+
*
|
|
25
|
+
* @param styles Image style options for which the converter is created.
|
|
26
|
+
* @returns A view-to-model converter.
|
|
27
|
+
*/
|
|
28
|
+
export declare function viewToModelStyleAttribute(styles: Array<ImageStyleOptionDefinition>): GetCallback<UpcastElementEvent>;
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module image/imagestyle/imagestylecommand
|
|
11
|
+
*/
|
|
12
|
+
import type { Element } from 'ckeditor5/src/engine.js';
|
|
13
|
+
import { Command, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
+
import type { ImageStyleOptionDefinition } from '../imageconfig.js';
|
|
15
|
+
/**
|
|
16
|
+
* The image style command. It is used to apply {@link module:image/imageconfig~ImageStyleConfig#options image style option}
|
|
17
|
+
* to a selected image.
|
|
18
|
+
*
|
|
19
|
+
* **Note**: Executing this command may change the image model element if the desired style requires an image of a different
|
|
20
|
+
* type. See {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand#execute} to learn more.
|
|
21
|
+
*/
|
|
22
|
+
export default class ImageStyleCommand extends Command {
|
|
23
|
+
/**
|
|
24
|
+
* An object containing names of default style options for the inline and block images.
|
|
25
|
+
* If there is no default style option for the given image type in the configuration,
|
|
26
|
+
* the name will be `false`.
|
|
27
|
+
*/
|
|
28
|
+
private _defaultStyles;
|
|
29
|
+
/**
|
|
30
|
+
* The styles handled by this command.
|
|
31
|
+
*/
|
|
32
|
+
private _styles;
|
|
33
|
+
/**
|
|
34
|
+
* Creates an instance of the image style command. When executed, the command applies one of
|
|
35
|
+
* {@link module:image/imageconfig~ImageStyleConfig#options style options} to the currently selected image.
|
|
36
|
+
*
|
|
37
|
+
* @param editor The editor instance.
|
|
38
|
+
* @param styles The style options that this command supports.
|
|
39
|
+
*/
|
|
40
|
+
constructor(editor: Editor, styles: Array<ImageStyleOptionDefinition>);
|
|
41
|
+
/**
|
|
42
|
+
* @inheritDoc
|
|
43
|
+
*/
|
|
44
|
+
refresh(): void;
|
|
45
|
+
/**
|
|
46
|
+
* Executes the command and applies the style to the currently selected image:
|
|
47
|
+
*
|
|
48
|
+
* ```ts
|
|
49
|
+
* editor.execute( 'imageStyle', { value: 'side' } );
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* **Note**: Executing this command may change the image model element if the desired style requires an image
|
|
53
|
+
* of a different type. Learn more about {@link module:image/imageconfig~ImageStyleOptionDefinition#modelElements model element}
|
|
54
|
+
* configuration for the style option.
|
|
55
|
+
*
|
|
56
|
+
* @param options.value The name of the style (as configured in {@link module:image/imageconfig~ImageStyleConfig#options}).
|
|
57
|
+
* @param options.setImageSizes Specifies whether the image `width` and `height` attributes should be set automatically.
|
|
58
|
+
* The default is `true`.
|
|
59
|
+
* @fires execute
|
|
60
|
+
*/
|
|
61
|
+
execute(options?: {
|
|
62
|
+
value?: string;
|
|
63
|
+
setImageSizes?: boolean;
|
|
64
|
+
}): void;
|
|
65
|
+
/**
|
|
66
|
+
* Returns `true` if requested style change would trigger the image type change.
|
|
67
|
+
*
|
|
68
|
+
* @param requestedStyle The name of the style (as configured in {@link module:image/imageconfig~ImageStyleConfig#options}).
|
|
69
|
+
* @param imageElement The image model element.
|
|
70
|
+
*/
|
|
71
|
+
shouldConvertImageType(requestedStyle: string, imageElement: Element): boolean;
|
|
72
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module image/imagestyle/imagestyleediting
|
|
11
|
+
*/
|
|
12
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
13
|
+
import ImageUtils from '../imageutils.js';
|
|
14
|
+
import type { ImageStyleOptionDefinition } from '../imageconfig.js';
|
|
15
|
+
/**
|
|
16
|
+
* The image style engine plugin. It sets the default configuration, creates converters and registers
|
|
17
|
+
* {@link module:image/imagestyle/imagestylecommand~ImageStyleCommand ImageStyleCommand}.
|
|
18
|
+
*/
|
|
19
|
+
export default class ImageStyleEditing extends Plugin {
|
|
20
|
+
/**
|
|
21
|
+
* @inheritDoc
|
|
22
|
+
*/
|
|
23
|
+
static get pluginName(): "ImageStyleEditing";
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
static get requires(): readonly [typeof ImageUtils];
|
|
28
|
+
/**
|
|
29
|
+
* It contains a list of the normalized and validated style options.
|
|
30
|
+
*
|
|
31
|
+
* * Each option contains a complete icon markup.
|
|
32
|
+
* * The style options not supported by any of the loaded image editing plugins (
|
|
33
|
+
* {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`} or
|
|
34
|
+
* {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`}) are filtered out.
|
|
35
|
+
*
|
|
36
|
+
* @internal
|
|
37
|
+
* @readonly
|
|
38
|
+
*/
|
|
39
|
+
normalizedStyles?: Array<ImageStyleOptionDefinition>;
|
|
40
|
+
/**
|
|
41
|
+
* @inheritDoc
|
|
42
|
+
*/
|
|
43
|
+
init(): void;
|
|
44
|
+
/**
|
|
45
|
+
* Sets the editor conversion taking the presence of
|
|
46
|
+
* {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`}
|
|
47
|
+
* and {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} plugins into consideration.
|
|
48
|
+
*/
|
|
49
|
+
private _setupConversion;
|
|
50
|
+
/**
|
|
51
|
+
* Registers a post-fixer that will make sure that the style attribute value is correct for a specific image type (block vs inline).
|
|
52
|
+
*/
|
|
53
|
+
private _setupPostFixer;
|
|
54
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module image/imagestyle/imagestyleui
|
|
11
|
+
*/
|
|
12
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
13
|
+
import ImageStyleEditing from './imagestyleediting.js';
|
|
14
|
+
import '../../theme/imagestyle.css';
|
|
15
|
+
/**
|
|
16
|
+
* The image style UI plugin.
|
|
17
|
+
*
|
|
18
|
+
* It registers buttons corresponding to the {@link module:image/imageconfig~ImageConfig#styles} configuration.
|
|
19
|
+
* It also registers the {@link module:image/imagestyle/utils#DEFAULT_DROPDOWN_DEFINITIONS default drop-downs} and the
|
|
20
|
+
* custom drop-downs defined by the developer in the {@link module:image/imageconfig~ImageConfig#toolbar} configuration.
|
|
21
|
+
*/
|
|
22
|
+
export default class ImageStyleUI extends Plugin {
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get requires(): readonly [typeof ImageStyleEditing];
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static get pluginName(): "ImageStyleUI";
|
|
31
|
+
/**
|
|
32
|
+
* Returns the default localized style titles provided by the plugin.
|
|
33
|
+
*
|
|
34
|
+
* The following localized titles corresponding with
|
|
35
|
+
* {@link module:image/imagestyle/utils#DEFAULT_OPTIONS} are available:
|
|
36
|
+
*
|
|
37
|
+
* * `'Wrap text'`,
|
|
38
|
+
* * `'Break text'`,
|
|
39
|
+
* * `'In line'`,
|
|
40
|
+
* * `'Full size image'`,
|
|
41
|
+
* * `'Side image'`,
|
|
42
|
+
* * `'Left aligned image'`,
|
|
43
|
+
* * `'Centered image'`,
|
|
44
|
+
* * `'Right aligned image'`
|
|
45
|
+
*/
|
|
46
|
+
get localizedDefaultStylesTitles(): Record<string, string>;
|
|
47
|
+
/**
|
|
48
|
+
* @inheritDoc
|
|
49
|
+
*/
|
|
50
|
+
init(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Creates a dropdown and stores it in the editor {@link module:ui/componentfactory~ComponentFactory}.
|
|
53
|
+
*/
|
|
54
|
+
private _createDropdown;
|
|
55
|
+
/**
|
|
56
|
+
* Creates a button and stores it in the editor {@link module:ui/componentfactory~ComponentFactory}.
|
|
57
|
+
*/
|
|
58
|
+
private _createButton;
|
|
59
|
+
private _executeCommand;
|
|
60
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* @module image/imagestyle/utils
|
|
11
|
+
*/
|
|
12
|
+
import { type Editor, type PluginCollection } from 'ckeditor5/src/core.js';
|
|
13
|
+
import type { ImageStyleConfig, ImageStyleDropdownDefinition, ImageStyleOptionDefinition } from '../imageconfig.js';
|
|
14
|
+
/**
|
|
15
|
+
* Default image style options provided by the plugin that can be referred in the {@link module:image/imageconfig~ImageConfig#styles}
|
|
16
|
+
* configuration.
|
|
17
|
+
*
|
|
18
|
+
* There are available 5 styles focused on formatting:
|
|
19
|
+
*
|
|
20
|
+
* * **`'alignLeft'`** aligns the inline or block image to the left and wraps it with the text using the `image-style-align-left` class,
|
|
21
|
+
* * **`'alignRight'`** aligns the inline or block image to the right and wraps it with the text using the `image-style-align-right` class,
|
|
22
|
+
* * **`'alignCenter'`** centers the block image using the `image-style-align-center` class,
|
|
23
|
+
* * **`'alignBlockLeft'`** aligns the block image to the left using the `image-style-block-align-left` class,
|
|
24
|
+
* * **`'alignBlockRight'`** aligns the block image to the right using the `image-style-block-align-right` class,
|
|
25
|
+
*
|
|
26
|
+
* and 3 semantic styles:
|
|
27
|
+
*
|
|
28
|
+
* * **`'inline'`** is an inline image without any CSS class,
|
|
29
|
+
* * **`'block'`** is a block image without any CSS class,
|
|
30
|
+
* * **`'side'`** is a block image styled with the `image-style-side` CSS class.
|
|
31
|
+
*/
|
|
32
|
+
export declare const DEFAULT_OPTIONS: Record<string, ImageStyleOptionDefinition>;
|
|
33
|
+
/**
|
|
34
|
+
* Default image style icons provided by the plugin that can be referred in the {@link module:image/imageconfig~ImageConfig#styles}
|
|
35
|
+
* configuration.
|
|
36
|
+
*
|
|
37
|
+
* See {@link module:image/imageconfig~ImageStyleOptionDefinition#icon} to learn more.
|
|
38
|
+
*
|
|
39
|
+
* There are 7 default icons available: `'full'`, `'left'`, `'inlineLeft'`, `'center'`, `'right'`, `'inlineRight'`, and `'inline'`.
|
|
40
|
+
*/
|
|
41
|
+
export declare const DEFAULT_ICONS: Record<string, string>;
|
|
42
|
+
/**
|
|
43
|
+
* Default drop-downs provided by the plugin that can be referred in the {@link module:image/imageconfig~ImageConfig#toolbar}
|
|
44
|
+
* configuration. The drop-downs are containers for the {@link module:image/imageconfig~ImageStyleConfig#options image style options}.
|
|
45
|
+
*
|
|
46
|
+
* If both of the `ImageEditing` plugins are loaded, there are 2 predefined drop-downs available:
|
|
47
|
+
*
|
|
48
|
+
* * **`'imageStyle:wrapText'`**, which contains the `alignLeft` and `alignRight` options, that is,
|
|
49
|
+
* those that wraps the text around the image,
|
|
50
|
+
* * **`'imageStyle:breakText'`**, which contains the `alignBlockLeft`, `alignCenter` and `alignBlockRight` options, that is,
|
|
51
|
+
* those that breaks the text around the image.
|
|
52
|
+
*/
|
|
53
|
+
export declare const DEFAULT_DROPDOWN_DEFINITIONS: Array<ImageStyleDropdownDefinition>;
|
|
54
|
+
/**
|
|
55
|
+
* Returns a list of the normalized and validated image style options.
|
|
56
|
+
*
|
|
57
|
+
* @param config
|
|
58
|
+
* @param config.isInlinePluginLoaded
|
|
59
|
+
* Determines whether the {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} plugin has been loaded.
|
|
60
|
+
* @param config.isBlockPluginLoaded
|
|
61
|
+
* Determines whether the {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`} plugin has been loaded.
|
|
62
|
+
* @param config.configuredStyles
|
|
63
|
+
* The image styles configuration provided in the image styles {@link module:image/imageconfig~ImageConfig#styles configuration}
|
|
64
|
+
* as a default or custom value.
|
|
65
|
+
* @returns
|
|
66
|
+
* * Each of options contains a complete icon markup.
|
|
67
|
+
* * The image style options not supported by any of the loaded plugins are filtered out.
|
|
68
|
+
*/
|
|
69
|
+
declare function normalizeStyles(config: {
|
|
70
|
+
isInlinePluginLoaded: boolean;
|
|
71
|
+
isBlockPluginLoaded: boolean;
|
|
72
|
+
configuredStyles: ImageStyleConfig;
|
|
73
|
+
}): Array<ImageStyleOptionDefinition>;
|
|
74
|
+
/**
|
|
75
|
+
* Returns the default image styles configuration depending on the loaded image editing plugins.
|
|
76
|
+
*
|
|
77
|
+
* @param isInlinePluginLoaded
|
|
78
|
+
* Determines whether the {@link module:image/image/imageblockediting~ImageBlockEditing `ImageBlockEditing`} plugin has been loaded.
|
|
79
|
+
*
|
|
80
|
+
* @param isBlockPluginLoaded
|
|
81
|
+
* Determines whether the {@link module:image/image/imageinlineediting~ImageInlineEditing `ImageInlineEditing`} plugin has been loaded.
|
|
82
|
+
*
|
|
83
|
+
* @returns
|
|
84
|
+
* It returns an object with the lists of the image style options and groups defined as strings related to the
|
|
85
|
+
* {@link module:image/imagestyle/utils#DEFAULT_OPTIONS default options}
|
|
86
|
+
*/
|
|
87
|
+
declare function getDefaultStylesConfiguration(isBlockPluginLoaded: boolean, isInlinePluginLoaded: boolean): ImageStyleConfig;
|
|
88
|
+
/**
|
|
89
|
+
* Returns a list of the available predefined drop-downs' definitions depending on the loaded image editing plugins.
|
|
90
|
+
*/
|
|
91
|
+
declare function getDefaultDropdownDefinitions(pluginCollection: PluginCollection<Editor>): Array<ImageStyleDropdownDefinition>;
|
|
92
|
+
/**
|
|
93
|
+
* Displays a console warning with the 'image-style-configuration-definition-invalid' error.
|
|
94
|
+
*/
|
|
95
|
+
declare function warnInvalidStyle(info: object): void;
|
|
96
|
+
declare const _default: {
|
|
97
|
+
normalizeStyles: typeof normalizeStyles;
|
|
98
|
+
getDefaultStylesConfiguration: typeof getDefaultStylesConfiguration;
|
|
99
|
+
getDefaultDropdownDefinitions: typeof getDefaultDropdownDefinitions;
|
|
100
|
+
warnInvalidStyle: typeof warnInvalidStyle;
|
|
101
|
+
DEFAULT_OPTIONS: Record<string, ImageStyleOptionDefinition>;
|
|
102
|
+
DEFAULT_ICONS: Record<string, string>;
|
|
103
|
+
DEFAULT_DROPDOWN_DEFINITIONS: ImageStyleDropdownDefinition[];
|
|
104
|
+
};
|
|
105
|
+
export default _default;
|