@eclass/ui-kit 1.57.9 → 1.57.10
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 +21 -2
- package/dist/eclass-ui-kit.es.js.map +1 -1
- package/dist/eclass-ui-kit.umd.js +3 -3
- package/dist/eclass-ui-kit.umd.js.map +1 -1
- package/dist/organisms/Modals/ModalAlert/ModalAlertContent.d.ts.map +1 -1
- package/dist/tsconfig.types.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/eclass-ui-kit.es.js
CHANGED
|
@@ -7331,7 +7331,7 @@ function FlashNotification({
|
|
|
7331
7331
|
duration: ["success", "info"].includes(state) ? handleTime(message) : Infinity,
|
|
7332
7332
|
id: alertStates[state].id
|
|
7333
7333
|
});
|
|
7334
|
-
}, [message, state, m2]);
|
|
7334
|
+
}, [message, state, m2, isMobile]);
|
|
7335
7335
|
useEffect(() => {
|
|
7336
7336
|
if (show) {
|
|
7337
7337
|
showToast();
|
|
@@ -7622,6 +7622,25 @@ const Loading$1 = ({
|
|
|
7622
7622
|
})]
|
|
7623
7623
|
});
|
|
7624
7624
|
};
|
|
7625
|
+
const sanitizeModalDescription = (description) => {
|
|
7626
|
+
const sanitizedDescription = purify.sanitize(description, {
|
|
7627
|
+
ADD_ATTR: ["target", "rel"]
|
|
7628
|
+
});
|
|
7629
|
+
const parsedDocument = new window.DOMParser().parseFromString(sanitizedDescription, "text/html");
|
|
7630
|
+
parsedDocument.querySelectorAll('a[target="_blank"]').forEach((anchor) => {
|
|
7631
|
+
var _a;
|
|
7632
|
+
const currentRel = (_a = anchor.getAttribute("rel")) != null ? _a : "";
|
|
7633
|
+
const relTokens = currentRel.split(/\s+/).filter(Boolean);
|
|
7634
|
+
if (!relTokens.includes("noopener")) {
|
|
7635
|
+
relTokens.push("noopener");
|
|
7636
|
+
}
|
|
7637
|
+
if (!relTokens.includes("noreferrer")) {
|
|
7638
|
+
relTokens.push("noreferrer");
|
|
7639
|
+
}
|
|
7640
|
+
anchor.setAttribute("rel", relTokens.join(" "));
|
|
7641
|
+
});
|
|
7642
|
+
return parsedDocument.body.innerHTML;
|
|
7643
|
+
};
|
|
7625
7644
|
const ModalAlertContent = ({
|
|
7626
7645
|
type,
|
|
7627
7646
|
title,
|
|
@@ -7630,7 +7649,7 @@ const ModalAlertContent = ({
|
|
|
7630
7649
|
children
|
|
7631
7650
|
}) => {
|
|
7632
7651
|
const [isDesktop] = useMediaQuery("(min-width: 641px)");
|
|
7633
|
-
const descriptionParsed = typeof description === "string" ? ReactParser(
|
|
7652
|
+
const descriptionParsed = typeof description === "string" ? ReactParser(sanitizeModalDescription(description)) : description;
|
|
7634
7653
|
return /* @__PURE__ */ jsxs(Fragment, {
|
|
7635
7654
|
children: [/* @__PURE__ */ jsxs(ModalBody, {
|
|
7636
7655
|
p: "32px",
|