@droppii-org/chat-sdk 0.7.12 → 0.7.13
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/thread-search/ThreadSearchContent.d.ts.map +1 -1
- package/dist/components/conversation-detail/thread-search/ThreadSearchContent.js +4 -2
- package/dist/locales/vi/conversation-inbox.json +0 -1
- package/dist/utils/imCommon.d.ts +1 -0
- package/dist/utils/imCommon.d.ts.map +1 -1
- package/dist/utils/imCommon.js +16 -23
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadSearchContent.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation-detail/thread-search/ThreadSearchContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAwC,KAAK,QAAQ,EAAE,MAAM,MAAM,CAAC;AAI3E,OAAO,EAEL,KAAK,gBAAgB,EAEtB,MAAM,8BAA8B,CAAC;AAYtC,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,sFAAsF;IACtF,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;CACrC;AAGD,QAAA,MAAM,mBAAmB,GAAI,sEAM1B,wBAAwB,
|
|
1
|
+
{"version":3,"file":"ThreadSearchContent.d.ts","sourceRoot":"","sources":["../../../../src/components/conversation-detail/thread-search/ThreadSearchContent.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAAwC,KAAK,QAAQ,EAAE,MAAM,MAAM,CAAC;AAI3E,OAAO,EAEL,KAAK,gBAAgB,EAEtB,MAAM,8BAA8B,CAAC;AAYtC,MAAM,WAAW,wBAAwB;IACvC,YAAY,EAAE,gBAAgB,CAAC;IAC/B,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,0DAA0D;IAC1D,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,sFAAsF;IACtF,sBAAsB,CAAC,EAAE,MAAM,IAAI,CAAC;CACrC;AAGD,QAAA,MAAM,mBAAmB,GAAI,sEAM1B,wBAAwB,4CA4I1B,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx,
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { Input, Spin, message as toastMessage } from "antd";
|
|
5
5
|
import { useDebounce } from "ahooks";
|
|
@@ -51,7 +51,9 @@ const ThreadSearchContent = ({ conversation, inputRef, onClose, onJump, onSearch
|
|
|
51
51
|
return (_jsx("div", { "data-testid": "thread-search-loading", className: "flex justify-center py-8", children: _jsx(Spin, {}) }));
|
|
52
52
|
}
|
|
53
53
|
if (results.length === 0) {
|
|
54
|
-
return (_jsx("div", { role: "status", className: "flex flex-1 flex-col", children: _jsx(ContactSearchStateMessage, { testId: "thread-search-empty", children: isError
|
|
54
|
+
return (_jsx("div", { role: "status", className: "flex flex-1 flex-col", children: _jsx(ContactSearchStateMessage, { testId: "thread-search-empty", children: isError
|
|
55
|
+
? t("thread_detail.search.failed")
|
|
56
|
+
: t("thread_detail.search.no_result_title") }) }));
|
|
55
57
|
}
|
|
56
58
|
return (_jsx("div", { id: SCROLL_TARGET_ID, className: "min-h-0 flex-1 overflow-y-auto", children: _jsx(InfiniteScroll, { dataLength: results.length, next: fetchNextPage,
|
|
57
59
|
// A failed page would otherwise leave the loader spinning for good.
|
|
@@ -109,7 +109,6 @@
|
|
|
109
109
|
"placeholder": "Tìm kiếm",
|
|
110
110
|
"initial": "Bạn có thể tìm kiếm theo nội dung tin nhắn",
|
|
111
111
|
"no_result_title": "Không tìm thấy kết quả nào",
|
|
112
|
-
"no_result_hint": "Hãy thử lại với cách viết khác hoặc kết hợp cụm từ khác phù hợp hơn.",
|
|
113
112
|
"failed": "Không tải được kết quả. Vui lòng thử lại",
|
|
114
113
|
"you": "Bạn"
|
|
115
114
|
},
|
package/dist/utils/imCommon.d.ts
CHANGED
|
@@ -31,5 +31,6 @@ export declare const conversationSort: (conversationList: ConversationItem[], or
|
|
|
31
31
|
peerType?: string;
|
|
32
32
|
members?: import("@droppii-org/wasm-client-sdk").ConversationGroupMember[];
|
|
33
33
|
lastOpenTime?: number;
|
|
34
|
+
pinTime?: number;
|
|
34
35
|
}[];
|
|
35
36
|
//# sourceMappingURL=imCommon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"imCommon.d.ts","sourceRoot":"","sources":["../../src/utils/imCommon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAI7E,eAAO,MAAM,cAAc,GAAI,cAAc,WAAW,YACO,CAAC;AAWhE,eAAO,MAAM,mBAAmB,GAAI,eAAe;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,WAAW,CAAC;CAChC,YAKA,CAAC;
|
|
1
|
+
{"version":3,"file":"imCommon.d.ts","sourceRoot":"","sources":["../../src/utils/imCommon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAI7E,eAAO,MAAM,cAAc,GAAI,cAAc,WAAW,YACO,CAAC;AAWhE,eAAO,MAAM,mBAAmB,GAAI,eAAe;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,WAAW,CAAC;CAChC,YAKA,CAAC;AAUF,eAAO,MAAM,gBAAgB,GAC3B,kBAAkB,gBAAgB,EAAE,EACpC,eAAe,gBAAgB,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmClC,CAAC"}
|
package/dist/utils/imCommon.js
CHANGED
|
@@ -27,6 +27,10 @@ export const isGroupConversation = (conversation) => {
|
|
|
27
27
|
}
|
|
28
28
|
return isGroupSession(conversation === null || conversation === void 0 ? void 0 : conversation.conversationType);
|
|
29
29
|
};
|
|
30
|
+
const activityTime = (item) => Math.max(item.draftTextTime || 0, item.latestMsgSendTime || 0);
|
|
31
|
+
// Same order as core's local list: pinned first, newest pin first, then latest
|
|
32
|
+
// activity. A pinned thread without pinTime (older core) ranks by activity.
|
|
33
|
+
const pinOrderTime = (item) => item.pinTime || activityTime(item);
|
|
30
34
|
export const conversationSort = (conversationList, originalList) => {
|
|
31
35
|
const listWithIndex = (conversationList === null || conversationList === void 0 ? void 0 : conversationList.map((item, index) => {
|
|
32
36
|
var _a;
|
|
@@ -41,31 +45,20 @@ export const conversationSort = (conversationList, originalList) => {
|
|
|
41
45
|
return false;
|
|
42
46
|
});
|
|
43
47
|
filterArr.sort((a, b) => {
|
|
44
|
-
if (a.isPinned
|
|
45
|
-
|
|
46
|
-
? a.draftTextTime
|
|
47
|
-
: a.latestMsgSendTime;
|
|
48
|
-
const bCompare = b.draftTextTime > b.latestMsgSendTime
|
|
49
|
-
? b.draftTextTime
|
|
50
|
-
: b.latestMsgSendTime;
|
|
51
|
-
if (aCompare > bCompare) {
|
|
52
|
-
return -1;
|
|
53
|
-
}
|
|
54
|
-
else if (aCompare < bCompare) {
|
|
55
|
-
return 1;
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
if (!originalList)
|
|
59
|
-
return 0;
|
|
60
|
-
return a.originalIndex - b.originalIndex;
|
|
61
|
-
}
|
|
48
|
+
if (!!a.isPinned !== !!b.isPinned) {
|
|
49
|
+
return a.isPinned ? -1 : 1;
|
|
62
50
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
return 1;
|
|
51
|
+
if (a.isPinned) {
|
|
52
|
+
const pinDiff = pinOrderTime(b) - pinOrderTime(a);
|
|
53
|
+
if (pinDiff !== 0)
|
|
54
|
+
return pinDiff;
|
|
68
55
|
}
|
|
56
|
+
const activityDiff = activityTime(b) - activityTime(a);
|
|
57
|
+
if (activityDiff !== 0)
|
|
58
|
+
return activityDiff;
|
|
59
|
+
if (!originalList)
|
|
60
|
+
return 0;
|
|
61
|
+
return a.originalIndex - b.originalIndex;
|
|
69
62
|
});
|
|
70
63
|
return filterArr.map((_a) => {
|
|
71
64
|
var { originalIndex } = _a, rest = __rest(_a, ["originalIndex"]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@droppii-org/chat-sdk",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.13",
|
|
4
4
|
"description": "Droppii React Chat SDK",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"dependencies": {
|
|
86
86
|
"@ant-design/cssinjs": "^1.24.0",
|
|
87
87
|
"@ant-design/icons": "^6.0.0",
|
|
88
|
-
"@droppii-org/wasm-client-sdk": "0.
|
|
88
|
+
"@droppii-org/wasm-client-sdk": "0.8.0",
|
|
89
89
|
"@lexical/code": "^0.34.0",
|
|
90
90
|
"@lexical/html": "^0.34.0",
|
|
91
91
|
"@lexical/link": "^0.34.0",
|