@planningcenter/chat-react-native 4.7.1-qa-staging.3 → 4.7.1-rc.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 (231) hide show
  1. package/build/components/conversation/attachments/expanded_link.js +8 -8
  2. package/build/components/conversation/attachments/expanded_link.js.map +1 -1
  3. package/build/components/conversation/attachments/generic_file_attachment.d.ts.map +1 -1
  4. package/build/components/conversation/attachments/generic_file_attachment.js +2 -2
  5. package/build/components/conversation/attachments/generic_file_attachment.js.map +1 -1
  6. package/build/components/conversation/attachments/giphy_attachment.d.ts.map +1 -1
  7. package/build/components/conversation/attachments/giphy_attachment.js +2 -2
  8. package/build/components/conversation/attachments/giphy_attachment.js.map +1 -1
  9. package/build/components/conversation/attachments/image_attachment.js +2 -2
  10. package/build/components/conversation/attachments/image_attachment.js.map +1 -1
  11. package/build/components/conversation/message_form.js +2 -2
  12. package/build/components/conversation/message_form.js.map +1 -1
  13. package/build/components/conversation/message_markdown.js +2 -2
  14. package/build/components/conversation/message_markdown.js.map +1 -1
  15. package/build/components/conversations/conversation_actions.d.ts.map +1 -1
  16. package/build/components/conversations/conversation_actions.js +193 -333
  17. package/build/components/conversations/conversation_actions.js.map +1 -1
  18. package/build/components/conversations/conversation_preview.d.ts.map +1 -1
  19. package/build/components/conversations/conversation_preview.js +91 -106
  20. package/build/components/conversations/conversation_preview.js.map +1 -1
  21. package/build/components/conversations/conversations.d.ts.map +1 -1
  22. package/build/components/conversations/conversations.js +56 -63
  23. package/build/components/conversations/conversations.js.map +1 -1
  24. package/build/components/conversations/conversations_blank_state.d.ts +1 -2
  25. package/build/components/conversations/conversations_blank_state.d.ts.map +1 -1
  26. package/build/components/conversations/conversations_blank_state.js +39 -71
  27. package/build/components/conversations/conversations_blank_state.js.map +1 -1
  28. package/build/components/group_conversation_list.d.ts.map +1 -1
  29. package/build/components/group_conversation_list.js +0 -1
  30. package/build/components/group_conversation_list.js.map +1 -1
  31. package/build/contexts/conversations_context.d.ts +1 -3
  32. package/build/contexts/conversations_context.d.ts.map +1 -1
  33. package/build/contexts/conversations_context.js +31 -39
  34. package/build/contexts/conversations_context.js.map +1 -1
  35. package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +0 -6
  36. package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -1
  37. package/build/hooks/use_api.d.ts +0 -6
  38. package/build/hooks/use_api.d.ts.map +1 -1
  39. package/build/hooks/use_api.js +5 -8
  40. package/build/hooks/use_api.js.map +1 -1
  41. package/build/hooks/use_clear_conversation_filters.d.ts.map +1 -1
  42. package/build/hooks/use_clear_conversation_filters.js +0 -1
  43. package/build/hooks/use_clear_conversation_filters.js.map +1 -1
  44. package/build/hooks/use_conversation.d.ts.map +1 -1
  45. package/build/hooks/use_conversation.js +1 -1
  46. package/build/hooks/use_conversation.js.map +1 -1
  47. package/build/hooks/use_features.d.ts +0 -1
  48. package/build/hooks/use_features.d.ts.map +1 -1
  49. package/build/hooks/use_features.js +1 -2
  50. package/build/hooks/use_features.js.map +1 -1
  51. package/build/hooks/use_groups.d.ts +0 -6
  52. package/build/hooks/use_groups.d.ts.map +1 -1
  53. package/build/hooks/use_groups_groups.d.ts +0 -6
  54. package/build/hooks/use_groups_groups.d.ts.map +1 -1
  55. package/build/hooks/use_live_relative_time.js +6 -5
  56. package/build/hooks/use_live_relative_time.js.map +1 -1
  57. package/build/hooks/use_teams.d.ts +0 -6
  58. package/build/hooks/use_teams.d.ts.map +1 -1
  59. package/build/navigation/index.d.ts +0 -5
  60. package/build/navigation/index.d.ts.map +1 -1
  61. package/build/navigation/index.js +0 -5
  62. package/build/navigation/index.js.map +1 -1
  63. package/build/screens/age_check/age_check_underage_screen.js +3 -3
  64. package/build/screens/age_check/age_check_underage_screen.js.map +1 -1
  65. package/build/screens/attachment_actions/attachment_actions_screen.js +2 -2
  66. package/build/screens/attachment_actions/attachment_actions_screen.js.map +1 -1
  67. package/build/screens/bug_report_screen.js +4 -4
  68. package/build/screens/bug_report_screen.js.map +1 -1
  69. package/build/screens/conversation_details_screen.d.ts.map +1 -1
  70. package/build/screens/conversation_details_screen.js +394 -460
  71. package/build/screens/conversation_details_screen.js.map +1 -1
  72. package/build/screens/conversation_filters/components/conversation_filters.d.ts.map +1 -1
  73. package/build/screens/conversation_filters/components/conversation_filters.js +12 -53
  74. package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
  75. package/build/screens/conversation_filters/components/rows.d.ts +3 -6
  76. package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
  77. package/build/screens/conversation_filters/components/rows.js +62 -99
  78. package/build/screens/conversation_filters/components/rows.js.map +1 -1
  79. package/build/screens/conversation_filters/context/conversation_filter_context.d.ts.map +1 -1
  80. package/build/screens/conversation_filters/context/conversation_filter_context.js +0 -4
  81. package/build/screens/conversation_filters/context/conversation_filter_context.js.map +1 -1
  82. package/build/screens/conversation_filters/filter_types.d.ts +0 -1
  83. package/build/screens/conversation_filters/filter_types.d.ts.map +1 -1
  84. package/build/screens/conversation_filters/filter_types.js +0 -1
  85. package/build/screens/conversation_filters/filter_types.js.map +1 -1
  86. package/build/screens/conversation_filters/hooks/filters.d.ts +0 -12
  87. package/build/screens/conversation_filters/hooks/filters.d.ts.map +1 -1
  88. package/build/screens/conversation_filters/screen_props.d.ts +0 -1
  89. package/build/screens/conversation_filters/screen_props.d.ts.map +1 -1
  90. package/build/screens/conversation_filters/screen_props.js.map +1 -1
  91. package/build/screens/conversations/components/filter_dropdown_list_header_component.d.ts.map +1 -1
  92. package/build/screens/conversations/components/filter_dropdown_list_header_component.js +126 -138
  93. package/build/screens/conversations/components/filter_dropdown_list_header_component.js.map +1 -1
  94. package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
  95. package/build/screens/conversations/components/list_header_component.js +90 -95
  96. package/build/screens/conversations/components/list_header_component.js.map +1 -1
  97. package/build/screens/conversations/components/search_list_header_component.d.ts.map +1 -1
  98. package/build/screens/conversations/components/search_list_header_component.js +95 -100
  99. package/build/screens/conversations/components/search_list_header_component.js.map +1 -1
  100. package/build/screens/conversations/conversations_screen.d.ts +0 -1
  101. package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
  102. package/build/screens/conversations/conversations_screen.js +10 -18
  103. package/build/screens/conversations/conversations_screen.js.map +1 -1
  104. package/build/screens/get_help_screen.d.ts.map +1 -1
  105. package/build/screens/get_help_screen.js +21 -5
  106. package/build/screens/get_help_screen.js.map +1 -1
  107. package/build/screens/index.d.ts +0 -1
  108. package/build/screens/index.d.ts.map +1 -1
  109. package/build/screens/index.js +0 -1
  110. package/build/screens/index.js.map +1 -1
  111. package/build/types/resources/conversation_membership.d.ts +0 -1
  112. package/build/types/resources/conversation_membership.d.ts.map +1 -1
  113. package/build/types/resources/conversation_membership.js.map +1 -1
  114. package/build/utils/date.d.ts +1 -1
  115. package/build/utils/date.d.ts.map +1 -1
  116. package/build/utils/date.js +4 -4
  117. package/build/utils/date.js.map +1 -1
  118. package/build/utils/index.d.ts +0 -1
  119. package/build/utils/index.d.ts.map +1 -1
  120. package/build/utils/index.js +0 -1
  121. package/build/utils/index.js.map +1 -1
  122. package/build/utils/request/conversation.d.ts +1 -3
  123. package/build/utils/request/conversation.d.ts.map +1 -1
  124. package/build/utils/request/conversation.js +0 -4
  125. package/build/utils/request/conversation.js.map +1 -1
  126. package/build/vendor/font_awesome_pro_solid_icons.d.ts +0 -1
  127. package/build/vendor/font_awesome_pro_solid_icons.d.ts.map +1 -1
  128. package/build/vendor/font_awesome_pro_solid_icons.js +0 -5
  129. package/build/vendor/font_awesome_pro_solid_icons.js.map +1 -1
  130. package/package.json +3 -3
  131. package/src/__tests__/components/conversation/attachments/giphy_attachment.test.tsx +1 -1
  132. package/src/__tests__/screens/conversation_filters/components/conversation_filters.test.tsx +0 -6
  133. package/src/__tests__/screens/get_help_screen.test.ts +1 -1
  134. package/src/components/conversation/attachments/expanded_link.tsx +4 -4
  135. package/src/components/conversation/attachments/generic_file_attachment.tsx +5 -2
  136. package/src/components/conversation/attachments/giphy_attachment.tsx +4 -2
  137. package/src/components/conversation/attachments/image_attachment.tsx +2 -2
  138. package/src/components/conversation/message_form.tsx +2 -2
  139. package/src/components/conversation/message_markdown.tsx +2 -2
  140. package/src/components/conversations/__tests__/conversation_actions.test.tsx +2 -77
  141. package/src/components/conversations/__tests__/conversation_preview.test.tsx +0 -29
  142. package/src/components/conversations/__tests__/conversations.test.tsx +0 -26
  143. package/src/components/conversations/__tests__/conversations_blank_state.test.tsx +0 -17
  144. package/src/components/conversations/conversation_actions.tsx +4 -73
  145. package/src/components/conversations/conversation_preview.tsx +1 -12
  146. package/src/components/conversations/conversations.tsx +0 -9
  147. package/src/components/conversations/conversations_blank_state.tsx +0 -18
  148. package/src/components/group_conversation_list.tsx +1 -4
  149. package/src/contexts/conversations_context.tsx +1 -8
  150. package/src/hooks/__tests__/use_live_relative_time.test.tsx +22 -0
  151. package/src/hooks/use_api.ts +1 -2
  152. package/src/hooks/use_clear_conversation_filters.ts +0 -1
  153. package/src/hooks/use_conversation.ts +0 -1
  154. package/src/hooks/use_features.ts +0 -1
  155. package/src/hooks/use_live_relative_time.ts +1 -1
  156. package/src/navigation/index.tsx +0 -8
  157. package/src/screens/__tests__/conversation_details_screen.test.tsx +1 -49
  158. package/src/screens/age_check/age_check_underage_screen.tsx +3 -3
  159. package/src/screens/attachment_actions/attachment_actions_screen.tsx +2 -2
  160. package/src/screens/bug_report_screen.tsx +4 -4
  161. package/src/screens/conversation_details_screen.tsx +0 -19
  162. package/src/screens/conversation_filters/__tests__/conversation_filters.test.tsx +0 -42
  163. package/src/screens/conversation_filters/components/conversation_filters.tsx +3 -22
  164. package/src/screens/conversation_filters/components/rows.tsx +10 -44
  165. package/src/screens/conversation_filters/context/conversation_filter_context.tsx +0 -4
  166. package/src/screens/conversation_filters/filter_types.ts +0 -1
  167. package/src/screens/conversation_filters/screen_props.ts +0 -1
  168. package/src/screens/conversations/__tests__/conversations_screen.test.tsx +0 -1
  169. package/src/screens/conversations/components/__tests__/filter_dropdown_list_header_component.test.tsx +0 -42
  170. package/src/screens/conversations/components/__tests__/list_header_component.test.tsx +0 -1
  171. package/src/screens/conversations/components/filter_dropdown_list_header_component.tsx +5 -21
  172. package/src/screens/conversations/components/list_header_component.tsx +4 -14
  173. package/src/screens/conversations/components/search_list_header_component.tsx +4 -14
  174. package/src/screens/conversations/conversations_screen.tsx +0 -3
  175. package/src/screens/get_help_screen.tsx +19 -5
  176. package/src/screens/index.ts +0 -1
  177. package/src/types/resources/conversation_membership.ts +0 -1
  178. package/src/utils/__tests__/date.test.ts +10 -1
  179. package/src/utils/date.ts +4 -4
  180. package/src/utils/index.ts +0 -1
  181. package/src/utils/request/conversation.ts +0 -6
  182. package/src/vendor/font_awesome_pro_solid_icons.ts +0 -12
  183. package/build/components/conversations/hidden_indicator.d.ts +0 -4
  184. package/build/components/conversations/hidden_indicator.d.ts.map +0 -1
  185. package/build/components/conversations/hidden_indicator.js +0 -52
  186. package/build/components/conversations/hidden_indicator.js.map +0 -1
  187. package/build/components/conversations/hidden_results_footer.d.ts +0 -2
  188. package/build/components/conversations/hidden_results_footer.d.ts.map +0 -1
  189. package/build/components/conversations/hidden_results_footer.js +0 -34
  190. package/build/components/conversations/hidden_results_footer.js.map +0 -1
  191. package/build/components/display/toast.d.ts +0 -3
  192. package/build/components/display/toast.d.ts.map +0 -1
  193. package/build/components/display/toast.js +0 -224
  194. package/build/components/display/toast.js.map +0 -1
  195. package/build/hooks/use_hidden_conversations_count.d.ts +0 -2
  196. package/build/hooks/use_hidden_conversations_count.d.ts.map +0 -1
  197. package/build/hooks/use_hidden_conversations_count.js +0 -32
  198. package/build/hooks/use_hidden_conversations_count.js.map +0 -1
  199. package/build/hooks/use_hide_conversation.d.ts +0 -108
  200. package/build/hooks/use_hide_conversation.d.ts.map +0 -1
  201. package/build/hooks/use_hide_conversation.js +0 -243
  202. package/build/hooks/use_hide_conversation.js.map +0 -1
  203. package/build/hooks/use_hide_conversations_enabled.d.ts +0 -2
  204. package/build/hooks/use_hide_conversations_enabled.d.ts.map +0 -1
  205. package/build/hooks/use_hide_conversations_enabled.js +0 -18
  206. package/build/hooks/use_hide_conversations_enabled.js.map +0 -1
  207. package/build/screens/conversation_actions_screen.d.ts +0 -7
  208. package/build/screens/conversation_actions_screen.d.ts.map +0 -1
  209. package/build/screens/conversation_actions_screen.js +0 -89
  210. package/build/screens/conversation_actions_screen.js.map +0 -1
  211. package/build/utils/open_url.d.ts +0 -11
  212. package/build/utils/open_url.d.ts.map +0 -1
  213. package/build/utils/open_url.js +0 -46
  214. package/build/utils/open_url.js.map +0 -1
  215. package/build/utils/toast_store.d.ts +0 -21
  216. package/build/utils/toast_store.d.ts.map +0 -1
  217. package/build/utils/toast_store.js +0 -27
  218. package/build/utils/toast_store.js.map +0 -1
  219. package/src/components/conversations/hidden_indicator.tsx +0 -30
  220. package/src/components/conversations/hidden_results_footer.tsx +0 -25
  221. package/src/components/display/__tests__/toast.test.tsx +0 -55
  222. package/src/components/display/toast.tsx +0 -115
  223. package/src/hooks/__tests__/use_hide_conversation.test.tsx +0 -189
  224. package/src/hooks/use_hidden_conversations_count.ts +0 -14
  225. package/src/hooks/use_hide_conversation.ts +0 -128
  226. package/src/hooks/use_hide_conversations_enabled.ts +0 -7
  227. package/src/screens/__tests__/conversation_actions_screen.test.tsx +0 -79
  228. package/src/screens/conversation_actions_screen.tsx +0 -53
  229. package/src/utils/__tests__/open_url.test.ts +0 -67
  230. package/src/utils/open_url.ts +0 -47
  231. package/src/utils/toast_store.ts +0 -45
@@ -45,7 +45,6 @@ export const SearchListHeaderComponent = () => {
45
45
  group_source_app_name = '',
46
46
  show_direct_messages,
47
47
  show_archived,
48
- show_hidden,
49
48
  } = route.params || {}
50
49
  const currentPersonCache = useCurrentPersonCache()
51
50
  const { markAllRead, isPending } = useMarkAllRead()
@@ -56,7 +55,7 @@ export const SearchListHeaderComponent = () => {
56
55
  )
57
56
 
58
57
  const active: FilterTypes = useMemo(() => {
59
- if (chat_group_graph_id || show_archived || show_hidden) {
58
+ if (chat_group_graph_id || show_archived) {
60
59
  return FilterTypes.More
61
60
  } else if (/groups/i.test(group_source_app_name)) {
62
61
  return FilterTypes.Groups
@@ -67,7 +66,7 @@ export const SearchListHeaderComponent = () => {
67
66
  }
68
67
 
69
68
  return FilterTypes.All
70
- }, [chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived, show_hidden])
69
+ }, [chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived])
71
70
 
72
71
  const handleNewConversationNavigation = useCallback(() => {
73
72
  if (newConversationFromFilter || entryMode === 'select_type') {
@@ -107,7 +106,6 @@ export const SearchListHeaderComponent = () => {
107
106
  group_source_app_name: undefined,
108
107
  show_direct_messages: undefined,
109
108
  show_archived: undefined,
110
- show_hidden: undefined,
111
109
  ...params,
112
110
  })
113
111
  },
@@ -128,16 +126,8 @@ export const SearchListHeaderComponent = () => {
128
126
  group_source_app_name,
129
127
  show_direct_messages,
130
128
  show_archived,
131
- show_hidden,
132
129
  })
133
- }, [
134
- navigation,
135
- chat_group_graph_id,
136
- group_source_app_name,
137
- show_direct_messages,
138
- show_archived,
139
- show_hidden,
140
- ])
130
+ }, [navigation, chat_group_graph_id, group_source_app_name, show_direct_messages, show_archived])
141
131
 
142
132
  const handleMarkAllRead = useCallback(() => {
143
133
  currentPersonCache.update({ unreadCount: 0 })
@@ -178,7 +168,7 @@ export const SearchListHeaderComponent = () => {
178
168
  <Heading numberOfLines={1} variant="h2">
179
169
  Conversations
180
170
  </Heading>
181
- {!show_archived && !show_hidden && (
171
+ {!show_archived && (
182
172
  <TextButton
183
173
  onPress={alertMarkAllRead}
184
174
  disabled={isPending}
@@ -2,7 +2,6 @@ import { StaticScreenProps } from '@react-navigation/native'
2
2
  import React from 'react'
3
3
  import { StyleSheet, View } from 'react-native'
4
4
  import { Conversations } from '../../components'
5
- import { Toast } from '../../components/display/toast'
6
5
  import { ConversationsContextProvider } from '../../contexts/conversations_context'
7
6
  import { useFilterDropdownEnabled } from '../../hooks/use_filter_dropdown_enabled'
8
7
  import { analyticsEvents, usePublishProductAnalyticsEvent } from '../../hooks/use_product_analytics'
@@ -19,7 +18,6 @@ export type ConversationsScreenProps = StaticScreenProps<{
19
18
  group_source_app_name?: AppName
20
19
  show_direct_messages?: boolean
21
20
  show_archived?: boolean
22
- show_hidden?: boolean
23
21
  show_unread?: boolean
24
22
  }>
25
23
 
@@ -34,7 +32,6 @@ export function ConversationsScreen({ route }: ConversationsScreenProps) {
34
32
  <ConversationsContextProvider args={route.params} opts={{ throwOnError: true }}>
35
33
  <Conversations ListHeaderComponent={Header} />
36
34
  </ConversationsContextProvider>
37
- <Toast />
38
35
  </View>
39
36
  )
40
37
  }
@@ -1,12 +1,12 @@
1
1
  import { StaticScreenProps, useNavigation } from '@react-navigation/native'
2
2
  import { useCallback, useMemo } from 'react'
3
- import { ScrollView, StyleSheet, View } from 'react-native'
3
+ import { Alert, ScrollView, StyleSheet, View } from 'react-native'
4
4
  import { Heading, PressableRow, Text, TextInlineButton } from '../components'
5
5
  import { useApiGet, useTheme } from '../hooks'
6
6
  import { useAppName } from '../hooks/use_app_name'
7
7
  import { useOrganization } from '../hooks/use_organization'
8
8
  import { ResourceObject } from '../types'
9
- import { openUrl } from '../utils'
9
+ import { Clipboard, Linking } from '../utils'
10
10
 
11
11
  type GetHelpScreenRouteProps = {
12
12
  type?: 'chat' | 'general'
@@ -65,7 +65,7 @@ export const GetHelpScreen = ({ route }: GetHelpScreenProps) => {
65
65
  {appSpecificHelpUrls.map(helpUrl => (
66
66
  <PressableRow
67
67
  key={helpUrl.id}
68
- onPress={() => openUrl(helpUrl.link)}
68
+ onPress={() => Linking.openURL(helpUrl.link)}
69
69
  text={helpUrl.title}
70
70
  isActive={true}
71
71
  iconPath="general.newWindow"
@@ -117,13 +117,27 @@ const ContactRow = ({ email, phone }: { email?: string; phone?: string }) => {
117
117
  export function sendEmail(email: string) {
118
118
  if (!email) return
119
119
 
120
- openUrl(encodeURI(`mailto:${email}`))
120
+ const url = encodeURI(`mailto:${email}`)
121
+
122
+ Linking.openURL(url).catch(() => {
123
+ Alert.alert('Oops', `Unable to open: ${email}`, [
124
+ { text: 'Copy to clipboard', onPress: () => Clipboard.setStringAsync(email) },
125
+ { text: 'OK' },
126
+ ])
127
+ })
121
128
  }
122
129
 
123
130
  export function placePhoneCall(phoneNumber: string) {
124
131
  if (!phoneNumber) return
125
132
 
126
- openUrl(encodeURI(`tel:${phoneNumber}`))
133
+ const url = encodeURI(`tel:${phoneNumber}`)
134
+
135
+ Linking.openURL(url).catch(() => {
136
+ Alert.alert('Oops', `Unable to open: ${phoneNumber}`, [
137
+ { text: 'Copy to clipboard', onPress: () => Clipboard.setStringAsync(phoneNumber) },
138
+ { text: 'OK' },
139
+ ])
140
+ })
127
141
  }
128
142
 
129
143
  const useStyles = () => {
@@ -8,7 +8,6 @@ export * from './preferred_app_selection_screen'
8
8
  export * from './group_notification_settings_screen'
9
9
  export * from './conversation_filter_recipients/conversation_filter_recipients_screen'
10
10
  export * from './message_actions_screen'
11
- export * from './conversation_actions_screen'
12
11
  export * from './message_report_screen'
13
12
  export * from './send_giphy_screen'
14
13
  export * from './not_found'
@@ -5,7 +5,6 @@ export type NotificationLevelDescription = string
5
5
 
6
6
  export interface ConversationMembershipResource extends ResourceObject {
7
7
  type: 'ConversationMembership'
8
- hidden?: boolean
9
8
  lastReadMessageSortKey: string
10
9
  muted: boolean
11
10
  notificationLevel: NotificationLevelValue
@@ -1,4 +1,4 @@
1
- import { formatEventDateTime } from '../date'
1
+ import { formatEventDateTime, relativeTime } from '../date'
2
2
 
3
3
  describe('formatEventDateTime', () => {
4
4
  beforeEach(() => {
@@ -21,3 +21,12 @@ describe('formatEventDateTime', () => {
21
21
  expect(formatEventDateTime(new Date(2026, 1, 3, 14, 0))).toBe('Feb 3 at 2pm')
22
22
  })
23
23
  })
24
+
25
+ describe('relativeTime', () => {
26
+ it('measures from the given time', () => {
27
+ const date = '2026-11-10T11:49:00Z'
28
+
29
+ expect(relativeTime(date, '2026-11-10T12:00:00Z')).toBe('11 minutes ago')
30
+ expect(relativeTime(date, '2026-11-10T12:01:00Z')).toBe('12 minutes ago')
31
+ })
32
+ })
package/src/utils/date.ts CHANGED
@@ -50,13 +50,13 @@ export function relativeDateTime(dateTimeString: string): string {
50
50
  }
51
51
  }
52
52
 
53
- export function relativeTime(date: DateProps): string {
54
- const now = dayjs()
53
+ export function relativeTime(date: DateProps, now: DateProps = Date.now()): string {
54
+ const current = dayjs(now)
55
55
  const then = dayjs(date)
56
- const duration = dayjs.duration(now.diff(then))
56
+ const duration = dayjs.duration(current.diff(then))
57
57
 
58
58
  if (duration.asDays() < 1) {
59
- return then.fromNow()
59
+ return then.from(current)
60
60
  } else {
61
61
  return dayjs(date).format('h:mma')
62
62
  }
@@ -10,7 +10,6 @@ export * from './host_bridge'
10
10
  export * from './liquid_glass'
11
11
  export * from './membership_sync_info_text'
12
12
  export * from './native_adapters'
13
- export * from './open_url'
14
13
  export * from './pluralize'
15
14
  export * from './conversation_safety_constants'
16
15
  export * from './reaction_constants'
@@ -7,19 +7,15 @@ export interface ConversationRequestArgs {
7
7
  group_source_app_name?: string
8
8
  show_direct_messages?: boolean
9
9
  show_archived?: boolean
10
- show_hidden?: boolean
11
10
  show_unread?: boolean
12
11
  }
13
12
 
14
- export const HIDDEN_CONVERSATIONS_FILTER = 'mine_or_not_empty,hidden'
15
-
16
13
  export const getConversationsRequestArgs = ({
17
14
  gids,
18
15
  chat_group_graph_id,
19
16
  group_source_app_name,
20
17
  show_direct_messages,
21
18
  show_archived,
22
- show_hidden,
23
19
  show_unread,
24
20
  }: Partial<ConversationRequestArgs> = {}): GetRequest => {
25
21
  let filter: string
@@ -27,8 +23,6 @@ export const getConversationsRequestArgs = ({
27
23
  filter = 'mine_or_not_empty,group'
28
24
  } else if (show_archived) {
29
25
  filter = 'mine_or_not_empty,archived'
30
- } else if (show_hidden) {
31
- filter = HIDDEN_CONVERSATIONS_FILTER
32
26
  } else if (show_unread) {
33
27
  filter = 'mine_or_not_empty,unread'
34
28
  } else if (show_direct_messages) {
@@ -620,15 +620,3 @@ export const faBoxArchive: IconDefinition = {
620
620
  'M0 64C0 46.3 14.3 32 32 32l448 0c17.7 0 32 14.3 32 32l0 32c0 17.7-14.3 32-32 32L32 128C14.3 128 0 113.7 0 96L0 64zM32 176l448 0 0 240c0 35.3-28.7 64-64 64L96 480c-35.3 0-64-28.7-64-64l0-240zm152 64c-13.3 0-24 10.7-24 24s10.7 24 24 24l144 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-144 0z',
621
621
  ],
622
622
  }
623
-
624
- export const faEyeSlash: IconDefinition = {
625
- prefix: 'fas',
626
- iconName: 'eye-slash',
627
- icon: [
628
- 576,
629
- 512,
630
- [],
631
- 'f070',
632
- 'M41-24.9c-9.4-9.4-24.6-9.4-33.9 0S-2.3-.3 7 9.1l528 528c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-96.4-96.4c2.7-2.4 5.4-4.8 8-7.2 46.8-43.5 78.1-95.4 93-131.1 3.3-7.9 3.3-16.7 0-24.6-14.9-35.7-46.2-87.7-93-131.1-47.1-43.7-111.8-80.6-192.6-80.6-56.8 0-105.6 18.2-146 44.2L41-24.9zM204.5 138.7c23.5-16.8 52.4-26.7 83.5-26.7 79.5 0 144 64.5 144 144 0 31.1-9.9 59.9-26.7 83.5l-34.7-34.7c12.7-21.4 17-47.7 10.1-73.7-13.7-51.2-66.4-81.6-117.6-67.9-8.6 2.3-16.7 5.7-24 10l-34.7-34.7zM325.3 395.1c-11.9 3.2-24.4 4.9-37.3 4.9-79.5 0-144-64.5-144-144 0-12.9 1.7-25.4 4.9-37.3L69.4 139.2c-32.6 36.8-55 75.8-66.9 104.5-3.3 7.9-3.3 16.7 0 24.6 14.9 35.7 46.2 87.7 93 131.1 47.1 43.7 111.8 80.6 192.6 80.6 37.3 0 71.2-7.9 101.5-20.6l-64.2-64.2z',
633
- ],
634
- }
@@ -1,4 +0,0 @@
1
- export declare const HiddenIndicator: ({ hidden }: {
2
- hidden: boolean;
3
- }) => import("react/jsx-runtime").JSX.Element | null;
4
- //# sourceMappingURL=hidden_indicator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hidden_indicator.d.ts","sourceRoot":"","sources":["../../../src/components/conversations/hidden_indicator.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,eAAe,GAAI,YAAY;IAAE,MAAM,EAAE,OAAO,CAAA;CAAE,mDAa9D,CAAA"}
@@ -1,52 +0,0 @@
1
- import { c as _c } from "react/compiler-runtime";
2
- import React from 'react';
3
- import { StyleSheet } from 'react-native';
4
- import { useTheme } from '../../hooks';
5
- import { MAX_FONT_SIZE_MULTIPLIER } from '../../utils';
6
- import { Icon } from '../display';
7
- import { jsx as _jsx } from "react/jsx-runtime";
8
- export const HiddenIndicator = t0 => {
9
- const $ = _c(2);
10
- const {
11
- hidden
12
- } = t0;
13
- const styles = useStyles();
14
- if (!hidden) {
15
- return null;
16
- }
17
- let t1;
18
- if ($[0] !== styles.hiddenIcon) {
19
- t1 = /*#__PURE__*/_jsx(Icon, {
20
- name: "general.hideEye",
21
- style: styles.hiddenIcon,
22
- testID: "conversation-hidden-icon",
23
- maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER
24
- });
25
- $[0] = styles.hiddenIcon;
26
- $[1] = t1;
27
- } else {
28
- t1 = $[1];
29
- }
30
- return t1;
31
- };
32
- const useStyles = () => {
33
- const $ = _c(2);
34
- const {
35
- colors
36
- } = useTheme();
37
- let t0;
38
- if ($[0] !== colors.iconColorDefaultDim) {
39
- t0 = StyleSheet.create({
40
- hiddenIcon: {
41
- color: colors.iconColorDefaultDim,
42
- fontSize: 16
43
- }
44
- });
45
- $[0] = colors.iconColorDefaultDim;
46
- $[1] = t0;
47
- } else {
48
- t0 = $[1];
49
- }
50
- return t0;
51
- };
52
- //# sourceMappingURL=hidden_indicator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hidden_indicator.js","names":["React","StyleSheet","useTheme","MAX_FONT_SIZE_MULTIPLIER","Icon","jsx","_jsx","HiddenIndicator","t0","$","_c","hidden","styles","useStyles","t1","hiddenIcon","name","style","testID","colors","iconColorDefaultDim","create","color","fontSize"],"sources":["../../../src/components/conversations/hidden_indicator.tsx"],"sourcesContent":["import React from 'react'\nimport { StyleSheet } from 'react-native'\nimport { useTheme } from '../../hooks'\nimport { MAX_FONT_SIZE_MULTIPLIER } from '../../utils'\nimport { Icon } from '../display'\n\nexport const HiddenIndicator = ({ hidden }: { hidden: boolean }) => {\n const styles = useStyles()\n\n if (!hidden) return null\n\n return (\n <Icon\n name=\"general.hideEye\"\n style={styles.hiddenIcon}\n testID=\"conversation-hidden-icon\"\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER}\n />\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n return StyleSheet.create({\n hiddenIcon: {\n color: colors.iconColorDefaultDim,\n fontSize: 16,\n },\n })\n}\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,cAAc;AACzC,SAASC,QAAQ,QAAQ,aAAa;AACtC,SAASC,wBAAwB,QAAQ,aAAa;AACtD,SAASC,IAAI,QAAQ,YAAY;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEjC,OAAO,MAAMC,eAAe,GAAGC,EAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAAC;IAAAC;EAAA,IAAAH,EAA+B;EAC7D,MAAAI,MAAA,GAAeC,SAAS,CAAC,CAAC;EAE1B,IAAI,CAACF,MAAM;IAAA,OAAS,IAAI;EAAA;EAAA,IAAAG,EAAA;EAAA,IAAAL,CAAA,QAAAG,MAAA,CAAAG,UAAA;IAGtBD,EAAA,gBAAAR,IAAA,CAACF,IAAI;MACEY,IAAiB,EAAjB,iBAAiB;MACfC,KAAiB,EAAjBL,MAAM,CAAAG,UAAW;MACjBG,MAA0B,EAA1B,0BAA0B;MACVf,qBAAwB,EAAxBA;IAAwB,CAChD,CAAC;IAAAM,CAAA,MAAAG,MAAA,CAAAG,UAAA;IAAAN,CAAA,MAAAK,EAAA;EAAA;IAAAA,EAAA,GAAAL,CAAA;EAAA;EAAA,OALFK,EAKE;AAAA,CAEL;AAED,MAAMD,SAAS,GAAGA,CAAA;EAAA,MAAAJ,CAAA,GAAAC,EAAA;EAChB;IAAAS;EAAA,IAAmBjB,QAAQ,CAAC,CAAC;EAAA,IAAAM,EAAA;EAAA,IAAAC,CAAA,QAAAU,MAAA,CAAAC,mBAAA;IACtBZ,EAAA,GAAAP,UAAU,CAAAoB,MAAO,CAAC;MAAAN,UAAA,EACX;QAAAO,KAAA,EACHH,MAAM,CAAAC,mBAAoB;QAAAG,QAAA,EACvB;MACZ;IACF,CAAC,CAAC;IAAAd,CAAA,MAAAU,MAAA,CAAAC,mBAAA;IAAAX,CAAA,MAAAD,EAAA;EAAA;IAAAA,EAAA,GAAAC,CAAA;EAAA;EAAA,OALKD,EAKL;AAAA,CACH","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export declare function HiddenResultsFooter(): import("react/jsx-runtime").JSX.Element;
2
- //# sourceMappingURL=hidden_results_footer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hidden_results_footer.d.ts","sourceRoot":"","sources":["../../../src/components/conversations/hidden_results_footer.tsx"],"names":[],"mappings":"AAIA,wBAAgB,mBAAmB,4CASlC"}
@@ -1,34 +0,0 @@
1
- import { c as _c } from "react/compiler-runtime";
2
- import React from 'react';
3
- import { StyleSheet, View } from 'react-native';
4
- import { Text } from '../display';
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- export function HiddenResultsFooter() {
7
- const $ = _c(1);
8
- let t0;
9
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
10
- t0 = /*#__PURE__*/_jsx(View, {
11
- style: styles.container,
12
- children: /*#__PURE__*/_jsx(Text, {
13
- variant: "tertiary",
14
- style: styles.text,
15
- children: "Hidden just for you. A conversation comes back to your list when someone sends a new message, unless it\u2019s also silenced."
16
- })
17
- });
18
- $[0] = t0;
19
- } else {
20
- t0 = $[0];
21
- }
22
- return t0;
23
- }
24
- const styles = StyleSheet.create({
25
- container: {
26
- alignItems: 'center',
27
- paddingVertical: 24,
28
- paddingHorizontal: 16
29
- },
30
- text: {
31
- textAlign: 'center'
32
- }
33
- });
34
- //# sourceMappingURL=hidden_results_footer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hidden_results_footer.js","names":["React","StyleSheet","View","Text","jsx","_jsx","HiddenResultsFooter","$","_c","t0","Symbol","for","style","styles","container","children","variant","text","create","alignItems","paddingVertical","paddingHorizontal","textAlign"],"sources":["../../../src/components/conversations/hidden_results_footer.tsx"],"sourcesContent":["import React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Text } from '../display'\n\nexport function HiddenResultsFooter() {\n return (\n <View style={styles.container}>\n <Text variant=\"tertiary\" style={styles.text}>\n Hidden just for you. A conversation comes back to your list when someone sends a new\n message, unless it&rsquo;s also silenced.\n </Text>\n </View>\n )\n}\n\nconst styles = StyleSheet.create({\n container: {\n alignItems: 'center',\n paddingVertical: 24,\n paddingHorizontal: 16,\n },\n text: {\n textAlign: 'center',\n },\n})\n"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,IAAI,QAAQ,YAAY;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAEjC,OAAO,SAAAC,oBAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAF,CAAA,QAAAG,MAAA,CAAAC,GAAA;IAEHF,EAAA,gBAAAJ,IAAA,CAACH,IAAI;MAAQU,KAAgB,EAAhBC,MAAM,CAAAC,SAAU;MAAAC,QAAA,eAC3BV,IAAA,CAACF,IAAI;QAASa,OAAU,EAAV,UAAU;QAAQJ,KAAW,EAAXC,MAAM,CAAAI,IAAK;QAAAF,QAAA,EAAE;MAG7C,CAAM;IAAC,CACH,CAAC;IAAAR,CAAA,MAAAE,EAAA;EAAA;IAAAA,EAAA,GAAAF,CAAA;EAAA;EAAA,OALPE,EAKO;AAAA;AAIX,MAAMI,MAAM,GAAGZ,UAAU,CAACiB,MAAM,CAAC;EAC/BJ,SAAS,EAAE;IACTK,UAAU,EAAE,QAAQ;IACpBC,eAAe,EAAE,EAAE;IACnBC,iBAAiB,EAAE;EACrB,CAAC;EACDJ,IAAI,EAAE;IACJK,SAAS,EAAE;EACb;AACF,CAAC,CAAC","ignoreList":[]}
@@ -1,3 +0,0 @@
1
- export declare const TOAST_DURATION_MS = 5000;
2
- export declare function Toast(): import("react/jsx-runtime").JSX.Element | null;
3
- //# sourceMappingURL=toast.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toast.d.ts","sourceRoot":"","sources":["../../../src/components/display/toast.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,iBAAiB,OAAO,CAAA;AAErC,wBAAgB,KAAK,mDAgEpB"}
@@ -1,224 +0,0 @@
1
- import { c as _c } from "react/compiler-runtime";
2
- import React, { useEffect, useSyncExternalStore } from 'react';
3
- import { AccessibilityInfo, StyleSheet, View } from 'react-native';
4
- import Animated, { FadeInDown, FadeOutDown, ReduceMotion } from 'react-native-reanimated';
5
- import { useSafeAreaInsets } from 'react-native-safe-area-context';
6
- import { useReduceMotion, useTheme } from '../../hooks';
7
- import { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils/styles';
8
- import { dismissToast, toastStore } from '../../utils/toast_store';
9
- import { Text } from './text';
10
- import { TextButton } from './text_button';
11
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
- export const TOAST_DURATION_MS = 5000;
13
- export function Toast() {
14
- const $ = _c(32);
15
- const toast = useSyncExternalStore(toastStore.subscribe, toastStore.getSnapshot);
16
- const styles = useStyles();
17
- const reduceMotion = useReduceMotion() ? ReduceMotion.Always : ReduceMotion.Never;
18
- let t0;
19
- let t1;
20
- if ($[0] !== toast) {
21
- t0 = () => {
22
- if (!toast) {
23
- return;
24
- }
25
- AccessibilityInfo.announceForAccessibility([toast.title, toast.subtitle].filter(Boolean).join(". "));
26
- const timeout = setTimeout(() => dismissToast(toast.id), TOAST_DURATION_MS);
27
- return () => clearTimeout(timeout);
28
- };
29
- t1 = [toast];
30
- $[0] = toast;
31
- $[1] = t0;
32
- $[2] = t1;
33
- } else {
34
- t0 = $[1];
35
- t1 = $[2];
36
- }
37
- useEffect(t0, t1);
38
- let t2;
39
- if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
40
- t2 = [];
41
- $[3] = t2;
42
- } else {
43
- t2 = $[3];
44
- }
45
- useEffect(_temp2, t2);
46
- if (!toast) {
47
- return null;
48
- }
49
- const {
50
- id,
51
- title,
52
- subtitle,
53
- action
54
- } = toast;
55
- const t3 = styles.container;
56
- let t4;
57
- if ($[4] !== reduceMotion) {
58
- t4 = FadeInDown.duration(200).reduceMotion(reduceMotion);
59
- $[4] = reduceMotion;
60
- $[5] = t4;
61
- } else {
62
- t4 = $[5];
63
- }
64
- let t5;
65
- if ($[6] !== reduceMotion) {
66
- t5 = FadeOutDown.duration(200).reduceMotion(reduceMotion);
67
- $[6] = reduceMotion;
68
- $[7] = t5;
69
- } else {
70
- t5 = $[7];
71
- }
72
- let t6;
73
- if ($[8] !== styles.title || $[9] !== title) {
74
- t6 = /*#__PURE__*/_jsx(Text, {
75
- style: styles.title,
76
- maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK,
77
- accessibilityRole: "alert",
78
- children: title
79
- });
80
- $[8] = styles.title;
81
- $[9] = title;
82
- $[10] = t6;
83
- } else {
84
- t6 = $[10];
85
- }
86
- let t7;
87
- if ($[11] !== styles.subtitle || $[12] !== subtitle) {
88
- t7 = Boolean(subtitle) && /*#__PURE__*/_jsx(Text, {
89
- variant: "footnote",
90
- style: styles.subtitle,
91
- maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK,
92
- children: subtitle
93
- });
94
- $[11] = styles.subtitle;
95
- $[12] = subtitle;
96
- $[13] = t7;
97
- } else {
98
- t7 = $[13];
99
- }
100
- let t8;
101
- if ($[14] !== styles.content || $[15] !== t6 || $[16] !== t7) {
102
- t8 = /*#__PURE__*/_jsxs(View, {
103
- style: styles.content,
104
- children: [t6, t7]
105
- });
106
- $[14] = styles.content;
107
- $[15] = t6;
108
- $[16] = t7;
109
- $[17] = t8;
110
- } else {
111
- t8 = $[17];
112
- }
113
- let t9;
114
- if ($[18] !== action || $[19] !== id || $[20] !== styles.actionText) {
115
- t9 = action && /*#__PURE__*/_jsx(TextButton, {
116
- textStyle: styles.actionText,
117
- maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER_LANDMARK,
118
- onPress: () => {
119
- dismissToast(id);
120
- action.onPress();
121
- },
122
- children: action.label
123
- });
124
- $[18] = action;
125
- $[19] = id;
126
- $[20] = styles.actionText;
127
- $[21] = t9;
128
- } else {
129
- t9 = $[21];
130
- }
131
- let t10;
132
- if ($[22] !== id || $[23] !== styles.toast || $[24] !== t4 || $[25] !== t5 || $[26] !== t8 || $[27] !== t9) {
133
- t10 = /*#__PURE__*/_jsxs(Animated.View, {
134
- entering: t4,
135
- exiting: t5,
136
- style: styles.toast,
137
- accessibilityLiveRegion: "polite",
138
- testID: "toast",
139
- children: [t8, t9]
140
- }, id);
141
- $[22] = id;
142
- $[23] = styles.toast;
143
- $[24] = t4;
144
- $[25] = t5;
145
- $[26] = t8;
146
- $[27] = t9;
147
- $[28] = t10;
148
- } else {
149
- t10 = $[28];
150
- }
151
- let t11;
152
- if ($[29] !== styles.container || $[30] !== t10) {
153
- t11 = /*#__PURE__*/_jsx(View, {
154
- style: t3,
155
- pointerEvents: "box-none",
156
- children: t10
157
- });
158
- $[29] = styles.container;
159
- $[30] = t10;
160
- $[31] = t11;
161
- } else {
162
- t11 = $[31];
163
- }
164
- return t11;
165
- }
166
- function _temp2() {
167
- return _temp;
168
- }
169
- function _temp() {
170
- return dismissToast();
171
- }
172
- const useStyles = () => {
173
- const $ = _c(5);
174
- const {
175
- colors
176
- } = useTheme();
177
- const {
178
- bottom
179
- } = useSafeAreaInsets();
180
- let t0;
181
- if ($[0] !== bottom || $[1] !== colors.fillColorNeutral010 || $[2] !== colors.fillColorNeutral070 || $[3] !== colors.fillColorNeutral100Inverted) {
182
- t0 = StyleSheet.create({
183
- container: {
184
- position: "absolute",
185
- left: 0,
186
- right: 0,
187
- bottom: bottom + 16,
188
- paddingHorizontal: 16
189
- },
190
- toast: {
191
- flexDirection: "row",
192
- alignItems: "center",
193
- gap: 16,
194
- paddingVertical: 12,
195
- paddingHorizontal: 16,
196
- borderRadius: 8,
197
- backgroundColor: colors.fillColorNeutral010
198
- },
199
- content: {
200
- flex: 1,
201
- gap: 2
202
- },
203
- title: {
204
- color: colors.fillColorNeutral100Inverted,
205
- fontWeight: "600"
206
- },
207
- subtitle: {
208
- color: colors.fillColorNeutral070
209
- },
210
- actionText: {
211
- color: colors.fillColorNeutral100Inverted
212
- }
213
- });
214
- $[0] = bottom;
215
- $[1] = colors.fillColorNeutral010;
216
- $[2] = colors.fillColorNeutral070;
217
- $[3] = colors.fillColorNeutral100Inverted;
218
- $[4] = t0;
219
- } else {
220
- t0 = $[4];
221
- }
222
- return t0;
223
- };
224
- //# sourceMappingURL=toast.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toast.js","names":["React","useEffect","useSyncExternalStore","AccessibilityInfo","StyleSheet","View","Animated","FadeInDown","FadeOutDown","ReduceMotion","useSafeAreaInsets","useReduceMotion","useTheme","MAX_FONT_SIZE_MULTIPLIER_LANDMARK","dismissToast","toastStore","Text","TextButton","jsx","_jsx","jsxs","_jsxs","TOAST_DURATION_MS","Toast","$","_c","toast","subscribe","getSnapshot","styles","useStyles","reduceMotion","Always","Never","t0","t1","announceForAccessibility","title","subtitle","filter","Boolean","join","timeout","setTimeout","id","clearTimeout","t2","Symbol","for","_temp2","action","t3","container","t4","duration","t5","t6","style","accessibilityRole","children","t7","variant","t8","content","t9","actionText","textStyle","onPress","label","t10","entering","exiting","accessibilityLiveRegion","testID","t11","pointerEvents","_temp","colors","bottom","fillColorNeutral010","fillColorNeutral070","fillColorNeutral100Inverted","create","position","left","right","paddingHorizontal","flexDirection","alignItems","gap","paddingVertical","borderRadius","backgroundColor","flex","color","fontWeight"],"sources":["../../../src/components/display/toast.tsx"],"sourcesContent":["import React, { useEffect, useSyncExternalStore } from 'react'\nimport { AccessibilityInfo, StyleSheet, View } from 'react-native'\nimport Animated, { FadeInDown, FadeOutDown, ReduceMotion } from 'react-native-reanimated'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { useReduceMotion, useTheme } from '../../hooks'\nimport { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils/styles'\nimport { dismissToast, toastStore } from '../../utils/toast_store'\nimport { Text } from './text'\nimport { TextButton } from './text_button'\n\nexport const TOAST_DURATION_MS = 5000\n\nexport function Toast() {\n const toast = useSyncExternalStore(toastStore.subscribe, toastStore.getSnapshot)\n const styles = useStyles()\n const reduceMotion = useReduceMotion() ? ReduceMotion.Always : ReduceMotion.Never\n\n useEffect(() => {\n if (!toast) return\n\n AccessibilityInfo.announceForAccessibility(\n [toast.title, toast.subtitle].filter(Boolean).join('. ')\n )\n const timeout = setTimeout(() => dismissToast(toast.id), TOAST_DURATION_MS)\n return () => clearTimeout(timeout)\n }, [toast])\n\n useEffect(() => () => dismissToast(), [])\n\n if (!toast) return null\n\n const { id, title, subtitle, action } = toast\n\n return (\n <View style={styles.container} pointerEvents=\"box-none\">\n <Animated.View\n key={id}\n entering={FadeInDown.duration(200).reduceMotion(reduceMotion)}\n exiting={FadeOutDown.duration(200).reduceMotion(reduceMotion)}\n style={styles.toast}\n accessibilityLiveRegion=\"polite\"\n testID=\"toast\"\n >\n <View style={styles.content}>\n <Text\n style={styles.title}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n accessibilityRole=\"alert\"\n >\n {title}\n </Text>\n {Boolean(subtitle) && (\n <Text\n variant=\"footnote\"\n style={styles.subtitle}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n >\n {subtitle}\n </Text>\n )}\n </View>\n {action && (\n <TextButton\n textStyle={styles.actionText}\n maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}\n onPress={() => {\n dismissToast(id)\n action.onPress()\n }}\n >\n {action.label}\n </TextButton>\n )}\n </Animated.View>\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n container: {\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: bottom + 16,\n paddingHorizontal: 16,\n },\n toast: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 16,\n paddingVertical: 12,\n paddingHorizontal: 16,\n borderRadius: 8,\n backgroundColor: colors.fillColorNeutral010,\n },\n content: {\n flex: 1,\n gap: 2,\n },\n title: {\n color: colors.fillColorNeutral100Inverted,\n fontWeight: '600',\n },\n subtitle: {\n color: colors.fillColorNeutral070,\n },\n actionText: {\n color: colors.fillColorNeutral100Inverted,\n },\n })\n}\n"],"mappings":";AAAA,OAAOA,KAAK,IAAIC,SAAS,EAAEC,oBAAoB,QAAQ,OAAO;AAC9D,SAASC,iBAAiB,EAAEC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAClE,OAAOC,QAAQ,IAAIC,UAAU,EAAEC,WAAW,EAAEC,YAAY,QAAQ,yBAAyB;AACzF,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SAASC,eAAe,EAAEC,QAAQ,QAAQ,aAAa;AACvD,SAASC,iCAAiC,QAAQ,oBAAoB;AACtE,SAASC,YAAY,EAAEC,UAAU,QAAQ,yBAAyB;AAClE,SAASC,IAAI,QAAQ,QAAQ;AAC7B,SAASC,UAAU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A,EACHjB,MAAM,CAAAI;MACf;IACF,CAAC,CAAC;IAAAzD,CAAA,MAAAsD,MAAA;IAAAtD,CAAA,MAAAqD,MAAA,CAAAE,mBAAA;IAAAvD,CAAA,MAAAqD,MAAA,CAAAG,mBAAA;IAAAxD,CAAA,MAAAqD,MAAA,CAAAI,2BAAA;IAAAzD,CAAA,MAAAU,EAAA;EAAA;IAAAA,EAAA,GAAAV,CAAA;EAAA;EAAA,OA/BKU,EA+BL;AAAA,CACH","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export declare function useHiddenConversationsCount(): number;
2
- //# sourceMappingURL=use_hidden_conversations_count.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use_hidden_conversations_count.d.ts","sourceRoot":"","sources":["../../src/hooks/use_hidden_conversations_count.ts"],"names":[],"mappings":"AAKA,wBAAgB,2BAA2B,WAQ1C"}