@droppii-org/chat-sdk 0.0.29 → 0.0.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/assets/conversationBg.png +0 -0
  2. package/dist/assets/images/conversationBg.png +0 -0
  3. package/dist/assets/images/imageFailed.png +0 -0
  4. package/dist/assets/sdk/sql-wasm.wasm +0 -0
  5. package/dist/assets/sdk/version +1 -0
  6. package/dist/assets/sdk/wasm_exec.js +575 -0
  7. package/dist/assets/svg/document.d.ts +2 -0
  8. package/dist/assets/svg/document.d.ts.map +1 -0
  9. package/dist/assets/svg/document.js +2 -0
  10. package/dist/assets/svg/document.tsx +37 -0
  11. package/dist/assets/svg/index.d.ts +2 -0
  12. package/dist/assets/svg/index.d.ts.map +1 -0
  13. package/dist/assets/svg/index.js +1 -0
  14. package/dist/assets/svg/index.ts +1 -0
  15. package/dist/components/chatBubble/ChatBubble.d.ts.map +1 -1
  16. package/dist/components/chatBubble/ChatBubble.js +6 -11
  17. package/dist/components/conversation/ConversationItemList.d.ts +7 -0
  18. package/dist/components/conversation/ConversationItemList.d.ts.map +1 -0
  19. package/dist/components/conversation/ConversationItemList.js +20 -0
  20. package/dist/components/conversation/DeskConversationList.d.ts +1 -5
  21. package/dist/components/conversation/DeskConversationList.d.ts.map +1 -1
  22. package/dist/components/conversation/DeskConversationList.js +44 -29
  23. package/dist/components/mediaCollection/FileCollection.d.ts +3 -0
  24. package/dist/components/mediaCollection/FileCollection.d.ts.map +1 -0
  25. package/dist/components/mediaCollection/FileCollection.js +54 -0
  26. package/dist/components/mediaCollection/ImageCollection.d.ts +3 -0
  27. package/dist/components/mediaCollection/ImageCollection.d.ts.map +1 -0
  28. package/dist/components/mediaCollection/ImageCollection.js +37 -0
  29. package/dist/components/mediaCollection/LinkCollection.d.ts +3 -0
  30. package/dist/components/mediaCollection/LinkCollection.d.ts.map +1 -0
  31. package/dist/components/mediaCollection/LinkCollection.js +8 -0
  32. package/dist/components/mediaCollection/VideoCollection.d.ts +3 -0
  33. package/dist/components/mediaCollection/VideoCollection.d.ts.map +1 -0
  34. package/dist/components/mediaCollection/VideoCollection.js +53 -0
  35. package/dist/components/mediaCollection/index.d.ts +9 -0
  36. package/dist/components/mediaCollection/index.d.ts.map +1 -0
  37. package/dist/components/mediaCollection/index.js +54 -0
  38. package/dist/components/message/MessageHeader.d.ts.map +1 -1
  39. package/dist/components/message/MessageHeader.js +2 -1
  40. package/dist/components/message/MessageList.d.ts.map +1 -1
  41. package/dist/components/message/MessageList.js +15 -3
  42. package/dist/components/message/footer/FilePreview.d.ts +0 -1
  43. package/dist/components/message/footer/FilePreview.d.ts.map +1 -1
  44. package/dist/components/message/footer/FilePreview.js +4 -4
  45. package/dist/components/message/footer/ToolbarPlugin.js +1 -1
  46. package/dist/components/message/footer/index.js +1 -1
  47. package/dist/components/message/item/FileMessage.d.ts.map +1 -1
  48. package/dist/components/message/item/FileMessage.js +2 -1
  49. package/dist/components/message/item/ImageMessage.js +3 -3
  50. package/dist/components/message/item/TextMessage.js +2 -2
  51. package/dist/components/message/item/index.js +1 -1
  52. package/dist/components/session/AssignedSessionFilter.d.ts.map +1 -1
  53. package/dist/components/session/AssignedSessionFilter.js +20 -12
  54. package/dist/constants/images.d.ts +5 -0
  55. package/dist/constants/images.d.ts.map +1 -0
  56. package/dist/constants/images.js +7 -0
  57. package/dist/context/ChatContext.d.ts +2 -1
  58. package/dist/context/ChatContext.d.ts.map +1 -1
  59. package/dist/context/ChatContext.js +17 -24
  60. package/dist/hooks/collection/useMediaCollection.d.ts +229 -0
  61. package/dist/hooks/collection/useMediaCollection.d.ts.map +1 -0
  62. package/dist/hooks/collection/useMediaCollection.js +66 -0
  63. package/dist/hooks/common/useIsMobile.d.ts +2 -0
  64. package/dist/hooks/common/useIsMobile.d.ts.map +1 -0
  65. package/dist/hooks/common/useIsMobile.js +15 -0
  66. package/dist/hooks/global/useGlobalEvent.d.ts.map +1 -1
  67. package/dist/hooks/global/useGlobalEvent.js +55 -6
  68. package/dist/hooks/init/useChatToken.d.ts +2 -0
  69. package/dist/hooks/init/useChatToken.d.ts.map +1 -0
  70. package/dist/hooks/init/useChatToken.js +11 -0
  71. package/dist/hooks/message/useSendMessage.d.ts.map +1 -1
  72. package/dist/hooks/message/useSendMessage.js +31 -12
  73. package/dist/index.d.ts +4 -2
  74. package/dist/index.d.ts.map +1 -1
  75. package/dist/index.js +1 -0
  76. package/dist/layout/index.d.ts.map +1 -1
  77. package/dist/layout/index.js +2 -5
  78. package/dist/locales/i18n.d.ts +3 -0
  79. package/dist/locales/i18n.d.ts.map +1 -0
  80. package/dist/locales/i18n.js +16 -0
  81. package/dist/locales/i18n.ts +18 -0
  82. package/dist/locales/vi/common.json +9 -0
  83. package/dist/screens/chatBubble/index.d.ts.map +1 -1
  84. package/dist/screens/chatBubble/index.js +4 -3
  85. package/dist/screens/deskMessage/index.d.ts.map +1 -1
  86. package/dist/screens/deskMessage/index.js +3 -3
  87. package/dist/services/api.d.ts +2 -0
  88. package/dist/services/api.d.ts.map +1 -0
  89. package/dist/services/api.js +16 -0
  90. package/dist/services/query.d.ts +5 -0
  91. package/dist/services/query.d.ts.map +1 -0
  92. package/dist/services/query.js +4 -0
  93. package/dist/services/routes.d.ts +15 -0
  94. package/dist/services/routes.d.ts.map +1 -0
  95. package/dist/services/routes.js +14 -0
  96. package/dist/store/auth.d.ts +4 -0
  97. package/dist/store/auth.d.ts.map +1 -0
  98. package/dist/store/auth.js +16 -0
  99. package/dist/store/conversation.d.ts.map +1 -1
  100. package/dist/store/conversation.js +4 -1
  101. package/dist/styles/global.css +1 -1
  102. package/dist/types/chat.d.ts +10 -4
  103. package/dist/types/chat.d.ts.map +1 -1
  104. package/dist/types/dto.d.ts +35 -0
  105. package/dist/types/dto.d.ts.map +1 -0
  106. package/dist/types/dto.js +1 -0
  107. package/dist/utils/common.d.ts +2 -0
  108. package/dist/utils/common.d.ts.map +1 -0
  109. package/dist/utils/common.js +12 -0
  110. package/package.json +15 -3
@@ -4,12 +4,12 @@ import { useCallback } from "react";
4
4
  import { useMessageFooterContext } from ".";
5
5
  import { Button } from "antd";
6
6
  import { Icon } from "../../icon";
7
+ import { documentIcon } from "../../../assets/svg";
7
8
  const documentTypes = [
8
9
  "application/pdf",
9
10
  "application/msword",
10
11
  "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
11
12
  ];
12
- export const documentIcon = (_jsxs("svg", { width: "40", height: "40", viewBox: "0 0 40 40", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M10.1923 5.83301L23.4363 5.83301L34.1656 14.2054V29.8639C34.1656 31.8997 32.5286 34.1663 29.8068 34.1663C27.0849 34.1663 10.1923 34.1663 10.1923 34.1663C7.4704 34.1663 5.8335 31.8997 5.8335 29.8639V10.0305C5.8335 7.99475 7.4704 5.83301 10.1923 5.83301Z", fill: "#24B0FF" }), _jsx("path", { d: "M10.8335 28.1394V20.833H16.0309V22.4222H12.7026V23.5916H15.3612V25.1708H12.7026V28.1394H10.8335Z", fill: "#edf6ff" }), _jsx("path", { d: "M19.0073 28.0885V20.833H20.8613V26.5118H24.0146V28.0885L19.0073 28.0885Z", fill: "#edf6ff" }), _jsx("path", { d: "M16.5918 28.1001V20.833H18.4485V28.1001H16.5918Z", fill: "#edf6ff" }), _jsx("path", { d: "M24.5737 20.833V28.1393H29.7723V26.5573H26.439L26.4422 25.1708H29.1017V23.5916H26.4422V22.4222H29.7723V20.833H24.5737Z", fill: "#edf6ff" }), _jsx("path", { opacity: "0.302", "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M23.2686 5.83301V14.2281H34.1655L23.2686 5.83301Z", fill: "#edf6ff" })] }));
13
13
  export const shortenFileName = (name, options = {}) => {
14
14
  const { maxLength = 20, keepStart = 8, keepEnd = 3 } = options;
15
15
  if (name.length <= maxLength)
@@ -31,7 +31,7 @@ const FilePreview = () => {
31
31
  setListUploadFiles(listUploadFiles.filter((f) => f.uid !== file.uid));
32
32
  };
33
33
  const renderFilePreview = useCallback((file) => {
34
- var _a, _b;
34
+ var _a, _b, _c;
35
35
  const isDocument = documentTypes.includes(((_a = file === null || file === void 0 ? void 0 : file.originFileObj) === null || _a === void 0 ? void 0 : _a.type) || "");
36
36
  const isVideo = (_b = file.type) === null || _b === void 0 ? void 0 : _b.startsWith("video/");
37
37
  let src = file.url;
@@ -39,10 +39,10 @@ const FilePreview = () => {
39
39
  src = URL.createObjectURL(file.originFileObj);
40
40
  }
41
41
  if (isDocument) {
42
- return (_jsxs("div", { className: "relative flex flex-row items-center gap-2 align-center bg-gray-100 rounded-md p-1 pr-2", children: [documentIcon, _jsx("span", { className: "text-xs text-gray-500", children: shortenFileName(file.name) }), _jsx(Button, { className: "absolute top-[-8px] right-[-8px] w-5 h-5 rounded-full p-0 bg-gray-500 hover:bg-gray-600", type: "primary", onClick: () => onRemoveFile(file), children: _jsx(Icon, { icon: "close-b", size: 12, color: "white" }) })] }, file.uid));
42
+ return (_jsxs("div", { className: "relative flex flex-row items-center gap-2 align-center bg-gray-100 rounded-md p-1 pr-2", children: [documentIcon, _jsx("span", { className: "text-xs text-gray-500", children: shortenFileName(((_c = file === null || file === void 0 ? void 0 : file.originFileObj) === null || _c === void 0 ? void 0 : _c.name) || "") }), _jsx(Button, { className: "absolute top-[-8px] right-[-8px] w-5 h-5 rounded-full p-0 bg-gray-500 hover:bg-gray-600", type: "primary", onClick: () => onRemoveFile(file), children: _jsx(Icon, { icon: "close-b", size: 12, color: "white" }) })] }, file.uid));
43
43
  }
44
44
  return (_jsxs("div", { className: "relative rounded-md border", children: [isVideo ? (_jsx("video", { src: src, className: "w-[48px] h-[48px] object-cover rounded-lg", autoPlay: false })) : (_jsx("img", { src: src, alt: file.name, className: "w-[48px] h-[48px] object-cover rounded-lg" })), _jsx(Button, { className: "absolute top-[-8px] right-[-8px] w-5 h-5 rounded-full p-0 bg-gray-500 hover:bg-gray-600", type: "primary", onClick: () => onRemoveFile(file), children: _jsx(Icon, { icon: "close-b", size: 12, color: "white" }) }), isVideo && (_jsx(Icon, { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2", icon: "play-b", size: 20, color: "white" }))] }, file.uid));
45
45
  }, [listUploadFiles]);
46
- return (_jsx("div", { className: "overflow-x-auto", children: _jsx("div", { className: "border-b py-2 px-4", children: _jsx("div", { className: "flex items-center gap-2", children: listUploadFiles.map((file) => renderFilePreview(file)) }) }) }));
46
+ return (_jsx("div", { className: "overflow-x-auto mb-[-4px]", children: _jsx("div", { className: "border-b py-2 px-4", children: _jsx("div", { className: "flex items-center gap-2", children: listUploadFiles.map((file) => renderFilePreview(file)) }) }) }));
47
47
  };
48
48
  export default FilePreview;
@@ -156,7 +156,7 @@ export const ToolbarPlugin = () => {
156
156
  removeSelectionListener();
157
157
  };
158
158
  }, [editor]);
159
- return (_jsxs("div", { className: "flex items-center gap-2 px-4", children: [formatTextButtons.map((button) => {
159
+ return (_jsxs("div", { className: "flex items-center gap-2 px-4 pt-1", children: [formatTextButtons.map((button) => {
160
160
  const { icon, onPress, key, isActive } = button;
161
161
  return (_jsx(Button, { type: "text", shape: "default", className: getButtonClasses(isActive), onClick: onPress, children: icon }, key));
162
162
  }), insertListButtons.map((button) => {
@@ -60,6 +60,6 @@ const MessageFooterProvider = (props) => {
60
60
  }
61
61
  setListUploadFiles([]);
62
62
  }, [sendMergeMessage, sendTextMessage, listUploadFiles]);
63
- return (_jsx(MessageFooterContext.Provider, { value: { onSendMessage, listUploadFiles, setListUploadFiles }, children: _jsxs(LexicalComposer, { initialConfig: initialConfig, children: [_jsxs("div", { className: "border-t pb-2 flex flex-col gap-1", children: [listUploadFiles.length > 0 && _jsx(FilePreview, {}), _jsx(ToolbarPlugin, {}), _jsx("div", { className: "relative px-4", children: _jsx(RichTextPlugin, { contentEditable: _jsx(ContentEditable, { className: "border border-indigo-500 rounded-md bg-blue-100 min-h-[64px] max-h-[140px] overflow-y-auto px-3 py-2 text-sm" }), ErrorBoundary: LexicalErrorBoundary, "aria-placeholder": "Nh\u1EADp tin nh\u1EAFn", placeholder: _jsx("div", { className: "absolute top-2 left-7 pointer-events-none", children: _jsx("p", { className: "text-gray-500 text-sm", children: "Nh\u1EADp tin nh\u1EAFn" }) }) }) }), _jsx(ActionBar, {})] }), _jsx(LinkPlugin, {}), _jsx(ListPlugin, {}), _jsx(EnterHandler, {})] }) }));
63
+ return (_jsx(MessageFooterContext.Provider, { value: { onSendMessage, listUploadFiles, setListUploadFiles }, children: _jsxs(LexicalComposer, { initialConfig: initialConfig, children: [_jsxs("div", { className: "border-t pb-2 flex flex-col gap-1 bg-white", children: [listUploadFiles.length > 0 && _jsx(FilePreview, {}), _jsx(ToolbarPlugin, {}), _jsx("div", { className: "relative px-4", children: _jsx(RichTextPlugin, { contentEditable: _jsx(ContentEditable, { className: "border border-indigo-500 rounded-md bg-blue-100 min-h-[64px] max-h-[140px] overflow-y-auto px-3 py-2 text-sm" }), ErrorBoundary: LexicalErrorBoundary, "aria-placeholder": "Nh\u1EADp tin nh\u1EAFn", placeholder: _jsx("div", { className: "absolute top-2 left-7 pointer-events-none", children: _jsx("p", { className: "text-gray-500 text-sm", children: "Nh\u1EADp tin nh\u1EAFn" }) }) }) }), _jsx(ActionBar, {})] }), _jsx(LinkPlugin, {}), _jsx(ListPlugin, {}), _jsx(EnterHandler, {})] }) }));
64
64
  };
65
65
  export default MessageFooterProvider;
@@ -1 +1 @@
1
- {"version":3,"file":"FileMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/FileMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,UAAU,qBAAqB;IAC7B,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,QAAA,MAAM,eAAe,GAAI,OAAO,qBAAqB,4CAmCpD,CAAC;AAEF,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"FileMessage.d.ts","sourceRoot":"","sources":["../../../../src/components/message/item/FileMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD,UAAU,qBAAqB;IAC7B,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,QAAA,MAAM,eAAe,GAAI,OAAO,qBAAqB,4CAmCpD,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { documentIcon, shortenFileName } from "../footer/FilePreview";
2
+ import { shortenFileName } from "../footer/FilePreview";
3
+ import { documentIcon } from "../../../assets/svg";
3
4
  const FileMessageItem = (props) => {
4
5
  var _a;
5
6
  const { message } = props;
@@ -3,7 +3,7 @@ import { MessageStatus } from "@openim/wasm-client-sdk";
3
3
  import { Image, Spin } from "antd";
4
4
  const min = (a, b) => (a > b ? b : a);
5
5
  const ImageMessageItem = (props) => {
6
- var _a, _b, _c;
6
+ var _a, _b, _c, _d;
7
7
  const { message } = props;
8
8
  const imageHeight = message.pictureElem.sourcePicture.height;
9
9
  const imageWidth = message.pictureElem.sourcePicture.width;
@@ -11,8 +11,8 @@ const ImageMessageItem = (props) => {
11
11
  const minHeight = min(200, imageWidth) * (imageHeight / imageWidth) + 2;
12
12
  const adaptedHight = min(minHeight, snapshotMaxHeight) + 10;
13
13
  const adaptedWidth = min(imageWidth, 200) + 10;
14
- const sourceUrl = ((_c = message.pictureElem.snapshotPicture) === null || _c === void 0 ? void 0 : _c.url) ||
15
- message.pictureElem.sourcePicture.url;
14
+ const sourceUrl = ((_c = message.pictureElem.sourcePicture) === null || _c === void 0 ? void 0 : _c.url) ||
15
+ ((_d = message.pictureElem.snapshotPicture) === null || _d === void 0 ? void 0 : _d.url);
16
16
  const isSending = message.status === MessageStatus.Sending;
17
17
  const minStyle = {
18
18
  minHeight: `${adaptedHight}px`,
@@ -14,8 +14,8 @@ const TextMessageItem = (props) => {
14
14
  if (Object.keys(extendMessageInfo).length > 0 &&
15
15
  (extendMessageInfo === null || extendMessageInfo === void 0 ? void 0 : extendMessageInfo.messageInfo)) {
16
16
  const htmlContent = ((_b = (_a = extendMessageInfo === null || extendMessageInfo === void 0 ? void 0 : extendMessageInfo.messageInfo) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.content) || "";
17
- return (_jsx("div", { className: "text-sm sm:text-base break-words whitespace-pre-line flex-1", dangerouslySetInnerHTML: { __html: htmlContent } }));
17
+ return (_jsx("div", { className: "!text-sm sm:text-base break-words whitespace-pre-line flex-1", dangerouslySetInnerHTML: { __html: htmlContent } }));
18
18
  }
19
- return (_jsx("span", { className: "text-sm sm:text-base whitespace-pre-wrap", children: ((_c = message === null || message === void 0 ? void 0 : message.textElem) === null || _c === void 0 ? void 0 : _c.content) || "" }));
19
+ return (_jsx("span", { className: "!text-sm sm:text-base whitespace-pre-wrap", children: ((_c = message === null || message === void 0 ? void 0 : message.textElem) === null || _c === void 0 ? void 0 : _c.content) || "" }));
20
20
  };
21
21
  export default TextMessageItem;
@@ -52,7 +52,7 @@ const MessageItem = ({ groupMessage }) => {
52
52
  const isMine = (message === null || message === void 0 ? void 0 : message.sendID) === (user === null || user === void 0 ? void 0 : user.userID);
53
53
  const showAvatar = messageIndex === messagesInGroup.length - 1;
54
54
  const showSenderName = messageIndex === 0 && (message === null || message === void 0 ? void 0 : message.sessionType) === SessionType.Group;
55
- return (_jsx("div", { className: clsx("flex", isMine ? "justify-end" : "justify-start"), children: _jsxs("div", { className: clsx("flex flex-1 items-end gap-2", isMine ? "justify-end" : "justify-start"), children: [!isMine && (_jsx("div", { className: "flex items-center justify-center w-[32px] h-[32px]", children: showAvatar && (_jsx(Avatar, { children: ((_b = (_a = message === null || message === void 0 ? void 0 : message.senderNickname) === null || _a === void 0 ? void 0 : _a.charAt) === null || _b === void 0 ? void 0 : _b.call(_a, 0)) || "A" })) })), _jsxs("div", { className: clsx("flex flex-col flex-[0.8]", isMine ? "items-end" : "items-start"), children: [!isMine && showSenderName && (_jsx("span", { className: "text-xs text-gray-500 mb-1 px-3", children: message === null || message === void 0 ? void 0 : message.senderNickname })), _jsxs("div", { className: clsx("px-3 py-2 rounded-2xl max-w-full break-words flex flex-col flex-1 text-gray-900 gap-1", isMine ? "bg-blue-100" : "bg-gray-100"), children: [(message === null || message === void 0 ? void 0 : message.contentType) === MessageType.MergeMessage ? (_jsxs("div", { children: [(_d = (_c = message === null || message === void 0 ? void 0 : message.mergeElem) === null || _c === void 0 ? void 0 : _c.multiMessage) === null || _d === void 0 ? void 0 : _d.map((item) => {
55
+ return (_jsx("div", { className: clsx("flex", isMine ? "justify-end" : "justify-start"), children: _jsxs("div", { className: clsx("flex flex-1 items-end gap-2", isMine ? "justify-end" : "justify-start"), children: [!isMine && (_jsx("div", { className: "flex items-center justify-center w-[32px] h-[32px]", children: showAvatar && (_jsx(Avatar, { children: ((_b = (_a = message === null || message === void 0 ? void 0 : message.senderNickname) === null || _a === void 0 ? void 0 : _a.charAt) === null || _b === void 0 ? void 0 : _b.call(_a, 0)) || "A" })) })), _jsxs("div", { className: clsx("flex flex-col flex-[0.8]", isMine ? "items-end" : "items-start"), children: [!isMine && showSenderName && (_jsx("span", { className: "text-xs text-gray-500 mb-1 px-3", children: message === null || message === void 0 ? void 0 : message.senderNickname })), _jsxs("div", { className: clsx("px-3 py-2 rounded-2xl max-w-full break-words flex flex-col flex-1 text-gray-900 gap-1", isMine ? "bg-blue-100" : "bg-white"), children: [(message === null || message === void 0 ? void 0 : message.contentType) === MessageType.MergeMessage ? (_jsxs("div", { children: [(_d = (_c = message === null || message === void 0 ? void 0 : message.mergeElem) === null || _c === void 0 ? void 0 : _c.multiMessage) === null || _d === void 0 ? void 0 : _d.map((item) => {
56
56
  return renderMessageByType(item);
57
57
  }), (message === null || message === void 0 ? void 0 : message.textElem) && (_jsx(TextMessageItem, { message: message }))] })) : (renderMessageByType(message)), _jsx("span", { className: clsx("text-xs text-gray-500 text-right text-gray-500"), children: dayjs(message === null || message === void 0 ? void 0 : message.sendTime).format("HH:mm") })] })] })] }) }, message === null || message === void 0 ? void 0 : message.clientMsgID));
58
58
  })] }, groupMessage === null || groupMessage === void 0 ? void 0 : groupMessage.groupMessageID));
@@ -1 +1 @@
1
- {"version":3,"file":"AssignedSessionFilter.d.ts","sourceRoot":"","sources":["../../../src/components/session/AssignedSessionFilter.tsx"],"names":[],"mappings":"AAyBA,UAAU,0BAA0B;IAClC,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,qBAAqB,GAAI,gCAG5B,0BAA0B,4CA6P5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"AssignedSessionFilter.d.ts","sourceRoot":"","sources":["../../../src/components/session/AssignedSessionFilter.tsx"],"names":[],"mappings":"AA2BA,UAAU,0BAA0B;IAClC,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,qBAAqB,GAAI,gCAG5B,0BAA0B,4CAwQ5B,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -6,7 +6,7 @@ import useConversationStore from "../../store/conversation";
6
6
  import { SESSION_STATUS_ENUM, TAG_ENUM } from "../../constants";
7
7
  const AssignedSessionFilter = ({ onFilterChange, className = "", }) => {
8
8
  const [expandedCategories, setExpandedCategories] = useState(new Set([0]));
9
- const [selectedFilter, setSelectedFilter] = useState("");
9
+ const [selectedFilter, setSelectedFilter] = useState(SESSION_STATUS_ENUM.UNASSIGNED);
10
10
  const summary = useConversationStore((state) => state.summary);
11
11
  const setFilterSummary = useConversationStore((state) => state.setFilterSummary);
12
12
  const messageCategories = useMemo(() => {
@@ -15,6 +15,7 @@ const AssignedSessionFilter = ({ onFilterChange, className = "", }) => {
15
15
  {
16
16
  icon: "chat-square-b",
17
17
  label: "Đang mở",
18
+ key: "ALL",
18
19
  count: (summary === null || summary === void 0 ? void 0 : summary.activeSessionCount) || 0,
19
20
  color: "text-gray-600",
20
21
  query: {
@@ -25,6 +26,7 @@ const AssignedSessionFilter = ({ onFilterChange, className = "", }) => {
25
26
  {
26
27
  icon: "user-del-o",
27
28
  label: "Chưa phân công",
29
+ key: SESSION_STATUS_ENUM.UNASSIGNED,
28
30
  count: ((_b = (_a = summary === null || summary === void 0 ? void 0 : summary.sessionStatuses) === null || _a === void 0 ? void 0 : _a.find((status) => status.type === SESSION_STATUS_ENUM.UNASSIGNED)) === null || _b === void 0 ? void 0 : _b.count) || 0,
29
31
  color: "text-orange-500",
30
32
  query: {
@@ -35,6 +37,7 @@ const AssignedSessionFilter = ({ onFilterChange, className = "", }) => {
35
37
  {
36
38
  icon: "warning-square-o",
37
39
  label: "Chậm xử lý",
40
+ key: TAG_ENUM.SLOW_PROCESSING,
38
41
  count: ((_d = (_c = summary === null || summary === void 0 ? void 0 : summary.tagCounts) === null || _c === void 0 ? void 0 : _c.find((status) => status.type === TAG_ENUM.SLOW_PROCESSING)) === null || _d === void 0 ? void 0 : _d.count) || 0,
39
42
  color: "text-red-500",
40
43
  query: {
@@ -45,6 +48,7 @@ const AssignedSessionFilter = ({ onFilterChange, className = "", }) => {
45
48
  {
46
49
  icon: "time-circle-o",
47
50
  label: "Chờ xử lý",
51
+ key: SESSION_STATUS_ENUM.WAITING_PROCESS,
48
52
  count: ((_f = (_e = summary === null || summary === void 0 ? void 0 : summary.sessionStatuses) === null || _e === void 0 ? void 0 : _e.find((status) => status.type === SESSION_STATUS_ENUM.WAITING_PROCESS)) === null || _f === void 0 ? void 0 : _f.count) || 0,
49
53
  color: "text-orange-400",
50
54
  query: {
@@ -55,6 +59,7 @@ const AssignedSessionFilter = ({ onFilterChange, className = "", }) => {
55
59
  {
56
60
  icon: "arrow-reply-o",
57
61
  label: "Chưa trả lời",
62
+ key: TAG_ENUM.AWAITING_REPLY,
58
63
  count: ((_h = (_g = summary === null || summary === void 0 ? void 0 : summary.tagCounts) === null || _g === void 0 ? void 0 : _g.find((status) => status.type === TAG_ENUM.AWAITING_REPLY)) === null || _h === void 0 ? void 0 : _h.count) || 0,
59
64
  color: "text-purple-500",
60
65
  query: {
@@ -65,6 +70,7 @@ const AssignedSessionFilter = ({ onFilterChange, className = "", }) => {
65
70
  {
66
71
  icon: "play-b",
67
72
  label: "Đang xử lý",
73
+ key: SESSION_STATUS_ENUM.IN_PROCESS,
68
74
  count: ((_k = (_j = summary === null || summary === void 0 ? void 0 : summary.sessionStatuses) === null || _j === void 0 ? void 0 : _j.find((status) => status.type === SESSION_STATUS_ENUM.IN_PROCESS)) === null || _k === void 0 ? void 0 : _k.count) || 0,
69
75
  color: "text-gray-600",
70
76
  query: {
@@ -75,6 +81,7 @@ const AssignedSessionFilter = ({ onFilterChange, className = "", }) => {
75
81
  {
76
82
  icon: "pause-b",
77
83
  label: "Tạm chờ",
84
+ key: TAG_ENUM.TEMPORARILY_PAUSED,
78
85
  count: ((_m = (_l = summary === null || summary === void 0 ? void 0 : summary.sessionStatuses) === null || _l === void 0 ? void 0 : _l.find((status) => status.type === TAG_ENUM.TEMPORARILY_PAUSED)) === null || _m === void 0 ? void 0 : _m.count) || 0,
79
86
  color: "text-gray-600",
80
87
  query: {
@@ -87,6 +94,7 @@ const AssignedSessionFilter = ({ onFilterChange, className = "", }) => {
87
94
  {
88
95
  icon: "check-b",
89
96
  label: "Đã đóng",
97
+ key: SESSION_STATUS_ENUM.COMPLETED,
90
98
  count: ((_p = (_o = summary === null || summary === void 0 ? void 0 : summary.sessionStatuses) === null || _o === void 0 ? void 0 : _o.find((status) => status.type === SESSION_STATUS_ENUM.COMPLETED)) === null || _p === void 0 ? void 0 : _p.count) || 0,
91
99
  color: "text-green-600",
92
100
  query: {
@@ -106,15 +114,15 @@ const AssignedSessionFilter = ({ onFilterChange, className = "", }) => {
106
114
  }
107
115
  setExpandedCategories(newExpanded);
108
116
  };
109
- const handleFilterSelect = (categoryId, subCategoryId) => {
110
- const filterId = subCategoryId || categoryId;
111
- setSelectedFilter(filterId);
112
- // Find the selected category and subcategory
113
- const category = messageCategories.find((cat) => cat.label === categoryId);
117
+ const handleFilterSelect = (categoryKey, subCategoryKey) => {
118
+ const filterKey = subCategoryKey || categoryKey;
119
+ setSelectedFilter(filterKey);
120
+ // Find the selected category and subcategory by key
121
+ const category = messageCategories.find((cat) => cat.key === categoryKey);
114
122
  let query;
115
123
  if (category) {
116
- if (subCategoryId && category.subCategories) {
117
- const subCategory = category.subCategories.find((sub) => sub.label === subCategoryId);
124
+ if (subCategoryKey && category.subCategories) {
125
+ const subCategory = category.subCategories.find((sub) => sub.key === subCategoryKey);
118
126
  query = subCategory === null || subCategory === void 0 ? void 0 : subCategory.query;
119
127
  }
120
128
  else {
@@ -124,20 +132,20 @@ const AssignedSessionFilter = ({ onFilterChange, className = "", }) => {
124
132
  if (query) {
125
133
  setFilterSummary(query);
126
134
  }
127
- onFilterChange === null || onFilterChange === void 0 ? void 0 : onFilterChange(categoryId, subCategoryId);
135
+ onFilterChange === null || onFilterChange === void 0 ? void 0 : onFilterChange(categoryKey, subCategoryKey);
128
136
  };
129
137
  return (_jsxs("div", { className: `w-64 bg-white border-r border-gray-200 flex flex-col ${className}`, children: [_jsx("div", { className: "p-4 border-b border-gray-200", children: _jsx("h2", { className: "text-lg font-semibold text-gray-800", children: "TIN NH\u1EAEN C\u1EE6A T\u00D4I" }) }), _jsx("div", { className: "flex-1 overflow-y-auto", children: _jsx("ul", { className: "py-2", children: messageCategories.map((category, index) => (_jsxs("li", { children: [_jsxs("button", { onClick: () => {
130
138
  if (category.subCategories) {
131
139
  toggleCategory(index);
132
140
  }
133
141
  else {
134
- handleFilterSelect(category.label);
142
+ handleFilterSelect(category.key);
135
143
  }
136
- }, className: `w-full flex items-center justify-between px-4 py-3 hover:bg-gray-50 transition-colors group ${selectedFilter === category.label && !category.subCategories
144
+ }, className: `w-full flex items-center justify-between px-4 py-3 hover:bg-gray-50 transition-colors group ${selectedFilter === category.key && !category.subCategories
137
145
  ? "bg-blue-50 border-r-2 border-blue-500"
138
146
  : ""}`, children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsxs("div", { className: "flex items-center gap-2", children: [category.subCategories && (_jsx(Icon, { icon: expandedCategories.has(index)
139
147
  ? "chevron-down-b"
140
- : "chevron-right-b", size: 14, className: "text-gray-400" })), _jsx(Icon, { icon: category.icon, size: 20, className: category.color })] }), _jsx("span", { className: "font-medium text-gray-800 text-left", children: category.label })] }), _jsx("span", { className: "text-sm font-medium text-gray-500 min-w-0", children: category.count })] }), category.subCategories && expandedCategories.has(index) && (_jsx("ul", { className: "ml-4 border-l border-gray-200", children: category.subCategories.map((subCategory, subIndex) => (_jsx("li", { children: _jsxs("button", { onClick: () => handleFilterSelect(category.label, subCategory.label), className: `w-full flex items-center justify-between px-4 py-2 hover:bg-gray-50 transition-colors group ${selectedFilter === subCategory.label
148
+ : "chevron-right-b", size: 14, className: "text-gray-400" })), _jsx(Icon, { icon: category.icon, size: 20, className: category.color })] }), _jsx("span", { className: "font-medium text-gray-800 text-left", children: category.label })] }), _jsx("span", { className: "text-sm font-medium text-gray-500 min-w-0", children: category.count })] }), category.subCategories && expandedCategories.has(index) && (_jsx("ul", { className: "ml-4 border-l border-gray-200", children: category.subCategories.map((subCategory, subIndex) => (_jsx("li", { children: _jsxs("button", { onClick: () => handleFilterSelect(category.key, subCategory.key), className: `w-full flex items-center justify-between px-4 py-2 hover:bg-gray-50 transition-colors group ${selectedFilter === subCategory.key
141
149
  ? "bg-blue-50 border-r-2 border-blue-500"
142
150
  : ""}`, children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "flex-shrink-0 ml-4", children: _jsx(Icon, { icon: subCategory.icon, size: 18, className: subCategory.color }) }), _jsx("span", { className: "text-sm font-medium text-gray-700 text-left", children: subCategory.label })] }), _jsx("span", { className: "text-xs font-medium text-gray-500 min-w-0", children: subCategory.count })] }) }, subIndex))) }))] }, index))) }) })] }));
143
151
  };
@@ -0,0 +1,5 @@
1
+ export declare const images: {
2
+ conversationBg: string;
3
+ imageFailed: string;
4
+ };
5
+ //# sourceMappingURL=images.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"images.d.ts","sourceRoot":"","sources":["../../src/constants/images.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,MAAM;;;CAGlB,CAAC"}
@@ -0,0 +1,7 @@
1
+ const conversationBg = new URL("../assets/images/conversationBg.png", import.meta.url).href;
2
+ const imageFailed = new URL("../assets/images/imageFailed.png", import.meta.url)
3
+ .href;
4
+ export const images = {
5
+ conversationBg,
6
+ imageFailed,
7
+ };
@@ -1,5 +1,6 @@
1
+ import "../styles/global.css";
1
2
  import { ChatContextType, ChatProviderProps } from "../types/chat";
2
3
  export declare const ChatContext: import("react").Context<ChatContextType>;
3
4
  export declare const useChatContext: () => ChatContextType;
4
- export declare const ChatProvider: ({ children, config, refetchToken, }: ChatProviderProps) => import("react/jsx-runtime").JSX.Element;
5
+ export declare const ChatProvider: ({ children, config }: ChatProviderProps) => import("react/jsx-runtime").JSX.Element;
5
6
  //# sourceMappingURL=ChatContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatContext.d.ts","sourceRoot":"","sources":["../../src/context/ChatContext.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,eAAe,EACf,iBAAiB,EAGlB,MAAM,eAAe,CAAC;AAIvB,eAAO,MAAM,WAAW,0CAOtB,CAAC;AAEH,eAAO,MAAM,cAAc,uBAAgC,CAAC;AAE5D,eAAO,MAAM,YAAY,GAAI,qCAI1B,iBAAiB,4CAoEnB,CAAC"}
1
+ {"version":3,"file":"ChatContext.d.ts","sourceRoot":"","sources":["../../src/context/ChatContext.tsx"],"names":[],"mappings":"AAEA,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EACL,eAAe,EACf,iBAAiB,EAGlB,MAAM,eAAe,CAAC;AAQvB,eAAO,MAAM,WAAW,0CAOtB,CAAC;AAEH,eAAO,MAAM,cAAc,uBAAgC,CAAC;AAE5D,eAAO,MAAM,YAAY,GAAI,sBAAsB,iBAAiB,4CAsDnE,CAAC"}
@@ -1,23 +1,28 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import "../styles/global.css";
3
4
  import { createContext, useContext, useEffect, useState } from "react";
4
5
  import { ConnectStatus, SyncStatus, } from "../types/chat";
5
6
  import { DChatSDK } from "../constants/sdk";
6
7
  import MainLayout from "../layout";
8
+ import useAuthStore from "../store/auth";
9
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
10
+ const queryClient = new QueryClient();
7
11
  export const ChatContext = createContext({
8
12
  user: null,
9
13
  connectStatus: ConnectStatus.Disconnected,
10
14
  syncStatus: SyncStatus.Success,
11
- userTokenHandler: () => { },
15
+ getSelfUserInfo: () => { },
12
16
  updateConnectStatus: () => { },
13
17
  updateSyncStatus: () => { },
14
18
  });
15
19
  export const useChatContext = () => useContext(ChatContext);
16
- export const ChatProvider = ({ children, config, refetchToken, }) => {
20
+ export const ChatProvider = ({ children, config }) => {
17
21
  const [connectStatus, setConnectStatus] = useState(ConnectStatus.Disconnected);
18
22
  const [syncStatus, setSyncStatus] = useState(SyncStatus.Success);
19
23
  const [user, setUser] = useState(null);
20
- const getUserInfo = () => {
24
+ const initAuthStore = useAuthStore((state) => state.initAuthStore);
25
+ const getSelfUserInfo = () => {
21
26
  DChatSDK.getSelfUserInfo()
22
27
  .then(({ data }) => {
23
28
  setUser(data);
@@ -26,24 +31,6 @@ export const ChatProvider = ({ children, config, refetchToken, }) => {
26
31
  console.error("getSelfUserInfo", errCode, errMsg);
27
32
  });
28
33
  };
29
- const handleLogin = (newToken) => {
30
- if (config) {
31
- DChatSDK.login(Object.assign(Object.assign({}, config), { token: newToken || config.token }))
32
- .then((res) => {
33
- getUserInfo();
34
- })
35
- .catch(({ errCode, errMsg }) => {
36
- console.error("handleLogin", errCode, errMsg);
37
- });
38
- }
39
- };
40
- const userTokenHandler = () => {
41
- refetchToken().then((token) => {
42
- if (!!token) {
43
- handleLogin(token);
44
- }
45
- });
46
- };
47
34
  const updateConnectStatus = (status) => {
48
35
  setConnectStatus(status);
49
36
  };
@@ -52,15 +39,21 @@ export const ChatProvider = ({ children, config, refetchToken, }) => {
52
39
  };
53
40
  useEffect(() => {
54
41
  if (config) {
55
- handleLogin();
42
+ initAuthStore({
43
+ accessToken: config.accessToken,
44
+ apiAddress: config.apiAddr,
45
+ platformID: config.platformID,
46
+ userID: config.userID,
47
+ wsAddress: config.wsAddr,
48
+ });
56
49
  }
57
50
  }, [config]);
58
51
  return (_jsx(ChatContext.Provider, { value: {
59
52
  user,
60
53
  connectStatus,
61
54
  syncStatus,
62
- userTokenHandler,
55
+ getSelfUserInfo,
63
56
  updateConnectStatus,
64
57
  updateSyncStatus,
65
- }, children: _jsx(MainLayout, { children: children }) }));
58
+ }, children: _jsx(QueryClientProvider, { client: queryClient, children: _jsx(MainLayout, { children: children }) }) }));
66
59
  };
@@ -0,0 +1,229 @@
1
+ import { MessageType } from "@openim/wasm-client-sdk";
2
+ import { MediaCollectionItem, MediaCollectionResponse } from "../../types/dto";
3
+ export declare const useMediaCollection: ({ recvID, contentType, }: {
4
+ recvID: string;
5
+ contentType: MessageType;
6
+ }) => {
7
+ error: Error;
8
+ isError: true;
9
+ isPending: false;
10
+ isLoadingError: false;
11
+ isRefetchError: true;
12
+ isSuccess: false;
13
+ isPlaceholderData: false;
14
+ status: "error";
15
+ fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
16
+ hasPreviousPage: boolean;
17
+ isFetchNextPageError: boolean;
18
+ isFetchPreviousPageError: boolean;
19
+ isFetchingPreviousPage: boolean;
20
+ dataUpdatedAt: number;
21
+ errorUpdatedAt: number;
22
+ failureCount: number;
23
+ failureReason: Error | null;
24
+ errorUpdateCount: number;
25
+ isFetched: boolean;
26
+ isFetchedAfterMount: boolean;
27
+ isFetching: boolean;
28
+ isInitialLoading: boolean;
29
+ isPaused: boolean;
30
+ isRefetching: boolean;
31
+ isStale: boolean;
32
+ isEnabled: boolean;
33
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
34
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
35
+ promise: Promise<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>>;
36
+ data: import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown> | undefined;
37
+ fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
38
+ hasNextPage: boolean;
39
+ isFetchingNextPage: boolean;
40
+ isLoading: boolean;
41
+ groupedData: Record<string, MediaCollectionItem[]>;
42
+ dataFlatten: MediaCollectionItem[];
43
+ } | {
44
+ error: null;
45
+ isError: false;
46
+ isPending: false;
47
+ isLoadingError: false;
48
+ isRefetchError: false;
49
+ isFetchNextPageError: false;
50
+ isFetchPreviousPageError: false;
51
+ isSuccess: true;
52
+ isPlaceholderData: false;
53
+ status: "success";
54
+ fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
55
+ hasPreviousPage: boolean;
56
+ isFetchingPreviousPage: boolean;
57
+ dataUpdatedAt: number;
58
+ errorUpdatedAt: number;
59
+ failureCount: number;
60
+ failureReason: Error | null;
61
+ errorUpdateCount: number;
62
+ isFetched: boolean;
63
+ isFetchedAfterMount: boolean;
64
+ isFetching: boolean;
65
+ isInitialLoading: boolean;
66
+ isPaused: boolean;
67
+ isRefetching: boolean;
68
+ isStale: boolean;
69
+ isEnabled: boolean;
70
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
71
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
72
+ promise: Promise<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>>;
73
+ data: import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown> | undefined;
74
+ fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
75
+ hasNextPage: boolean;
76
+ isFetchingNextPage: boolean;
77
+ isLoading: boolean;
78
+ groupedData: Record<string, MediaCollectionItem[]>;
79
+ dataFlatten: MediaCollectionItem[];
80
+ } | {
81
+ error: Error;
82
+ isError: true;
83
+ isPending: false;
84
+ isLoadingError: true;
85
+ isRefetchError: false;
86
+ isFetchNextPageError: false;
87
+ isFetchPreviousPageError: false;
88
+ isSuccess: false;
89
+ isPlaceholderData: false;
90
+ status: "error";
91
+ fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
92
+ hasPreviousPage: boolean;
93
+ isFetchingPreviousPage: boolean;
94
+ dataUpdatedAt: number;
95
+ errorUpdatedAt: number;
96
+ failureCount: number;
97
+ failureReason: Error | null;
98
+ errorUpdateCount: number;
99
+ isFetched: boolean;
100
+ isFetchedAfterMount: boolean;
101
+ isFetching: boolean;
102
+ isInitialLoading: boolean;
103
+ isPaused: boolean;
104
+ isRefetching: boolean;
105
+ isStale: boolean;
106
+ isEnabled: boolean;
107
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
108
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
109
+ promise: Promise<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>>;
110
+ data: import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown> | undefined;
111
+ fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
112
+ hasNextPage: boolean;
113
+ isFetchingNextPage: boolean;
114
+ isLoading: boolean;
115
+ groupedData: Record<string, MediaCollectionItem[]>;
116
+ dataFlatten: MediaCollectionItem[];
117
+ } | {
118
+ error: null;
119
+ isError: false;
120
+ isPending: true;
121
+ isLoadingError: false;
122
+ isRefetchError: false;
123
+ isFetchNextPageError: false;
124
+ isFetchPreviousPageError: false;
125
+ isSuccess: false;
126
+ isPlaceholderData: false;
127
+ status: "pending";
128
+ fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
129
+ hasPreviousPage: boolean;
130
+ isFetchingPreviousPage: boolean;
131
+ dataUpdatedAt: number;
132
+ errorUpdatedAt: number;
133
+ failureCount: number;
134
+ failureReason: Error | null;
135
+ errorUpdateCount: number;
136
+ isFetched: boolean;
137
+ isFetchedAfterMount: boolean;
138
+ isFetching: boolean;
139
+ isInitialLoading: boolean;
140
+ isPaused: boolean;
141
+ isRefetching: boolean;
142
+ isStale: boolean;
143
+ isEnabled: boolean;
144
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
145
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
146
+ promise: Promise<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>>;
147
+ data: import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown> | undefined;
148
+ fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
149
+ hasNextPage: boolean;
150
+ isFetchingNextPage: boolean;
151
+ isLoading: boolean;
152
+ groupedData: Record<string, MediaCollectionItem[]>;
153
+ dataFlatten: MediaCollectionItem[];
154
+ } | {
155
+ error: null;
156
+ isError: false;
157
+ isPending: true;
158
+ isLoadingError: false;
159
+ isRefetchError: false;
160
+ isFetchNextPageError: false;
161
+ isFetchPreviousPageError: false;
162
+ isSuccess: false;
163
+ isPlaceholderData: false;
164
+ status: "pending";
165
+ fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
166
+ hasPreviousPage: boolean;
167
+ isFetchingPreviousPage: boolean;
168
+ dataUpdatedAt: number;
169
+ errorUpdatedAt: number;
170
+ failureCount: number;
171
+ failureReason: Error | null;
172
+ errorUpdateCount: number;
173
+ isFetched: boolean;
174
+ isFetchedAfterMount: boolean;
175
+ isFetching: boolean;
176
+ isInitialLoading: boolean;
177
+ isPaused: boolean;
178
+ isRefetching: boolean;
179
+ isStale: boolean;
180
+ isEnabled: boolean;
181
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
182
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
183
+ promise: Promise<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>>;
184
+ data: import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown> | undefined;
185
+ fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
186
+ hasNextPage: boolean;
187
+ isFetchingNextPage: boolean;
188
+ isLoading: boolean;
189
+ groupedData: Record<string, MediaCollectionItem[]>;
190
+ dataFlatten: MediaCollectionItem[];
191
+ } | {
192
+ isError: false;
193
+ error: null;
194
+ isPending: false;
195
+ isLoadingError: false;
196
+ isRefetchError: false;
197
+ isSuccess: true;
198
+ isPlaceholderData: true;
199
+ isFetchNextPageError: false;
200
+ isFetchPreviousPageError: false;
201
+ status: "success";
202
+ fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
203
+ hasPreviousPage: boolean;
204
+ isFetchingPreviousPage: boolean;
205
+ dataUpdatedAt: number;
206
+ errorUpdatedAt: number;
207
+ failureCount: number;
208
+ failureReason: Error | null;
209
+ errorUpdateCount: number;
210
+ isFetched: boolean;
211
+ isFetchedAfterMount: boolean;
212
+ isFetching: boolean;
213
+ isInitialLoading: boolean;
214
+ isPaused: boolean;
215
+ isRefetching: boolean;
216
+ isStale: boolean;
217
+ isEnabled: boolean;
218
+ refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
219
+ fetchStatus: import("@tanstack/react-query").FetchStatus;
220
+ promise: Promise<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>>;
221
+ data: import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown> | undefined;
222
+ fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<import("@tanstack/react-query").InfiniteData<MediaCollectionResponse, unknown>, Error>>;
223
+ hasNextPage: boolean;
224
+ isFetchingNextPage: boolean;
225
+ isLoading: boolean;
226
+ groupedData: Record<string, MediaCollectionItem[]>;
227
+ dataFlatten: MediaCollectionItem[];
228
+ };
229
+ //# sourceMappingURL=useMediaCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useMediaCollection.d.ts","sourceRoot":"","sources":["../../../src/hooks/collection/useMediaCollection.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,EACL,mBAAmB,EAEnB,uBAAuB,EACxB,MAAM,iBAAiB,CAAC;AAIzB,eAAO,MAAM,kBAAkB,GAAI,0BAGhC;IACD,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,WAAW,CAAC;CAC1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkEA,CAAC"}