wealth-alpha-chat-widget 2.0.8 → 2.0.9

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 CHANGED
@@ -712,6 +712,7 @@ var chat_default = {
712
712
  chipRow: "chat_chipRow",
713
713
  chip: "chat_chip",
714
714
  chipIcon: "chat_chipIcon",
715
+ chipMain: "chat_chipMain",
715
716
  chipActive: "chat_chipActive",
716
717
  chipDisabled: "chat_chipDisabled",
717
718
  typing: "chat_typing",
@@ -791,8 +792,10 @@ function navIconFor(chip) {
791
792
  return null;
792
793
  }
793
794
  function Chip({ chip, disabled, active, onClick }) {
795
+ const isMainMenu = chip.id === "__root__";
794
796
  const classes = [
795
797
  chat_default.chip,
798
+ isMainMenu ? chat_default.chipMain : "",
796
799
  active ? chat_default.chipActive : "",
797
800
  disabled ? chat_default.chipDisabled : ""
798
801
  ].filter(Boolean).join(" ");
@@ -985,6 +988,9 @@ function MessageBubble({ message, onChipClick, onFeedback }) {
985
988
  };
986
989
  const chips = message.chips ?? [];
987
990
  const showMenuGrid = isBot && message.chipsActive && isRootMenuChips(chips);
991
+ const isNavChip = (c) => c.id === "__root__" || c.label.trim() === "Back";
992
+ const navChips = chips.filter(isNavChip);
993
+ const otherChips = chips.filter((c) => !isNavChip(c));
988
994
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column" }, children: [
989
995
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: bubbleClass, children: isBot ? /* @__PURE__ */ jsxRuntime.jsx(
990
996
  "div",
@@ -1059,14 +1065,24 @@ function MessageBubble({ message, onChipClick, onFeedback }) {
1059
1065
  },
1060
1066
  chip.id
1061
1067
  );
1062
- }) }) : isBot && chips.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
1063
- ChipRow,
1064
- {
1065
- chips,
1066
- disabled: !message.chipsActive,
1067
- onClick: handleChipClick
1068
- }
1069
- ) : null
1068
+ }) }) : isBot && chips.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1069
+ otherChips.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
1070
+ ChipRow,
1071
+ {
1072
+ chips: otherChips,
1073
+ disabled: !message.chipsActive,
1074
+ onClick: handleChipClick
1075
+ }
1076
+ ) : null,
1077
+ navChips.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
1078
+ ChipRow,
1079
+ {
1080
+ chips: navChips,
1081
+ disabled: !message.chipsActive,
1082
+ onClick: handleChipClick
1083
+ }
1084
+ ) : null
1085
+ ] }) : null
1070
1086
  ] });
1071
1087
  }
1072
1088
  function TypingIndicator() {