@eclass/ui-kit 1.46.1 → 1.46.3
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/eclass-ui-kit.es.js
CHANGED
|
@@ -29923,8 +29923,6 @@ function Accessibility(props) {
|
|
|
29923
29923
|
height: "16",
|
|
29924
29924
|
viewBox: "0 0 16 16",
|
|
29925
29925
|
fill: "none",
|
|
29926
|
-
stroke: "#60798E",
|
|
29927
|
-
strokeWidth: 0.5,
|
|
29928
29926
|
children: /* @__PURE__ */ jsx("path", {
|
|
29929
29927
|
fillRule: "evenodd",
|
|
29930
29928
|
clipRule: "evenodd",
|
|
@@ -29934,51 +29932,11 @@ function Accessibility(props) {
|
|
|
29934
29932
|
})
|
|
29935
29933
|
});
|
|
29936
29934
|
}
|
|
29937
|
-
|
|
29938
|
-
|
|
29939
|
-
const
|
|
29940
|
-
|
|
29941
|
-
|
|
29942
|
-
} else {
|
|
29943
|
-
requestAnimationFrame(checkUserWay);
|
|
29944
|
-
}
|
|
29945
|
-
};
|
|
29946
|
-
try {
|
|
29947
|
-
checkUserWay();
|
|
29948
|
-
} catch (error) {
|
|
29949
|
-
reject(new Error("UserWay script failed to load"));
|
|
29950
|
-
}
|
|
29951
|
-
});
|
|
29952
|
-
};
|
|
29953
|
-
function UserWay({
|
|
29954
|
-
accountId,
|
|
29955
|
-
color: color2 = "#0189FF"
|
|
29956
|
-
}) {
|
|
29957
|
-
const [isUserWayReady, setIsUserWayReady] = useState(false);
|
|
29958
|
-
useEffect(() => {
|
|
29959
|
-
if (!document.getElementById("userway-script")) {
|
|
29960
|
-
const script = document.createElement("script");
|
|
29961
|
-
script.id = "userway-script";
|
|
29962
|
-
script.src = "https://cdn.userway.org/widget.js";
|
|
29963
|
-
script.async = true;
|
|
29964
|
-
script.setAttribute("data-account", accountId);
|
|
29965
|
-
script.setAttribute("data-color", color2);
|
|
29966
|
-
script.setAttribute("data-trigger", "customTrigger");
|
|
29967
|
-
document.body.appendChild(script);
|
|
29968
|
-
}
|
|
29969
|
-
waitForUserWay().then(() => {
|
|
29970
|
-
setIsUserWayReady(true);
|
|
29971
|
-
return void 0;
|
|
29972
|
-
}).catch((error) => {
|
|
29973
|
-
console.error("Failed to load UserWay:", error);
|
|
29974
|
-
});
|
|
29975
|
-
}, [accountId, color2]);
|
|
29976
|
-
const handleButtonClick = () => {
|
|
29977
|
-
var _a;
|
|
29978
|
-
if (isUserWayReady && ((_a = window == null ? void 0 : window.UserWay) == null ? void 0 : _a.widgetOpen)) {
|
|
29979
|
-
window.UserWay.widgetOpen();
|
|
29980
|
-
} else {
|
|
29981
|
-
console.error("UserWay script not loaded yet.");
|
|
29935
|
+
function UserWay() {
|
|
29936
|
+
const triggerWidget = () => {
|
|
29937
|
+
const buttonB = document.getElementById("userWayTrigger");
|
|
29938
|
+
if (buttonB == null ? void 0 : buttonB.click) {
|
|
29939
|
+
buttonB.click();
|
|
29982
29940
|
}
|
|
29983
29941
|
};
|
|
29984
29942
|
return /* @__PURE__ */ jsx(Box, {
|
|
@@ -29989,13 +29947,14 @@ function UserWay({
|
|
|
29989
29947
|
border: "1px solid transparent",
|
|
29990
29948
|
display: "flex",
|
|
29991
29949
|
height: "30px",
|
|
29992
|
-
id: "
|
|
29950
|
+
id: "UserWayButton",
|
|
29993
29951
|
justifyContent: "center",
|
|
29994
|
-
|
|
29952
|
+
padding: "0 8px",
|
|
29995
29953
|
width: "30px",
|
|
29996
29954
|
_hover: {
|
|
29997
29955
|
background: "rgba(96, 121, 142, 0.8)"
|
|
29998
29956
|
},
|
|
29957
|
+
onClick: triggerWidget,
|
|
29999
29958
|
children: /* @__PURE__ */ jsx(Accessibility, {})
|
|
30000
29959
|
});
|
|
30001
29960
|
}
|