@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.
- package/build/components/conversation/message.d.ts +2 -3
- package/build/components/conversation/message.d.ts.map +1 -1
- package/build/components/conversation/message.js +22 -23
- package/build/components/conversation/message.js.map +1 -1
- package/build/components/conversation/message_read_receipts.d.ts +4 -2
- package/build/components/conversation/message_read_receipts.d.ts.map +1 -1
- package/build/components/conversation/message_read_receipts.js +3 -2
- package/build/components/conversation/message_read_receipts.js.map +1 -1
- package/build/components/conversation/reply_shadow_message.d.ts +1 -2
- package/build/components/conversation/reply_shadow_message.d.ts.map +1 -1
- package/build/components/conversation/reply_shadow_message.js +46 -47
- package/build/components/conversation/reply_shadow_message.js.map +1 -1
- package/build/hooks/use_conversation_messages.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages.js +28 -40
- 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 +1 -6
- package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
- package/build/hooks/use_message_create_or_update.d.ts +4 -99
- package/build/hooks/use_message_create_or_update.d.ts.map +1 -1
- package/build/hooks/use_message_create_or_update.js +6 -47
- package/build/hooks/use_message_create_or_update.js.map +1 -1
- package/build/screens/conversation_new/components/groups_form.js +80 -71
- package/build/screens/conversation_new/components/groups_form.js.map +1 -1
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +365 -184
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/types/resources/message.d.ts +0 -2
- package/build/types/resources/message.d.ts.map +1 -1
- package/build/types/resources/message.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 +7 -14
- package/build/utils/cache/messages_cache.js.map +1 -1
- package/build/utils/cache/optimistically_create_message.d.ts +1 -2
- package/build/utils/cache/optimistically_create_message.d.ts.map +1 -1
- package/build/utils/cache/optimistically_create_message.js +2 -4
- package/build/utils/cache/optimistically_create_message.js.map +1 -1
- package/build/utils/client/transform_response.d.ts.map +1 -1
- package/build/utils/client/transform_response.js +5 -9
- package/build/utils/client/transform_response.js.map +1 -1
- package/build/utils/group_messages.d.ts +0 -1
- package/build/utils/group_messages.d.ts.map +1 -1
- package/build/utils/group_messages.js +1 -10
- package/build/utils/group_messages.js.map +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.d.ts.map +1 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.js +0 -1
- package/build/utils/jolt/transform_message_event_data_to_message_resource.js.map +1 -1
- package/build/utils/request/messages_data_options.d.ts.map +1 -1
- package/build/utils/request/messages_data_options.js +2 -2
- package/build/utils/request/messages_data_options.js.map +1 -1
- package/package.json +3 -3
- package/src/components/conversation/message.tsx +18 -15
- package/src/components/conversation/message_read_receipts.tsx +5 -3
- package/src/components/conversation/reply_shadow_message.tsx +7 -9
- package/src/hooks/use_conversation_messages.ts +1 -5
- package/src/hooks/use_conversation_messages_jolt_events.ts +0 -7
- package/src/hooks/use_message_create_or_update.ts +16 -29
- package/src/screens/conversation_new/components/groups_form.tsx +7 -2
- package/src/screens/conversation_screen.tsx +104 -11
- package/src/types/resources/message.ts +0 -2
- package/src/utils/__tests__/group_messages.test.ts +0 -48
- package/src/utils/cache/messages_cache.ts +11 -27
- package/src/utils/cache/optimistically_create_message.ts +0 -3
- package/src/utils/client/transform_response.ts +5 -7
- package/src/utils/group_messages.ts +1 -18
- package/src/utils/jolt/transform_message_event_data_to_message_resource.ts +0 -1
- package/src/utils/request/messages_data_options.ts +1 -2
- package/build/components/conversation/message_list.d.ts +0 -21
- package/build/components/conversation/message_list.d.ts.map +0 -1
- package/build/components/conversation/message_list.js +0 -273
- package/build/components/conversation/message_list.js.map +0 -1
- package/build/utils/replace_equal_by_id.d.ts +0 -6
- package/build/utils/replace_equal_by_id.d.ts.map +0 -1
- package/build/utils/replace_equal_by_id.js +0 -41
- package/build/utils/replace_equal_by_id.js.map +0 -1
- package/src/components/conversation/__tests__/message_list.test.tsx +0 -271
- package/src/components/conversation/__tests__/reply_shadow_message.test.tsx +0 -119
- package/src/components/conversation/message_list.tsx +0 -157
- package/src/hooks/__tests__/use_message_create_or_update.test.tsx +0 -110
- package/src/utils/__tests__/replace_equal_by_id.test.ts +0 -73
- package/src/utils/cache/__tests__/messages_cache.test.ts +0 -89
- package/src/utils/cache/__tests__/messages_cache_reply_roots.test.ts +0 -70
- package/src/utils/client/__tests__/transform_response.test.ts +0 -62
- 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(
|
|
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
|
|
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
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
$[
|
|
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
|
-
|
|
210
|
+
t8 = $[17];
|
|
188
211
|
}
|
|
189
|
-
|
|
190
|
-
$[
|
|
191
|
-
$[
|
|
192
|
-
$[
|
|
212
|
+
t7 = messages.find(t8);
|
|
213
|
+
$[13] = editing_message_id;
|
|
214
|
+
$[14] = messages;
|
|
215
|
+
$[15] = t7;
|
|
193
216
|
} else {
|
|
194
|
-
|
|
217
|
+
t7 = $[15];
|
|
195
218
|
}
|
|
196
|
-
const currentlyEditingMessage =
|
|
197
|
-
let
|
|
198
|
-
if ($[
|
|
199
|
-
|
|
200
|
-
$[
|
|
201
|
-
$[
|
|
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
|
-
|
|
226
|
+
t8 = $[19];
|
|
204
227
|
}
|
|
205
|
-
const replyRootAuthorFirstName =
|
|
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
|
|
211
|
-
if ($[
|
|
212
|
-
|
|
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
|
-
$[
|
|
239
|
+
$[20] = t9;
|
|
217
240
|
} else {
|
|
218
|
-
|
|
241
|
+
t9 = $[20];
|
|
219
242
|
}
|
|
220
|
-
const trackScroll =
|
|
221
|
-
let
|
|
222
|
-
if ($[
|
|
223
|
-
|
|
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
|
-
$[
|
|
250
|
+
$[21] = t10;
|
|
228
251
|
} else {
|
|
229
|
-
|
|
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(
|
|
238
|
-
let
|
|
239
|
-
if ($[
|
|
240
|
-
|
|
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
|
-
$[
|
|
246
|
-
$[
|
|
268
|
+
$[22] = restOffset;
|
|
269
|
+
$[23] = t11;
|
|
247
270
|
} else {
|
|
248
|
-
|
|
271
|
+
t11 = $[23];
|
|
249
272
|
}
|
|
250
|
-
const handleReturnToBottom =
|
|
251
|
-
let
|
|
252
|
-
if ($[
|
|
253
|
-
|
|
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
|
-
$[
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
270
|
-
$[
|
|
271
|
-
$[
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
} else {
|
|
276
|
-
|
|
277
|
-
}
|
|
278
|
-
const
|
|
279
|
-
let
|
|
280
|
-
if ($[
|
|
281
|
-
|
|
282
|
-
$[
|
|
283
|
-
$[
|
|
284
|
-
$[
|
|
285
|
-
$[
|
|
286
|
-
$[
|
|
287
|
-
$[
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
290
|
-
} else {
|
|
291
|
-
|
|
292
|
-
}
|
|
293
|
-
useEffect(
|
|
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
|
|
296
|
-
if ($[
|
|
297
|
-
|
|
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
|
-
$[
|
|
323
|
+
$[40] = t15;
|
|
301
324
|
} else {
|
|
302
|
-
|
|
325
|
+
t15 = $[40];
|
|
303
326
|
}
|
|
304
|
-
let
|
|
305
|
-
if ($[
|
|
306
|
-
|
|
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
|
-
$[
|
|
334
|
+
$[41] = t16;
|
|
312
335
|
} else {
|
|
313
|
-
|
|
336
|
+
t16 = $[41];
|
|
314
337
|
}
|
|
315
|
-
let
|
|
316
|
-
if ($[
|
|
317
|
-
|
|
318
|
-
children: [
|
|
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
|
-
$[
|
|
326
|
-
$[
|
|
348
|
+
$[42] = navigation.goBack;
|
|
349
|
+
$[43] = t17;
|
|
327
350
|
} else {
|
|
328
|
-
|
|
351
|
+
t17 = $[43];
|
|
329
352
|
}
|
|
330
|
-
let
|
|
331
|
-
if ($[
|
|
332
|
-
|
|
353
|
+
let t18;
|
|
354
|
+
if ($[44] !== styles.container || $[45] !== t17) {
|
|
355
|
+
t18 = /*#__PURE__*/_jsx(View, {
|
|
333
356
|
style: styles.container,
|
|
334
|
-
children:
|
|
357
|
+
children: t17
|
|
335
358
|
});
|
|
336
|
-
$[
|
|
337
|
-
$[
|
|
338
|
-
$[
|
|
359
|
+
$[44] = styles.container;
|
|
360
|
+
$[45] = t17;
|
|
361
|
+
$[46] = t18;
|
|
339
362
|
} else {
|
|
340
|
-
|
|
363
|
+
t18 = $[46];
|
|
341
364
|
}
|
|
342
|
-
return
|
|
365
|
+
return t18;
|
|
343
366
|
}
|
|
344
|
-
let
|
|
345
|
-
if ($[
|
|
346
|
-
|
|
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(
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
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
|
-
$[
|
|
367
|
-
$[
|
|
368
|
-
$[
|
|
369
|
-
$[
|
|
370
|
-
$[
|
|
371
|
-
$[
|
|
372
|
-
$[
|
|
373
|
-
$[
|
|
374
|
-
$[
|
|
375
|
-
$[
|
|
376
|
-
$[
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
379
|
-
|
|
380
|
-
|
|
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
|
|
383
|
-
if ($[
|
|
384
|
-
|
|
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
|
-
$[
|
|
389
|
-
$[
|
|
390
|
-
$[
|
|
451
|
+
$[63] = handleReturnToBottom;
|
|
452
|
+
$[64] = showJumpToBottomButton;
|
|
453
|
+
$[65] = t16;
|
|
391
454
|
} else {
|
|
392
|
-
|
|
455
|
+
t16 = $[65];
|
|
393
456
|
}
|
|
394
|
-
let
|
|
395
|
-
if ($[
|
|
396
|
-
|
|
397
|
-
$[
|
|
398
|
-
$[
|
|
457
|
+
let t17;
|
|
458
|
+
if ($[66] !== noMessages) {
|
|
459
|
+
t17 = !noMessages && /*#__PURE__*/_jsx(TypingIndicator, {});
|
|
460
|
+
$[66] = noMessages;
|
|
461
|
+
$[67] = t17;
|
|
399
462
|
} else {
|
|
400
|
-
|
|
463
|
+
t17 = $[67];
|
|
401
464
|
}
|
|
402
|
-
let
|
|
403
|
-
if ($[
|
|
404
|
-
|
|
405
|
-
$[
|
|
406
|
-
$[
|
|
465
|
+
let t18;
|
|
466
|
+
if ($[68] !== showLeaderDisabledReplyBanner) {
|
|
467
|
+
t18 = showLeaderDisabledReplyBanner && /*#__PURE__*/_jsx(LeaderMessagesDisabledBanner, {});
|
|
468
|
+
$[68] = showLeaderDisabledReplyBanner;
|
|
469
|
+
$[69] = t18;
|
|
407
470
|
} else {
|
|
408
|
-
|
|
471
|
+
t18 = $[69];
|
|
409
472
|
}
|
|
410
|
-
let
|
|
411
|
-
if ($[
|
|
412
|
-
|
|
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
|
-
$[
|
|
421
|
-
$[
|
|
422
|
-
$[
|
|
423
|
-
$[
|
|
424
|
-
$[
|
|
425
|
-
$[
|
|
426
|
-
$[
|
|
427
|
-
} else {
|
|
428
|
-
|
|
429
|
-
}
|
|
430
|
-
let
|
|
431
|
-
if ($[
|
|
432
|
-
|
|
433
|
-
children: [
|
|
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
|
-
$[
|
|
436
|
-
$[
|
|
437
|
-
$[
|
|
438
|
-
$[
|
|
439
|
-
$[
|
|
440
|
-
$[
|
|
441
|
-
} else {
|
|
442
|
-
|
|
443
|
-
}
|
|
444
|
-
let
|
|
445
|
-
if ($[
|
|
446
|
-
|
|
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:
|
|
511
|
+
children: t20
|
|
449
512
|
});
|
|
450
|
-
$[
|
|
451
|
-
$[
|
|
452
|
-
$[
|
|
513
|
+
$[83] = styles.container;
|
|
514
|
+
$[84] = t20;
|
|
515
|
+
$[85] = t21;
|
|
453
516
|
} else {
|
|
454
|
-
|
|
517
|
+
t21 = $[85];
|
|
455
518
|
}
|
|
456
|
-
return
|
|
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(
|
|
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
|
|
970
|
+
function _temp2(r) {
|
|
790
971
|
return r.name === "Conversations";
|
|
791
972
|
}
|
|
792
973
|
//# sourceMappingURL=conversation_screen.js.map
|