@planningcenter/chat-react-native 4.2.1-qa-staging.9 → 4.2.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_form.d.ts +1 -2
- package/build/components/conversation/message_form.d.ts.map +1 -1
- package/build/components/conversation/message_form.js +370 -167
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversation/message_list.d.ts +2 -5
- package/build/components/conversation/message_list.d.ts.map +1 -1
- package/build/components/conversation/message_list.js +67 -187
- package/build/components/conversation/message_list.js.map +1 -1
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +3 -4
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -1
- package/build/hooks/index.d.ts +0 -1
- package/build/hooks/index.d.ts.map +1 -1
- package/build/hooks/index.js +0 -1
- package/build/hooks/index.js.map +1 -1
- package/build/hooks/use_conversation_messages.d.ts +5 -14
- package/build/hooks/use_conversation_messages.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages.js +42 -218
- 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 +42 -58
- package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
- package/build/hooks/use_features.d.ts +1 -2
- package/build/hooks/use_features.d.ts.map +1 -1
- package/build/hooks/use_features.js +1 -2
- package/build/hooks/use_features.js.map +1 -1
- package/build/hooks/use_mark_latest_message_read.d.ts +1 -2
- package/build/hooks/use_mark_latest_message_read.d.ts.map +1 -1
- package/build/hooks/use_mark_latest_message_read.js +3 -4
- package/build/hooks/use_mark_latest_message_read.js.map +1 -1
- package/build/hooks/use_read_receipts.d.ts +3 -4
- package/build/hooks/use_read_receipts.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.d.ts +6 -10
- package/build/hooks/use_suspense_api.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.js +63 -83
- package/build/hooks/use_suspense_api.js.map +1 -1
- package/build/screens/conversation_new/components/services_form.js +8 -9
- package/build/screens/conversation_new/components/services_form.js.map +1 -1
- package/build/screens/conversation_screen.d.ts +0 -1
- package/build/screens/conversation_screen.d.ts.map +1 -1
- package/build/screens/conversation_screen.js +203 -305
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/message_actions_screen.d.ts.map +1 -1
- package/build/screens/message_actions_screen.js +92 -103
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/screens/notification_settings/hooks/groups.d.ts +3 -4
- package/build/screens/notification_settings/hooks/groups.d.ts.map +1 -1
- package/build/types/api_primitives.d.ts +0 -1
- package/build/types/api_primitives.d.ts.map +1 -1
- package/build/types/api_primitives.js.map +1 -1
- package/build/types/resources/member.d.ts +0 -1
- package/build/types/resources/member.d.ts.map +1 -1
- package/build/types/resources/member.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 +1 -37
- package/build/utils/cache/messages_cache.js.map +1 -1
- package/build/utils/client/types.d.ts +0 -1
- package/build/utils/client/types.d.ts.map +1 -1
- package/build/utils/client/types.js.map +1 -1
- package/build/utils/group_messages.js +1 -4
- package/build/utils/group_messages.js.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/hooks/use_features.test.ts +2 -10
- package/src/__utils__/query_client.ts +0 -3
- package/src/components/conversation/message_form.tsx +3 -31
- package/src/components/conversation/message_list.tsx +4 -88
- package/src/hooks/__tests__/use_message_create_or_update.test.tsx +7 -2
- package/src/hooks/index.ts +0 -1
- package/src/hooks/use_conversation_messages.ts +17 -103
- package/src/hooks/use_conversation_messages_jolt_events.ts +2 -12
- package/src/hooks/use_features.ts +2 -3
- package/src/hooks/use_mark_latest_message_read.ts +3 -4
- package/src/hooks/use_suspense_api.ts +6 -14
- package/src/screens/conversation_new/components/services_form.tsx +5 -5
- package/src/screens/conversation_screen.tsx +13 -62
- package/src/screens/message_actions_screen.tsx +1 -12
- package/src/types/api_primitives.ts +0 -1
- package/src/types/resources/member.ts +0 -1
- package/src/utils/__tests__/group_messages.test.ts +0 -29
- package/src/utils/cache/__tests__/messages_cache.test.ts +1 -2
- package/src/utils/cache/__tests__/messages_cache_reply_roots.test.ts +2 -3
- package/src/utils/cache/messages_cache.ts +1 -45
- package/src/utils/client/types.ts +0 -1
- package/src/utils/group_messages.ts +1 -4
- package/build/components/conversation/missing_message.d.ts +0 -2
- package/build/components/conversation/missing_message.d.ts.map +0 -1
- package/build/components/conversation/missing_message.js +0 -139
- package/build/components/conversation/missing_message.js.map +0 -1
- package/build/hooks/use_direct_message_eligibility.d.ts +0 -14
- package/build/hooks/use_direct_message_eligibility.d.ts.map +0 -1
- package/build/hooks/use_direct_message_eligibility.js +0 -87
- package/build/hooks/use_direct_message_eligibility.js.map +0 -1
- package/build/utils/cache/messages_window.d.ts +0 -11
- package/build/utils/cache/messages_window.d.ts.map +0 -1
- package/build/utils/cache/messages_window.js +0 -51
- package/build/utils/cache/messages_window.js.map +0 -1
- package/src/__tests__/hooks/use_direct_message_eligibility.test.tsx +0 -83
- package/src/__tests__/screens/conversation_new/components/services_form.test.tsx +0 -91
- package/src/components/conversation/missing_message.tsx +0 -66
- package/src/hooks/__tests__/use_conversation_messages.test.tsx +0 -333
- package/src/hooks/__tests__/use_conversation_messages_jolt_events.test.tsx +0 -87
- package/src/hooks/__tests__/use_mark_latest_message_read.test.tsx +0 -33
- package/src/hooks/use_direct_message_eligibility.ts +0 -40
- package/src/utils/cache/__tests__/messages_cache_deletion.test.ts +0 -97
- package/src/utils/cache/__tests__/messages_window.test.ts +0 -78
- package/src/utils/cache/messages_window.ts +0 -55
|
@@ -13,9 +13,8 @@ interface MessagesFormRootProps extends ViewProps {
|
|
|
13
13
|
replyRootId?: string | null;
|
|
14
14
|
replyRootAuthorFirstName?: string | null;
|
|
15
15
|
onFlaggedInMessageForm?: (id: string) => void;
|
|
16
|
-
onBeforeSubmit?: () => void | Promise<void>;
|
|
17
16
|
}
|
|
18
|
-
declare function MessageFormRoot({ conversation, currentlyEditingMessage, children, replyRootId, replyRootAuthorFirstName, onFlaggedInMessageForm,
|
|
17
|
+
declare function MessageFormRoot({ conversation, currentlyEditingMessage, children, replyRootId, replyRootAuthorFirstName, onFlaggedInMessageForm, }: MessagesFormRootProps): import("react/jsx-runtime").JSX.Element;
|
|
19
18
|
declare function MessageFormInput(): import("react/jsx-runtime").JSX.Element;
|
|
20
19
|
declare function MessageFormSubmitBtn(): import("react/jsx-runtime").JSX.Element;
|
|
21
20
|
declare function MessageFormAttachmentPicker(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message_form.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message_form.tsx"],"names":[],"mappings":"AAEA,OAAO,EAQL,SAAS,EAEV,MAAM,cAAc,CAAA;AAiBrB,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"message_form.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/message_form.tsx"],"names":[],"mappings":"AAEA,OAAO,EAQL,SAAS,EAEV,MAAM,cAAc,CAAA;AAiBrB,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AA6BnE,eAAO,MAAM,WAAW;;;;;;CAOvB,CAAA;AAED,UAAU,qBAAsB,SAAQ,SAAS;IAC/C,YAAY,EAAE,oBAAoB,CAAA;IAClC,uBAAuB,CAAC,EAAE,eAAe,GAAG,IAAI,CAAA;IAChD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,wBAAwB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACxC,sBAAsB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9C;AAmCD,iBAAS,eAAe,CAAC,EACvB,YAAY,EACZ,uBAAuB,EACvB,QAAQ,EACR,WAAW,EACX,wBAAwB,EACxB,sBAAsB,GACvB,EAAE,qBAAqB,2CA6KvB;AAyID,iBAAS,gBAAgB,4CAyDxB;AAcD,iBAAS,oBAAoB,4CAgD5B;AAED,iBAAS,2BAA2B,mDAuHnC;AAED,iBAAS,mBAAmB,mDAkC3B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useNavigation, useTheme as useNavigationTheme, useRoute } from '@react-navigation/native';
|
|
3
|
-
import React, { useCallback, useContext, useEffect,
|
|
3
|
+
import React, { useCallback, useContext, useEffect, useState } from 'react';
|
|
4
4
|
import { Linking, Platform, Pressable, ScrollView, StyleSheet, TextInput, View, Keyboard } from 'react-native';
|
|
5
5
|
import LinearGradient from 'react-native-linear-gradient';
|
|
6
6
|
import { Heading, Icon, IconButton, Text, TextButton } from '../../components';
|
|
@@ -11,7 +11,7 @@ import { useBroadcastTypingStatus } from '../../hooks/use_broadcast_typing_statu
|
|
|
11
11
|
import { useChatConfiguration } from '../../hooks/use_chat_configuration';
|
|
12
12
|
import { useMessageCreateOrUpdate } from '../../hooks/use_message_create_or_update';
|
|
13
13
|
import { useMessageDraft } from '../../hooks/use_message_draft';
|
|
14
|
-
import {
|
|
14
|
+
import { MAX_FONT_SIZE_MULTIPLIER_LANDMARK, platformFontWeightMedium, platformPressedOpacityStyle } from '../../utils';
|
|
15
15
|
import { pickAttachmentPreviewKind } from '../../utils/attachment_kind';
|
|
16
16
|
import { canSubmitMessage } from '../../utils/can_submit_message';
|
|
17
17
|
import { isInputEditable } from '../../utils/is_input_editable';
|
|
@@ -48,15 +48,16 @@ const MessageFormContext = React.createContext({
|
|
|
48
48
|
const GIPHY_MAX_LENGTH = 50;
|
|
49
49
|
const MAX_MESSAGE_LENGTH = 5000;
|
|
50
50
|
const PLACEHOLDER_FONT_SCALE_THRESHOLD = 1.7;
|
|
51
|
-
function MessageFormRoot({
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
function MessageFormRoot(t0) {
|
|
52
|
+
const $ = _c(88);
|
|
53
|
+
const {
|
|
54
|
+
conversation,
|
|
55
|
+
currentlyEditingMessage,
|
|
56
|
+
children,
|
|
57
|
+
replyRootId,
|
|
58
|
+
replyRootAuthorFirstName,
|
|
59
|
+
onFlaggedInMessageForm
|
|
60
|
+
} = t0;
|
|
60
61
|
const {
|
|
61
62
|
giphyApiKey
|
|
62
63
|
} = useContext(ChatContext);
|
|
@@ -67,162 +68,295 @@ function MessageFormRoot({
|
|
|
67
68
|
saveDraft,
|
|
68
69
|
clearDraft
|
|
69
70
|
} = useMessageDraft();
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
let t1;
|
|
72
|
+
if ($[0] !== currentlyEditingMessage || $[1] !== draft?.text) {
|
|
73
|
+
t1 = () => currentlyEditingMessage ? "" : draft?.text || "";
|
|
74
|
+
$[0] = currentlyEditingMessage;
|
|
75
|
+
$[1] = draft?.text;
|
|
76
|
+
$[2] = t1;
|
|
77
|
+
} else {
|
|
78
|
+
t1 = $[2];
|
|
79
|
+
}
|
|
80
|
+
const [text, setText] = React.useState(t1);
|
|
74
81
|
const [usingGiphy, setUsingGiphy] = useState(false);
|
|
75
82
|
const navigation = useNavigation();
|
|
76
83
|
const route = useRoute();
|
|
84
|
+
const t2 = currentlyEditingMessage || undefined;
|
|
85
|
+
let t3;
|
|
86
|
+
if ($[3] !== conversation.id || $[4] !== replyRootId || $[5] !== t2) {
|
|
87
|
+
t3 = {
|
|
88
|
+
conversationId: conversation.id,
|
|
89
|
+
message: t2,
|
|
90
|
+
replyRootId
|
|
91
|
+
};
|
|
92
|
+
$[3] = conversation.id;
|
|
93
|
+
$[4] = replyRootId;
|
|
94
|
+
$[5] = t2;
|
|
95
|
+
$[6] = t3;
|
|
96
|
+
} else {
|
|
97
|
+
t3 = $[6];
|
|
98
|
+
}
|
|
77
99
|
const {
|
|
78
100
|
status,
|
|
79
101
|
isPending,
|
|
80
102
|
reset: resetMutation,
|
|
81
103
|
mutateAsync
|
|
82
|
-
} = useMessageCreateOrUpdate(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
104
|
+
} = useMessageCreateOrUpdate(t3);
|
|
105
|
+
const t4 = currentlyEditingMessage ? undefined : draft?.attachments;
|
|
106
|
+
let t5;
|
|
107
|
+
if ($[7] !== conversation.id || $[8] !== onFlaggedInMessageForm || $[9] !== t4) {
|
|
108
|
+
t5 = {
|
|
109
|
+
conversationId: conversation.id,
|
|
110
|
+
draftAttachments: t4,
|
|
111
|
+
onFlaggedInMessageForm
|
|
112
|
+
};
|
|
113
|
+
$[7] = conversation.id;
|
|
114
|
+
$[8] = onFlaggedInMessageForm;
|
|
115
|
+
$[9] = t4;
|
|
116
|
+
$[10] = t5;
|
|
117
|
+
} else {
|
|
118
|
+
t5 = $[10];
|
|
119
|
+
}
|
|
120
|
+
const attachmentUploader = useAttachmentUploader(t5);
|
|
92
121
|
const resetAttachmentUploader = attachmentUploader.reset;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
});
|
|
104
|
-
}, [resetAttachmentUploader, resetMutation, navigation, currentlyEditingMessage, clearDraft]);
|
|
105
|
-
useEffect(() => {
|
|
106
|
-
if (canGiphy && !usingGiphy && text.startsWith('/giphy ')) {
|
|
107
|
-
setUsingGiphy(true);
|
|
108
|
-
setText('');
|
|
109
|
-
}
|
|
110
|
-
}, [canGiphy, text, usingGiphy]);
|
|
111
|
-
useEffect(() => {
|
|
112
|
-
switch (status) {
|
|
113
|
-
case 'success':
|
|
114
|
-
reset();
|
|
115
|
-
break;
|
|
116
|
-
}
|
|
117
|
-
}, [reset, status]);
|
|
118
|
-
useEffect(() => {
|
|
119
|
-
if (route.params.clear_input) {
|
|
120
|
-
reset();
|
|
122
|
+
let t6;
|
|
123
|
+
if ($[11] !== clearDraft || $[12] !== currentlyEditingMessage || $[13] !== navigation || $[14] !== resetAttachmentUploader || $[15] !== resetMutation) {
|
|
124
|
+
t6 = () => {
|
|
125
|
+
resetAttachmentUploader();
|
|
126
|
+
resetMutation();
|
|
127
|
+
setText("");
|
|
128
|
+
setUsingGiphy(false);
|
|
129
|
+
if (!currentlyEditingMessage) {
|
|
130
|
+
clearDraft();
|
|
131
|
+
}
|
|
121
132
|
navigation.setParams({
|
|
122
|
-
|
|
123
|
-
clear_input: false
|
|
133
|
+
editing_message_id: null
|
|
124
134
|
});
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
135
|
+
};
|
|
136
|
+
$[11] = clearDraft;
|
|
137
|
+
$[12] = currentlyEditingMessage;
|
|
138
|
+
$[13] = navigation;
|
|
139
|
+
$[14] = resetAttachmentUploader;
|
|
140
|
+
$[15] = resetMutation;
|
|
141
|
+
$[16] = t6;
|
|
142
|
+
} else {
|
|
143
|
+
t6 = $[16];
|
|
144
|
+
}
|
|
145
|
+
const reset = t6;
|
|
146
|
+
let t7;
|
|
147
|
+
let t8;
|
|
148
|
+
if ($[17] !== canGiphy || $[18] !== text || $[19] !== usingGiphy) {
|
|
149
|
+
t7 = () => {
|
|
150
|
+
if (canGiphy && !usingGiphy && text.startsWith("/giphy ")) {
|
|
151
|
+
setUsingGiphy(true);
|
|
152
|
+
setText("");
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
t8 = [canGiphy, text, usingGiphy];
|
|
156
|
+
$[17] = canGiphy;
|
|
157
|
+
$[18] = text;
|
|
158
|
+
$[19] = usingGiphy;
|
|
159
|
+
$[20] = t7;
|
|
160
|
+
$[21] = t8;
|
|
161
|
+
} else {
|
|
162
|
+
t7 = $[20];
|
|
163
|
+
t8 = $[21];
|
|
164
|
+
}
|
|
165
|
+
useEffect(t7, t8);
|
|
166
|
+
let t10;
|
|
167
|
+
let t9;
|
|
168
|
+
if ($[22] !== reset || $[23] !== status) {
|
|
169
|
+
t9 = () => {
|
|
170
|
+
switch (status) {
|
|
171
|
+
case "success":
|
|
172
|
+
{
|
|
173
|
+
reset();
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
t10 = [reset, status];
|
|
178
|
+
$[22] = reset;
|
|
179
|
+
$[23] = status;
|
|
180
|
+
$[24] = t10;
|
|
181
|
+
$[25] = t9;
|
|
182
|
+
} else {
|
|
183
|
+
t10 = $[24];
|
|
184
|
+
t9 = $[25];
|
|
185
|
+
}
|
|
186
|
+
useEffect(t9, t10);
|
|
187
|
+
let t11;
|
|
188
|
+
let t12;
|
|
189
|
+
if ($[26] !== navigation || $[27] !== reset || $[28] !== route.params) {
|
|
190
|
+
t11 = () => {
|
|
191
|
+
if (route.params.clear_input) {
|
|
192
|
+
reset();
|
|
193
|
+
navigation.setParams({
|
|
194
|
+
...route.params,
|
|
195
|
+
clear_input: false
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
t12 = [reset, navigation, route.params];
|
|
200
|
+
$[26] = navigation;
|
|
201
|
+
$[27] = reset;
|
|
202
|
+
$[28] = route.params;
|
|
203
|
+
$[29] = t11;
|
|
204
|
+
$[30] = t12;
|
|
205
|
+
} else {
|
|
206
|
+
t11 = $[29];
|
|
207
|
+
t12 = $[30];
|
|
208
|
+
}
|
|
209
|
+
useEffect(t11, t12);
|
|
210
|
+
let t13;
|
|
211
|
+
let t14;
|
|
212
|
+
if ($[31] !== attachmentUploader.attachments || $[32] !== currentlyEditingMessage || $[33] !== saveDraft || $[34] !== text) {
|
|
213
|
+
t13 = () => {
|
|
214
|
+
if (currentlyEditingMessage) {
|
|
215
|
+
return;
|
|
216
|
+
}
|
|
217
|
+
const timeoutId = setTimeout(() => {
|
|
218
|
+
saveDraft(text, attachmentUploader.attachments);
|
|
219
|
+
}, 500);
|
|
220
|
+
return () => clearTimeout(timeoutId);
|
|
221
|
+
};
|
|
222
|
+
t14 = [text, attachmentUploader.attachments, saveDraft, currentlyEditingMessage];
|
|
223
|
+
$[31] = attachmentUploader.attachments;
|
|
224
|
+
$[32] = currentlyEditingMessage;
|
|
225
|
+
$[33] = saveDraft;
|
|
226
|
+
$[34] = text;
|
|
227
|
+
$[35] = t13;
|
|
228
|
+
$[36] = t14;
|
|
229
|
+
} else {
|
|
230
|
+
t13 = $[35];
|
|
231
|
+
t14 = $[36];
|
|
232
|
+
}
|
|
233
|
+
useEffect(t13, t14);
|
|
234
|
+
const t15 = conversation.disabled ?? false;
|
|
235
|
+
const t16 = !!attachmentUploader?.pendingUploads;
|
|
236
|
+
const t17 = !!attachmentUploader?.flaggedAttachmentCount;
|
|
237
|
+
let t18;
|
|
238
|
+
if ($[37] !== attachmentUploader.attachmentIds?.length || $[38] !== isPending || $[39] !== t15 || $[40] !== t16 || $[41] !== t17 || $[42] !== text) {
|
|
239
|
+
t18 = canSubmitMessage({
|
|
240
|
+
isPending,
|
|
241
|
+
conversationDisabled: t15,
|
|
242
|
+
pendingUploads: t16,
|
|
243
|
+
hasFlaggedAttachments: t17,
|
|
244
|
+
hasText: hasMessageText(text),
|
|
245
|
+
hasSendableAttachments: !!attachmentUploader?.attachmentIds?.length
|
|
246
|
+
});
|
|
247
|
+
$[37] = attachmentUploader.attachmentIds?.length;
|
|
248
|
+
$[38] = isPending;
|
|
249
|
+
$[39] = t15;
|
|
250
|
+
$[40] = t16;
|
|
251
|
+
$[41] = t17;
|
|
252
|
+
$[42] = text;
|
|
253
|
+
$[43] = t18;
|
|
254
|
+
} else {
|
|
255
|
+
t18 = $[43];
|
|
256
|
+
}
|
|
257
|
+
const canSubmit = t18;
|
|
145
258
|
const disabled = !canSubmit;
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
259
|
+
const t19 = conversation.disabled ?? false;
|
|
260
|
+
let t20;
|
|
261
|
+
if ($[44] !== isPending || $[45] !== t19) {
|
|
262
|
+
t20 = isInputEditable({
|
|
263
|
+
isPending,
|
|
264
|
+
conversationDisabled: t19
|
|
265
|
+
});
|
|
266
|
+
$[44] = isPending;
|
|
267
|
+
$[45] = t19;
|
|
268
|
+
$[46] = t20;
|
|
269
|
+
} else {
|
|
270
|
+
t20 = $[46];
|
|
271
|
+
}
|
|
272
|
+
const inputEditable = t20;
|
|
273
|
+
let t21;
|
|
274
|
+
if ($[47] !== conversation.id || $[48] !== navigation || $[49] !== text) {
|
|
275
|
+
t21 = () => {
|
|
276
|
+
if (!Keyboard.isVisible() || Platform.OS === "ios") {
|
|
277
|
+
navigation.navigate("SendGiphy", {
|
|
164
278
|
conversation_id: conversation.id,
|
|
165
279
|
search_term: text
|
|
166
280
|
});
|
|
167
|
-
keyboardListener?.remove();
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
}, [conversation.id, navigation, text]);
|
|
171
|
-
const catchingUp = useRef(false);
|
|
172
|
-
|
|
173
|
-
// A send from a window behind the live edge would leave a gap above it, so a failed
|
|
174
|
-
// catch-up stops the send and keeps what was typed.
|
|
175
|
-
const catchUpBeforeSend = async () => {
|
|
176
|
-
if (catchingUp.current) return false;
|
|
177
|
-
catchingUp.current = true;
|
|
178
|
-
try {
|
|
179
|
-
await onBeforeSubmit?.();
|
|
180
|
-
return true;
|
|
181
|
-
} catch (error) {
|
|
182
|
-
Log.error('send stopped: live window fetch failed', error);
|
|
183
|
-
return false;
|
|
184
|
-
} finally {
|
|
185
|
-
catchingUp.current = false;
|
|
186
|
-
}
|
|
187
|
-
};
|
|
188
|
-
const handleSubmit = async () => {
|
|
189
|
-
if (!canSubmit) return;
|
|
190
|
-
if (canGiphy && usingGiphy) {
|
|
191
|
-
if (!(await catchUpBeforeSend())) return;
|
|
192
|
-
TextInput.State.blurTextInput(TextInput.State.currentlyFocusedInput());
|
|
193
|
-
Haptic.impactLight();
|
|
194
|
-
navigateToSendGiphyAfterKeyboardHides();
|
|
195
|
-
} else {
|
|
196
|
-
let attachmentsForSubmit = attachmentUploader.attachments.filter(a => a.status === 'success' && a.id).map(attachment => ({
|
|
197
|
-
type: 'MessageAttachment',
|
|
198
|
-
id: attachment.id,
|
|
199
|
-
file: attachment.file
|
|
200
|
-
}));
|
|
201
|
-
const messageText = stripEmptyTextCharacters(text);
|
|
202
|
-
if (currentlyEditingMessage) {
|
|
203
|
-
mutateAsync({
|
|
204
|
-
text: messageText
|
|
205
|
-
});
|
|
206
|
-
reset();
|
|
207
281
|
} else {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
attachments: attachmentsForSubmit
|
|
282
|
+
const keyboardListener = Keyboard.addListener("keyboardDidHide", () => {
|
|
283
|
+
navigation.navigate("SendGiphy", {
|
|
284
|
+
conversation_id: conversation.id,
|
|
285
|
+
search_term: text
|
|
286
|
+
});
|
|
287
|
+
keyboardListener?.remove();
|
|
215
288
|
});
|
|
216
289
|
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
290
|
+
};
|
|
291
|
+
$[47] = conversation.id;
|
|
292
|
+
$[48] = navigation;
|
|
293
|
+
$[49] = text;
|
|
294
|
+
$[50] = t21;
|
|
295
|
+
} else {
|
|
296
|
+
t21 = $[50];
|
|
297
|
+
}
|
|
298
|
+
const navigateToSendGiphyAfterKeyboardHides = t21;
|
|
299
|
+
let t22;
|
|
300
|
+
if ($[51] !== attachmentUploader.attachments || $[52] !== canGiphy || $[53] !== canSubmit || $[54] !== currentlyEditingMessage || $[55] !== mutateAsync || $[56] !== navigateToSendGiphyAfterKeyboardHides || $[57] !== reset || $[58] !== text || $[59] !== usingGiphy) {
|
|
301
|
+
t22 = () => {
|
|
302
|
+
if (!canSubmit) {
|
|
303
|
+
return;
|
|
304
|
+
}
|
|
305
|
+
if (canGiphy && usingGiphy) {
|
|
306
|
+
TextInput.State.blurTextInput(TextInput.State.currentlyFocusedInput());
|
|
307
|
+
Haptic.impactLight();
|
|
308
|
+
navigateToSendGiphyAfterKeyboardHides();
|
|
309
|
+
} else {
|
|
310
|
+
const attachmentsForSubmit = attachmentUploader.attachments.filter(_temp).map(_temp2);
|
|
311
|
+
const messageText = stripEmptyTextCharacters(text);
|
|
312
|
+
if (currentlyEditingMessage) {
|
|
313
|
+
mutateAsync({
|
|
314
|
+
text: messageText
|
|
315
|
+
});
|
|
316
|
+
reset();
|
|
317
|
+
} else {
|
|
318
|
+
mutateAsync({
|
|
319
|
+
text: messageText,
|
|
320
|
+
attachments: attachmentsForSubmit
|
|
321
|
+
});
|
|
322
|
+
reset();
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
$[51] = attachmentUploader.attachments;
|
|
327
|
+
$[52] = canGiphy;
|
|
328
|
+
$[53] = canSubmit;
|
|
329
|
+
$[54] = currentlyEditingMessage;
|
|
330
|
+
$[55] = mutateAsync;
|
|
331
|
+
$[56] = navigateToSendGiphyAfterKeyboardHides;
|
|
332
|
+
$[57] = reset;
|
|
333
|
+
$[58] = text;
|
|
334
|
+
$[59] = usingGiphy;
|
|
335
|
+
$[60] = t22;
|
|
336
|
+
} else {
|
|
337
|
+
t22 = $[60];
|
|
338
|
+
}
|
|
339
|
+
const handleSubmit = t22;
|
|
340
|
+
let t23;
|
|
341
|
+
let t24;
|
|
342
|
+
if ($[61] !== currentlyEditingMessage) {
|
|
343
|
+
t23 = () => {
|
|
344
|
+
if (currentlyEditingMessage) {
|
|
345
|
+
setText(currentlyEditingMessage.text || "");
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
t24 = [currentlyEditingMessage];
|
|
349
|
+
$[61] = currentlyEditingMessage;
|
|
350
|
+
$[62] = t23;
|
|
351
|
+
$[63] = t24;
|
|
352
|
+
} else {
|
|
353
|
+
t23 = $[62];
|
|
354
|
+
t24 = $[63];
|
|
355
|
+
}
|
|
356
|
+
useEffect(t23, t24);
|
|
357
|
+
let t25;
|
|
358
|
+
if ($[64] !== attachmentUploader || $[65] !== canGiphy || $[66] !== currentlyEditingMessage || $[67] !== disabled || $[68] !== handleSubmit || $[69] !== inputEditable || $[70] !== replyRootAuthorFirstName || $[71] !== replyRootId || $[72] !== reset || $[73] !== text || $[74] !== usingGiphy) {
|
|
359
|
+
t25 = {
|
|
226
360
|
text,
|
|
227
361
|
setText,
|
|
228
362
|
onSubmit: handleSubmit,
|
|
@@ -236,15 +370,84 @@ function MessageFormRoot({
|
|
|
236
370
|
reset,
|
|
237
371
|
replyRootId,
|
|
238
372
|
replyRootAuthorFirstName
|
|
239
|
-
}
|
|
240
|
-
|
|
373
|
+
};
|
|
374
|
+
$[64] = attachmentUploader;
|
|
375
|
+
$[65] = canGiphy;
|
|
376
|
+
$[66] = currentlyEditingMessage;
|
|
377
|
+
$[67] = disabled;
|
|
378
|
+
$[68] = handleSubmit;
|
|
379
|
+
$[69] = inputEditable;
|
|
380
|
+
$[70] = replyRootAuthorFirstName;
|
|
381
|
+
$[71] = replyRootId;
|
|
382
|
+
$[72] = reset;
|
|
383
|
+
$[73] = text;
|
|
384
|
+
$[74] = usingGiphy;
|
|
385
|
+
$[75] = t25;
|
|
386
|
+
} else {
|
|
387
|
+
t25 = $[75];
|
|
388
|
+
}
|
|
389
|
+
let t26;
|
|
390
|
+
let t27;
|
|
391
|
+
let t28;
|
|
392
|
+
if ($[76] === Symbol.for("react.memo_cache_sentinel")) {
|
|
393
|
+
t26 = /*#__PURE__*/_jsx(EditingIndicator, {});
|
|
394
|
+
t27 = /*#__PURE__*/_jsx(ReplyIndicator, {});
|
|
395
|
+
t28 = /*#__PURE__*/_jsx(FlaggedContentBanner, {});
|
|
396
|
+
$[76] = t26;
|
|
397
|
+
$[77] = t27;
|
|
398
|
+
$[78] = t28;
|
|
399
|
+
} else {
|
|
400
|
+
t26 = $[76];
|
|
401
|
+
t27 = $[77];
|
|
402
|
+
t28 = $[78];
|
|
403
|
+
}
|
|
404
|
+
let t29;
|
|
405
|
+
if ($[79] !== children || $[80] !== styles.textInputContainer) {
|
|
406
|
+
t29 = /*#__PURE__*/_jsx(View, {
|
|
407
|
+
style: styles.textInputContainer,
|
|
408
|
+
children: children
|
|
409
|
+
});
|
|
410
|
+
$[79] = children;
|
|
411
|
+
$[80] = styles.textInputContainer;
|
|
412
|
+
$[81] = t29;
|
|
413
|
+
} else {
|
|
414
|
+
t29 = $[81];
|
|
415
|
+
}
|
|
416
|
+
let t30;
|
|
417
|
+
if ($[82] !== styles.container || $[83] !== t29) {
|
|
418
|
+
t30 = /*#__PURE__*/_jsxs(View, {
|
|
241
419
|
style: styles.container,
|
|
242
|
-
children: [
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
420
|
+
children: [t26, t27, t28, t29]
|
|
421
|
+
});
|
|
422
|
+
$[82] = styles.container;
|
|
423
|
+
$[83] = t29;
|
|
424
|
+
$[84] = t30;
|
|
425
|
+
} else {
|
|
426
|
+
t30 = $[84];
|
|
427
|
+
}
|
|
428
|
+
let t31;
|
|
429
|
+
if ($[85] !== t25 || $[86] !== t30) {
|
|
430
|
+
t31 = /*#__PURE__*/_jsx(MessageFormContext.Provider, {
|
|
431
|
+
value: t25,
|
|
432
|
+
children: t30
|
|
433
|
+
});
|
|
434
|
+
$[85] = t25;
|
|
435
|
+
$[86] = t30;
|
|
436
|
+
$[87] = t31;
|
|
437
|
+
} else {
|
|
438
|
+
t31 = $[87];
|
|
439
|
+
}
|
|
440
|
+
return t31;
|
|
441
|
+
}
|
|
442
|
+
function _temp2(attachment) {
|
|
443
|
+
return {
|
|
444
|
+
type: "MessageAttachment",
|
|
445
|
+
id: attachment.id,
|
|
446
|
+
file: attachment.file
|
|
447
|
+
};
|
|
448
|
+
}
|
|
449
|
+
function _temp(a) {
|
|
450
|
+
return a.status === "success" && a.id;
|
|
248
451
|
}
|
|
249
452
|
function MessageFormAttachments() {
|
|
250
453
|
const $ = _c(10);
|
|
@@ -347,7 +550,7 @@ function FlaggedContentBanner() {
|
|
|
347
550
|
if ($[0] !== attachmentUploader?.attachments) {
|
|
348
551
|
t1 = Symbol.for("react.early_return_sentinel");
|
|
349
552
|
bb0: {
|
|
350
|
-
const flaggedAttachments = attachmentUploader?.attachments.filter(
|
|
553
|
+
const flaggedAttachments = attachmentUploader?.attachments.filter(_temp3) ?? [];
|
|
351
554
|
const flaggedCount = flaggedAttachments.length;
|
|
352
555
|
if (flaggedCount === 0) {
|
|
353
556
|
t1 = null;
|
|
@@ -454,7 +657,7 @@ function FlaggedContentBanner() {
|
|
|
454
657
|
}
|
|
455
658
|
return t8;
|
|
456
659
|
}
|
|
457
|
-
function
|
|
660
|
+
function _temp3(a) {
|
|
458
661
|
return a.flagged;
|
|
459
662
|
}
|
|
460
663
|
function BannerMessage(t0) {
|
|
@@ -468,7 +671,7 @@ function BannerMessage(t0) {
|
|
|
468
671
|
if ($[0] !== styles.flaggedBannerLink) {
|
|
469
672
|
t1 = /*#__PURE__*/_jsx(Text, {
|
|
470
673
|
style: styles.flaggedBannerLink,
|
|
471
|
-
onPress:
|
|
674
|
+
onPress: _temp4,
|
|
472
675
|
accessibilityRole: "link",
|
|
473
676
|
children: "content guidelines"
|
|
474
677
|
});
|
|
@@ -497,7 +700,7 @@ function BannerMessage(t0) {
|
|
|
497
700
|
}
|
|
498
701
|
return t2;
|
|
499
702
|
}
|
|
500
|
-
function
|
|
703
|
+
function _temp4() {
|
|
501
704
|
return Linking.openURL("https://www.planningcenter.com/terms#:~:text=4.%20Acceptable%20Use%20of%20Planning%20Center");
|
|
502
705
|
}
|
|
503
706
|
function MessageFormInput() {
|
|
@@ -841,7 +1044,7 @@ function MessageFormAttachmentPicker() {
|
|
|
841
1044
|
if (result.canceled) {
|
|
842
1045
|
return;
|
|
843
1046
|
}
|
|
844
|
-
const filteredAssets = result.assets.filter(
|
|
1047
|
+
const filteredAssets = result.assets.filter(_temp5).map(_temp6);
|
|
845
1048
|
attachmentUploader?.handleFilesAttached(filteredAssets);
|
|
846
1049
|
};
|
|
847
1050
|
$[0] = attachmentUploader;
|
|
@@ -856,7 +1059,7 @@ function MessageFormAttachmentPicker() {
|
|
|
856
1059
|
if (result_0.canceled) {
|
|
857
1060
|
return;
|
|
858
1061
|
}
|
|
859
|
-
const filteredAssets_0 = result_0.assets.filter(
|
|
1062
|
+
const filteredAssets_0 = result_0.assets.filter(_temp7).map(_temp8);
|
|
860
1063
|
attachmentUploader?.handleFilesAttached(filteredAssets_0);
|
|
861
1064
|
};
|
|
862
1065
|
$[2] = attachmentUploader;
|
|
@@ -996,7 +1199,7 @@ function MessageFormAttachmentPicker() {
|
|
|
996
1199
|
}
|
|
997
1200
|
return t8;
|
|
998
1201
|
}
|
|
999
|
-
function
|
|
1202
|
+
function _temp8(asset_2) {
|
|
1000
1203
|
return {
|
|
1001
1204
|
uri: asset_2.uri,
|
|
1002
1205
|
name: asset_2.name,
|
|
@@ -1004,10 +1207,10 @@ function _temp6(asset_2) {
|
|
|
1004
1207
|
size: asset_2.size
|
|
1005
1208
|
};
|
|
1006
1209
|
}
|
|
1007
|
-
function
|
|
1210
|
+
function _temp7(asset_1) {
|
|
1008
1211
|
return asset_1.size != null && asset_1.uri;
|
|
1009
1212
|
}
|
|
1010
|
-
function
|
|
1213
|
+
function _temp6(asset_0) {
|
|
1011
1214
|
return {
|
|
1012
1215
|
uri: asset_0.uri,
|
|
1013
1216
|
name: asset_0.fileName || asset_0.uri.split("/").pop() || "attachment",
|
|
@@ -1017,7 +1220,7 @@ function _temp4(asset_0) {
|
|
|
1017
1220
|
width: asset_0.width
|
|
1018
1221
|
};
|
|
1019
1222
|
}
|
|
1020
|
-
function
|
|
1223
|
+
function _temp5(asset) {
|
|
1021
1224
|
return asset.fileSize && asset.mimeType && asset.uri;
|
|
1022
1225
|
}
|
|
1023
1226
|
function MessageFormCommands() {
|