@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 +8 -1
- package/dist/index.mjs +8 -1
- package/package.json +1 -1
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
|
-
|
|
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
|
-
|
|
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(
|