@droppii-org/chat-sdk 0.7.1 → 0.7.3
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/components/conversation-detail/ConversationMessageList.d.ts.map +1 -1
- package/dist/components/conversation-detail/ConversationMessageList.js +23 -5
- package/dist/components/conversation-inbox/ConversationInboxItem.d.ts.map +1 -1
- package/dist/components/conversation-inbox/ConversationInboxItem.js +1 -1
- package/dist/components/message/item/ConsultantChatButton.d.ts +6 -0
- package/dist/components/message/item/ConsultantChatButton.d.ts.map +1 -0
- package/dist/components/message/item/ConsultantChatButton.js +19 -0
- package/dist/components/message/item/CustomMessage.d.ts.map +1 -1
- package/dist/components/message/item/CustomMessage.js +6 -1
- package/dist/components/message/item/EventMessage.d.ts +11 -0
- package/dist/components/message/item/EventMessage.d.ts.map +1 -0
- package/dist/components/message/item/EventMessage.js +28 -0
- package/dist/components/message/item/consultantCta.d.ts +8 -0
- package/dist/components/message/item/consultantCta.d.ts.map +1 -0
- package/dist/components/message/item/consultantCta.js +5 -0
- package/dist/components/message/item/index.d.ts.map +1 -1
- package/dist/components/message/item/index.js +10 -4
- package/dist/components/message/item/otherSenders.d.ts.map +1 -1
- package/dist/components/message/item/otherSenders.js +4 -1
- package/dist/hooks/conversation/useConsultantChatNavigation.d.ts +12 -0
- package/dist/hooks/conversation/useConsultantChatNavigation.d.ts.map +1 -0
- package/dist/hooks/conversation/useConsultantChatNavigation.js +94 -0
- package/dist/hooks/global/useGlobalEvent.d.ts.map +1 -1
- package/dist/hooks/global/useGlobalEvent.js +32 -0
- package/dist/hooks/message/useMessage.d.ts +1 -1
- package/dist/hooks/message/useMessage.d.ts.map +1 -1
- package/dist/hooks/message/useMessage.js +7 -4
- package/dist/hooks/message/useNewMessageAnnouncement.d.ts.map +1 -1
- package/dist/hooks/message/useNewMessageAnnouncement.js +3 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/locales/vi/common.json +1 -0
- package/dist/screens/conversation-detail/index.d.ts.map +1 -1
- package/dist/screens/conversation-detail/index.js +20 -1
- package/dist/store/conversation.d.ts.map +1 -1
- package/dist/store/conversation.js +3 -0
- package/dist/store/type.d.ts +8 -0
- package/dist/store/type.d.ts.map +1 -1
- package/dist/styles/global.css +1 -1
- package/dist/types/chat.d.ts +2 -1
- package/dist/types/chat.d.ts.map +1 -1
- package/dist/types/chat.js +3 -0
- package/dist/types/customMessage.d.ts +17 -0
- package/dist/types/customMessage.d.ts.map +1 -1
- package/dist/types/customMessage.js +8 -0
- package/dist/utils/common.d.ts +2 -0
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/common.js +14 -4
- package/dist/utils/customMessage.d.ts +7 -1
- package/dist/utils/customMessage.d.ts.map +1 -1
- package/dist/utils/customMessage.js +55 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationMessageList.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-detail/ConversationMessageList.tsx"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"ConversationMessageList.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-detail/ConversationMessageList.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAiCf,MAAM,WAAW,4BAA4B;IAC3C,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1E,kGAAkG;IAClG,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;CACrC;AAED,QAAA,MAAM,uBAAuB,GAAI,4DAI9B,4BAA4B,4CAoS9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
import { useCallback, useEffect, useMemo, useState, } from "react";
|
|
4
4
|
import { Empty, Spin, message as toastMessage } from "antd";
|
|
5
5
|
import { useEventListener } from "ahooks";
|
|
6
6
|
import { useTranslation } from "react-i18next";
|
|
@@ -13,12 +13,15 @@ import { usePinMessage } from "../../hooks/message/usePinMessage";
|
|
|
13
13
|
import { useRevokeMessage } from "../../hooks/message/useRevokeMessage";
|
|
14
14
|
import { useGroupPermission } from "../../hooks/group/useGroupPermission";
|
|
15
15
|
import { useViewOnlyGroupRefresh } from "../../hooks/conversation/useViewOnlyGroupRefresh";
|
|
16
|
+
import { useConsultantChatNavigation } from "../../hooks/conversation/useConsultantChatNavigation";
|
|
16
17
|
import useConversationStore from "../../store/conversation";
|
|
17
18
|
import { PeerType } from "../../types/conversation";
|
|
18
19
|
import useAuthStore from "../../store/auth";
|
|
19
|
-
import { isGroupChat as resolveIsGroupChat, isSupportSessionAgentView, } from "../../utils/conversation";
|
|
20
|
+
import { isBotPeer, isGroupChat as resolveIsGroupChat, isSupportSessionAgentView, } from "../../utils/conversation";
|
|
20
21
|
import emitter from "../../utils/events";
|
|
21
22
|
import MessageItem from "../../components/message/item";
|
|
23
|
+
import { ConsultantCtaContext, } from "../../components/message/item/consultantCta";
|
|
24
|
+
import { findConsultantCtaMessageId } from "../../utils/customMessage";
|
|
22
25
|
import UnreadMessageJumpButton from "../../components/message/UnreadMessageJumpButton";
|
|
23
26
|
import PinLimitModal from "./PinLimitModal";
|
|
24
27
|
const ConversationMessageList = ({ bottomSlot, onCopyMessageLink, onSearchMessageRevoked, }) => {
|
|
@@ -39,9 +42,10 @@ const ConversationMessageList = ({ bottomSlot, onCopyMessageLink, onSearchMessag
|
|
|
39
42
|
// the permission check would hide a feature that is live for them.
|
|
40
43
|
const canPinMessage = !isGroupChat || permissions.pinMessage || allowPinMessageWithoutPermission;
|
|
41
44
|
const viewerUserID = (user === null || user === void 0 ? void 0 : user.userID) || authUserID;
|
|
45
|
+
const isAgentView = isSupportSessionAgentView(Object.assign(Object.assign({}, conversation), { conversationID: conversationId }), viewerUserID);
|
|
42
46
|
// App history strips the assignment log and session dividers, which an
|
|
43
47
|
// agent handling someone else's session needs — load the full history.
|
|
44
|
-
const useAppHistory = !
|
|
48
|
+
const useAppHistory = !isAgentView;
|
|
45
49
|
const messageController = useMessage(conversationId, searchClientMsgID, true, useAppHistory, onSearchMessageRevoked);
|
|
46
50
|
useViewOnlyGroupRefresh({
|
|
47
51
|
enabled: isViewOnlyMember && (conversation === null || conversation === void 0 ? void 0 : conversation.peerType) === PeerType.GROUP,
|
|
@@ -56,6 +60,20 @@ const ConversationMessageList = ({ bottomSlot, onCopyMessageLink, onSearchMessag
|
|
|
56
60
|
const { scrollRef, loadMoreOldMessage, handleInfiniteScroll, scrollToBottomIfAtBottom, scrollToMessage, } = useMessageListScroll(Object.assign({ conversationId, userId: viewerUserID, isGroupChat, markAsReadBlocked: !isUnreadLookupResolved }, messageController));
|
|
57
61
|
const { loadState, moreOldLoading } = messageController;
|
|
58
62
|
const isMessageLoading = !conversationId || loadState.initLoading;
|
|
63
|
+
const { openConsultantChat } = useConsultantChatNavigation();
|
|
64
|
+
// The button is the owner's way to their own consultant, in their bot thread.
|
|
65
|
+
const canOpenConsultantChat = !!conversation && isBotPeer(conversation) && !isAgentView;
|
|
66
|
+
const consultantCta = useMemo(() => ({
|
|
67
|
+
ctaMessageId: canOpenConsultantChat
|
|
68
|
+
? findConsultantCtaMessageId(loadState.messageList, loadState.hasMoreNew)
|
|
69
|
+
: null,
|
|
70
|
+
onOpenConsultantChat: openConsultantChat,
|
|
71
|
+
}), [
|
|
72
|
+
canOpenConsultantChat,
|
|
73
|
+
loadState.messageList,
|
|
74
|
+
loadState.hasMoreNew,
|
|
75
|
+
openConsultantChat,
|
|
76
|
+
]);
|
|
59
77
|
const [openToolboxMessageId, setOpenToolboxMessageId] = useState(null);
|
|
60
78
|
const closeToolbox = useCallback(() => setOpenToolboxMessageId(null), []);
|
|
61
79
|
const [revealedTimeMsgId, setRevealedTimeMsgId] = useState(null);
|
|
@@ -140,7 +158,7 @@ const ConversationMessageList = ({ bottomSlot, onCopyMessageLink, onSearchMessag
|
|
|
140
158
|
target: scrollRef,
|
|
141
159
|
enable: !!openToolboxMessageId,
|
|
142
160
|
});
|
|
143
|
-
return (_jsxs("div", { "data-testid": "conversation-message-list", "data-cp-name": "ConversationMessageList", className: "relative flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-white", children: [isMessageLoading ? (_jsx("div", { className: "flex flex-1 items-center justify-center py-12", children: _jsx(Spin, {}) })) : (_jsxs(MessageInfiniteScroll, { scrollRef: scrollRef, scrollableTargetId: "scrollableConversationMessagesDiv", loadState: loadState, moreOldLoading: moreOldLoading, onLoadMoreOld: loadMoreOldMessage, onScroll: handleInfiniteScroll, containerClassName: "h-full", empty: _jsx("div", { className: "flex flex-1 items-center justify-center py-12", children: _jsx(Empty, { description: t("empty.no_messages") }) }), children: [_jsx("div", { "aria-hidden": "true", className: "h-3 shrink-0" }), bottomSlot, loadState.messageList.map((message, index, array) => (_jsx(MessageItem, { message: message, allMessages: array, isGroupChat: isGroupChat, forceHideTip: index === 0 && !!bottomSlot, contextMenuOpen: openToolboxMessageId === message.clientMsgID, onContextMenuOpenChange: (open) => setOpenToolboxMessageId(open ? message.clientMsgID : null), onQuoteMessage: setQuotedMessage, onRevokeMessage: handleRevokeMessage, timeRevealed: revealedTimeMsgId === message.clientMsgID, onToggleTimeReveal: handleToggleTimeReveal, onPressQuoteMessage: onPressQuoteMessage, onPinMessage: canPinMessage ? handlePinMessage : undefined, onUnpinMessage: canPinMessage ? handleUnpinMessage : undefined, onCopyMessageLink: handleCopyMessageLink, showUnreadDivider: !!unreadDividerMessageId &&
|
|
144
|
-
|
|
161
|
+
return (_jsxs("div", { "data-testid": "conversation-message-list", "data-cp-name": "ConversationMessageList", className: "relative flex min-h-0 min-w-0 flex-1 flex-col overflow-x-hidden bg-white", children: [isMessageLoading ? (_jsx("div", { className: "flex flex-1 items-center justify-center py-12", children: _jsx(Spin, {}) })) : (_jsxs(MessageInfiniteScroll, { scrollRef: scrollRef, scrollableTargetId: "scrollableConversationMessagesDiv", loadState: loadState, moreOldLoading: moreOldLoading, onLoadMoreOld: loadMoreOldMessage, onScroll: handleInfiniteScroll, containerClassName: "h-full", empty: _jsx("div", { className: "flex flex-1 items-center justify-center py-12", children: _jsx(Empty, { description: t("empty.no_messages") }) }), children: [_jsx("div", { "aria-hidden": "true", className: "h-3 shrink-0" }), bottomSlot, _jsx(ConsultantCtaContext.Provider, { value: consultantCta, children: loadState.messageList.map((message, index, array) => (_jsx(MessageItem, { message: message, allMessages: array, isGroupChat: isGroupChat, forceHideTip: index === 0 && !!bottomSlot, contextMenuOpen: openToolboxMessageId === message.clientMsgID, onContextMenuOpenChange: (open) => setOpenToolboxMessageId(open ? message.clientMsgID : null), onQuoteMessage: setQuotedMessage, onRevokeMessage: handleRevokeMessage, timeRevealed: revealedTimeMsgId === message.clientMsgID, onToggleTimeReveal: handleToggleTimeReveal, onPressQuoteMessage: onPressQuoteMessage, onPinMessage: canPinMessage ? handlePinMessage : undefined, onUnpinMessage: canPinMessage ? handleUnpinMessage : undefined, onCopyMessageLink: handleCopyMessageLink, showUnreadDivider: !!unreadDividerMessageId &&
|
|
162
|
+
message.clientMsgID === unreadDividerMessageId, onUnreadDividerSeen: markDividerSeen, enableLongPress: true }, message.clientMsgID))) })] })), !isMessageLoading && showJumpButton && (_jsx(UnreadMessageJumpButton, { className: "absolute right-0 top-4 z-10", onClick: handleJumpToFirstUnread })), _jsx(PinLimitModal, { open: pinLimitModalOpen, max: pinnedTotalCount, onClose: () => setPinLimitModalOpen(false) })] }));
|
|
145
163
|
};
|
|
146
164
|
export default ConversationMessageList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationInboxItem.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-inbox/ConversationInboxItem.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAoBjE,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,OAAO,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAC/C;AAQD,QAAA,MAAM,qBAAqB,GAAI,mBAAmB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"ConversationInboxItem.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-inbox/ConversationInboxItem.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAoBjE,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,oBAAoB,CAAC;IAC3B,OAAO,EAAE,CAAC,IAAI,EAAE,oBAAoB,KAAK,IAAI,CAAC;CAC/C;AAQD,QAAA,MAAM,qBAAqB,GAAI,mBAAmB,0BAA0B,4CAkG3E,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
|
|
@@ -51,7 +51,7 @@ const ConversationInboxItem = ({ item, onClick }) => {
|
|
|
51
51
|
peerType: item.peerType,
|
|
52
52
|
conversationType: item.conversationType,
|
|
53
53
|
showName: item.showName,
|
|
54
|
-
});
|
|
54
|
+
}, { showEventMessages: !isCrm });
|
|
55
55
|
const latestMessageTime = formatLatestMessageTime(item.latestMsgSendTime || null);
|
|
56
56
|
const unreadCount = (_a = item.unreadCount) !== null && _a !== void 0 ? _a : 0;
|
|
57
57
|
const isMuted = isConversationMuted(item.recvMsgOpt);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
interface ConsultantChatButtonProps {
|
|
2
|
+
onClick: () => void;
|
|
3
|
+
}
|
|
4
|
+
declare const ConsultantChatButton: ({ onClick }: ConsultantChatButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export default ConsultantChatButton;
|
|
6
|
+
//# sourceMappingURL=ConsultantChatButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConsultantChatButton.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/ConsultantChatButton.tsx"],"names":[],"mappings":"AAMA,UAAU,yBAAyB;IACjC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,QAAA,MAAM,oBAAoB,GAAI,aAAa,yBAAyB,4CAuBnE,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { useTranslation } from "react-i18next";
|
|
5
|
+
import { Icon } from "../../../components/icon";
|
|
6
|
+
const ConsultantChatButton = ({ onClick }) => {
|
|
7
|
+
const { t } = useTranslation();
|
|
8
|
+
// A second click before the thread switches would push the same route twice.
|
|
9
|
+
const [isOpening, setIsOpening] = useState(false);
|
|
10
|
+
return (_jsxs("button", { type: "button", "data-testid": "consultant-chat-button", disabled: isOpening, onClick: (event) => {
|
|
11
|
+
// The bubble underneath toggles its time label on click.
|
|
12
|
+
event.stopPropagation();
|
|
13
|
+
if (isOpening)
|
|
14
|
+
return;
|
|
15
|
+
setIsOpening(true);
|
|
16
|
+
onClick();
|
|
17
|
+
}, className: "flex h-[31px] w-full items-center justify-center gap-2 rounded-lg bg-[var(--dc-color-primary)] px-3 text-[14px] font-normal leading-[160%] text-white transition-colors hover:bg-[var(--dc-color-primary-hover)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[var(--dc-color-primary-focus)]", children: [_jsx(Icon, { icon: "chat-square-o", size: 20, className: "text-white" }), _jsx("span", { children: t("consultant_chat_button") })] }));
|
|
18
|
+
};
|
|
19
|
+
export default ConsultantChatButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/CustomMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"CustomMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/CustomMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAW3D,UAAU,sBAAsB;IAC9B,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,QAAA,MAAM,iBAAiB,GAAI,aAAa,sBAAsB,mDAiD7D,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -3,7 +3,9 @@ import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
|
3
3
|
import clsx from "clsx";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
5
|
import { useChatContext } from "../../../context/ChatContext";
|
|
6
|
-
import {
|
|
6
|
+
import { CustomMessageType } from "../../../types/customMessage";
|
|
7
|
+
import { isSystemEventMessage, parseCustomMessagePayload, } from "../../../utils/customMessage";
|
|
8
|
+
import EventMessageItem from "./EventMessage";
|
|
7
9
|
import { MESSAGE_TEXT_CLASS } from "./textStyle";
|
|
8
10
|
const CustomMessageItem = ({ message }) => {
|
|
9
11
|
var _a, _b;
|
|
@@ -14,6 +16,9 @@ const CustomMessageItem = ({ message }) => {
|
|
|
14
16
|
if (renderedContent) {
|
|
15
17
|
return _jsx(_Fragment, { children: renderedContent });
|
|
16
18
|
}
|
|
19
|
+
if (isSystemEventMessage(message)) {
|
|
20
|
+
return (_jsx(EventMessageItem, { message: message, data: (payload === null || payload === void 0 ? void 0 : payload.type) === CustomMessageType.Event ? payload.data : null }));
|
|
21
|
+
}
|
|
17
22
|
const fallbackText = ((_a = message === null || message === void 0 ? void 0 : message.textElem) === null || _a === void 0 ? void 0 : _a.content) || ((_b = message === null || message === void 0 ? void 0 : message.quoteElem) === null || _b === void 0 ? void 0 : _b.text);
|
|
18
23
|
if (fallbackText) {
|
|
19
24
|
return (_jsx("p", { className: clsx("min-w-0 whitespace-pre-wrap [overflow-wrap:anywhere]", MESSAGE_TEXT_CLASS), children: fallbackText }));
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MessageItem } from "@droppii-org/wasm-client-sdk";
|
|
2
|
+
import type { CustomElemEventData } from "../../../types/customMessage";
|
|
3
|
+
interface EventMessageItemProps {
|
|
4
|
+
message: MessageItem;
|
|
5
|
+
/** null when customElem.data didn't parse — the text still renders. */
|
|
6
|
+
data: CustomElemEventData | null;
|
|
7
|
+
}
|
|
8
|
+
/** Draws its own surface: MessageItem renders it in a transparent bubble. */
|
|
9
|
+
declare const EventMessageItem: ({ message, data }: EventMessageItemProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export default EventMessageItem;
|
|
11
|
+
//# sourceMappingURL=EventMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/EventMessage.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAcjE,UAAU,qBAAqB;IAC7B,OAAO,EAAE,WAAW,CAAC;IACrB,uEAAuE;IACvE,IAAI,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAClC;AAED,6EAA6E;AAC7E,QAAA,MAAM,gBAAgB,GAAI,mBAAmB,qBAAqB,mDAgCjE,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { sanitizeHtml } from "../../../utils/common";
|
|
5
|
+
import { getEventMessageHtml } from "../../../utils/customMessage";
|
|
6
|
+
import ConsultantChatButton from "./ConsultantChatButton";
|
|
7
|
+
import { useConsultantCta } from "./consultantCta";
|
|
8
|
+
import { MESSAGE_TEXT_CLASS } from "./textStyle";
|
|
9
|
+
// Same text size as every other message in the thread, with one blank line
|
|
10
|
+
// (1.6em at the default 160% line height) between paragraphs.
|
|
11
|
+
const EVENT_TEXT_CLASS = clsx("min-w-0 [overflow-wrap:anywhere] [&_p+p]:mt-[1.6em]", MESSAGE_TEXT_CLASS);
|
|
12
|
+
/** Draws its own surface: MessageItem renders it in a transparent bubble. */
|
|
13
|
+
const EventMessageItem = ({ message, data }) => {
|
|
14
|
+
var _a;
|
|
15
|
+
const consultantCta = useConsultantCta();
|
|
16
|
+
const html = getEventMessageHtml(message);
|
|
17
|
+
const fallbackText = ((_a = message === null || message === void 0 ? void 0 : message.customElem) === null || _a === void 0 ? void 0 : _a.description) || (data === null || data === void 0 ? void 0 : data.message) || "";
|
|
18
|
+
const consultantId = data === null || data === void 0 ? void 0 : data.consultantId;
|
|
19
|
+
const openConsultantChat = consultantCta &&
|
|
20
|
+
consultantId &&
|
|
21
|
+
consultantCta.ctaMessageId === (message === null || message === void 0 ? void 0 : message.clientMsgID)
|
|
22
|
+
? () => consultantCta.onOpenConsultantChat(consultantId)
|
|
23
|
+
: null;
|
|
24
|
+
if (!html && !fallbackText)
|
|
25
|
+
return null;
|
|
26
|
+
return (_jsxs("div", { "data-testid": "event-message", className: "flex min-w-0 flex-col gap-2 rounded-[20px] rounded-bl bg-[var(--dc-color-neutral-surface)] px-4 py-3", children: [html ? (_jsx("div", { className: EVENT_TEXT_CLASS, dangerouslySetInnerHTML: { __html: sanitizeHtml(html) } })) : (_jsx("p", { className: EVENT_TEXT_CLASS, children: fallbackText })), openConsultantChat && (_jsx(ConsultantChatButton, { onClick: openConsultantChat }))] }));
|
|
27
|
+
};
|
|
28
|
+
export default EventMessageItem;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ConsultantCtaContextValue {
|
|
2
|
+
/** clientMsgID of the single message allowed to show the button, if any. */
|
|
3
|
+
ctaMessageId: string | null;
|
|
4
|
+
onOpenConsultantChat: (consultantId: string) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const ConsultantCtaContext: import("react").Context<ConsultantCtaContextValue | null>;
|
|
7
|
+
export declare const useConsultantCta: () => ConsultantCtaContextValue | null;
|
|
8
|
+
//# sourceMappingURL=consultantCta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"consultantCta.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/consultantCta.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,yBAAyB;IACxC,4EAA4E;IAC5E,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,oBAAoB,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAID,eAAO,MAAM,oBAAoB,2DACsB,CAAC;AAExD,eAAO,MAAM,gBAAgB,wCAAyC,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createContext, useContext } from "react";
|
|
2
|
+
// Only the conversation-detail message list provides it; other timelines
|
|
3
|
+
// (CRM desk, pinned/search previews) render event messages without a button.
|
|
4
|
+
export const ConsultantCtaContext = createContext(null);
|
|
5
|
+
export const useConsultantCta = () => useContext(ConsultantCtaContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,IAAI,eAAe,EAG/B,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/index.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,WAAW,IAAI,eAAe,EAG/B,MAAM,8BAA8B,CAAC;AA8DtC,UAAU,gBAAgB;IACxB,OAAO,EAAE,eAAe,CAAC;IACzB,WAAW,EAAE,eAAe,EAAE,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,uBAAuB,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAClD,eAAe,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACpD,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAClD,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IACpD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,2EAA2E;IAC3E,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uEAAuE;IACvE,kBAAkB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,iBAAiB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;CAClC;AAiDD,QAAA,MAAM,WAAW,GAAI,kSAkBlB,gBAAgB,mDA0flB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -10,6 +10,7 @@ import { getImmediateNeighbor, getVisibleNeighbor, isMessageHiddenForViewer, } f
|
|
|
10
10
|
import { MSG_ITEM_BUBBLE_GROUP_PREFIX, MSG_ITEM_CONTENT_PREFIX, MSG_ITEM_PREFIX, SUPPORT_SYSTEM_SENDER_ID, } from "../../../constants";
|
|
11
11
|
import { formatDividerTimestamp } from "../../../utils/common";
|
|
12
12
|
import { CustomMessageType } from "../../../types/customMessage";
|
|
13
|
+
import { isEventCustomMessage, isSystemEventMessage, } from "../../../utils/customMessage";
|
|
13
14
|
import useAuthStore from "../../../store/auth";
|
|
14
15
|
import useConversationStore from "../../../store/conversation";
|
|
15
16
|
import { useMemo, useRef, useState } from "react";
|
|
@@ -53,6 +54,8 @@ const MessageItem = ({ message, allMessages, isGroupChat = false, forceHideTip =
|
|
|
53
54
|
const { resendMessage } = useSendMessage();
|
|
54
55
|
const userID = useAuthStore((state) => state.userID);
|
|
55
56
|
const isCrm = useAuthStore((state) => state.isCrm);
|
|
57
|
+
// Bot-thread event messages draw their own surface and can't be replied to.
|
|
58
|
+
const isEventMessage = isSystemEventMessage(message);
|
|
56
59
|
const conversationData = useConversationStore((state) => state.conversationData);
|
|
57
60
|
// CRM only: the "…" menu and whether the message holds focus (so Tab reaches it).
|
|
58
61
|
const [moreOpen, setMoreOpen] = useState(false);
|
|
@@ -67,7 +70,7 @@ const MessageItem = ({ message, allMessages, isGroupChat = false, forceHideTip =
|
|
|
67
70
|
}
|
|
68
71
|
const closeToolbox = () => onContextMenuOpenChange === null || onContextMenuOpenChange === void 0 ? void 0 : onContextMenuOpenChange(false);
|
|
69
72
|
const actions = [];
|
|
70
|
-
if (isDeliveredForUi && onQuoteMessage) {
|
|
73
|
+
if (isDeliveredForUi && onQuoteMessage && !isEventMessage) {
|
|
71
74
|
actions.push({
|
|
72
75
|
key: MessageToolboxActionKey.REPLY,
|
|
73
76
|
label: t("context_menu_reply"),
|
|
@@ -143,6 +146,7 @@ const MessageItem = ({ message, allMessages, isGroupChat = false, forceHideTip =
|
|
|
143
146
|
onContextMenuOpenChange,
|
|
144
147
|
onCopyMessageLink,
|
|
145
148
|
isMessageLinkCopyable,
|
|
149
|
+
isEventMessage,
|
|
146
150
|
]);
|
|
147
151
|
const bubbleWrapperRef = useRef(null);
|
|
148
152
|
useLongPress(() => onContextMenuOpenChange === null || onContextMenuOpenChange === void 0 ? void 0 : onContextMenuOpenChange(true), enableLongPress ? bubbleWrapperRef : undefined, { delay: 500 });
|
|
@@ -186,8 +190,10 @@ const MessageItem = ({ message, allMessages, isGroupChat = false, forceHideTip =
|
|
|
186
190
|
const hasContextMenu = contextMenuItems.length > 0;
|
|
187
191
|
const isLatestMine = ((_a = allMessages.find((m) => m.sendID === userID)) === null || _a === void 0 ? void 0 : _a.clientMsgID) ===
|
|
188
192
|
message.clientMsgID;
|
|
189
|
-
|
|
190
|
-
const
|
|
193
|
+
// CRM hides event messages, so they must not anchor its dividers or groups.
|
|
194
|
+
const isHiddenNeighbour = (candidate) => isCrm && isEventCustomMessage(candidate);
|
|
195
|
+
const previousMessage = getVisibleNeighbor(allMessages, message, "prev", isHiddenNeighbour);
|
|
196
|
+
const nextMessage = getVisibleNeighbor(allMessages, message, "next", isHiddenNeighbour);
|
|
191
197
|
const isOrder = isOrderMessage(message);
|
|
192
198
|
// A system-log, group-notification, or session-event item breaks the
|
|
193
199
|
// group even though it's skipped by getVisibleNeighbor's "next ordinary
|
|
@@ -266,7 +272,7 @@ const MessageItem = ({ message, allMessages, isGroupChat = false, forceHideTip =
|
|
|
266
272
|
timeBreakNode,
|
|
267
273
|
_jsx(SessionEventMessageItem, { message: message })));
|
|
268
274
|
}
|
|
269
|
-
const bubbleNode = (_jsx(MessageBubble, { isMine: isMine, isInternal: isInternalMessage, supportSender: supportSender, senderName: message === null || message === void 0 ? void 0 : message.senderNickname, showSenderName: showSenderName, showTip: showTip, id: `${MSG_ITEM_CONTENT_PREFIX}${message === null || message === void 0 ? void 0 : message.clientMsgID}`, content: renderBubbleContent(message, onPressQuoteMessage), isTransparent: isStickerMessage, timeLabel: isCrm ? undefined : dayjs.tz(message.sendTime).format("HH:mm"), timeRevealed: timeRevealed, onToggleTimeReveal: () => onToggleTimeReveal === null || onToggleTimeReveal === void 0 ? void 0 : onToggleTimeReveal(message.clientMsgID) }));
|
|
275
|
+
const bubbleNode = (_jsx(MessageBubble, { isMine: isMine, isInternal: isInternalMessage, supportSender: supportSender, senderName: message === null || message === void 0 ? void 0 : message.senderNickname, showSenderName: showSenderName, showTip: showTip, id: `${MSG_ITEM_CONTENT_PREFIX}${message === null || message === void 0 ? void 0 : message.clientMsgID}`, content: renderBubbleContent(message, onPressQuoteMessage), isTransparent: isStickerMessage || isEventMessage, timeLabel: isCrm ? undefined : dayjs.tz(message.sendTime).format("HH:mm"), timeRevealed: timeRevealed, onToggleTimeReveal: () => onToggleTimeReveal === null || onToggleTimeReveal === void 0 ? void 0 : onToggleTimeReveal(message.clientMsgID) }));
|
|
270
276
|
const showPinnedBadge = Boolean(message === null || message === void 0 ? void 0 : message.isPinned);
|
|
271
277
|
const showGroupTime = isCrm && !nextSameUser;
|
|
272
278
|
const pinnedBadgeNode = showPinnedBadge ? (_jsx("span", { "data-testid": "message-pinned-badge", className: clsx("absolute -top-2.5 z-[1] flex h-[22px] w-[26px] items-center justify-center rounded-full border border-white bg-gray-25", isMine ? "left-0" : "right-0"), children: _jsx(AdaptiveIcon, { stroke: "pin", font: "thumbtack-b", size: 12, className: "text-[var(--dc-color-primary)]" }) })) : null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otherSenders.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/otherSenders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"otherSenders.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/otherSenders.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAmBhE;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,WAAW,EAAE,EACvB,UAAU,MAAM,KACf,OAeF,CAAC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { MessageType } from "@droppii-org/wasm-client-sdk";
|
|
2
|
+
import { isEventCustomMessage } from "../../../utils/customMessage";
|
|
2
3
|
import { isGroupNotificationMessageType, isSessionEventMessage, isSystemLogMessageType, } from "../../../utils/messageLog";
|
|
3
4
|
const cache = new WeakMap();
|
|
4
5
|
const isChatMessage = (message) => message.contentType !== MessageType.RevokeMessage &&
|
|
5
6
|
!isSystemLogMessageType(message.contentType) &&
|
|
6
7
|
!isGroupNotificationMessageType(message.contentType) &&
|
|
7
|
-
!isSessionEventMessage(message)
|
|
8
|
+
!isSessionEventMessage(message) &&
|
|
9
|
+
// CRM-only helper, and CRM hides event messages.
|
|
10
|
+
!isEventCustomMessage(message);
|
|
8
11
|
/**
|
|
9
12
|
* True when at least two different people other than the viewer have spoken (bot and
|
|
10
13
|
* customer, or several members). Only then does an incoming group need a sender label.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ConversationItem } from "@droppii-org/wasm-client-sdk";
|
|
2
|
+
import type { ConsultantReturnTarget } from "../../store/type";
|
|
3
|
+
export declare const nextConsultantReturnTarget: (target: ConsultantReturnTarget | null, conversation: ConversationItem | null) => ConsultantReturnTarget | null;
|
|
4
|
+
/** Opens the consultant's 1:1 from a bot-thread message and leads back to it. */
|
|
5
|
+
export declare const useConsultantChatNavigation: () => {
|
|
6
|
+
returnTarget: ConsultantReturnTarget | null;
|
|
7
|
+
openConsultantChat: (consultantId: string) => void;
|
|
8
|
+
returnToBotThread: () => void;
|
|
9
|
+
clearReturnTarget: () => void;
|
|
10
|
+
setReturnTarget: (target: ConsultantReturnTarget | null) => void;
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=useConsultantChatNavigation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConsultantChatNavigation.d.ts","sourceRoot":"","sources":["../../../src/hooks/conversation/useConsultantChatNavigation.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAIrE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAsB3D,eAAO,MAAM,0BAA0B,GACrC,QAAQ,sBAAsB,GAAG,IAAI,EACrC,cAAc,gBAAgB,GAAG,IAAI,KACpC,sBAAsB,GAAG,IAO3B,CAAC;AAEF,iFAAiF;AACjF,eAAO,MAAM,2BAA2B;;uCAoBrB,MAAM;;;;CA2DxB,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
import { useChatContext } from "../../context/ChatContext";
|
|
4
|
+
import { useChatNavigate } from "../../hooks/conversation/useChatNavigate";
|
|
5
|
+
import useConversationStore from "../../store/conversation";
|
|
6
|
+
// Every param that names the open thread; one target must replace them all.
|
|
7
|
+
const THREAD_TARGET_PARAMS = [
|
|
8
|
+
"threadId",
|
|
9
|
+
"conversationId",
|
|
10
|
+
"userId",
|
|
11
|
+
"groupId",
|
|
12
|
+
"botId",
|
|
13
|
+
"inviteToken",
|
|
14
|
+
"messageId",
|
|
15
|
+
];
|
|
16
|
+
const buildThreadUrl = (target) => {
|
|
17
|
+
const params = new URLSearchParams(window.location.search);
|
|
18
|
+
THREAD_TARGET_PARAMS.forEach((key) => params.delete(key));
|
|
19
|
+
Object.entries(target).forEach(([key, value]) => params.set(key, value));
|
|
20
|
+
return `${window.location.pathname}?${params.toString()}`;
|
|
21
|
+
};
|
|
22
|
+
// Keeps the way back only while the user is on the consultant 1:1 they opened
|
|
23
|
+
// from the button; reaching the bot thread or any other thread drops it.
|
|
24
|
+
export const nextConsultantReturnTarget = (target, conversation) => {
|
|
25
|
+
if (!target || !conversation)
|
|
26
|
+
return target;
|
|
27
|
+
if (conversation.userID === target.consultantId) {
|
|
28
|
+
return target.hasArrived ? target : Object.assign(Object.assign({}, target), { hasArrived: true });
|
|
29
|
+
}
|
|
30
|
+
const isBotThread = conversation.conversationID === target.botConversationId;
|
|
31
|
+
return isBotThread && !target.hasArrived ? target : null;
|
|
32
|
+
};
|
|
33
|
+
/** Opens the consultant's 1:1 from a bot-thread message and leads back to it. */
|
|
34
|
+
export const useConsultantChatNavigation = () => {
|
|
35
|
+
const { useUrlState = true } = useChatContext();
|
|
36
|
+
const onNavigate = useChatNavigate();
|
|
37
|
+
const returnTarget = useConversationStore((state) => state.consultantReturnTarget);
|
|
38
|
+
const setReturnTarget = useConversationStore((state) => state.setConsultantReturnTarget);
|
|
39
|
+
const setPendingResolveTarget = useConversationStore((state) => state.setPendingResolveTarget);
|
|
40
|
+
const setSelectedConversationId = useConversationStore((state) => state.setSelectedConversationId);
|
|
41
|
+
const clearSelectedConversation = useConversationStore((state) => state.clearSelectedConversation);
|
|
42
|
+
const openConsultantChat = useCallback((consultantId) => {
|
|
43
|
+
const botConversation = useConversationStore.getState().conversationData;
|
|
44
|
+
if (!botConversation)
|
|
45
|
+
return;
|
|
46
|
+
setReturnTarget({
|
|
47
|
+
consultantId,
|
|
48
|
+
botConversationId: botConversation.conversationID,
|
|
49
|
+
hasArrived: false,
|
|
50
|
+
});
|
|
51
|
+
if (useUrlState) {
|
|
52
|
+
onNavigate(buildThreadUrl({ userId: consultantId }));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
// Bubble mode: the selected id would otherwise outrank the new target.
|
|
56
|
+
clearSelectedConversation();
|
|
57
|
+
setPendingResolveTarget({ userId: consultantId });
|
|
58
|
+
}, [
|
|
59
|
+
useUrlState,
|
|
60
|
+
onNavigate,
|
|
61
|
+
setReturnTarget,
|
|
62
|
+
clearSelectedConversation,
|
|
63
|
+
setPendingResolveTarget,
|
|
64
|
+
]);
|
|
65
|
+
const returnToBotThread = useCallback(() => {
|
|
66
|
+
if (!returnTarget)
|
|
67
|
+
return;
|
|
68
|
+
const { botConversationId } = returnTarget;
|
|
69
|
+
setReturnTarget(null);
|
|
70
|
+
// The URL drives the selection in page mode; writing the store first
|
|
71
|
+
// would race the stale ?userId= and re-open the consultant.
|
|
72
|
+
if (useUrlState) {
|
|
73
|
+
onNavigate(buildThreadUrl({ threadId: botConversationId }));
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
setPendingResolveTarget(null);
|
|
77
|
+
setSelectedConversationId(botConversationId);
|
|
78
|
+
}, [
|
|
79
|
+
returnTarget,
|
|
80
|
+
useUrlState,
|
|
81
|
+
onNavigate,
|
|
82
|
+
setReturnTarget,
|
|
83
|
+
setPendingResolveTarget,
|
|
84
|
+
setSelectedConversationId,
|
|
85
|
+
]);
|
|
86
|
+
const clearReturnTarget = useCallback(() => setReturnTarget(null), [setReturnTarget]);
|
|
87
|
+
return {
|
|
88
|
+
returnTarget,
|
|
89
|
+
openConsultantChat,
|
|
90
|
+
returnToBotThread,
|
|
91
|
+
clearReturnTarget,
|
|
92
|
+
setReturnTarget,
|
|
93
|
+
};
|
|
94
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useGlobalEvent.d.ts","sourceRoot":"","sources":["../../../src/hooks/global/useGlobalEvent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useGlobalEvent.d.ts","sourceRoot":"","sources":["../../../src/hooks/global/useGlobalEvent.ts"],"names":[],"mappings":"AAgDA,eAAO,MAAM,cAAc,YA+lB1B,CAAC"}
|
|
@@ -10,6 +10,7 @@ import { handleInputStatusChanged, removeTyperOnNewMessage, } from "../../hooks/
|
|
|
10
10
|
import { useChatContext } from "../../context/ChatContext";
|
|
11
11
|
import { useChatNavigate } from "../../hooks/conversation/useChatNavigate";
|
|
12
12
|
import useConversationStore from "../../store/conversation";
|
|
13
|
+
import { resolveConversationBotId } from "../../utils/conversation";
|
|
13
14
|
import useAuthStore from "../../store/auth";
|
|
14
15
|
import { useRefetchChatToken } from "../../hooks/init/useChatToken";
|
|
15
16
|
import { updateSession } from "../../hooks/session/useUpdateSession";
|
|
@@ -230,6 +231,32 @@ export const useGlobalEvent = () => {
|
|
|
230
231
|
const syncFailedHandler = () => {
|
|
231
232
|
updateSyncStatus(SyncStatus.Failed);
|
|
232
233
|
};
|
|
234
|
+
// The bot behind the open thread changed (flow swapped, type switched,
|
|
235
|
+
// activated/deactivated). Everything the bot UI renders is react-query
|
|
236
|
+
// cached and seeded from it — useBotFlow re-seeds its local state off
|
|
237
|
+
// detailQuery.data — so invalidating is enough; no event bus needed.
|
|
238
|
+
const handleBotUpdated = (botId) => {
|
|
239
|
+
if (!botId)
|
|
240
|
+
return;
|
|
241
|
+
const conversation = useConversationStore.getState().conversationData;
|
|
242
|
+
if (!conversation)
|
|
243
|
+
return;
|
|
244
|
+
// Returns "" (not undefined) for a non-bot thread, so a falsy check here
|
|
245
|
+
// covers both "not a bot conversation" and "no botId recorded".
|
|
246
|
+
const openBotId = resolveConversationBotId(conversation);
|
|
247
|
+
if (!openBotId || openBotId !== botId)
|
|
248
|
+
return;
|
|
249
|
+
const conversationId = conversation.conversationID;
|
|
250
|
+
void queryClient.invalidateQueries({
|
|
251
|
+
queryKey: [QUERY_KEYS.GET_CONVERSATION_DETAIL, conversationId],
|
|
252
|
+
});
|
|
253
|
+
void queryClient.invalidateQueries({
|
|
254
|
+
queryKey: [QUERY_KEYS.GET_BOT_MAIN_MENU, conversationId],
|
|
255
|
+
});
|
|
256
|
+
void queryClient.invalidateQueries({
|
|
257
|
+
queryKey: [QUERY_KEYS.GET_BOT_DETAIL, botId],
|
|
258
|
+
});
|
|
259
|
+
};
|
|
233
260
|
const businessNotificationHandler = ({ data, }) => {
|
|
234
261
|
console.log(data.key, "business notification");
|
|
235
262
|
switch (data.key) {
|
|
@@ -242,6 +269,11 @@ export const useGlobalEvent = () => {
|
|
|
242
269
|
queryKey: [QUERY_KEYS.GET_LIST_SESSION_BY_CONVERSATION],
|
|
243
270
|
});
|
|
244
271
|
break;
|
|
272
|
+
case BusinessNotificationType.BOT_UPDATED: {
|
|
273
|
+
const payload = JSON.parse(data.data || "{}");
|
|
274
|
+
handleBotUpdated(payload.botId);
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
245
277
|
default:
|
|
246
278
|
break;
|
|
247
279
|
}
|
|
@@ -27,7 +27,7 @@ export declare const useMessage: (conversationId?: string, searchClientMsgID?: s
|
|
|
27
27
|
export declare const pushNewMessage: (message: MessageItem) => void;
|
|
28
28
|
export declare const updateOneMessage: (message: MessageItem) => void;
|
|
29
29
|
export declare const removeOneMessage: (clientMsgID: string) => void;
|
|
30
|
-
export declare const getVisibleNeighbor: (allMessages: MessageItem[], current: MessageItem, direction: "prev" | "next") => MessageItem | undefined;
|
|
30
|
+
export declare const getVisibleNeighbor: (allMessages: MessageItem[], current: MessageItem, direction: "prev" | "next", isSkipped?: (candidate: MessageItem) => boolean) => MessageItem | undefined;
|
|
31
31
|
export declare const getImmediateNeighbor: (allMessages: MessageItem[], current: MessageItem, direction: "prev" | "next") => MessageItem | undefined;
|
|
32
32
|
export declare const mergeLatestMessages: (current: MessageItem[], fetched: MessageItem[]) => MessageItem[];
|
|
33
33
|
//# sourceMappingURL=useMessage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/message/useMessage.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,WAAW,EACX,WAAW,EAEZ,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"useMessage.d.ts","sourceRoot":"","sources":["../../../src/hooks/message/useMessage.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,WAAW,EACX,WAAW,EAEZ,MAAM,8BAA8B,CAAC;AAmBtC,eAAO,MAAM,kBAAkB,eAkB9B,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,SAAS,WAAW,EACpB,OAAO,OAAO,EACd,eAAe;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,EAAE,CAAC,EAAE,MAAM,CAAA;CAAE,EAC5E,eAAe,MAAM,KACpB,OA4BF,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,iBAAiB,MAAM,EACvB,oBAAoB,MAAM,EAC1B,iBAAc,EACd,uBAAqB,EAGrB,yBAAyB,MAAM,IAAI;;;;;qBAgBd,WAAW,EAAE;;;;;;qBAAb,WAAW,EAAE;;;;;;;CAoZnC,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,SAAS,WAAW,SACpB,CAAC;AAChC,eAAO,MAAM,gBAAgB,GAAI,SAAS,WAAW,SACpB,CAAC;AAClC,eAAO,MAAM,gBAAgB,GAAI,aAAa,MAAM,SACf,CAAC;AAEtC,eAAO,MAAM,kBAAkB,GAC7B,aAAa,WAAW,EAAE,EAC1B,SAAS,WAAW,EACpB,WAAW,MAAM,GAAG,MAAM,EAC1B,YAAY,CAAC,SAAS,EAAE,WAAW,KAAK,OAAO,KAC9C,WAAW,GAAG,SAqBhB,CAAC;AAMF,eAAO,MAAM,oBAAoB,GAC/B,aAAa,WAAW,EAAE,EAC1B,SAAS,WAAW,EACpB,WAAW,MAAM,GAAG,MAAM,KACzB,WAAW,GAAG,SAQhB,CAAC;AAmBF,eAAO,MAAM,mBAAmB,GAC9B,SAAS,WAAW,EAAE,EACtB,SAAS,WAAW,EAAE,kBAgBvB,CAAC"}
|
|
@@ -11,7 +11,7 @@ import { useChatContext } from "../../context/ChatContext";
|
|
|
11
11
|
import useAuthStore from "../../store/auth";
|
|
12
12
|
import { ConnectStatus, SyncStatus } from "../../types/chat";
|
|
13
13
|
import { GROUP_NOTIFICATION_MESSAGE_TYPES, isGroupNotificationMessageType, isSessionEventMessage, isSystemLogMessageType } from "../../utils/messageLog";
|
|
14
|
-
import { isRenderableCustomMessage } from "../../utils/customMessage";
|
|
14
|
+
import { isEventCustomMessage, isRenderableCustomMessage, } from "../../utils/customMessage";
|
|
15
15
|
import { isGroupConversation } from "../../utils/imCommon";
|
|
16
16
|
import { isSupportSessionAgentView } from "../../utils/conversation";
|
|
17
17
|
export const visibleTypeMessage = [
|
|
@@ -42,8 +42,10 @@ export const isMessageHiddenForViewer = (message, isCrm, conversation, viewerUse
|
|
|
42
42
|
!isGroupConversation(conversation)) {
|
|
43
43
|
return true;
|
|
44
44
|
}
|
|
45
|
+
// Automatic bot-thread messages are for the user only; product decided CS
|
|
46
|
+
// never sees them.
|
|
45
47
|
if (isCrm)
|
|
46
|
-
return
|
|
48
|
+
return isEventCustomMessage(message);
|
|
47
49
|
// An agent handling someone else's session (e.g. PDP CS) needs the
|
|
48
50
|
// assignment log and session dividers; the owner never sees them.
|
|
49
51
|
const isAgentView = isSupportSessionAgentView(conversation, viewerUserID);
|
|
@@ -402,7 +404,7 @@ onSearchMessageRevoked) => {
|
|
|
402
404
|
export const pushNewMessage = (message) => emit("PUSH_NEW_MSG", message);
|
|
403
405
|
export const updateOneMessage = (message) => emit("UPDATE_ONE_MSG", message);
|
|
404
406
|
export const removeOneMessage = (clientMsgID) => emit("REMOVE_ONE_MSG", clientMsgID);
|
|
405
|
-
export const getVisibleNeighbor = (allMessages, current, direction) => {
|
|
407
|
+
export const getVisibleNeighbor = (allMessages, current, direction, isSkipped) => {
|
|
406
408
|
const currentIndex = allMessages.findIndex((m) => m.clientMsgID === current.clientMsgID);
|
|
407
409
|
if (currentIndex === -1)
|
|
408
410
|
return undefined;
|
|
@@ -410,7 +412,8 @@ export const getVisibleNeighbor = (allMessages, current, direction) => {
|
|
|
410
412
|
let index = currentIndex + step;
|
|
411
413
|
while (index >= 0 && index < allMessages.length) {
|
|
412
414
|
const candidate = allMessages[index];
|
|
413
|
-
if (visibleTypeMessage.includes(candidate.contentType)
|
|
415
|
+
if (visibleTypeMessage.includes(candidate.contentType) &&
|
|
416
|
+
!(isSkipped === null || isSkipped === void 0 ? void 0 : isSkipped(candidate))) {
|
|
414
417
|
return candidate;
|
|
415
418
|
}
|
|
416
419
|
index += step;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNewMessageAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/hooks/message/useNewMessageAnnouncement.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useNewMessageAnnouncement.d.ts","sourceRoot":"","sources":["../../../src/hooks/message/useNewMessageAnnouncement.ts"],"names":[],"mappings":"AAaA,8FAA8F;AAC9F,eAAO,MAAM,yBAAyB,cA4BrC,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { useTranslation } from "react-i18next";
|
|
4
4
|
import emitter from "../../utils/events";
|
|
5
|
+
import { isEventCustomMessage } from "../../utils/customMessage";
|
|
5
6
|
import useAuthStore from "../../store/auth";
|
|
6
7
|
import { isGroupNotificationMessageType, isSessionEventMessage, isSystemLogMessageType, } from "../../utils/messageLog";
|
|
7
8
|
/** Text for an aria-live region: who wrote the newest incoming message, never its content. */
|
|
@@ -16,7 +17,8 @@ export const useNewMessageAnnouncement = () => {
|
|
|
16
17
|
return;
|
|
17
18
|
if (isSystemLogMessageType(message.contentType) ||
|
|
18
19
|
isGroupNotificationMessageType(message.contentType) ||
|
|
19
|
-
isSessionEventMessage(message)
|
|
20
|
+
isSessionEventMessage(message) ||
|
|
21
|
+
isEventCustomMessage(message))
|
|
20
22
|
return;
|
|
21
23
|
flip = !flip;
|
|
22
24
|
// The trailing space flip makes a repeat from the same sender announce again.
|
package/dist/index.d.ts
CHANGED
|
@@ -51,8 +51,8 @@ export { isInCsSession } from "./utils/botFlow";
|
|
|
51
51
|
export { fetchBotConversationDetail, } from "./hooks/conversation/useBotConversationDetail";
|
|
52
52
|
export { fetchConversationByBotId, } from "./hooks/conversation/useResolveConversation";
|
|
53
53
|
export { useSwitchToCsTeam, SwitchToCsTeamResult, } from "./hooks/conversation/useSwitchToCsTeam";
|
|
54
|
-
export { CustomMessageType } from "./types/customMessage";
|
|
55
|
-
export type { CustomElemOrderData, CustomMessagePayload, RenderCustomMessage, RenderCustomMessageArgs, } from "./types/customMessage";
|
|
54
|
+
export { CustomMessageType, MallEventType } from "./types/customMessage";
|
|
55
|
+
export type { CustomElemEventData, CustomElemOrderData, CustomMessagePayload, RenderCustomMessage, RenderCustomMessageArgs, } from "./types/customMessage";
|
|
56
56
|
export { useDChatAuth } from "./hooks/user/useAuth";
|
|
57
57
|
export { useSendMessage } from "./hooks/message/useSendMessage";
|
|
58
58
|
export type { UseSendMessageOptions } from "./hooks/message/useSendMessage";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,CAAC;AAExB,OAAO,gBAAgB,MAAM,wBAAwB,CAAC;AACtD,OAAO,SAAS,MAAM,kCAAkC,CAAC;AACzD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAC7E,OAAO,YAAY,MAAM,cAAc,CAAC;AACxC,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,EAAE,EAAE,MAAM,cAAc,CAAC;AAC7C,cAAc,eAAe,CAAC;AAG9B,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACzD,YAAY,EACV,UAAU,EACV,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5C,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,YAAY,EAAE,e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sB,CAAC;AAIvE,OAAO,EACL,QAAQ,IAAI,aAAa,EACzB,QAAQ,IAAI,aAAa,EACzB,WAAW,IAAI,gBAAgB,GAChC,CAAC;AAEF,YAAY,EAAE,uBAAuB,EAAE,CAAC;AAExC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,sBAAsB,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,7 @@ export { fetchBotConversationDetail, } from "./hooks/conversation/useBotConversa
|
|
|
49
49
|
export { fetchConversationByBotId, } from "./hooks/conversation/useResolveConversation";
|
|
50
50
|
export { useSwitchToCsTeam, SwitchToCsTeamResult, } from "./hooks/conversation/useSwitchToCsTeam";
|
|
51
51
|
//Custom message
|
|
52
|
-
export { CustomMessageType } from "./types/customMessage";
|
|
52
|
+
export { CustomMessageType, MallEventType } from "./types/customMessage";
|
|
53
53
|
//Hooks
|
|
54
54
|
export { useDChatAuth } from "./hooks/user/useAuth";
|
|
55
55
|
export { useSendMessage } from "./hooks/message/useSendMessage";
|