@planningcenter/chat-react-native 4.7.1-qa-staging.1 → 4.7.1-qa-1092.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 (175) hide show
  1. package/build/components/conversations/conversation_actions.d.ts.map +1 -1
  2. package/build/components/conversations/conversation_actions.js +193 -333
  3. package/build/components/conversations/conversation_actions.js.map +1 -1
  4. package/build/components/conversations/conversation_preview.d.ts.map +1 -1
  5. package/build/components/conversations/conversation_preview.js +91 -106
  6. package/build/components/conversations/conversation_preview.js.map +1 -1
  7. package/build/components/conversations/conversations.d.ts.map +1 -1
  8. package/build/components/conversations/conversations.js +56 -63
  9. package/build/components/conversations/conversations.js.map +1 -1
  10. package/build/components/conversations/conversations_blank_state.d.ts +1 -2
  11. package/build/components/conversations/conversations_blank_state.d.ts.map +1 -1
  12. package/build/components/conversations/conversations_blank_state.js +39 -71
  13. package/build/components/conversations/conversations_blank_state.js.map +1 -1
  14. package/build/components/group_conversation_list.d.ts.map +1 -1
  15. package/build/components/group_conversation_list.js +0 -1
  16. package/build/components/group_conversation_list.js.map +1 -1
  17. package/build/contexts/conversations_context.d.ts +1 -3
  18. package/build/contexts/conversations_context.d.ts.map +1 -1
  19. package/build/contexts/conversations_context.js +31 -39
  20. package/build/contexts/conversations_context.js.map +1 -1
  21. package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +0 -6
  22. package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -1
  23. package/build/hooks/use_api.d.ts +0 -6
  24. package/build/hooks/use_api.d.ts.map +1 -1
  25. package/build/hooks/use_api.js +5 -8
  26. package/build/hooks/use_api.js.map +1 -1
  27. package/build/hooks/use_clear_conversation_filters.d.ts.map +1 -1
  28. package/build/hooks/use_clear_conversation_filters.js +0 -1
  29. package/build/hooks/use_clear_conversation_filters.js.map +1 -1
  30. package/build/hooks/use_conversation.d.ts.map +1 -1
  31. package/build/hooks/use_conversation.js +1 -1
  32. package/build/hooks/use_conversation.js.map +1 -1
  33. package/build/hooks/use_features.d.ts +0 -1
  34. package/build/hooks/use_features.d.ts.map +1 -1
  35. package/build/hooks/use_features.js +1 -2
  36. package/build/hooks/use_features.js.map +1 -1
  37. package/build/hooks/use_groups.d.ts +0 -6
  38. package/build/hooks/use_groups.d.ts.map +1 -1
  39. package/build/hooks/use_groups_groups.d.ts +0 -6
  40. package/build/hooks/use_groups_groups.d.ts.map +1 -1
  41. package/build/hooks/use_teams.d.ts +0 -6
  42. package/build/hooks/use_teams.d.ts.map +1 -1
  43. package/build/navigation/index.d.ts +0 -5
  44. package/build/navigation/index.d.ts.map +1 -1
  45. package/build/navigation/index.js +0 -5
  46. package/build/navigation/index.js.map +1 -1
  47. package/build/screens/conversation_details_screen.d.ts.map +1 -1
  48. package/build/screens/conversation_details_screen.js +394 -460
  49. package/build/screens/conversation_details_screen.js.map +1 -1
  50. package/build/screens/conversation_filters/components/conversation_filters.d.ts.map +1 -1
  51. package/build/screens/conversation_filters/components/conversation_filters.js +12 -53
  52. package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
  53. package/build/screens/conversation_filters/components/rows.d.ts +3 -6
  54. package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
  55. package/build/screens/conversation_filters/components/rows.js +62 -99
  56. package/build/screens/conversation_filters/components/rows.js.map +1 -1
  57. package/build/screens/conversation_filters/context/conversation_filter_context.d.ts.map +1 -1
  58. package/build/screens/conversation_filters/context/conversation_filter_context.js +0 -4
  59. package/build/screens/conversation_filters/context/conversation_filter_context.js.map +1 -1
  60. package/build/screens/conversation_filters/filter_types.d.ts +0 -1
  61. package/build/screens/conversation_filters/filter_types.d.ts.map +1 -1
  62. package/build/screens/conversation_filters/filter_types.js +0 -1
  63. package/build/screens/conversation_filters/filter_types.js.map +1 -1
  64. package/build/screens/conversation_filters/hooks/filters.d.ts +0 -12
  65. package/build/screens/conversation_filters/hooks/filters.d.ts.map +1 -1
  66. package/build/screens/conversation_filters/screen_props.d.ts +0 -1
  67. package/build/screens/conversation_filters/screen_props.d.ts.map +1 -1
  68. package/build/screens/conversation_filters/screen_props.js.map +1 -1
  69. package/build/screens/conversations/components/filter_dropdown_list_header_component.d.ts.map +1 -1
  70. package/build/screens/conversations/components/filter_dropdown_list_header_component.js +126 -138
  71. package/build/screens/conversations/components/filter_dropdown_list_header_component.js.map +1 -1
  72. package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
  73. package/build/screens/conversations/components/list_header_component.js +90 -95
  74. package/build/screens/conversations/components/list_header_component.js.map +1 -1
  75. package/build/screens/conversations/components/search_list_header_component.d.ts.map +1 -1
  76. package/build/screens/conversations/components/search_list_header_component.js +95 -100
  77. package/build/screens/conversations/components/search_list_header_component.js.map +1 -1
  78. package/build/screens/conversations/conversations_screen.d.ts +0 -1
  79. package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
  80. package/build/screens/conversations/conversations_screen.js +10 -18
  81. package/build/screens/conversations/conversations_screen.js.map +1 -1
  82. package/build/screens/index.d.ts +0 -1
  83. package/build/screens/index.d.ts.map +1 -1
  84. package/build/screens/index.js +0 -1
  85. package/build/screens/index.js.map +1 -1
  86. package/build/types/resources/conversation_membership.d.ts +0 -1
  87. package/build/types/resources/conversation_membership.d.ts.map +1 -1
  88. package/build/types/resources/conversation_membership.js.map +1 -1
  89. package/build/utils/request/conversation.d.ts +1 -3
  90. package/build/utils/request/conversation.d.ts.map +1 -1
  91. package/build/utils/request/conversation.js +0 -4
  92. package/build/utils/request/conversation.js.map +1 -1
  93. package/build/vendor/font_awesome_pro_solid_icons.d.ts +0 -1
  94. package/build/vendor/font_awesome_pro_solid_icons.d.ts.map +1 -1
  95. package/build/vendor/font_awesome_pro_solid_icons.js +0 -5
  96. package/build/vendor/font_awesome_pro_solid_icons.js.map +1 -1
  97. package/package.json +3 -3
  98. package/src/__tests__/screens/conversation_filters/components/conversation_filters.test.tsx +0 -6
  99. package/src/components/conversations/__tests__/conversation_actions.test.tsx +2 -77
  100. package/src/components/conversations/__tests__/conversation_preview.test.tsx +0 -29
  101. package/src/components/conversations/__tests__/conversations.test.tsx +0 -26
  102. package/src/components/conversations/__tests__/conversations_blank_state.test.tsx +0 -17
  103. package/src/components/conversations/conversation_actions.tsx +4 -73
  104. package/src/components/conversations/conversation_preview.tsx +1 -12
  105. package/src/components/conversations/conversations.tsx +0 -9
  106. package/src/components/conversations/conversations_blank_state.tsx +0 -18
  107. package/src/components/group_conversation_list.tsx +1 -4
  108. package/src/contexts/conversations_context.tsx +1 -8
  109. package/src/hooks/use_api.ts +1 -2
  110. package/src/hooks/use_clear_conversation_filters.ts +0 -1
  111. package/src/hooks/use_conversation.ts +0 -1
  112. package/src/hooks/use_features.ts +0 -1
  113. package/src/navigation/index.tsx +0 -8
  114. package/src/screens/__tests__/conversation_details_screen.test.tsx +1 -49
  115. package/src/screens/conversation_details_screen.tsx +0 -19
  116. package/src/screens/conversation_filters/__tests__/conversation_filters.test.tsx +0 -42
  117. package/src/screens/conversation_filters/components/conversation_filters.tsx +3 -22
  118. package/src/screens/conversation_filters/components/rows.tsx +10 -44
  119. package/src/screens/conversation_filters/context/conversation_filter_context.tsx +0 -4
  120. package/src/screens/conversation_filters/filter_types.ts +0 -1
  121. package/src/screens/conversation_filters/screen_props.ts +0 -1
  122. package/src/screens/conversations/__tests__/conversations_screen.test.tsx +0 -1
  123. package/src/screens/conversations/components/__tests__/filter_dropdown_list_header_component.test.tsx +0 -42
  124. package/src/screens/conversations/components/__tests__/list_header_component.test.tsx +0 -1
  125. package/src/screens/conversations/components/filter_dropdown_list_header_component.tsx +5 -21
  126. package/src/screens/conversations/components/list_header_component.tsx +4 -14
  127. package/src/screens/conversations/components/search_list_header_component.tsx +4 -14
  128. package/src/screens/conversations/conversations_screen.tsx +0 -3
  129. package/src/screens/index.ts +0 -1
  130. package/src/types/resources/conversation_membership.ts +0 -1
  131. package/src/utils/request/conversation.ts +0 -6
  132. package/src/vendor/font_awesome_pro_solid_icons.ts +0 -12
  133. package/build/components/conversations/hidden_indicator.d.ts +0 -4
  134. package/build/components/conversations/hidden_indicator.d.ts.map +0 -1
  135. package/build/components/conversations/hidden_indicator.js +0 -52
  136. package/build/components/conversations/hidden_indicator.js.map +0 -1
  137. package/build/components/conversations/hidden_results_footer.d.ts +0 -2
  138. package/build/components/conversations/hidden_results_footer.d.ts.map +0 -1
  139. package/build/components/conversations/hidden_results_footer.js +0 -34
  140. package/build/components/conversations/hidden_results_footer.js.map +0 -1
  141. package/build/components/display/toast.d.ts +0 -3
  142. package/build/components/display/toast.d.ts.map +0 -1
  143. package/build/components/display/toast.js +0 -224
  144. package/build/components/display/toast.js.map +0 -1
  145. package/build/hooks/use_hidden_conversations_count.d.ts +0 -2
  146. package/build/hooks/use_hidden_conversations_count.d.ts.map +0 -1
  147. package/build/hooks/use_hidden_conversations_count.js +0 -32
  148. package/build/hooks/use_hidden_conversations_count.js.map +0 -1
  149. package/build/hooks/use_hide_conversation.d.ts +0 -108
  150. package/build/hooks/use_hide_conversation.d.ts.map +0 -1
  151. package/build/hooks/use_hide_conversation.js +0 -243
  152. package/build/hooks/use_hide_conversation.js.map +0 -1
  153. package/build/hooks/use_hide_conversations_enabled.d.ts +0 -2
  154. package/build/hooks/use_hide_conversations_enabled.d.ts.map +0 -1
  155. package/build/hooks/use_hide_conversations_enabled.js +0 -18
  156. package/build/hooks/use_hide_conversations_enabled.js.map +0 -1
  157. package/build/screens/conversation_actions_screen.d.ts +0 -7
  158. package/build/screens/conversation_actions_screen.d.ts.map +0 -1
  159. package/build/screens/conversation_actions_screen.js +0 -89
  160. package/build/screens/conversation_actions_screen.js.map +0 -1
  161. package/build/utils/toast_store.d.ts +0 -21
  162. package/build/utils/toast_store.d.ts.map +0 -1
  163. package/build/utils/toast_store.js +0 -27
  164. package/build/utils/toast_store.js.map +0 -1
  165. package/src/components/conversations/hidden_indicator.tsx +0 -30
  166. package/src/components/conversations/hidden_results_footer.tsx +0 -25
  167. package/src/components/display/__tests__/toast.test.tsx +0 -55
  168. package/src/components/display/toast.tsx +0 -115
  169. package/src/hooks/__tests__/use_hide_conversation.test.tsx +0 -189
  170. package/src/hooks/use_hidden_conversations_count.ts +0 -14
  171. package/src/hooks/use_hide_conversation.ts +0 -128
  172. package/src/hooks/use_hide_conversations_enabled.ts +0 -7
  173. package/src/screens/__tests__/conversation_actions_screen.test.tsx +0 -79
  174. package/src/screens/conversation_actions_screen.tsx +0 -53
  175. package/src/utils/toast_store.ts +0 -45
@@ -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,QAAQ,eAAe;AAAA,SAAAC,GAAA,IAAAC,I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C;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"}
@@ -1,32 +0,0 @@
1
- import { c as _c } from "react/compiler-runtime";
2
- import { getConversationsRequestArgs } from '../utils/request/conversation';
3
- import { useApiPaginator } from './use_api';
4
- import { useHideConversationsEnabled } from './use_hide_conversations_enabled';
5
- export function useHiddenConversationsCount() {
6
- const $ = _c(3);
7
- const enabled = useHideConversationsEnabled();
8
- let t0;
9
- if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
10
- t0 = getConversationsRequestArgs({
11
- show_hidden: true
12
- });
13
- $[0] = t0;
14
- } else {
15
- t0 = $[0];
16
- }
17
- let t1;
18
- if ($[1] !== enabled) {
19
- t1 = {
20
- enabled
21
- };
22
- $[1] = enabled;
23
- $[2] = t1;
24
- } else {
25
- t1 = $[2];
26
- }
27
- const {
28
- totalCount
29
- } = useApiPaginator(t0, t1);
30
- return enabled ? totalCount : 0;
31
- }
32
- //# sourceMappingURL=use_hidden_conversations_count.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use_hidden_conversations_count.js","names":["getConversationsRequestArgs","useApiPaginator","useHideConversationsEnabled","useHiddenConversationsCount","$","_c","enabled","t0","Symbol","for","show_hidden","t1","totalCount"],"sources":["../../src/hooks/use_hidden_conversations_count.ts"],"sourcesContent":["import { ConversationResource } from '../types'\nimport { getConversationsRequestArgs } from '../utils/request/conversation'\nimport { useApiPaginator } from './use_api'\nimport { useHideConversationsEnabled } from './use_hide_conversations_enabled'\n\nexport function useHiddenConversationsCount() {\n const enabled = useHideConversationsEnabled()\n const { totalCount } = useApiPaginator<ConversationResource>(\n getConversationsRequestArgs({ show_hidden: true }),\n { enabled }\n )\n\n return enabled ? totalCount : 0\n}\n"],"mappings":";AACA,SAASA,2BAA2B,QAAQ,+BAA+B;AAC3E,SAASC,eAAe,QAAQ,WAAW;AAC3C,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,OAAO,SAAAC,4BAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EACL,MAAAC,OAAA,GAAgBJ,2BAA2B,CAAC,CAAC;EAAA,IAAAK,EAAA;EAAA,IAAAH,CAAA,QAAAI,MAAA,CAAAC,GAAA;IAE3CF,EAAA,GAAAP,2BAA2B,CAAC;MAAAU,WAAA,EAAe;IAAK,CAAC,CAAC;IAAAN,CAAA,MAAAG,EAAA;EAAA;IAAAA,EAAA,GAAAH,CAAA;EAAA;EAAA,IAAAO,EAAA;EAAA,IAAAP,CAAA,QAAAE,OAAA;IAClDK,EAAA;MAAAL;IAAU,CAAC;IAAAF,CAAA,MAAAE,OAAA;IAAAF,CAAA,MAAAO,EAAA;EAAA;IAAAA,EAAA,GAAAP,CAAA;EAAA;EAFb;IAAAQ;EAAA,IAAuBX,eAAe,CACpCM,EAAkD,EAClDI,EACF,CAAC;EAAA,OAEML,OAAO,GAAPM,UAAwB,GAAxB,CAAwB;AAAA","ignoreList":[]}
@@ -1,108 +0,0 @@
1
- import { InfiniteData } from '@tanstack/react-query';
2
- import { ApiCollection, ApiResource, ConversationMembershipResource, ConversationResource } from '../types';
3
- type ConversationsData = InfiniteData<ApiCollection<ConversationResource>>;
4
- export declare const HIDDEN_TOAST_TITLE = "Conversation hidden";
5
- export declare const HIDDEN_TOAST_SUBTITLE = "It'll come back if someone sends a new message.";
6
- export declare const HIDDEN_AND_SILENCED_TOAST_SUBTITLE = "It's silenced too, so it stays hidden until you unhide it.";
7
- export declare const useHideConversation: ({ conversation, hidden: knownHidden, }: {
8
- conversation: ConversationResource;
9
- hidden?: boolean;
10
- }) => {
11
- data: undefined;
12
- variables: undefined;
13
- error: null;
14
- isError: false;
15
- isIdle: true;
16
- isPending: false;
17
- isSuccess: false;
18
- status: "idle";
19
- reset: () => void;
20
- context: {
21
- previousLists: [readonly unknown[], ConversationsData | undefined][];
22
- } | undefined;
23
- failureCount: number;
24
- failureReason: Error | null;
25
- isPaused: boolean;
26
- submittedAt: number;
27
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
28
- previousLists: [readonly unknown[], ConversationsData | undefined][];
29
- }>;
30
- hidden: boolean;
31
- setHidden: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
32
- previousLists: [readonly unknown[], ConversationsData | undefined][];
33
- }>;
34
- } | {
35
- data: undefined;
36
- variables: boolean;
37
- error: null;
38
- isError: false;
39
- isIdle: false;
40
- isPending: true;
41
- isSuccess: false;
42
- status: "pending";
43
- reset: () => void;
44
- context: {
45
- previousLists: [readonly unknown[], ConversationsData | undefined][];
46
- } | undefined;
47
- failureCount: number;
48
- failureReason: Error | null;
49
- isPaused: boolean;
50
- submittedAt: number;
51
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
52
- previousLists: [readonly unknown[], ConversationsData | undefined][];
53
- }>;
54
- hidden: boolean;
55
- setHidden: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
56
- previousLists: [readonly unknown[], ConversationsData | undefined][];
57
- }>;
58
- } | {
59
- data: undefined;
60
- error: Error;
61
- variables: boolean;
62
- isError: true;
63
- isIdle: false;
64
- isPending: false;
65
- isSuccess: false;
66
- status: "error";
67
- reset: () => void;
68
- context: {
69
- previousLists: [readonly unknown[], ConversationsData | undefined][];
70
- } | undefined;
71
- failureCount: number;
72
- failureReason: Error | null;
73
- isPaused: boolean;
74
- submittedAt: number;
75
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
76
- previousLists: [readonly unknown[], ConversationsData | undefined][];
77
- }>;
78
- hidden: boolean;
79
- setHidden: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
80
- previousLists: [readonly unknown[], ConversationsData | undefined][];
81
- }>;
82
- } | {
83
- data: ApiResource<ConversationMembershipResource>;
84
- error: null;
85
- variables: boolean;
86
- isError: false;
87
- isIdle: false;
88
- isPending: false;
89
- isSuccess: true;
90
- status: "success";
91
- reset: () => void;
92
- context: {
93
- previousLists: [readonly unknown[], ConversationsData | undefined][];
94
- } | undefined;
95
- failureCount: number;
96
- failureReason: Error | null;
97
- isPaused: boolean;
98
- submittedAt: number;
99
- mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
100
- previousLists: [readonly unknown[], ConversationsData | undefined][];
101
- }>;
102
- hidden: boolean;
103
- setHidden: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
104
- previousLists: [readonly unknown[], ConversationsData | undefined][];
105
- }>;
106
- };
107
- export {};
108
- //# sourceMappingURL=use_hide_conversation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use_hide_conversation.d.ts","sourceRoot":"","sources":["../../src/hooks/use_hide_conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAyC,MAAM,uBAAuB,CAAA;AAE3F,OAAO,EACL,aAAa,EACb,WAAW,EACX,8BAA8B,EAC9B,oBAAoB,EACrB,MAAM,UAAU,CAAA;AAYjB,KAAK,iBAAiB,GAAG,YAAY,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC,CAAA;AAG1E,eAAO,MAAM,kBAAkB,wBAAwB,CAAA;AACvD,eAAO,MAAM,qBAAqB,oDAAoD,CAAA;AACtF,eAAO,MAAM,kCAAkC,+DACe,CAAA;AAE9D,eAAO,MAAM,mBAAmB,GAAI,wCAGjC;IACD,YAAY,EAAE,oBAAoB,CAAA;IAClC,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8FA,CAAA"}