@ckeditor/ckeditor5-image 44.2.0-alpha.16 → 44.2.0-alpha.3
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 +12 -9
- 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.3",
|
|
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.3",
|
|
17
|
+
"@ckeditor/ckeditor5-core": "44.2.0-alpha.3",
|
|
18
|
+
"@ckeditor/ckeditor5-engine": "44.2.0-alpha.3",
|
|
19
|
+
"@ckeditor/ckeditor5-typing": "44.2.0-alpha.3",
|
|
20
|
+
"@ckeditor/ckeditor5-ui": "44.2.0-alpha.3",
|
|
21
|
+
"@ckeditor/ckeditor5-undo": "44.2.0-alpha.3",
|
|
22
|
+
"@ckeditor/ckeditor5-upload": "44.2.0-alpha.3",
|
|
23
|
+
"@ckeditor/ckeditor5-utils": "44.2.0-alpha.3",
|
|
24
|
+
"@ckeditor/ckeditor5-widget": "44.2.0-alpha.3",
|
|
25
|
+
"ckeditor5": "44.2.0-alpha.3",
|
|
26
26
|
"lodash-es": "4.17.21"
|
|
27
27
|
},
|
|
28
28
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -128,12 +128,6 @@ 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
|
-
}
|
|
137
131
|
// Do not set aspect-ratio for pictures. See https://github.com/ckeditor/ckeditor5/issues/14579.
|
|
138
132
|
if (data.item.hasAttribute('sources')) {
|
|
139
133
|
return;
|
|
@@ -143,8 +137,14 @@ export default class ImageSizeAttributes extends Plugin {
|
|
|
143
137
|
if (imageType === 'imageInline' && !isResized && !setRatioForInlineImage) {
|
|
144
138
|
return;
|
|
145
139
|
}
|
|
146
|
-
|
|
147
|
-
|
|
140
|
+
const width = data.item.getAttribute('width');
|
|
141
|
+
const height = data.item.getAttribute('height');
|
|
142
|
+
if (!width || !height) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
viewWriter.setStyle('aspect-ratio', `${width}/${height}`, img);
|
|
146
|
+
if (isEditingDowncast) {
|
|
147
|
+
viewWriter.setAttribute('loading', 'lazy', img);
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
150
|
}
|