@droppii-org/chat-sdk 0.0.64 → 0.0.65

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/message/footer/index.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAK/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAGvD,UAAU,kBAAkB;IAC1B,cAAc,CAAC,EAAE,gBAAgB,CAAC;CACnC;AA+BD,eAAO,MAAM,oBAAoB,mDAI/B,CAAC;AAEH,eAAO,MAAM,uBAAuB,gCAAyC,CAAC;AAE9E,QAAA,MAAM,qBAAqB,GAAI,oBAAoB,kBAAkB,4CA4DpE,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/message/footer/index.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAK/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,UAAU,kBAAkB;IAC1B,cAAc,CAAC,EAAE,gBAAgB,CAAC;CACnC;AA+BD,eAAO,MAAM,oBAAoB,mDAI/B,CAAC;AAEH,eAAO,MAAM,uBAAuB,gCAAyC,CAAC;AAE9E,QAAA,MAAM,qBAAqB,GAAI,oBAAoB,kBAAkB,4CA4DpE,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -11,12 +11,11 @@ import { LinkNode } from "@lexical/link";
11
11
  import { HeadingNode, QuoteNode } from "@lexical/rich-text";
12
12
  import { ListItemNode, ListNode } from "@lexical/list";
13
13
  import { createContext, useCallback, useContext, useState } from "react";
14
- // import EnterHandler from "./EnterHandler";
14
+ import EnterHandler from "./EnterHandler";
15
15
  import ActionBar from "./ActionBar";
16
16
  import { useSendMessage } from "../../../hooks/message/useSendMessage";
17
17
  import FilePreview from "./FilePreview";
18
18
  import { useTranslation } from "react-i18next";
19
- import EnterHandler from "./EnterHandler";
20
19
  const theme = {
21
20
  text: {
22
21
  bold: "font-bold",
@@ -1 +1 @@
1
- {"version":3,"file":"SearchDrawer.d.ts","sourceRoot":"","sources":["../../../src/components/searchConversation/SearchDrawer.tsx"],"names":[],"mappings":"AAQA,QAAA,MAAM,YAAY,+CAsEjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"SearchDrawer.d.ts","sourceRoot":"","sources":["../../../src/components/searchConversation/SearchDrawer.tsx"],"names":[],"mappings":"AAQA,QAAA,MAAM,YAAY,+CAgFjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -4,7 +4,7 @@ import { Icon } from "../icon";
4
4
  import { useIsMobile } from "../../hooks/common/useIsMobile";
5
5
  import useBoolean from "ahooks/lib/useBoolean";
6
6
  import { useTranslation } from "react-i18next";
7
- import { useRef, useState } from "react";
7
+ import { useEffect, useRef, useState } from "react";
8
8
  import SearchMessageOnCurrentConversation from "./SearchMessageOnCurrentConversation";
9
9
  const SearchDrawer = () => {
10
10
  const { t } = useTranslation();
@@ -12,6 +12,15 @@ const SearchDrawer = () => {
12
12
  const [isOpen, { toggle }] = useBoolean(false);
13
13
  const [search, setSearch] = useState("");
14
14
  const isMobile = useIsMobile();
15
+ useEffect(() => {
16
+ if (isOpen) {
17
+ const timer = setTimeout(() => {
18
+ var _a;
19
+ (_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
20
+ }, 100);
21
+ return () => clearTimeout(timer);
22
+ }
23
+ }, [isOpen]);
15
24
  return (_jsxs("div", { children: [_jsx(Button, { type: "text", shape: "default", className: "text-gray-500 w-8 h-8 p-0", onClick: toggle, children: _jsx(Icon, { icon: "search-o", size: 22 }) }), _jsx(Drawer, { open: isOpen, onClose: toggle, mask: false, closeIcon: false, styles: {
16
25
  body: {
17
26
  padding: 0,
@@ -22,7 +22,7 @@ const SearchItemAsMessage = (props) => {
22
22
  if (isCrm)
23
23
  return false;
24
24
  const ownerId = (_c = (_b = (_a = JSON.parse((conversationData === null || conversationData === void 0 ? void 0 : conversationData.ex) || "{}")) === null || _a === void 0 ? void 0 : _a.sessionInfo) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.ownerId;
25
- return (user === null || user === void 0 ? void 0 : user.userID) === (message === null || message === void 0 ? void 0 : message.sendID);
25
+ return (user === null || user === void 0 ? void 0 : user.userID) !== (message === null || message === void 0 ? void 0 : message.sendID);
26
26
  }, [conversationData === null || conversationData === void 0 ? void 0 : conversationData.ex, message === null || message === void 0 ? void 0 : message.sendID, isCrm]);
27
27
  const onPressItem = async () => {
28
28
  const { data } = await DChatSDK.getOneConversation({
@@ -55,14 +55,14 @@ const SearchItemAsMessage = (props) => {
55
55
  }
56
56
  }
57
57
  return (_jsxs("div", { className: "py-3 px-2 flex items-center gap-3 hover:bg-gray-100 hover:rounded-sm cursor-pointer border-b mx-1", onClick: onPressItem, children: [_jsx("div", { children: _jsx(Avatar, { size: "large", src: useConversationDisplay
58
- ? conversationData === null || conversationData === void 0 ? void 0 : conversationData.faceURL
59
- : message.senderFaceUrl, alt: useConversationDisplay
60
- ? conversationData === null || conversationData === void 0 ? void 0 : conversationData.showName
61
- : message.senderNickname, children: useConversationDisplay
62
- ? conversationData === null || conversationData === void 0 ? void 0 : conversationData.showName.charAt(0).toUpperCase()
63
- : message.senderNickname.charAt(0).toUpperCase() }) }), _jsxs("div", { className: "flex flex-col flex-1 min-w-0 gap-1", children: [_jsxs("div", { className: "flex flex-1 items-center justify-between", children: [_jsx("span", { className: "text-sm flex-1 font-semibold truncate", children: useConversationDisplay
64
- ? conversationData === null || conversationData === void 0 ? void 0 : conversationData.showName
65
- : message.senderNickname }), _jsx("span", { className: "text-xs text-gray-500", children: formatTimestamp(message.sendTime, {
58
+ ? message.senderFaceUrl
59
+ : conversationData === null || conversationData === void 0 ? void 0 : conversationData.faceURL, alt: useConversationDisplay
60
+ ? message.senderNickname
61
+ : conversationData === null || conversationData === void 0 ? void 0 : conversationData.showName, children: useConversationDisplay
62
+ ? message.senderNickname.charAt(0).toUpperCase()
63
+ : conversationData === null || conversationData === void 0 ? void 0 : conversationData.showName.charAt(0).toUpperCase() }) }), _jsxs("div", { className: "flex flex-col flex-1 min-w-0 gap-1", children: [_jsxs("div", { className: "flex flex-1 items-center justify-between", children: [_jsx("span", { className: "text-sm flex-1 font-semibold truncate", children: useConversationDisplay
64
+ ? message.senderNickname
65
+ : conversationData === null || conversationData === void 0 ? void 0 : conversationData.showName }), _jsx("span", { className: "text-xs text-gray-500", children: formatTimestamp(message.sendTime, {
66
66
  hasTime: true,
67
67
  }) })] }), _jsx("div", { className: "flex flex-col flex-1 min-w-0", children: _jsx("span", { className: "text-xs flex-1 text-gray-500 truncate", dangerouslySetInnerHTML: {
68
68
  __html: highlightSearch(msgContent, searchTerm),
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/deskMessage/index.tsx"],"names":[],"mappings":"AAYA,QAAA,MAAM,gBAAgB,+CA+BrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/screens/deskMessage/index.tsx"],"names":[],"mappings":"AAWA,QAAA,MAAM,gBAAgB,+CA8BrB,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -8,11 +8,10 @@ import { ConnectStatus, SyncStatus } from "../../types/chat";
8
8
  import useConversationStore from "../../store/conversation";
9
9
  import DeskAssignedSession from "../../components/session/DeskAssignedSession";
10
10
  import ThreadInfo from "../../components/thread/ThreadInfo";
11
- import DChatBubble from "../chatBubble";
12
11
  const DChatDeskMessage = () => {
13
12
  const selectedConversationId = useConversationStore((state) => state.selectedConversationId);
14
13
  const searchClientMsgID = useConversationStore((state) => state.searchClientMsgID);
15
14
  const { connectStatus, syncStatus } = useChatContext();
16
- return (_jsx(_Fragment, { children: connectStatus === ConnectStatus.Connected ? (_jsx(Spin, { spinning: syncStatus === SyncStatus.Loading, children: _jsxs("div", { className: "flex flex-1 flex-row h-screen bg-gray-50", children: [_jsx(DeskAssignedSession, {}), _jsx(DeskConversationList, {}), _jsx(MessageList, { conversationId: selectedConversationId, searchClientMsgID: searchClientMsgID }), _jsx(ThreadInfo, {}), _jsx(DChatBubble, { conversationID: "sg_bot_25620a9f-b251-4861-9c03-77dc3906dc69_9ceb4d64-a51e-4ec9-a917-798270788e4d" })] }) })) : (_jsx("div", { className: "flex flex-1 flex-row h-screen bg-gray-50", children: connectStatus === ConnectStatus.Connecting && _jsx(Spin, { fullscreen: true }) })) }));
15
+ return (_jsx(_Fragment, { children: connectStatus === ConnectStatus.Connected ? (_jsx(Spin, { spinning: syncStatus === SyncStatus.Loading, children: _jsxs("div", { className: "flex flex-1 flex-row h-screen bg-gray-50", children: [_jsx(DeskAssignedSession, {}), _jsx(DeskConversationList, {}), _jsx(MessageList, { conversationId: selectedConversationId, searchClientMsgID: searchClientMsgID }), _jsx(ThreadInfo, {})] }) })) : (_jsx("div", { className: "flex flex-1 flex-row h-screen bg-gray-50", children: connectStatus === ConnectStatus.Connecting && _jsx(Spin, { fullscreen: true }) })) }));
17
16
  };
18
17
  export default DChatDeskMessage;