@planningcenter/chat-react-native 4.7.0 → 4.7.1-qa-staging.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/build/components/conversations/conversation_actions.d.ts.map +1 -1
  2. package/build/components/conversations/conversation_actions.js +322 -186
  3. package/build/components/conversations/conversation_actions.js.map +1 -1
  4. package/build/components/display/toast.d.ts +3 -0
  5. package/build/components/display/toast.d.ts.map +1 -0
  6. package/build/components/display/toast.js +224 -0
  7. package/build/components/display/toast.js.map +1 -0
  8. package/build/components/group_conversation_list.d.ts.map +1 -1
  9. package/build/components/group_conversation_list.js +1 -0
  10. package/build/components/group_conversation_list.js.map +1 -1
  11. package/build/contexts/conversations_context.d.ts +3 -1
  12. package/build/contexts/conversations_context.d.ts.map +1 -1
  13. package/build/contexts/conversations_context.js +32 -27
  14. package/build/contexts/conversations_context.js.map +1 -1
  15. package/build/hooks/use_conversation.d.ts.map +1 -1
  16. package/build/hooks/use_conversation.js +1 -1
  17. package/build/hooks/use_conversation.js.map +1 -1
  18. package/build/hooks/use_features.d.ts +1 -0
  19. package/build/hooks/use_features.d.ts.map +1 -1
  20. package/build/hooks/use_features.js +2 -1
  21. package/build/hooks/use_features.js.map +1 -1
  22. package/build/hooks/use_hide_conversation.d.ts +107 -0
  23. package/build/hooks/use_hide_conversation.d.ts.map +1 -0
  24. package/build/hooks/use_hide_conversation.js +238 -0
  25. package/build/hooks/use_hide_conversation.js.map +1 -0
  26. package/build/hooks/use_hide_conversations_enabled.d.ts +2 -0
  27. package/build/hooks/use_hide_conversations_enabled.d.ts.map +1 -0
  28. package/build/hooks/use_hide_conversations_enabled.js +18 -0
  29. package/build/hooks/use_hide_conversations_enabled.js.map +1 -0
  30. package/build/navigation/index.d.ts +5 -0
  31. package/build/navigation/index.d.ts.map +1 -1
  32. package/build/navigation/index.js +5 -0
  33. package/build/navigation/index.js.map +1 -1
  34. package/build/screens/conversation_actions_screen.d.ts +7 -0
  35. package/build/screens/conversation_actions_screen.d.ts.map +1 -0
  36. package/build/screens/conversation_actions_screen.js +89 -0
  37. package/build/screens/conversation_actions_screen.js.map +1 -0
  38. package/build/screens/conversation_details_screen.d.ts.map +1 -1
  39. package/build/screens/conversation_details_screen.js +460 -394
  40. package/build/screens/conversation_details_screen.js.map +1 -1
  41. package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
  42. package/build/screens/conversations/conversations_screen.js +18 -10
  43. package/build/screens/conversations/conversations_screen.js.map +1 -1
  44. package/build/screens/index.d.ts +1 -0
  45. package/build/screens/index.d.ts.map +1 -1
  46. package/build/screens/index.js +1 -0
  47. package/build/screens/index.js.map +1 -1
  48. package/build/types/resources/conversation_membership.d.ts +1 -0
  49. package/build/types/resources/conversation_membership.d.ts.map +1 -1
  50. package/build/types/resources/conversation_membership.js.map +1 -1
  51. package/build/utils/toast_store.d.ts +21 -0
  52. package/build/utils/toast_store.d.ts.map +1 -0
  53. package/build/utils/toast_store.js +27 -0
  54. package/build/utils/toast_store.js.map +1 -0
  55. package/package.json +3 -3
  56. package/src/components/conversations/__tests__/conversation_actions.test.tsx +76 -2
  57. package/src/components/conversations/conversation_actions.tsx +68 -4
  58. package/src/components/display/__tests__/toast.test.tsx +55 -0
  59. package/src/components/display/toast.tsx +115 -0
  60. package/src/components/group_conversation_list.tsx +4 -1
  61. package/src/contexts/conversations_context.tsx +6 -1
  62. package/src/hooks/__tests__/use_hide_conversation.test.tsx +147 -0
  63. package/src/hooks/use_conversation.ts +1 -0
  64. package/src/hooks/use_features.ts +1 -0
  65. package/src/hooks/use_hide_conversation.ts +118 -0
  66. package/src/hooks/use_hide_conversations_enabled.ts +7 -0
  67. package/src/navigation/index.tsx +8 -0
  68. package/src/screens/__tests__/conversation_actions_screen.test.tsx +79 -0
  69. package/src/screens/__tests__/conversation_details_screen.test.tsx +49 -1
  70. package/src/screens/conversation_actions_screen.tsx +53 -0
  71. package/src/screens/conversation_details_screen.tsx +19 -0
  72. package/src/screens/conversations/__tests__/conversations_screen.test.tsx +1 -0
  73. package/src/screens/conversations/conversations_screen.tsx +2 -0
  74. package/src/screens/index.ts +1 -0
  75. package/src/types/resources/conversation_membership.ts +1 -0
  76. package/src/utils/toast_store.ts +45 -0
@@ -1,16 +1,20 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
+ import { useNavigation } from '@react-navigation/native';
2
3
  import React, { useCallback, useEffect, useRef, useState } from 'react';
3
4
  import { Platform, Pressable, StyleSheet, View } from 'react-native';
4
5
  import ReanimatedSwipeable from 'react-native-gesture-handler/ReanimatedSwipeable';
5
6
  import { useConversationsContext } from '../../contexts/conversations_context';
6
7
  import { useTheme, useCreateAndroidRippleColor } from '../../hooks';
7
8
  import { useConversationsMarkRead, useConversationsMute } from '../../hooks/use_conversations_actions';
9
+ import { useHideConversation } from '../../hooks/use_hide_conversation';
10
+ import { useHideConversationsEnabled } from '../../hooks/use_hide_conversations_enabled';
8
11
  import { isArchivedConversation, platformPressedOpacityStyle } from '../../utils';
12
+ import { Haptic } from '../../utils/native_adapters';
9
13
  import { tokens } from '../../vendor/tapestry/tokens';
10
14
  import { SwipeableToggleButton } from './swipeable_toggle_button';
11
15
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
12
16
  export function ConversationActions(t0) {
13
- const $ = _c(66);
17
+ const $ = _c(89);
14
18
  const {
15
19
  children,
16
20
  conversation,
@@ -19,10 +23,12 @@ export function ConversationActions(t0) {
19
23
  accessibilityLabel
20
24
  } = t0;
21
25
  const swipeableRef = useRef(null);
26
+ const navigation = useNavigation();
22
27
  const styles = useStyles();
23
28
  const {
24
29
  activeConversationId,
25
- setActiveConversationId
30
+ setActiveConversationId,
31
+ hideable
26
32
  } = useConversationsContext();
27
33
  const [disabled, setDisabled] = useState(false);
28
34
  const overshootLeft = Platform.OS === "ios";
@@ -67,253 +73,344 @@ export function ConversationActions(t0) {
67
73
  markRead,
68
74
  isPending: isMarkReadPending
69
75
  } = useConversationsMarkRead(t3);
70
- const isConversationEmpty = conversation.lastMessageCreatedAt === null;
71
76
  let t4;
72
77
  if ($[6] !== conversation) {
73
- t4 = isArchivedConversation(conversation);
78
+ t4 = {
79
+ conversation
80
+ };
74
81
  $[6] = conversation;
75
82
  $[7] = t4;
76
83
  } else {
77
84
  t4 = $[7];
78
85
  }
79
- const canMute = !t4;
86
+ const {
87
+ hidden,
88
+ setHidden,
89
+ isPending: isHiddenPending
90
+ } = useHideConversation(t4);
91
+ const hideConversationsEnabled = useHideConversationsEnabled();
92
+ const isConversationEmpty = conversation.lastMessageCreatedAt === null;
80
93
  let t5;
81
- if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
82
- t5 = () => {
83
- setDisabled(false);
84
- swipeableRef.current?.close();
85
- };
86
- $[8] = t5;
94
+ if ($[8] !== conversation) {
95
+ t5 = isArchivedConversation(conversation);
96
+ $[8] = conversation;
97
+ $[9] = t5;
87
98
  } else {
88
- t5 = $[8];
99
+ t5 = $[9];
89
100
  }
90
- const handleSwipeableClose = t5;
101
+ const canMute = !t5;
91
102
  let t6;
92
- if ($[9] !== conversation.id || $[10] !== setActiveConversationId) {
93
- t6 = () => {
94
- setDisabled(true);
95
- setActiveConversationId(conversation.id);
96
- };
97
- $[9] = conversation.id;
98
- $[10] = setActiveConversationId;
99
- $[11] = t6;
103
+ if ($[10] !== conversation || $[11] !== hideConversationsEnabled || $[12] !== hideable) {
104
+ t6 = hideable && hideConversationsEnabled && !isArchivedConversation(conversation);
105
+ $[10] = conversation;
106
+ $[11] = hideConversationsEnabled;
107
+ $[12] = hideable;
108
+ $[13] = t6;
100
109
  } else {
101
- t6 = $[11];
110
+ t6 = $[13];
102
111
  }
103
- const handleSwipeableOpen = t6;
112
+ const canHide = t6;
104
113
  let t7;
105
- if ($[12] !== disabled || $[13] !== onPress) {
114
+ if ($[14] === Symbol.for("react.memo_cache_sentinel")) {
106
115
  t7 = () => {
107
- if (disabled || !onPress) {
108
- return;
109
- }
110
- onPress();
116
+ setDisabled(false);
117
+ swipeableRef.current?.close();
111
118
  };
112
- $[12] = disabled;
113
- $[13] = onPress;
114
119
  $[14] = t7;
115
120
  } else {
116
121
  t7 = $[14];
117
122
  }
118
- const handlePress = t7;
123
+ const handleSwipeableClose = t7;
119
124
  let t8;
120
- if ($[15] !== muted || $[16] !== setMuted) {
125
+ if ($[15] !== conversation.id || $[16] !== setActiveConversationId) {
121
126
  t8 = () => {
122
- setMuted(!muted);
123
- handleSwipeableClose();
127
+ setDisabled(true);
128
+ setActiveConversationId(conversation.id);
124
129
  };
125
- $[15] = muted;
126
- $[16] = setMuted;
130
+ $[15] = conversation.id;
131
+ $[16] = setActiveConversationId;
127
132
  $[17] = t8;
128
133
  } else {
129
134
  t8 = $[17];
130
135
  }
131
- const handleMute = t8;
136
+ const handleSwipeableOpen = t8;
132
137
  let t9;
133
- if ($[18] !== markRead || $[19] !== read) {
138
+ if ($[18] !== disabled || $[19] !== onPress) {
134
139
  t9 = () => {
135
- markRead(!read);
136
- handleSwipeableClose();
140
+ if (disabled || !onPress) {
141
+ return;
142
+ }
143
+ onPress();
137
144
  };
138
- $[18] = markRead;
139
- $[19] = read;
145
+ $[18] = disabled;
146
+ $[19] = onPress;
140
147
  $[20] = t9;
141
148
  } else {
142
149
  t9 = $[20];
143
150
  }
144
- const handleLatestMessageUnread = t9;
151
+ const handlePress = t9;
145
152
  let t10;
146
- if ($[21] !== isConversationEmpty || $[22] !== read) {
147
- t10 = !isConversationEmpty ? [{
148
- name: read ? "markUnread" : "markRead",
149
- label: read ? "Mark unread" : "Mark read"
150
- }] : [];
151
- $[21] = isConversationEmpty;
152
- $[22] = read;
153
+ if ($[21] !== muted || $[22] !== setMuted) {
154
+ t10 = () => {
155
+ setMuted(!muted);
156
+ handleSwipeableClose();
157
+ };
158
+ $[21] = muted;
159
+ $[22] = setMuted;
153
160
  $[23] = t10;
154
161
  } else {
155
162
  t10 = $[23];
156
163
  }
157
- const readAccessibilityAction = t10;
164
+ const handleMute = t10;
158
165
  let t11;
159
- if ($[24] !== canMute || $[25] !== muted) {
160
- t11 = canMute ? [{
161
- name: muted ? "unmute" : "mute",
162
- label: muted ? "Enable" : "Silence"
163
- }] : [];
164
- $[24] = canMute;
165
- $[25] = muted;
166
+ if ($[24] !== hidden || $[25] !== setHidden) {
167
+ t11 = () => {
168
+ setHidden(!hidden);
169
+ handleSwipeableClose();
170
+ };
171
+ $[24] = hidden;
172
+ $[25] = setHidden;
166
173
  $[26] = t11;
167
174
  } else {
168
175
  t11 = $[26];
169
176
  }
170
- const muteAccessibilityAction = t11;
177
+ const handleHide = t11;
171
178
  let t12;
172
- if ($[27] !== muteAccessibilityAction || $[28] !== readAccessibilityAction) {
173
- t12 = [...muteAccessibilityAction, ...readAccessibilityAction];
174
- $[27] = muteAccessibilityAction;
175
- $[28] = readAccessibilityAction;
176
- $[29] = t12;
179
+ if ($[27] !== conversation.id || $[28] !== disabled || $[29] !== navigation) {
180
+ t12 = () => {
181
+ if (disabled) {
182
+ return;
183
+ }
184
+ Haptic.impactLight();
185
+ navigation.navigate("ConversationActions", {
186
+ conversation_id: conversation.id
187
+ });
188
+ };
189
+ $[27] = conversation.id;
190
+ $[28] = disabled;
191
+ $[29] = navigation;
192
+ $[30] = t12;
177
193
  } else {
178
- t12 = $[29];
194
+ t12 = $[30];
179
195
  }
180
- const accessibilityActions = t12;
196
+ const handleLongPress = t12;
181
197
  let t13;
182
- if ($[30] !== handleLatestMessageUnread || $[31] !== handleMute) {
183
- t13 = event => {
184
- bb45: switch (event.nativeEvent.actionName) {
198
+ if ($[31] !== markRead || $[32] !== read) {
199
+ t13 = () => {
200
+ markRead(!read);
201
+ handleSwipeableClose();
202
+ };
203
+ $[31] = markRead;
204
+ $[32] = read;
205
+ $[33] = t13;
206
+ } else {
207
+ t13 = $[33];
208
+ }
209
+ const handleLatestMessageUnread = t13;
210
+ let t14;
211
+ if ($[34] !== isConversationEmpty || $[35] !== read) {
212
+ t14 = !isConversationEmpty ? [{
213
+ name: read ? "markUnread" : "markRead",
214
+ label: read ? "Mark unread" : "Mark read"
215
+ }] : [];
216
+ $[34] = isConversationEmpty;
217
+ $[35] = read;
218
+ $[36] = t14;
219
+ } else {
220
+ t14 = $[36];
221
+ }
222
+ const readAccessibilityAction = t14;
223
+ let t15;
224
+ if ($[37] !== canMute || $[38] !== muted) {
225
+ t15 = canMute ? [{
226
+ name: muted ? "unmute" : "mute",
227
+ label: muted ? "Enable" : "Silence"
228
+ }] : [];
229
+ $[37] = canMute;
230
+ $[38] = muted;
231
+ $[39] = t15;
232
+ } else {
233
+ t15 = $[39];
234
+ }
235
+ const muteAccessibilityAction = t15;
236
+ let t16;
237
+ if ($[40] !== canHide || $[41] !== hidden) {
238
+ t16 = canHide ? [{
239
+ name: hidden ? "unhide" : "hide",
240
+ label: hidden ? "Unhide" : "Hide"
241
+ }] : [];
242
+ $[40] = canHide;
243
+ $[41] = hidden;
244
+ $[42] = t16;
245
+ } else {
246
+ t16 = $[42];
247
+ }
248
+ const hideAccessibilityAction = t16;
249
+ let t17;
250
+ if ($[43] !== hideAccessibilityAction || $[44] !== muteAccessibilityAction || $[45] !== readAccessibilityAction) {
251
+ t17 = [...muteAccessibilityAction, ...hideAccessibilityAction, ...readAccessibilityAction];
252
+ $[43] = hideAccessibilityAction;
253
+ $[44] = muteAccessibilityAction;
254
+ $[45] = readAccessibilityAction;
255
+ $[46] = t17;
256
+ } else {
257
+ t17 = $[46];
258
+ }
259
+ const accessibilityActions = t17;
260
+ let t18;
261
+ if ($[47] !== handleHide || $[48] !== handleLatestMessageUnread || $[49] !== handleMute) {
262
+ t18 = event => {
263
+ bb70: switch (event.nativeEvent.actionName) {
185
264
  case "markRead":
186
265
  {
187
266
  handleLatestMessageUnread();
188
- break bb45;
267
+ break bb70;
189
268
  }
190
269
  case "markUnread":
191
270
  {
192
271
  handleLatestMessageUnread();
193
- break bb45;
272
+ break bb70;
194
273
  }
195
274
  case "mute":
196
275
  {
197
276
  handleMute();
198
- break bb45;
277
+ break bb70;
199
278
  }
200
279
  case "unmute":
201
280
  {
202
281
  handleMute();
282
+ break bb70;
283
+ }
284
+ case "hide":
285
+ case "unhide":
286
+ {
287
+ handleHide();
203
288
  }
204
289
  }
205
290
  };
206
- $[30] = handleLatestMessageUnread;
207
- $[31] = handleMute;
208
- $[32] = t13;
291
+ $[47] = handleHide;
292
+ $[48] = handleLatestMessageUnread;
293
+ $[49] = handleMute;
294
+ $[50] = t18;
209
295
  } else {
210
- t13 = $[32];
296
+ t18 = $[50];
211
297
  }
212
- const handleAccessibilityAction = t13;
213
- let t14;
214
- let t15;
215
- if ($[33] !== activeConversationId || $[34] !== conversation.id) {
216
- t14 = () => {
298
+ const handleAccessibilityAction = t18;
299
+ let t19;
300
+ let t20;
301
+ if ($[51] !== activeConversationId || $[52] !== conversation.id) {
302
+ t19 = () => {
217
303
  if (activeConversationId === conversation.id) {
218
304
  return;
219
305
  }
220
306
  handleSwipeableClose();
221
307
  };
222
- t15 = [activeConversationId, conversation.id, handleSwipeableClose];
223
- $[33] = activeConversationId;
224
- $[34] = conversation.id;
225
- $[35] = t14;
226
- $[36] = t15;
308
+ t20 = [activeConversationId, conversation.id, handleSwipeableClose];
309
+ $[51] = activeConversationId;
310
+ $[52] = conversation.id;
311
+ $[53] = t19;
312
+ $[54] = t20;
227
313
  } else {
228
- t14 = $[35];
229
- t15 = $[36];
314
+ t19 = $[53];
315
+ t20 = $[54];
230
316
  }
231
- useEffect(t14, t15);
232
- let t16;
233
- if ($[37] === Symbol.for("react.memo_cache_sentinel")) {
234
- t16 = () => setDisabled(false);
235
- $[37] = t16;
317
+ useEffect(t19, t20);
318
+ let t21;
319
+ if ($[55] === Symbol.for("react.memo_cache_sentinel")) {
320
+ t21 = () => setDisabled(false);
321
+ $[55] = t21;
236
322
  } else {
237
- t16 = $[37];
323
+ t21 = $[55];
238
324
  }
239
- let t17;
240
- if ($[38] !== canMute || $[39] !== handleLatestMessageUnread || $[40] !== handleMute || $[41] !== isConversationEmpty || $[42] !== isMarkReadPending || $[43] !== isMutedPending || $[44] !== muted || $[45] !== read) {
241
- t17 = () => /*#__PURE__*/_jsx(LeftActions, {
325
+ let t22;
326
+ if ($[56] !== canHide || $[57] !== canMute || $[58] !== handleHide || $[59] !== handleLatestMessageUnread || $[60] !== handleMute || $[61] !== hidden || $[62] !== isConversationEmpty || $[63] !== isHiddenPending || $[64] !== isMarkReadPending || $[65] !== isMutedPending || $[66] !== muted || $[67] !== read) {
327
+ t22 = () => /*#__PURE__*/_jsx(LeftActions, {
242
328
  isConversationEmpty: isConversationEmpty,
243
329
  canMute: canMute,
330
+ canHide: canHide,
244
331
  handleMute: handleMute,
332
+ handleHide: handleHide,
245
333
  handleLatestMessageUnread: handleLatestMessageUnread,
246
334
  muted: muted,
335
+ hidden: hidden,
247
336
  read: read,
248
337
  isMutedPending: isMutedPending,
338
+ isHiddenPending: isHiddenPending,
249
339
  isMarkReadPending: isMarkReadPending
250
340
  });
251
- $[38] = canMute;
252
- $[39] = handleLatestMessageUnread;
253
- $[40] = handleMute;
254
- $[41] = isConversationEmpty;
255
- $[42] = isMarkReadPending;
256
- $[43] = isMutedPending;
257
- $[44] = muted;
258
- $[45] = read;
259
- $[46] = t17;
341
+ $[56] = canHide;
342
+ $[57] = canMute;
343
+ $[58] = handleHide;
344
+ $[59] = handleLatestMessageUnread;
345
+ $[60] = handleMute;
346
+ $[61] = hidden;
347
+ $[62] = isConversationEmpty;
348
+ $[63] = isHiddenPending;
349
+ $[64] = isMarkReadPending;
350
+ $[65] = isMutedPending;
351
+ $[66] = muted;
352
+ $[67] = read;
353
+ $[68] = t22;
260
354
  } else {
261
- t17 = $[46];
355
+ t22 = $[68];
262
356
  }
263
- const t18 = `conversation-${conversation.id}`;
264
- let t19;
265
- if ($[47] !== style) {
266
- t19 = t20 => {
357
+ const t23 = `conversation-${conversation.id}`;
358
+ const t24 = canHide ? handleLongPress : undefined;
359
+ let t25;
360
+ if ($[69] !== style) {
361
+ t25 = t26 => {
267
362
  const {
268
363
  pressed
269
- } = t20;
364
+ } = t26;
270
365
  return [style, pressed && platformPressedOpacityStyle];
271
366
  };
272
- $[47] = style;
273
- $[48] = t19;
367
+ $[69] = style;
368
+ $[70] = t25;
274
369
  } else {
275
- t19 = $[48];
370
+ t25 = $[70];
276
371
  }
277
- let t20;
278
- if ($[49] !== androidRippleColor) {
279
- t20 = {
372
+ let t26;
373
+ if ($[71] !== androidRippleColor) {
374
+ t26 = {
280
375
  color: androidRippleColor,
281
376
  borderless: false,
282
377
  foreground: true
283
378
  };
284
- $[49] = androidRippleColor;
285
- $[50] = t20;
379
+ $[71] = androidRippleColor;
380
+ $[72] = t26;
286
381
  } else {
287
- t20 = $[50];
382
+ t26 = $[72];
288
383
  }
289
- let t21;
290
- if ($[51] !== accessibilityActions || $[52] !== accessibilityLabel || $[53] !== children || $[54] !== handleAccessibilityAction || $[55] !== handlePress || $[56] !== t18 || $[57] !== t19 || $[58] !== t20) {
291
- t21 = /*#__PURE__*/_jsx(Pressable, {
292
- testID: t18,
384
+ let t27;
385
+ if ($[73] !== accessibilityActions || $[74] !== accessibilityLabel || $[75] !== children || $[76] !== handleAccessibilityAction || $[77] !== handlePress || $[78] !== t23 || $[79] !== t24 || $[80] !== t25 || $[81] !== t26) {
386
+ t27 = /*#__PURE__*/_jsx(Pressable, {
387
+ testID: t23,
293
388
  onPress: handlePress,
294
- style: t19,
295
- android_ripple: t20,
389
+ onLongPress: t24,
390
+ style: t25,
391
+ android_ripple: t26,
296
392
  accessibilityLabel: accessibilityLabel,
297
393
  accessibilityRole: "button",
298
394
  accessibilityActions: accessibilityActions,
299
395
  onAccessibilityAction: handleAccessibilityAction,
300
396
  children: children
301
397
  });
302
- $[51] = accessibilityActions;
303
- $[52] = accessibilityLabel;
304
- $[53] = children;
305
- $[54] = handleAccessibilityAction;
306
- $[55] = handlePress;
307
- $[56] = t18;
308
- $[57] = t19;
309
- $[58] = t20;
310
- $[59] = t21;
311
- } else {
312
- t21 = $[59];
398
+ $[73] = accessibilityActions;
399
+ $[74] = accessibilityLabel;
400
+ $[75] = children;
401
+ $[76] = handleAccessibilityAction;
402
+ $[77] = handlePress;
403
+ $[78] = t23;
404
+ $[79] = t24;
405
+ $[80] = t25;
406
+ $[81] = t26;
407
+ $[82] = t27;
408
+ } else {
409
+ t27 = $[82];
313
410
  }
314
- let t22;
315
- if ($[60] !== handleSwipeableOpen || $[61] !== styles.swipeableChildContainer || $[62] !== styles.swipeableContainer || $[63] !== t17 || $[64] !== t21) {
316
- t22 = /*#__PURE__*/_jsx(ReanimatedSwipeable, {
411
+ let t28;
412
+ if ($[83] !== handleSwipeableOpen || $[84] !== styles.swipeableChildContainer || $[85] !== styles.swipeableContainer || $[86] !== t22 || $[87] !== t27) {
413
+ t28 = /*#__PURE__*/_jsx(ReanimatedSwipeable, {
317
414
  ref: swipeableRef,
318
415
  childrenContainerStyle: styles.swipeableChildContainer,
319
416
  containerStyle: styles.swipeableContainer,
@@ -321,38 +418,42 @@ export function ConversationActions(t0) {
321
418
  overshootLeft: overshootLeft,
322
419
  overshootRight: false,
323
420
  onSwipeableOpenStartDrag: handleSwipeableOpen,
324
- onSwipeableClose: t16,
421
+ onSwipeableClose: t21,
325
422
  renderRightActions: _temp,
326
- renderLeftActions: t17,
327
- children: t21
423
+ renderLeftActions: t22,
424
+ children: t27
328
425
  });
329
- $[60] = handleSwipeableOpen;
330
- $[61] = styles.swipeableChildContainer;
331
- $[62] = styles.swipeableContainer;
332
- $[63] = t17;
333
- $[64] = t21;
334
- $[65] = t22;
426
+ $[83] = handleSwipeableOpen;
427
+ $[84] = styles.swipeableChildContainer;
428
+ $[85] = styles.swipeableContainer;
429
+ $[86] = t22;
430
+ $[87] = t27;
431
+ $[88] = t28;
335
432
  } else {
336
- t22 = $[65];
433
+ t28 = $[88];
337
434
  }
338
- return t22;
435
+ return t28;
339
436
  }
340
437
  function _temp() {
341
438
  return /*#__PURE__*/_jsx(_Fragment, {});
342
439
  }
343
440
  function LeftActions(t0) {
344
- const $ = _c(18);
441
+ const $ = _c(25);
345
442
  const {
346
443
  isConversationEmpty,
347
444
  canMute,
445
+ canHide,
348
446
  handleMute,
447
+ handleHide,
349
448
  handleLatestMessageUnread,
350
449
  muted,
450
+ hidden,
351
451
  read,
352
452
  isMutedPending,
453
+ isHiddenPending,
353
454
  isMarkReadPending
354
455
  } = t0;
355
- const t1 = canMute ? 2 : 1;
456
+ const t1 = 1 + Number(canMute) + Number(canHide);
356
457
  let t2;
357
458
  if ($[0] !== t1) {
358
459
  t2 = {
@@ -384,6 +485,23 @@ function LeftActions(t0) {
384
485
  let t4;
385
486
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
386
487
  t4 = {
488
+ true: {
489
+ iconName: "general.showEye",
490
+ label: "Unhide"
491
+ },
492
+ false: {
493
+ iconName: "general.hideEye",
494
+ label: "Hide"
495
+ }
496
+ };
497
+ $[3] = t4;
498
+ } else {
499
+ t4 = $[3];
500
+ }
501
+ const hideToggleContent = t4;
502
+ let t5;
503
+ if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
504
+ t5 = {
387
505
  true: {
388
506
  iconName: "general.outlinedTextMessage",
389
507
  label: "Mark read"
@@ -393,61 +511,79 @@ function LeftActions(t0) {
393
511
  label: "Mark unread"
394
512
  }
395
513
  };
396
- $[3] = t4;
514
+ $[4] = t5;
397
515
  } else {
398
- t4 = $[3];
516
+ t5 = $[4];
399
517
  }
400
- const latestMessageUnreadToggleContent = t4;
401
- const t5 = !read;
402
- let t6;
403
- if ($[4] !== handleLatestMessageUnread || $[5] !== isConversationEmpty || $[6] !== isMarkReadPending || $[7] !== t5) {
404
- t6 = /*#__PURE__*/_jsx(SwipeableToggleButton, {
518
+ const latestMessageUnreadToggleContent = t5;
519
+ const t6 = !read;
520
+ let t7;
521
+ if ($[5] !== handleLatestMessageUnread || $[6] !== isConversationEmpty || $[7] !== isMarkReadPending || $[8] !== t6) {
522
+ t7 = /*#__PURE__*/_jsx(SwipeableToggleButton, {
405
523
  loading: isMarkReadPending,
406
524
  disabled: isConversationEmpty,
407
- toggled: t5,
525
+ toggled: t6,
408
526
  onPress: handleLatestMessageUnread,
409
527
  toggleContent: latestMessageUnreadToggleContent,
410
528
  backgroundColor: tokens.fillColorInteractionSwipeDefault
411
529
  });
412
- $[4] = handleLatestMessageUnread;
413
- $[5] = isConversationEmpty;
414
- $[6] = isMarkReadPending;
415
- $[7] = t5;
530
+ $[5] = handleLatestMessageUnread;
531
+ $[6] = isConversationEmpty;
532
+ $[7] = isMarkReadPending;
416
533
  $[8] = t6;
534
+ $[9] = t7;
417
535
  } else {
418
- t6 = $[8];
536
+ t7 = $[9];
419
537
  }
420
- let t7;
421
- if ($[9] !== canMute || $[10] !== handleMute || $[11] !== isMutedPending || $[12] !== muted) {
422
- t7 = canMute && /*#__PURE__*/_jsx(SwipeableToggleButton, {
538
+ let t8;
539
+ if ($[10] !== canMute || $[11] !== handleMute || $[12] !== isMutedPending || $[13] !== muted) {
540
+ t8 = canMute && /*#__PURE__*/_jsx(SwipeableToggleButton, {
423
541
  loading: isMutedPending,
424
542
  toggled: muted,
425
543
  onPress: handleMute,
426
544
  toggleContent: muteToggleContent,
427
545
  backgroundColor: tokens.fillColorInteractionSwipeSecondary
428
546
  });
429
- $[9] = canMute;
430
- $[10] = handleMute;
431
- $[11] = isMutedPending;
432
- $[12] = muted;
433
- $[13] = t7;
547
+ $[10] = canMute;
548
+ $[11] = handleMute;
549
+ $[12] = isMutedPending;
550
+ $[13] = muted;
551
+ $[14] = t8;
434
552
  } else {
435
- t7 = $[13];
553
+ t8 = $[14];
436
554
  }
437
- let t8;
438
- if ($[14] !== styles.actionButtonContainer || $[15] !== t6 || $[16] !== t7) {
439
- t8 = /*#__PURE__*/_jsxs(View, {
555
+ let t9;
556
+ if ($[15] !== canHide || $[16] !== handleHide || $[17] !== hidden || $[18] !== isHiddenPending) {
557
+ t9 = canHide && /*#__PURE__*/_jsx(SwipeableToggleButton, {
558
+ loading: isHiddenPending,
559
+ toggled: hidden,
560
+ onPress: handleHide,
561
+ toggleContent: hideToggleContent,
562
+ backgroundColor: tokens.colorNeutral45
563
+ });
564
+ $[15] = canHide;
565
+ $[16] = handleHide;
566
+ $[17] = hidden;
567
+ $[18] = isHiddenPending;
568
+ $[19] = t9;
569
+ } else {
570
+ t9 = $[19];
571
+ }
572
+ let t10;
573
+ if ($[20] !== styles.actionButtonContainer || $[21] !== t7 || $[22] !== t8 || $[23] !== t9) {
574
+ t10 = /*#__PURE__*/_jsxs(View, {
440
575
  style: styles.actionButtonContainer,
441
- children: [t6, t7]
576
+ children: [t7, t8, t9]
442
577
  });
443
- $[14] = styles.actionButtonContainer;
444
- $[15] = t6;
445
- $[16] = t7;
446
- $[17] = t8;
578
+ $[20] = styles.actionButtonContainer;
579
+ $[21] = t7;
580
+ $[22] = t8;
581
+ $[23] = t9;
582
+ $[24] = t10;
447
583
  } else {
448
- t8 = $[17];
584
+ t10 = $[24];
449
585
  }
450
- return t8;
586
+ return t10;
451
587
  }
452
588
  const ACTION_BUTTON_WIDTH = 120;
453
589
  const useStyles = t0 => {