wealth-alpha-chat-widget 2.0.7 → 2.0.8
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.cjs +23 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +23 -15
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -777,11 +777,17 @@ function AuthGate({ brandName, loginUrl, onLoginClick }) {
|
|
|
777
777
|
}
|
|
778
778
|
var HOME_ICON = '<path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/>';
|
|
779
779
|
var BACK_ICON = '<line x1="19" y1="12" x2="5" y2="12"/><polyline points="12 19 5 12 12 5"/>';
|
|
780
|
+
var PREV_ICON = '<polyline points="15 18 9 12 15 6"/>';
|
|
781
|
+
var NEXT_ICON = '<polyline points="9 18 15 12 9 6"/>';
|
|
780
782
|
var EMOJI_RE = /[\u{1F000}-\u{1FAFF}\u{2190}-\u{21FF}\u{2300}-\u{27BF}\u{2B00}-\u{2BFF}\u{FE00}-\u{FE0F}\u{1F1E6}-\u{1F1FF}\u{20E3}]/gu;
|
|
781
783
|
var stripEmoji = (s) => s.replace(EMOJI_RE, "").replace(/\s{2,}/g, " ").trim();
|
|
782
784
|
function navIconFor(chip) {
|
|
783
|
-
if (chip.id === "__root__") return HOME_ICON;
|
|
784
|
-
if (chip.label.trim() === "Back") return BACK_ICON;
|
|
785
|
+
if (chip.id === "__root__") return { svg: HOME_ICON, trailing: false };
|
|
786
|
+
if (chip.label.trim() === "Back") return { svg: BACK_ICON, trailing: false };
|
|
787
|
+
if (chip.id.includes("_page:")) {
|
|
788
|
+
const isPrev = /prev/i.test(chip.label);
|
|
789
|
+
return { svg: isPrev ? PREV_ICON : NEXT_ICON, trailing: !isPrev };
|
|
790
|
+
}
|
|
785
791
|
return null;
|
|
786
792
|
}
|
|
787
793
|
function Chip({ chip, disabled, active, onClick }) {
|
|
@@ -792,6 +798,18 @@ function Chip({ chip, disabled, active, onClick }) {
|
|
|
792
798
|
].filter(Boolean).join(" ");
|
|
793
799
|
const navIcon = navIconFor(chip);
|
|
794
800
|
const label = stripEmoji(chip.label);
|
|
801
|
+
const iconEl = navIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: chat_default.chipIcon, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
802
|
+
"svg",
|
|
803
|
+
{
|
|
804
|
+
viewBox: "0 0 24 24",
|
|
805
|
+
fill: "none",
|
|
806
|
+
stroke: "currentColor",
|
|
807
|
+
strokeWidth: 2,
|
|
808
|
+
strokeLinecap: "round",
|
|
809
|
+
strokeLinejoin: "round",
|
|
810
|
+
dangerouslySetInnerHTML: { __html: navIcon.svg }
|
|
811
|
+
}
|
|
812
|
+
) }) : null;
|
|
795
813
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
796
814
|
"button",
|
|
797
815
|
{
|
|
@@ -800,19 +818,9 @@ function Chip({ chip, disabled, active, onClick }) {
|
|
|
800
818
|
disabled,
|
|
801
819
|
onClick: () => !disabled && onClick(chip),
|
|
802
820
|
children: [
|
|
803
|
-
navIcon
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
viewBox: "0 0 24 24",
|
|
807
|
-
fill: "none",
|
|
808
|
-
stroke: "currentColor",
|
|
809
|
-
strokeWidth: 2,
|
|
810
|
-
strokeLinecap: "round",
|
|
811
|
-
strokeLinejoin: "round",
|
|
812
|
-
dangerouslySetInnerHTML: { __html: navIcon }
|
|
813
|
-
}
|
|
814
|
-
) }) : null,
|
|
815
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
|
|
821
|
+
navIcon && !navIcon.trailing ? iconEl : null,
|
|
822
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
|
|
823
|
+
navIcon && navIcon.trailing ? iconEl : null
|
|
816
824
|
]
|
|
817
825
|
}
|
|
818
826
|
);
|