@ckeditor/ckeditor5-image 41.3.0 → 41.4.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/image.js +1 -1
- package/ckeditor5-metadata.json +1 -1
- package/dist/index-content.css +105 -0
- package/dist/index-editor.css +132 -0
- package/dist/index.css +542 -0
- package/dist/index.css.map +1 -0
- package/dist/index.js +5638 -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/ast.d.ts +8 -0
- package/dist/translations/ast.js +5 -0
- package/dist/translations/az.d.ts +8 -0
- package/dist/translations/az.js +5 -0
- package/dist/translations/bg.d.ts +8 -0
- package/dist/translations/bg.js +5 -0
- package/dist/translations/bn.d.ts +8 -0
- package/dist/translations/bn.js +5 -0
- package/dist/translations/bs.d.ts +8 -0
- package/dist/translations/bs.js +5 -0
- package/dist/translations/ca.d.ts +8 -0
- package/dist/translations/ca.js +5 -0
- package/dist/translations/cs.d.ts +8 -0
- package/dist/translations/cs.js +5 -0
- package/dist/translations/da.d.ts +8 -0
- package/dist/translations/da.js +5 -0
- package/dist/translations/de-ch.d.ts +8 -0
- package/dist/translations/de-ch.js +5 -0
- package/dist/translations/de.d.ts +8 -0
- package/dist/translations/de.js +5 -0
- package/dist/translations/el.d.ts +8 -0
- package/dist/translations/el.js +5 -0
- package/dist/translations/en-au.d.ts +8 -0
- package/dist/translations/en-au.js +5 -0
- package/dist/translations/en-gb.d.ts +8 -0
- package/dist/translations/en-gb.js +5 -0
- package/dist/translations/en.d.ts +8 -0
- package/dist/translations/en.js +5 -0
- package/dist/translations/eo.d.ts +8 -0
- package/dist/translations/eo.js +5 -0
- package/dist/translations/es-co.d.ts +8 -0
- package/dist/translations/es-co.js +5 -0
- package/dist/translations/es.d.ts +8 -0
- package/dist/translations/es.js +5 -0
- package/dist/translations/et.d.ts +8 -0
- package/dist/translations/et.js +5 -0
- package/dist/translations/eu.d.ts +8 -0
- package/dist/translations/eu.js +5 -0
- package/dist/translations/fa.d.ts +8 -0
- package/dist/translations/fa.js +5 -0
- package/dist/translations/fi.d.ts +8 -0
- package/dist/translations/fi.js +5 -0
- package/dist/translations/fr.d.ts +8 -0
- package/dist/translations/fr.js +5 -0
- package/dist/translations/gl.d.ts +8 -0
- package/dist/translations/gl.js +5 -0
- package/dist/translations/he.d.ts +8 -0
- package/dist/translations/he.js +5 -0
- package/dist/translations/hi.d.ts +8 -0
- package/dist/translations/hi.js +5 -0
- package/dist/translations/hr.d.ts +8 -0
- package/dist/translations/hr.js +5 -0
- package/dist/translations/hu.d.ts +8 -0
- package/dist/translations/hu.js +5 -0
- package/dist/translations/id.d.ts +8 -0
- package/dist/translations/id.js +5 -0
- package/dist/translations/it.d.ts +8 -0
- package/dist/translations/it.js +5 -0
- package/dist/translations/ja.d.ts +8 -0
- package/dist/translations/ja.js +5 -0
- package/dist/translations/jv.d.ts +8 -0
- package/dist/translations/jv.js +5 -0
- package/dist/translations/km.d.ts +8 -0
- package/dist/translations/km.js +5 -0
- package/dist/translations/kn.d.ts +8 -0
- package/dist/translations/kn.js +5 -0
- package/dist/translations/ko.d.ts +8 -0
- package/dist/translations/ko.js +5 -0
- package/dist/translations/ku.d.ts +8 -0
- package/dist/translations/ku.js +5 -0
- package/dist/translations/lt.d.ts +8 -0
- package/dist/translations/lt.js +5 -0
- package/dist/translations/lv.d.ts +8 -0
- package/dist/translations/lv.js +5 -0
- package/dist/translations/ms.d.ts +8 -0
- package/dist/translations/ms.js +5 -0
- package/dist/translations/nb.d.ts +8 -0
- package/dist/translations/nb.js +5 -0
- package/dist/translations/ne.d.ts +8 -0
- package/dist/translations/ne.js +5 -0
- package/dist/translations/nl.d.ts +8 -0
- package/dist/translations/nl.js +5 -0
- package/dist/translations/no.d.ts +8 -0
- package/dist/translations/no.js +5 -0
- package/dist/translations/pl.d.ts +8 -0
- package/dist/translations/pl.js +5 -0
- package/dist/translations/pt-br.d.ts +8 -0
- package/dist/translations/pt-br.js +5 -0
- package/dist/translations/pt.d.ts +8 -0
- package/dist/translations/pt.js +5 -0
- package/dist/translations/ro.d.ts +8 -0
- package/dist/translations/ro.js +5 -0
- package/dist/translations/ru.d.ts +8 -0
- package/dist/translations/ru.js +5 -0
- package/dist/translations/si.d.ts +8 -0
- package/dist/translations/si.js +5 -0
- package/dist/translations/sk.d.ts +8 -0
- package/dist/translations/sk.js +5 -0
- package/dist/translations/sq.d.ts +8 -0
- package/dist/translations/sq.js +5 -0
- package/dist/translations/sr-latn.d.ts +8 -0
- package/dist/translations/sr-latn.js +5 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +5 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +5 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +5 -0
- package/dist/translations/tk.d.ts +8 -0
- package/dist/translations/tk.js +5 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +5 -0
- package/dist/translations/tt.d.ts +8 -0
- package/dist/translations/tt.js +5 -0
- package/dist/translations/ug.d.ts +8 -0
- package/dist/translations/ug.js +5 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +5 -0
- package/dist/translations/ur.d.ts +8 -0
- package/dist/translations/ur.js +5 -0
- package/dist/translations/uz.d.ts +8 -0
- package/dist/translations/uz.js +5 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +5 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +5 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +5 -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/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/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/imagecustomresizeform.css +33 -0
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
import type { Translations } from 'ckeditor5';
|
|
7
|
+
declare const translations: Translations;
|
|
8
|
+
export default translations;
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
export default {"tt":{"dictionary":{"image widget":"","Wrap text":"","Break text":"","In line":"","Side image":"","Full size image":"","Left aligned image":"","Centered image":"","Right aligned image":"","Change image text alternative":"","Text alternative":"","Enter image caption":"","Insert image":"","Replace image":"","Upload from computer":"","Replace from computer":"","Upload image from computer":"","Image from computer":"","Replace image from computer":"","Upload failed":"","Image toolbar":"","Resize image":"","Resize image to %0":"","Resize image to the original size":"","Original":"","Image resize list":"","Insert":"","Update":"Яңарт","Insert image via URL":"","Update image URL":"","Caption for the image":"","Caption for image: %0":""},getPluralForm(n){return 0;}}}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
import type { Translations } from 'ckeditor5';
|
|
7
|
+
declare const translations: Translations;
|
|
8
|
+
export default translations;
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
export default {"ug":{"dictionary":{"image widget":"رەسىمچىك","Wrap text":"","Break text":"","In line":"","Side image":"يان رەسىم","Full size image":"ئەسلى چوڭلۇقتىكى رەسىم","Left aligned image":"سولغا توغۇرلانغان رەسىم","Centered image":"ئوتتۇردىكى رەسىم","Right aligned image":"ئوڭغا توغۇرلانغان رەسىم","Change image text alternative":"رەسىملىك تېكىست تاللىغۇچنى ئۆزگەرتىش","Text alternative":"تېكىست ئاملاشتۇرۇش","Enter image caption":"رەسىمنىڭ تېمىسىنى كىرگۈزۈڭ","Insert image":"رەسىم قىستۇرۇش","Replace image":"","Upload from computer":"","Replace from computer":"","Upload image from computer":"","Image from computer":"","Replace image from computer":"","Upload failed":"چىقىرىش مەغلۇپ بولدى","Image toolbar":"","Resize image":"","Resize image to %0":"","Resize image to the original size":"","Original":"","Image resize list":"","Insert":"قىستۇر","Update":"","Insert image via URL":"","Update image URL":"","Caption for the image":"","Caption for image: %0":""},getPluralForm(n){return (n != 1);}}}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
import type { Translations } from 'ckeditor5';
|
|
7
|
+
declare const translations: Translations;
|
|
8
|
+
export default translations;
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
export default {"uk":{"dictionary":{"image widget":"Віджет зображення","Wrap text":"Обернути текст","Break text":"Розірвати тексту","In line":"В тексті","Side image":"Бокове зображення","Full size image":"Повний розмір зображення","Left aligned image":"Зображення ліворуч","Centered image":"Зображення по центру","Right aligned image":"Зображення праворуч","Change image text alternative":"Змінити текстову альтернативу зображення","Text alternative":"Текстова альтернатива","Enter image caption":"Введіть підпис зображення","Insert image":"Вставити зображення","Replace image":"Замінити зображення","Upload from computer":"Завантажити з комп'ютера","Replace from computer":"Замінити з комп'ютера","Upload image from computer":"Завантажити зображення з комп'ютера","Image from computer":"Зображення з комп'ютера","Replace image from computer":"Замінити зображення з комп'ютера","Upload failed":"Завантаження не вдалось","Image toolbar":"Панелі інструментів зображення","Resize image":"Розтягнути зображення","Resize image to %0":"Розтягнути зображення до %0","Resize image to the original size":"Розтягнути зображення до оригінального розміру","Original":"Оригінал","Image resize list":"Перелік розмірів","Insert":"Вставити","Update":"Оновити","Insert image via URL":"Вставити зображення через посилання","Update image URL":"Оновити посилання на зображення","Caption for the image":"Підпис до зображення","Caption for image: %0":"Підпис до зображення: %0"},getPluralForm(n){return (n % 1 == 0 && n % 10 == 1 && n % 100 != 11 ? 0 : n % 1 == 0 && n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 12 || n % 100 > 14) ? 1 : n % 1 == 0 && (n % 10 ==0 || (n % 10 >=5 && n % 10 <=9) || (n % 100 >=11 && n % 100 <=14 )) ? 2: 3);}}}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
import type { Translations } from 'ckeditor5';
|
|
7
|
+
declare const translations: Translations;
|
|
8
|
+
export default translations;
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
export default {"ur":{"dictionary":{"image widget":"آلۂ عکس","Wrap text":"ملفوف متن","Break text":"متن تقسیم کریں","In line":"","Side image":"عکس بہ پہلو","Full size image":"مکمل پہمائش کا عکس","Left aligned image":"","Centered image":"","Right aligned image":"","Change image text alternative":"","Text alternative":"","Enter image caption":"","Insert image":"","Replace image":"","Upload from computer":"","Replace from computer":"","Upload image from computer":"","Image from computer":"","Replace image from computer":"","Upload failed":"","Image toolbar":"آلہ جات برائے عکس","Resize image":"","Resize image to %0":"","Resize image to the original size":"","Original":"","Image resize list":"","Insert":"","Update":"","Insert image via URL":"","Update image URL":"","Caption for the image":"","Caption for image: %0":""},getPluralForm(n){return (n != 1);}}}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
import type { Translations } from 'ckeditor5';
|
|
7
|
+
declare const translations: Translations;
|
|
8
|
+
export default translations;
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
export default {"uz":{"dictionary":{"image widget":"Tasvirlar vidjeti","Wrap text":"","Break text":"","In line":"","Side image":"Yon tasvir","Full size image":"Asl rasm hajmi","Left aligned image":"Chapga tekislash","Centered image":"Markazga tekislash","Right aligned image":"O'ngga tekislash","Change image text alternative":"Muqobil matnni tahrirlash","Text alternative":"Muqobil matn","Enter image caption":"Rasm sarlavhasi","Insert image":"Rasm kiritish","Replace image":"","Upload from computer":"","Replace from computer":"","Upload image from computer":"","Image from computer":"","Replace image from computer":"","Upload failed":"Yuklab olinmadi","Image toolbar":"Rasm asboblari paneli","Resize image":"Rasm hajmini o'zgartirish","Resize image to %0":"Rasm hajmini %0 ga o‘zgartirish","Resize image to the original size":"Rasmning o'lchamini asl o'lchamiga o'zgartiring","Original":"Asl","Image resize list":"Hajmlar ro'yxati","Insert":"Kiritish","Update":"O'zgartirish","Insert image via URL":"Rasmni URL orqali kiritish","Update image URL":"Rasm URL manzilini o'zgartirish","Caption for the image":"","Caption for image: %0":""},getPluralForm(n){return 0;}}}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
import type { Translations } from 'ckeditor5';
|
|
7
|
+
declare const translations: Translations;
|
|
8
|
+
export default translations;
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
export default {"vi":{"dictionary":{"image widget":"tiện ích ảnh","Wrap text":"Bọc văn bản","Break text":"Ngắt văn bản","In line":"Nội dòng","Side image":"Ảnh một bên","Full size image":"Ảnh đầy đủ","Left aligned image":"Ảnh canh trái","Centered image":"Ảnh canh giữa","Right aligned image":"Ảnh canh phải","Change image text alternative":"Đổi chữ alt của ảnh","Text alternative":"Chữ alt","Enter image caption":"Nhập mô tả ảnh","Insert image":"Chèn ảnh","Replace image":"Thay thế hình ảnh","Upload from computer":"Tải lên từ máy tính","Replace from computer":"Thay thế từ máy tính","Upload image from computer":"Tải hình ảnh lên từ máy tính","Image from computer":"Hình ảnh từ máy tính","Replace image from computer":"Thay thế hình ảnh từ máy tính","Upload failed":"Tải thất bại","Image toolbar":"Thanh công cụ hình ảnh","Resize image":"Chỉnh kích cỡ ảnh","Resize image to %0":"Chỉnh kích cỡ ảnh về %0","Resize image to the original size":"Chỉnh về ảnh kích cỡ nguyên gốc","Original":"Nguyên bản","Image resize list":"Danh sách ảnh đã chỉnh kích thước","Insert":"Chèn","Update":"Cập nhật","Insert image via URL":"Chèn ảnh từ URL","Update image URL":"Cập nhật ảnh từ URL","Caption for the image":"Chú thích cho hình ảnh","Caption for image: %0":"Chú thích cho hình ảnh: %0"},getPluralForm(n){return 0;}}}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
import type { Translations } from 'ckeditor5';
|
|
7
|
+
declare const translations: Translations;
|
|
8
|
+
export default translations;
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
export default {"zh-cn":{"dictionary":{"image widget":"图片组件","Wrap text":"文字环绕","Break text":"文字断行","In line":"行内","Side image":"图片侧边显示","Full size image":"全尺寸图片","Left aligned image":"图片左侧对齐","Centered image":"图片居中","Right aligned image":"图片右侧对齐","Change image text alternative":"更改图片替换文本","Text alternative":"替换文本","Enter image caption":"输入图片标题","Insert image":"插入图像","Replace image":"替换图片","Upload from computer":"从电脑上传","Replace from computer":"从电脑替换","Upload image from computer":"从电脑上传图片","Image from computer":"从计算机中选择图片","Replace image from computer":"从电脑替换图片","Upload failed":"上传失败","Image toolbar":"图片工具栏","Resize image":"调整图像大小","Resize image to %0":"调整图像大小为%0","Resize image to the original size":"调整图像大小为原始大小","Original":"原始大小","Image resize list":"图片大小列表","Insert":"插入","Update":"更新","Insert image via URL":"通过URL地址插入图片","Update image URL":"更新图片URL地址","Caption for the image":"图片说明:","Caption for image: %0":"图片说明:%0"},getPluralForm(n){return 0;}}}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
import type { Translations } from 'ckeditor5';
|
|
7
|
+
declare const translations: Translations;
|
|
8
|
+
export default translations;
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
+
export default {"zh":{"dictionary":{"image widget":"圖片小工具","Wrap text":"文繞圖","Break text":"上及下","In line":"行中","Side image":"側邊圖片","Full size image":"完整尺寸圖片","Left aligned image":"向左對齊圖片","Centered image":"置中圖片","Right aligned image":"向右對齊圖片","Change image text alternative":"修改圖片的替代文字","Text alternative":"替代文字","Enter image caption":"輸入圖片說明","Insert image":"插入圖片","Replace image":"替換圖片","Upload from computer":"從電腦上傳","Replace from computer":"從電腦替換","Upload image from computer":"從電腦上傳圖片","Image from computer":"來自電腦的圖片","Replace image from computer":"從電腦替換圖片","Upload failed":"上傳失敗","Image toolbar":"圖片工具","Resize image":"縮放圖片","Resize image to %0":"縮放圖片到 %0","Resize image to the original size":"縮放圖片到原始尺寸","Original":"原始圖片","Image resize list":"圖片縮放清單","Insert":"插入","Update":"更新","Insert image via URL":"使用連結插入圖片","Update image URL":"更新圖片連結","Caption for the image":"影像的標題","Caption for image: %0":"影像標題:%0"},getPluralForm(n){return 0;}}}
|
|
@@ -0,0 +1,61 @@
|
|
|
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 { ImageConfig, AutoImage, Image, ImageBlock, ImageCaption, ImageInline, ImageInsert, ImageInsertViaUrl, ImageResize, ImageStyle, ImageTextAlternative, ImageToolbar, ImageUpload, ImageUtils, ImageBlockEditing, ImageEditing, ImageCaptionEditing, ImageCaptionUI, ImageCaptionUtils, ImageInsertUI, ImageResizeEditing, ImageCustomResizeUI, ImageSizeAttributes, ImageStyleEditing, ImageStyleUI, ImageTextAlternativeEditing, ImageTextAlternativeUI, ImageUploadEditing, ImageUploadProgress, ImageUploadUI, ImageTypeCommand, InsertImageCommand, ReplaceImageSourceCommand, ToggleImageCaptionCommand, ResizeImageCommand, ImageStyleCommand, ImageTextAlternativeCommand, UploadImageCommand } from './index.js';
|
|
10
|
+
declare module '@ckeditor/ckeditor5-core' {
|
|
11
|
+
interface EditorConfig {
|
|
12
|
+
/**
|
|
13
|
+
* The configuration of the image features. Used by the image features in the `@ckeditor/ckeditor5-image` package.
|
|
14
|
+
*
|
|
15
|
+
* Read more in {@link module:image/imageconfig~ImageConfig}.
|
|
16
|
+
*/
|
|
17
|
+
image?: ImageConfig;
|
|
18
|
+
}
|
|
19
|
+
interface PluginsMap {
|
|
20
|
+
[AutoImage.pluginName]: AutoImage;
|
|
21
|
+
[Image.pluginName]: Image;
|
|
22
|
+
[ImageBlock.pluginName]: ImageBlock;
|
|
23
|
+
[ImageCaption.pluginName]: ImageCaption;
|
|
24
|
+
[ImageInline.pluginName]: ImageInline;
|
|
25
|
+
[ImageInsert.pluginName]: ImageInsert;
|
|
26
|
+
[ImageInsertViaUrl.pluginName]: ImageInsertViaUrl;
|
|
27
|
+
[ImageResize.pluginName]: ImageResize;
|
|
28
|
+
[ImageStyle.pluginName]: ImageStyle;
|
|
29
|
+
[ImageTextAlternative.pluginName]: ImageTextAlternative;
|
|
30
|
+
[ImageToolbar.pluginName]: ImageToolbar;
|
|
31
|
+
[ImageUpload.pluginName]: ImageUpload;
|
|
32
|
+
[ImageUtils.pluginName]: ImageUtils;
|
|
33
|
+
[ImageBlockEditing.pluginName]: ImageBlockEditing;
|
|
34
|
+
[ImageEditing.pluginName]: ImageEditing;
|
|
35
|
+
[ImageCaptionEditing.pluginName]: ImageCaptionEditing;
|
|
36
|
+
[ImageCaptionUI.pluginName]: ImageCaptionUI;
|
|
37
|
+
[ImageCaptionUtils.pluginName]: ImageCaptionUtils;
|
|
38
|
+
[ImageInsertUI.pluginName]: ImageInsertUI;
|
|
39
|
+
[ImageResizeEditing.pluginName]: ImageResizeEditing;
|
|
40
|
+
[ImageCustomResizeUI.pluginName]: ImageCustomResizeUI;
|
|
41
|
+
[ImageSizeAttributes.pluginName]: ImageSizeAttributes;
|
|
42
|
+
[ImageStyleEditing.pluginName]: ImageStyleEditing;
|
|
43
|
+
[ImageStyleUI.pluginName]: ImageStyleUI;
|
|
44
|
+
[ImageTextAlternativeEditing.pluginName]: ImageTextAlternativeEditing;
|
|
45
|
+
[ImageTextAlternativeUI.pluginName]: ImageTextAlternativeUI;
|
|
46
|
+
[ImageUploadEditing.pluginName]: ImageUploadEditing;
|
|
47
|
+
[ImageUploadProgress.pluginName]: ImageUploadProgress;
|
|
48
|
+
[ImageUploadUI.pluginName]: ImageUploadUI;
|
|
49
|
+
}
|
|
50
|
+
interface CommandsMap {
|
|
51
|
+
imageTypeBlock: ImageTypeCommand;
|
|
52
|
+
imageTypeInline: ImageTypeCommand;
|
|
53
|
+
insertImage: InsertImageCommand;
|
|
54
|
+
replaceImageSource: ReplaceImageSourceCommand;
|
|
55
|
+
toggleImageCaption: ToggleImageCaptionCommand;
|
|
56
|
+
resizeImage: ResizeImageCommand;
|
|
57
|
+
imageStyle: ImageStyleCommand;
|
|
58
|
+
imageTextAlternative: ImageTextAlternativeCommand;
|
|
59
|
+
uploadImage: UploadImageCommand;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @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/autoimage
|
|
11
|
+
*/
|
|
12
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
13
|
+
import { Clipboard } from 'ckeditor5/src/clipboard.js';
|
|
14
|
+
import { Undo } from 'ckeditor5/src/undo.js';
|
|
15
|
+
import { Delete } from 'ckeditor5/src/typing.js';
|
|
16
|
+
import ImageUtils from './imageutils.js';
|
|
17
|
+
/**
|
|
18
|
+
* The auto-image plugin. It recognizes image links in the pasted content and embeds
|
|
19
|
+
* them shortly after they are injected into the document.
|
|
20
|
+
*/
|
|
21
|
+
export default class AutoImage extends Plugin {
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get requires(): readonly [typeof Clipboard, typeof ImageUtils, typeof Undo, typeof Delete];
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get pluginName(): "AutoImage";
|
|
30
|
+
/**
|
|
31
|
+
* The paste–to–embed `setTimeout` ID. Stored as a property to allow
|
|
32
|
+
* cleaning of the timeout.
|
|
33
|
+
*/
|
|
34
|
+
private _timeoutId;
|
|
35
|
+
/**
|
|
36
|
+
* The position where the `<imageBlock>` element will be inserted after the timeout,
|
|
37
|
+
* determined each time a new content is pasted into the document.
|
|
38
|
+
*/
|
|
39
|
+
private _positionToInsert;
|
|
40
|
+
/**
|
|
41
|
+
* @inheritDoc
|
|
42
|
+
*/
|
|
43
|
+
constructor(editor: Editor);
|
|
44
|
+
/**
|
|
45
|
+
* @inheritDoc
|
|
46
|
+
*/
|
|
47
|
+
init(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Analyzes the part of the document between provided positions in search for a URL representing an image.
|
|
50
|
+
* When the URL is found, it is automatically converted into an image.
|
|
51
|
+
*
|
|
52
|
+
* @param leftPosition Left position of the selection.
|
|
53
|
+
* @param rightPosition Right position of the selection.
|
|
54
|
+
*/
|
|
55
|
+
private _embedImageBetweenPositions;
|
|
56
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
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/image/converters
|
|
11
|
+
*/
|
|
12
|
+
import type { DowncastDispatcher, UpcastDispatcher } from 'ckeditor5/src/engine.js';
|
|
13
|
+
import type ImageUtils from '../imageutils.js';
|
|
14
|
+
/**
|
|
15
|
+
* Returns a function that converts the image view representation:
|
|
16
|
+
*
|
|
17
|
+
* ```html
|
|
18
|
+
* <figure class="image"><img src="..." alt="..."></img></figure>
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* to the model representation:
|
|
22
|
+
*
|
|
23
|
+
* ```html
|
|
24
|
+
* <imageBlock src="..." alt="..."></imageBlock>
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* The entire content of the `<figure>` element except the first `<img>` is being converted as children
|
|
28
|
+
* of the `<imageBlock>` model element.
|
|
29
|
+
*
|
|
30
|
+
* @internal
|
|
31
|
+
*/
|
|
32
|
+
export declare function upcastImageFigure(imageUtils: ImageUtils): (dispatcher: UpcastDispatcher) => void;
|
|
33
|
+
/**
|
|
34
|
+
* Returns a function that converts the image view representation:
|
|
35
|
+
*
|
|
36
|
+
* ```html
|
|
37
|
+
* <picture><source ... /><source ... />...<img ... /></picture>
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* to the model representation as the `sources` attribute:
|
|
41
|
+
*
|
|
42
|
+
* ```html
|
|
43
|
+
* <image[Block|Inline] ... sources="..."></image[Block|Inline]>
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @internal
|
|
47
|
+
*/
|
|
48
|
+
export declare function upcastPicture(imageUtils: ImageUtils): (dispatcher: UpcastDispatcher) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Converter used to convert the `srcset` model image attribute to the `srcset` and `sizes` attributes in the view.
|
|
51
|
+
*
|
|
52
|
+
* @internal
|
|
53
|
+
* @param imageType The type of the image.
|
|
54
|
+
*/
|
|
55
|
+
export declare function downcastSrcsetAttribute(imageUtils: ImageUtils, imageType: 'imageBlock' | 'imageInline'): (dispatcher: DowncastDispatcher) => void;
|
|
56
|
+
/**
|
|
57
|
+
* Converts the `source` model attribute to the `<picture><source /><source />...<img /></picture>`
|
|
58
|
+
* view structure.
|
|
59
|
+
*
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
export declare function downcastSourcesAttribute(imageUtils: ImageUtils): (dispatcher: DowncastDispatcher) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Converter used to convert a given image attribute from the model to the view.
|
|
65
|
+
*
|
|
66
|
+
* @internal
|
|
67
|
+
* @param imageType The type of the image.
|
|
68
|
+
* @param attributeKey The name of the attribute to convert.
|
|
69
|
+
*/
|
|
70
|
+
export declare function downcastImageAttribute(imageUtils: ImageUtils, imageType: 'imageBlock' | 'imageInline', attributeKey: string): (dispatcher: DowncastDispatcher) => void;
|
|
@@ -0,0 +1,63 @@
|
|
|
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/image/imageblockediting
|
|
11
|
+
*/
|
|
12
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
13
|
+
import { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';
|
|
14
|
+
import ImageEditing from './imageediting.js';
|
|
15
|
+
import ImageSizeAttributes from '../imagesizeattributes.js';
|
|
16
|
+
import ImageUtils from '../imageutils.js';
|
|
17
|
+
import ImagePlaceholder from './imageplaceholder.js';
|
|
18
|
+
/**
|
|
19
|
+
* The image block plugin.
|
|
20
|
+
*
|
|
21
|
+
* It registers:
|
|
22
|
+
*
|
|
23
|
+
* * `<imageBlock>` as a block element in the document schema, and allows `alt`, `src` and `srcset` attributes.
|
|
24
|
+
* * converters for editing and data pipelines.,
|
|
25
|
+
* * {@link module:image/image/imagetypecommand~ImageTypeCommand `'imageTypeBlock'`} command that converts inline images into
|
|
26
|
+
* block images.
|
|
27
|
+
*/
|
|
28
|
+
export default class ImageBlockEditing extends Plugin {
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
static get requires(): readonly [typeof ImageEditing, typeof ImageSizeAttributes, typeof ImageUtils, typeof ImagePlaceholder, typeof ClipboardPipeline];
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
static get pluginName(): "ImageBlockEditing";
|
|
37
|
+
/**
|
|
38
|
+
* @inheritDoc
|
|
39
|
+
*/
|
|
40
|
+
init(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Configures conversion pipelines to support upcasting and downcasting
|
|
43
|
+
* block images (block image widgets) and their attributes.
|
|
44
|
+
*/
|
|
45
|
+
private _setupConversion;
|
|
46
|
+
/**
|
|
47
|
+
* Integrates the plugin with the clipboard pipeline.
|
|
48
|
+
*
|
|
49
|
+
* Idea is that the feature should recognize the user's intent when an **inline** image is
|
|
50
|
+
* pasted or dropped. If such an image is pasted/dropped:
|
|
51
|
+
*
|
|
52
|
+
* * into an empty block (e.g. an empty paragraph),
|
|
53
|
+
* * on another object (e.g. some block widget).
|
|
54
|
+
*
|
|
55
|
+
* it gets converted into a block image on the fly. We assume this is the user's intent
|
|
56
|
+
* if they decided to put their image there.
|
|
57
|
+
*
|
|
58
|
+
* See the `ImageInlineEditing` for the similar integration that works in the opposite direction.
|
|
59
|
+
*
|
|
60
|
+
* The feature also sets image `width` and `height` attributes on paste.
|
|
61
|
+
*/
|
|
62
|
+
private _setupClipboardIntegration;
|
|
63
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @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/image/imageediting
|
|
11
|
+
*/
|
|
12
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
13
|
+
import ImageUtils from '../imageutils.js';
|
|
14
|
+
/**
|
|
15
|
+
* The image engine plugin. This module loads common code shared between
|
|
16
|
+
* {@link module:image/image/imageinlineediting~ImageInlineEditing} and
|
|
17
|
+
* {@link module:image/image/imageblockediting~ImageBlockEditing} plugins.
|
|
18
|
+
*
|
|
19
|
+
* This plugin registers the {@link module:image/image/insertimagecommand~InsertImageCommand 'insertImage'} command.
|
|
20
|
+
*/
|
|
21
|
+
export default class ImageEditing extends Plugin {
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
static get requires(): readonly [typeof ImageUtils];
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
static get pluginName(): "ImageEditing";
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
init(): void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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/image/imageinlineediting
|
|
11
|
+
*/
|
|
12
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
13
|
+
import { ClipboardPipeline } from 'ckeditor5/src/clipboard.js';
|
|
14
|
+
import ImageEditing from './imageediting.js';
|
|
15
|
+
import ImageSizeAttributes from '../imagesizeattributes.js';
|
|
16
|
+
import ImageUtils from '../imageutils.js';
|
|
17
|
+
import ImagePlaceholder from './imageplaceholder.js';
|
|
18
|
+
/**
|
|
19
|
+
* The image inline plugin.
|
|
20
|
+
*
|
|
21
|
+
* It registers:
|
|
22
|
+
*
|
|
23
|
+
* * `<imageInline>` as an inline element in the document schema, and allows `alt`, `src` and `srcset` attributes.
|
|
24
|
+
* * converters for editing and data pipelines.
|
|
25
|
+
* * {@link module:image/image/imagetypecommand~ImageTypeCommand `'imageTypeInline'`} command that converts block images into
|
|
26
|
+
* inline images.
|
|
27
|
+
*/
|
|
28
|
+
export default class ImageInlineEditing extends Plugin {
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
static get requires(): readonly [typeof ImageEditing, typeof ImageSizeAttributes, typeof ImageUtils, typeof ImagePlaceholder, typeof ClipboardPipeline];
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
static get pluginName(): "ImageInlineEditing";
|
|
37
|
+
/**
|
|
38
|
+
* @inheritDoc
|
|
39
|
+
*/
|
|
40
|
+
init(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Configures conversion pipelines to support upcasting and downcasting
|
|
43
|
+
* inline images (inline image widgets) and their attributes.
|
|
44
|
+
*/
|
|
45
|
+
private _setupConversion;
|
|
46
|
+
/**
|
|
47
|
+
* Integrates the plugin with the clipboard pipeline.
|
|
48
|
+
*
|
|
49
|
+
* Idea is that the feature should recognize the user's intent when an **block** image is
|
|
50
|
+
* pasted or dropped. If such an image is pasted/dropped into a non-empty block
|
|
51
|
+
* (e.g. a paragraph with some text) it gets converted into an inline image on the fly.
|
|
52
|
+
*
|
|
53
|
+
* We assume this is the user's intent if they decided to put their image there.
|
|
54
|
+
*
|
|
55
|
+
* **Note**: If a block image has a caption, it will not be converted to an inline image
|
|
56
|
+
* to avoid the confusion. Captions are added on purpose and they should never be lost
|
|
57
|
+
* in the clipboard pipeline.
|
|
58
|
+
*
|
|
59
|
+
* See the `ImageBlockEditing` for the similar integration that works in the opposite direction.
|
|
60
|
+
*
|
|
61
|
+
* The feature also sets image `width` and `height` attributes when pasting.
|
|
62
|
+
*/
|
|
63
|
+
private _setupClipboardIntegration;
|
|
64
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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/image/imageloadobserver
|
|
11
|
+
*/
|
|
12
|
+
import { Observer } from 'ckeditor5/src/engine.js';
|
|
13
|
+
/**
|
|
14
|
+
* Observes all new images added to the {@link module:engine/view/document~Document},
|
|
15
|
+
* fires {@link module:engine/view/document~Document#event:imageLoaded} and
|
|
16
|
+
* {@link module:engine/view/document~Document#event:layoutChanged} event every time when the new image
|
|
17
|
+
* has been loaded.
|
|
18
|
+
*
|
|
19
|
+
* **Note:** This event is not fired for images that has been added to the document and rendered as `complete` (already loaded).
|
|
20
|
+
*/
|
|
21
|
+
export default class ImageLoadObserver extends Observer {
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
observe(domRoot: HTMLElement): void;
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
stopObserving(domRoot: HTMLElement): void;
|
|
30
|
+
/**
|
|
31
|
+
* Fires {@link module:engine/view/document~Document#event:layoutChanged} and
|
|
32
|
+
* {@link module:engine/view/document~Document#event:imageLoaded}
|
|
33
|
+
* if observer {@link #isEnabled is enabled}.
|
|
34
|
+
*
|
|
35
|
+
* @param domEvent The DOM event.
|
|
36
|
+
*/
|
|
37
|
+
private _fireEvents;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Fired when an <img/> DOM element has been loaded in the DOM root.
|
|
41
|
+
*
|
|
42
|
+
* Introduced by {@link module:image/image/imageloadobserver~ImageLoadObserver}.
|
|
43
|
+
*
|
|
44
|
+
* @see module:image/image/imageloadobserver~ImageLoadObserver
|
|
45
|
+
*
|
|
46
|
+
* @eventName module:engine/view/document~Document#imageLoaded
|
|
47
|
+
* @param data Event data.
|
|
48
|
+
*/
|
|
49
|
+
export type ImageLoadedEvent = {
|
|
50
|
+
name: 'imageLoaded';
|
|
51
|
+
args: [Event];
|
|
52
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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/image/imageplaceholder
|
|
11
|
+
*/
|
|
12
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
13
|
+
import ImageUtils from '../imageutils.js';
|
|
14
|
+
import '../../theme/imageplaceholder.css';
|
|
15
|
+
/**
|
|
16
|
+
* Adds support for image placeholder that is automatically removed when the image is loaded.
|
|
17
|
+
*/
|
|
18
|
+
export default class ImagePlaceholder extends Plugin {
|
|
19
|
+
/**
|
|
20
|
+
* @inheritDoc
|
|
21
|
+
*/
|
|
22
|
+
static get requires(): readonly [typeof ImageUtils];
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get pluginName(): "ImagePlaceholder";
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
afterInit(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Extends model schema.
|
|
33
|
+
*/
|
|
34
|
+
private _setupSchema;
|
|
35
|
+
/**
|
|
36
|
+
* Registers converters.
|
|
37
|
+
*/
|
|
38
|
+
private _setupConversion;
|
|
39
|
+
/**
|
|
40
|
+
* Prepares listener for image load.
|
|
41
|
+
*/
|
|
42
|
+
private _setupLoadListener;
|
|
43
|
+
}
|