@planningcenter/chat-react-native 4.0.1-qa-staging.2 → 4.0.1-rc.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.
Files changed (85) hide show
  1. package/build/components/conversation/message.d.ts +2 -3
  2. package/build/components/conversation/message.d.ts.map +1 -1
  3. package/build/components/conversation/message.js +22 -23
  4. package/build/components/conversation/message.js.map +1 -1
  5. package/build/components/conversation/message_read_receipts.d.ts +4 -2
  6. package/build/components/conversation/message_read_receipts.d.ts.map +1 -1
  7. package/build/components/conversation/message_read_receipts.js +3 -2
  8. package/build/components/conversation/message_read_receipts.js.map +1 -1
  9. package/build/components/conversation/reply_shadow_message.d.ts +1 -2
  10. package/build/components/conversation/reply_shadow_message.d.ts.map +1 -1
  11. package/build/components/conversation/reply_shadow_message.js +46 -47
  12. package/build/components/conversation/reply_shadow_message.js.map +1 -1
  13. package/build/hooks/use_conversation_messages.d.ts.map +1 -1
  14. package/build/hooks/use_conversation_messages.js +28 -40
  15. package/build/hooks/use_conversation_messages.js.map +1 -1
  16. package/build/hooks/use_conversation_messages_jolt_events.d.ts.map +1 -1
  17. package/build/hooks/use_conversation_messages_jolt_events.js +1 -6
  18. package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
  19. package/build/hooks/use_message_create_or_update.d.ts +4 -99
  20. package/build/hooks/use_message_create_or_update.d.ts.map +1 -1
  21. package/build/hooks/use_message_create_or_update.js +6 -47
  22. package/build/hooks/use_message_create_or_update.js.map +1 -1
  23. package/build/screens/conversation_new/components/groups_form.js +80 -71
  24. package/build/screens/conversation_new/components/groups_form.js.map +1 -1
  25. package/build/screens/conversation_screen.d.ts.map +1 -1
  26. package/build/screens/conversation_screen.js +365 -184
  27. package/build/screens/conversation_screen.js.map +1 -1
  28. package/build/types/resources/message.d.ts +0 -2
  29. package/build/types/resources/message.d.ts.map +1 -1
  30. package/build/types/resources/message.js.map +1 -1
  31. package/build/utils/cache/messages_cache.d.ts +0 -1
  32. package/build/utils/cache/messages_cache.d.ts.map +1 -1
  33. package/build/utils/cache/messages_cache.js +7 -14
  34. package/build/utils/cache/messages_cache.js.map +1 -1
  35. package/build/utils/cache/optimistically_create_message.d.ts +1 -2
  36. package/build/utils/cache/optimistically_create_message.d.ts.map +1 -1
  37. package/build/utils/cache/optimistically_create_message.js +2 -4
  38. package/build/utils/cache/optimistically_create_message.js.map +1 -1
  39. package/build/utils/client/transform_response.d.ts.map +1 -1
  40. package/build/utils/client/transform_response.js +5 -9
  41. package/build/utils/client/transform_response.js.map +1 -1
  42. package/build/utils/group_messages.d.ts +0 -1
  43. package/build/utils/group_messages.d.ts.map +1 -1
  44. package/build/utils/group_messages.js +1 -10
  45. package/build/utils/group_messages.js.map +1 -1
  46. package/build/utils/jolt/transform_message_event_data_to_message_resource.d.ts.map +1 -1
  47. package/build/utils/jolt/transform_message_event_data_to_message_resource.js +0 -1
  48. package/build/utils/jolt/transform_message_event_data_to_message_resource.js.map +1 -1
  49. package/build/utils/request/messages_data_options.d.ts.map +1 -1
  50. package/build/utils/request/messages_data_options.js +2 -2
  51. package/build/utils/request/messages_data_options.js.map +1 -1
  52. package/package.json +3 -3
  53. package/src/components/conversation/message.tsx +18 -15
  54. package/src/components/conversation/message_read_receipts.tsx +5 -3
  55. package/src/components/conversation/reply_shadow_message.tsx +7 -9
  56. package/src/hooks/use_conversation_messages.ts +1 -5
  57. package/src/hooks/use_conversation_messages_jolt_events.ts +0 -7
  58. package/src/hooks/use_message_create_or_update.ts +16 -29
  59. package/src/screens/conversation_new/components/groups_form.tsx +7 -2
  60. package/src/screens/conversation_screen.tsx +104 -11
  61. package/src/types/resources/message.ts +0 -2
  62. package/src/utils/__tests__/group_messages.test.ts +0 -48
  63. package/src/utils/cache/messages_cache.ts +11 -27
  64. package/src/utils/cache/optimistically_create_message.ts +0 -3
  65. package/src/utils/client/transform_response.ts +5 -7
  66. package/src/utils/group_messages.ts +1 -18
  67. package/src/utils/jolt/transform_message_event_data_to_message_resource.ts +0 -1
  68. package/src/utils/request/messages_data_options.ts +1 -2
  69. package/build/components/conversation/message_list.d.ts +0 -21
  70. package/build/components/conversation/message_list.d.ts.map +0 -1
  71. package/build/components/conversation/message_list.js +0 -273
  72. package/build/components/conversation/message_list.js.map +0 -1
  73. package/build/utils/replace_equal_by_id.d.ts +0 -6
  74. package/build/utils/replace_equal_by_id.d.ts.map +0 -1
  75. package/build/utils/replace_equal_by_id.js +0 -41
  76. package/build/utils/replace_equal_by_id.js.map +0 -1
  77. package/src/components/conversation/__tests__/message_list.test.tsx +0 -271
  78. package/src/components/conversation/__tests__/reply_shadow_message.test.tsx +0 -119
  79. package/src/components/conversation/message_list.tsx +0 -157
  80. package/src/hooks/__tests__/use_message_create_or_update.test.tsx +0 -110
  81. package/src/utils/__tests__/replace_equal_by_id.test.ts +0 -73
  82. package/src/utils/cache/__tests__/messages_cache.test.ts +0 -89
  83. package/src/utils/cache/__tests__/messages_cache_reply_roots.test.ts +0 -70
  84. package/src/utils/client/__tests__/transform_response.test.ts +0 -62
  85. package/src/utils/replace_equal_by_id.ts +0 -42
@@ -1,20 +1,24 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
+ import { date as formatDate } from '@planningcenter/datetime-fmt';
2
3
  import { HeaderTitle, PlatformPressable } from '@react-navigation/elements';
3
4
  import { CommonActions, useNavigation, useTheme as useNavigationTheme, useRoute } from '@react-navigation/native';
4
5
  import React, { useCallback, useEffect, useRef, useState } from 'react';
5
- import { Platform, StyleSheet, useWindowDimensions, View } from 'react-native';
6
+ import { FlatList, Platform, StyleSheet, useWindowDimensions, View } from 'react-native';
6
7
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
7
- import { Badge, Icon } from '../components';
8
+ import { Badge, Icon, Text } from '../components';
8
9
  import { ConversationStartBanner } from '../components/conversation/conversation_start_banner';
9
10
  import { JumpToBottomButton } from '../components/conversation/jump_to_bottom_button';
11
+ import { Message } from '../components/conversation/message';
10
12
  import { MessageForm } from '../components/conversation/message_form';
11
- import { MessageList } from '../components/conversation/message_list';
12
13
  import { ConversationDisabledBanner, LeaderMessagesDisabledBanner, MemberMessagesDisabledBanner } from '../components/conversation/messages_disabled_banners';
14
+ import { ReplyShadowMessage } from '../components/conversation/reply_shadow_message';
15
+ import { SystemMessage } from '../components/conversation/system_message';
13
16
  import { TypingIndicator } from '../components/conversation/typing_indicator';
14
17
  import { KeyboardView } from '../components/display/keyboard_view';
15
18
  import { useHeaderSlotReserve } from '../components/display/platform_modal_header_buttons';
16
19
  import BlankState from '../components/primitive/blank_state_primitive';
17
20
  import { ConversationContextProvider } from '../contexts/conversation_context';
21
+ import { useTheme } from '../hooks';
18
22
  import { useMessageAvailableMembersAction } from '../hooks/direct_messages/use_message_available_members_action';
19
23
  import { useConversation } from '../hooks/use_conversation';
20
24
  import { useConversationJoltEvents } from '../hooks/use_conversation_jolt_events';
@@ -24,6 +28,10 @@ import { useMarkLatestMessageRead } from '../hooks/use_mark_latest_message_read'
24
28
  import { analyticsEvents, normalizeAnalyticsMetadata, usePublishProductAnalyticsEvent } from '../hooks/use_product_analytics';
25
29
  import { useRestAwayFromDismissEdge } from '../hooks/use_rest_away_from_dismiss_edge';
26
30
  import { useVideoModerationJoltEvents } from '../hooks/use_video_moderation_jolt_events';
31
+ import { getRelativeDateStatus } from '../utils/date';
32
+ import { groupMessages } from '../utils/group_messages';
33
+ import { CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL } from '../utils/styles';
34
+ import { isSystemMessage } from '../utils/system_messages';
27
35
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
28
36
  export function ConversationScreen(t0) {
29
37
  const $ = _c(13);
@@ -96,7 +104,7 @@ export function ConversationScreen(t0) {
96
104
  return t6;
97
105
  }
98
106
  function ConversationScreenContent(t0) {
99
- const $ = _c(80);
107
+ const $ = _c(86);
100
108
  const {
101
109
  route
102
110
  } = t0;
@@ -167,7 +175,21 @@ function ConversationScreenContent(t0) {
167
175
  t4 = $[9];
168
176
  }
169
177
  useMarkLatestMessageRead(t4);
170
- const noMessages = messages.length === 0;
178
+ const t5 = !!reply_root_id;
179
+ let t6;
180
+ if ($[10] !== messages || $[11] !== t5) {
181
+ t6 = groupMessages({
182
+ ms: messages,
183
+ inReplyScreen: t5
184
+ });
185
+ $[10] = messages;
186
+ $[11] = t5;
187
+ $[12] = t6;
188
+ } else {
189
+ t6 = $[12];
190
+ }
191
+ const messagesWithSeparators = t6;
192
+ const noMessages = messagesWithSeparators.length === 0;
171
193
  const {
172
194
  repliesDisabled,
173
195
  memberAbility,
@@ -176,57 +198,58 @@ function ConversationScreenContent(t0) {
176
198
  } = conversation;
177
199
  const canReply = memberAbility?.canReply;
178
200
  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;
201
+ const canDeleteNonAuthoredMessages = memberAbility?.canDeleteNonAuthoredMessages ?? false;
202
+ let t7;
203
+ if ($[13] !== editing_message_id || $[14] !== messages) {
204
+ let t8;
205
+ if ($[16] !== editing_message_id) {
206
+ t8 = m => String(m.id) === String(editing_message_id);
207
+ $[16] = editing_message_id;
208
+ $[17] = t8;
186
209
  } else {
187
- t6 = $[14];
210
+ t8 = $[17];
188
211
  }
189
- t5 = messages.find(t6);
190
- $[10] = editing_message_id;
191
- $[11] = messages;
192
- $[12] = t5;
212
+ t7 = messages.find(t8);
213
+ $[13] = editing_message_id;
214
+ $[14] = messages;
215
+ $[15] = t7;
193
216
  } else {
194
- t5 = $[12];
217
+ t7 = $[15];
195
218
  }
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;
219
+ const currentlyEditingMessage = t7;
220
+ let t8;
221
+ if ($[18] !== reply_root_author_name) {
222
+ t8 = reply_root_author_name?.split(" ")[0];
223
+ $[18] = reply_root_author_name;
224
+ $[19] = t8;
202
225
  } else {
203
- t6 = $[16];
226
+ t8 = $[19];
204
227
  }
205
- const replyRootAuthorFirstName = t6;
228
+ const replyRootAuthorFirstName = t8;
206
229
  const replyHeaderTitle = replyRootAuthorFirstName ? `Reply to ${replyRootAuthorFirstName}` : "Reply";
207
230
  const muted = conversation.conversationMembership?.muted ?? conversation.muted;
208
231
  const listRef = useRef(null);
209
232
  const [showJumpToBottomButton, setShowJumpToBottomButton] = useState(false);
210
- let t7;
211
- if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
212
- t7 = event => {
233
+ let t9;
234
+ if ($[20] === Symbol.for("react.memo_cache_sentinel")) {
235
+ t9 = event => {
213
236
  const offsetY = event.nativeEvent.contentOffset.y;
214
237
  setShowJumpToBottomButton(offsetY > 200);
215
238
  };
216
- $[17] = t7;
239
+ $[20] = t9;
217
240
  } else {
218
- t7 = $[17];
241
+ t9 = $[20];
219
242
  }
220
- const trackScroll = t7;
221
- let t8;
222
- if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
223
- t8 = {
243
+ const trackScroll = t9;
244
+ let t10;
245
+ if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
246
+ t10 = {
224
247
  listRef,
225
248
  enabled: Platform.OS === "ios"
226
249
  };
227
- $[18] = t8;
250
+ $[21] = t10;
228
251
  } else {
229
- t8 = $[18];
252
+ t10 = $[21];
230
253
  }
231
254
  const {
232
255
  restOffset,
@@ -234,23 +257,23 @@ function ConversationScreenContent(t0) {
234
257
  onContentSizeChange,
235
258
  onMomentumScrollEnd,
236
259
  onScrollEndDrag
237
- } = useRestAwayFromDismissEdge(t8);
238
- let t9;
239
- if ($[19] !== restOffset) {
240
- t9 = () => {
260
+ } = useRestAwayFromDismissEdge(t10);
261
+ let t11;
262
+ if ($[22] !== restOffset) {
263
+ t11 = () => {
241
264
  listRef.current?.scrollToOffset({
242
265
  offset: restOffset
243
266
  });
244
267
  };
245
- $[19] = restOffset;
246
- $[20] = t9;
268
+ $[22] = restOffset;
269
+ $[23] = t11;
247
270
  } else {
248
- t9 = $[20];
271
+ t11 = $[23];
249
272
  }
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 = () => {
273
+ const handleReturnToBottom = t11;
274
+ let t12;
275
+ if ($[24] !== badges?.[0] || $[25] !== conversation.deleted || $[26] !== muted || $[27] !== navigation || $[28] !== replyHeaderTitle || $[29] !== reply_root_id || $[30] !== title) {
276
+ t12 = () => {
254
277
  if (reply_root_id) {
255
278
  navigation.setParams({
256
279
  title: replyHeaderTitle
@@ -264,152 +287,192 @@ function ConversationScreenContent(t0) {
264
287
  });
265
288
  }
266
289
  };
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);
290
+ $[24] = badges?.[0];
291
+ $[25] = conversation.deleted;
292
+ $[26] = muted;
293
+ $[27] = navigation;
294
+ $[28] = replyHeaderTitle;
295
+ $[29] = reply_root_id;
296
+ $[30] = title;
297
+ $[31] = t12;
298
+ } else {
299
+ t12 = $[31];
300
+ }
301
+ const t13 = conversation?.deleted;
302
+ let t14;
303
+ if ($[32] !== badges || $[33] !== muted || $[34] !== navigation || $[35] !== replyHeaderTitle || $[36] !== reply_root_id || $[37] !== t13 || $[38] !== title) {
304
+ t14 = [navigation, title, badges, t13, reply_root_id, replyHeaderTitle, muted];
305
+ $[32] = badges;
306
+ $[33] = muted;
307
+ $[34] = navigation;
308
+ $[35] = replyHeaderTitle;
309
+ $[36] = reply_root_id;
310
+ $[37] = t13;
311
+ $[38] = title;
312
+ $[39] = t14;
313
+ } else {
314
+ t14 = $[39];
315
+ }
316
+ useEffect(t12, t14);
294
317
  if (!conversation || conversation.deleted) {
295
- let t13;
296
- if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
297
- t13 = /*#__PURE__*/_jsx(BlankState.Imagery, {
318
+ let t15;
319
+ if ($[40] === Symbol.for("react.memo_cache_sentinel")) {
320
+ t15 = /*#__PURE__*/_jsx(BlankState.Imagery, {
298
321
  name: "general.outlinedTextMessage"
299
322
  });
300
- $[37] = t13;
323
+ $[40] = t15;
301
324
  } else {
302
- t13 = $[37];
325
+ t15 = $[40];
303
326
  }
304
- let t14;
305
- if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
306
- t14 = /*#__PURE__*/_jsx(BlankState.Content, {
327
+ let t16;
328
+ if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
329
+ t16 = /*#__PURE__*/_jsx(BlankState.Content, {
307
330
  children: /*#__PURE__*/_jsx(BlankState.Heading, {
308
331
  children: "This conversation has been deleted"
309
332
  })
310
333
  });
311
- $[38] = t14;
334
+ $[41] = t16;
312
335
  } else {
313
- t14 = $[38];
336
+ t16 = $[41];
314
337
  }
315
- let t15;
316
- if ($[39] !== navigation.goBack) {
317
- t15 = /*#__PURE__*/_jsxs(BlankState.Root, {
318
- children: [t13, t14, /*#__PURE__*/_jsx(BlankState.Button, {
338
+ let t17;
339
+ if ($[42] !== navigation.goBack) {
340
+ t17 = /*#__PURE__*/_jsxs(BlankState.Root, {
341
+ children: [t15, t16, /*#__PURE__*/_jsx(BlankState.Button, {
319
342
  onPress: navigation.goBack,
320
343
  title: "Back to conversations",
321
344
  accessibilityHint: "Navigates back to the conversations list",
322
345
  accessibilityRole: "link"
323
346
  })]
324
347
  });
325
- $[39] = navigation.goBack;
326
- $[40] = t15;
348
+ $[42] = navigation.goBack;
349
+ $[43] = t17;
327
350
  } else {
328
- t15 = $[40];
351
+ t17 = $[43];
329
352
  }
330
- let t16;
331
- if ($[41] !== styles.container || $[42] !== t15) {
332
- t16 = /*#__PURE__*/_jsx(View, {
353
+ let t18;
354
+ if ($[44] !== styles.container || $[45] !== t17) {
355
+ t18 = /*#__PURE__*/_jsx(View, {
333
356
  style: styles.container,
334
- children: t15
357
+ children: t17
335
358
  });
336
- $[41] = styles.container;
337
- $[42] = t15;
338
- $[43] = t16;
359
+ $[44] = styles.container;
360
+ $[45] = t17;
361
+ $[46] = t18;
339
362
  } else {
340
- t16 = $[43];
363
+ t18 = $[46];
341
364
  }
342
- return t16;
365
+ return t18;
343
366
  }
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, {
367
+ let t15;
368
+ if ($[47] !== canDeleteNonAuthoredMessages || $[48] !== conversation || $[49] !== conversation_id || $[50] !== fetchNextPage || $[51] !== hasNextPage || $[52] !== messagesWithSeparators || $[53] !== noMessages || $[54] !== onContentSizeChange || $[55] !== onLayout || $[56] !== onMomentumScrollEnd || $[57] !== onScrollEndDrag || $[58] !== reply_root_id || $[59] !== styles.emptyState || $[60] !== styles.listContainer || $[61] !== styles.listHeader) {
369
+ t15 = noMessages ? /*#__PURE__*/_jsx(View, {
347
370
  style: styles.emptyState,
348
371
  children: /*#__PURE__*/_jsx(ConversationStartBanner, {
349
372
  conversation: conversation,
350
373
  hasMessages: false
351
374
  })
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(),
375
+ }) : /*#__PURE__*/_jsx(FlatList, {
376
+ inverted: true,
377
+ ref: listRef,
378
+ contentContainerStyle: styles.listContainer,
379
+ data: messagesWithSeparators,
380
+ keyExtractor: _temp,
360
381
  onScroll: trackScroll,
361
382
  onLayout: onLayout,
362
383
  onContentSizeChange: onContentSizeChange,
363
384
  onScrollEndDrag: onScrollEndDrag,
364
- onMomentumScrollEnd: onMomentumScrollEnd
385
+ onMomentumScrollEnd: onMomentumScrollEnd,
386
+ scrollEventThrottle: 10,
387
+ ListFooterComponent: hasNextPage ? null : /*#__PURE__*/_jsx(ConversationStartBanner, {
388
+ conversation: conversation,
389
+ hasMessages: true
390
+ }),
391
+ renderItem: t16 => {
392
+ const {
393
+ item: item_0
394
+ } = t16;
395
+ if (item_0.type === "DateSeparator") {
396
+ return /*#__PURE__*/_jsx(InlineDateSeparator, {
397
+ ...item_0
398
+ });
399
+ }
400
+ if (item_0.type === "ReplyShadowMessage") {
401
+ return /*#__PURE__*/_jsx(ReplyShadowMessage, {
402
+ ...item_0,
403
+ conversation_id: conversation_id,
404
+ inReplyScreen: !!reply_root_id
405
+ });
406
+ }
407
+ if (isSystemMessage(item_0)) {
408
+ return /*#__PURE__*/_jsx(SystemMessage, {
409
+ message: item_0,
410
+ conversationId: conversation_id
411
+ });
412
+ }
413
+ return /*#__PURE__*/_jsx(Message, {
414
+ ...item_0,
415
+ canDeleteNonAuthoredMessages: canDeleteNonAuthoredMessages,
416
+ conversation_id: conversation_id,
417
+ latestReadMessageSortKey: conversation?.latestReadMessageSortKey,
418
+ inReplyScreen: !!reply_root_id
419
+ });
420
+ },
421
+ onEndReached: () => fetchNextPage(),
422
+ ListHeaderComponent: /*#__PURE__*/_jsx(View, {
423
+ style: styles.listHeader
424
+ })
365
425
  });
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];
426
+ $[47] = canDeleteNonAuthoredMessages;
427
+ $[48] = conversation;
428
+ $[49] = conversation_id;
429
+ $[50] = fetchNextPage;
430
+ $[51] = hasNextPage;
431
+ $[52] = messagesWithSeparators;
432
+ $[53] = noMessages;
433
+ $[54] = onContentSizeChange;
434
+ $[55] = onLayout;
435
+ $[56] = onMomentumScrollEnd;
436
+ $[57] = onScrollEndDrag;
437
+ $[58] = reply_root_id;
438
+ $[59] = styles.emptyState;
439
+ $[60] = styles.listContainer;
440
+ $[61] = styles.listHeader;
441
+ $[62] = t15;
442
+ } else {
443
+ t15 = $[62];
381
444
  }
382
- let t14;
383
- if ($[57] !== handleReturnToBottom || $[58] !== showJumpToBottomButton) {
384
- t14 = /*#__PURE__*/_jsx(JumpToBottomButton, {
445
+ let t16;
446
+ if ($[63] !== handleReturnToBottom || $[64] !== showJumpToBottomButton) {
447
+ t16 = /*#__PURE__*/_jsx(JumpToBottomButton, {
385
448
  onPress: handleReturnToBottom,
386
449
  visible: showJumpToBottomButton
387
450
  });
388
- $[57] = handleReturnToBottom;
389
- $[58] = showJumpToBottomButton;
390
- $[59] = t14;
451
+ $[63] = handleReturnToBottom;
452
+ $[64] = showJumpToBottomButton;
453
+ $[65] = t16;
391
454
  } else {
392
- t14 = $[59];
455
+ t16 = $[65];
393
456
  }
394
- let t15;
395
- if ($[60] !== noMessages) {
396
- t15 = !noMessages && /*#__PURE__*/_jsx(TypingIndicator, {});
397
- $[60] = noMessages;
398
- $[61] = t15;
457
+ let t17;
458
+ if ($[66] !== noMessages) {
459
+ t17 = !noMessages && /*#__PURE__*/_jsx(TypingIndicator, {});
460
+ $[66] = noMessages;
461
+ $[67] = t17;
399
462
  } else {
400
- t15 = $[61];
463
+ t17 = $[67];
401
464
  }
402
- let t16;
403
- if ($[62] !== showLeaderDisabledReplyBanner) {
404
- t16 = showLeaderDisabledReplyBanner && /*#__PURE__*/_jsx(LeaderMessagesDisabledBanner, {});
405
- $[62] = showLeaderDisabledReplyBanner;
406
- $[63] = t16;
465
+ let t18;
466
+ if ($[68] !== showLeaderDisabledReplyBanner) {
467
+ t18 = showLeaderDisabledReplyBanner && /*#__PURE__*/_jsx(LeaderMessagesDisabledBanner, {});
468
+ $[68] = showLeaderDisabledReplyBanner;
469
+ $[69] = t18;
407
470
  } else {
408
- t16 = $[63];
471
+ t18 = $[69];
409
472
  }
410
- let t17;
411
- if ($[64] !== canReply || $[65] !== conversation || $[66] !== currentlyEditingMessage || $[67] !== markHandledByMessageForm || $[68] !== replyRootAuthorFirstName || $[69] !== reply_root_id) {
412
- t17 = /*#__PURE__*/_jsx(ConversationBottomBar, {
473
+ let t19;
474
+ if ($[70] !== canReply || $[71] !== conversation || $[72] !== currentlyEditingMessage || $[73] !== markHandledByMessageForm || $[74] !== replyRootAuthorFirstName || $[75] !== reply_root_id) {
475
+ t19 = /*#__PURE__*/_jsx(ConversationBottomBar, {
413
476
  conversation: conversation,
414
477
  canReply: canReply,
415
478
  replyRootAuthorFirstName: replyRootAuthorFirstName,
@@ -417,43 +480,46 @@ function ConversationScreenContent(t0) {
417
480
  currentlyEditingMessage: currentlyEditingMessage,
418
481
  onFlaggedInMessageForm: markHandledByMessageForm
419
482
  });
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]
483
+ $[70] = canReply;
484
+ $[71] = conversation;
485
+ $[72] = currentlyEditingMessage;
486
+ $[73] = markHandledByMessageForm;
487
+ $[74] = replyRootAuthorFirstName;
488
+ $[75] = reply_root_id;
489
+ $[76] = t19;
490
+ } else {
491
+ t19 = $[76];
492
+ }
493
+ let t20;
494
+ if ($[77] !== t15 || $[78] !== t16 || $[79] !== t17 || $[80] !== t18 || $[81] !== t19) {
495
+ t20 = /*#__PURE__*/_jsxs(KeyboardView, {
496
+ children: [t15, t16, t17, t18, t19]
434
497
  });
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, {
498
+ $[77] = t15;
499
+ $[78] = t16;
500
+ $[79] = t17;
501
+ $[80] = t18;
502
+ $[81] = t19;
503
+ $[82] = t20;
504
+ } else {
505
+ t20 = $[82];
506
+ }
507
+ let t21;
508
+ if ($[83] !== styles.container || $[84] !== t20) {
509
+ t21 = /*#__PURE__*/_jsx(View, {
447
510
  style: styles.container,
448
- children: t18
511
+ children: t20
449
512
  });
450
- $[77] = styles.container;
451
- $[78] = t18;
452
- $[79] = t19;
513
+ $[83] = styles.container;
514
+ $[84] = t20;
515
+ $[85] = t21;
453
516
  } else {
454
- t19 = $[79];
517
+ t21 = $[85];
455
518
  }
456
- return t19;
519
+ return t21;
520
+ }
521
+ function _temp(item) {
522
+ return item.id;
457
523
  }
458
524
  function ConversationBottomBar(t0) {
459
525
  const $ = _c(15);
@@ -534,6 +600,115 @@ function ConversationBottomBar(t0) {
534
600
  }
535
601
  return t6;
536
602
  }
603
+ function InlineDateSeparator(t0) {
604
+ const $ = _c(17);
605
+ const {
606
+ date
607
+ } = t0;
608
+ const styles = useDateSeparatorStyles();
609
+ let t1;
610
+ if ($[0] !== date) {
611
+ t1 = getRelativeDateStatus(date);
612
+ $[0] = date;
613
+ $[1] = t1;
614
+ } else {
615
+ t1 = $[1];
616
+ }
617
+ const {
618
+ isThisYear
619
+ } = t1;
620
+ const showYear = !isThisYear;
621
+ let t2;
622
+ if ($[2] !== date || $[3] !== showYear) {
623
+ t2 = formatDate(date, {
624
+ style: "long",
625
+ year: showYear
626
+ });
627
+ $[2] = date;
628
+ $[3] = showYear;
629
+ $[4] = t2;
630
+ } else {
631
+ t2 = $[4];
632
+ }
633
+ const dateStamp = t2;
634
+ let t3;
635
+ if ($[5] !== styles.separator) {
636
+ t3 = /*#__PURE__*/_jsx(View, {
637
+ style: styles.separator
638
+ });
639
+ $[5] = styles.separator;
640
+ $[6] = t3;
641
+ } else {
642
+ t3 = $[6];
643
+ }
644
+ let t4;
645
+ if ($[7] !== dateStamp || $[8] !== styles.dateText) {
646
+ t4 = /*#__PURE__*/_jsx(Text, {
647
+ variant: "footnote",
648
+ style: styles.dateText,
649
+ children: dateStamp
650
+ });
651
+ $[7] = dateStamp;
652
+ $[8] = styles.dateText;
653
+ $[9] = t4;
654
+ } else {
655
+ t4 = $[9];
656
+ }
657
+ let t5;
658
+ if ($[10] !== styles.separator) {
659
+ t5 = /*#__PURE__*/_jsx(View, {
660
+ style: styles.separator
661
+ });
662
+ $[10] = styles.separator;
663
+ $[11] = t5;
664
+ } else {
665
+ t5 = $[11];
666
+ }
667
+ let t6;
668
+ if ($[12] !== styles.container || $[13] !== t3 || $[14] !== t4 || $[15] !== t5) {
669
+ t6 = /*#__PURE__*/_jsxs(View, {
670
+ style: styles.container,
671
+ children: [t3, t4, t5]
672
+ });
673
+ $[12] = styles.container;
674
+ $[13] = t3;
675
+ $[14] = t4;
676
+ $[15] = t5;
677
+ $[16] = t6;
678
+ } else {
679
+ t6 = $[16];
680
+ }
681
+ return t6;
682
+ }
683
+ const useDateSeparatorStyles = () => {
684
+ const $ = _c(2);
685
+ const theme = useTheme();
686
+ let t0;
687
+ if ($[0] !== theme.colors.borderColorDefaultBase) {
688
+ t0 = StyleSheet.create({
689
+ container: {
690
+ alignItems: "center",
691
+ flexDirection: "row",
692
+ paddingHorizontal: CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,
693
+ paddingVertical: 16
694
+ },
695
+ separator: {
696
+ flex: 1,
697
+ height: 1,
698
+ borderTopWidth: 1,
699
+ borderTopColor: theme.colors.borderColorDefaultBase
700
+ },
701
+ dateText: {
702
+ paddingHorizontal: 8
703
+ }
704
+ });
705
+ $[0] = theme.colors.borderColorDefaultBase;
706
+ $[1] = t0;
707
+ } else {
708
+ t0 = $[1];
709
+ }
710
+ return t0;
711
+ };
537
712
  export const ConversationScreenTitle = t0 => {
538
713
  const $ = _c(29);
539
714
  const {
@@ -728,6 +903,12 @@ const useStyles = () => {
728
903
  emptyState: {
729
904
  flex: 1,
730
905
  justifyContent: "center"
906
+ },
907
+ listContainer: {
908
+ paddingVertical: 12
909
+ },
910
+ listHeader: {
911
+ height: 16
731
912
  }
732
913
  });
733
914
  $[0] = bottom;
@@ -753,7 +934,7 @@ const useEnsureConversationsRouteExists = () => {
753
934
  t0 = () => {
754
935
  const navigationState = navigation.getState();
755
936
  const routes = navigationState?.routes || [];
756
- const conversationsRoute = routes.find(_temp);
937
+ const conversationsRoute = routes.find(_temp2);
757
938
  if (conversationsRoute) {
758
939
  return;
759
940
  }
@@ -786,7 +967,7 @@ const useEnsureConversationsRouteExists = () => {
786
967
  }
787
968
  useEffect(t0, t2);
788
969
  };
789
- function _temp(r) {
970
+ function _temp2(r) {
790
971
  return r.name === "Conversations";
791
972
  }
792
973
  //# sourceMappingURL=conversation_screen.js.map