@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.
Files changed (83) hide show
  1. package/build/components/conversation/message_form.d.ts +2 -1
  2. package/build/components/conversation/message_form.d.ts.map +1 -1
  3. package/build/components/conversation/message_form.js +54 -51
  4. package/build/components/conversation/message_form.js.map +1 -1
  5. package/build/components/conversation/message_list.d.ts +2 -2
  6. package/build/components/conversation/message_list.d.ts.map +1 -1
  7. package/build/components/conversation/message_list.js +19 -16
  8. package/build/components/conversation/message_list.js.map +1 -1
  9. package/build/hooks/index.d.ts +1 -0
  10. package/build/hooks/index.d.ts.map +1 -1
  11. package/build/hooks/index.js +1 -0
  12. package/build/hooks/index.js.map +1 -1
  13. package/build/hooks/paginator_meta.d.ts +3 -1
  14. package/build/hooks/paginator_meta.d.ts.map +1 -1
  15. package/build/hooks/paginator_meta.js +25 -8
  16. package/build/hooks/paginator_meta.js.map +1 -1
  17. package/build/hooks/use_api.d.ts.map +1 -1
  18. package/build/hooks/use_api.js +5 -8
  19. package/build/hooks/use_api.js.map +1 -1
  20. package/build/hooks/use_conversation_messages_jolt_events.d.ts +9 -1
  21. package/build/hooks/use_conversation_messages_jolt_events.d.ts.map +1 -1
  22. package/build/hooks/use_conversation_messages_jolt_events.js +88 -73
  23. package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
  24. package/build/hooks/use_direct_message_eligibility.d.ts +14 -0
  25. package/build/hooks/use_direct_message_eligibility.d.ts.map +1 -0
  26. package/build/hooks/use_direct_message_eligibility.js +87 -0
  27. package/build/hooks/use_direct_message_eligibility.js.map +1 -0
  28. package/build/hooks/use_fetch_newer_messages.d.ts +8 -0
  29. package/build/hooks/use_fetch_newer_messages.d.ts.map +1 -0
  30. package/build/hooks/use_fetch_newer_messages.js +56 -0
  31. package/build/hooks/use_fetch_newer_messages.js.map +1 -0
  32. package/build/hooks/use_suspense_api.d.ts.map +1 -1
  33. package/build/hooks/use_suspense_api.js +5 -8
  34. package/build/hooks/use_suspense_api.js.map +1 -1
  35. package/build/screens/conversation_new/components/services_form.js +9 -8
  36. package/build/screens/conversation_new/components/services_form.js.map +1 -1
  37. package/build/screens/conversation_screen.d.ts.map +1 -1
  38. package/build/screens/conversation_screen.js +137 -322
  39. package/build/screens/conversation_screen.js.map +1 -1
  40. package/build/types/api_primitives.d.ts +2 -0
  41. package/build/types/api_primitives.d.ts.map +1 -1
  42. package/build/types/api_primitives.js.map +1 -1
  43. package/build/types/resources/member.d.ts +1 -0
  44. package/build/types/resources/member.d.ts.map +1 -1
  45. package/build/types/resources/member.js.map +1 -1
  46. package/build/utils/cache/prepend_newer_page.d.ts +7 -0
  47. package/build/utils/cache/prepend_newer_page.d.ts.map +1 -0
  48. package/build/utils/cache/prepend_newer_page.js +14 -0
  49. package/build/utils/cache/prepend_newer_page.js.map +1 -0
  50. package/build/utils/client/types.d.ts +1 -0
  51. package/build/utils/client/types.d.ts.map +1 -1
  52. package/build/utils/client/types.js.map +1 -1
  53. package/build/utils/gated_message_cache.d.ts +7 -0
  54. package/build/utils/gated_message_cache.d.ts.map +1 -0
  55. package/build/utils/gated_message_cache.js +13 -0
  56. package/build/utils/gated_message_cache.js.map +1 -0
  57. package/build/utils/group_messages.js +4 -1
  58. package/build/utils/group_messages.js.map +1 -1
  59. package/package.json +3 -3
  60. package/src/__tests__/hooks/paginator_meta.test.ts +73 -2
  61. package/src/__tests__/hooks/use_conversation_messages_jolt_events.test.ts +36 -0
  62. package/src/__tests__/hooks/use_direct_message_eligibility.test.tsx +83 -0
  63. package/src/__tests__/screens/conversation_new/components/services_form.test.tsx +91 -0
  64. package/src/__tests__/utils/gated_message_cache.test.ts +26 -0
  65. package/src/components/conversation/message_form.tsx +4 -0
  66. package/src/components/conversation/message_list.tsx +8 -1
  67. package/src/hooks/index.ts +1 -0
  68. package/src/hooks/paginator_meta.ts +29 -5
  69. package/src/hooks/use_api.ts +4 -5
  70. package/src/hooks/use_conversation_messages_jolt_events.ts +57 -40
  71. package/src/hooks/use_direct_message_eligibility.ts +40 -0
  72. package/src/hooks/use_fetch_newer_messages.ts +37 -0
  73. package/src/hooks/use_suspense_api.ts +4 -5
  74. package/src/screens/conversation_new/components/services_form.tsx +5 -5
  75. package/src/screens/conversation_screen.tsx +36 -4
  76. package/src/types/api_primitives.ts +2 -0
  77. package/src/types/resources/member.ts +1 -0
  78. package/src/utils/__tests__/group_messages.test.ts +29 -0
  79. package/src/utils/cache/__tests__/prepend_newer_page.test.ts +35 -0
  80. package/src/utils/cache/prepend_newer_page.ts +22 -0
  81. package/src/utils/client/types.ts +1 -0
  82. package/src/utils/gated_message_cache.ts +19 -0
  83. 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(t0) {
99
- const $ = _c(80);
100
- const {
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
- } = useConversationMessages(t1);
131
- let t2;
132
- if ($[3] !== conversation_id) {
133
- t2 = {
134
- conversationId: conversation_id
135
- };
136
- $[3] = conversation_id;
137
- $[4] = t2;
138
- } else {
139
- t2 = $[4];
140
- }
141
- useConversationJoltEvents(t2);
142
- let t3;
143
- if ($[5] !== conversation_id) {
144
- t3 = {
145
- conversationId: conversation_id
146
- };
147
- $[5] = conversation_id;
148
- $[6] = t3;
149
- } else {
150
- t3 = $[6];
151
- }
152
- useConversationMessagesJoltEvents(t3);
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
- let t4;
158
- if ($[7] !== conversation || $[8] !== messages) {
159
- t4 = {
160
- conversation,
161
- messages
162
- };
163
- $[7] = conversation;
164
- $[8] = messages;
165
- $[9] = t4;
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
- let t5;
180
- if ($[10] !== editing_message_id || $[11] !== messages) {
181
- let t6;
182
- if ($[13] !== editing_message_id) {
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 [showJumpToBottomButton, setShowJumpToBottomButton] = useState(false);
210
- let t7;
211
- if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
212
- t7 = event => {
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(t8);
238
- let t9;
239
- if ($[19] !== restOffset) {
240
- t9 = () => {
241
- listRef.current?.scrollToOffset({
242
- offset: restOffset
243
- });
244
- };
245
- $[19] = restOffset;
246
- $[20] = t9;
247
- } else {
248
- t9 = $[20];
249
- }
250
- const handleReturnToBottom = t9;
251
- let t10;
252
- if ($[21] !== badges?.[0] || $[22] !== conversation.deleted || $[23] !== muted || $[24] !== navigation || $[25] !== replyHeaderTitle || $[26] !== reply_root_id || $[27] !== title) {
253
- t10 = () => {
254
- if (reply_root_id) {
255
- navigation.setParams({
256
- title: replyHeaderTitle
257
- });
258
- } else {
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
- t13 = $[37];
303
- }
304
- let t14;
305
- if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
306
- t14 = /*#__PURE__*/_jsx(BlankState.Content, {
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
- let t15;
316
- if ($[39] !== navigation.goBack) {
317
- t15 = /*#__PURE__*/_jsxs(BlankState.Root, {
318
- children: [t13, t14, /*#__PURE__*/_jsx(BlankState.Button, {
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
- let t15;
395
- if ($[60] !== noMessages) {
396
- t15 = !noMessages && /*#__PURE__*/_jsx(TypingIndicator, {});
397
- $[60] = noMessages;
398
- $[61] = t15;
399
- } else {
400
- t15 = $[61];
401
- }
402
- let t16;
403
- if ($[62] !== showLeaderDisabledReplyBanner) {
404
- t16 = showLeaderDisabledReplyBanner && /*#__PURE__*/_jsx(LeaderMessagesDisabledBanner, {});
405
- $[62] = showLeaderDisabledReplyBanner;
406
- $[63] = t16;
407
- } else {
408
- t16 = $[63];
409
- }
410
- let t17;
411
- if ($[64] !== canReply || $[65] !== conversation || $[66] !== currentlyEditingMessage || $[67] !== markHandledByMessageForm || $[68] !== replyRootAuthorFirstName || $[69] !== reply_root_id) {
412
- t17 = /*#__PURE__*/_jsx(ConversationBottomBar, {
413
- conversation: conversation,
414
- canReply: canReply,
415
- replyRootAuthorFirstName: replyRootAuthorFirstName,
416
- replyRootId: reply_root_id,
417
- currentlyEditingMessage: currentlyEditingMessage,
418
- onFlaggedInMessageForm: markHandledByMessageForm
419
- });
420
- $[64] = canReply;
421
- $[65] = conversation;
422
- $[66] = currentlyEditingMessage;
423
- $[67] = markHandledByMessageForm;
424
- $[68] = replyRootAuthorFirstName;
425
- $[69] = reply_root_id;
426
- $[70] = t17;
427
- } else {
428
- t17 = $[70];
429
- }
430
- let t18;
431
- if ($[71] !== t13 || $[72] !== t14 || $[73] !== t15 || $[74] !== t16 || $[75] !== t17) {
432
- t18 = /*#__PURE__*/_jsxs(KeyboardView, {
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(15);
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] !== onFlaggedInMessageForm || $[11] !== replyRootAuthorFirstName || $[12] !== replyRootId || $[13] !== t1) {
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] = onFlaggedInMessageForm;
528
- $[11] = replyRootAuthorFirstName;
529
- $[12] = replyRootId;
530
- $[13] = t1;
531
- $[14] = t6;
532
- } else {
533
- t6 = $[14];
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
  }