wealth-alpha-chat-widget 2.0.4 → 2.0.6
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 +30 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +12 -0
- package/dist/index.css.map +1 -1
- package/dist/index.mjs +30 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -711,6 +711,7 @@ var chat_default = {
|
|
|
711
711
|
bubbleMeta: "chat_bubbleMeta",
|
|
712
712
|
chipRow: "chat_chipRow",
|
|
713
713
|
chip: "chat_chip",
|
|
714
|
+
chipIcon: "chat_chipIcon",
|
|
714
715
|
chipActive: "chat_chipActive",
|
|
715
716
|
chipDisabled: "chat_chipDisabled",
|
|
716
717
|
typing: "chat_typing",
|
|
@@ -774,12 +775,26 @@ function AuthGate({ brandName, loginUrl, onLoginClick }) {
|
|
|
774
775
|
] })
|
|
775
776
|
] });
|
|
776
777
|
}
|
|
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
|
+
var PREV_ICON = '<polyline points="15 18 9 12 15 6"/>';
|
|
780
|
+
var NEXT_ICON = '<polyline points="9 18 15 12 9 6"/>';
|
|
781
|
+
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;
|
|
782
|
+
var stripEmoji = (s) => s.replace(EMOJI_RE, "").replace(/\s{2,}/g, " ").trim();
|
|
783
|
+
function navIconFor(chip) {
|
|
784
|
+
if (chip.id === "__root__") return HOME_ICON;
|
|
785
|
+
if (chip.id.includes("_page:")) {
|
|
786
|
+
return /prev/i.test(chip.label) ? PREV_ICON : NEXT_ICON;
|
|
787
|
+
}
|
|
788
|
+
return null;
|
|
789
|
+
}
|
|
777
790
|
function Chip({ chip, disabled, active, onClick }) {
|
|
778
791
|
const classes = [
|
|
779
792
|
chat_default.chip,
|
|
780
793
|
active ? chat_default.chipActive : "",
|
|
781
794
|
disabled ? chat_default.chipDisabled : ""
|
|
782
795
|
].filter(Boolean).join(" ");
|
|
796
|
+
const navIcon = navIconFor(chip);
|
|
797
|
+
const label = stripEmoji(chip.label);
|
|
783
798
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
784
799
|
"button",
|
|
785
800
|
{
|
|
@@ -788,8 +803,19 @@ function Chip({ chip, disabled, active, onClick }) {
|
|
|
788
803
|
disabled,
|
|
789
804
|
onClick: () => !disabled && onClick(chip),
|
|
790
805
|
children: [
|
|
791
|
-
|
|
792
|
-
|
|
806
|
+
navIcon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: chat_default.chipIcon, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
807
|
+
"svg",
|
|
808
|
+
{
|
|
809
|
+
viewBox: "0 0 24 24",
|
|
810
|
+
fill: "none",
|
|
811
|
+
stroke: "currentColor",
|
|
812
|
+
strokeWidth: 2,
|
|
813
|
+
strokeLinecap: "round",
|
|
814
|
+
strokeLinejoin: "round",
|
|
815
|
+
dangerouslySetInnerHTML: { __html: navIcon }
|
|
816
|
+
}
|
|
817
|
+
) }) : null,
|
|
818
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
|
|
793
819
|
]
|
|
794
820
|
}
|
|
795
821
|
);
|
|
@@ -964,7 +990,7 @@ function MessageBubble({ message, onChipClick, onFeedback }) {
|
|
|
964
990
|
onClick: handleMarkdownClick
|
|
965
991
|
}
|
|
966
992
|
) : message.content }),
|
|
967
|
-
isCard ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chat_default.feedbackRow, children: [
|
|
993
|
+
isCard && !isSectorCard ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chat_default.feedbackRow, children: [
|
|
968
994
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: chat_default.feedbackLabel, children: "Was this helpful?" }),
|
|
969
995
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
970
996
|
"button",
|
|
@@ -997,7 +1023,7 @@ function MessageBubble({ message, onChipClick, onFeedback }) {
|
|
|
997
1023
|
}
|
|
998
1024
|
)
|
|
999
1025
|
] }) : null,
|
|
1000
|
-
isCard ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chat_default.disclaimer, children: [
|
|
1026
|
+
isCard && !isSectorCard ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chat_default.disclaimer, children: [
|
|
1001
1027
|
/* @__PURE__ */ jsxRuntime.jsx("b", { children: "Disclaimer:" }),
|
|
1002
1028
|
" ",
|
|
1003
1029
|
CARD_DISCLAIMER
|