@planningcenter/chat-react-native 4.1.0 → 4.1.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.d.ts +3 -2
- package/build/components/conversation/message.d.ts.map +1 -1
- package/build/components/conversation/message.js +23 -22
- package/build/components/conversation/message.js.map +1 -1
- package/build/components/conversation/message_list.d.ts +21 -0
- package/build/components/conversation/message_list.d.ts.map +1 -0
- package/build/components/conversation/message_list.js +273 -0
- package/build/components/conversation/message_list.js.map +1 -0
- package/build/components/conversation/message_read_receipts.d.ts +2 -4
- package/build/components/conversation/message_read_receipts.d.ts.map +1 -1
- package/build/components/conversation/message_read_receipts.js +2 -3
- package/build/components/conversation/message_read_receipts.js.map +1 -1
- package/build/components/conversation/reply_shadow_message.d.ts +2 -1
- package/build/components/conversation/reply_shadow_message.d.ts.map +1 -1
- package/build/components/conversation/reply_shadow_message.js +47 -46
- package/build/components/conversation/reply_shadow_message.js.map +1 -1
- package/build/contexts/api_provider.d.ts.map +1 -1
- package/build/contexts/api_provider.js +12 -1
- package/build/contexts/api_provider.js.map +1 -1
- package/build/hooks/use_conversation_messages.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages.js +40 -28
- 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 +6 -1
- package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
- package/build/hooks/use_features.d.ts +16 -0
- package/build/hooks/use_features.d.ts.map +1 -1
- package/build/hooks/use_features.js +43 -47
- package/build/hooks/use_features.js.map +1 -1
- package/build/hooks/use_message_create_or_update.d.ts +99 -4
- package/build/hooks/use_message_create_or_update.d.ts.map +1 -1
- package/build/hooks/use_message_create_or_update.js +47 -6
- package/build/hooks/use_message_create_or_update.js.map +1 -1
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +184 -365
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/conversations/components/search_list_header_component.d.ts +2 -0
- package/build/screens/conversations/components/search_list_header_component.d.ts.map +1 -0
- package/build/screens/conversations/components/search_list_header_component.js +496 -0
- package/build/screens/conversations/components/search_list_header_component.js.map +1 -0
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +28 -16
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/types/resources/message.d.ts +2 -0
- 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 +1 -0
- package/build/utils/cache/messages_cache.d.ts.map +1 -1
- package/build/utils/cache/messages_cache.js +14 -7
- package/build/utils/cache/messages_cache.js.map +1 -1
- package/build/utils/cache/optimistically_create_message.d.ts +2 -1
- package/build/utils/cache/optimistically_create_message.d.ts.map +1 -1
- package/build/utils/cache/optimistically_create_message.js +4 -2
- 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 +9 -5
- package/build/utils/client/transform_response.js.map +1 -1
- package/build/utils/group_messages.d.ts +1 -0
- package/build/utils/group_messages.d.ts.map +1 -1
- package/build/utils/group_messages.js +10 -1
- 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 +1 -0
- package/build/utils/jolt/transform_message_event_data_to_message_resource.js.map +1 -1
- package/build/utils/replace_equal_by_id.d.ts +6 -0
- package/build/utils/replace_equal_by_id.d.ts.map +1 -0
- package/build/utils/replace_equal_by_id.js +41 -0
- package/build/utils/replace_equal_by_id.js.map +1 -0
- 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/build/utils/time.d.ts +1 -0
- package/build/utils/time.d.ts.map +1 -1
- package/build/utils/time.js +1 -0
- package/build/utils/time.js.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/hooks/use_features.test.ts +61 -0
- package/src/components/conversation/__tests__/message_list.test.tsx +271 -0
- package/src/components/conversation/__tests__/reply_shadow_message.test.tsx +119 -0
- package/src/components/conversation/message.tsx +15 -18
- package/src/components/conversation/message_list.tsx +157 -0
- package/src/components/conversation/message_read_receipts.tsx +3 -5
- package/src/components/conversation/reply_shadow_message.tsx +9 -7
- package/src/contexts/api_provider.tsx +4 -0
- package/src/hooks/__tests__/use_message_create_or_update.test.tsx +110 -0
- package/src/hooks/use_conversation_messages.ts +5 -1
- package/src/hooks/use_conversation_messages_jolt_events.ts +7 -0
- package/src/hooks/use_features.ts +26 -14
- package/src/hooks/use_message_create_or_update.ts +29 -16
- package/src/screens/conversation_screen.tsx +11 -104
- package/src/screens/conversations/components/search_list_header_component.tsx +291 -0
- package/src/screens/conversations/conversations_screen.tsx +6 -1
- package/src/types/resources/message.ts +2 -0
- package/src/utils/__tests__/group_messages.test.ts +48 -0
- package/src/utils/__tests__/replace_equal_by_id.test.ts +73 -0
- package/src/utils/cache/__tests__/messages_cache.test.ts +89 -0
- package/src/utils/cache/__tests__/messages_cache_reply_roots.test.ts +70 -0
- package/src/utils/cache/messages_cache.ts +27 -11
- package/src/utils/cache/optimistically_create_message.ts +3 -0
- package/src/utils/client/__tests__/transform_response.test.ts +62 -0
- package/src/utils/client/transform_response.ts +7 -5
- package/src/utils/group_messages.ts +18 -1
- package/src/utils/jolt/transform_message_event_data_to_message_resource.ts +1 -0
- package/src/utils/replace_equal_by_id.ts +42 -0
- package/src/utils/request/messages_data_options.ts +2 -1
- package/src/utils/time.ts +1 -0
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { date as formatDate } from '@planningcenter/datetime-fmt';
|
|
3
2
|
import { HeaderTitle, PlatformPressable } from '@react-navigation/elements';
|
|
4
3
|
import { CommonActions, useNavigation, useTheme as useNavigationTheme, useRoute } from '@react-navigation/native';
|
|
5
4
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
6
|
-
import {
|
|
5
|
+
import { Platform, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
7
6
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
8
|
-
import { Badge, Icon
|
|
7
|
+
import { Badge, Icon } from '../components';
|
|
9
8
|
import { ConversationStartBanner } from '../components/conversation/conversation_start_banner';
|
|
10
9
|
import { JumpToBottomButton } from '../components/conversation/jump_to_bottom_button';
|
|
11
|
-
import { Message } from '../components/conversation/message';
|
|
12
10
|
import { MessageForm } from '../components/conversation/message_form';
|
|
11
|
+
import { MessageList } from '../components/conversation/message_list';
|
|
13
12
|
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';
|
|
16
13
|
import { TypingIndicator } from '../components/conversation/typing_indicator';
|
|
17
14
|
import { KeyboardView } from '../components/display/keyboard_view';
|
|
18
15
|
import { useHeaderSlotReserve } from '../components/display/platform_modal_header_buttons';
|
|
19
16
|
import BlankState from '../components/primitive/blank_state_primitive';
|
|
20
17
|
import { ConversationContextProvider } from '../contexts/conversation_context';
|
|
21
|
-
import { useTheme } from '../hooks';
|
|
22
18
|
import { useMessageAvailableMembersAction } from '../hooks/direct_messages/use_message_available_members_action';
|
|
23
19
|
import { useConversation } from '../hooks/use_conversation';
|
|
24
20
|
import { useConversationJoltEvents } from '../hooks/use_conversation_jolt_events';
|
|
@@ -28,10 +24,6 @@ import { useMarkLatestMessageRead } from '../hooks/use_mark_latest_message_read'
|
|
|
28
24
|
import { analyticsEvents, normalizeAnalyticsMetadata, usePublishProductAnalyticsEvent } from '../hooks/use_product_analytics';
|
|
29
25
|
import { useRestAwayFromDismissEdge } from '../hooks/use_rest_away_from_dismiss_edge';
|
|
30
26
|
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';
|
|
35
27
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
36
28
|
export function ConversationScreen(t0) {
|
|
37
29
|
const $ = _c(13);
|
|
@@ -104,7 +96,7 @@ export function ConversationScreen(t0) {
|
|
|
104
96
|
return t6;
|
|
105
97
|
}
|
|
106
98
|
function ConversationScreenContent(t0) {
|
|
107
|
-
const $ = _c(
|
|
99
|
+
const $ = _c(80);
|
|
108
100
|
const {
|
|
109
101
|
route
|
|
110
102
|
} = t0;
|
|
@@ -175,21 +167,7 @@ function ConversationScreenContent(t0) {
|
|
|
175
167
|
t4 = $[9];
|
|
176
168
|
}
|
|
177
169
|
useMarkLatestMessageRead(t4);
|
|
178
|
-
const
|
|
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;
|
|
170
|
+
const noMessages = messages.length === 0;
|
|
193
171
|
const {
|
|
194
172
|
repliesDisabled,
|
|
195
173
|
memberAbility,
|
|
@@ -198,58 +176,57 @@ function ConversationScreenContent(t0) {
|
|
|
198
176
|
} = conversation;
|
|
199
177
|
const canReply = memberAbility?.canReply;
|
|
200
178
|
const showLeaderDisabledReplyBanner = canReply && repliesDisabled;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
$[
|
|
208
|
-
$[17] = t8;
|
|
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;
|
|
209
186
|
} else {
|
|
210
|
-
|
|
187
|
+
t6 = $[14];
|
|
211
188
|
}
|
|
212
|
-
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
189
|
+
t5 = messages.find(t6);
|
|
190
|
+
$[10] = editing_message_id;
|
|
191
|
+
$[11] = messages;
|
|
192
|
+
$[12] = t5;
|
|
216
193
|
} else {
|
|
217
|
-
|
|
194
|
+
t5 = $[12];
|
|
218
195
|
}
|
|
219
|
-
const currentlyEditingMessage =
|
|
220
|
-
let
|
|
221
|
-
if ($[
|
|
222
|
-
|
|
223
|
-
$[
|
|
224
|
-
$[
|
|
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;
|
|
225
202
|
} else {
|
|
226
|
-
|
|
203
|
+
t6 = $[16];
|
|
227
204
|
}
|
|
228
|
-
const replyRootAuthorFirstName =
|
|
205
|
+
const replyRootAuthorFirstName = t6;
|
|
229
206
|
const replyHeaderTitle = replyRootAuthorFirstName ? `Reply to ${replyRootAuthorFirstName}` : "Reply";
|
|
230
207
|
const muted = conversation.conversationMembership?.muted ?? conversation.muted;
|
|
231
208
|
const listRef = useRef(null);
|
|
232
209
|
const [showJumpToBottomButton, setShowJumpToBottomButton] = useState(false);
|
|
233
|
-
let
|
|
234
|
-
if ($[
|
|
235
|
-
|
|
210
|
+
let t7;
|
|
211
|
+
if ($[17] === Symbol.for("react.memo_cache_sentinel")) {
|
|
212
|
+
t7 = event => {
|
|
236
213
|
const offsetY = event.nativeEvent.contentOffset.y;
|
|
237
214
|
setShowJumpToBottomButton(offsetY > 200);
|
|
238
215
|
};
|
|
239
|
-
$[
|
|
216
|
+
$[17] = t7;
|
|
240
217
|
} else {
|
|
241
|
-
|
|
218
|
+
t7 = $[17];
|
|
242
219
|
}
|
|
243
|
-
const trackScroll =
|
|
244
|
-
let
|
|
245
|
-
if ($[
|
|
246
|
-
|
|
220
|
+
const trackScroll = t7;
|
|
221
|
+
let t8;
|
|
222
|
+
if ($[18] === Symbol.for("react.memo_cache_sentinel")) {
|
|
223
|
+
t8 = {
|
|
247
224
|
listRef,
|
|
248
225
|
enabled: Platform.OS === "ios"
|
|
249
226
|
};
|
|
250
|
-
$[
|
|
227
|
+
$[18] = t8;
|
|
251
228
|
} else {
|
|
252
|
-
|
|
229
|
+
t8 = $[18];
|
|
253
230
|
}
|
|
254
231
|
const {
|
|
255
232
|
restOffset,
|
|
@@ -257,23 +234,23 @@ function ConversationScreenContent(t0) {
|
|
|
257
234
|
onContentSizeChange,
|
|
258
235
|
onMomentumScrollEnd,
|
|
259
236
|
onScrollEndDrag
|
|
260
|
-
} = useRestAwayFromDismissEdge(
|
|
261
|
-
let
|
|
262
|
-
if ($[
|
|
263
|
-
|
|
237
|
+
} = useRestAwayFromDismissEdge(t8);
|
|
238
|
+
let t9;
|
|
239
|
+
if ($[19] !== restOffset) {
|
|
240
|
+
t9 = () => {
|
|
264
241
|
listRef.current?.scrollToOffset({
|
|
265
242
|
offset: restOffset
|
|
266
243
|
});
|
|
267
244
|
};
|
|
268
|
-
$[
|
|
269
|
-
$[
|
|
245
|
+
$[19] = restOffset;
|
|
246
|
+
$[20] = t9;
|
|
270
247
|
} else {
|
|
271
|
-
|
|
248
|
+
t9 = $[20];
|
|
272
249
|
}
|
|
273
|
-
const handleReturnToBottom =
|
|
274
|
-
let
|
|
275
|
-
if ($[
|
|
276
|
-
|
|
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 = () => {
|
|
277
254
|
if (reply_root_id) {
|
|
278
255
|
navigation.setParams({
|
|
279
256
|
title: replyHeaderTitle
|
|
@@ -287,192 +264,152 @@ function ConversationScreenContent(t0) {
|
|
|
287
264
|
});
|
|
288
265
|
}
|
|
289
266
|
};
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
293
|
-
$[
|
|
294
|
-
$[
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
$[
|
|
298
|
-
} else {
|
|
299
|
-
|
|
300
|
-
}
|
|
301
|
-
const
|
|
302
|
-
let
|
|
303
|
-
if ($[
|
|
304
|
-
|
|
305
|
-
$[
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
$[
|
|
313
|
-
} else {
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
useEffect(
|
|
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);
|
|
317
294
|
if (!conversation || conversation.deleted) {
|
|
318
|
-
let
|
|
319
|
-
if ($[
|
|
320
|
-
|
|
295
|
+
let t13;
|
|
296
|
+
if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
|
|
297
|
+
t13 = /*#__PURE__*/_jsx(BlankState.Imagery, {
|
|
321
298
|
name: "general.outlinedTextMessage"
|
|
322
299
|
});
|
|
323
|
-
$[
|
|
300
|
+
$[37] = t13;
|
|
324
301
|
} else {
|
|
325
|
-
|
|
302
|
+
t13 = $[37];
|
|
326
303
|
}
|
|
327
|
-
let
|
|
328
|
-
if ($[
|
|
329
|
-
|
|
304
|
+
let t14;
|
|
305
|
+
if ($[38] === Symbol.for("react.memo_cache_sentinel")) {
|
|
306
|
+
t14 = /*#__PURE__*/_jsx(BlankState.Content, {
|
|
330
307
|
children: /*#__PURE__*/_jsx(BlankState.Heading, {
|
|
331
308
|
children: "This conversation has been deleted"
|
|
332
309
|
})
|
|
333
310
|
});
|
|
334
|
-
$[
|
|
311
|
+
$[38] = t14;
|
|
335
312
|
} else {
|
|
336
|
-
|
|
313
|
+
t14 = $[38];
|
|
337
314
|
}
|
|
338
|
-
let
|
|
339
|
-
if ($[
|
|
340
|
-
|
|
341
|
-
children: [
|
|
315
|
+
let t15;
|
|
316
|
+
if ($[39] !== navigation.goBack) {
|
|
317
|
+
t15 = /*#__PURE__*/_jsxs(BlankState.Root, {
|
|
318
|
+
children: [t13, t14, /*#__PURE__*/_jsx(BlankState.Button, {
|
|
342
319
|
onPress: navigation.goBack,
|
|
343
320
|
title: "Back to conversations",
|
|
344
321
|
accessibilityHint: "Navigates back to the conversations list",
|
|
345
322
|
accessibilityRole: "link"
|
|
346
323
|
})]
|
|
347
324
|
});
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
325
|
+
$[39] = navigation.goBack;
|
|
326
|
+
$[40] = t15;
|
|
350
327
|
} else {
|
|
351
|
-
|
|
328
|
+
t15 = $[40];
|
|
352
329
|
}
|
|
353
|
-
let
|
|
354
|
-
if ($[
|
|
355
|
-
|
|
330
|
+
let t16;
|
|
331
|
+
if ($[41] !== styles.container || $[42] !== t15) {
|
|
332
|
+
t16 = /*#__PURE__*/_jsx(View, {
|
|
356
333
|
style: styles.container,
|
|
357
|
-
children:
|
|
334
|
+
children: t15
|
|
358
335
|
});
|
|
359
|
-
$[
|
|
360
|
-
$[
|
|
361
|
-
$[
|
|
336
|
+
$[41] = styles.container;
|
|
337
|
+
$[42] = t15;
|
|
338
|
+
$[43] = t16;
|
|
362
339
|
} else {
|
|
363
|
-
|
|
340
|
+
t16 = $[43];
|
|
364
341
|
}
|
|
365
|
-
return
|
|
342
|
+
return t16;
|
|
366
343
|
}
|
|
367
|
-
let
|
|
368
|
-
if ($[
|
|
369
|
-
|
|
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, {
|
|
370
347
|
style: styles.emptyState,
|
|
371
348
|
children: /*#__PURE__*/_jsx(ConversationStartBanner, {
|
|
372
349
|
conversation: conversation,
|
|
373
350
|
hasMessages: false
|
|
374
351
|
})
|
|
375
|
-
}) : /*#__PURE__*/_jsx(
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
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(),
|
|
381
360
|
onScroll: trackScroll,
|
|
382
361
|
onLayout: onLayout,
|
|
383
362
|
onContentSizeChange: onContentSizeChange,
|
|
384
363
|
onScrollEndDrag: onScrollEndDrag,
|
|
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
|
-
})
|
|
364
|
+
onMomentumScrollEnd: onMomentumScrollEnd
|
|
425
365
|
});
|
|
426
|
-
$[
|
|
427
|
-
$[
|
|
428
|
-
$[
|
|
429
|
-
$[
|
|
430
|
-
$[
|
|
431
|
-
$[
|
|
432
|
-
$[
|
|
433
|
-
$[
|
|
434
|
-
$[
|
|
435
|
-
$[
|
|
436
|
-
$[
|
|
437
|
-
$[
|
|
438
|
-
$[
|
|
439
|
-
|
|
440
|
-
$[
|
|
441
|
-
$[62] = t15;
|
|
442
|
-
} else {
|
|
443
|
-
t15 = $[62];
|
|
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];
|
|
444
381
|
}
|
|
445
|
-
let
|
|
446
|
-
if ($[
|
|
447
|
-
|
|
382
|
+
let t14;
|
|
383
|
+
if ($[57] !== handleReturnToBottom || $[58] !== showJumpToBottomButton) {
|
|
384
|
+
t14 = /*#__PURE__*/_jsx(JumpToBottomButton, {
|
|
448
385
|
onPress: handleReturnToBottom,
|
|
449
386
|
visible: showJumpToBottomButton
|
|
450
387
|
});
|
|
451
|
-
$[
|
|
452
|
-
$[
|
|
453
|
-
$[
|
|
388
|
+
$[57] = handleReturnToBottom;
|
|
389
|
+
$[58] = showJumpToBottomButton;
|
|
390
|
+
$[59] = t14;
|
|
454
391
|
} else {
|
|
455
|
-
|
|
392
|
+
t14 = $[59];
|
|
456
393
|
}
|
|
457
|
-
let
|
|
458
|
-
if ($[
|
|
459
|
-
|
|
460
|
-
$[
|
|
461
|
-
$[
|
|
394
|
+
let t15;
|
|
395
|
+
if ($[60] !== noMessages) {
|
|
396
|
+
t15 = !noMessages && /*#__PURE__*/_jsx(TypingIndicator, {});
|
|
397
|
+
$[60] = noMessages;
|
|
398
|
+
$[61] = t15;
|
|
462
399
|
} else {
|
|
463
|
-
|
|
400
|
+
t15 = $[61];
|
|
464
401
|
}
|
|
465
|
-
let
|
|
466
|
-
if ($[
|
|
467
|
-
|
|
468
|
-
$[
|
|
469
|
-
$[
|
|
402
|
+
let t16;
|
|
403
|
+
if ($[62] !== showLeaderDisabledReplyBanner) {
|
|
404
|
+
t16 = showLeaderDisabledReplyBanner && /*#__PURE__*/_jsx(LeaderMessagesDisabledBanner, {});
|
|
405
|
+
$[62] = showLeaderDisabledReplyBanner;
|
|
406
|
+
$[63] = t16;
|
|
470
407
|
} else {
|
|
471
|
-
|
|
408
|
+
t16 = $[63];
|
|
472
409
|
}
|
|
473
|
-
let
|
|
474
|
-
if ($[
|
|
475
|
-
|
|
410
|
+
let t17;
|
|
411
|
+
if ($[64] !== canReply || $[65] !== conversation || $[66] !== currentlyEditingMessage || $[67] !== markHandledByMessageForm || $[68] !== replyRootAuthorFirstName || $[69] !== reply_root_id) {
|
|
412
|
+
t17 = /*#__PURE__*/_jsx(ConversationBottomBar, {
|
|
476
413
|
conversation: conversation,
|
|
477
414
|
canReply: canReply,
|
|
478
415
|
replyRootAuthorFirstName: replyRootAuthorFirstName,
|
|
@@ -480,46 +417,43 @@ function ConversationScreenContent(t0) {
|
|
|
480
417
|
currentlyEditingMessage: currentlyEditingMessage,
|
|
481
418
|
onFlaggedInMessageForm: markHandledByMessageForm
|
|
482
419
|
});
|
|
483
|
-
$[
|
|
484
|
-
$[
|
|
485
|
-
$[
|
|
486
|
-
$[
|
|
487
|
-
$[
|
|
488
|
-
$[
|
|
489
|
-
$[
|
|
490
|
-
} else {
|
|
491
|
-
|
|
492
|
-
}
|
|
493
|
-
let
|
|
494
|
-
if ($[
|
|
495
|
-
|
|
496
|
-
children: [
|
|
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]
|
|
497
434
|
});
|
|
498
|
-
$[
|
|
499
|
-
$[
|
|
500
|
-
$[
|
|
501
|
-
$[
|
|
502
|
-
$[
|
|
503
|
-
$[
|
|
504
|
-
} else {
|
|
505
|
-
|
|
506
|
-
}
|
|
507
|
-
let
|
|
508
|
-
if ($[
|
|
509
|
-
|
|
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, {
|
|
510
447
|
style: styles.container,
|
|
511
|
-
children:
|
|
448
|
+
children: t18
|
|
512
449
|
});
|
|
513
|
-
$[
|
|
514
|
-
$[
|
|
515
|
-
$[
|
|
450
|
+
$[77] = styles.container;
|
|
451
|
+
$[78] = t18;
|
|
452
|
+
$[79] = t19;
|
|
516
453
|
} else {
|
|
517
|
-
|
|
454
|
+
t19 = $[79];
|
|
518
455
|
}
|
|
519
|
-
return
|
|
520
|
-
}
|
|
521
|
-
function _temp(item) {
|
|
522
|
-
return item.id;
|
|
456
|
+
return t19;
|
|
523
457
|
}
|
|
524
458
|
function ConversationBottomBar(t0) {
|
|
525
459
|
const $ = _c(15);
|
|
@@ -600,115 +534,6 @@ function ConversationBottomBar(t0) {
|
|
|
600
534
|
}
|
|
601
535
|
return t6;
|
|
602
536
|
}
|
|
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
|
-
};
|
|
712
537
|
export const ConversationScreenTitle = t0 => {
|
|
713
538
|
const $ = _c(29);
|
|
714
539
|
const {
|
|
@@ -903,12 +728,6 @@ const useStyles = () => {
|
|
|
903
728
|
emptyState: {
|
|
904
729
|
flex: 1,
|
|
905
730
|
justifyContent: "center"
|
|
906
|
-
},
|
|
907
|
-
listContainer: {
|
|
908
|
-
paddingVertical: 12
|
|
909
|
-
},
|
|
910
|
-
listHeader: {
|
|
911
|
-
height: 16
|
|
912
731
|
}
|
|
913
732
|
});
|
|
914
733
|
$[0] = bottom;
|
|
@@ -934,7 +753,7 @@ const useEnsureConversationsRouteExists = () => {
|
|
|
934
753
|
t0 = () => {
|
|
935
754
|
const navigationState = navigation.getState();
|
|
936
755
|
const routes = navigationState?.routes || [];
|
|
937
|
-
const conversationsRoute = routes.find(
|
|
756
|
+
const conversationsRoute = routes.find(_temp);
|
|
938
757
|
if (conversationsRoute) {
|
|
939
758
|
return;
|
|
940
759
|
}
|
|
@@ -967,7 +786,7 @@ const useEnsureConversationsRouteExists = () => {
|
|
|
967
786
|
}
|
|
968
787
|
useEffect(t0, t2);
|
|
969
788
|
};
|
|
970
|
-
function
|
|
789
|
+
function _temp(r) {
|
|
971
790
|
return r.name === "Conversations";
|
|
972
791
|
}
|
|
973
792
|
//# sourceMappingURL=conversation_screen.js.map
|