@planningcenter/chat-react-native 4.2.0 → 4.2.1-qa-staging.0
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 +2 -1
- package/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +54 -51
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversation/message_list.d.ts +2 -2
- package/build/components/conversation/message_list.d.ts.map +1 -1
- package/build/components/conversation/message_list.js +19 -16
- package/build/components/conversation/message_list.js.map +1 -1
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.d.ts.map +1 -1
- package/build/hooks/index.js +1 -0
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/paginator_meta.d.ts +3 -1
- package/build/hooks/paginator_meta.d.ts.map +1 -1
- package/build/hooks/paginator_meta.js +25 -8
- package/build/hooks/paginator_meta.js.map +1 -1
- package/build/hooks/use_api.d.ts.map +1 -1
- package/build/hooks/use_api.js +5 -8
- package/build/hooks/use_api.js.map +1 -1
- package/build/hooks/use_conversation_messages_jolt_events.d.ts +9 -1
- package/build/hooks/use_conversation_messages_jolt_events.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages_jolt_events.js +88 -73
- package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
- package/build/hooks/use_direct_message_eligibility.d.ts +14 -0
- package/build/hooks/use_direct_message_eligibility.d.ts.map +1 -0
- package/build/hooks/use_direct_message_eligibility.js +87 -0
- package/build/hooks/use_direct_message_eligibility.js.map +1 -0
- package/build/hooks/use_fetch_newer_messages.d.ts +8 -0
- package/build/hooks/use_fetch_newer_messages.d.ts.map +1 -0
- package/build/hooks/use_fetch_newer_messages.js +56 -0
- package/build/hooks/use_fetch_newer_messages.js.map +1 -0
- package/build/hooks/use_suspense_api.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.js +5 -8
- package/build/hooks/use_suspense_api.js.map +1 -1
- package/build/screens/conversation_new/components/services_form.js +9 -8
- package/build/screens/conversation_new/components/services_form.js.map +1 -1
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +137 -322
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/types/api_primitives.d.ts +2 -0
- 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 +1 -0
- package/build/types/resources/member.d.ts.map +1 -1
- package/build/types/resources/member.js.map +1 -1
- package/build/utils/cache/prepend_newer_page.d.ts +7 -0
- package/build/utils/cache/prepend_newer_page.d.ts.map +1 -0
- package/build/utils/cache/prepend_newer_page.js +14 -0
- package/build/utils/cache/prepend_newer_page.js.map +1 -0
- package/build/utils/client/types.d.ts +1 -0
- package/build/utils/client/types.d.ts.map +1 -1
- package/build/utils/client/types.js.map +1 -1
- package/build/utils/gated_message_cache.d.ts +7 -0
- package/build/utils/gated_message_cache.d.ts.map +1 -0
- package/build/utils/gated_message_cache.js +13 -0
- package/build/utils/gated_message_cache.js.map +1 -0
- package/build/utils/group_messages.js +4 -1
- package/build/utils/group_messages.js.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/hooks/paginator_meta.test.ts +73 -2
- package/src/__tests__/hooks/use_conversation_messages_jolt_events.test.ts +36 -0
- package/src/__tests__/hooks/use_direct_message_eligibility.test.tsx +83 -0
- package/src/__tests__/screens/conversation_new/components/services_form.test.tsx +91 -0
- package/src/__tests__/utils/gated_message_cache.test.ts +26 -0
- package/src/components/conversation/message_form.tsx +4 -0
- package/src/components/conversation/message_list.tsx +8 -1
- package/src/hooks/index.ts +1 -0
- package/src/hooks/paginator_meta.ts +29 -5
- package/src/hooks/use_api.ts +4 -5
- package/src/hooks/use_conversation_messages_jolt_events.ts +57 -40
- package/src/hooks/use_direct_message_eligibility.ts +40 -0
- package/src/hooks/use_fetch_newer_messages.ts +37 -0
- package/src/hooks/use_suspense_api.ts +4 -5
- package/src/screens/conversation_new/components/services_form.tsx +5 -5
- package/src/screens/conversation_screen.tsx +36 -4
- package/src/types/api_primitives.ts +2 -0
- package/src/types/resources/member.ts +1 -0
- package/src/utils/__tests__/group_messages.test.ts +29 -0
- package/src/utils/cache/__tests__/prepend_newer_page.test.ts +35 -0
- package/src/utils/cache/prepend_newer_page.ts +22 -0
- package/src/utils/client/types.ts +1 -0
- package/src/utils/gated_message_cache.ts +19 -0
- package/src/utils/group_messages.ts +4 -1
|
@@ -20,10 +20,12 @@ import { useConversation } from '../hooks/use_conversation';
|
|
|
20
20
|
import { useConversationJoltEvents } from '../hooks/use_conversation_jolt_events';
|
|
21
21
|
import { useConversationMessages } from '../hooks/use_conversation_messages';
|
|
22
22
|
import { useConversationMessagesJoltEvents } from '../hooks/use_conversation_messages_jolt_events';
|
|
23
|
+
import { useFetchNewerMessages } from '../hooks/use_fetch_newer_messages';
|
|
23
24
|
import { useMarkLatestMessageRead } from '../hooks/use_mark_latest_message_read';
|
|
24
25
|
import { analyticsEvents, normalizeAnalyticsMetadata, usePublishProductAnalyticsEvent } from '../hooks/use_product_analytics';
|
|
25
26
|
import { useRestAwayFromDismissEdge } from '../hooks/use_rest_away_from_dismiss_edge';
|
|
26
27
|
import { useVideoModerationJoltEvents } from '../hooks/use_video_moderation_jolt_events';
|
|
28
|
+
import { gatedMessageCache } from '../utils/gated_message_cache';
|
|
27
29
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
30
|
export function ConversationScreen(t0) {
|
|
29
31
|
const $ = _c(13);
|
|
@@ -95,11 +97,9 @@ export function ConversationScreen(t0) {
|
|
|
95
97
|
}
|
|
96
98
|
return t6;
|
|
97
99
|
}
|
|
98
|
-
function ConversationScreenContent(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
route
|
|
102
|
-
} = t0;
|
|
100
|
+
function ConversationScreenContent({
|
|
101
|
+
route
|
|
102
|
+
}) {
|
|
103
103
|
const styles = useStyles();
|
|
104
104
|
const navigation = useNavigation();
|
|
105
105
|
const {
|
|
@@ -111,62 +111,46 @@ function ConversationScreenContent(t0) {
|
|
|
111
111
|
const {
|
|
112
112
|
data: conversation
|
|
113
113
|
} = useConversation(route.params);
|
|
114
|
-
let t1;
|
|
115
|
-
if ($[0] !== conversation_id || $[1] !== reply_root_id) {
|
|
116
|
-
t1 = {
|
|
117
|
-
conversation_id,
|
|
118
|
-
reply_root_id
|
|
119
|
-
};
|
|
120
|
-
$[0] = conversation_id;
|
|
121
|
-
$[1] = reply_root_id;
|
|
122
|
-
$[2] = t1;
|
|
123
|
-
} else {
|
|
124
|
-
t1 = $[2];
|
|
125
|
-
}
|
|
126
114
|
const {
|
|
127
115
|
messages,
|
|
128
116
|
fetchNextPage,
|
|
129
|
-
hasNextPage
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
117
|
+
hasNextPage,
|
|
118
|
+
queryKey
|
|
119
|
+
} = useConversationMessages({
|
|
120
|
+
conversation_id,
|
|
121
|
+
reply_root_id
|
|
122
|
+
});
|
|
123
|
+
const [showJumpToBottomButton, setShowJumpToBottomButton] = useState(false);
|
|
124
|
+
const readingHistory = showJumpToBottomButton;
|
|
125
|
+
const skippedNewMessages = useRef(false);
|
|
126
|
+
const messageCaches = [gatedMessageCache({
|
|
127
|
+
queryKey,
|
|
128
|
+
acceptNewMessages: !readingHistory,
|
|
129
|
+
onSkippedNewMessage: () => {
|
|
130
|
+
skippedNewMessages.current = true;
|
|
131
|
+
}
|
|
132
|
+
})];
|
|
133
|
+
const newestMessageId = messages[0]?.id;
|
|
134
|
+
useConversationJoltEvents({
|
|
135
|
+
conversationId: conversation_id
|
|
136
|
+
});
|
|
137
|
+
useConversationMessagesJoltEvents({
|
|
138
|
+
conversationId: conversation_id,
|
|
139
|
+
messageCaches
|
|
140
|
+
});
|
|
153
141
|
const {
|
|
154
142
|
markHandledByMessageForm
|
|
155
143
|
} = useVideoModerationJoltEvents();
|
|
156
144
|
useEnsureConversationsRouteExists();
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
} else {
|
|
167
|
-
t4 = $[9];
|
|
168
|
-
}
|
|
169
|
-
useMarkLatestMessageRead(t4);
|
|
145
|
+
useMarkLatestMessageRead({
|
|
146
|
+
conversation,
|
|
147
|
+
messages
|
|
148
|
+
});
|
|
149
|
+
const fetchNewer = useFetchNewerMessages({
|
|
150
|
+
conversation_id,
|
|
151
|
+
reply_root_id,
|
|
152
|
+
queryKey
|
|
153
|
+
});
|
|
170
154
|
const noMessages = messages.length === 0;
|
|
171
155
|
const {
|
|
172
156
|
repliesDisabled,
|
|
@@ -176,294 +160,123 @@ function ConversationScreenContent(t0) {
|
|
|
176
160
|
} = conversation;
|
|
177
161
|
const canReply = memberAbility?.canReply;
|
|
178
162
|
const showLeaderDisabledReplyBanner = canReply && repliesDisabled;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
t6 = m => String(m.id) === String(editing_message_id);
|
|
184
|
-
$[13] = editing_message_id;
|
|
185
|
-
$[14] = t6;
|
|
186
|
-
} else {
|
|
187
|
-
t6 = $[14];
|
|
188
|
-
}
|
|
189
|
-
t5 = messages.find(t6);
|
|
190
|
-
$[10] = editing_message_id;
|
|
191
|
-
$[11] = messages;
|
|
192
|
-
$[12] = t5;
|
|
193
|
-
} else {
|
|
194
|
-
t5 = $[12];
|
|
195
|
-
}
|
|
196
|
-
const currentlyEditingMessage = t5;
|
|
197
|
-
let t6;
|
|
198
|
-
if ($[15] !== reply_root_author_name) {
|
|
199
|
-
t6 = reply_root_author_name?.split(" ")[0];
|
|
200
|
-
$[15] = reply_root_author_name;
|
|
201
|
-
$[16] = t6;
|
|
202
|
-
} else {
|
|
203
|
-
t6 = $[16];
|
|
204
|
-
}
|
|
205
|
-
const replyRootAuthorFirstName = t6;
|
|
206
|
-
const replyHeaderTitle = replyRootAuthorFirstName ? `Reply to ${replyRootAuthorFirstName}` : "Reply";
|
|
163
|
+
const currentlyEditingMessage = messages.find(m => String(m.id) === String(editing_message_id));
|
|
164
|
+
const replyRootAuthorFirstName = reply_root_author_name?.split(' ')[0];
|
|
165
|
+
const replyHeaderTitle = replyRootAuthorFirstName ? `Reply to ${replyRootAuthorFirstName}` : 'Reply';
|
|
166
|
+
// Prefer the membership for optimistic updates.
|
|
207
167
|
const muted = conversation.conversationMembership?.muted ?? conversation.muted;
|
|
208
168
|
const listRef = useRef(null);
|
|
209
|
-
const
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
const offsetY = event.nativeEvent.contentOffset.y;
|
|
214
|
-
setShowJumpToBottomButton(offsetY > 200);
|
|
215
|
-
};
|
|
216
|
-
$[17] = t7;
|
|
217
|
-
} else {
|
|
218
|
-
t7 = $[17];
|
|
219
|
-
}
|
|
220
|
-
const trackScroll = t7;
|
|
221
|
-
let t8;
|
|
222
|
-
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
223
|
-
t8 = {
|
|
224
|
-
listRef,
|
|
225
|
-
enabled: Platform.OS === "ios"
|
|
226
|
-
};
|
|
227
|
-
$[18] = t8;
|
|
228
|
-
} else {
|
|
229
|
-
t8 = $[18];
|
|
230
|
-
}
|
|
169
|
+
const trackScroll = event => {
|
|
170
|
+
const offsetY = event.nativeEvent.contentOffset.y;
|
|
171
|
+
setShowJumpToBottomButton(offsetY > 200);
|
|
172
|
+
};
|
|
231
173
|
const {
|
|
232
174
|
restOffset,
|
|
233
175
|
onLayout,
|
|
234
176
|
onContentSizeChange,
|
|
235
177
|
onMomentumScrollEnd,
|
|
236
178
|
onScrollEndDrag
|
|
237
|
-
} = useRestAwayFromDismissEdge(
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
navigation.setParams({
|
|
260
|
-
title,
|
|
261
|
-
badge: badges?.[0],
|
|
262
|
-
deleted: conversation?.deleted,
|
|
263
|
-
muted
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
};
|
|
267
|
-
$[21] = badges?.[0];
|
|
268
|
-
$[22] = conversation.deleted;
|
|
269
|
-
$[23] = muted;
|
|
270
|
-
$[24] = navigation;
|
|
271
|
-
$[25] = replyHeaderTitle;
|
|
272
|
-
$[26] = reply_root_id;
|
|
273
|
-
$[27] = title;
|
|
274
|
-
$[28] = t10;
|
|
275
|
-
} else {
|
|
276
|
-
t10 = $[28];
|
|
277
|
-
}
|
|
278
|
-
const t11 = conversation?.deleted;
|
|
279
|
-
let t12;
|
|
280
|
-
if ($[29] !== badges || $[30] !== muted || $[31] !== navigation || $[32] !== replyHeaderTitle || $[33] !== reply_root_id || $[34] !== t11 || $[35] !== title) {
|
|
281
|
-
t12 = [navigation, title, badges, t11, reply_root_id, replyHeaderTitle, muted];
|
|
282
|
-
$[29] = badges;
|
|
283
|
-
$[30] = muted;
|
|
284
|
-
$[31] = navigation;
|
|
285
|
-
$[32] = replyHeaderTitle;
|
|
286
|
-
$[33] = reply_root_id;
|
|
287
|
-
$[34] = t11;
|
|
288
|
-
$[35] = title;
|
|
289
|
-
$[36] = t12;
|
|
290
|
-
} else {
|
|
291
|
-
t12 = $[36];
|
|
292
|
-
}
|
|
293
|
-
useEffect(t10, t12);
|
|
294
|
-
if (!conversation || conversation.deleted) {
|
|
295
|
-
let t13;
|
|
296
|
-
if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
|
|
297
|
-
t13 = /*#__PURE__*/_jsx(BlankState.Imagery, {
|
|
298
|
-
name: "general.outlinedTextMessage"
|
|
179
|
+
} = useRestAwayFromDismissEdge({
|
|
180
|
+
listRef,
|
|
181
|
+
enabled: Platform.OS === 'ios'
|
|
182
|
+
});
|
|
183
|
+
const handleReturnToBottom = useCallback(() => {
|
|
184
|
+
listRef.current?.scrollToOffset({
|
|
185
|
+
offset: restOffset
|
|
186
|
+
});
|
|
187
|
+
}, [restOffset]);
|
|
188
|
+
const jumpToLatest = useCallback(() => {
|
|
189
|
+
setShowJumpToBottomButton(false);
|
|
190
|
+
handleReturnToBottom();
|
|
191
|
+
}, [handleReturnToBottom]);
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
if (readingHistory || !newestMessageId || !skippedNewMessages.current) return;
|
|
194
|
+
skippedNewMessages.current = false;
|
|
195
|
+
fetchNewer(newestMessageId);
|
|
196
|
+
}, [fetchNewer, newestMessageId, readingHistory]);
|
|
197
|
+
useEffect(() => {
|
|
198
|
+
if (reply_root_id) {
|
|
199
|
+
navigation.setParams({
|
|
200
|
+
title: replyHeaderTitle
|
|
299
201
|
});
|
|
300
|
-
$[37] = t13;
|
|
301
202
|
} else {
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
children: /*#__PURE__*/_jsx(BlankState.Heading, {
|
|
308
|
-
children: "This conversation has been deleted"
|
|
309
|
-
})
|
|
203
|
+
navigation.setParams({
|
|
204
|
+
title: title,
|
|
205
|
+
badge: badges?.[0],
|
|
206
|
+
deleted: conversation?.deleted,
|
|
207
|
+
muted
|
|
310
208
|
});
|
|
311
|
-
$[38] = t14;
|
|
312
|
-
} else {
|
|
313
|
-
t14 = $[38];
|
|
314
209
|
}
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
210
|
+
}, [navigation, title, badges, conversation?.deleted, reply_root_id, replyHeaderTitle, muted]);
|
|
211
|
+
if (!conversation || conversation.deleted) {
|
|
212
|
+
return /*#__PURE__*/_jsx(View, {
|
|
213
|
+
style: styles.container,
|
|
214
|
+
children: /*#__PURE__*/_jsxs(BlankState.Root, {
|
|
215
|
+
children: [/*#__PURE__*/_jsx(BlankState.Imagery, {
|
|
216
|
+
name: "general.outlinedTextMessage"
|
|
217
|
+
}), /*#__PURE__*/_jsx(BlankState.Content, {
|
|
218
|
+
children: /*#__PURE__*/_jsx(BlankState.Heading, {
|
|
219
|
+
children: "This conversation has been deleted"
|
|
220
|
+
})
|
|
221
|
+
}), /*#__PURE__*/_jsx(BlankState.Button, {
|
|
319
222
|
onPress: navigation.goBack,
|
|
320
223
|
title: "Back to conversations",
|
|
321
224
|
accessibilityHint: "Navigates back to the conversations list",
|
|
322
225
|
accessibilityRole: "link"
|
|
323
226
|
})]
|
|
324
|
-
});
|
|
325
|
-
$[39] = navigation.goBack;
|
|
326
|
-
$[40] = t15;
|
|
327
|
-
} else {
|
|
328
|
-
t15 = $[40];
|
|
329
|
-
}
|
|
330
|
-
let t16;
|
|
331
|
-
if ($[41] !== styles.container || $[42] !== t15) {
|
|
332
|
-
t16 = /*#__PURE__*/_jsx(View, {
|
|
333
|
-
style: styles.container,
|
|
334
|
-
children: t15
|
|
335
|
-
});
|
|
336
|
-
$[41] = styles.container;
|
|
337
|
-
$[42] = t15;
|
|
338
|
-
$[43] = t16;
|
|
339
|
-
} else {
|
|
340
|
-
t16 = $[43];
|
|
341
|
-
}
|
|
342
|
-
return t16;
|
|
343
|
-
}
|
|
344
|
-
let t13;
|
|
345
|
-
if ($[44] !== conversation || $[45] !== conversation_id || $[46] !== fetchNextPage || $[47] !== hasNextPage || $[48] !== messages || $[49] !== noMessages || $[50] !== onContentSizeChange || $[51] !== onLayout || $[52] !== onMomentumScrollEnd || $[53] !== onScrollEndDrag || $[54] !== reply_root_id || $[55] !== styles.emptyState) {
|
|
346
|
-
t13 = noMessages ? /*#__PURE__*/_jsx(View, {
|
|
347
|
-
style: styles.emptyState,
|
|
348
|
-
children: /*#__PURE__*/_jsx(ConversationStartBanner, {
|
|
349
|
-
conversation: conversation,
|
|
350
|
-
hasMessages: false
|
|
351
227
|
})
|
|
352
|
-
}) : /*#__PURE__*/_jsx(MessageList, {
|
|
353
|
-
listRef: listRef,
|
|
354
|
-
conversation: conversation,
|
|
355
|
-
conversationId: conversation_id,
|
|
356
|
-
messages: messages,
|
|
357
|
-
replyRootId: reply_root_id,
|
|
358
|
-
hasNextPage: hasNextPage,
|
|
359
|
-
onEndReached: () => fetchNextPage(),
|
|
360
|
-
onScroll: trackScroll,
|
|
361
|
-
onLayout: onLayout,
|
|
362
|
-
onContentSizeChange: onContentSizeChange,
|
|
363
|
-
onScrollEndDrag: onScrollEndDrag,
|
|
364
|
-
onMomentumScrollEnd: onMomentumScrollEnd
|
|
365
228
|
});
|
|
366
|
-
$[44] = conversation;
|
|
367
|
-
$[45] = conversation_id;
|
|
368
|
-
$[46] = fetchNextPage;
|
|
369
|
-
$[47] = hasNextPage;
|
|
370
|
-
$[48] = messages;
|
|
371
|
-
$[49] = noMessages;
|
|
372
|
-
$[50] = onContentSizeChange;
|
|
373
|
-
$[51] = onLayout;
|
|
374
|
-
$[52] = onMomentumScrollEnd;
|
|
375
|
-
$[53] = onScrollEndDrag;
|
|
376
|
-
$[54] = reply_root_id;
|
|
377
|
-
$[55] = styles.emptyState;
|
|
378
|
-
$[56] = t13;
|
|
379
|
-
} else {
|
|
380
|
-
t13 = $[56];
|
|
381
|
-
}
|
|
382
|
-
let t14;
|
|
383
|
-
if ($[57] !== handleReturnToBottom || $[58] !== showJumpToBottomButton) {
|
|
384
|
-
t14 = /*#__PURE__*/_jsx(JumpToBottomButton, {
|
|
385
|
-
onPress: handleReturnToBottom,
|
|
386
|
-
visible: showJumpToBottomButton
|
|
387
|
-
});
|
|
388
|
-
$[57] = handleReturnToBottom;
|
|
389
|
-
$[58] = showJumpToBottomButton;
|
|
390
|
-
$[59] = t14;
|
|
391
|
-
} else {
|
|
392
|
-
t14 = $[59];
|
|
393
229
|
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
children: [t13, t14, t15, t16, t17]
|
|
434
|
-
});
|
|
435
|
-
$[71] = t13;
|
|
436
|
-
$[72] = t14;
|
|
437
|
-
$[73] = t15;
|
|
438
|
-
$[74] = t16;
|
|
439
|
-
$[75] = t17;
|
|
440
|
-
$[76] = t18;
|
|
441
|
-
} else {
|
|
442
|
-
t18 = $[76];
|
|
443
|
-
}
|
|
444
|
-
let t19;
|
|
445
|
-
if ($[77] !== styles.container || $[78] !== t18) {
|
|
446
|
-
t19 = /*#__PURE__*/_jsx(View, {
|
|
447
|
-
style: styles.container,
|
|
448
|
-
children: t18
|
|
449
|
-
});
|
|
450
|
-
$[77] = styles.container;
|
|
451
|
-
$[78] = t18;
|
|
452
|
-
$[79] = t19;
|
|
453
|
-
} else {
|
|
454
|
-
t19 = $[79];
|
|
455
|
-
}
|
|
456
|
-
return t19;
|
|
230
|
+
return /*#__PURE__*/_jsx(View, {
|
|
231
|
+
style: styles.container,
|
|
232
|
+
children: /*#__PURE__*/_jsxs(KeyboardView, {
|
|
233
|
+
children: [noMessages ? /*#__PURE__*/_jsx(View, {
|
|
234
|
+
style: styles.emptyState,
|
|
235
|
+
children: /*#__PURE__*/_jsx(ConversationStartBanner, {
|
|
236
|
+
conversation: conversation,
|
|
237
|
+
hasMessages: false
|
|
238
|
+
})
|
|
239
|
+
}) : /*#__PURE__*/_jsx(MessageList, {
|
|
240
|
+
listRef: listRef,
|
|
241
|
+
conversation: conversation,
|
|
242
|
+
conversationId: conversation_id,
|
|
243
|
+
messages: messages,
|
|
244
|
+
replyRootId: reply_root_id,
|
|
245
|
+
hasNextPage: hasNextPage,
|
|
246
|
+
onEndReached: () => fetchNextPage(),
|
|
247
|
+
onScroll: trackScroll,
|
|
248
|
+
onLayout: onLayout,
|
|
249
|
+
onContentSizeChange: onContentSizeChange,
|
|
250
|
+
onScrollEndDrag: onScrollEndDrag,
|
|
251
|
+
onMomentumScrollEnd: onMomentumScrollEnd,
|
|
252
|
+
maintainVisibleContentPosition: readingHistory ? {
|
|
253
|
+
minIndexForVisible: 0
|
|
254
|
+
} : undefined
|
|
255
|
+
}), /*#__PURE__*/_jsx(JumpToBottomButton, {
|
|
256
|
+
onPress: jumpToLatest,
|
|
257
|
+
visible: showJumpToBottomButton
|
|
258
|
+
}), !noMessages && /*#__PURE__*/_jsx(TypingIndicator, {}), showLeaderDisabledReplyBanner && /*#__PURE__*/_jsx(LeaderMessagesDisabledBanner, {}), /*#__PURE__*/_jsx(ConversationBottomBar, {
|
|
259
|
+
conversation: conversation,
|
|
260
|
+
canReply: canReply,
|
|
261
|
+
replyRootAuthorFirstName: replyRootAuthorFirstName,
|
|
262
|
+
replyRootId: reply_root_id,
|
|
263
|
+
currentlyEditingMessage: currentlyEditingMessage,
|
|
264
|
+
onFlaggedInMessageForm: markHandledByMessageForm,
|
|
265
|
+
onBeforeSubmit: jumpToLatest
|
|
266
|
+
})]
|
|
267
|
+
})
|
|
268
|
+
});
|
|
457
269
|
}
|
|
458
270
|
function ConversationBottomBar(t0) {
|
|
459
|
-
const $ = _c(
|
|
271
|
+
const $ = _c(16);
|
|
460
272
|
const {
|
|
461
273
|
conversation,
|
|
462
274
|
canReply,
|
|
463
275
|
replyRootAuthorFirstName,
|
|
464
276
|
replyRootId,
|
|
465
277
|
currentlyEditingMessage,
|
|
466
|
-
onFlaggedInMessageForm
|
|
278
|
+
onFlaggedInMessageForm,
|
|
279
|
+
onBeforeSubmit
|
|
467
280
|
} = t0;
|
|
468
281
|
const messageLink = useMessageAvailableMembersAction(conversation);
|
|
469
282
|
if (conversation.disabled) {
|
|
@@ -513,24 +326,26 @@ function ConversationBottomBar(t0) {
|
|
|
513
326
|
t5 = $[7];
|
|
514
327
|
}
|
|
515
328
|
let t6;
|
|
516
|
-
if ($[8] !== conversation || $[9] !== currentlyEditingMessage || $[10] !==
|
|
329
|
+
if ($[8] !== conversation || $[9] !== currentlyEditingMessage || $[10] !== onBeforeSubmit || $[11] !== onFlaggedInMessageForm || $[12] !== replyRootAuthorFirstName || $[13] !== replyRootId || $[14] !== t1) {
|
|
517
330
|
t6 = /*#__PURE__*/_jsxs(MessageForm.Root, {
|
|
518
331
|
replyRootAuthorFirstName: replyRootAuthorFirstName,
|
|
519
332
|
conversation: conversation,
|
|
520
333
|
replyRootId: replyRootId,
|
|
521
334
|
currentlyEditingMessage: currentlyEditingMessage,
|
|
522
335
|
onFlaggedInMessageForm: onFlaggedInMessageForm,
|
|
336
|
+
onBeforeSubmit: onBeforeSubmit,
|
|
523
337
|
children: [t2, t3, t4, t5]
|
|
524
338
|
}, t1);
|
|
525
339
|
$[8] = conversation;
|
|
526
340
|
$[9] = currentlyEditingMessage;
|
|
527
|
-
$[10] =
|
|
528
|
-
$[11] =
|
|
529
|
-
$[12] =
|
|
530
|
-
$[13] =
|
|
531
|
-
$[14] =
|
|
532
|
-
|
|
533
|
-
|
|
341
|
+
$[10] = onBeforeSubmit;
|
|
342
|
+
$[11] = onFlaggedInMessageForm;
|
|
343
|
+
$[12] = replyRootAuthorFirstName;
|
|
344
|
+
$[13] = replyRootId;
|
|
345
|
+
$[14] = t1;
|
|
346
|
+
$[15] = t6;
|
|
347
|
+
} else {
|
|
348
|
+
t6 = $[15];
|
|
534
349
|
}
|
|
535
350
|
return t6;
|
|
536
351
|
}
|