@droppii-org/chat-sdk 0.6.39 → 0.6.41
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/ConversationDetailInput.d.ts.map +1 -1
- package/dist/components/conversation-detail/ConversationDetailInput.js +9 -0
- package/dist/components/conversation-detail/PinnedMessageBar.d.ts +7 -1
- package/dist/components/conversation-detail/PinnedMessageBar.d.ts.map +1 -1
- package/dist/components/conversation-detail/PinnedMessageBar.js +4 -3
- package/dist/components/conversation-detail/PinnedMessageItem.d.ts +2 -1
- package/dist/components/conversation-detail/PinnedMessageItem.d.ts.map +1 -1
- package/dist/components/conversation-detail/PinnedMessageItem.js +9 -8
- package/dist/components/conversation-detail/PinnedMessagesPanel.d.ts +2 -1
- package/dist/components/conversation-detail/PinnedMessagesPanel.d.ts.map +1 -1
- package/dist/components/conversation-detail/PinnedMessagesPanel.js +2 -2
- package/dist/components/message/MessageList.d.ts +2 -0
- package/dist/components/message/MessageList.d.ts.map +1 -1
- package/dist/components/message/MessageList.js +3 -2
- package/dist/hooks/common/useOutsideTapDismiss.d.ts +12 -0
- package/dist/hooks/common/useOutsideTapDismiss.d.ts.map +1 -0
- package/dist/hooks/common/useOutsideTapDismiss.js +81 -0
- package/dist/hooks/message/usePinnedMessages.d.ts.map +1 -1
- package/dist/hooks/message/usePinnedMessages.js +6 -0
- package/dist/screens/conversation-detail/index.d.ts.map +1 -1
- package/dist/screens/conversation-detail/index.js +2 -1
- package/dist/screens/desk-message/index.d.ts.map +1 -1
- package/dist/screens/desk-message/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConversationDetailInput.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-detail/ConversationDetailInput.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConversationDetailInput.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-detail/ConversationDetailInput.tsx"],"names":[],"mappings":"AA2BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAoB/D,MAAM,WAAW,4BAA4B;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,WAAW,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,wEAAwE;IACxE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,QAAA,MAAM,uBAAuB,GAAI,yFAO9B,4BAA4B,4CA0vB9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -15,6 +15,7 @@ import useMessageDraftStore from "../../store/messageDraft";
|
|
|
15
15
|
import { emit } from "../../utils/events";
|
|
16
16
|
import { extractLinkUrls } from "../../utils/link";
|
|
17
17
|
import { useFetchUrlMetadata } from "../../hooks/common/useFetchUrlMetadata";
|
|
18
|
+
import { useOutsideTapDismiss } from "../../hooks/common/useOutsideTapDismiss";
|
|
18
19
|
import { processAndValidateDocuments, processAndValidateFiles, } from "../../utils/fileValidation";
|
|
19
20
|
import { FilePreviewList } from "../../components/message/footer/FilePreview";
|
|
20
21
|
import LinkInputPreview from "../../components/message/footer/LinkInputPreview";
|
|
@@ -97,6 +98,14 @@ const ConversationDetailInput = ({ placeholder, onSendMessage, onInputChange, mo
|
|
|
97
98
|
const [previewDismissed, setPreviewDismissed] = useState(false);
|
|
98
99
|
const [isMoreOptionOpen, { setFalse: closeMoreOption, toggle: toggleMoreOption },] = useBoolean(false);
|
|
99
100
|
const [isStickerOpen, { setFalse: closeSticker, toggle: toggleSticker },] = useBoolean(false);
|
|
101
|
+
useOutsideTapDismiss({
|
|
102
|
+
enabled: isMoreOptionOpen || isStickerOpen,
|
|
103
|
+
insideRef: containerRef,
|
|
104
|
+
onDismiss: () => {
|
|
105
|
+
closeMoreOption();
|
|
106
|
+
closeSticker();
|
|
107
|
+
},
|
|
108
|
+
});
|
|
100
109
|
const [caretIndex, setCaretIndex] = useState(0);
|
|
101
110
|
const rawMentionTrigger = useMentionTrigger(value, caretIndex);
|
|
102
111
|
// Escape dismisses the menu for the CURRENT trigger span without erasing
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
interface PinnedMessageBarProps {
|
|
2
|
+
/** CRM spec labels every pin "Tin nhắn từ {name}"; BIZ varies the label by message type. */
|
|
3
|
+
genericSubtitle?: boolean;
|
|
4
|
+
/** Hides unpin in the pinned panel for users the toolbox already denies pinning. */
|
|
5
|
+
canUnpin?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const PinnedMessageBar: ({ genericSubtitle, canUnpin, }: PinnedMessageBarProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
2
8
|
export default PinnedMessageBar;
|
|
3
9
|
//# sourceMappingURL=PinnedMessageBar.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PinnedMessageBar.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-detail/PinnedMessageBar.tsx"],"names":[],"mappings":"AA6HA,QAAA,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"PinnedMessageBar.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-detail/PinnedMessageBar.tsx"],"names":[],"mappings":"AA6HA,UAAU,qBAAqB;IAC7B,4FAA4F;IAC5F,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,oFAAoF;IACpF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,gBAAgB,GAAI,gCAGvB,qBAAqB,mDAkGvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -69,7 +69,7 @@ const PinnedMessageThumbnail = ({ message }) => {
|
|
|
69
69
|
}
|
|
70
70
|
return null;
|
|
71
71
|
};
|
|
72
|
-
const PinnedMessageBar = () => {
|
|
72
|
+
const PinnedMessageBar = ({ genericSubtitle = false, canUnpin = true, }) => {
|
|
73
73
|
const { t } = useTranslation();
|
|
74
74
|
const userID = useAuthStore((state) => state.userID);
|
|
75
75
|
const conversation = useConversationStore((state) => state.conversationData);
|
|
@@ -91,7 +91,8 @@ const PinnedMessageBar = () => {
|
|
|
91
91
|
? t("your_self")
|
|
92
92
|
: latestPinnedMessage.senderNickname || t("message_sender_unnamed");
|
|
93
93
|
const isRevoked = latestPinnedMessage.contentType === MessageType.RevokeMessage;
|
|
94
|
-
const subtitleKey =
|
|
94
|
+
const subtitleKey = (!genericSubtitle &&
|
|
95
|
+
PINNED_SUBTITLE_KEY_BY_TYPE[latestPinnedMessage.contentType]) ||
|
|
95
96
|
"pinned_from_text";
|
|
96
97
|
const title = isRevoked
|
|
97
98
|
? t("revoked")
|
|
@@ -104,6 +105,6 @@ const PinnedMessageBar = () => {
|
|
|
104
105
|
const hasFlushThumbnail = hasThumbnail &&
|
|
105
106
|
latestPinnedMessage.contentType !== MessageType.FileMessage;
|
|
106
107
|
const remainingPinnedCount = pinnedTotalCount - 1;
|
|
107
|
-
return (_jsxs(_Fragment, { children: [_jsxs("div", { "data-testid": "pinned-message-bar", "data-cp-name": "PinnedMessageBar", role: "button", tabIndex: 0, onClick: () => setIsPanelOpen(true), className: clsx("flex w-full shrink-0 cursor-pointer items-center gap-3 bg-gray-cool-25 pr-3", hasFlushThumbnail ? "py-0 pl-0" : "py-1 pl-3"), children: [hasThumbnail && (_jsx(PinnedMessageThumbnail, { message: latestPinnedMessage })), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col justify-center", children: [showTitle && (_jsx("p", { className: "truncate text-sm font-medium leading-[160%] text-gray-900", children: title })), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Icon, { icon: "thumbtack-b", size: 12, className: "text-[var(--dc-color-primary)]" }), _jsx("p", { className: "truncate text-[13px] leading-[160%] text-gray-600", children: t(subtitleKey, { name: senderName }) })] })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [remainingPinnedCount > 0 && (_jsxs("span", { className: "flex min-w-[26px] items-center justify-center rounded-full border-2 border-white bg-gradient-danger-light px-1 text-xs font-bold leading-[160%] text-white", children: ["+", remainingPinnedCount] })), _jsx(Icon, { icon: "angle-down-o", size: 20, className: "text-gray-600" })] })] }), _jsx(PinnedMessagesPanel, { open: isPanelOpen, onClose: () => setIsPanelOpen(false) })] }));
|
|
108
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { "data-testid": "pinned-message-bar", "data-cp-name": "PinnedMessageBar", role: "button", tabIndex: 0, onClick: () => setIsPanelOpen(true), className: clsx("flex w-full shrink-0 cursor-pointer items-center gap-3 bg-gray-cool-25 pr-3", hasFlushThumbnail ? "py-0 pl-0" : "py-1 pl-3"), children: [hasThumbnail && (_jsx(PinnedMessageThumbnail, { message: latestPinnedMessage })), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col justify-center", children: [showTitle && (_jsx("p", { className: "truncate text-sm font-medium leading-[160%] text-gray-900", children: title })), _jsxs("div", { className: "flex items-center gap-1", children: [_jsx(Icon, { icon: "thumbtack-b", size: 12, className: "text-[var(--dc-color-primary)]" }), _jsx("p", { className: "truncate text-[13px] leading-[160%] text-gray-600", children: t(subtitleKey, { name: senderName }) })] })] }), _jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [remainingPinnedCount > 0 && (_jsxs("span", { className: "flex min-w-[26px] items-center justify-center rounded-full border-2 border-white bg-gradient-danger-light px-1 text-xs font-bold leading-[160%] text-white", children: ["+", remainingPinnedCount] })), _jsx(Icon, { icon: "angle-down-o", size: 20, className: "text-gray-600" })] })] }), _jsx(PinnedMessagesPanel, { open: isPanelOpen, onClose: () => setIsPanelOpen(false), canUnpin: canUnpin })] }));
|
|
108
109
|
};
|
|
109
110
|
export default PinnedMessageBar;
|
|
@@ -5,7 +5,8 @@ interface PinnedMessageItemProps {
|
|
|
5
5
|
onContextMenuOpenChange: (open: boolean) => void;
|
|
6
6
|
onUnpin: (message: MessageItemType) => void;
|
|
7
7
|
onJump: (message: MessageItemType) => void;
|
|
8
|
+
canUnpin?: boolean;
|
|
8
9
|
}
|
|
9
|
-
declare const PinnedMessageItem: ({ message, contextMenuOpen, onContextMenuOpenChange, onUnpin, onJump, }: PinnedMessageItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const PinnedMessageItem: ({ message, contextMenuOpen, onContextMenuOpenChange, onUnpin, onJump, canUnpin, }: PinnedMessageItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export default PinnedMessageItem;
|
|
11
12
|
//# sourceMappingURL=PinnedMessageItem.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PinnedMessageItem.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-detail/PinnedMessageItem.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAY9E,UAAU,sBAAsB;IAC9B,OAAO,EAAE,eAAe,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,uBAAuB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,OAAO,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5C,MAAM,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"PinnedMessageItem.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-detail/PinnedMessageItem.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAY9E,UAAU,sBAAsB;IAC9B,OAAO,EAAE,eAAe,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,uBAAuB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,OAAO,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC5C,MAAM,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,IAAI,CAAC;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,iBAAiB,GAAI,mFAOxB,sBAAsB,4CAqFxB,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -8,17 +8,18 @@ import MessageBubble from "../../components/message/item/MessageBubble";
|
|
|
8
8
|
import { renderBubbleContent } from "../../components/message/item/renderMessageContent";
|
|
9
9
|
import { buildMessageToolboxMenuItems, MessageToolboxActionKey, MESSAGE_TOOLBOX_OVERLAY_CLASSNAME, } from "../../components/message/toolbox";
|
|
10
10
|
import useAuthStore from "../../store/auth";
|
|
11
|
-
const PinnedMessageItem = ({ message, contextMenuOpen, onContextMenuOpenChange, onUnpin, onJump, }) => {
|
|
11
|
+
const PinnedMessageItem = ({ message, contextMenuOpen, onContextMenuOpenChange, onUnpin, onJump, canUnpin = true, }) => {
|
|
12
12
|
const { t } = useTranslation();
|
|
13
13
|
const userID = useAuthStore((state) => state.userID);
|
|
14
14
|
const isMine = (message === null || message === void 0 ? void 0 : message.sendID) === userID;
|
|
15
|
+
const unpinAction = {
|
|
16
|
+
key: MessageToolboxActionKey.UNPIN,
|
|
17
|
+
label: t("context_menu_unpin"),
|
|
18
|
+
icon: "thumbtack-off-o",
|
|
19
|
+
onClick: () => onUnpin(message),
|
|
20
|
+
};
|
|
15
21
|
const contextMenuItems = buildMessageToolboxMenuItems([
|
|
16
|
-
|
|
17
|
-
key: MessageToolboxActionKey.UNPIN,
|
|
18
|
-
label: t("context_menu_unpin"),
|
|
19
|
-
icon: "thumbtack-off-o",
|
|
20
|
-
onClick: () => onUnpin(message),
|
|
21
|
-
},
|
|
22
|
+
...(canUnpin ? [unpinAction] : []),
|
|
22
23
|
{
|
|
23
24
|
key: MessageToolboxActionKey.VIEW_ORIGINAL,
|
|
24
25
|
label: t("context_menu_view_original"),
|
|
@@ -32,6 +33,6 @@ const PinnedMessageItem = ({ message, contextMenuOpen, onContextMenuOpenChange,
|
|
|
32
33
|
event.stopPropagation();
|
|
33
34
|
onUnpin(message);
|
|
34
35
|
}, className: "flex h-7 w-7 shrink-0 items-center justify-center self-center rounded-full bg-gray-25 text-gray-600", children: _jsx(Icon, { icon: "thumbtack-off-o", size: 16 }) }));
|
|
35
|
-
return (_jsxs("div", { "data-cp-name": "PinnedMessageItem", className: clsx("flex items-end gap-2 px-3 pb-4", isMine ? "justify-end" : "justify-start"), children: [isMine && unpinButton, _jsx(Dropdown, { menu: { items: contextMenuItems }, trigger: ["contextMenu"], open: contextMenuOpen, onOpenChange: onContextMenuOpenChange, overlayClassName: MESSAGE_TOOLBOX_OVERLAY_CLASSNAME, children: _jsxs("div", { className: "relative min-w-0 cursor-pointer", onClick: () => onJump(message), children: [_jsx("div", { className: "pointer-events-none", children: bubbleNode }), pinnedBadgeNode] }) }), !isMine && unpinButton] }));
|
|
36
|
+
return (_jsxs("div", { "data-cp-name": "PinnedMessageItem", className: clsx("flex items-end gap-2 px-3 pb-4", isMine ? "justify-end" : "justify-start"), children: [isMine && canUnpin && unpinButton, _jsx(Dropdown, { menu: { items: contextMenuItems }, trigger: ["contextMenu"], open: contextMenuOpen, onOpenChange: onContextMenuOpenChange, overlayClassName: MESSAGE_TOOLBOX_OVERLAY_CLASSNAME, children: _jsxs("div", { className: "relative min-w-0 cursor-pointer", onClick: () => onJump(message), children: [_jsx("div", { className: "pointer-events-none", children: bubbleNode }), pinnedBadgeNode] }) }), !isMine && canUnpin && unpinButton] }));
|
|
36
37
|
};
|
|
37
38
|
export default PinnedMessageItem;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
interface PinnedMessagesPanelProps {
|
|
2
2
|
open: boolean;
|
|
3
3
|
onClose: () => void;
|
|
4
|
+
canUnpin?: boolean;
|
|
4
5
|
}
|
|
5
|
-
declare const PinnedMessagesPanel: ({ open, onClose }: PinnedMessagesPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare const PinnedMessagesPanel: ({ open, onClose, canUnpin, }: PinnedMessagesPanelProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
7
|
export default PinnedMessagesPanel;
|
|
7
8
|
//# sourceMappingURL=PinnedMessagesPanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PinnedMessagesPanel.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-detail/PinnedMessagesPanel.tsx"],"names":[],"mappings":"AAYA,UAAU,wBAAwB;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"PinnedMessagesPanel.d.ts","sourceRoot":"","sources":["../../../src/components/conversation-detail/PinnedMessagesPanel.tsx"],"names":[],"mappings":"AAYA,UAAU,wBAAwB;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,mBAAmB,GAAI,8BAI1B,wBAAwB,4CAqG1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -8,7 +8,7 @@ import useConversationStore from "../../store/conversation";
|
|
|
8
8
|
import { usePinMessage } from "../../hooks/message/usePinMessage";
|
|
9
9
|
import { emit } from "../../utils/events";
|
|
10
10
|
import PinnedMessageItem from "./PinnedMessageItem";
|
|
11
|
-
const PinnedMessagesPanel = ({ open, onClose }) => {
|
|
11
|
+
const PinnedMessagesPanel = ({ open, onClose, canUnpin = true, }) => {
|
|
12
12
|
const { t } = useTranslation();
|
|
13
13
|
const conversation = useConversationStore((state) => state.conversationData);
|
|
14
14
|
const selectedConversationId = useConversationStore((state) => state.selectedConversationId);
|
|
@@ -46,6 +46,6 @@ const PinnedMessagesPanel = ({ open, onClose }) => {
|
|
|
46
46
|
borderTopRightRadius: 16,
|
|
47
47
|
overflow: "hidden",
|
|
48
48
|
},
|
|
49
|
-
}, getContainer: false, forceRender: true, children: _jsxs("div", { className: "flex h-full flex-col bg-white", children: [_jsxs("div", { className: "flex items-center gap-4 border-b border-gray-25 px-3 py-4", children: [_jsx("span", { className: "flex-1 text-lg font-bold text-gray-900", children: t("pinned_panel_title") }), _jsx(Button, { type: "text", shape: "default", className: "h-6 w-6 p-0 text-gray-900", onClick: onClose, "aria-label": t("pinned_panel_title"), children: _jsx(Icon, { icon: "close-b", size: 24 }) })] }), _jsxs("div", { className: "flex flex-1 flex-col gap-3 overflow-y-auto py-3", children: [_jsx("p", { className: "px-3 text-sm leading-[160%] text-gray-600", children: t("pinned_panel_hint") }), pinnedMessageList.map((message) => (_jsx(PinnedMessageItem, { message: message, contextMenuOpen: openContextMenuId === message.clientMsgID, onContextMenuOpenChange: (isOpen) => setOpenContextMenuId(isOpen ? message.clientMsgID : null), onUnpin: handleUnpin, onJump: handleJump }, message.clientMsgID)))] })] }) }));
|
|
49
|
+
}, getContainer: false, forceRender: true, children: _jsxs("div", { className: "flex h-full flex-col bg-white", children: [_jsxs("div", { className: "flex items-center gap-4 border-b border-gray-25 px-3 py-4", children: [_jsx("span", { className: "flex-1 text-lg font-bold text-gray-900", children: t("pinned_panel_title") }), _jsx(Button, { type: "text", shape: "default", className: "h-6 w-6 p-0 text-gray-900", onClick: onClose, "aria-label": t("pinned_panel_title"), children: _jsx(Icon, { icon: "close-b", size: 24 }) })] }), _jsxs("div", { className: "flex flex-1 flex-col gap-3 overflow-y-auto py-3", children: [_jsx("p", { className: "px-3 text-sm leading-[160%] text-gray-600", children: t("pinned_panel_hint") }), pinnedMessageList.map((message) => (_jsx(PinnedMessageItem, { message: message, contextMenuOpen: openContextMenuId === message.clientMsgID, onContextMenuOpenChange: (isOpen) => setOpenContextMenuId(isOpen ? message.clientMsgID : null), onUnpin: handleUnpin, onJump: handleJump, canUnpin: canUnpin }, message.clientMsgID)))] })] }) }));
|
|
50
50
|
};
|
|
51
51
|
export default PinnedMessagesPanel;
|
|
@@ -8,6 +8,8 @@ interface MessageListProps {
|
|
|
8
8
|
onCopyMessageLink?: (conversationId: string, clientMsgID: string) => void;
|
|
9
9
|
/** Called instead of the SDK's default toast when a jumped-to message turns out to be revoked. */
|
|
10
10
|
onSearchMessageRevoked?: () => void;
|
|
11
|
+
/** Renders the pinned-message bar under the header (CRM desk only). */
|
|
12
|
+
showPinnedMessageBar?: boolean;
|
|
11
13
|
}
|
|
12
14
|
declare const MessageList: (props: MessageListProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
15
|
export default MessageList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../../src/components/message/MessageList.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MessageList.d.ts","sourceRoot":"","sources":["../../../src/components/message/MessageList.tsx"],"names":[],"mappings":"AAkCA,UAAU,gBAAgB;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,iBAAiB,CAAC,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1E,kGAAkG;IAClG,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;IACpC,uEAAuE;IACvE,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,QAAA,MAAM,WAAW,GAAI,OAAO,gBAAgB,4CAuX3C,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -26,12 +26,13 @@ import { isGroupConversation } from "../../utils/imCommon";
|
|
|
26
26
|
import { ConnectStatus, SessionStatus } from "../../types/chat";
|
|
27
27
|
import { PeerType } from "../../types/conversation";
|
|
28
28
|
import PinLimitModal from "../../components/conversation-detail/PinLimitModal";
|
|
29
|
+
import PinnedMessageBar from "../../components/conversation-detail/PinnedMessageBar";
|
|
29
30
|
import ConfirmModal from "../../components/common/ConfirmModal";
|
|
30
31
|
dayjs.extend(isToday);
|
|
31
32
|
const MessageList = (props) => {
|
|
32
33
|
const { t } = useTranslation();
|
|
33
34
|
const { user, connectStatus, allowPinMessageWithoutPermission } = useChatContext();
|
|
34
|
-
const { onClose, conversationId, searchClientMsgID, openCreateCannedModal, onOpenThreadInfo, onCopyMessageLink, onSearchMessageRevoked, } = props;
|
|
35
|
+
const { onClose, conversationId, searchClientMsgID, openCreateCannedModal, onOpenThreadInfo, onCopyMessageLink, onSearchMessageRevoked, showPinnedMessageBar = false, } = props;
|
|
35
36
|
const conversationData = useConversationStore((state) => state.conversationData);
|
|
36
37
|
const permissions = useGroupPermission(conversationData === null || conversationData === void 0 ? void 0 : conversationData.groupID);
|
|
37
38
|
const isGroupChat = isGroupConversation(conversationData !== null && conversationData !== void 0 ? conversationData : undefined);
|
|
@@ -192,7 +193,7 @@ const MessageList = (props) => {
|
|
|
192
193
|
if (!conversationData) {
|
|
193
194
|
return (_jsx("div", { className: "flex flex-1 items-center justify-center h-full", children: connectStatus !== ConnectStatus.Connected ? (_jsx(Spin, {})) : (_jsx(Empty, { description: t("no_conversation_data") })) }));
|
|
194
195
|
}
|
|
195
|
-
return (_jsxs("div", { className: "flex flex-col flex-1 relative h-full min-w-0 overflow-hidden bg-white", "data-cp-name": "MessageList", children: [_jsx(MessageHeader, { onClose: onClose, currentSession: latestConversationSession, isJoined: isJoined, onOpenThreadInfo: onOpenThreadInfo }), _jsx(MessageInfiniteScroll, { scrollRef: scrollRef, scrollableTargetId: "scrollableMessagesDiv", loadState: loadState, moreOldLoading: moreOldLoading, onLoadMoreOld: loadMoreOldMessage, onScroll: handleInfiniteScroll, children: loadState.messageList.map((message, _, array) => (_jsx(MessageItem, { message: message, allMessages: array, isGroupChat: isGroupChat, contextMenuOpen: openMenuId === message.clientMsgID, onContextMenuOpenChange: (open) => setOpenMenuId(open ? message.clientMsgID : null), onRevokeMessage: handleOpenRevoke, onQuoteMessage: setQuotedMessage, onPressQuoteMessage: onPressQuoteMessage, onPinMessage: canPinMessage ? handlePinMessage : undefined, onUnpinMessage: canPinMessage ? handleUnpinMessage : undefined, timeRevealed: revealedTimeMsgId === message.clientMsgID, onToggleTimeReveal: handleToggleTimeReveal, onCopyMessageLink: handleCopyMessageLink }, message.clientMsgID))) }), moreNewLoading && (_jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) })), (Boolean(rawGroupId) && isCheckingMembership) || !isGroupStateFresh ? (_jsx("div", { className: "border-t bg-white py-4 flex items-center justify-center", children: _jsx(Spin, {}) })) : (latestConversationSession === null || latestConversationSession === void 0 ? void 0 : latestConversationSession.status) === SessionStatus.UNASSIGNED ? (_jsx(UnassignedSessionFooter, { sessionId: latestConversationSession.id, teamId: latestConversationSession.teamId })) : !isConfirmedGroup && shouldRestrictToLastSession ? (_jsxs("div", { className: "border-t bg-white py-4 flex flex-col items-center gap-2", "data-cp-name": "JoinGroupRequired", children: [_jsx("p", { className: "text-sm text-gray-500", children: t("join_group_required") }), _jsx(Button, { type: "primary", onClick: joinGroup, loading: isJoining, children: t("join_group") })] })) : isViewOnlyMember ? (
|
|
196
|
+
return (_jsxs("div", { className: "flex flex-col flex-1 relative h-full min-w-0 overflow-hidden bg-white", "data-cp-name": "MessageList", children: [_jsx(MessageHeader, { onClose: onClose, currentSession: latestConversationSession, isJoined: isJoined, onOpenThreadInfo: onOpenThreadInfo }), showPinnedMessageBar && (_jsx(PinnedMessageBar, { genericSubtitle: true, canUnpin: canPinMessage })), _jsx(MessageInfiniteScroll, { scrollRef: scrollRef, scrollableTargetId: "scrollableMessagesDiv", loadState: loadState, moreOldLoading: moreOldLoading, onLoadMoreOld: loadMoreOldMessage, onScroll: handleInfiniteScroll, children: loadState.messageList.map((message, _, array) => (_jsx(MessageItem, { message: message, allMessages: array, isGroupChat: isGroupChat, contextMenuOpen: openMenuId === message.clientMsgID, onContextMenuOpenChange: (open) => setOpenMenuId(open ? message.clientMsgID : null), onRevokeMessage: handleOpenRevoke, onQuoteMessage: setQuotedMessage, onPressQuoteMessage: onPressQuoteMessage, onPinMessage: canPinMessage ? handlePinMessage : undefined, onUnpinMessage: canPinMessage ? handleUnpinMessage : undefined, timeRevealed: revealedTimeMsgId === message.clientMsgID, onToggleTimeReveal: handleToggleTimeReveal, onCopyMessageLink: handleCopyMessageLink }, message.clientMsgID))) }), moreNewLoading && (_jsx("div", { className: "flex items-center justify-center py-2", children: _jsx(Spin, {}) })), (Boolean(rawGroupId) && isCheckingMembership) || !isGroupStateFresh ? (_jsx("div", { className: "border-t bg-white py-4 flex items-center justify-center", children: _jsx(Spin, {}) })) : (latestConversationSession === null || latestConversationSession === void 0 ? void 0 : latestConversationSession.status) === SessionStatus.UNASSIGNED ? (_jsx(UnassignedSessionFooter, { sessionId: latestConversationSession.id, teamId: latestConversationSession.teamId })) : !isConfirmedGroup && shouldRestrictToLastSession ? (_jsxs("div", { className: "border-t bg-white py-4 flex flex-col items-center gap-2", "data-cp-name": "JoinGroupRequired", children: [_jsx("p", { className: "text-sm text-gray-500", children: t("join_group_required") }), _jsx(Button, { type: "primary", onClick: joinGroup, loading: isJoining, children: t("join_group") })] })) : isViewOnlyMember ? (
|
|
196
197
|
// Brief fallback while isJoined catches up after the kick event.
|
|
197
198
|
_jsx(MessageFooter, { currentSession: latestConversationSession, openCreateCannedModal: openCreateCannedModal })) : !canSendMessage ? (_jsx("div", { className: "border-t bg-[#f5f5f5] py-3 flex items-center justify-center", children: _jsx("p", { className: "text-sm text-gray-500", children: t(isRestrictedByGroupMute
|
|
198
199
|
? "send_message_disabled_group_mute"
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
/** Marks the area where a tap closes the open composer panel (the thread timeline). */
|
|
3
|
+
export declare const COMPOSER_DISMISS_ZONE_ATTR = "data-composer-dismiss-zone";
|
|
4
|
+
interface UseOutsideTapDismissOptions {
|
|
5
|
+
enabled: boolean;
|
|
6
|
+
/** Taps inside this element never dismiss (the composer and its panels). */
|
|
7
|
+
insideRef: RefObject<HTMLElement | null>;
|
|
8
|
+
onDismiss: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const useOutsideTapDismiss: ({ enabled, insideRef, onDismiss, }: UseOutsideTapDismissOptions) => void;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=useOutsideTapDismiss.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOutsideTapDismiss.d.ts","sourceRoot":"","sources":["../../../src/hooks/common/useOutsideTapDismiss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAE1D,uFAAuF;AACvF,eAAO,MAAM,0BAA0B,+BAA+B,CAAC;AAOvE,UAAU,2BAA2B;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,4EAA4E;IAC5E,SAAS,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,CAAC;IACzC,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AA6BD,eAAO,MAAM,oBAAoB,GAAI,oCAIlC,2BAA2B,SAuD7B,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
/** Marks the area where a tap closes the open composer panel (the thread timeline). */
|
|
3
|
+
export const COMPOSER_DISMISS_ZONE_ATTR = "data-composer-dismiss-zone";
|
|
4
|
+
// Past this much pointer travel the gesture is a scroll/drag, not a tap.
|
|
5
|
+
const TAP_MOVE_TOLERANCE_PX = 10;
|
|
6
|
+
// Upper bound for a click that never arrives (pointerup on another element).
|
|
7
|
+
const SWALLOW_FALLBACK_MS = 1000;
|
|
8
|
+
const isInDismissZone = (target, inside) => {
|
|
9
|
+
if (!(target instanceof Element))
|
|
10
|
+
return false;
|
|
11
|
+
if (inside === null || inside === void 0 ? void 0 : inside.contains(target))
|
|
12
|
+
return false;
|
|
13
|
+
return target.closest(`[${COMPOSER_DISMISS_ZONE_ATTR}]`) !== null;
|
|
14
|
+
};
|
|
15
|
+
// The dismissing tap's click must not hit what sits under it; the window ends at
|
|
16
|
+
// the next pointerdown, so a browser-delayed click is still swallowed.
|
|
17
|
+
const swallowNextClick = () => {
|
|
18
|
+
const stop = () => {
|
|
19
|
+
window.removeEventListener("click", swallow, { capture: true });
|
|
20
|
+
window.removeEventListener("pointerdown", stop, { capture: true });
|
|
21
|
+
clearTimeout(fallbackTimer);
|
|
22
|
+
};
|
|
23
|
+
const swallow = (event) => {
|
|
24
|
+
event.preventDefault();
|
|
25
|
+
event.stopImmediatePropagation();
|
|
26
|
+
stop();
|
|
27
|
+
};
|
|
28
|
+
window.addEventListener("click", swallow, { capture: true });
|
|
29
|
+
window.addEventListener("pointerdown", stop, { capture: true });
|
|
30
|
+
const fallbackTimer = setTimeout(stop, SWALLOW_FALLBACK_MS);
|
|
31
|
+
};
|
|
32
|
+
export const useOutsideTapDismiss = ({ enabled, insideRef, onDismiss, }) => {
|
|
33
|
+
const onDismissRef = useRef(onDismiss);
|
|
34
|
+
onDismissRef.current = onDismiss;
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
if (!enabled)
|
|
37
|
+
return;
|
|
38
|
+
let tapStart = null;
|
|
39
|
+
const hasMoved = (event) => !!tapStart &&
|
|
40
|
+
Math.hypot(event.clientX - tapStart.x, event.clientY - tapStart.y) >
|
|
41
|
+
TAP_MOVE_TOLERANCE_PX;
|
|
42
|
+
// A second pointer landing mid-tap (pinch, two-finger touch) makes this a
|
|
43
|
+
// multi-touch gesture, so the pending tap is dropped rather than resumed.
|
|
44
|
+
const handlePointerDown = (event) => {
|
|
45
|
+
const isPrimaryTap = event.isPrimary !== false && event.button === 0;
|
|
46
|
+
tapStart =
|
|
47
|
+
isPrimaryTap && isInDismissZone(event.target, insideRef.current)
|
|
48
|
+
? { x: event.clientX, y: event.clientY, pointerId: event.pointerId }
|
|
49
|
+
: null;
|
|
50
|
+
};
|
|
51
|
+
const handlePointerMove = (event) => {
|
|
52
|
+
if ((tapStart === null || tapStart === void 0 ? void 0 : tapStart.pointerId) === event.pointerId && hasMoved(event)) {
|
|
53
|
+
tapStart = null;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const handlePointerUp = (event) => {
|
|
57
|
+
if (!tapStart || tapStart.pointerId !== event.pointerId)
|
|
58
|
+
return;
|
|
59
|
+
const isTap = !hasMoved(event) && isInDismissZone(event.target, insideRef.current);
|
|
60
|
+
tapStart = null;
|
|
61
|
+
if (!isTap)
|
|
62
|
+
return;
|
|
63
|
+
swallowNextClick();
|
|
64
|
+
onDismissRef.current();
|
|
65
|
+
};
|
|
66
|
+
// Touch scrolling cancels the pointer once the browser takes over the pan.
|
|
67
|
+
const handlePointerCancel = () => {
|
|
68
|
+
tapStart = null;
|
|
69
|
+
};
|
|
70
|
+
document.addEventListener("pointerdown", handlePointerDown, true);
|
|
71
|
+
document.addEventListener("pointermove", handlePointerMove, true);
|
|
72
|
+
document.addEventListener("pointerup", handlePointerUp, true);
|
|
73
|
+
document.addEventListener("pointercancel", handlePointerCancel, true);
|
|
74
|
+
return () => {
|
|
75
|
+
document.removeEventListener("pointerdown", handlePointerDown, true);
|
|
76
|
+
document.removeEventListener("pointermove", handlePointerMove, true);
|
|
77
|
+
document.removeEventListener("pointerup", handlePointerUp, true);
|
|
78
|
+
document.removeEventListener("pointercancel", handlePointerCancel, true);
|
|
79
|
+
};
|
|
80
|
+
}, [enabled, insideRef]);
|
|
81
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePinnedMessages.d.ts","sourceRoot":"","sources":["../../../src/hooks/message/usePinnedMessages.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB,GAAU,gBAAgB,MAAM,
|
|
1
|
+
{"version":3,"file":"usePinnedMessages.d.ts","sourceRoot":"","sources":["../../../src/hooks/message/usePinnedMessages.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB,GAAU,gBAAgB,MAAM,kBA2B/D,CAAC;AAEF,eAAO,MAAM,iBAAiB,GAAI,gBAAgB,MAAM;;;;CAqBvD,CAAC"}
|
|
@@ -11,6 +11,12 @@ export const fetchPinnedMessages = async (conversationID) => {
|
|
|
11
11
|
offset: 0,
|
|
12
12
|
pageSize: PAGE_SIZE.small,
|
|
13
13
|
});
|
|
14
|
+
// The store holds one thread's pins; a reply that lands after the user
|
|
15
|
+
// switched threads would paint the old thread's pins into the new one.
|
|
16
|
+
const { selectedConversationId, conversationData } = useConversationStore.getState();
|
|
17
|
+
const activeConversationId = selectedConversationId || (conversationData === null || conversationData === void 0 ? void 0 : conversationData.conversationID);
|
|
18
|
+
if (activeConversationId !== conversationID)
|
|
19
|
+
return;
|
|
14
20
|
const sortedMessageList = [...(data.messageList || [])].sort((first, second) => (second.pinnedTime || 0) - (first.pinnedTime || 0));
|
|
15
21
|
setPinnedMessageData(sortedMessageList, data.totalCount || 0, (_a = data.remainingPinCount) !== null && _a !== void 0 ? _a : 0, (_b = data.isEnd) !== null && _b !== void 0 ? _b : true);
|
|
16
22
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation-detail/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAWrF,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,6CAA6C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/conversation-detail/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAWrF,OAAO,EAEL,KAAK,4BAA4B,EAClC,MAAM,6CAA6C,CAAC;AAIrD,MAAM,WAAW,4BACf,SAAQ,4BAA4B,EAClC,4BAA4B;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB;;;OAGG;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,8IAc9B,4BAA4B,mDAyO9B,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -30,6 +30,7 @@ import { useBotFlow } from "../../hooks/conversation/useBotFlow";
|
|
|
30
30
|
import { BOT_TYPE } from "../../constants/botFlow";
|
|
31
31
|
import { useResolveConversation, } from "../../hooks/conversation/useResolveConversation";
|
|
32
32
|
import { isBotPeer } from "../../utils/conversation";
|
|
33
|
+
import { COMPOSER_DISMISS_ZONE_ATTR } from "../../hooks/common/useOutsideTapDismiss";
|
|
33
34
|
const DChatConversationDetail = (_a) => {
|
|
34
35
|
var _b;
|
|
35
36
|
var { className, children, onBack, conversationId, messageId, userId, groupId, botId,
|
|
@@ -114,6 +115,6 @@ const DChatConversationDetail = (_a) => {
|
|
|
114
115
|
!botFlow.flowIsEnd &&
|
|
115
116
|
botFlow.shouldShowButtons &&
|
|
116
117
|
botFlow.currentButtonsBlock ? (_jsx(BotButtonMessage, { buttons: botFlow.currentButtonsBlock.data.buttons, disabled: botFlow.isProcessing, onSelect: botFlow.selectButton, onRestart: botFlow.restart })) : null;
|
|
117
|
-
return (_jsxs("div", { "data-testid": "conversation-detail-root", className: clsx("relative flex h-full w-full flex-col overflow-hidden bg-white", className), children: [_jsx(ConversationDetailHeader, { conversation: conversation, onBack: handleBack, onProfileClick: openProfile }), _jsx(PinnedMessageBar, {}), _jsxs("div", { className: "relative flex min-h-0 flex-1 flex-col", children: [children !== null && children !== void 0 ? children : (_jsx(ConversationMessageList, { bottomSlot: botButtonsSlot, onCopyMessageLink: onCopyMessageLink, onSearchMessageRevoked: onSearchMessageRevoked })), _jsx(TypingIndicatorBar, { conversationId: conversation.conversationID })] }), footer, isBotThread && (_jsxs(_Fragment, { children: [_jsx(BotMenuSheet, { open: isMenuOpen, items: botFlow.menuItems, disabled: botFlow.isProcessing, onClose: closeMenu, onSelect: botFlow.selectMenuOption }), _jsx(CsSessionConfirmModal, { open: botFlow.isCsConfirmOpen, loading: botFlow.isProcessing, onCancel: botFlow.cancelMenuOption, onConfirm: botFlow.confirmEndCsSession })] })), _jsx(ThreadProfilePanel, { open: isProfileOpen, conversation: conversation, onClose: closeProfile, onSelectResource: setResourceTab }), _jsx(MediaResourcePanel, { open: resourceTab !== null, initialTab: resourceTab !== null && resourceTab !== void 0 ? resourceTab : MediaResourceTabKey.Image, onClose: () => setResourceTab(null) })] }));
|
|
118
|
+
return (_jsxs("div", { "data-testid": "conversation-detail-root", className: clsx("relative flex h-full w-full flex-col overflow-hidden bg-white", className), children: [_jsx(ConversationDetailHeader, { conversation: conversation, onBack: handleBack, onProfileClick: openProfile }), _jsx(PinnedMessageBar, {}), _jsxs("div", { [COMPOSER_DISMISS_ZONE_ATTR]: "", className: "relative flex min-h-0 flex-1 flex-col", children: [children !== null && children !== void 0 ? children : (_jsx(ConversationMessageList, { bottomSlot: botButtonsSlot, onCopyMessageLink: onCopyMessageLink, onSearchMessageRevoked: onSearchMessageRevoked })), _jsx(TypingIndicatorBar, { conversationId: conversation.conversationID })] }), footer, isBotThread && (_jsxs(_Fragment, { children: [_jsx(BotMenuSheet, { open: isMenuOpen, items: botFlow.menuItems, disabled: botFlow.isProcessing, onClose: closeMenu, onSelect: botFlow.selectMenuOption }), _jsx(CsSessionConfirmModal, { open: botFlow.isCsConfirmOpen, loading: botFlow.isProcessing, onCancel: botFlow.cancelMenuOption, onConfirm: botFlow.confirmEndCsSession })] })), _jsx(ThreadProfilePanel, { open: isProfileOpen, conversation: conversation, onClose: closeProfile, onSelectResource: setResourceTab }), _jsx(MediaResourcePanel, { open: resourceTab !== null, initialTab: resourceTab !== null && resourceTab !== void 0 ? resourceTab : MediaResourceTabKey.Image, onClose: () => setResourceTab(null) })] }));
|
|
118
119
|
};
|
|
119
120
|
export default DChatConversationDetail;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/desk-message/index.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,UAAU,qBAAqB;IAC7B,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;IACnC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,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,gBAAgB,GAAI,8FAKvB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/desk-message/index.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAE5E,UAAU,qBAAqB;IAC7B,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;IACnC,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAC9C,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,gBAAgB,GAAI,8FAKvB,qBAAqB,4CA2CvB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -14,6 +14,6 @@ const DChatDeskMessage = ({ openCreateCannedModal, groupThreadInfoConfig, onCopy
|
|
|
14
14
|
const searchClientMsgID = useConversationStore((state) => state.searchClientMsgID);
|
|
15
15
|
const [isThreadInfoOpen, { toggle: toggleThreadInfo, setFalse: closeThreadInfo },] = useBoolean(false);
|
|
16
16
|
const { connectStatus } = useChatContext();
|
|
17
|
-
return (_jsx(_Fragment, { children: connectStatus === ConnectStatus.Connected ? (_jsxs("div", { className: "flex flex-1 flex-row h-screen bg-[#f5f5f5]", children: [_jsx(DeskAssignedSession, {}), _jsx(DeskConversationList, {}), _jsx(MessageList, { conversationId: selectedConversationId, searchClientMsgID: searchClientMsgID, openCreateCannedModal: openCreateCannedModal, onOpenThreadInfo: toggleThreadInfo, onCopyMessageLink: onCopyMessageLink, onSearchMessageRevoked: onSearchMessageRevoked }), _jsx(ThreadInfo, { isOpen: isThreadInfoOpen, onClose: closeThreadInfo, groupConfig: groupThreadInfoConfig })] })) : (_jsx("div", { className: "flex flex-1 flex-row h-screen bg-[#f5f5f5]", children: connectStatus === ConnectStatus.Connecting && _jsx(Spin, { fullscreen: true }) })) }));
|
|
17
|
+
return (_jsx(_Fragment, { children: connectStatus === ConnectStatus.Connected ? (_jsxs("div", { className: "flex flex-1 flex-row h-screen bg-[#f5f5f5]", children: [_jsx(DeskAssignedSession, {}), _jsx(DeskConversationList, {}), _jsx(MessageList, { conversationId: selectedConversationId, searchClientMsgID: searchClientMsgID, openCreateCannedModal: openCreateCannedModal, onOpenThreadInfo: toggleThreadInfo, onCopyMessageLink: onCopyMessageLink, onSearchMessageRevoked: onSearchMessageRevoked, showPinnedMessageBar: true }), _jsx(ThreadInfo, { isOpen: isThreadInfoOpen, onClose: closeThreadInfo, groupConfig: groupThreadInfoConfig })] })) : (_jsx("div", { className: "flex flex-1 flex-row h-screen bg-[#f5f5f5]", children: connectStatus === ConnectStatus.Connecting && _jsx(Spin, { fullscreen: true }) })) }));
|
|
18
18
|
};
|
|
19
19
|
export default DChatDeskMessage;
|