@droppii-org/chat-sdk 0.1.53 → 0.1.55

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.
Files changed (40) hide show
  1. package/dist/components/biz-thread-detail/BizMessageList.d.ts +5 -1
  2. package/dist/components/biz-thread-detail/BizMessageList.d.ts.map +1 -1
  3. package/dist/components/biz-thread-detail/BizMessageList.js +3 -18
  4. package/dist/components/biz-thread-detail/bot/BotButtonMessage.d.ts +8 -1
  5. package/dist/components/biz-thread-detail/bot/BotButtonMessage.d.ts.map +1 -1
  6. package/dist/components/biz-thread-detail/bot/BotButtonMessage.js +5 -4
  7. package/dist/components/biz-thread-detail/bot/index.d.ts +1 -2
  8. package/dist/components/biz-thread-detail/bot/index.d.ts.map +1 -1
  9. package/dist/components/biz-thread-detail/bot/index.js +0 -1
  10. package/dist/components/message/footer/index.d.ts.map +1 -1
  11. package/dist/components/message/footer/index.js +0 -1
  12. package/dist/components/message/item/LinkCard.d.ts +2 -1
  13. package/dist/components/message/item/LinkCard.d.ts.map +1 -1
  14. package/dist/components/message/item/LinkCard.js +5 -3
  15. package/dist/components/message/item/UrlTextMessage.d.ts.map +1 -1
  16. package/dist/components/message/item/UrlTextMessage.js +10 -7
  17. package/dist/components/message/item/index.d.ts +2 -1
  18. package/dist/components/message/item/index.d.ts.map +1 -1
  19. package/dist/components/message/item/index.js +2 -7
  20. package/dist/constants/botFlow.d.ts +0 -5
  21. package/dist/constants/botFlow.d.ts.map +1 -1
  22. package/dist/constants/botFlow.js +0 -11
  23. package/dist/hooks/biz/useBotFlow.d.ts +3 -2
  24. package/dist/hooks/biz/useBotFlow.d.ts.map +1 -1
  25. package/dist/hooks/biz/useBotFlow.js +61 -2
  26. package/dist/hooks/biz/useRunBotFlow.d.ts +3 -2
  27. package/dist/hooks/biz/useRunBotFlow.d.ts.map +1 -1
  28. package/dist/hooks/message/useMessage.d.ts.map +1 -1
  29. package/dist/hooks/message/useMessage.js +0 -2
  30. package/dist/hooks/message/useSendMessage.d.ts +5 -3
  31. package/dist/hooks/message/useSendMessage.d.ts.map +1 -1
  32. package/dist/hooks/message/useSendMessage.js +8 -3
  33. package/dist/screens/biz-thread-detail/index.d.ts.map +1 -1
  34. package/dist/screens/biz-thread-detail/index.js +4 -8
  35. package/dist/tsconfig.tsbuildinfo +1 -1
  36. package/dist/types/biz.d.ts +1 -5
  37. package/dist/types/biz.d.ts.map +1 -1
  38. package/dist/types/chat.d.ts +6 -1
  39. package/dist/types/chat.d.ts.map +1 -1
  40. package/package.json +1 -1
@@ -16,11 +16,11 @@ import { useTranslation } from "react-i18next";
16
16
  import clsx from "clsx";
17
17
  import useBizConversationStore from "../../store/bizConversation";
18
18
  import { BizMessageList, BizThreadDetailHeader, BizThreadDetailInput, } from "../../components/biz-thread-detail";
19
- import { BotFlowProvider, BotStartButton, } from "../../components/biz-thread-detail/bot";
19
+ import { BotButtonMessage, BotStartButton, } from "../../components/biz-thread-detail/bot";
20
20
  import { useBotFlow } from "../../hooks/biz/useBotFlow";
21
21
  import { isBizBotCrmChat } from "../../utils/bizConversation";
22
22
  const DChatBizThreadDetail = (_a) => {
23
- var _b, _c, _d;
23
+ var _b;
24
24
  var { className, children, onBack } = _a, inputProps = __rest(_a, ["className", "children", "onBack"]);
25
25
  const { t } = useTranslation("biz-inbox");
26
26
  const router = useRouter();
@@ -44,11 +44,7 @@ const DChatBizThreadDetail = (_a) => {
44
44
  }
45
45
  const isBotNotStarted = isBotThread && botFlow.status === "not_started";
46
46
  const footer = isBotNotStarted ? (_jsx("div", { className: "bg-white p-6", children: _jsx(BotStartButton, { label: t("thread_detail.bot.start"), onClick: botFlow.start, disabled: botFlow.isProcessing }) })) : (_jsx(BizThreadDetailInput, Object.assign({}, inputProps)));
47
- return (_jsx(BotFlowProvider, { value: {
48
- buttons: (_d = (_c = botFlow.currentButtonsBlock) === null || _c === void 0 ? void 0 : _c.data.buttons) !== null && _d !== void 0 ? _d : [],
49
- disabled: botFlow.isProcessing,
50
- onSelect: botFlow.selectButton,
51
- onRestart: botFlow.restart,
52
- }, children: _jsxs("div", { "data-testid": "biz-thread-detail-root", className: clsx("relative flex h-full w-full flex-col overflow-hidden bg-white", className), children: [_jsx(BizThreadDetailHeader, { conversation: conversation, onBack: handleBack }), _jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: children !== null && children !== void 0 ? children : _jsx(BizMessageList, {}) }), footer] }) }));
47
+ const botButtonsSlot = isBotThread && botFlow.shouldShowButtons && botFlow.currentButtonsBlock ? (_jsx(BotButtonMessage, { buttons: botFlow.currentButtonsBlock.data.buttons, disabled: botFlow.isProcessing, onSelect: botFlow.selectButton, onRestart: botFlow.restart })) : null;
48
+ return (_jsxs("div", { "data-testid": "biz-thread-detail-root", className: clsx("relative flex h-full w-full flex-col overflow-hidden bg-white", className), children: [_jsx(BizThreadDetailHeader, { conversation: conversation, onBack: handleBack }), _jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: children !== null && children !== void 0 ? children : _jsx(BizMessageList, { bottomSlot: botButtonsSlot }) }), footer] }));
53
49
  };
54
50
  export default DChatBizThreadDetail;