@planningcenter/chat-react-native 4.2.1-qa-staging.9 → 4.2.1
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/build/components/conversation/message_form.d.ts +1 -2
- package/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +370 -167
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversation/message_list.d.ts +2 -5
- package/build/components/conversation/message_list.d.ts.map +1 -1
- package/build/components/conversation/message_list.js +67 -187
- package/build/components/conversation/message_list.js.map +1 -1
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +3 -4
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -1
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.d.ts.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use_conversation_messages.d.ts +5 -14
- package/build/hooks/use_conversation_messages.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages.js +42 -218
- package/build/hooks/use_conversation_messages.js.map +1 -1
- package/build/hooks/use_conversation_messages_jolt_events.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages_jolt_events.js +42 -58
- package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
- package/build/hooks/use_features.d.ts +1 -2
- package/build/hooks/use_features.d.ts.map +1 -1
- package/build/hooks/use_features.js +1 -2
- package/build/hooks/use_features.js.map +1 -1
- package/build/hooks/use_mark_latest_message_read.d.ts +1 -2
- package/build/hooks/use_mark_latest_message_read.d.ts.map +1 -1
- package/build/hooks/use_mark_latest_message_read.js +3 -4
- package/build/hooks/use_mark_latest_message_read.js.map +1 -1
- package/build/hooks/use_read_receipts.d.ts +3 -4
- package/build/hooks/use_read_receipts.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.d.ts +6 -10
- package/build/hooks/use_suspense_api.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.js +63 -83
- package/build/hooks/use_suspense_api.js.map +1 -1
- package/build/screens/conversation_new/components/services_form.js +8 -9
- package/build/screens/conversation_new/components/services_form.js.map +1 -1
- package/build/screens/conversation_screen.d.ts +0 -1
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +203 -305
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/message_actions_screen.d.ts.map +1 -1
- package/build/screens/message_actions_screen.js +92 -103
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/screens/notification_settings/hooks/groups.d.ts +3 -4
- package/build/screens/notification_settings/hooks/groups.d.ts.map +1 -1
- package/build/types/api_primitives.d.ts +0 -1
- package/build/types/api_primitives.d.ts.map +1 -1
- package/build/types/api_primitives.js.map +1 -1
- package/build/types/resources/member.d.ts +0 -1
- package/build/types/resources/member.d.ts.map +1 -1
- package/build/types/resources/member.js.map +1 -1
- package/build/utils/cache/messages_cache.d.ts +0 -1
- package/build/utils/cache/messages_cache.d.ts.map +1 -1
- package/build/utils/cache/messages_cache.js +1 -37
- package/build/utils/cache/messages_cache.js.map +1 -1
- package/build/utils/client/types.d.ts +0 -1
- package/build/utils/client/types.d.ts.map +1 -1
- package/build/utils/client/types.js.map +1 -1
- package/build/utils/group_messages.js +1 -4
- package/build/utils/group_messages.js.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/hooks/use_features.test.ts +2 -10
- package/src/__utils__/query_client.ts +0 -3
- package/src/components/conversation/message_form.tsx +3 -31
- package/src/components/conversation/message_list.tsx +4 -88
- package/src/hooks/__tests__/use_message_create_or_update.test.tsx +7 -2
- package/src/hooks/index.ts +0 -1
- package/src/hooks/use_conversation_messages.ts +17 -103
- package/src/hooks/use_conversation_messages_jolt_events.ts +2 -12
- package/src/hooks/use_features.ts +2 -3
- package/src/hooks/use_mark_latest_message_read.ts +3 -4
- package/src/hooks/use_suspense_api.ts +6 -14
- package/src/screens/conversation_new/components/services_form.tsx +5 -5
- package/src/screens/conversation_screen.tsx +13 -62
- package/src/screens/message_actions_screen.tsx +1 -12
- package/src/types/api_primitives.ts +0 -1
- package/src/types/resources/member.ts +0 -1
- package/src/utils/__tests__/group_messages.test.ts +0 -29
- package/src/utils/cache/__tests__/messages_cache.test.ts +1 -2
- package/src/utils/cache/__tests__/messages_cache_reply_roots.test.ts +2 -3
- package/src/utils/cache/messages_cache.ts +1 -45
- package/src/utils/client/types.ts +0 -1
- package/src/utils/group_messages.ts +1 -4
- package/build/components/conversation/missing_message.d.ts +0 -2
- package/build/components/conversation/missing_message.d.ts.map +0 -1
- package/build/components/conversation/missing_message.js +0 -139
- package/build/components/conversation/missing_message.js.map +0 -1
- package/build/hooks/use_direct_message_eligibility.d.ts +0 -14
- package/build/hooks/use_direct_message_eligibility.d.ts.map +0 -1
- package/build/hooks/use_direct_message_eligibility.js +0 -87
- package/build/hooks/use_direct_message_eligibility.js.map +0 -1
- package/build/utils/cache/messages_window.d.ts +0 -11
- package/build/utils/cache/messages_window.d.ts.map +0 -1
- package/build/utils/cache/messages_window.js +0 -51
- package/build/utils/cache/messages_window.js.map +0 -1
- package/src/__tests__/hooks/use_direct_message_eligibility.test.tsx +0 -83
- package/src/__tests__/screens/conversation_new/components/services_form.test.tsx +0 -91
- package/src/components/conversation/missing_message.tsx +0 -66
- package/src/hooks/__tests__/use_conversation_messages.test.tsx +0 -333
- package/src/hooks/__tests__/use_conversation_messages_jolt_events.test.tsx +0 -87
- package/src/hooks/__tests__/use_mark_latest_message_read.test.tsx +0 -33
- package/src/hooks/use_direct_message_eligibility.ts +0 -40
- package/src/utils/cache/__tests__/messages_cache_deletion.test.ts +0 -97
- package/src/utils/cache/__tests__/messages_window.test.ts +0 -78
- package/src/utils/cache/messages_window.ts +0 -55
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { date as formatDate } from '@planningcenter/datetime-fmt';
|
|
3
|
-
import
|
|
4
|
-
import React, { useRef } from 'react';
|
|
3
|
+
import React from 'react';
|
|
5
4
|
import { FlatList, StyleSheet, View } from 'react-native';
|
|
6
5
|
import { useTheme } from '../../hooks';
|
|
7
6
|
import { getRelativeDateStatus } from '../../utils/date';
|
|
@@ -11,266 +10,147 @@ import { isSystemMessage } from '../../utils/system_messages';
|
|
|
11
10
|
import { Text } from '../display';
|
|
12
11
|
import { ConversationStartBanner } from './conversation_start_banner';
|
|
13
12
|
import { Message } from './message';
|
|
14
|
-
import { MissingMessage } from './missing_message';
|
|
15
13
|
import { ReplyShadowMessage } from './reply_shadow_message';
|
|
16
14
|
import { SystemMessage } from './system_message';
|
|
17
|
-
|
|
18
|
-
// While behind, the bottom of the window isn't the live edge. Following there pulls
|
|
19
|
-
// each newly paged-in page into view and chains the next fetch.
|
|
20
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
-
const HOLD_AND_FOLLOW = {
|
|
22
|
-
minIndexForVisible: 0,
|
|
23
|
-
autoscrollToTopThreshold: 100
|
|
24
|
-
};
|
|
25
|
-
const HOLD_ONLY = {
|
|
26
|
-
minIndexForVisible: 0
|
|
27
|
-
};
|
|
28
|
-
const ANCHOR_CLEARS_JUMP_BUTTON = 56;
|
|
29
|
-
|
|
30
16
|
/** MessageList
|
|
31
17
|
* The inverted list of messages, reply previews, and date separators for a conversation
|
|
32
18
|
*/
|
|
33
19
|
export function MessageList(t0) {
|
|
34
|
-
const $ = _c(
|
|
20
|
+
const $ = _c(26);
|
|
35
21
|
const {
|
|
36
22
|
listRef,
|
|
37
23
|
conversation,
|
|
38
24
|
conversationId,
|
|
39
25
|
messages,
|
|
40
26
|
replyRootId,
|
|
41
|
-
anchorMessageId,
|
|
42
|
-
behind: t1,
|
|
43
27
|
hasNextPage,
|
|
44
28
|
onEndReached,
|
|
45
|
-
onStartReached,
|
|
46
29
|
onScroll,
|
|
47
30
|
onLayout,
|
|
48
31
|
onContentSizeChange,
|
|
49
|
-
onScrollBeginDrag,
|
|
50
32
|
onScrollEndDrag,
|
|
51
33
|
onMomentumScrollEnd
|
|
52
34
|
} = t0;
|
|
53
|
-
const behind = t1 === undefined ? false : t1;
|
|
54
35
|
const styles = useStyles();
|
|
55
36
|
const inReplyScreen = !!replyRootId;
|
|
56
37
|
const canDeleteNonAuthoredMessages = conversation.memberAbility?.canDeleteNonAuthoredMessages ?? false;
|
|
57
38
|
const latestRead = conversation.latestReadMessageSortKey;
|
|
58
|
-
let
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
messagesWithSeparators = groupMessages({
|
|
39
|
+
let t1;
|
|
40
|
+
if ($[0] !== inReplyScreen || $[1] !== messages) {
|
|
41
|
+
t1 = groupMessages({
|
|
62
42
|
ms: messages,
|
|
63
43
|
inReplyScreen
|
|
64
44
|
});
|
|
65
|
-
|
|
66
|
-
$[
|
|
67
|
-
$[
|
|
68
|
-
$[2] = messages;
|
|
69
|
-
$[3] = messagesWithSeparators;
|
|
70
|
-
$[4] = t2;
|
|
71
|
-
} else {
|
|
72
|
-
messagesWithSeparators = $[3];
|
|
73
|
-
t2 = $[4];
|
|
74
|
-
}
|
|
75
|
-
const anchorIndex = t2;
|
|
76
|
-
const layoutHeight = useRef(0);
|
|
77
|
-
const contentHeight = useRef(0);
|
|
78
|
-
const userHasScrolled = useRef(false);
|
|
79
|
-
const draggedSinceStartReached = useRef(false);
|
|
80
|
-
let t3;
|
|
81
|
-
if ($[5] !== anchorIndex || $[6] !== listRef) {
|
|
82
|
-
t3 = () => {
|
|
83
|
-
const anchorIsLoaded = anchorIndex >= 0;
|
|
84
|
-
if (!anchorIsLoaded || userHasScrolled.current) {
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const scrollable = layoutHeight.current > 0 && contentHeight.current > layoutHeight.current;
|
|
88
|
-
if (!scrollable) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
listRef.current?.scrollToIndex({
|
|
92
|
-
index: anchorIndex,
|
|
93
|
-
viewPosition: 0,
|
|
94
|
-
viewOffset: ANCHOR_CLEARS_JUMP_BUTTON,
|
|
95
|
-
animated: false
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
$[5] = anchorIndex;
|
|
99
|
-
$[6] = listRef;
|
|
100
|
-
$[7] = t3;
|
|
101
|
-
} else {
|
|
102
|
-
t3 = $[7];
|
|
103
|
-
}
|
|
104
|
-
const pinAnchorToBottomEdge = t3;
|
|
105
|
-
let t4;
|
|
106
|
-
if ($[8] !== onLayout || $[9] !== pinAnchorToBottomEdge) {
|
|
107
|
-
t4 = event => {
|
|
108
|
-
onLayout?.(event);
|
|
109
|
-
layoutHeight.current = event.nativeEvent.layout.height;
|
|
110
|
-
pinAnchorToBottomEdge();
|
|
111
|
-
};
|
|
112
|
-
$[8] = onLayout;
|
|
113
|
-
$[9] = pinAnchorToBottomEdge;
|
|
114
|
-
$[10] = t4;
|
|
45
|
+
$[0] = inReplyScreen;
|
|
46
|
+
$[1] = messages;
|
|
47
|
+
$[2] = t1;
|
|
115
48
|
} else {
|
|
116
|
-
|
|
49
|
+
t1 = $[2];
|
|
117
50
|
}
|
|
118
|
-
const
|
|
119
|
-
let
|
|
120
|
-
if ($[
|
|
121
|
-
|
|
122
|
-
onContentSizeChange?.(width, height);
|
|
123
|
-
contentHeight.current = height;
|
|
124
|
-
pinAnchorToBottomEdge();
|
|
125
|
-
};
|
|
126
|
-
$[11] = onContentSizeChange;
|
|
127
|
-
$[12] = pinAnchorToBottomEdge;
|
|
128
|
-
$[13] = t5;
|
|
129
|
-
} else {
|
|
130
|
-
t5 = $[13];
|
|
131
|
-
}
|
|
132
|
-
const handleContentSizeChange = t5;
|
|
133
|
-
let t6;
|
|
134
|
-
if ($[14] !== onScrollBeginDrag) {
|
|
135
|
-
t6 = event_0 => {
|
|
136
|
-
userHasScrolled.current = true;
|
|
137
|
-
draggedSinceStartReached.current = true;
|
|
138
|
-
onScrollBeginDrag?.(event_0);
|
|
139
|
-
};
|
|
140
|
-
$[14] = onScrollBeginDrag;
|
|
141
|
-
$[15] = t6;
|
|
142
|
-
} else {
|
|
143
|
-
t6 = $[15];
|
|
144
|
-
}
|
|
145
|
-
const handleScrollBeginDrag = t6;
|
|
146
|
-
let t7;
|
|
147
|
-
if ($[16] !== onStartReached) {
|
|
148
|
-
t7 = () => {
|
|
149
|
-
if (!draggedSinceStartReached.current) {
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
draggedSinceStartReached.current = false;
|
|
153
|
-
onStartReached?.();
|
|
154
|
-
};
|
|
155
|
-
$[16] = onStartReached;
|
|
156
|
-
$[17] = t7;
|
|
157
|
-
} else {
|
|
158
|
-
t7 = $[17];
|
|
159
|
-
}
|
|
160
|
-
const handleStartReached = t7;
|
|
161
|
-
const t8 = behind ? HOLD_ONLY : HOLD_AND_FOLLOW;
|
|
162
|
-
let t9;
|
|
163
|
-
if ($[18] !== conversation || $[19] !== hasNextPage) {
|
|
164
|
-
t9 = hasNextPage ? null : /*#__PURE__*/_jsx(ConversationStartBanner, {
|
|
51
|
+
const messagesWithSeparators = t1;
|
|
52
|
+
let t2;
|
|
53
|
+
if ($[3] !== conversation || $[4] !== hasNextPage) {
|
|
54
|
+
t2 = hasNextPage ? null : /*#__PURE__*/_jsx(ConversationStartBanner, {
|
|
165
55
|
conversation: conversation,
|
|
166
56
|
hasMessages: true
|
|
167
57
|
});
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
58
|
+
$[3] = conversation;
|
|
59
|
+
$[4] = hasNextPage;
|
|
60
|
+
$[5] = t2;
|
|
171
61
|
} else {
|
|
172
|
-
|
|
62
|
+
t2 = $[5];
|
|
173
63
|
}
|
|
174
|
-
let
|
|
175
|
-
if ($[
|
|
176
|
-
|
|
64
|
+
let t3;
|
|
65
|
+
if ($[6] !== canDeleteNonAuthoredMessages || $[7] !== conversationId || $[8] !== inReplyScreen || $[9] !== latestRead) {
|
|
66
|
+
t3 = t4 => {
|
|
177
67
|
const {
|
|
178
|
-
item:
|
|
179
|
-
} =
|
|
180
|
-
if (
|
|
68
|
+
item: item_0
|
|
69
|
+
} = t4;
|
|
70
|
+
if (item_0.type === "DateSeparator") {
|
|
181
71
|
return /*#__PURE__*/_jsx(InlineDateSeparator, {
|
|
182
|
-
...
|
|
72
|
+
...item_0
|
|
183
73
|
});
|
|
184
74
|
}
|
|
185
|
-
if (
|
|
186
|
-
return /*#__PURE__*/_jsx(MissingMessage, {});
|
|
187
|
-
}
|
|
188
|
-
if (item_1.type === "ReplyShadowMessage") {
|
|
75
|
+
if (item_0.type === "ReplyShadowMessage") {
|
|
189
76
|
return /*#__PURE__*/_jsx(ReplyShadowMessage, {
|
|
190
|
-
...
|
|
77
|
+
...item_0,
|
|
191
78
|
conversation_id: conversationId,
|
|
192
79
|
inReplyScreen: inReplyScreen
|
|
193
80
|
});
|
|
194
81
|
}
|
|
195
|
-
if (isSystemMessage(
|
|
82
|
+
if (isSystemMessage(item_0)) {
|
|
196
83
|
return /*#__PURE__*/_jsx(SystemMessage, {
|
|
197
|
-
message:
|
|
84
|
+
message: item_0,
|
|
198
85
|
conversationId: conversationId
|
|
199
86
|
});
|
|
200
87
|
}
|
|
201
|
-
const readByOthers =
|
|
88
|
+
const readByOthers = item_0.mine && !!latestRead && item_0.id <= latestRead;
|
|
202
89
|
return /*#__PURE__*/_jsx(Message, {
|
|
203
|
-
...
|
|
90
|
+
...item_0,
|
|
204
91
|
canDeleteNonAuthoredMessages: canDeleteNonAuthoredMessages,
|
|
205
92
|
conversation_id: conversationId,
|
|
206
93
|
readByOthers: readByOthers,
|
|
207
94
|
inReplyScreen: inReplyScreen
|
|
208
95
|
});
|
|
209
96
|
};
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
97
|
+
$[6] = canDeleteNonAuthoredMessages;
|
|
98
|
+
$[7] = conversationId;
|
|
99
|
+
$[8] = inReplyScreen;
|
|
100
|
+
$[9] = latestRead;
|
|
101
|
+
$[10] = t3;
|
|
215
102
|
} else {
|
|
216
|
-
|
|
103
|
+
t3 = $[10];
|
|
217
104
|
}
|
|
218
|
-
let
|
|
219
|
-
if ($[
|
|
220
|
-
|
|
105
|
+
let t4;
|
|
106
|
+
if ($[11] !== styles.listHeader) {
|
|
107
|
+
t4 = /*#__PURE__*/_jsx(View, {
|
|
221
108
|
style: styles.listHeader
|
|
222
109
|
});
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
110
|
+
$[11] = styles.listHeader;
|
|
111
|
+
$[12] = t4;
|
|
225
112
|
} else {
|
|
226
|
-
|
|
113
|
+
t4 = $[12];
|
|
227
114
|
}
|
|
228
|
-
let
|
|
229
|
-
if ($[
|
|
230
|
-
|
|
115
|
+
let t5;
|
|
116
|
+
if ($[13] !== listRef || $[14] !== messagesWithSeparators || $[15] !== onContentSizeChange || $[16] !== onEndReached || $[17] !== onLayout || $[18] !== onMomentumScrollEnd || $[19] !== onScroll || $[20] !== onScrollEndDrag || $[21] !== styles.listContainer || $[22] !== t2 || $[23] !== t3 || $[24] !== t4) {
|
|
117
|
+
t5 = /*#__PURE__*/_jsx(FlatList, {
|
|
231
118
|
inverted: true,
|
|
232
119
|
ref: listRef,
|
|
233
120
|
contentContainerStyle: styles.listContainer,
|
|
234
121
|
data: messagesWithSeparators,
|
|
235
122
|
keyExtractor: _temp,
|
|
236
123
|
onScroll: onScroll,
|
|
237
|
-
onLayout:
|
|
238
|
-
onContentSizeChange:
|
|
239
|
-
onScrollBeginDrag: handleScrollBeginDrag,
|
|
240
|
-
onScrollToIndexFailed: noop,
|
|
124
|
+
onLayout: onLayout,
|
|
125
|
+
onContentSizeChange: onContentSizeChange,
|
|
241
126
|
onScrollEndDrag: onScrollEndDrag,
|
|
242
127
|
onMomentumScrollEnd: onMomentumScrollEnd,
|
|
243
128
|
scrollEventThrottle: 10,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
renderItem: t10,
|
|
129
|
+
ListFooterComponent: t2,
|
|
130
|
+
renderItem: t3,
|
|
247
131
|
onEndReached: onEndReached,
|
|
248
|
-
|
|
249
|
-
ListHeaderComponent: t11
|
|
132
|
+
ListHeaderComponent: t4
|
|
250
133
|
});
|
|
251
|
-
$[
|
|
252
|
-
$[
|
|
253
|
-
$[
|
|
254
|
-
$[
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
$[
|
|
261
|
-
$[
|
|
262
|
-
$[
|
|
263
|
-
$[
|
|
264
|
-
$[41] = t8;
|
|
265
|
-
$[42] = t9;
|
|
266
|
-
$[43] = t12;
|
|
134
|
+
$[13] = listRef;
|
|
135
|
+
$[14] = messagesWithSeparators;
|
|
136
|
+
$[15] = onContentSizeChange;
|
|
137
|
+
$[16] = onEndReached;
|
|
138
|
+
$[17] = onLayout;
|
|
139
|
+
$[18] = onMomentumScrollEnd;
|
|
140
|
+
$[19] = onScroll;
|
|
141
|
+
$[20] = onScrollEndDrag;
|
|
142
|
+
$[21] = styles.listContainer;
|
|
143
|
+
$[22] = t2;
|
|
144
|
+
$[23] = t3;
|
|
145
|
+
$[24] = t4;
|
|
146
|
+
$[25] = t5;
|
|
267
147
|
} else {
|
|
268
|
-
|
|
148
|
+
t5 = $[25];
|
|
269
149
|
}
|
|
270
|
-
return
|
|
150
|
+
return t5;
|
|
271
151
|
}
|
|
272
|
-
function _temp(
|
|
273
|
-
return
|
|
152
|
+
function _temp(item) {
|
|
153
|
+
return item.id;
|
|
274
154
|
}
|
|
275
155
|
function InlineDateSeparator(t0) {
|
|
276
156
|
const $ = _c(17);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message_list.js","names":["date","formatDate","noop","React","useRef","FlatList","StyleSheet","View","useTheme","getRelativeDateStatus","groupMessages","CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL","isSystemMessage","Text","ConversationStartBanner","Message","MissingMessage","ReplyShadowMessage","SystemMessage","jsx","_jsx","jsxs","_jsxs","HOLD_AND_FOLLOW","minIndexForVisible","autoscrollToTopThreshold","HOLD_ONLY","ANCHOR_CLEARS_JUMP_BUTTON","MessageList","t0","$","_c","listRef","conversation","conversationId","messages","replyRootId","anchorMessageId","behind","t1","hasNextPage","onEndReached","onStartReached","onScroll","onLayout","onContentSizeChange","onScrollBeginDrag","onScrollEndDrag","onMomentumScrollEnd","undefined","styles","useStyles","inReplyScreen","canDeleteNonAuthoredMessages","memberAbility","latestRead","latestReadMessageSortKey","messagesWithSeparators","t2","ms","findIndex","item","id","anchorIndex","layoutHeight","contentHeight","userHasScrolled","draggedSinceStartReached","t3","anchorIsLoaded","current","scrollable","scrollToIndex","index","viewPosition","viewOffset","animated","pinAnchorToBottomEdge","t4","event","nativeEvent","layout","height","handleLayout","t5","width","handleContentSizeChange","t6","event_0","handleScrollBeginDrag","t7","handleStartReached","t8","t9","hasMessages","t10","t11","item_1","type","InlineDateSeparator","deletedAt","readByOthers","mine","listHeader","style","t12","listContainer","inverted","contentContainerStyle","keyExtractor","_temp","scrollEventThrottle","maintainVisibleContentPosition","ListFooterComponent","renderItem","ListHeaderComponent","item_0","useDateSeparatorStyles","isThisYear","showYear","year","dateStamp","separator","dateText","variant","children","container","theme","colors","borderColorDefaultBase","create","alignItems","flexDirection","paddingHorizontal","paddingVertical","flex","borderTopWidth","borderTopColor"],"sources":["../../../src/components/conversation/message_list.tsx"],"sourcesContent":["import { date as formatDate } from '@planningcenter/datetime-fmt'\nimport { noop } from 'lodash'\nimport React, { RefObject, useRef } from 'react'\nimport { FlatList, FlatListProps, StyleSheet, View } from 'react-native'\nimport { useTheme } from '../../hooks'\nimport { ConversationResource } from '../../types/resources/conversation'\nimport { MessageResource } from '../../types/resources/message'\nimport { getRelativeDateStatus } from '../../utils/date'\nimport { groupMessages, type DateSeparator, type EnrichedMessage } from '../../utils/group_messages'\nimport { CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL } from '../../utils/styles'\nimport { isSystemMessage } from '../../utils/system_messages'\nimport { Text } from '../display'\nimport { ConversationStartBanner } from './conversation_start_banner'\nimport { Message } from './message'\nimport { MissingMessage } from './missing_message'\nimport { ReplyShadowMessage } from './reply_shadow_message'\nimport { SystemMessage } from './system_message'\n\n// While behind, the bottom of the window isn't the live edge. Following there pulls\n// each newly paged-in page into view and chains the next fetch.\nconst HOLD_AND_FOLLOW = { minIndexForVisible: 0, autoscrollToTopThreshold: 100 }\nconst HOLD_ONLY = { minIndexForVisible: 0 }\n\ntype ScrollHandlers = Pick<\n FlatListProps<EnrichedMessage>,\n | 'onScroll'\n | 'onLayout'\n | 'onContentSizeChange'\n | 'onScrollBeginDrag'\n | 'onScrollEndDrag'\n | 'onMomentumScrollEnd'\n>\n\ninterface MessageListProps extends ScrollHandlers {\n listRef: RefObject<FlatList | null>\n conversation: ConversationResource\n conversationId: number\n messages: MessageResource[]\n replyRootId?: string | null\n anchorMessageId?: string | null\n behind?: boolean\n hasNextPage: boolean\n onEndReached: () => void\n onStartReached?: () => void\n}\n\nconst ANCHOR_CLEARS_JUMP_BUTTON = 56\n\n/** MessageList\n * The inverted list of messages, reply previews, and date separators for a conversation\n */\nexport function MessageList({\n listRef,\n conversation,\n conversationId,\n messages,\n replyRootId,\n anchorMessageId,\n behind = false,\n hasNextPage,\n onEndReached,\n onStartReached,\n onScroll,\n onLayout,\n onContentSizeChange,\n onScrollBeginDrag,\n onScrollEndDrag,\n onMomentumScrollEnd,\n}: MessageListProps) {\n const styles = useStyles()\n const inReplyScreen = !!replyRootId\n const canDeleteNonAuthoredMessages =\n conversation.memberAbility?.canDeleteNonAuthoredMessages ?? false\n const latestRead = conversation.latestReadMessageSortKey\n const messagesWithSeparators = groupMessages({ ms: messages, inReplyScreen })\n const anchorIndex = anchorMessageId\n ? messagesWithSeparators.findIndex(item => item.id === anchorMessageId)\n : -1\n const layoutHeight = useRef(0)\n const contentHeight = useRef(0)\n const userHasScrolled = useRef(false)\n const draggedSinceStartReached = useRef(false)\n\n // Row heights keep settling after the first layout (images, attachments), so we\n // re-pin on every layout pass until the reader takes over with a drag.\n const pinAnchorToBottomEdge = () => {\n const anchorIsLoaded = anchorIndex >= 0\n if (!anchorIsLoaded || userHasScrolled.current) return\n\n const scrollable = layoutHeight.current > 0 && contentHeight.current > layoutHeight.current\n if (!scrollable) return\n\n listRef.current?.scrollToIndex({\n index: anchorIndex,\n viewPosition: 0,\n viewOffset: ANCHOR_CLEARS_JUMP_BUTTON,\n animated: false,\n })\n }\n\n const handleLayout: FlatListProps<EnrichedMessage>['onLayout'] = event => {\n onLayout?.(event)\n layoutHeight.current = event.nativeEvent.layout.height\n pinAnchorToBottomEdge()\n }\n\n const handleContentSizeChange: FlatListProps<EnrichedMessage>['onContentSizeChange'] = (\n width,\n height\n ) => {\n onContentSizeChange?.(width, height)\n contentHeight.current = height\n pinAnchorToBottomEdge()\n }\n\n const handleScrollBeginDrag: FlatListProps<EnrichedMessage>['onScrollBeginDrag'] = event => {\n userHasScrolled.current = true\n draggedSinceStartReached.current = true\n onScrollBeginDrag?.(event)\n }\n\n // VirtualizedList re-checks its edges on every content size change using a JS offset\n // the native hold never updates, so without this each merged page re-fires it.\n const handleStartReached = () => {\n if (!draggedSinceStartReached.current) return\n\n draggedSinceStartReached.current = false\n onStartReached?.()\n }\n\n return (\n <FlatList\n inverted\n ref={listRef}\n contentContainerStyle={styles.listContainer}\n data={messagesWithSeparators}\n keyExtractor={item => item.id}\n onScroll={onScroll}\n onLayout={handleLayout}\n onContentSizeChange={handleContentSizeChange}\n onScrollBeginDrag={handleScrollBeginDrag}\n // Expected while rows are still measuring; the next layout pass pins again.\n onScrollToIndexFailed={noop}\n onScrollEndDrag={onScrollEndDrag}\n onMomentumScrollEnd={onMomentumScrollEnd}\n scrollEventThrottle={10}\n maintainVisibleContentPosition={behind ? HOLD_ONLY : HOLD_AND_FOLLOW}\n ListFooterComponent={\n hasNextPage ? null : (\n <ConversationStartBanner conversation={conversation} hasMessages={true} />\n )\n }\n renderItem={({ item }) => {\n if (item.type === 'DateSeparator') {\n return <InlineDateSeparator {...item} />\n }\n\n if (item.type === 'Message' && item.deletedAt && !item.replyRootId) {\n return <MissingMessage />\n }\n\n if (item.type === 'ReplyShadowMessage') {\n return (\n <ReplyShadowMessage\n {...(item as any)}\n conversation_id={conversationId}\n inReplyScreen={inReplyScreen}\n />\n )\n }\n\n if (isSystemMessage(item)) {\n return <SystemMessage message={item} conversationId={conversationId} />\n }\n\n const readByOthers = item.mine && !!latestRead && item.id <= latestRead\n return (\n <Message\n {...item}\n canDeleteNonAuthoredMessages={canDeleteNonAuthoredMessages}\n conversation_id={conversationId}\n readByOthers={readByOthers}\n inReplyScreen={inReplyScreen}\n />\n )\n }}\n onEndReached={onEndReached}\n onStartReached={handleStartReached}\n ListHeaderComponent={<View style={styles.listHeader} />}\n />\n )\n}\n\nfunction InlineDateSeparator({ date }: DateSeparator) {\n const styles = useDateSeparatorStyles()\n const { isThisYear } = getRelativeDateStatus(date)\n const showYear = !isThisYear\n const dateStamp = formatDate(date, { style: 'long', year: showYear })\n\n return (\n <View style={styles.container}>\n <View style={styles.separator} />\n <Text variant=\"footnote\" style={styles.dateText}>\n {dateStamp}\n </Text>\n <View style={styles.separator} />\n </View>\n )\n}\n\nconst useDateSeparatorStyles = () => {\n const theme = useTheme()\n return StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n paddingHorizontal: CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n paddingVertical: 16,\n },\n separator: {\n flex: 1,\n height: 1,\n borderTopWidth: 1,\n borderTopColor: theme.colors.borderColorDefaultBase,\n },\n dateText: {\n paddingHorizontal: 8,\n },\n })\n}\n\nconst useStyles = () =>\n StyleSheet.create({\n listContainer: {\n paddingVertical: 12,\n },\n listHeader: {\n // Just whitespace to provide space where the typing indicator can be\n height: 16,\n },\n })\n"],"mappings":";AAAA,SAASA,IAAI,IAAIC,UAAU,QAAQ,8BAA8B;AACjE,SAASC,IAAI,QAAQ,QAAQ;AAC7B,OAAOC,KAAK,IAAeC,MAAM,QAAQ,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nG,CAAA,MAAAD,EAAA;EAAA;IAAAA,EAAA,GAAAC,CAAA;EAAA;EAAA,OAhBKD,EAgBL;AAAA,CACH;AAED,MAAMsB,SAAS,GAAGA,CAAA,KAChB7C,UAAU,CAAC4H,MAAM,CAAC;EAChBxB,aAAa,EAAE;IACb4B,eAAe,EAAE;EACnB,CAAC;EACD/B,UAAU,EAAE;IACV;IACArB,MAAM,EAAE;EACV;AACF,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"message_list.js","names":["date","formatDate","React","FlatList","StyleSheet","View","useTheme","getRelativeDateStatus","groupMessages","CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL","isSystemMessage","Text","ConversationStartBanner","Message","ReplyShadowMessage","SystemMessage","jsx","_jsx","jsxs","_jsxs","MessageList","t0","$","_c","listRef","conversation","conversationId","messages","replyRootId","hasNextPage","onEndReached","onScroll","onLayout","onContentSizeChange","onScrollEndDrag","onMomentumScrollEnd","styles","useStyles","inReplyScreen","canDeleteNonAuthoredMessages","memberAbility","latestRead","latestReadMessageSortKey","t1","ms","messagesWithSeparators","t2","hasMessages","t3","t4","item","item_0","type","InlineDateSeparator","readByOthers","mine","id","listHeader","style","t5","listContainer","inverted","contentContainerStyle","keyExtractor","_temp","scrollEventThrottle","ListFooterComponent","renderItem","ListHeaderComponent","useDateSeparatorStyles","isThisYear","showYear","year","dateStamp","separator","dateText","variant","children","t6","container","theme","colors","borderColorDefaultBase","create","alignItems","flexDirection","paddingHorizontal","paddingVertical","flex","height","borderTopWidth","borderTopColor"],"sources":["../../../src/components/conversation/message_list.tsx"],"sourcesContent":["import { date as formatDate } from '@planningcenter/datetime-fmt'\nimport React, { RefObject } from 'react'\nimport { FlatList, FlatListProps, StyleSheet, View } from 'react-native'\nimport { useTheme } from '../../hooks'\nimport { ConversationResource } from '../../types/resources/conversation'\nimport { MessageResource } from '../../types/resources/message'\nimport { getRelativeDateStatus } from '../../utils/date'\nimport { groupMessages, type DateSeparator, type EnrichedMessage } from '../../utils/group_messages'\nimport { CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL } from '../../utils/styles'\nimport { isSystemMessage } from '../../utils/system_messages'\nimport { Text } from '../display'\nimport { ConversationStartBanner } from './conversation_start_banner'\nimport { Message } from './message'\nimport { ReplyShadowMessage } from './reply_shadow_message'\nimport { SystemMessage } from './system_message'\n\ntype ScrollHandlers = Pick<\n FlatListProps<EnrichedMessage>,\n 'onScroll' | 'onLayout' | 'onContentSizeChange' | 'onScrollEndDrag' | 'onMomentumScrollEnd'\n>\n\ninterface MessageListProps extends ScrollHandlers {\n listRef: RefObject<FlatList | null>\n conversation: ConversationResource\n conversationId: number\n messages: MessageResource[]\n replyRootId?: string | null\n hasNextPage: boolean\n onEndReached: () => void\n}\n\n/** MessageList\n * The inverted list of messages, reply previews, and date separators for a conversation\n */\nexport function MessageList({\n listRef,\n conversation,\n conversationId,\n messages,\n replyRootId,\n hasNextPage,\n onEndReached,\n onScroll,\n onLayout,\n onContentSizeChange,\n onScrollEndDrag,\n onMomentumScrollEnd,\n}: MessageListProps) {\n const styles = useStyles()\n const inReplyScreen = !!replyRootId\n const canDeleteNonAuthoredMessages =\n conversation.memberAbility?.canDeleteNonAuthoredMessages ?? false\n const latestRead = conversation.latestReadMessageSortKey\n const messagesWithSeparators = groupMessages({ ms: messages, inReplyScreen })\n\n return (\n <FlatList\n inverted\n ref={listRef}\n contentContainerStyle={styles.listContainer}\n data={messagesWithSeparators}\n keyExtractor={item => item.id}\n onScroll={onScroll}\n onLayout={onLayout}\n onContentSizeChange={onContentSizeChange}\n onScrollEndDrag={onScrollEndDrag}\n onMomentumScrollEnd={onMomentumScrollEnd}\n scrollEventThrottle={10}\n ListFooterComponent={\n hasNextPage ? null : (\n <ConversationStartBanner conversation={conversation} hasMessages={true} />\n )\n }\n renderItem={({ item }) => {\n if (item.type === 'DateSeparator') {\n return <InlineDateSeparator {...item} />\n }\n\n if (item.type === 'ReplyShadowMessage') {\n return (\n <ReplyShadowMessage\n {...(item as any)}\n conversation_id={conversationId}\n inReplyScreen={inReplyScreen}\n />\n )\n }\n\n if (isSystemMessage(item)) {\n return <SystemMessage message={item} conversationId={conversationId} />\n }\n\n const readByOthers = item.mine && !!latestRead && item.id <= latestRead\n return (\n <Message\n {...item}\n canDeleteNonAuthoredMessages={canDeleteNonAuthoredMessages}\n conversation_id={conversationId}\n readByOthers={readByOthers}\n inReplyScreen={inReplyScreen}\n />\n )\n }}\n onEndReached={onEndReached}\n ListHeaderComponent={<View style={styles.listHeader} />}\n />\n )\n}\n\nfunction InlineDateSeparator({ date }: DateSeparator) {\n const styles = useDateSeparatorStyles()\n const { isThisYear } = getRelativeDateStatus(date)\n const showYear = !isThisYear\n const dateStamp = formatDate(date, { style: 'long', year: showYear })\n\n return (\n <View style={styles.container}>\n <View style={styles.separator} />\n <Text variant=\"footnote\" style={styles.dateText}>\n {dateStamp}\n </Text>\n <View style={styles.separator} />\n </View>\n )\n}\n\nconst useDateSeparatorStyles = () => {\n const theme = useTheme()\n return StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n paddingHorizontal: CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n paddingVertical: 16,\n },\n separator: {\n flex: 1,\n height: 1,\n borderTopWidth: 1,\n borderTopColor: theme.colors.borderColorDefaultBase,\n },\n dateText: {\n paddingHorizontal: 8,\n },\n })\n}\n\nconst useStyles = () =>\n StyleSheet.create({\n listContainer: {\n paddingVertical: 12,\n },\n listHeader: {\n // Just whitespace to provide space where the typing indicator can be\n height: 16,\n },\n })\n"],"mappings":";AAAA,SAASA,IAAI,IAAIC,UAAU,QAAQ,8BAA8B;AACjE,OAAOC,KAAK,MAAqB,OAAO;AACxC,SAASC,QAAQ,EAAiBC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AACxE,SAASC,QAAQ,QAAQ,aAAa;AAGtC,SAASC,qBAAqB,QAAQ,kBAAkB;AACxD,SAASC,aAAa,QAAkD,4BAA4B;AACpG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EACD9B,UAAU,EAAE;IACV;IACAgC,MAAM,EAAE;EACV;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -16,7 +16,6 @@ export declare function useGroupMembersForNewConversation({ id, gender, }: {
|
|
|
16
16
|
adultMembers: MemberResource[];
|
|
17
17
|
childMembers: MemberResource[];
|
|
18
18
|
totalCount: number;
|
|
19
|
-
infiniteData: import("@tanstack/query-core").InfiniteData<import("../..").ApiCollection<GroupsGroupMemberResource>, Partial<import("../..").RequestData> | undefined>;
|
|
20
19
|
error: Response | null;
|
|
21
20
|
status: "success" | "error";
|
|
22
21
|
isError: boolean;
|
|
@@ -37,10 +36,10 @@ export declare function useGroupMembersForNewConversation({ id, gender, }: {
|
|
|
37
36
|
isPaused: boolean;
|
|
38
37
|
isRefetching: boolean;
|
|
39
38
|
isStale: boolean;
|
|
40
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../..").ApiCollection<GroupsGroupMemberResource>,
|
|
39
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../..").ApiCollection<GroupsGroupMemberResource>, unknown>, Response>>;
|
|
41
40
|
fetchStatus: import("@tanstack/query-core").FetchStatus;
|
|
42
|
-
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../..").ApiCollection<GroupsGroupMemberResource>,
|
|
43
|
-
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../..").ApiCollection<GroupsGroupMemberResource>,
|
|
41
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../..").ApiCollection<GroupsGroupMemberResource>, unknown>, Response>>;
|
|
42
|
+
fetchPreviousPage: (options?: import("@tanstack/query-core").FetchPreviousPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("../..").ApiCollection<GroupsGroupMemberResource>, unknown>, Response>>;
|
|
44
43
|
hasNextPage: boolean;
|
|
45
44
|
hasPreviousPage: boolean;
|
|
46
45
|
isFetchNextPageError: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_group_members_for_new_conversation.d.ts","sourceRoot":"","sources":["../../../src/hooks/groups/use_group_members_for_new_conversation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAA;AAE3G,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE1D,KAAK,0BAA0B,CAAC,CAAC,SAAS,cAAc,IAAI,UAAU,CACpE,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAC/B,CAAA;AAED,MAAM,MAAM,oCAAoC,GAAG,IAAI,CACrD,0BAA0B,CAAC,yBAAyB,CAAC,EAAE,8CAA8C;AACrG,MAAM,CACP,GAAG;IACF,IAAI,EAAE,cAAc,EAAE,CAAA;IACtB,YAAY,EAAE,cAAc,EAAE,CAAA;IAC9B,YAAY,EAAE,cAAc,EAAE,CAAA;CAC/B,CAAA;AAED,wBAAgB,iCAAiC,CAAC,EAChD,EAAE,EACF,MAAM,GACP,EAAE;IACD,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB
|
|
1
|
+
{"version":3,"file":"use_group_members_for_new_conversation.d.ts","sourceRoot":"","sources":["../../../src/hooks/groups/use_group_members_for_new_conversation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,yBAAyB,EAAE,MAAM,iEAAiE,CAAA;AAE3G,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE1D,KAAK,0BAA0B,CAAC,CAAC,SAAS,cAAc,IAAI,UAAU,CACpE,OAAO,oBAAoB,CAAC,CAAC,CAAC,CAC/B,CAAA;AAED,MAAM,MAAM,oCAAoC,GAAG,IAAI,CACrD,0BAA0B,CAAC,yBAAyB,CAAC,EAAE,8CAA8C;AACrG,MAAM,CACP,GAAG;IACF,IAAI,EAAE,cAAc,EAAE,CAAA;IACtB,YAAY,EAAE,cAAc,EAAE,CAAA;IAC9B,YAAY,EAAE,cAAc,EAAE,CAAA;CAC/B,CAAA;AAED,wBAAgB,iCAAiC,CAAC,EAChD,EAAE,EACF,MAAM,GACP,EAAE;IACD,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CACtB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4CA"}
|
package/build/hooks/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export * from './use_chat_permissions';
|
|
|
8
8
|
export * from './use_create_android_ripple_color';
|
|
9
9
|
export * from './use_current_person';
|
|
10
10
|
export * from './use_deleting_ids';
|
|
11
|
-
export * from './use_direct_message_eligibility';
|
|
12
11
|
export * from './use_direct_messages_eligible';
|
|
13
12
|
export * from './use_font_scale';
|
|
14
13
|
export * from './use_has_direct_messages';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,yCAAyC,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,mCAAmC,CAAA;AACjD,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,yCAAyC,CAAA;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,qBAAqB,CAAA;AACnC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,mCAAmC,CAAA;AACjD,cAAc,sBAAsB,CAAA;AACpC,cAAc,oBAAoB,CAAA;AAClC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,kBAAkB,CAAA;AAChC,cAAc,2BAA2B,CAAA;AACzC,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,sCAAsC,CAAA;AACpD,cAAc,2CAA2C,CAAA;AACzD,cAAc,+BAA+B,CAAA;AAC7C,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,+BAA+B,CAAA;AAC7C,cAAc,yBAAyB,CAAA;AACvC,cAAc,wBAAwB,CAAA;AACtC,cAAc,gCAAgC,CAAA;AAC9C,cAAc,wBAAwB,CAAA;AACtC,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA"}
|
package/build/hooks/index.js
CHANGED
|
@@ -8,7 +8,6 @@ export * from './use_chat_permissions';
|
|
|
8
8
|
export * from './use_create_android_ripple_color';
|
|
9
9
|
export * from './use_current_person';
|
|
10
10
|
export * from './use_deleting_ids';
|
|
11
|
-
export * from './use_direct_message_eligibility';
|
|
12
11
|
export * from './use_direct_messages_eligible';
|
|
13
12
|
export * from './use_font_scale';
|
|
14
13
|
export * from './use_has_direct_messages';
|
package/build/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["useApiClient"],"sources":["../../src/hooks/index.ts"],"sourcesContent":["export * from './use_animated_message_background_color'\nexport { useApiClient } from './use_api_client'\nexport * from './use_api'\nexport * from './use_app_state'\nexport * from './use_async_storage'\nexport * from './use_at_font_scale_breakpoint'\nexport * from './use_chat_permissions'\nexport * from './use_create_android_ripple_color'\nexport * from './use_current_person'\nexport * from './use_deleting_ids'\nexport * from './
|
|
1
|
+
{"version":3,"file":"index.js","names":["useApiClient"],"sources":["../../src/hooks/index.ts"],"sourcesContent":["export * from './use_animated_message_background_color'\nexport { useApiClient } from './use_api_client'\nexport * from './use_api'\nexport * from './use_app_state'\nexport * from './use_async_storage'\nexport * from './use_at_font_scale_breakpoint'\nexport * from './use_chat_permissions'\nexport * from './use_create_android_ripple_color'\nexport * from './use_current_person'\nexport * from './use_deleting_ids'\nexport * from './use_direct_messages_eligible'\nexport * from './use_font_scale'\nexport * from './use_has_direct_messages'\nexport * from './use_groups_groups'\nexport * from './use_groups'\nexport * from './use_selected_chip_background_color'\nexport * from './use_interaction_tinted_background_color'\nexport * from './use_message_reaction_toggle'\nexport * from './use_new_conversation_entry'\nexport * from './use_organization'\nexport * from './use_people_person'\nexport * from './use_preview_avatar_diameter'\nexport * from './use_product_analytics'\nexport * from './use_qualified_by_age'\nexport * from './use_scalable_number_of_lines'\nexport * from './use_submit_age_check'\nexport * from './use_suspense_api'\nexport * from './use_theme'\n"],"mappings":"AAAA,cAAc,yCAAyC;AACvD,SAASA,YAAY,QAAQ,kBAAkB;AAC/C,cAAc,WAAW;AACzB,cAAc,iBAAiB;AAC/B,cAAc,qBAAqB;AACnC,cAAc,gCAAgC;AAC9C,cAAc,wBAAwB;AACtC,cAAc,mCAAmC;AACjD,cAAc,sBAAsB;AACpC,cAAc,oBAAoB;AAClC,cAAc,gCAAgC;AAC9C,cAAc,kBAAkB;AAChC,cAAc,2BAA2B;AACzC,cAAc,qBAAqB;AACnC,cAAc,cAAc;AAC5B,cAAc,sCAAsC;AACpD,cAAc,2CAA2C;AACzD,cAAc,+BAA+B;AAC7C,cAAc,8BAA8B;AAC5C,cAAc,oBAAoB;AAClC,cAAc,qBAAqB;AACnC,cAAc,+BAA+B;AAC7C,cAAc,yBAAyB;AACvC,cAAc,wBAAwB;AACtC,cAAc,gCAAgC;AAC9C,cAAc,wBAAwB;AACtC,cAAc,oBAAoB;AAClC,cAAc,aAAa","ignoreList":[]}
|
|
@@ -1,23 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MessageResource } from '../types';
|
|
2
2
|
import { SuspensePaginatorOptions } from './use_suspense_api';
|
|
3
|
-
|
|
3
|
+
export declare const useConversationMessages: ({ conversation_id, reply_root_id }: {
|
|
4
4
|
conversation_id: number;
|
|
5
5
|
reply_root_id?: string | null;
|
|
6
|
-
}
|
|
7
|
-
type Options = WindowOptions & {
|
|
8
|
-
anchor?: string | null;
|
|
9
|
-
};
|
|
10
|
-
export declare const useConversationMessages: ({ conversation_id, reply_root_id, anchor }: Options, opts?: SuspensePaginatorOptions) => {
|
|
6
|
+
}, opts?: SuspensePaginatorOptions) => {
|
|
11
7
|
messages: MessageResource[];
|
|
12
|
-
|
|
13
|
-
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<ApiCollection<MessageResource>, Partial<import("..").RequestData> | undefined>, Response>>;
|
|
8
|
+
refetch: (options?: import("@tanstack/query-core").RefetchOptions) => Promise<import("@tanstack/query-core").QueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<MessageResource>, unknown>, Response>>;
|
|
14
9
|
isRefetching: boolean;
|
|
15
|
-
fetchNextPage: () => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<
|
|
16
|
-
fetchNewer: () => Promise<void>;
|
|
17
|
-
fetchLiveWindow: () => Promise<void>;
|
|
10
|
+
fetchNextPage: (options?: import("@tanstack/query-core").FetchNextPageOptions) => Promise<import("@tanstack/query-core").InfiniteQueryObserverResult<import("@tanstack/query-core").InfiniteData<import("..").ApiCollection<MessageResource>, unknown>, Response>>;
|
|
18
11
|
hasNextPage: boolean;
|
|
19
12
|
queryKey: import("./use_suspense_api").RequestQueryKey;
|
|
20
13
|
};
|
|
21
|
-
export declare const dropMessagesWindowIfBehind: (options: WindowOptions) => void;
|
|
22
|
-
export {};
|
|
23
14
|
//# sourceMappingURL=use_conversation_messages.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_conversation_messages.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversation_messages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use_conversation_messages.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversation_messages.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAG1C,OAAO,EAAE,wBAAwB,EAAwB,MAAM,oBAAoB,CAAA;AAEnF,eAAO,MAAM,uBAAuB,GAClC,oCAAoC;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EAC9F,OAAO,wBAAwB;;;;;;;CAwBhC,CAAA"}
|