@droppii-org/chat-mobile 0.2.108 → 0.2.110
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/lib/module/screens/ChatInfo/ChatInfo.js +12 -3
- package/lib/module/screens/ChatInfo/ChatInfo.js.map +1 -1
- package/lib/module/screens/ChatInfo/ChatInfoActions.js +45 -40
- package/lib/module/screens/ChatInfo/ChatInfoActions.js.map +1 -1
- package/lib/module/screens/ChatInfo/ChatInfoProfile.js +11 -7
- package/lib/module/screens/ChatInfo/ChatInfoProfile.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatDetail.js +42 -7
- package/lib/module/screens/chat-detail/ChatDetail.js.map +1 -1
- package/lib/module/screens/chat-detail/ChatListLegend.js +249 -49
- package/lib/module/screens/chat-detail/ChatListLegend.js.map +1 -1
- package/lib/module/screens/chat-detail/hooks/createUnreadMarkReadGate.js +32 -0
- package/lib/module/screens/chat-detail/hooks/createUnreadMarkReadGate.js.map +1 -0
- package/lib/module/screens/chat-detail/hooks/useMarkConversationRead.js +180 -0
- package/lib/module/screens/chat-detail/hooks/useMarkConversationRead.js.map +1 -0
- package/lib/module/screens/chat-detail/hooks/useUnreadAnchorSeen.js +88 -0
- package/lib/module/screens/chat-detail/hooks/useUnreadAnchorSeen.js.map +1 -0
- package/lib/module/screens/chat-detail/hooks/useUnreadDeeplinkCheck.js +59 -0
- package/lib/module/screens/chat-detail/hooks/useUnreadDeeplinkCheck.js.map +1 -0
- package/lib/module/screens/chat-detail/hooks/useUnreadIndicator.js +105 -0
- package/lib/module/screens/chat-detail/hooks/useUnreadIndicator.js.map +1 -0
- package/lib/module/screens/chat-detail/hooks/useUnreadIndicatorInList.js +157 -0
- package/lib/module/screens/chat-detail/hooks/useUnreadIndicatorInList.js.map +1 -0
- package/lib/module/screens/chat-detail/legend/LegendChatUnreadButton.js +140 -0
- package/lib/module/screens/chat-detail/legend/LegendChatUnreadButton.js.map +1 -0
- package/lib/module/screens/chat-detail/legend/LegendChatUnreadDivider.js +51 -0
- package/lib/module/screens/chat-detail/legend/LegendChatUnreadDivider.js.map +1 -0
- package/lib/module/services/message.js +30 -0
- package/lib/module/services/message.js.map +1 -1
- package/lib/module/store/message.js +25 -4
- package/lib/module/store/message.js.map +1 -1
- package/lib/module/store/unreadIndicator.js +26 -0
- package/lib/module/store/unreadIndicator.js.map +1 -0
- package/lib/module/translation/resources/i18n.js +2 -0
- package/lib/module/translation/resources/i18n.js.map +1 -1
- package/lib/module/types/chat.js.map +1 -1
- package/lib/module/types/unreadIndicator.js +2 -0
- package/lib/module/types/unreadIndicator.js.map +1 -0
- package/lib/module/utils/markReadPolicy.js +25 -0
- package/lib/module/utils/markReadPolicy.js.map +1 -0
- package/lib/module/utils/promise.js +16 -0
- package/lib/module/utils/promise.js.map +1 -1
- package/lib/module/utils/unreadAnchor.js +57 -0
- package/lib/module/utils/unreadAnchor.js.map +1 -0
- package/lib/module/utils/unreadIndicatorState.js +96 -0
- package/lib/module/utils/unreadIndicatorState.js.map +1 -0
- package/lib/typescript/src/screens/ChatInfo/ChatInfo.d.ts.map +1 -1
- package/lib/typescript/src/screens/ChatInfo/ChatInfoActions.d.ts +2 -1
- package/lib/typescript/src/screens/ChatInfo/ChatInfoActions.d.ts.map +1 -1
- package/lib/typescript/src/screens/ChatInfo/ChatInfoProfile.d.ts +2 -1
- package/lib/typescript/src/screens/ChatInfo/ChatInfoProfile.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatDetail.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts +4 -1
- package/lib/typescript/src/screens/chat-detail/ChatListLegend.d.ts.map +1 -1
- package/lib/typescript/src/screens/chat-detail/hooks/createUnreadMarkReadGate.d.ts +9 -0
- package/lib/typescript/src/screens/chat-detail/hooks/createUnreadMarkReadGate.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useMarkConversationRead.d.ts +39 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useMarkConversationRead.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useUnreadAnchorSeen.d.ts +26 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useUnreadAnchorSeen.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useUnreadDeeplinkCheck.d.ts +17 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useUnreadDeeplinkCheck.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useUnreadIndicator.d.ts +21 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useUnreadIndicator.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useUnreadIndicatorInList.d.ts +35 -0
- package/lib/typescript/src/screens/chat-detail/hooks/useUnreadIndicatorInList.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/legend/LegendChatUnreadButton.d.ts +8 -0
- package/lib/typescript/src/screens/chat-detail/legend/LegendChatUnreadButton.d.ts.map +1 -0
- package/lib/typescript/src/screens/chat-detail/legend/LegendChatUnreadDivider.d.ts +7 -0
- package/lib/typescript/src/screens/chat-detail/legend/LegendChatUnreadDivider.d.ts.map +1 -0
- package/lib/typescript/src/services/message.d.ts +8 -0
- package/lib/typescript/src/services/message.d.ts.map +1 -1
- package/lib/typescript/src/store/message.d.ts.map +1 -1
- package/lib/typescript/src/store/unreadIndicator.d.ts +10 -0
- package/lib/typescript/src/store/unreadIndicator.d.ts.map +1 -0
- package/lib/typescript/src/translation/resources/i18n.d.ts.map +1 -1
- package/lib/typescript/src/types/chat.d.ts +3 -0
- package/lib/typescript/src/types/chat.d.ts.map +1 -1
- package/lib/typescript/src/types/events.d.ts +17 -1
- package/lib/typescript/src/types/events.d.ts.map +1 -1
- package/lib/typescript/src/types/unreadIndicator.d.ts +45 -0
- package/lib/typescript/src/types/unreadIndicator.d.ts.map +1 -0
- package/lib/typescript/src/utils/markReadPolicy.d.ts +27 -0
- package/lib/typescript/src/utils/markReadPolicy.d.ts.map +1 -0
- package/lib/typescript/src/utils/promise.d.ts +6 -0
- package/lib/typescript/src/utils/promise.d.ts.map +1 -1
- package/lib/typescript/src/utils/unreadAnchor.d.ts +33 -0
- package/lib/typescript/src/utils/unreadAnchor.d.ts.map +1 -0
- package/lib/typescript/src/utils/unreadIndicatorState.d.ts +26 -0
- package/lib/typescript/src/utils/unreadIndicatorState.d.ts.map +1 -0
- package/package.json +2 -2
- package/src/screens/ChatInfo/ChatInfo.tsx +10 -1
- package/src/screens/ChatInfo/ChatInfoActions.tsx +47 -39
- package/src/screens/ChatInfo/ChatInfoProfile.tsx +17 -12
- package/src/screens/chat-detail/ChatDetail.tsx +58 -5
- package/src/screens/chat-detail/ChatListLegend.tsx +314 -46
- package/src/screens/chat-detail/hooks/createUnreadMarkReadGate.ts +41 -0
- package/src/screens/chat-detail/hooks/useMarkConversationRead.ts +197 -0
- package/src/screens/chat-detail/hooks/useUnreadAnchorSeen.ts +105 -0
- package/src/screens/chat-detail/hooks/useUnreadDeeplinkCheck.ts +68 -0
- package/src/screens/chat-detail/hooks/useUnreadIndicator.ts +112 -0
- package/src/screens/chat-detail/hooks/useUnreadIndicatorInList.ts +181 -0
- package/src/screens/chat-detail/legend/LegendChatUnreadButton.tsx +165 -0
- package/src/screens/chat-detail/legend/LegendChatUnreadDivider.tsx +52 -0
- package/src/services/message.ts +42 -0
- package/src/store/message.ts +23 -5
- package/src/store/unreadIndicator.ts +38 -0
- package/src/translation/resources/i18n.ts +2 -0
- package/src/types/chat.ts +3 -0
- package/src/types/events.ts +18 -1
- package/src/types/unreadIndicator.ts +49 -0
- package/src/utils/markReadPolicy.ts +55 -0
- package/src/utils/promise.ts +20 -0
- package/src/utils/unreadAnchor.ts +87 -0
- package/src/utils/unreadIndicatorState.ts +131 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Pure transitions behind `useUnreadIndicatorStore` — kept free of React and
|
|
5
|
+
* zustand so they can be unit-tested. Every transition after `begin` is
|
|
6
|
+
* token-scoped: a token that isn't the current session's leaves the state
|
|
7
|
+
* untouched (same reference).
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// Slack past the lookup timeout before the gate treats itself as open even if
|
|
11
|
+
// `resolve` never ran.
|
|
12
|
+
export const UNREAD_GATE_WATCHDOG_SLACK_MS = 500;
|
|
13
|
+
export const INITIAL_UNREAD_INDICATOR_STATE = {
|
|
14
|
+
token: 0,
|
|
15
|
+
routeKey: undefined,
|
|
16
|
+
conversationId: undefined,
|
|
17
|
+
pending: false,
|
|
18
|
+
pendingSince: 0,
|
|
19
|
+
anchor: null,
|
|
20
|
+
pillDismissed: false,
|
|
21
|
+
awaitingDeeplinkCheck: false,
|
|
22
|
+
settledBy: null
|
|
23
|
+
};
|
|
24
|
+
const isMine = (s, token) => token === s.token;
|
|
25
|
+
export const beginUnreadSession = (s, {
|
|
26
|
+
routeKey,
|
|
27
|
+
conversationId,
|
|
28
|
+
skip,
|
|
29
|
+
awaitDeeplinkCheck
|
|
30
|
+
}, now) => ({
|
|
31
|
+
...INITIAL_UNREAD_INDICATOR_STATE,
|
|
32
|
+
token: s.token + 1,
|
|
33
|
+
routeKey,
|
|
34
|
+
conversationId,
|
|
35
|
+
pending: !skip,
|
|
36
|
+
pendingSince: skip ? 0 : now,
|
|
37
|
+
awaitingDeeplinkCheck: !skip && awaitDeeplinkCheck
|
|
38
|
+
});
|
|
39
|
+
export const resolveUnreadSession = (s, token, anchor) => !isMine(s, token) || !s.pending ? s : {
|
|
40
|
+
...s,
|
|
41
|
+
pending: false,
|
|
42
|
+
anchor,
|
|
43
|
+
settledBy: 'resolve'
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// Doesn't bump the token: a late `resolve` is already ignored because
|
|
47
|
+
// `pending` is false. Only a new `begin` (a new visit) bumps it.
|
|
48
|
+
export const clearUnreadSession = (s, token) => !isMine(s, token) ? s : {
|
|
49
|
+
...s,
|
|
50
|
+
pending: false,
|
|
51
|
+
anchor: null,
|
|
52
|
+
pillDismissed: true,
|
|
53
|
+
awaitingDeeplinkCheck: false,
|
|
54
|
+
settledBy: 'clear'
|
|
55
|
+
};
|
|
56
|
+
export const dismissUnreadPill = (s, token) => !isMine(s, token) || s.pillDismissed ? s : {
|
|
57
|
+
...s,
|
|
58
|
+
pillDismissed: true
|
|
59
|
+
};
|
|
60
|
+
export const confirmUnreadDeeplinkCheck = (s, token, hide) => {
|
|
61
|
+
if (!isMine(s, token)) return s;
|
|
62
|
+
// Not a clear: the user is still on the screen, so it must not trigger
|
|
63
|
+
// the leave flush that a blur's clear does.
|
|
64
|
+
if (hide) return {
|
|
65
|
+
...clearUnreadSession(s, token),
|
|
66
|
+
settledBy: 'hide'
|
|
67
|
+
};
|
|
68
|
+
return s.awaitingDeeplinkCheck ? {
|
|
69
|
+
...s,
|
|
70
|
+
awaitingDeeplinkCheck: false
|
|
71
|
+
} : s;
|
|
72
|
+
};
|
|
73
|
+
export const rearmUnreadDeeplinkCheck = (s, token) => !isMine(s, token) || !s.anchor || s.awaitingDeeplinkCheck ? s : {
|
|
74
|
+
...s,
|
|
75
|
+
awaitingDeeplinkCheck: true
|
|
76
|
+
};
|
|
77
|
+
export const resetUnreadSession = s => ({
|
|
78
|
+
...INITIAL_UNREAD_INDICATOR_STATE,
|
|
79
|
+
token: s.token + 1
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
/** When the watchdog opens a still-pending gate on its own. */
|
|
83
|
+
export const getUnreadGateDeadline = (s, timeoutMs) => s.pendingSince + timeoutMs + UNREAD_GATE_WATCHDOG_SLACK_MS;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Whether mark-read must wait. Closed only for MY session while its lookup is
|
|
87
|
+
* still pending and within the watchdog deadline. No session yet (not focused,
|
|
88
|
+
* or access not confirmed) is fail-closed; a session superseded by another
|
|
89
|
+
* visit is not this screen's gate.
|
|
90
|
+
*/
|
|
91
|
+
export const isUnreadGateClosed = (s, myToken, now, timeoutMs) => {
|
|
92
|
+
if (myToken == null) return true;
|
|
93
|
+
if (!isMine(s, myToken)) return false;
|
|
94
|
+
return s.pending && now <= getUnreadGateDeadline(s, timeoutMs);
|
|
95
|
+
};
|
|
96
|
+
//# sourceMappingURL=unreadIndicatorState.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["UNREAD_GATE_WATCHDOG_SLACK_MS","INITIAL_UNREAD_INDICATOR_STATE","token","routeKey","undefined","conversationId","pending","pendingSince","anchor","pillDismissed","awaitingDeeplinkCheck","settledBy","isMine","s","beginUnreadSession","skip","awaitDeeplinkCheck","now","resolveUnreadSession","clearUnreadSession","dismissUnreadPill","confirmUnreadDeeplinkCheck","hide","rearmUnreadDeeplinkCheck","resetUnreadSession","getUnreadGateDeadline","timeoutMs","isUnreadGateClosed","myToken"],"sourceRoot":"../../../src","sources":["utils/unreadIndicatorState.ts"],"mappings":";;AAMA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO,MAAMA,6BAA6B,GAAG,GAAG;AAEhD,OAAO,MAAMC,8BAAoD,GAAG;EAClEC,KAAK,EAAE,CAAC;EACRC,QAAQ,EAAEC,SAAS;EACnBC,cAAc,EAAED,SAAS;EACzBE,OAAO,EAAE,KAAK;EACdC,YAAY,EAAE,CAAC;EACfC,MAAM,EAAE,IAAI;EACZC,aAAa,EAAE,KAAK;EACpBC,qBAAqB,EAAE,KAAK;EAC5BC,SAAS,EAAE;AACb,CAAC;AAED,MAAMC,MAAM,GAAGA,CAACC,CAAuB,EAAEX,KAAa,KAAKA,KAAK,KAAKW,CAAC,CAACX,KAAK;AAE5E,OAAO,MAAMY,kBAAkB,GAAGA,CAChCD,CAAuB,EACvB;EACEV,QAAQ;EACRE,cAAc;EACdU,IAAI;EACJC;AACyB,CAAC,EAC5BC,GAAW,MACe;EAC1B,GAAGhB,8BAA8B;EACjCC,KAAK,EAAEW,CAAC,CAACX,KAAK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,OAAOE,CAAC,CAACH,qBAAqB,GAAG;IAAE,GAAGG,CAAC;IAAEH,qBAAqB,EAAE;EAAM,CAAC,GAAGG,CAAC;AAC7E,CAAC;AAED,OAAO,MAAMU,wBAAwB,GAAGA,CACtCV,CAAuB,EACvBX,KAAa,KAEb,CAACU,MAAM,CAACC,CAAC,EAAEX,KAAK,CAAC,IAAI,CAACW,CAAC,CAACL,MAAM,IAAIK,CAAC,CAACH,qBAAqB,GACrDG,CAAC,GACD;EAAE,GAAGA,CAAC;EAAEH,qBAAqB,EAAE;AAAK,CAAC;AAE3C,OAAO,MAAMc,kBAAkB,GAC7BX,CAAuB,KACG;EAC1B,GAAGZ,8BAA8B;EACjCC,KAAK,EAAEW,CAAC,CAACX,KAAK,GAAG;AACnB,CAAC,CAAC;;AAEF;AACA,OAAO,MAAMuB,qBAAqB,GAAGA,CACnCZ,CAAuB,EACvBa,SAAiB,KACNb,CAAC,CAACN,YAAY,GAAGmB,SAAS,GAAG1B,6BAA6B;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAM2B,kBAAkB,GAAGA,CAChCd,CAAuB,EACvBe,OAAsB,EACtBX,GAAW,EACXS,SAAiB,KACL;EACZ,IAAIE,OAAO,IAAI,IAAI,EAAE,OAAO,IAAI;EAChC,IAAI,CAAChB,MAAM,CAACC,CAAC,EAAEe,OAAO,CAAC,EAAE,OAAO,KAAK;EACrC,OAAOf,CAAC,CAACP,OAAO,IAAIW,GAAG,IAAIQ,qBAAqB,CAACZ,CAAC,EAAEa,SAAS,CAAC;AAChE,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatInfo.d.ts","sourceRoot":"","sources":["../../../../../src/screens/ChatInfo/ChatInfo.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;;
|
|
1
|
+
{"version":3,"file":"ChatInfo.d.ts","sourceRoot":"","sources":["../../../../../src/screens/ChatInfo/ChatInfo.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;;AAmG7C,wBAAgD"}
|
|
@@ -8,7 +8,8 @@ interface ChatInfoActionsProps {
|
|
|
8
8
|
onPressAddToGroup?: () => void;
|
|
9
9
|
onPressLeaveGroup?: () => void;
|
|
10
10
|
onDismissGroup?: () => void;
|
|
11
|
+
isNotInGroup?: boolean;
|
|
11
12
|
}
|
|
12
|
-
declare const ChatInfoActions: import("react").MemoExoticComponent<({ conversation, isTargetActive, isGroup, onPressOrders, onPressCreateGroup, onPressAddToGroup, onPressLeaveGroup, onDismissGroup, }: ChatInfoActionsProps) => import("react").JSX.Element>;
|
|
13
|
+
declare const ChatInfoActions: import("react").MemoExoticComponent<({ conversation, isTargetActive, isGroup, onPressOrders, onPressCreateGroup, onPressAddToGroup, onPressLeaveGroup, onDismissGroup, isNotInGroup, }: ChatInfoActionsProps) => import("react").JSX.Element>;
|
|
13
14
|
export default ChatInfoActions;
|
|
14
15
|
//# sourceMappingURL=ChatInfoActions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatInfoActions.d.ts","sourceRoot":"","sources":["../../../../../src/screens/ChatInfo/ChatInfoActions.tsx"],"names":[],"mappings":"AAQA,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAC;AAQvC,UAAU,oBAAoB;IAC5B,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatInfoActions.d.ts","sourceRoot":"","sources":["../../../../../src/screens/ChatInfo/ChatInfoActions.tsx"],"names":[],"mappings":"AAQA,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAC;AAQvC,UAAU,oBAAoB;IAC5B,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,eAAe,0LAWhB,oBAAoB,iCA6NxB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -2,7 +2,8 @@ import { type ConversationItem } from '@droppii/openim-rn-client-sdk';
|
|
|
2
2
|
interface ChatInfoProfileProps {
|
|
3
3
|
conversation?: ConversationItem;
|
|
4
4
|
onPressSearch?: () => void;
|
|
5
|
+
isNotInGroup?: boolean;
|
|
5
6
|
}
|
|
6
|
-
declare const ChatInfoProfile: import("react").MemoExoticComponent<({ conversation, onPressSearch }: ChatInfoProfileProps) => import("react").JSX.Element>;
|
|
7
|
+
declare const ChatInfoProfile: import("react").MemoExoticComponent<({ conversation, onPressSearch, isNotInGroup }: ChatInfoProfileProps) => import("react").JSX.Element>;
|
|
7
8
|
export default ChatInfoProfile;
|
|
8
9
|
//# sourceMappingURL=ChatInfoProfile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatInfoProfile.d.ts","sourceRoot":"","sources":["../../../../../src/screens/ChatInfo/ChatInfoProfile.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAC;AAwCvC,UAAU,oBAAoB;IAC5B,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatInfoProfile.d.ts","sourceRoot":"","sources":["../../../../../src/screens/ChatInfo/ChatInfoProfile.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAC;AAwCvC,UAAU,oBAAoB;IAC5B,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,QAAA,MAAM,eAAe,sFAC6B,oBAAoB,iCA2FrE,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatDetail.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatDetail.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatDetail.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatDetail.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAga/C,QAAA,MAAM,YAAY,GAAI,OAAO,eAAe,gCAS3C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -14,7 +14,10 @@ interface ChatListLegendInternalProps extends ChatListProps {
|
|
|
14
14
|
dismissAreaTouchProps?: DismissAreaTouchProps;
|
|
15
15
|
isComposerPanelOpen?: boolean;
|
|
16
16
|
onDismissAreaScrollBeginDrag?: () => void;
|
|
17
|
+
unreadToken?: number | null;
|
|
18
|
+
unreadTokenRef?: RefObject<number | null>;
|
|
19
|
+
deeplinkTargetId?: string;
|
|
17
20
|
}
|
|
18
|
-
export declare const ChatListLegend: import("react").MemoExoticComponent<({ messages, conversationId, customMessageItemFactory, onLoadMoreOld, moreOldLoading, hasMoreOld, onLoadMoreNew, hasMoreNew, onMediaPress: onMediaPressProp, onPressUrl: onPressUrlProp, onLongPress, listRef, freeze, scrollMessageToEnd, keyboardOffset, isLoading, renderConversationViewHeader, dismissAreaTouchProps, isComposerPanelOpen, onDismissAreaScrollBeginDrag, }: ChatListLegendInternalProps) => import("react").JSX.Element>;
|
|
21
|
+
export declare const ChatListLegend: import("react").MemoExoticComponent<({ messages, conversationId, customMessageItemFactory, onLoadMoreOld, moreOldLoading, hasMoreOld, onLoadMoreNew, hasMoreNew, onMediaPress: onMediaPressProp, onPressUrl: onPressUrlProp, onLongPress, listRef, freeze, scrollMessageToEnd, keyboardOffset, isLoading, renderConversationViewHeader, dismissAreaTouchProps, isComposerPanelOpen, onDismissAreaScrollBeginDrag, unreadToken, unreadTokenRef, deeplinkTargetId, }: ChatListLegendInternalProps) => import("react").JSX.Element>;
|
|
19
22
|
export {};
|
|
20
23
|
//# sourceMappingURL=ChatListLegend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChatListLegend.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatListLegend.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAQf,OAAiB,EAKf,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,8BAA8B,CAAC;AActC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"ChatListLegend.d.ts","sourceRoot":"","sources":["../../../../../src/screens/chat-detail/ChatListLegend.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAQf,OAAiB,EAKf,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAMjC,OAAO,EACL,KAAK,aAAa,EAEnB,MAAM,8BAA8B,CAAC;AActC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAyB7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAyE7E,UAAU,2BAA4B,SAAQ,aAAa;IACzD,OAAO,EAAE,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IACzC,MAAM,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;IAC7B,kBAAkB,EAAE,CAAC,IAAI,EAAE;QACzB,QAAQ,EAAE,OAAO,CAAC;QAClB,aAAa,EAAE,OAAO,CAAC;KACxB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IAGvB,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;IAE9C,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,4BAA4B,CAAC,EAAE,MAAM,IAAI,CAAC;IAG1C,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,cAAc,CAAC,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAG1C,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,eAAO,MAAM,cAAc,scAyBtB,2BAA2B,iCAgoC/B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
import type { MarkReadGate } from './useMarkConversationRead';
|
|
3
|
+
/**
|
|
4
|
+
* Holds mark-read back until this screen's first-unread lookup has answered,
|
|
5
|
+
* so the thread is never marked read before the anchor is captured. Scoped to
|
|
6
|
+
* the token in `tokenRef`: another screen's session never opens or closes it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const createUnreadMarkReadGate: (tokenRef: RefObject<number | null>) => MarkReadGate;
|
|
9
|
+
//# sourceMappingURL=createUnreadMarkReadGate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createUnreadMarkReadGate.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/hooks/createUnreadMarkReadGate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GACnC,UAAU,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,KACjC,YAwBD,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import { type MarkReadReason } from '../../../utils/markReadPolicy';
|
|
3
|
+
/**
|
|
4
|
+
* Something mark-read has to wait for. Optional, so the edge-triggered
|
|
5
|
+
* mark-read works on its own (gate open) without the unread indicator.
|
|
6
|
+
*/
|
|
7
|
+
export interface MarkReadGate {
|
|
8
|
+
isClosed: () => boolean;
|
|
9
|
+
/** When a closed gate opens on its own (epoch ms), or null if it won't. */
|
|
10
|
+
openDeadline: () => number | null;
|
|
11
|
+
/** `onOpen`: the gate opened; `onClear`: the session ended (non-child blur). */
|
|
12
|
+
subscribe: (handlers: {
|
|
13
|
+
onOpen: () => void;
|
|
14
|
+
onClear: () => void;
|
|
15
|
+
}) => () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Edge-triggered, throttled mark-read. A trigger marks the conversation dirty
|
|
19
|
+
* and tries to flush; the flush only calls the SDK when `shouldRequestMarkRead`
|
|
20
|
+
* allows it, at most once per `MARK_READ_THROTTLE_MS` (trailing). The dirty
|
|
21
|
+
* flag is cleared only by a successful call, so a suppressed or failed one is
|
|
22
|
+
* retried by the next trigger. Everything is read through refs, so the
|
|
23
|
+
* returned callbacks are stable.
|
|
24
|
+
*
|
|
25
|
+
* Deeplink entry: the first list load of each deeplink target never marks the
|
|
26
|
+
* thread dirty — the list rests at the window end only until the jump runs.
|
|
27
|
+
*/
|
|
28
|
+
export declare const useMarkConversationRead: ({ conversationId, isAtBottomRef, listLoadedRef, hasMoreNew, deeplinkTargetId, gate, }: {
|
|
29
|
+
conversationId?: string;
|
|
30
|
+
isAtBottomRef: RefObject<boolean>;
|
|
31
|
+
listLoadedRef: RefObject<boolean>;
|
|
32
|
+
hasMoreNew: boolean;
|
|
33
|
+
deeplinkTargetId?: string;
|
|
34
|
+
gate?: MarkReadGate;
|
|
35
|
+
}) => {
|
|
36
|
+
requestMarkRead: (reason: MarkReadReason) => void;
|
|
37
|
+
flushMarkRead: (reason: MarkReadReason) => void;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=useMarkConversationRead.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useMarkConversationRead.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/hooks/useMarkConversationRead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvE,OAAO,EAIL,KAAK,cAAc,EACpB,MAAM,+BAA+B,CAAC;AAEvC;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,QAAQ,EAAE,MAAM,OAAO,CAAC;IACxB,2EAA2E;IAC3E,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC,gFAAgF;IAChF,SAAS,EAAE,CAAC,QAAQ,EAAE;QACpB,MAAM,EAAE,MAAM,IAAI,CAAC;QACnB,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,KAAK,MAAM,IAAI,CAAC;CAClB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,GAAI,uFAOrC;IACD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAClC,aAAa,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,CAAC,EAAE,YAAY,CAAC;CACrB;8BA+EY,cAAc;4BAakB,cAAc;CAoD1D,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import type { LegendListRef, ViewToken, ViewabilityConfig } from '@legendapp/list/react-native';
|
|
3
|
+
/**
|
|
4
|
+
* "The divider has been seen" = the anchor row's TOP edge (where the divider
|
|
5
|
+
* sits) is in the viewport, after initial positioning has settled. Before
|
|
6
|
+
* settle — Old Arch corrects the estimated `initialScrollAtEnd` later — a
|
|
7
|
+
* visible divider only hides the pill (render-time check), it doesn't dismiss
|
|
8
|
+
* it for good.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useUnreadAnchorSeen: ({ rowId, unreadToken, isLoading, listRef, }: {
|
|
11
|
+
rowId: string | null;
|
|
12
|
+
unreadToken: number | null;
|
|
13
|
+
isLoading: boolean;
|
|
14
|
+
listRef: RefObject<LegendListRef | null>;
|
|
15
|
+
}) => {
|
|
16
|
+
positionSettled: boolean;
|
|
17
|
+
viewabilityReady: boolean;
|
|
18
|
+
viewabilityConfig: ViewabilityConfig;
|
|
19
|
+
isAnchorTopVisibleNow: () => boolean;
|
|
20
|
+
checkAnchorSeen: () => void;
|
|
21
|
+
handleViewableItemsChanged: ({ viewableItems }: {
|
|
22
|
+
viewableItems: ViewToken[];
|
|
23
|
+
}) => void;
|
|
24
|
+
markPositionSettled: () => void;
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=useUnreadAnchorSeen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnreadAnchorSeen.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/hooks/useUnreadAnchorSeen.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EACV,aAAa,EACb,SAAS,EACT,iBAAiB,EAClB,MAAM,8BAA8B,CAAC;AAStC;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,6CAKjC;IACD,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,EAAE,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;CAC1C;;;;;;oDA2BuB;QAAE,aAAa,EAAE,SAAS,EAAE,CAAA;KAAE;;CAwCrD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* D11: a deeplink to a message OLDER than the first unread hides the
|
|
4
|
+
* indicator; a deeplink at/after it (or whose target never shows up) shows it.
|
|
5
|
+
* Decided explicitly once the lookup has answered and the window has loaded,
|
|
6
|
+
* and re-decided — against the existing anchor, with no SDK call — when
|
|
7
|
+
* `targetMessageId` changes on the same screen.
|
|
8
|
+
*
|
|
9
|
+
* Must run above `useMessages` in ChatDetail: the re-arm effect has to land
|
|
10
|
+
* before `useMessages`' `reset()` in the same commit.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useUnreadDeeplinkCheck: ({ targetMessageId, unreadToken, tokenRef, }: {
|
|
13
|
+
targetMessageId?: string;
|
|
14
|
+
unreadToken: number | null;
|
|
15
|
+
tokenRef: RefObject<number | null>;
|
|
16
|
+
}) => void;
|
|
17
|
+
//# sourceMappingURL=useUnreadDeeplinkCheck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnreadDeeplinkCheck.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/hooks/useUnreadDeeplinkCheck.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAK1D;;;;;;;;;GASG;AACH,eAAO,MAAM,sBAAsB,GAAI,6CAIpC;IACD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,SAAS,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACpC,SA4CA,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const CHILD_NAV_TTL_MS = 1000;
|
|
2
|
+
/**
|
|
3
|
+
* Owns this screen's unread-indicator session. `getFirstUnreadMessage` records
|
|
4
|
+
* the thread's open time server-side, so it's called exactly once per route
|
|
5
|
+
* visit: on the first focus after access is confirmed. A remount of ChatDetail
|
|
6
|
+
* inside the same route (access re-check, SDK reconnect) adopts the existing
|
|
7
|
+
* session instead of calling again; a new route key is a new visit.
|
|
8
|
+
*
|
|
9
|
+
* Must be called above `useMessages` (see `useUnreadDeeplinkCheck`).
|
|
10
|
+
*/
|
|
11
|
+
export declare const useUnreadIndicator: ({ conversationId, isBotConversation, targetMessageId, accessConfirmed, }: {
|
|
12
|
+
conversationId: string;
|
|
13
|
+
isBotConversation: boolean;
|
|
14
|
+
targetMessageId?: string;
|
|
15
|
+
accessConfirmed: boolean;
|
|
16
|
+
}) => {
|
|
17
|
+
unreadToken: number;
|
|
18
|
+
unreadTokenRef: import("react").RefObject<number>;
|
|
19
|
+
markChildNavigation: () => void;
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=useUnreadIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnreadIndicator.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/hooks/useUnreadIndicator.ts"],"names":[],"mappings":"AAcA,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC;;;;;;;;GAQG;AACH,eAAO,MAAM,kBAAkB,GAAI,0EAKhC;IACD,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;CAC1B;;;;CA4EA,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type RefObject } from 'react';
|
|
2
|
+
import type { MessageItem } from '@droppii/openim-rn-client-sdk';
|
|
3
|
+
import type { LegendListRef } from '@legendapp/list/react-native';
|
|
4
|
+
import { type ScrollToMessageOptions } from '../../../types/events';
|
|
5
|
+
/** Lands the divider ~100px below the list top, no highlight, never exits. */
|
|
6
|
+
export declare const UNREAD_JUMP_OPTIONS: ScrollToMessageOptions;
|
|
7
|
+
/**
|
|
8
|
+
* Wires the unread session into the list: which row carries the divider,
|
|
9
|
+
* whether the pill shows, and the pill's jump. The session is token-scoped —
|
|
10
|
+
* a second ChatDetail of the same thread never reads or dismisses this one's.
|
|
11
|
+
*/
|
|
12
|
+
export declare const useUnreadIndicatorInList: ({ messages, unreadToken, isLoading, hasMoreOld, moreOldLoading, onLoadMoreOld, isBotConversation, listRef, jumpInFlightRef, setJumpInFlight, }: {
|
|
13
|
+
messages: MessageItem[];
|
|
14
|
+
unreadToken: number | null;
|
|
15
|
+
isLoading: boolean;
|
|
16
|
+
hasMoreOld: boolean;
|
|
17
|
+
moreOldLoading: boolean;
|
|
18
|
+
onLoadMoreOld?: (loadMore: boolean) => void;
|
|
19
|
+
isBotConversation: boolean;
|
|
20
|
+
listRef: RefObject<LegendListRef | null>;
|
|
21
|
+
jumpInFlightRef: RefObject<boolean>;
|
|
22
|
+
/** Writes the flag (and its safety timeout); `jumpInFlightRef` reads it. */
|
|
23
|
+
setJumpInFlight: (inFlight: boolean) => void;
|
|
24
|
+
}) => {
|
|
25
|
+
unreadAnchorRowId: string;
|
|
26
|
+
isPillVisible: boolean;
|
|
27
|
+
viewabilityConfig: import("@legendapp/list/react-native").ViewabilityConfig;
|
|
28
|
+
handleViewableItemsChanged: ({ viewableItems }: {
|
|
29
|
+
viewableItems: import("@legendapp/list/react-native").ViewToken[];
|
|
30
|
+
}) => void;
|
|
31
|
+
checkAnchorSeen: () => void;
|
|
32
|
+
markPositionSettled: () => void;
|
|
33
|
+
jumpToFirstUnread: () => void;
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=useUnreadIndicatorInList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUnreadIndicatorInList.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/hooks/useUnreadIndicatorInList.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2C,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAGlE,OAAO,EAAa,KAAK,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAI/E,8EAA8E;AAC9E,eAAO,MAAM,mBAAmB,EAAE,sBAKjC,CAAC;AASF;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,GAAI,gJAWtC;IACD,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,OAAO,EAAE,SAAS,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;IACzC,eAAe,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACpC,4EAA4E;IAC5E,eAAe,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAC9C;;;;;;;;;;CA+HA,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface LegendChatUnreadButtonProps {
|
|
2
|
+
visible: boolean;
|
|
3
|
+
onPress?: () => void;
|
|
4
|
+
}
|
|
5
|
+
/** "Tin chưa đọc" half-pill, top-right of the list; jumps to the divider. */
|
|
6
|
+
export declare const LegendChatUnreadButton: import("react").MemoExoticComponent<({ visible, onPress }: LegendChatUnreadButtonProps) => import("react").JSX.Element>;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=LegendChatUnreadButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendChatUnreadButton.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/legend/LegendChatUnreadButton.tsx"],"names":[],"mappings":"AAuFA,UAAU,2BAA2B;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,6DACV,2BAA2B,iCAkCnD,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* "TIN NHẮN CHƯA ĐỌC" row above the first unread message. Figma spacing: the
|
|
3
|
+
* previous row's 8 bottom margin + 8 top margin + 4 padding = 20 above the
|
|
4
|
+
* lines; 4 padding + 12 bottom margin + the time label's 8 = 24 below.
|
|
5
|
+
*/
|
|
6
|
+
export declare const LegendChatUnreadDivider: import("react").MemoExoticComponent<() => import("react").JSX.Element>;
|
|
7
|
+
//# sourceMappingURL=LegendChatUnreadDivider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendChatUnreadDivider.d.ts","sourceRoot":"","sources":["../../../../../../src/screens/chat-detail/legend/LegendChatUnreadDivider.tsx"],"names":[],"mappings":"AAaA;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,wEAwBlC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type AdvancedGetMessageResult, type MessageItem } from '@droppii/openim-rn-client-sdk';
|
|
2
|
+
export declare const FIRST_UNREAD_TIMEOUT_MS = 5000;
|
|
2
3
|
export type HistoryMessageResult = AdvancedGetMessageResult & {
|
|
3
4
|
lastMinSeq?: number;
|
|
4
5
|
};
|
|
@@ -19,6 +20,13 @@ export declare namespace ChatMessageAPI {
|
|
|
19
20
|
count?: number;
|
|
20
21
|
}): Promise<import("@droppii/openim-rn-client-sdk").SearchMessageResult>;
|
|
21
22
|
function markConversationAsRead(conversationID: string): Promise<[unknown, unknown]>;
|
|
23
|
+
/**
|
|
24
|
+
* First unread message of the conversation, or `null` when there is none,
|
|
25
|
+
* the call fails, or it times out. Never throws. The server records the
|
|
26
|
+
* conversation's open time on this call, so callers invoke it once per
|
|
27
|
+
* visit.
|
|
28
|
+
*/
|
|
29
|
+
function getFirstUnreadMessage(conversationID: string, timeoutMs?: number): Promise<MessageItem | null>;
|
|
22
30
|
function getCurrentUserId(): Promise<string>;
|
|
23
31
|
}
|
|
24
32
|
export type { MessageItem };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/services/message.ts"],"names":[],"mappings":"AAAA,OAAkB,EAEhB,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EACjB,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/services/message.ts"],"names":[],"mappings":"AAAA,OAAkB,EAEhB,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EACjB,MAAM,+BAA+B,CAAC;AAWvC,eAAO,MAAM,uBAAuB,OAAO,CAAC;AAE5C,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,GAAG;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,yBAAiB,cAAc,CAAC;IAC9B,SAAsB,oBAAoB,CACxC,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE;QACR,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,GACA,OAAO,CAAC,oBAAoB,CAAC,CAQ/B;IAED,SAAsB,eAAe,CAAC,MAAM,EAAE;QAC5C,IAAI,EAAE,MAAM,CAAC;KACd,GAAG,OAAO,CAAC,WAAW,CAAC,CAavB;IAED,SAAsB,mBAAmB,CACvC,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE;QACR,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;QACvB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;QAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,wEASF;IAED,SAAsB,sBAAsB,CAAC,cAAc,EAAE,MAAM,+BAUlE;IAED;;;;;OAKG;IACH,SAAsB,qBAAqB,CACzC,cAAc,EAAE,MAAM,EACtB,SAAS,SAA0B,GAClC,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAwB7B;IAED,SAAsB,gBAAgB,oBAErC;CACF;AAED,YAAY,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/store/message.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAGV,YAAY,EACb,MAAM,eAAe,CAAC;AAcvB,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../../src/store/message.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAGV,YAAY,EACb,MAAM,eAAe,CAAC;AAcvB,eAAO,MAAM,eAAe,2EAuOzB,CAAC;AAEJ,eAAO,MAAM,kBAAkB,GAAI,aAAa,MAAM,SAiBrD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { UnreadIndicatorStore } from '../types/unreadIndicator';
|
|
2
|
+
/**
|
|
3
|
+
* Unread-indicator session for ChatDetail. A dedicated store rather than a
|
|
4
|
+
* slice of `useMessageStore`, whose `reset()` also runs on a deeplink target
|
|
5
|
+
* change. Module scope on purpose: the session outlives remounts of
|
|
6
|
+
* ChatDetail inside the same route (access re-check, SDK reconnect). Internal —
|
|
7
|
+
* not exported from `store/index.ts`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const useUnreadIndicatorStore: import("zustand").UseBoundStore<import("zustand").StoreApi<UnreadIndicatorStore>>;
|
|
10
|
+
//# sourceMappingURL=unreadIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unreadIndicator.d.ts","sourceRoot":"","sources":["../../../../src/store/unreadIndicator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAYrE;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,mFAiBnC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../../src/translation/resources/i18n.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../../src/translation/resources/i18n.ts"],"names":[],"mappings":";;;AAiPA,wBAEE"}
|
|
@@ -3,6 +3,7 @@ import type { PropsWithChildren } from 'react';
|
|
|
3
3
|
import type { IUrlMetadata } from './common';
|
|
4
4
|
import type { DFlowContext, IConversationFlow, IConversationFlowStep, InputButtonItem, IRunConversationFlowPayload } from './flows';
|
|
5
5
|
import type { GetOpenIMTokenResponse } from './auth';
|
|
6
|
+
import type { ScrollToMessageOptions } from './events';
|
|
6
7
|
import type { ChatDetailProps } from '../screens/chat-detail';
|
|
7
8
|
export declare const EventProvider: {
|
|
8
9
|
readonly ga: "ga";
|
|
@@ -179,6 +180,8 @@ export interface ISearchMessagesParams {
|
|
|
179
180
|
applicationType: DChatApplicationType;
|
|
180
181
|
conversationId?: string;
|
|
181
182
|
startClientMsgId: string;
|
|
183
|
+
/** Carried from the ScrollToMessage that triggered the search. */
|
|
184
|
+
scrollOptions?: ScrollToMessageOptions;
|
|
182
185
|
}
|
|
183
186
|
export interface MessageStore {
|
|
184
187
|
messages: MessageItem[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../src/types/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,KAAK,WAAW,EAChB,KAAK,YAAY,EAClB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,QAAQ,CAAC;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE9D,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,KAAK,KAAK,GAAG,CACX,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,GAAG,EACZ,QAAQ,CAAC,EAAE,GAAG,MAAM,OAAO,aAAa,EAAE,KACvC,IAAI,CAAC;AAEV,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAA;KAAE,CAAC;IACxC,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAA;KAAE,CAAC;IACxC,KAAK,CAAC,EAAE;QAAE,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAA;KAAE,CAAC;IACxC,WAAW,C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eAAe,CAAC;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;CAC1B"}
|
|
@@ -7,8 +7,24 @@ export declare enum ChatEvent {
|
|
|
7
7
|
GroupRemoved = "chat:group_removed",
|
|
8
8
|
TargetMessageUnavailable = "chat:target_message_unavailable"
|
|
9
9
|
}
|
|
10
|
-
export interface
|
|
10
|
+
export interface ScrollToMessageOptions {
|
|
11
|
+
/** Default true: highlight the target for 5s after landing. */
|
|
12
|
+
highlight?: boolean;
|
|
13
|
+
/** Default 0.5 (centred). */
|
|
14
|
+
viewPosition?: number;
|
|
15
|
+
viewOffset?: number;
|
|
16
|
+
/** Default true: an unavailable target toasts and navigates back. */
|
|
17
|
+
exitOnUnavailable?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Default true. False: an out-of-window jump loads the window but doesn't
|
|
20
|
+
* re-emit, because the caller re-resolves its own target.
|
|
21
|
+
*/
|
|
22
|
+
reemitAfterSearch?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface ScrollToMessagePayload extends ScrollToMessageOptions {
|
|
11
25
|
clientMessageId: string;
|
|
26
|
+
/** @internal Set on post-search emits; stops a re-search loop. */
|
|
27
|
+
fromSearch?: boolean;
|
|
12
28
|
}
|
|
13
29
|
export interface MessageRevokedPayload {
|
|
14
30
|
clientMsgID: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,oBAAY,SAAS;IACnB,eAAe,2BAA2B;IAC1C,cAAc,0BAA0B;IACxC,cAAc,yBAAyB;IACvC,sBAAsB,kCAAkC;IACxD,YAAY,uBAAuB;IACnC,wBAAwB,oCAAoC;CAC7D;AAED,MAAM,WAAW,sBAAsB;IACrC,eAAe,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../../../src/types/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,oBAAY,SAAS;IACnB,eAAe,2BAA2B;IAC1C,cAAc,0BAA0B;IACxC,cAAc,yBAAyB;IACvC,sBAAsB,kCAAkC;IACxD,YAAY,uBAAuB;IACnC,wBAAwB,oCAAoC;CAC7D;AAED,MAAM,WAAW,sBAAsB;IACrC,+DAA+D;IAC/D,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,6BAA6B;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,sBAAuB,SAAQ,sBAAsB;IACpE,eAAe,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,6BAA6B,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAElE,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;CACzC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/** The validated first-unread message of a thread. */
|
|
2
|
+
export interface UnreadAnchor {
|
|
3
|
+
clientMsgID: string;
|
|
4
|
+
seq: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* One unread-indicator session per route visit. `token` identifies the
|
|
8
|
+
* session: every mutation after `begin` names the token it was issued for and
|
|
9
|
+
* is a no-op otherwise, so two ChatDetail instances of the same thread can't
|
|
10
|
+
* touch each other's session.
|
|
11
|
+
*/
|
|
12
|
+
export interface UnreadIndicatorState {
|
|
13
|
+
token: number;
|
|
14
|
+
routeKey?: string;
|
|
15
|
+
conversationId?: string;
|
|
16
|
+
/** The `getFirstUnreadMessage` lookup is in flight (mark-read gate). */
|
|
17
|
+
pending: boolean;
|
|
18
|
+
pendingSince: number;
|
|
19
|
+
anchor: UnreadAnchor | null;
|
|
20
|
+
pillDismissed: boolean;
|
|
21
|
+
/** Deeplink entry: hide the indicator until the D11 rule is decided. */
|
|
22
|
+
awaitingDeeplinkCheck: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* How the lookup phase ended: `resolve` (answered), `clear` (left the
|
|
25
|
+
* screen — blur), `hide` (D11 deeplink rule hid it; the user is still here).
|
|
26
|
+
*/
|
|
27
|
+
settledBy: 'resolve' | 'clear' | 'hide' | null;
|
|
28
|
+
}
|
|
29
|
+
export interface BeginUnreadSessionOptions {
|
|
30
|
+
routeKey: string;
|
|
31
|
+
conversationId: string;
|
|
32
|
+
/** Bot threads: no lookup, no indicator, gate open. */
|
|
33
|
+
skip: boolean;
|
|
34
|
+
awaitDeeplinkCheck: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface UnreadIndicatorStore extends UnreadIndicatorState {
|
|
37
|
+
begin: (options: BeginUnreadSessionOptions) => number;
|
|
38
|
+
resolve: (token: number, anchor: UnreadAnchor | null) => void;
|
|
39
|
+
clear: (token: number) => void;
|
|
40
|
+
dismissPill: (token: number) => void;
|
|
41
|
+
confirmDeeplinkCheck: (token: number, hide: boolean) => void;
|
|
42
|
+
rearmDeeplinkCheck: (token: number) => void;
|
|
43
|
+
reset: () => void;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=unreadIndicator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unreadIndicator.d.ts","sourceRoot":"","sources":["../../../../src/types/unreadIndicator.ts"],"names":[],"mappings":"AAEA,sDAAsD;AACtD,M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+
/**
|
|
2
|
+
* When ChatDetail may mark the conversation read. Since OpenIM rc43 every
|
|
3
|
+
* call is a server round-trip (two SDK requests), so it's edge-triggered and
|
|
4
|
+
* throttled instead of fired on every scroll event. Pure, for unit tests.
|
|
5
|
+
*/
|
|
6
|
+
export type MarkReadReason = 'list-load' | 'reached-bottom' | 'incoming' | 'fab' | 'window-reload' | 'focus' | 'app-active' | 'gate-open' | 'leave';
|
|
7
|
+
export interface MarkReadInput {
|
|
8
|
+
reason: MarkReadReason;
|
|
9
|
+
/** The unread lookup hasn't answered yet (its anchor must be captured first). */
|
|
10
|
+
gateClosed: boolean;
|
|
11
|
+
focused: boolean;
|
|
12
|
+
appActive: boolean;
|
|
13
|
+
listLoaded: boolean;
|
|
14
|
+
/** The window isn't at the newest message (deeplink / jump window). */
|
|
15
|
+
hasMoreNew: boolean;
|
|
16
|
+
atBottom: boolean;
|
|
17
|
+
isDeeplinkFirstLoad: boolean;
|
|
18
|
+
/** A mark-read became due while the screen was focused. */
|
|
19
|
+
dirtyWhileFocused: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** A list (re)load just landed — not something the user did. */
|
|
22
|
+
export declare const isListLoadReason: (reason: MarkReadReason) => boolean;
|
|
23
|
+
export declare const shouldRequestMarkRead: (input: MarkReadInput) => boolean;
|
|
24
|
+
export declare const MARK_READ_THROTTLE_MS = 1000;
|
|
25
|
+
/** 0 → call now; otherwise the delay of the trailing call. */
|
|
26
|
+
export declare const nextMarkReadDelay: (now: number, lastCallAt: number, throttleMs?: number) => number;
|
|
27
|
+
//# sourceMappingURL=markReadPolicy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markReadPolicy.d.ts","sourceRoot":"","sources":["../../../../src/utils/markReadPolicy.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,MAAM,cAAc,GACtB,WAAW,GACX,gBAAgB,GAChB,UAAU,GACV,KAAK,GACL,eAAe,GACf,OAAO,GACP,YAAY,GACZ,WAAW,GACX,OAAO,CAAC;AAEZ,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,cAAc,CAAC;IACvB,iFAAiF;IACjF,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,uEAAuE;IACvE,UAAU,EAAE,OAAO,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,2DAA2D;IAC3D,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,gEAAgE;AAChE,eAAO,MAAM,gBAAgB,GAAI,QAAQ,cAAc,KAAG,OACJ,CAAC;AAEvD,eAAO,MAAM,qBAAqB,GAAI,OAAO,aAAa,KAAG,OAS5D,CAAC;AAEF,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,8DAA8D;AAC9D,eAAO,MAAM,iBAAiB,GAC5B,KAAK,MAAM,EACX,YAAY,MAAM,EAClB,mBAAkC,KACjC,MAAoD,CAAC"}
|