@webstudio-is/image 0.110.0 → 0.111.1-0d68965.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 +8 -5
- package/lib/types/image-optimize.d.ts +4 -1
- package/package.json +4 -4
package/lib/index.js
CHANGED
|
@@ -140,26 +140,29 @@ var imagePlaceholderSvg = `data:image/svg+xml;base64,${btoa(`<svg
|
|
|
140
140
|
fill="none"
|
|
141
141
|
xmlns="http://www.w3.org/2000/svg"
|
|
142
142
|
>
|
|
143
|
-
<rect width="600" height="600"
|
|
143
|
+
<rect width="600" height="600" />
|
|
144
144
|
<path
|
|
145
145
|
fill-rule="evenodd"
|
|
146
146
|
clip-rule="evenodd"
|
|
147
147
|
d="M450 170H150C141.716 170 135 176.716 135 185V415C135 423.284 141.716 430 150 430H450C458.284 430 465 423.284 465 415V185C465 176.716 458.284 170 450 170ZM150 145C127.909 145 110 162.909 110 185V415C110 437.091 127.909 455 150 455H450C472.091 455 490 437.091 490 415V185C490 162.909 472.091 145 450 145H150Z"
|
|
148
|
-
fill="#
|
|
148
|
+
fill="#C1C8CD"
|
|
149
149
|
/>
|
|
150
150
|
<path
|
|
151
151
|
d="M237.135 235.012C237.135 255.723 220.345 272.512 199.635 272.512C178.924 272.512 162.135 255.723 162.135 235.012C162.135 214.301 178.924 197.512 199.635 197.512C220.345 197.512 237.135 214.301 237.135 235.012Z"
|
|
152
|
-
fill="#
|
|
152
|
+
fill="#C1C8CD"
|
|
153
153
|
/>
|
|
154
154
|
<path
|
|
155
155
|
d="M160 405V367.205L221.609 306.364L256.552 338.628L358.161 234L440 316.043V405H160Z"
|
|
156
|
-
fill="#
|
|
156
|
+
fill="#C1C8CD"
|
|
157
157
|
/>
|
|
158
158
|
</svg>`)}`;
|
|
159
159
|
|
|
160
160
|
// src/image-loaders.ts
|
|
161
161
|
import warnOnce from "warn-once";
|
|
162
|
-
var createImageLoader = (loaderOptions) => (
|
|
162
|
+
var createImageLoader = (loaderOptions) => (props) => {
|
|
163
|
+
const width = props.format === "raw" ? 16 : props.width;
|
|
164
|
+
const quality = props.format === "raw" ? 100 : props.quality;
|
|
165
|
+
const { format, src } = props;
|
|
163
166
|
if (true) {
|
|
164
167
|
warnOnce(
|
|
165
168
|
allSizes.includes(width) === false,
|
|
@@ -88,7 +88,10 @@ export type ImageLoader = (props: {
|
|
|
88
88
|
width: number;
|
|
89
89
|
quality: number;
|
|
90
90
|
src: string;
|
|
91
|
-
format?: "auto"
|
|
91
|
+
format?: "auto";
|
|
92
|
+
} | {
|
|
93
|
+
src: string;
|
|
94
|
+
format: "raw";
|
|
92
95
|
}) => string;
|
|
93
96
|
export declare const allSizes: number[];
|
|
94
97
|
export declare const getImageAttributes: (props: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/image",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.111.1-0d68965.0",
|
|
4
4
|
"description": "Image optimization",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"react": "^18.2.0",
|
|
17
17
|
"react-dom": "^18.2.0",
|
|
18
18
|
"typescript": "5.2.2",
|
|
19
|
-
"@webstudio-is/jest-config": "1.0.
|
|
20
|
-
"@webstudio-is/storybook-config": "0.0.0",
|
|
21
|
-
"@webstudio-is/tsconfig": "1.0.
|
|
19
|
+
"@webstudio-is/jest-config": "1.0.8-0d68965.0",
|
|
20
|
+
"@webstudio-is/storybook-config": "0.0.1-0d68965.0",
|
|
21
|
+
"@webstudio-is/tsconfig": "1.0.8-0d68965.0"
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"react": "^18.2.0",
|