@webstudio-is/image 0.254.0 → 0.257.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/lib/index.js +4 -1
- package/package.json +3 -2
package/lib/index.js
CHANGED
|
@@ -69,7 +69,7 @@ var getInt = (value) => {
|
|
|
69
69
|
return Math.round(vNum);
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
return
|
|
72
|
+
return;
|
|
73
73
|
};
|
|
74
74
|
var DEFAULT_SIZES = "(min-width: 1280px) 50vw, 100vw";
|
|
75
75
|
var DEFAULT_QUALITY = 80;
|
|
@@ -88,6 +88,9 @@ var getImageAttributes = (props) => {
|
|
|
88
88
|
0
|
|
89
89
|
);
|
|
90
90
|
if (props.src != null && props.src !== "") {
|
|
91
|
+
if (props.src.startsWith("data:")) {
|
|
92
|
+
return { src: props.src };
|
|
93
|
+
}
|
|
91
94
|
if (props.srcSet == null && props.optimize) {
|
|
92
95
|
const sizes = props.sizes ?? (props.width == null ? DEFAULT_SIZES : void 0);
|
|
93
96
|
return generateImgAttrs({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/image",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.257.0",
|
|
4
4
|
"description": "Image optimization",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"dependencies": {
|
|
9
9
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
10
10
|
"warn-once": "^0.1.1",
|
|
11
|
-
"@webstudio-is/sdk": "0.
|
|
11
|
+
"@webstudio-is/sdk": "0.257.0"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
14
|
"@types/react": "^18.2.70",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
17
17
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
18
18
|
"vitest": "^3.1.2",
|
|
19
|
+
"@webstudio-is/design-system": "0.0.0",
|
|
19
20
|
"@webstudio-is/tsconfig": "1.0.7"
|
|
20
21
|
},
|
|
21
22
|
"peerDependencies": {
|