@raketa-builder/support 1.4.21 → 1.4.22

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.
Files changed (2) hide show
  1. package/dist/Image.js +6 -6
  2. package/package.json +1 -1
package/dist/Image.js CHANGED
@@ -44,15 +44,15 @@ const getAlt = (src) => {
44
44
  }
45
45
  return "";
46
46
  };
47
- const getSrc = (src, variant, supportedFormats) => {
47
+ const getSrc = (src, variant, optimizedFormats) => {
48
48
  var _a, _b, _c;
49
49
  if (typeof src === "object") {
50
50
  if (((_a = src == null ? void 0 : src.name) == null ? void 0 : _a.includes(".svg")) || ((_b = src == null ? void 0 : src.name) == null ? void 0 : _b.includes(".gif"))) {
51
51
  return [null, null, (_c = src.urls) == null ? void 0 : _c.original];
52
52
  }
53
53
  const fallback = src.urls[variant];
54
- const webp = supportedFormats.includes("webp") ? getWebp(fallback) : null;
55
- const avif = supportedFormats.includes("avif") ? getAvif(fallback) : null;
54
+ const webp = optimizedFormats.includes("webp") ? getWebp(fallback) : null;
55
+ const avif = optimizedFormats.includes("avif") ? getAvif(fallback) : null;
56
56
  return [webp, avif, fallback];
57
57
  }
58
58
  return [null, null, src];
@@ -70,13 +70,13 @@ const Image = (_a) => {
70
70
  src,
71
71
  alt,
72
72
  loading = "lazy",
73
- supportedFormats = ["webp", "avif"]
73
+ optimizedFormats = ["webp", "avif"]
74
74
  } = _b, props = __objRest(_b, [
75
75
  "variant",
76
76
  "src",
77
77
  "alt",
78
78
  "loading",
79
- "supportedFormats"
79
+ "optimizedFormats"
80
80
  ]);
81
81
  if (!variant) {
82
82
  console.error("Image with no variant", { variant, src, alt, props });
@@ -96,7 +96,7 @@ const Image = (_a) => {
96
96
  const [webp, avif, fallback] = getSrc(
97
97
  imageObjOrSrc,
98
98
  variant,
99
- supportedFormats
99
+ optimizedFormats
100
100
  );
101
101
  return /* @__PURE__ */ jsxs("picture", { children: [
102
102
  avif && /* @__PURE__ */ jsx("source", { srcSet: encodeURI(avif), type: "image/avif" }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raketa-builder/support",
3
- "version": "1.4.21",
3
+ "version": "1.4.22",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "types": "./dist/index.d.ts",