@cntrl-site/sdk 1.21.0-alpha.4 → 1.21.0-alpha.5

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/dist/index.js CHANGED
@@ -1331,7 +1331,14 @@ const styles = {
1331
1331
  img
1332
1332
  };
1333
1333
  const SvgImage = ({ url: url2, fill = "#000000", hoverFill = "#CCCCCC", className = "" }) => {
1334
- if (!url2.endsWith(".svg")) {
1334
+ const [supportsMask, setSupportsMask] = react.useState(true);
1335
+ react.useEffect(() => {
1336
+ if (typeof window !== "undefined" && window.CSS) {
1337
+ const supported = CSS.supports("mask-image", 'url("")') || CSS.supports("-webkit-mask-image", 'url("")');
1338
+ setSupportsMask(supported);
1339
+ }
1340
+ }, []);
1341
+ if (!url2.endsWith(".svg") || !supportsMask) {
1335
1342
  return /* @__PURE__ */ jsxRuntime.jsx("img", { src: url2, alt: "", className: cn(styles.img, className) });
1336
1343
  }
1337
1344
  return /* @__PURE__ */ jsxRuntime.jsx(
package/dist/index.mjs CHANGED
@@ -1312,7 +1312,14 @@ const styles = {
1312
1312
  img
1313
1313
  };
1314
1314
  const SvgImage = ({ url, fill = "#000000", hoverFill = "#CCCCCC", className = "" }) => {
1315
- if (!url.endsWith(".svg")) {
1315
+ const [supportsMask, setSupportsMask] = useState(true);
1316
+ useEffect(() => {
1317
+ if (typeof window !== "undefined" && window.CSS) {
1318
+ const supported = CSS.supports("mask-image", 'url("")') || CSS.supports("-webkit-mask-image", 'url("")');
1319
+ setSupportsMask(supported);
1320
+ }
1321
+ }, []);
1322
+ if (!url.endsWith(".svg") || !supportsMask) {
1316
1323
  return /* @__PURE__ */ jsx("img", { src: url, alt: "", className: cn(styles.img, className) });
1317
1324
  }
1318
1325
  return /* @__PURE__ */ jsx(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cntrl-site/sdk",
3
- "version": "1.21.0-alpha.4",
3
+ "version": "1.21.0-alpha.5",
4
4
  "description": "Generic SDK for use in public websites.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",