@planningcenter/chat-react-native 3.15.0-rc.1 → 3.15.0-rc.10

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 (160) hide show
  1. package/build/components/conversations/conversation_actions.js +1 -1
  2. package/build/components/conversations/conversation_actions.js.map +1 -1
  3. package/build/components/display/action_button.js +1 -3
  4. package/build/components/display/action_button.js.map +1 -1
  5. package/build/components/display/avatar.d.ts +3 -1
  6. package/build/components/display/avatar.d.ts.map +1 -1
  7. package/build/components/display/avatar.js +2 -2
  8. package/build/components/display/avatar.js.map +1 -1
  9. package/build/components/display/avatar_group.d.ts +3 -1
  10. package/build/components/display/avatar_group.d.ts.map +1 -1
  11. package/build/components/display/avatar_group.js +2 -2
  12. package/build/components/display/avatar_group.js.map +1 -1
  13. package/build/components/display/icon.d.ts +26 -13
  14. package/build/components/display/icon.d.ts.map +1 -1
  15. package/build/components/display/icon.js +0 -12
  16. package/build/components/display/icon.js.map +1 -1
  17. package/build/components/display/index.d.ts +1 -0
  18. package/build/components/display/index.d.ts.map +1 -1
  19. package/build/components/display/index.js +1 -0
  20. package/build/components/display/index.js.map +1 -1
  21. package/build/components/display/pressable_row.d.ts +14 -0
  22. package/build/components/display/pressable_row.d.ts.map +1 -0
  23. package/build/components/display/pressable_row.js +65 -0
  24. package/build/components/display/pressable_row.js.map +1 -0
  25. package/build/components/primitive/avatar_primitive.d.ts +2 -0
  26. package/build/components/primitive/avatar_primitive.d.ts.map +1 -1
  27. package/build/components/primitive/avatar_primitive.js +20 -19
  28. package/build/components/primitive/avatar_primitive.js.map +1 -1
  29. package/build/components/primitive/form_sheet.d.ts +3 -2
  30. package/build/components/primitive/form_sheet.d.ts.map +1 -1
  31. package/build/components/primitive/form_sheet.js +5 -3
  32. package/build/components/primitive/form_sheet.js.map +1 -1
  33. package/build/hooks/use_api.d.ts +1 -1
  34. package/build/hooks/use_api.d.ts.map +1 -1
  35. package/build/hooks/use_api.js.map +1 -1
  36. package/build/hooks/use_api_client.d.ts +1 -1
  37. package/build/hooks/use_api_client.d.ts.map +1 -1
  38. package/build/hooks/use_api_client.js +1 -1
  39. package/build/hooks/use_api_client.js.map +1 -1
  40. package/build/hooks/use_app_name.d.ts +3 -0
  41. package/build/hooks/use_app_name.d.ts.map +1 -0
  42. package/build/hooks/use_app_name.js +12 -0
  43. package/build/hooks/use_app_name.js.map +1 -0
  44. package/build/hooks/use_async_storage.d.ts +1 -1
  45. package/build/hooks/use_async_storage.d.ts.map +1 -1
  46. package/build/hooks/use_async_storage.js +6 -5
  47. package/build/hooks/use_async_storage.js.map +1 -1
  48. package/build/hooks/use_report_bug_action.d.ts +1 -1
  49. package/build/hooks/use_report_bug_action.d.ts.map +1 -1
  50. package/build/hooks/use_report_bug_action.js +1 -9
  51. package/build/hooks/use_report_bug_action.js.map +1 -1
  52. package/build/hooks/use_suspense_api.d.ts +1 -1
  53. package/build/hooks/use_suspense_api.d.ts.map +1 -1
  54. package/build/hooks/use_suspense_api.js.map +1 -1
  55. package/build/index.d.ts +2 -0
  56. package/build/index.d.ts.map +1 -1
  57. package/build/index.js +2 -0
  58. package/build/index.js.map +1 -1
  59. package/build/navigation/index.d.ts +20 -5
  60. package/build/navigation/index.d.ts.map +1 -1
  61. package/build/navigation/index.js +23 -15
  62. package/build/navigation/index.js.map +1 -1
  63. package/build/polyfills/events/CustomEvent.d.ts +21 -0
  64. package/build/polyfills/events/CustomEvent.d.ts.map +1 -0
  65. package/build/polyfills/events/CustomEvent.js +22 -0
  66. package/build/polyfills/events/CustomEvent.js.map +1 -0
  67. package/build/polyfills/events/Event.d.ts +49 -0
  68. package/build/polyfills/events/Event.d.ts.map +1 -0
  69. package/build/polyfills/events/Event.js +125 -0
  70. package/build/polyfills/events/Event.js.map +1 -0
  71. package/build/polyfills/events/EventHandlerAttributes.d.ts +8 -0
  72. package/build/polyfills/events/EventHandlerAttributes.d.ts.map +1 -0
  73. package/build/polyfills/events/EventHandlerAttributes.js +46 -0
  74. package/build/polyfills/events/EventHandlerAttributes.js.map +1 -0
  75. package/build/polyfills/events/EventTarget.d.ts +33 -0
  76. package/build/polyfills/events/EventTarget.d.ts.map +1 -0
  77. package/build/polyfills/events/EventTarget.js +238 -0
  78. package/build/polyfills/events/EventTarget.js.map +1 -0
  79. package/build/polyfills/events/internals/EventInternals.d.ts +30 -0
  80. package/build/polyfills/events/internals/EventInternals.d.ts.map +1 -0
  81. package/build/polyfills/events/internals/EventInternals.js +76 -0
  82. package/build/polyfills/events/internals/EventInternals.js.map +1 -0
  83. package/build/polyfills/events/internals/EventTargetInternals.d.ts +9 -0
  84. package/build/polyfills/events/internals/EventTargetInternals.d.ts.map +1 -0
  85. package/build/polyfills/events/internals/EventTargetInternals.js +11 -0
  86. package/build/polyfills/events/internals/EventTargetInternals.js.map +1 -0
  87. package/build/polyfills/webidl/PlatformObjects.d.ts +31 -0
  88. package/build/polyfills/webidl/PlatformObjects.d.ts.map +1 -0
  89. package/build/polyfills/webidl/PlatformObjects.js +39 -0
  90. package/build/polyfills/webidl/PlatformObjects.js.map +1 -0
  91. package/build/screens/bug_report_screen.d.ts.map +1 -1
  92. package/build/screens/bug_report_screen.js +62 -57
  93. package/build/screens/bug_report_screen.js.map +1 -1
  94. package/build/screens/conversation_filters/components/conversation_filters.js +9 -7
  95. package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
  96. package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
  97. package/build/screens/conversation_filters/components/rows.js +50 -31
  98. package/build/screens/conversation_filters/components/rows.js.map +1 -1
  99. package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
  100. package/build/screens/conversations/conversations_screen.js +6 -6
  101. package/build/screens/conversations/conversations_screen.js.map +1 -1
  102. package/build/screens/design_system_screen.js +1 -1
  103. package/build/screens/design_system_screen.js.map +1 -1
  104. package/build/screens/get_help_screen.d.ts +5 -0
  105. package/build/screens/get_help_screen.d.ts.map +1 -0
  106. package/build/screens/get_help_screen.js +94 -0
  107. package/build/screens/get_help_screen.js.map +1 -0
  108. package/build/screens/message_actions_screen.d.ts +1 -1
  109. package/build/screens/message_actions_screen.d.ts.map +1 -1
  110. package/build/screens/message_actions_screen.js +14 -11
  111. package/build/screens/message_actions_screen.js.map +1 -1
  112. package/build/utils/client/index.d.ts +1 -0
  113. package/build/utils/client/index.d.ts.map +1 -1
  114. package/build/utils/client/index.js +1 -0
  115. package/build/utils/client/index.js.map +1 -1
  116. package/build/utils/client/types.d.ts +61 -0
  117. package/build/utils/client/types.d.ts.map +1 -0
  118. package/build/utils/client/types.js +2 -0
  119. package/build/utils/client/types.js.map +1 -0
  120. package/build/utils/theme.d.ts +1 -0
  121. package/build/utils/theme.d.ts.map +1 -1
  122. package/build/utils/theme.js +2 -0
  123. package/build/utils/theme.js.map +1 -1
  124. package/package.json +5 -5
  125. package/src/__tests__/event-polyfill.test.ts +314 -0
  126. package/src/components/conversations/conversation_actions.tsx +1 -1
  127. package/src/components/display/action_button.tsx +1 -4
  128. package/src/components/display/avatar.tsx +5 -1
  129. package/src/components/display/avatar_group.tsx +5 -1
  130. package/src/components/display/icon.tsx +17 -14
  131. package/src/components/display/index.ts +1 -0
  132. package/src/components/display/pressable_row.tsx +103 -0
  133. package/src/components/primitive/avatar_primitive.tsx +35 -19
  134. package/src/components/primitive/form_sheet.tsx +33 -5
  135. package/src/hooks/use_api.ts +1 -1
  136. package/src/hooks/use_api_client.ts +2 -2
  137. package/src/hooks/use_app_name.ts +17 -0
  138. package/src/hooks/use_async_storage.ts +8 -5
  139. package/src/hooks/use_report_bug_action.ts +2 -10
  140. package/src/hooks/use_suspense_api.ts +1 -1
  141. package/src/index.tsx +2 -0
  142. package/src/navigation/index.tsx +38 -25
  143. package/src/polyfills/events/CustomEvent.ts +32 -0
  144. package/src/polyfills/events/Event.ts +186 -0
  145. package/src/polyfills/events/EventHandlerAttributes.ts +67 -0
  146. package/src/polyfills/events/EventTarget.ts +360 -0
  147. package/src/polyfills/events/README.md +1 -0
  148. package/src/polyfills/events/internals/EventInternals.ts +95 -0
  149. package/src/polyfills/events/internals/EventTargetInternals.ts +16 -0
  150. package/src/polyfills/webidl/PlatformObjects.ts +50 -0
  151. package/src/screens/bug_report_screen.tsx +79 -67
  152. package/src/screens/conversation_filters/components/conversation_filters.tsx +10 -7
  153. package/src/screens/conversation_filters/components/rows.tsx +63 -50
  154. package/src/screens/conversations/conversations_screen.tsx +7 -7
  155. package/src/screens/design_system_screen.tsx +1 -1
  156. package/src/screens/get_help_screen.tsx +131 -0
  157. package/src/screens/message_actions_screen.tsx +34 -12
  158. package/src/utils/client/index.ts +1 -0
  159. package/src/utils/theme.ts +3 -0
  160. /package/src/utils/client/{types.d.ts → types.ts} +0 -0
@@ -17,14 +17,17 @@ export const MessageActionsScreenOptions = getFormSheetScreenOptions({
17
17
  headerTitle: 'Message actions',
18
18
  });
19
19
  export function MessageActionsScreen({ route }) {
20
- const navigation = useNavigation();
21
20
  const { conversation_id, message_id, canDeleteNonAuthoredMessages } = route.params;
22
- const apiClient = useApiClient();
23
- const styles = useStyles();
24
21
  const { messages, refetch } = useConversationMessages({ conversation_id }, { refetchOnMount: false });
25
22
  const message = messages.find(m => m.id === message_id);
26
23
  if (!message)
27
- fail('Message not found');
24
+ return null;
25
+ return (<MessageActionsScreenContent message={message} conversation_id={conversation_id} canDeleteNonAuthoredMessages={canDeleteNonAuthoredMessages || false} refetchMessages={refetch}/>);
26
+ }
27
+ function MessageActionsScreenContent({ message, conversation_id, canDeleteNonAuthoredMessages, refetchMessages, }) {
28
+ const navigation = useNavigation();
29
+ const apiClient = useApiClient();
30
+ const styles = useStyles();
28
31
  const myReactions = message?.reactionCounts
29
32
  .filter(reaction => reaction.mine)
30
33
  .map(reaction => reaction.value);
@@ -51,13 +54,13 @@ export function MessageActionsScreen({ route }) {
51
54
  onSuccess: () => navigation.goBack(),
52
55
  });
53
56
  const deleteMessage = useCallback(() => {
54
- const url = `/me/conversations/${conversation_id}/messages/${message_id}/`;
57
+ const url = `/me/conversations/${conversation_id}/messages/${message.id}/`;
55
58
  return apiClient.chat.delete({ url });
56
- }, [apiClient, conversation_id, message_id]);
59
+ }, [apiClient, conversation_id, message.id]);
57
60
  const { mutate: handleDeleteMessage } = useMutation({
58
61
  mutationFn: deleteMessage,
59
62
  onSuccess: () => {
60
- refetch();
63
+ refetchMessages();
61
64
  Haptic.notificationSuccess();
62
65
  navigation.goBack();
63
66
  },
@@ -77,18 +80,18 @@ export function MessageActionsScreen({ route }) {
77
80
  const params = omitBy({
78
81
  ...(targetRoute?.params || {}),
79
82
  conversation_id,
80
- editing_message_id: message_id,
83
+ editing_message_id: message.id,
81
84
  }, isNil);
82
85
  navigation.dispatch(StackActions.popTo('Conversation', params));
83
- }, [navigation, conversation_id, message_id]);
86
+ }, [navigation, conversation_id, message.id]);
84
87
  const handleViewReadReceiptsPress = useCallback(() => {
85
88
  Haptic.impactLight();
86
89
  const params = omitBy({
87
90
  conversation_id,
88
- message_id,
91
+ message_id: message.id,
89
92
  }, isNil);
90
93
  navigation.dispatch(StackActions.popTo('MessageReadReceipts', params));
91
- }, [navigation, conversation_id, message_id]);
94
+ }, [navigation, conversation_id, message.id]);
92
95
  return (<FormSheet.Root style={styles.formSheetContent}>
93
96
  <View style={styles.reactionList}>
94
97
  {availableReactions.map((reaction, index) => (<Reaction key={index} reaction={reaction} onPress={() => {
@@ -1 +1 @@
1
- {"version":3,"file":"message_actions_screen.js","sourceRoot":"","sources":["../../src/screens/message_actions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC1C,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SACf;QACD,YAAY,EAAE;YACZ,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;YACP,UAAU,EAAE,CAAC;YACb,aAAa,EAAE,EAAE;YACjB,iBAAiB,EAAE,MAAM,CAAC,sBAAsB;YAChD,iBAAiB,EAAE,CAAC;SACrB;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,eAAe;YACvB,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,cAAc;YAC3B,YAAY,EAAE,EAAE;YAChB,cAAc,EAAE,QAAQ;YACxB,QAAQ,EAAE,QAAQ;SACnB;QACD,aAAa,EAAE;YACb,QAAQ,EAAE,EAAE;SACb;QACD,OAAO,EAAE;YACP,UAAU,EAAE,CAAC;SACd;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport { useMutation } from '@tanstack/react-query'\nimport { isNil, omitBy } from 'lodash'\nimport React, { useCallback } from 'react'\nimport { Alert, Platform, StyleSheet, View } from 'react-native'\nimport { Text } from '../components'\nimport { REACTION_EMOJIS, useReactionStyles } from '../components/conversation/message_reaction'\nimport FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'\nimport { useCreateAndroidRippleColor, useFontScale, useTheme } from '../hooks'\nimport { useApiClient } from '../hooks/use_api_client'\nimport { useConversationMessages } from '../hooks/use_conversation_messages'\nimport { useMessageReactionToggle } from '../hooks/use_message_reaction_toggle'\nimport { ReactionCountResource } from '../types/resources/reaction'\nimport { Clipboard, Haptic } from '../utils/native_adapters'\n\nexport const MessageActionsScreenOptions = getFormSheetScreenOptions({\n sheetAllowedDetents: [0.5],\n headerTitle: 'Message actions',\n})\n\nexport type MessageActionsScreenProps = StaticScreenProps<{\n message_id: string\n conversation_id: number\n canDeleteNonAuthoredMessages?: boolean\n}>\n\nexport function MessageActionsScreen({ route }: MessageActionsScreenProps) {\n const navigation = useNavigation()\n const { conversation_id, message_id, canDeleteNonAuthoredMessages } = route.params\n\n const apiClient = useApiClient()\n const styles = useStyles()\n\n const { messages, refetch } = useConversationMessages(\n { conversation_id },\n { refetchOnMount: false }\n )\n const message = messages.find(m => m.id === message_id)\n\n if (!message) fail('Message not found')\n\n const myReactions = message?.reactionCounts\n .filter(reaction => reaction.mine)\n .map(reaction => reaction.value)\n\n const availableReactions = Object.entries(REACTION_EMOJIS).map(([value, emoji]) => {\n return {\n value: value as ReactionCountResource['value'],\n emoji,\n mine: myReactions?.includes(value as ReactionCountResource['value']),\n }\n })\n\n const attachmentForCopy = (): string => {\n const giphyTitleLink = message?.attachments.find(\n attachment => attachment.type === 'giphy'\n )?.titleLink\n\n if (giphyTitleLink) return giphyTitleLink\n return ''\n }\n\n const handleCopyPress = () => {\n Clipboard.setStringAsync(message?.text || attachmentForCopy() || '')\n navigation.goBack()\n }\n\n const { handleReactionToggle, isPending } = useMessageReactionToggle({\n conversation_id,\n message,\n onSuccess: () => navigation.goBack(),\n })\n\n const deleteMessage = useCallback(() => {\n const url = `/me/conversations/${conversation_id}/messages/${message_id}/`\n\n return apiClient.chat.delete({ url })\n }, [apiClient, conversation_id, message_id])\n\n const { mutate: handleDeleteMessage } = useMutation({\n mutationFn: deleteMessage,\n onSuccess: () => {\n refetch()\n Haptic.notificationSuccess()\n navigation.goBack()\n },\n onError: () => {\n Alert.alert('Oops', 'We were unable to delete this message. Please try again.')\n },\n })\n\n const handleDeleteConfirm = useCallback(() => {\n Alert.alert('Delete message', 'Are you sure you want to permanently delete this message?', [\n { text: 'Cancel', style: 'cancel' },\n { text: 'Delete', style: 'destructive', onPress: () => handleDeleteMessage() },\n ])\n }, [handleDeleteMessage])\n\n const handleEditPress = useCallback(() => {\n const state = navigation.getState?.()\n const targetRoute = state?.routes?.find(r => r.name === 'Conversation')\n const params = omitBy(\n {\n ...(targetRoute?.params || {}),\n conversation_id,\n editing_message_id: message_id,\n },\n isNil\n )\n navigation.dispatch(StackActions.popTo('Conversation', params))\n }, [navigation, conversation_id, message_id])\n\n const handleViewReadReceiptsPress = useCallback(() => {\n Haptic.impactLight()\n const params = omitBy(\n {\n conversation_id,\n message_id,\n },\n isNil\n )\n navigation.dispatch(StackActions.popTo('MessageReadReceipts', params))\n }, [navigation, conversation_id, message_id])\n\n return (\n <FormSheet.Root style={styles.formSheetContent}>\n <View style={styles.reactionList}>\n {availableReactions.map((reaction, index) => (\n <Reaction\n key={index}\n reaction={reaction}\n onPress={() => {\n Haptic.impactLight()\n handleReactionToggle({\n value: reaction.value,\n mine: reaction.mine,\n })\n }}\n />\n ))}\n </View>\n <View style={styles.actions}>\n <FormSheet.Action\n onPress={handleCopyPress}\n title=\"Copy text\"\n iconName=\"services.fileCopy\"\n accessibilityHint=\"Copies text and links to clipboard\"\n />\n {message?.mine && (\n <FormSheet.Action\n onPress={() => handleEditPress()}\n title=\"Edit message\"\n iconName=\"accounts.editor\"\n accessibilityHint=\"Opens existing text in the message form input.\"\n />\n )}\n {message?.mine && (\n <FormSheet.Action\n onPress={() => handleViewReadReceiptsPress()}\n title=\"View read receipts\"\n iconName=\"general.checkPerson\"\n accessibilityHint=\"Opens a modal with a list of people who read your message.\"\n />\n )}\n {(message?.mine || canDeleteNonAuthoredMessages) && (\n <FormSheet.Action\n onPress={() => handleDeleteConfirm()}\n title=\"Delete message\"\n iconName=\"publishing.trash\"\n appearance=\"danger\"\n disabled={isPending}\n accessibilityHint=\"Opens a confirmation alert to delete this message permanently.\"\n />\n )}\n </View>\n </FormSheet.Root>\n )\n}\n\nconst Reaction = ({\n reaction,\n onPress,\n}: {\n reaction: { value: ReactionCountResource['value']; emoji: string; mine: boolean | undefined }\n onPress: () => void\n}) => {\n const styles = useStyles()\n const reactionStyles = useReactionStyles({ mine: reaction.mine ? 1 : 0 })\n\n const { colors } = useTheme()\n const baseRippleColor = reaction.mine ? colors.interaction : colors.fillColorNeutral060\n const androidRippleColor = useCreateAndroidRippleColor({ color: baseRippleColor })\n\n return (\n <PlatformPressable\n key={reaction.value}\n style={[reactionStyles.reaction, styles.reaction]}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n onPress={onPress}\n >\n <Text style={styles.reactionEmoji}>{REACTION_EMOJIS[reaction.value]}</Text>\n </PlatformPressable>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: 1.3 })\n\n const btnBorderWidth = 1\n const baseSize = 46 * fontScale\n const reactionBtnSize = Platform.select({\n ios: baseSize,\n android: baseSize + btnBorderWidth * 2,\n })\n\n return StyleSheet.create({\n formSheetContent: {\n paddingTop: 16,\n },\n reactionList: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n gap: 16,\n paddingTop: 8,\n paddingBottom: 16,\n borderBottomColor: colors.borderColorDefaultBase,\n borderBottomWidth: 1,\n },\n reaction: {\n height: reactionBtnSize,\n width: reactionBtnSize,\n borderWidth: btnBorderWidth,\n borderRadius: 32,\n justifyContent: 'center',\n overflow: 'hidden',\n },\n reactionEmoji: {\n fontSize: 24,\n },\n actions: {\n paddingTop: 4,\n },\n })\n}\n"]}
1
+ {"version":3,"file":"message_actions_screen.js","sourceRoot":"","sources":["../../src/screens/message_actions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,YAAY,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACtC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAChE,OAAO,EAAE,IAAI,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ACxB,MAAM,QAAQ,GAAG,EAAE,GAAG,SAAS,CAAA;IAC/B,MAAM,eAAe,GAAG,QAAQ,CAAC,MAAM,CAAC;QACtC,GAAG,EAAE,QAAQ;QACb,OAAO,EAAE,QAAQ,GAAG,cAAc,GAAG,CAAC;KACvC,CAAC,CAAA;IAEF,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,gBAAgB,EAAE;YAChB,UAAU,EAAE,EAAE;SACf;QACD,YAAY,EAAE;YACZ,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,QAAQ;YACxB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;YACP,UAAU,EAAE,CAAC;YACb,aAAa,EAAE,EAAE;YACjB,iBAAiB,EAAE,MAAM,CAAC,sBAAsB;YAChD,iBAAiB,EAAE,CAAC;SACrB;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,eAAe;YACvB,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,cAAc;YAC3B,YAAY,EAAE,EAAE;YAChB,cAAc,EAAE,QAAQ;YACxB,QAAQ,EAAE,QAAQ;SACnB;QACD,aAAa,EAAE;YACb,QAAQ,EAAE,EAAE;SACb;QACD,OAAO,EAAE;YACP,UAAU,EAAE,CAAC;SACd;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StackActions, StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport { useMutation } from '@tanstack/react-query'\nimport { isNil, omitBy } from 'lodash'\nimport React, { useCallback } from 'react'\nimport { Alert, Platform, StyleSheet, View } from 'react-native'\nimport { Text } from '../components'\nimport { REACTION_EMOJIS, useReactionStyles } from '../components/conversation/message_reaction'\nimport FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'\nimport { useCreateAndroidRippleColor, useFontScale, useTheme } from '../hooks'\nimport { useApiClient } from '../hooks/use_api_client'\nimport { useConversationMessages } from '../hooks/use_conversation_messages'\nimport { useMessageReactionToggle } from '../hooks/use_message_reaction_toggle'\nimport { ReactionCountResource } from '../types/resources/reaction'\nimport { Clipboard, Haptic } from '../utils/native_adapters'\nimport { MessageResource } from '../types'\n\nexport const MessageActionsScreenOptions = getFormSheetScreenOptions({\n sheetAllowedDetents: [0.5],\n headerTitle: 'Message actions',\n})\n\nexport type MessageActionsScreenProps = StaticScreenProps<{\n message_id: string\n conversation_id: number\n canDeleteNonAuthoredMessages?: boolean\n}>\n\nexport function MessageActionsScreen({ route }: MessageActionsScreenProps) {\n const { conversation_id, message_id, canDeleteNonAuthoredMessages } = route.params\n\n const { messages, refetch } = useConversationMessages(\n { conversation_id },\n { refetchOnMount: false }\n )\n const message = messages.find(m => m.id === message_id)\n\n if (!message) return null\n\n return (\n <MessageActionsScreenContent\n message={message}\n conversation_id={conversation_id}\n canDeleteNonAuthoredMessages={canDeleteNonAuthoredMessages || false}\n refetchMessages={refetch}\n />\n )\n}\n\nfunction MessageActionsScreenContent({\n message,\n conversation_id,\n canDeleteNonAuthoredMessages,\n refetchMessages,\n}: {\n message: MessageResource\n conversation_id: number\n canDeleteNonAuthoredMessages: boolean\n refetchMessages: () => void\n}) {\n const navigation = useNavigation()\n const apiClient = useApiClient()\n const styles = useStyles()\n\n const myReactions = message?.reactionCounts\n .filter(reaction => reaction.mine)\n .map(reaction => reaction.value)\n\n const availableReactions = Object.entries(REACTION_EMOJIS).map(([value, emoji]) => {\n return {\n value: value as ReactionCountResource['value'],\n emoji,\n mine: myReactions?.includes(value as ReactionCountResource['value']),\n }\n })\n\n const attachmentForCopy = (): string => {\n const giphyTitleLink = message?.attachments.find(\n attachment => attachment.type === 'giphy'\n )?.titleLink\n\n if (giphyTitleLink) return giphyTitleLink\n return ''\n }\n\n const handleCopyPress = () => {\n Clipboard.setStringAsync(message?.text || attachmentForCopy() || '')\n navigation.goBack()\n }\n\n const { handleReactionToggle, isPending } = useMessageReactionToggle({\n conversation_id,\n message,\n onSuccess: () => navigation.goBack(),\n })\n\n const deleteMessage = useCallback(() => {\n const url = `/me/conversations/${conversation_id}/messages/${message.id}/`\n\n return apiClient.chat.delete({ url })\n }, [apiClient, conversation_id, message.id])\n\n const { mutate: handleDeleteMessage } = useMutation({\n mutationFn: deleteMessage,\n onSuccess: () => {\n refetchMessages()\n Haptic.notificationSuccess()\n navigation.goBack()\n },\n onError: () => {\n Alert.alert('Oops', 'We were unable to delete this message. Please try again.')\n },\n })\n\n const handleDeleteConfirm = useCallback(() => {\n Alert.alert('Delete message', 'Are you sure you want to permanently delete this message?', [\n { text: 'Cancel', style: 'cancel' },\n { text: 'Delete', style: 'destructive', onPress: () => handleDeleteMessage() },\n ])\n }, [handleDeleteMessage])\n\n const handleEditPress = useCallback(() => {\n const state = navigation.getState?.()\n const targetRoute = state?.routes?.find(r => r.name === 'Conversation')\n const params = omitBy(\n {\n ...(targetRoute?.params || {}),\n conversation_id,\n editing_message_id: message.id,\n },\n isNil\n )\n navigation.dispatch(StackActions.popTo('Conversation', params))\n }, [navigation, conversation_id, message.id])\n\n const handleViewReadReceiptsPress = useCallback(() => {\n Haptic.impactLight()\n const params = omitBy(\n {\n conversation_id,\n message_id: message.id,\n },\n isNil\n )\n navigation.dispatch(StackActions.popTo('MessageReadReceipts', params))\n }, [navigation, conversation_id, message.id])\n\n return (\n <FormSheet.Root style={styles.formSheetContent}>\n <View style={styles.reactionList}>\n {availableReactions.map((reaction, index) => (\n <Reaction\n key={index}\n reaction={reaction}\n onPress={() => {\n Haptic.impactLight()\n handleReactionToggle({\n value: reaction.value,\n mine: reaction.mine,\n })\n }}\n />\n ))}\n </View>\n <View style={styles.actions}>\n <FormSheet.Action\n onPress={handleCopyPress}\n title=\"Copy text\"\n iconName=\"services.fileCopy\"\n accessibilityHint=\"Copies text and links to clipboard\"\n />\n {message?.mine && (\n <FormSheet.Action\n onPress={() => handleEditPress()}\n title=\"Edit message\"\n iconName=\"accounts.editor\"\n accessibilityHint=\"Opens existing text in the message form input.\"\n />\n )}\n {message?.mine && (\n <FormSheet.Action\n onPress={() => handleViewReadReceiptsPress()}\n title=\"View read receipts\"\n iconName=\"general.checkPerson\"\n accessibilityHint=\"Opens a modal with a list of people who read your message.\"\n />\n )}\n {(message?.mine || canDeleteNonAuthoredMessages) && (\n <FormSheet.Action\n onPress={() => handleDeleteConfirm()}\n title=\"Delete message\"\n iconName=\"publishing.trash\"\n appearance=\"danger\"\n disabled={isPending}\n accessibilityHint=\"Opens a confirmation alert to delete this message permanently.\"\n />\n )}\n </View>\n </FormSheet.Root>\n )\n}\n\nconst Reaction = ({\n reaction,\n onPress,\n}: {\n reaction: { value: ReactionCountResource['value']; emoji: string; mine: boolean | undefined }\n onPress: () => void\n}) => {\n const styles = useStyles()\n const reactionStyles = useReactionStyles({ mine: reaction.mine ? 1 : 0 })\n\n const { colors } = useTheme()\n const baseRippleColor = reaction.mine ? colors.interaction : colors.fillColorNeutral060\n const androidRippleColor = useCreateAndroidRippleColor({ color: baseRippleColor })\n\n return (\n <PlatformPressable\n key={reaction.value}\n style={[reactionStyles.reaction, styles.reaction]}\n android_ripple={{ color: androidRippleColor, borderless: false, foreground: true }}\n onPress={onPress}\n >\n <Text style={styles.reactionEmoji}>{REACTION_EMOJIS[reaction.value]}</Text>\n </PlatformPressable>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: 1.3 })\n\n const btnBorderWidth = 1\n const baseSize = 46 * fontScale\n const reactionBtnSize = Platform.select({\n ios: baseSize,\n android: baseSize + btnBorderWidth * 2,\n })\n\n return StyleSheet.create({\n formSheetContent: {\n paddingTop: 16,\n },\n reactionList: {\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center',\n gap: 16,\n paddingTop: 8,\n paddingBottom: 16,\n borderBottomColor: colors.borderColorDefaultBase,\n borderBottomWidth: 1,\n },\n reaction: {\n height: reactionBtnSize,\n width: reactionBtnSize,\n borderWidth: btnBorderWidth,\n borderRadius: 32,\n justifyContent: 'center',\n overflow: 'hidden',\n },\n reactionEmoji: {\n fontSize: 24,\n },\n actions: {\n paddingTop: 4,\n },\n })\n}\n"]}
@@ -1,2 +1,3 @@
1
1
  export * from './client';
2
+ export * from './types';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA"}
@@ -1,2 +1,3 @@
1
1
  export * from './client';
2
+ export * from './types';
2
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA","sourcesContent":["export * from './client'\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/utils/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA","sourcesContent":["export * from './client'\nexport * from './types'\n"]}
@@ -0,0 +1,61 @@
1
+ export interface Accumulator {
2
+ data: Record<string, unknown>[];
3
+ included: Record<string, unknown>[];
4
+ meta: Record<string, unknown>;
5
+ links: Record<string, unknown>;
6
+ }
7
+ export interface WalkRequest extends GetRequest {
8
+ acc?: Accumulator;
9
+ }
10
+ export interface GenericRequest {
11
+ headers?: Record<string, string>;
12
+ url: string;
13
+ }
14
+ export interface GetRequest extends GenericRequest {
15
+ data: {
16
+ filter?: string;
17
+ fields: Record<string, string[]>;
18
+ where?: Record<string, string | number | (string | number)[]>;
19
+ include?: string[];
20
+ order?: string;
21
+ perPage?: number;
22
+ offset?: number;
23
+ walk?: boolean;
24
+ } & Record<string, unknown>;
25
+ }
26
+ export interface Relationship {
27
+ data: {
28
+ type: string;
29
+ id: string;
30
+ };
31
+ }
32
+ export type Relationships = Record<string, Relationship | Relationship[]>;
33
+ export interface PostRequest extends GenericRequest {
34
+ data?: {
35
+ fields?: Record<string, string>;
36
+ include?: string[];
37
+ data?: {
38
+ type: string;
39
+ attributes: Record<string, unknown>;
40
+ relationships?: Relationships;
41
+ };
42
+ };
43
+ }
44
+ export type PatchRequest = PostRequest;
45
+ export interface DeleteRequest extends GenericRequest {
46
+ }
47
+ export interface ApiClient<T = unknown> {
48
+ get(_request: GetRequest): Promise<T>;
49
+ post(_request: PostRequest): Promise<T>;
50
+ patch(_request: PatchRequest): Promise<T>;
51
+ delete(_request: DeleteRequest): Promise<T>;
52
+ }
53
+ export type RequestData = {
54
+ fields: Record<string, string[] | string>;
55
+ where: Record<string, string | number | (string | number)[]>;
56
+ include: string[];
57
+ data: Record<string, unknown>;
58
+ perPage: number;
59
+ offset: number;
60
+ };
61
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/client/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IAC/B,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;IACnC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAC/B;AAED,MAAM,WAAW,WAAY,SAAQ,UAAU;IAC7C,GAAG,CAAC,EAAE,WAAW,CAAA;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,UAAW,SAAQ,cAAc;IAChD,IAAI,EAAE;QACJ,MAAM,CAAC,EAAE,M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E,WAAW,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IACvC,KAAK,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;IACzC,MAAM,CAAC,QAAQ,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC,CAAA;CAC5C;AAED,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,CAAA;IACzC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;IAC5D,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf,CAAA"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/client/types.ts"],"names":[],"mappings":"","sourcesContent":["export interface Accumulator {\n data: Record<string, unknown>[]\n included: Record<string, unknown>[]\n meta: Record<string, unknown>\n links: Record<string, unknown>\n}\n\nexport interface WalkRequest extends GetRequest {\n acc?: Accumulator\n}\n\nexport interface GenericRequest {\n headers?: Record<string, string>\n url: string\n}\n\nexport interface GetRequest extends GenericRequest {\n data: {\n filter?: string\n fields: Record<string, string[]>\n where?: Record<string, string | number | (string | number)[]>\n include?: string[]\n order?: string\n perPage?: number\n offset?: number\n walk?: boolean\n } & Record<string, unknown>\n}\n\nexport interface Relationship {\n data: {\n type: string\n id: string\n }\n}\n\nexport type Relationships = Record<string, Relationship | Relationship[]>\nexport interface PostRequest extends GenericRequest {\n data?: {\n fields?: Record<string, string> // value should be comma separated string\n include?: string[]\n data?: {\n type: string\n attributes: Record<string, unknown>\n relationships?: Relationships\n }\n }\n}\n\nexport type PatchRequest = PostRequest\n\nexport interface DeleteRequest extends GenericRequest {}\n\nexport interface ApiClient<T = unknown> {\n get(_request: GetRequest): Promise<T>\n post(_request: PostRequest): Promise<T>\n patch(_request: PatchRequest): Promise<T>\n delete(_request: DeleteRequest): Promise<T>\n}\n\nexport type RequestData = {\n fields: Record<string, string[] | string>\n where: Record<string, string | number | (string | number)[]>\n include: string[]\n data: Record<string, unknown>\n perPage: number\n offset: number\n}\n"]}
@@ -34,6 +34,7 @@ interface ChatColors {
34
34
  androidModalHeaderButtonTextColor: ColorValue | string | undefined;
35
35
  iOSModalHeaderButtonTextColor: OpaqueColorValue | string | undefined;
36
36
  androidSwitchThumbColor: string | undefined;
37
+ conversationActionsBackground: string;
37
38
  testColor: string;
38
39
  statusSuccessIcon: string;
39
40
  statusSuccessText: string;
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAiB,MAAM,cAAc,CAAA;AAE3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AAE/E,MAAM,WAAW,SAAU,SAAQ,YAAY;IAC7C,MAAM,EAAE,YAAY,CAAC,QAAQ,CAAC,GAC5B,CAAC,OAAO,mBAAmB,CAAC,KAAK,GAAG,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAA;CACvE;AAED;;;;;;;;;;;;;gDAagD;AAEhD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,UAAU,CAAA;IAClB,MAAM,EAAE;QACN,YAAY,EAAE,MAAM,CAAA;KACrB,CAAA;IACD,oBAAoB,EAAE,OAAO,CAAA;CAC9B;AAED,eAAO,MAAM,YAAY,gBAAiB,eAAe,KAAG,SAe3D,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;AAE5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BAAiB,EAAE,MAAM,CAAA;IACzB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,iBAAiB,EAAE,MAAM,CAAA;IACzB,cAAc,EAAE,MAAM,CAAA;IACtB,cAAc,EAAE,MAAM,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,cAAc,EAAE,MAAM,CAAA;IACtB,iBAAiB,EAAE,MAAM,CAAA;IACzB,iBAAiB,EAAE,MAAM,CAAA;IACzB,mBAAmB,EAAE,MAAM,CAAA;IAC3B,iBAAiB,EAAE,MAAM,CAAA;IACzB,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB,iBAAiB,EAAE,MAAM,CAAA;IACzB,eAAe,EAAE,MAAM,CAAA;IACvB,yBAAyB,EAAE,MAAM,CAAA;IACjC,yBAAyB,EAAE,MAAM,CAAA;IACjC,+BAA+B,EAAE,MAAM,CAAA;IACvC,sBAAsB,EAAE,MAAM,CAAA;IAC9B,sBAAsB,EAAE,MAAM,CAAA;IAC9B,4BAA4B,EAAE,MAAM,CAAA;IACpC,yBAAyB,EAAE,MAAM,CAAA;IACjC,yBAAyB,EAAE,MAAM,CAAA;IACjC,+BAA+B,EAAE,MAAM,CAAA;IACvC,uBAAuB,EAAE,MAAM,CAAA;IAC/B,uBAAuB,EAAE,MAAM,CAAA;IAC/B,6BAA6B,EAAE,MAAM,CAAA;IACrC,yBAAyB,EAAE,MAAM,CAAA;IACjC,yBAAyB,EAAE,MAAM,CAAA;IACjC,+BAA+B,EAAE,MAAM,CAAA;CACxC"}
@@ -23,6 +23,7 @@ const colorsChatLight = {
23
23
  buttonEnd: undefined,
24
24
  interaction: tokens.fillColorInteractionDefault,
25
25
  androidSwitchThumbColor: undefined,
26
+ conversationActionsBackground: tokens.colorNeutral100White,
26
27
  testColor: 'hotpink',
27
28
  statusInfoIcon: tokens.iconColorStatusInfoPrimary,
28
29
  statusInfoText: tokens.textColorStatusInfo,
@@ -64,6 +65,7 @@ const colorsChatDark = {
64
65
  buttonEnd: undefined,
65
66
  interaction: tokens.fillColorInteractionDefaultDark,
66
67
  androidSwitchThumbColor: undefined,
68
+ conversationActionsBackground: tokens.colorNeutral7,
67
69
  testColor: 'pink',
68
70
  statusInfoIcon: tokens.iconColorStatusInfoPrimaryDark,
69
71
  statusInfoText: tokens.textColorStatusInfoDark,
@@ -1 +1 @@
1
- {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,aAAa,EAAE,MAAM,cAAc,CAAA;AAC3F,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AA8B/E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,WAA4B,EAAa,EAAE;IACtE,MAAM,MAAM,GAAG,WAAW,IAAI,OAAO,CAAA;IAErC,MAAM,aAAa,GAAG;QACpB,GAAG,iBAAiB,CAAC,MAAM,CAAC;QAC5B,GAAG,mBAAmB,CAAC,MAAM,CAAC;KAC/B,CAAA;IAED,OAAO;QACL,MAAM,EAAE,aAAa;QACrB,MAAM,EAAE;YACN,YAAY,EAAE,EAAE;SACjB;QACD,oBAAoB,EAAE,IAAI,EAAE,sEAAsE;KACnG,CAAA;AACH,CAAC,CAAA;AA8CD,MAAM,eAAe,GAAe;IAClC,IAAI,EAAE,OAAO;IACb,iCAAiC,EAAE,MAAM,CAAC,2BAA2B;IACrE,6BAA6B,EAAE,aAAa,CAAC,MAAM,CAAC;IACpD,WAAW,EAAE,SAAS;IACtB,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,MAAM,CAAC,2BAA2B;IAC/C,uBAAuB,EAAE,SAAS;IAClC,SAAS,EAAE,SAAS;IACpB,cAAc,EAAE,MAAM,CAAC,0BAA0B;IACjD,cAAc,EAAE,MAAM,CAAC,mBAAmB;IAC1C,gBAAgB,EAAE,MAAM,CAAC,qBAAqB;IAC9C,cA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AAE,MAAM,CAAC,+BAA+B;IAC/D,uBAAuB,EAAE,MAAM,CAAC,wBAAwB;IACxD,6BAA6B,EAAE,MAAM,CAAC,6BAA6B;IACnE,yBAAyB,EAAE,MAAM,CAAC,iCAAiC;IACnE,yBAAyB,EAAE,MAAM,CAAC,0BAA0B;IAC5D,+BAA+B,EAAE,MAAM,CAAC,+BAA+B;CACxE,CAAA;AAED,MAAM,iBAAiB,GAAG;IACxB,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,cAAc;CACrB,CAAA","sourcesContent":["import { ColorSchemeName, ColorValue, OpaqueColorValue, PlatformColor } from 'react-native'\nimport { tokens } from '../vendor/tapestry/tokens'\nimport { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map'\n\nexport interface ChatTheme extends DefaultTheme {\n colors: DefaultTheme['colors'] &\n (typeof aliasTokensColorMap.light | typeof aliasTokensColorMap.dark)\n}\n\n/** =============================================\n NOTE: The specific values for `colors` and the `productBadge` are temporary examples that can be replaced once we start building out UI. This line's comment can be removed at that time too.\n\n The default theme is intended to support two types of customizations:\n 1. Specific color properties for a chat component (eg. `primaryButtonBackgroundColor`)\n 2. Any styles for a specific component. (Use only one level of nesting.)\n ```\n primaryButton: {\n borderRadius: number\n container: ViewStyle\n text: TextStyle\n }\n ```\n============================================= */\n\nexport interface DefaultTheme {\n colors: ChatColors\n button: {\n borderRadius: number\n }\n showBadgeProductLogo: boolean\n}\n\nexport const defaultTheme = (colorScheme: ColorSchemeName): ChatTheme => {\n const scheme = colorScheme || 'light'\n\n const defaultColors = {\n ...chatThemeColorMap[scheme],\n ...aliasTokensColorMap[scheme],\n }\n\n return {\n colors: defaultColors,\n button: {\n borderRadius: 40,\n },\n showBadgeProductLogo: true, // Overrides visibility of the product logo in `src/display/badge.tsx`\n }\n}\n\nexport type TemporaryDefaultColorsType = Partial<ChatColors>\n\ninterface ChatColors {\n name: string\n buttonStart: string | undefined\n buttonEnd: string | undefined\n interaction: string\n androidModalHeaderButtonTextColor: ColorValue | string | undefined\n iOSModalHeaderButtonTextColor: OpaqueColorValue | string | undefined\n androidSwitchThumbColor: string | undefined\n testColor: string\n statusSuccessIcon: string\n statusSuccessText: string\n statusSuccessBorder: string\n statusSuccessFill: string\n statusInfoIcon: string\n statusInfoText: string\n statusInfoBorder: string\n statusInfoFill: string\n statusWarningIcon: string\n statusWarningText: string\n statusWarningBorder: string\n statusWarningFill: string\n statusErrorIcon: string\n statusErrorText: string\n statusErrorBorder: string\n statusErrorFill: string\n statusSuccessComposedIcon: string\n statusSuccessComposedText: string\n statusSuccessComposedBackground: string\n statusInfoComposedIcon: string\n statusInfoComposedText: string\n statusInfoComposedBackground: string\n statusWarningComposedIcon: string\n statusWarningComposedText: string\n statusWarningComposedBackground: string\n statusErrorComposedIcon: string\n statusErrorComposedText: string\n statusErrorComposedBackground: string\n statusNeutralComposedIcon: string\n statusNeutralComposedText: string\n statusNeutralComposedBackground: string\n}\n\nconst colorsChatLight: ChatColors = {\n name: 'light',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefault,\n iOSModalHeaderButtonTextColor: PlatformColor('link'),\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefault,\n androidSwitchThumbColor: undefined,\n testColor: 'hotpink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoText: tokens.textColorStatusInfo,\n statusInfoBorder: tokens.borderColorStatusInfo,\n statusInfoFill: tokens.fillColorStatusInfoSolid,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessText: tokens.textColorStatusSuccess,\n statusSuccessBorder: tokens.borderColorStatusSuccess,\n statusSuccessFill: tokens.fillColorStatusSuccessSolid,\n statusWarningIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningText: tokens.textColorStatusWarning,\n statusWarningBorder: tokens.borderColorStatusWarning,\n statusWarningFill: tokens.fillColorStatusWarningSolid,\n statusErrorIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorText: tokens.textColorStatusError,\n statusErrorBorder: tokens.borderColorStatusError,\n statusErrorFill: tokens.fillColorStatusErrorSolid,\n statusInfoComposedIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoComposedText: tokens.textColorStatusInfo,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhost,\n statusSuccessComposedIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessComposedText: tokens.textColorStatusSuccess,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhost,\n statusWarningComposedIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningComposedText: tokens.textColorStatusWarning,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhost,\n statusErrorComposedIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorComposedText: tokens.textColorStatusError,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhost,\n statusNeutralComposedIcon: tokens.iconColorStatusNeutralPrimary,\n statusNeutralComposedText: tokens.textColorStatusNeutral,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhost,\n}\n\nconst colorsChatDark: ChatColors = {\n name: 'dark',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefaultDark,\n iOSModalHeaderButtonTextColor: PlatformColor('link'),\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefaultDark,\n androidSwitchThumbColor: undefined,\n testColor: 'pink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoText: tokens.textColorStatusInfoDark,\n statusInfoBorder: tokens.borderColorStatusInfoDark,\n statusInfoFill: tokens.fillColorStatusInfoSolidDark,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessText: tokens.textColorStatusSuccessDark,\n statusSuccessBorder: tokens.borderColorStatusSuccessDark,\n statusSuccessFill: tokens.fillColorStatusSuccessSolidDark,\n statusWarningIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningText: tokens.textColorStatusWarningDark,\n statusWarningBorder: tokens.borderColorStatusWarningDark,\n statusWarningFill: tokens.fillColorStatusWarningSolidDark,\n statusErrorIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorText: tokens.textColorStatusErrorDark,\n statusErrorBorder: tokens.borderColorStatusErrorDark,\n statusErrorFill: tokens.fillColorStatusErrorSolidDark,\n\n // Note: CCA inverts composed status colors in dark mode\n statusInfoComposedIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoComposedText: tokens.textColorStatusInfoDark,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhostDark,\n statusSuccessComposedIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessComposedText: tokens.textColorStatusSuccessDark,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhostDark,\n statusWarningComposedIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningComposedText: tokens.textColorStatusWarningDark,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhostDark,\n statusErrorComposedIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorComposedText: tokens.textColorStatusErrorDark,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhostDark,\n statusNeutralComposedIcon: tokens.iconColorStatusNeutralPrimaryDark,\n statusNeutralComposedText: tokens.textColorStatusNeutralDark,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhostDark,\n}\n\nconst chatThemeColorMap = {\n light: colorsChatLight,\n dark: colorsChatDark,\n}\n"]}
1
+ {"version":3,"file":"theme.js","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiD,aAAa,EAAE,MAAM,cAAc,CAAA;AAC3F,OAAO,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAA;AA8B/E,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,WAA4B,EAAa,EAAE;IACtE,MAAM,MAAM,GAAG,WAAW,IAAI,OAAO,CAAA;IAErC,MAAM,aAAa,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A+B;IACzD,iBAAiB,EAAE,MAAM,CAAC,iCAAiC;IAC3D,iBAAiB,EAAE,MAAM,CAAC,0BAA0B;IACpD,mBAAmB,EAAE,MAAM,CAAC,4BAA4B;IACxD,iBAAiB,EAAE,MAAM,CAAC,+BAA+B;IACzD,eAAe,EAAE,MAAM,CAAC,+BAA+B;IACvD,eAAe,EAAE,MAAM,CAAC,wBAAwB;IAChD,iBAAiB,EAAE,MAAM,CAAC,0BAA0B;IACpD,eAAe,EAAE,MAAM,CAAC,6BAA6B;IAErD,wDAAwD;IACxD,sBAAsB,EAAE,MAAM,CAAC,8BAA8B;IAC7D,sBAAsB,EAAE,MAAM,CAAC,uBAAuB;IACtD,4BAA4B,EAAE,MAAM,CAAC,4BAA4B;IACjE,yBAAyB,EAAE,MAAM,CAAC,iCAAiC;IACnE,yBAAyB,EAAE,MAAM,CAAC,0BAA0B;IAC5D,+BAA+B,EAAE,MAAM,CAAC,+BAA+B;IACvE,yBAAyB,EAAE,MAAM,CAAC,iCAAiC;IACnE,yBAAyB,EAAE,MAAM,CAAC,0BAA0B;IAC5D,+BAA+B,EAAE,MAAM,CAAC,+BAA+B;IACvE,uBAAuB,EAAE,MAAM,CAAC,+BAA+B;IAC/D,uBAAuB,EAAE,MAAM,CAAC,wBAAwB;IACxD,6BAA6B,EAAE,MAAM,CAAC,6BAA6B;IACnE,yBAAyB,EAAE,MAAM,CAAC,iCAAiC;IACnE,yBAAyB,EAAE,MAAM,CAAC,0BAA0B;IAC5D,+BAA+B,EAAE,MAAM,CAAC,+BAA+B;CACxE,CAAA;AAED,MAAM,iBAAiB,GAAG;IACxB,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,cAAc;CACrB,CAAA","sourcesContent":["import { ColorSchemeName, ColorValue, OpaqueColorValue, PlatformColor } from 'react-native'\nimport { tokens } from '../vendor/tapestry/tokens'\nimport { aliasTokensColorMap } from '../vendor/tapestry/alias_tokens_color_map'\n\nexport interface ChatTheme extends DefaultTheme {\n colors: DefaultTheme['colors'] &\n (typeof aliasTokensColorMap.light | typeof aliasTokensColorMap.dark)\n}\n\n/** =============================================\n NOTE: The specific values for `colors` and the `productBadge` are temporary examples that can be replaced once we start building out UI. This line's comment can be removed at that time too.\n\n The default theme is intended to support two types of customizations:\n 1. Specific color properties for a chat component (eg. `primaryButtonBackgroundColor`)\n 2. Any styles for a specific component. (Use only one level of nesting.)\n ```\n primaryButton: {\n borderRadius: number\n container: ViewStyle\n text: TextStyle\n }\n ```\n============================================= */\n\nexport interface DefaultTheme {\n colors: ChatColors\n button: {\n borderRadius: number\n }\n showBadgeProductLogo: boolean\n}\n\nexport const defaultTheme = (colorScheme: ColorSchemeName): ChatTheme => {\n const scheme = colorScheme || 'light'\n\n const defaultColors = {\n ...chatThemeColorMap[scheme],\n ...aliasTokensColorMap[scheme],\n }\n\n return {\n colors: defaultColors,\n button: {\n borderRadius: 40,\n },\n showBadgeProductLogo: true, // Overrides visibility of the product logo in `src/display/badge.tsx`\n }\n}\n\nexport type TemporaryDefaultColorsType = Partial<ChatColors>\n\ninterface ChatColors {\n name: string\n buttonStart: string | undefined\n buttonEnd: string | undefined\n interaction: string\n androidModalHeaderButtonTextColor: ColorValue | string | undefined\n iOSModalHeaderButtonTextColor: OpaqueColorValue | string | undefined\n androidSwitchThumbColor: string | undefined\n conversationActionsBackground: string\n testColor: string\n statusSuccessIcon: string\n statusSuccessText: string\n statusSuccessBorder: string\n statusSuccessFill: string\n statusInfoIcon: string\n statusInfoText: string\n statusInfoBorder: string\n statusInfoFill: string\n statusWarningIcon: string\n statusWarningText: string\n statusWarningBorder: string\n statusWarningFill: string\n statusErrorIcon: string\n statusErrorText: string\n statusErrorBorder: string\n statusErrorFill: string\n statusSuccessComposedIcon: string\n statusSuccessComposedText: string\n statusSuccessComposedBackground: string\n statusInfoComposedIcon: string\n statusInfoComposedText: string\n statusInfoComposedBackground: string\n statusWarningComposedIcon: string\n statusWarningComposedText: string\n statusWarningComposedBackground: string\n statusErrorComposedIcon: string\n statusErrorComposedText: string\n statusErrorComposedBackground: string\n statusNeutralComposedIcon: string\n statusNeutralComposedText: string\n statusNeutralComposedBackground: string\n}\n\nconst colorsChatLight: ChatColors = {\n name: 'light',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefault,\n iOSModalHeaderButtonTextColor: PlatformColor('link'),\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefault,\n androidSwitchThumbColor: undefined,\n conversationActionsBackground: tokens.colorNeutral100White,\n testColor: 'hotpink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoText: tokens.textColorStatusInfo,\n statusInfoBorder: tokens.borderColorStatusInfo,\n statusInfoFill: tokens.fillColorStatusInfoSolid,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessText: tokens.textColorStatusSuccess,\n statusSuccessBorder: tokens.borderColorStatusSuccess,\n statusSuccessFill: tokens.fillColorStatusSuccessSolid,\n statusWarningIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningText: tokens.textColorStatusWarning,\n statusWarningBorder: tokens.borderColorStatusWarning,\n statusWarningFill: tokens.fillColorStatusWarningSolid,\n statusErrorIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorText: tokens.textColorStatusError,\n statusErrorBorder: tokens.borderColorStatusError,\n statusErrorFill: tokens.fillColorStatusErrorSolid,\n statusInfoComposedIcon: tokens.iconColorStatusInfoPrimary,\n statusInfoComposedText: tokens.textColorStatusInfo,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhost,\n statusSuccessComposedIcon: tokens.iconColorStatusSuccessPrimary,\n statusSuccessComposedText: tokens.textColorStatusSuccess,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhost,\n statusWarningComposedIcon: tokens.iconColorStatusWarningPrimary,\n statusWarningComposedText: tokens.textColorStatusWarning,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhost,\n statusErrorComposedIcon: tokens.iconColorStatusErrorPrimary,\n statusErrorComposedText: tokens.textColorStatusError,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhost,\n statusNeutralComposedIcon: tokens.iconColorStatusNeutralPrimary,\n statusNeutralComposedText: tokens.textColorStatusNeutral,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhost,\n}\n\nconst colorsChatDark: ChatColors = {\n name: 'dark',\n androidModalHeaderButtonTextColor: tokens.fillColorInteractionDefaultDark,\n iOSModalHeaderButtonTextColor: PlatformColor('link'),\n buttonStart: undefined,\n buttonEnd: undefined,\n interaction: tokens.fillColorInteractionDefaultDark,\n androidSwitchThumbColor: undefined,\n conversationActionsBackground: tokens.colorNeutral7,\n testColor: 'pink',\n statusInfoIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoText: tokens.textColorStatusInfoDark,\n statusInfoBorder: tokens.borderColorStatusInfoDark,\n statusInfoFill: tokens.fillColorStatusInfoSolidDark,\n statusSuccessIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessText: tokens.textColorStatusSuccessDark,\n statusSuccessBorder: tokens.borderColorStatusSuccessDark,\n statusSuccessFill: tokens.fillColorStatusSuccessSolidDark,\n statusWarningIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningText: tokens.textColorStatusWarningDark,\n statusWarningBorder: tokens.borderColorStatusWarningDark,\n statusWarningFill: tokens.fillColorStatusWarningSolidDark,\n statusErrorIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorText: tokens.textColorStatusErrorDark,\n statusErrorBorder: tokens.borderColorStatusErrorDark,\n statusErrorFill: tokens.fillColorStatusErrorSolidDark,\n\n // Note: CCA inverts composed status colors in dark mode\n statusInfoComposedIcon: tokens.iconColorStatusInfoPrimaryDark,\n statusInfoComposedText: tokens.textColorStatusInfoDark,\n statusInfoComposedBackground: tokens.fillColorStatusInfoGhostDark,\n statusSuccessComposedIcon: tokens.iconColorStatusSuccessPrimaryDark,\n statusSuccessComposedText: tokens.textColorStatusSuccessDark,\n statusSuccessComposedBackground: tokens.fillColorStatusSuccessGhostDark,\n statusWarningComposedIcon: tokens.iconColorStatusWarningPrimaryDark,\n statusWarningComposedText: tokens.textColorStatusWarningDark,\n statusWarningComposedBackground: tokens.fillColorStatusWarningGhostDark,\n statusErrorComposedIcon: tokens.iconColorStatusErrorPrimaryDark,\n statusErrorComposedText: tokens.textColorStatusErrorDark,\n statusErrorComposedBackground: tokens.fillColorStatusErrorGhostDark,\n statusNeutralComposedIcon: tokens.iconColorStatusNeutralPrimaryDark,\n statusNeutralComposedText: tokens.textColorStatusNeutralDark,\n statusNeutralComposedBackground: tokens.fillColorStatusNeutralGhostDark,\n}\n\nconst chatThemeColorMap = {\n light: colorsChatLight,\n dark: colorsChatDark,\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@planningcenter/chat-react-native",
3
- "version": "3.15.0-rc.1",
3
+ "version": "3.15.0-rc.10",
4
4
  "description": "",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "@react-navigation/elements": "*",
27
27
  "@react-navigation/native": ">=7.0.0",
28
28
  "@react-navigation/native-stack": ">=7.0.0",
29
- "@shopify/flash-list": "*",
29
+ "@shopify/flash-list": "<2.0.0",
30
30
  "@tanstack/react-query": "^5.0.0",
31
31
  "color": "^3.1.2",
32
32
  "lodash": "*",
@@ -37,7 +37,7 @@
37
37
  "react-native-device-info": "*",
38
38
  "react-native-gesture-handler": "*",
39
39
  "react-native-linear-gradient": "^2.8.3",
40
- "react-native-reanimated": "*",
40
+ "react-native-reanimated": "<4.0.0",
41
41
  "react-native-safe-area-context": ">=4.0.0",
42
42
  "react-native-svg": "*"
43
43
  },
@@ -46,7 +46,7 @@
46
46
  "@testing-library/react-hooks": "^8.0.1",
47
47
  "@types/jest": "^29.5.14",
48
48
  "@typescript-eslint/parser": "^8.32.0",
49
- "expo-module-scripts": "^4.1.6",
49
+ "expo-module-scripts": "^5.0.7",
50
50
  "fast-text-encoding": "^1.0.6",
51
51
  "jest": "^29.7.0",
52
52
  "jest-fetch-mock": "^3.0.3",
@@ -55,5 +55,5 @@
55
55
  "react-native-url-polyfill": "^2.0.0",
56
56
  "typescript": "<5.6.0"
57
57
  },
58
- "gitHead": "374e1b143d5267e4dfd7b35e50df600adda5f3c1"
58
+ "gitHead": "da61fea0cbdbd67c1d2713dd533d5260efe6b991"
59
59
  }