@ckeditor/ckeditor5-image 44.2.0-alpha.1 → 44.2.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/image.js +1 -1
- package/dist/index.js +9 -12
- package/dist/index.js.map +1 -1
- package/package.json +11 -11
- package/src/imagesizeattributes.js +8 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-image",
|
|
3
|
-
"version": "44.2.0-alpha.
|
|
3
|
+
"version": "44.2.0-alpha.10",
|
|
4
4
|
"description": "Image feature for CKEditor 5.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ckeditor",
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
"type": "module",
|
|
14
14
|
"main": "src/index.js",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@ckeditor/ckeditor5-clipboard": "44.2.0-alpha.
|
|
17
|
-
"@ckeditor/ckeditor5-core": "44.2.0-alpha.
|
|
18
|
-
"@ckeditor/ckeditor5-engine": "44.2.0-alpha.
|
|
19
|
-
"@ckeditor/ckeditor5-typing": "44.2.0-alpha.
|
|
20
|
-
"@ckeditor/ckeditor5-ui": "44.2.0-alpha.
|
|
21
|
-
"@ckeditor/ckeditor5-undo": "44.2.0-alpha.
|
|
22
|
-
"@ckeditor/ckeditor5-upload": "44.2.0-alpha.
|
|
23
|
-
"@ckeditor/ckeditor5-utils": "44.2.0-alpha.
|
|
24
|
-
"@ckeditor/ckeditor5-widget": "44.2.0-alpha.
|
|
25
|
-
"ckeditor5": "44.2.0-alpha.
|
|
16
|
+
"@ckeditor/ckeditor5-clipboard": "44.2.0-alpha.10",
|
|
17
|
+
"@ckeditor/ckeditor5-core": "44.2.0-alpha.10",
|
|
18
|
+
"@ckeditor/ckeditor5-engine": "44.2.0-alpha.10",
|
|
19
|
+
"@ckeditor/ckeditor5-typing": "44.2.0-alpha.10",
|
|
20
|
+
"@ckeditor/ckeditor5-ui": "44.2.0-alpha.10",
|
|
21
|
+
"@ckeditor/ckeditor5-undo": "44.2.0-alpha.10",
|
|
22
|
+
"@ckeditor/ckeditor5-upload": "44.2.0-alpha.10",
|
|
23
|
+
"@ckeditor/ckeditor5-utils": "44.2.0-alpha.10",
|
|
24
|
+
"@ckeditor/ckeditor5-widget": "44.2.0-alpha.10",
|
|
25
|
+
"ckeditor5": "44.2.0-alpha.10",
|
|
26
26
|
"lodash-es": "4.17.21"
|
|
27
27
|
},
|
|
28
28
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -128,6 +128,12 @@ export default class ImageSizeAttributes extends Plugin {
|
|
|
128
128
|
else {
|
|
129
129
|
viewWriter.removeAttribute(viewAttributeName, img);
|
|
130
130
|
}
|
|
131
|
+
const width = data.item.getAttribute('width');
|
|
132
|
+
const height = data.item.getAttribute('height');
|
|
133
|
+
const hasSizes = width && height;
|
|
134
|
+
if (hasSizes && isEditingDowncast) {
|
|
135
|
+
viewWriter.setAttribute('loading', 'lazy', img);
|
|
136
|
+
}
|
|
131
137
|
// Do not set aspect-ratio for pictures. See https://github.com/ckeditor/ckeditor5/issues/14579.
|
|
132
138
|
if (data.item.hasAttribute('sources')) {
|
|
133
139
|
return;
|
|
@@ -137,14 +143,8 @@ export default class ImageSizeAttributes extends Plugin {
|
|
|
137
143
|
if (imageType === 'imageInline' && !isResized && !setRatioForInlineImage) {
|
|
138
144
|
return;
|
|
139
145
|
}
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
if (!width || !height) {
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
viewWriter.setStyle('aspect-ratio', `${width}/${height}`, img);
|
|
146
|
-
if (isEditingDowncast) {
|
|
147
|
-
viewWriter.setAttribute('loading', 'lazy', img);
|
|
146
|
+
if (hasSizes) {
|
|
147
|
+
viewWriter.setStyle('aspect-ratio', `${width}/${height}`, img);
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
150
|
}
|