@webstudio-is/image 0.167.0 → 0.168.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 CHANGED
@@ -179,6 +179,12 @@ var createImageLoader = (loaderOptions) => (props) => {
179
179
  searchParams.set("width", width.toString());
180
180
  searchParams.set("quality", quality.toString());
181
181
  searchParams.set("format", format ?? "auto");
182
+ if (props.format !== "raw" && props.height != null) {
183
+ searchParams.set("height", props.height.toString());
184
+ }
185
+ if (props.format !== "raw" && props.fit != null) {
186
+ searchParams.set("fit", props.fit);
187
+ }
182
188
  return `${imageBaseUrl}${src}?${searchParams.toString()}`;
183
189
  };
184
190
  export {
@@ -89,6 +89,8 @@ export type ImageLoader = (props: {
89
89
  quality: number;
90
90
  src: string;
91
91
  format?: "auto";
92
+ height?: number;
93
+ fit?: "pad";
92
94
  } | {
93
95
  src: string;
94
96
  format: "raw";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webstudio-is/image",
3
- "version": "0.167.0",
3
+ "version": "0.168.0",
4
4
  "description": "Image optimization",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -16,8 +16,8 @@
16
16
  "react": "18.3.0-canary-14898b6a9-20240318",
17
17
  "react-dom": "18.3.0-canary-14898b6a9-20240318",
18
18
  "typescript": "5.4.5",
19
- "@webstudio-is/tsconfig": "1.0.7",
20
- "@webstudio-is/jest-config": "1.0.7"
19
+ "@webstudio-is/jest-config": "1.0.7",
20
+ "@webstudio-is/tsconfig": "1.0.7"
21
21
  },
22
22
  "peerDependencies": {
23
23
  "react": "18.3.0-canary-14898b6a9-20240318",