@planningcenter/chat-react-native 3.1.0-rc.13 → 3.1.0-rc.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/conversation/attachments/attachment_card.d.ts +9 -0
- package/build/components/conversation/attachments/attachment_card.d.ts.map +1 -0
- package/build/components/conversation/attachments/attachment_card.js +35 -0
- package/build/components/conversation/attachments/attachment_card.js.map +1 -0
- package/build/components/conversation/attachments/audio_attachment.d.ts +6 -0
- package/build/components/conversation/attachments/audio_attachment.d.ts.map +1 -0
- package/build/components/conversation/attachments/audio_attachment.js +84 -0
- package/build/components/conversation/attachments/audio_attachment.js.map +1 -0
- package/build/components/conversation/attachments/constants.d.ts +3 -0
- package/build/components/conversation/attachments/constants.d.ts.map +1 -0
- package/build/components/conversation/attachments/constants.js +4 -0
- package/build/components/conversation/attachments/constants.js.map +1 -0
- package/build/components/conversation/attachments/download_attachment_button.d.ts +9 -0
- package/build/components/conversation/attachments/download_attachment_button.d.ts.map +1 -0
- package/build/components/conversation/attachments/download_attachment_button.js +29 -0
- package/build/components/conversation/attachments/download_attachment_button.js.map +1 -0
- package/build/components/conversation/attachments/expanded_link.d.ts +5 -0
- package/build/components/conversation/attachments/expanded_link.d.ts.map +1 -0
- package/build/components/conversation/attachments/expanded_link.js +44 -0
- package/build/components/conversation/attachments/expanded_link.js.map +1 -0
- package/build/components/conversation/attachments/generic_file_attachment.d.ts +7 -0
- package/build/components/conversation/attachments/generic_file_attachment.d.ts.map +1 -0
- package/build/components/conversation/attachments/generic_file_attachment.js +63 -0
- package/build/components/conversation/attachments/generic_file_attachment.js.map +1 -0
- package/build/components/conversation/attachments/giphy_attachment.d.ts +6 -0
- package/build/components/conversation/attachments/giphy_attachment.d.ts.map +1 -0
- package/build/components/conversation/attachments/giphy_attachment.js +42 -0
- package/build/components/conversation/attachments/giphy_attachment.js.map +1 -0
- package/build/components/conversation/attachments/image_attachment.d.ts +5 -0
- package/build/components/conversation/attachments/image_attachment.d.ts.map +1 -0
- package/build/components/conversation/attachments/image_attachment.js +24 -0
- package/build/components/conversation/attachments/image_attachment.js.map +1 -0
- package/build/components/conversation/attachments/video_attachment.d.ts +6 -0
- package/build/components/conversation/attachments/video_attachment.d.ts.map +1 -0
- package/build/components/conversation/attachments/video_attachment.js +64 -0
- package/build/components/conversation/attachments/video_attachment.js.map +1 -0
- package/build/components/conversation/message.d.ts +1 -1
- package/build/components/conversation/message.d.ts.map +1 -1
- package/build/components/conversation/message.js +13 -7
- package/build/components/conversation/message.js.map +1 -1
- package/build/components/conversation/message_attachments.d.ts +6 -0
- package/build/components/conversation/message_attachments.d.ts.map +1 -0
- package/build/components/conversation/message_attachments.js +52 -0
- package/build/components/conversation/message_attachments.js.map +1 -0
- package/build/components/conversation/message_markdown.d.ts +7 -0
- package/build/components/conversation/message_markdown.d.ts.map +1 -0
- package/build/components/conversation/message_markdown.js +38 -0
- package/build/components/conversation/message_markdown.js.map +1 -0
- package/build/components/conversations/conversation_preview.d.ts +9 -0
- package/build/components/conversations/conversation_preview.d.ts.map +1 -0
- package/build/components/conversations/conversation_preview.js +58 -0
- package/build/components/conversations/conversation_preview.js.map +1 -0
- package/build/components/conversations/conversations.d.ts +8 -0
- package/build/components/conversations/conversations.d.ts.map +1 -0
- package/build/components/conversations/conversations.js +40 -0
- package/build/components/conversations/conversations.js.map +1 -0
- package/build/components/conversations/unread_count_badge.d.ts +5 -0
- package/build/components/conversations/unread_count_badge.d.ts.map +1 -0
- package/build/components/conversations/unread_count_badge.js +33 -0
- package/build/components/conversations/unread_count_badge.js.map +1 -0
- package/build/components/display/badge.d.ts +9 -1
- package/build/components/display/badge.d.ts.map +1 -1
- package/build/components/display/badge.js +22 -10
- package/build/components/display/badge.js.map +1 -1
- package/build/components/display/button.d.ts +1 -1
- package/build/components/display/button.d.ts.map +1 -1
- package/build/components/display/button.js.map +1 -1
- package/build/components/display/child_notice.js +2 -2
- package/build/components/display/child_notice.js.map +1 -1
- package/build/components/display/icon.d.ts.map +1 -1
- package/build/components/display/icon.js +10 -8
- package/build/components/display/icon.js.map +1 -1
- package/build/components/display/text.js +2 -8
- package/build/components/display/text.js.map +1 -1
- package/build/components/index.d.ts +1 -1
- package/build/components/index.d.ts.map +1 -1
- package/build/components/index.js +1 -1
- package/build/components/index.js.map +1 -1
- package/build/components/page/error_boundary.d.ts +1 -1
- package/build/hooks/use_api.d.ts +6 -4
- package/build/hooks/use_api.d.ts.map +1 -1
- package/build/hooks/use_api.js +5 -2
- package/build/hooks/use_api.js.map +1 -1
- package/build/hooks/use_api_client.d.ts +1 -2
- package/build/hooks/use_api_client.d.ts.map +1 -1
- package/build/hooks/use_api_client.js.map +1 -1
- package/build/hooks/use_conversation.js +1 -1
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_conversation_jolt_events.js +1 -1
- package/build/hooks/use_conversation_jolt_events.js.map +1 -1
- package/build/hooks/use_conversation_messages_jolt_events.js +1 -1
- package/build/hooks/use_conversation_messages_jolt_events.js.map +1 -1
- package/build/hooks/use_conversations.d.ts +2 -3
- package/build/hooks/use_conversations.d.ts.map +1 -1
- package/build/hooks/use_conversations.js +3 -29
- package/build/hooks/use_conversations.js.map +1 -1
- package/build/hooks/use_groups.d.ts +214 -0
- package/build/hooks/use_groups.d.ts.map +1 -0
- package/build/hooks/use_groups.js +22 -0
- package/build/hooks/use_groups.js.map +1 -0
- package/build/hooks/use_groups_groups.d.ts +208 -0
- package/build/hooks/use_groups_groups.d.ts.map +1 -0
- package/build/hooks/use_groups_groups.js +18 -0
- package/build/hooks/use_groups_groups.js.map +1 -0
- package/build/hooks/use_services_team.d.ts +4 -0
- package/build/hooks/use_services_team.d.ts.map +1 -0
- package/build/hooks/use_services_team.js +22 -0
- package/build/hooks/use_services_team.js.map +1 -0
- package/build/hooks/use_suspense_api.d.ts +2 -1
- package/build/hooks/use_suspense_api.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.js +2 -1
- package/build/hooks/use_suspense_api.js.map +1 -1
- package/build/hooks/use_teams.d.ts +208 -0
- package/build/hooks/use_teams.d.ts.map +1 -0
- package/build/hooks/use_teams.js +22 -0
- package/build/hooks/use_teams.js.map +1 -0
- package/build/navigation/index.d.ts +11 -0
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +5 -0
- package/build/navigation/index.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +86 -62
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_filters_screen.d.ts +13 -0
- package/build/screens/conversation_filters_screen.d.ts.map +1 -0
- package/build/screens/conversation_filters_screen.js +346 -0
- package/build/screens/conversation_filters_screen.js.map +1 -0
- package/build/screens/conversation_screen.js +2 -1
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/conversations_screen.d.ts +4 -2
- package/build/screens/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations_screen.js +139 -11
- package/build/screens/conversations_screen.js.map +1 -1
- package/build/screens/create/conversation_select_recipients_screen.d.ts.map +1 -1
- package/build/screens/create/conversation_select_recipients_screen.js +3 -11
- package/build/screens/create/conversation_select_recipients_screen.js.map +1 -1
- package/build/types/resources/group_resource.d.ts +4 -2
- package/build/types/resources/group_resource.d.ts.map +1 -1
- package/build/types/resources/group_resource.js.map +1 -1
- package/build/types/resources/index.d.ts +1 -0
- package/build/types/resources/index.d.ts.map +1 -1
- package/build/types/resources/index.js +1 -0
- package/build/types/resources/index.js.map +1 -1
- package/build/types/resources/services/index.d.ts +2 -0
- package/build/types/resources/services/index.d.ts.map +1 -0
- package/build/types/resources/services/index.js +2 -0
- package/build/types/resources/services/index.js.map +1 -0
- package/build/types/resources/services/team_resource.d.ts +48 -0
- package/build/types/resources/services/team_resource.d.ts.map +1 -0
- package/build/types/resources/services/team_resource.js +7 -0
- package/build/types/resources/services/team_resource.js.map +1 -0
- package/build/utils/index.d.ts +1 -0
- package/build/utils/index.d.ts.map +1 -1
- package/build/utils/index.js +1 -0
- package/build/utils/index.js.map +1 -1
- package/build/utils/native_adapters/audio.d.ts +13 -0
- package/build/utils/native_adapters/audio.d.ts.map +1 -0
- package/build/utils/native_adapters/audio.js +7 -0
- package/build/utils/native_adapters/audio.js.map +1 -0
- package/build/utils/native_adapters/configuration.d.ts +7 -1
- package/build/utils/native_adapters/configuration.d.ts.map +1 -1
- package/build/utils/native_adapters/configuration.js +17 -1
- package/build/utils/native_adapters/configuration.js.map +1 -1
- package/build/utils/native_adapters/index.d.ts +2 -0
- package/build/utils/native_adapters/index.d.ts.map +1 -1
- package/build/utils/native_adapters/index.js +2 -0
- package/build/utils/native_adapters/index.js.map +1 -1
- package/build/utils/native_adapters/video.d.ts +25 -0
- package/build/utils/native_adapters/video.d.ts.map +1 -0
- package/build/utils/native_adapters/video.js +7 -0
- package/build/utils/native_adapters/video.js.map +1 -0
- package/build/utils/parse_simple_markdown.d.ts +7 -0
- package/build/utils/parse_simple_markdown.d.ts.map +1 -0
- package/build/utils/parse_simple_markdown.js +32 -0
- package/build/utils/parse_simple_markdown.js.map +1 -0
- package/build/utils/pluralize.d.ts +2 -0
- package/build/utils/pluralize.d.ts.map +1 -0
- package/build/utils/pluralize.js +10 -0
- package/build/utils/pluralize.js.map +1 -0
- package/build/utils/request/conversation.d.ts +10 -0
- package/build/utils/request/conversation.d.ts.map +1 -0
- package/build/utils/request/conversation.js +32 -0
- package/build/utils/request/conversation.js.map +1 -0
- package/build/utils/request/messages.d.ts +15 -0
- package/build/utils/request/messages.d.ts.map +1 -0
- package/build/utils/request/messages.js +22 -0
- package/build/utils/request/messages.js.map +1 -0
- package/build/utils/theme.d.ts +1 -1
- package/build/utils/theme.d.ts.map +1 -1
- package/build/utils/theme.js +1 -1
- package/build/utils/theme.js.map +1 -1
- package/package.json +2 -2
- package/src/__tests__/utils/parse_simple_markdown.ts +93 -0
- package/src/__tests__/utils/pluralize.tsx +17 -0
- package/src/components/conversation/attachments/attachment_card.tsx +46 -0
- package/src/components/conversation/attachments/audio_attachment.tsx +102 -0
- package/src/components/conversation/attachments/constants.ts +5 -0
- package/src/components/conversation/attachments/download_attachment_button.tsx +46 -0
- package/src/components/conversation/attachments/expanded_link.tsx +54 -0
- package/src/components/conversation/attachments/generic_file_attachment.tsx +75 -0
- package/src/components/conversation/attachments/giphy_attachment.tsx +56 -0
- package/src/components/conversation/attachments/image_attachment.tsx +31 -0
- package/src/components/conversation/attachments/video_attachment.tsx +92 -0
- package/src/components/conversation/message.tsx +15 -6
- package/src/components/conversation/message_attachments.tsx +61 -0
- package/src/components/conversation/message_markdown.tsx +52 -0
- package/src/components/conversations/conversation_preview.tsx +84 -0
- package/src/components/conversations/conversations.tsx +79 -0
- package/src/components/conversations/unread_count_badge.tsx +38 -0
- package/src/components/display/badge.tsx +41 -10
- package/src/components/display/button.tsx +1 -1
- package/src/components/display/child_notice.tsx +2 -2
- package/src/components/display/icon.tsx +10 -8
- package/src/components/display/text.tsx +1 -7
- package/src/components/index.tsx +1 -1
- package/src/hooks/use_api.ts +11 -10
- package/src/hooks/use_api_client.ts +1 -1
- package/src/hooks/use_conversation.ts +1 -1
- package/src/hooks/use_conversation_jolt_events.ts +1 -1
- package/src/hooks/use_conversation_messages_jolt_events.ts +1 -1
- package/src/hooks/use_conversations.ts +3 -31
- package/src/hooks/use_groups.ts +31 -0
- package/src/hooks/use_groups_groups.ts +20 -0
- package/src/hooks/use_services_team.ts +30 -0
- package/src/hooks/use_suspense_api.ts +4 -4
- package/src/hooks/use_teams.ts +25 -0
- package/src/navigation/index.tsx +8 -0
- package/src/screens/conversation_details_screen.tsx +149 -117
- package/src/screens/conversation_filters_screen.tsx +488 -0
- package/src/screens/conversation_screen.tsx +8 -1
- package/src/screens/conversations_screen.tsx +210 -13
- package/src/screens/create/conversation_select_recipients_screen.tsx +3 -11
- package/src/types/resources/group_resource.ts +5 -2
- package/src/types/resources/index.ts +1 -0
- package/src/types/resources/services/index.ts +1 -0
- package/src/types/resources/services/team_resource.ts +60 -0
- package/src/utils/client/types.d.ts +2 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/native_adapters/audio.ts +15 -0
- package/src/utils/native_adapters/configuration.ts +24 -1
- package/src/utils/native_adapters/index.ts +2 -0
- package/src/utils/native_adapters/video.ts +30 -0
- package/src/utils/parse_simple_markdown.ts +40 -0
- package/src/utils/pluralize.ts +11 -0
- package/src/utils/request/conversation.ts +46 -0
- package/src/utils/request/messages.ts +21 -0
- package/src/utils/theme.ts +2 -2
- package/build/components/conversations.d.ts +0 -3
- package/build/components/conversations.d.ts.map +0 -1
- package/build/components/conversations.js +0 -100
- package/build/components/conversations.js.map +0 -1
- package/src/components/conversations.tsx +0 -144
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAoB,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC7F,OAAO,EAEL,aAAa,EACb,QAAQ,IAAI,kBAAkB,EAC9B,QAAQ,GACT,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAS5E,MAAM,UAAU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vB,SAAS,EAAE;YACT,IAAI,EAAE,CAAC;YACP,cAAc,EAAE,QAAQ;YACxB,eAAe,EAAE,eAAe,CAAC,MAAM,CAAC,IAAI;YAC5C,aAAa,EAAE,MAAM;SACtB;QACD,YAAY,EAAE;YACZ,IAAI,EAAE,CAAC;SACR;QACD,aAAa,EAAE;YACb,GAAG,EAAE,EAAE;YACP,iBAAiB,EAAE,EAAE;YACrB,eAAe,EAAE,EAAE;SACpB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { HeaderTitle, HeaderTitleProps, PlatformPressable } from '@react-navigation/elements'\nimport {\n StaticScreenProps,\n useNavigation,\n useTheme as useNavigationTheme,\n useRoute,\n} from '@react-navigation/native'\nimport React, { useCallback, useEffect } from 'react'\nimport { FlatList, Platform, StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Badge, Icon } from '../components'\nimport { Message } from '../components/conversation/message'\nimport { MessageForm } from '../components/conversation/message_form'\nimport { KeyboardView } from '../components/display/keyboard_view'\nimport { useConversation } from '../hooks/use_conversation'\nimport { useConversationMessages } from '../hooks/use_conversation_messages'\n\ntype ConversationRouteProps = {\n conversation_id: number\n chat_group_graph_id?: string\n}\n\nexport type ConversationScreenProps = StaticScreenProps<ConversationRouteProps>\n\nexport function ConversationScreen({ route }: ConversationScreenProps) {\n const styles = useStyles()\n const navigation = useNavigation()\n\n const { conversation_id } = route.params\n const { data: conversation } = useConversation(route.params)\n const { messages, refetch, isRefetching, fetchNextPage } = useConversationMessages({\n conversation_id,\n })\n\n // Seems to be necessary to define this way so we get the route picked up\n const headerTitle = useCallback(\n (props: HeaderTitleProps) => <PressableHeaderTitle {...props} />,\n []\n )\n\n useEffect(() => {\n navigation.setOptions({ headerTitle, title: conversation?.title })\n }, [conversation, conversation_id, navigation, headerTitle, conversation?.title])\n\n return (\n <View style={styles.container}>\n <KeyboardView style={styles.keyboardView}>\n <FlatList\n inverted\n contentContainerStyle={styles.listContainer}\n refreshing={isRefetching}\n onRefresh={refetch}\n data={messages}\n keyExtractor={item => item.id}\n renderItem={({ item }) => <Message {...item} conversation_id={conversation_id} />}\n onEndReached={() => fetchNextPage()}\n />\n <MessageForm.Root conversation={conversation}>\n {/* <MessageForm.AttachmentPicker /> */}\n {/* <MessageForm.Commands /> */}\n <MessageForm.TextInput />\n <MessageForm.SubmitButton />\n </MessageForm.Root>\n </KeyboardView>\n </View>\n )\n}\n\nconst PressableHeaderTitle = ({ style, children }: HeaderTitleProps) => {\n const styles = usePressableHeaderStyle()\n const navigation = useNavigation()\n\n const route = useRoute() as ConversationScreenProps['route']\n\n const { data: conversation } = useConversation(route.params)\n const badge = conversation.badges?.[0]\n const resourceType = badge?.pcoResourceType || ''\n const productName = badge?.appName\n const name = badge?.text || undefined\n\n return (\n <PlatformPressable\n style={styles.container}\n onPress={() =>\n navigation.navigate('ConversationDetails', { conversation_id: conversation?.id })\n }\n >\n <View style={styles.titleWrapper}>\n <HeaderTitle style={[styles.title, style]}>{children}</HeaderTitle>\n <Icon name=\"general.downChevron\" size={12} />\n </View>\n <Badge\n variant=\"metaSubtle\"\n productLogoName={productName}\n label={resourceType}\n metaLabel={name}\n style={styles.badge}\n />\n </PlatformPressable>\n )\n}\n\nconst usePressableHeaderStyle = () => {\n return StyleSheet.create({\n container: {\n alignItems: Platform.select({ android: 'flex-start', default: 'center' }),\n },\n titleWrapper: {\n alignItems: 'center',\n columnGap: 4,\n flexDirection: 'row',\n },\n title: {\n padding: 0,\n margin: 0,\n },\n badge: {\n alignSelf: Platform.select({ android: 'flex-start', default: 'center' }),\n marginTop: 2,\n },\n })\n}\n\nconst useStyles = () => {\n const navigationTheme = useNavigationTheme()\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n backgroundColor: navigationTheme.colors.card,\n paddingBottom: bottom,\n },\n keyboardView: {\n flex: 1,\n },\n listContainer: {\n gap: 12,\n paddingHorizontal: 16,\n paddingVertical: 12,\n },\n })\n}\n"]}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
2
|
import React from 'react';
|
|
3
|
+
import { GraphId } from '../types/resources/group_resource';
|
|
3
4
|
export type ConversationScreenProps = StaticScreenProps<{
|
|
4
5
|
title?: string;
|
|
5
|
-
chat_group_graph_id?:
|
|
6
|
+
chat_group_graph_id?: GraphId;
|
|
7
|
+
group_source_app_name?: string;
|
|
6
8
|
}>;
|
|
7
|
-
export declare function ConversationsScreen(
|
|
9
|
+
export declare function ConversationsScreen({ route }: ConversationScreenProps): React.JSX.Element;
|
|
8
10
|
//# sourceMappingURL=conversations_screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversations_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"conversations_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversations_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,iBAAiB,EAA2B,MAAM,0BAA0B,CAAA;AAChG,OAAO,KAA+B,MAAM,OAAO,CAAA;AAMnD,OAAO,EAAE,OAAO,EAAiB,MAAM,mCAAmC,CAAA;AAG1E,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;IACtD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAA;CAC/B,CAAC,CAAA;AAEF,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,EAAE,uBAAuB,qBA+BrE"}
|
|
@@ -1,16 +1,144 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { useNavigation, useRoute } from '@react-navigation/native';
|
|
2
|
+
import React, { useCallback, useMemo } from 'react';
|
|
2
3
|
import { StyleSheet, View } from 'react-native';
|
|
3
|
-
import { Conversations } from '../components';
|
|
4
|
-
|
|
4
|
+
import { Badge, Button, Conversations, Heading, TextButton } from '../components';
|
|
5
|
+
import { ActionButton } from '../components/display/action_button';
|
|
6
|
+
import { useCanCreateConversations, useTheme } from '../hooks';
|
|
7
|
+
import { useApiGet } from '../hooks/use_api';
|
|
8
|
+
import { useCanDisplayGroups } from '../hooks/use_groups';
|
|
9
|
+
export function ConversationsScreen({ route }) {
|
|
10
|
+
const navigation = useNavigation();
|
|
11
|
+
const canCreateConversations = useCanCreateConversations();
|
|
12
|
+
const styles = useStyles();
|
|
13
|
+
const { chat_group_graph_id, group_source_app_name } = route.params;
|
|
14
|
+
const filter = useMemo(() => {
|
|
15
|
+
if (chat_group_graph_id) {
|
|
16
|
+
return 'group';
|
|
17
|
+
}
|
|
18
|
+
else if (group_source_app_name) {
|
|
19
|
+
return 'group_source_app_name';
|
|
20
|
+
}
|
|
21
|
+
return 'mine_or_not_empty';
|
|
22
|
+
}, [chat_group_graph_id, group_source_app_name]);
|
|
5
23
|
return (<View style={styles.container}>
|
|
6
|
-
<Conversations />
|
|
24
|
+
<Conversations ListHeaderComponent={ListHeaderComponent} group={chat_group_graph_id} group_source_app_name={group_source_app_name} filter={filter}/>
|
|
25
|
+
<ActionButton visible={canCreateConversations} title="New conversation" onPress={() => navigation.navigate('Create')}/>
|
|
7
26
|
</View>);
|
|
8
27
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
});
|
|
28
|
+
var FilterTypes;
|
|
29
|
+
(function (FilterTypes) {
|
|
30
|
+
FilterTypes["All"] = "All";
|
|
31
|
+
FilterTypes["Groups"] = "Groups";
|
|
32
|
+
FilterTypes["Teams"] = "Teams";
|
|
33
|
+
FilterTypes["More"] = "More";
|
|
34
|
+
})(FilterTypes || (FilterTypes = {}));
|
|
35
|
+
const ListHeaderComponent = () => {
|
|
36
|
+
const styles = useStyles();
|
|
37
|
+
const navigation = useNavigation();
|
|
38
|
+
const canFilterByTeams = useCanDisplayGroups({ source_app_name: 'Services', source_type: 'Team' });
|
|
39
|
+
const canFilterByGroups = useCanDisplayGroups({ source_app_name: 'Groups', source_type: 'Group' });
|
|
40
|
+
const route = useRoute();
|
|
41
|
+
const { chat_group_graph_id, group_source_app_name = '' } = route.params;
|
|
42
|
+
const active = useMemo(() => {
|
|
43
|
+
if (chat_group_graph_id) {
|
|
44
|
+
return FilterTypes.More;
|
|
45
|
+
}
|
|
46
|
+
else if (/groups/i.test(group_source_app_name)) {
|
|
47
|
+
return FilterTypes.Groups;
|
|
48
|
+
}
|
|
49
|
+
else if (/services/i.test(group_source_app_name)) {
|
|
50
|
+
return FilterTypes.Teams;
|
|
51
|
+
}
|
|
52
|
+
return FilterTypes.All;
|
|
53
|
+
}, [chat_group_graph_id, group_source_app_name]);
|
|
54
|
+
const hideAppFilters = !canFilterByGroups || !canFilterByTeams;
|
|
55
|
+
return (<View style={styles.listHeader}>
|
|
56
|
+
<View style={styles.titleRow}>
|
|
57
|
+
<Heading numberOfLines={1} variant="h2">
|
|
58
|
+
Conversations
|
|
59
|
+
</Heading>
|
|
60
|
+
<TextButton>Mark all read</TextButton>
|
|
61
|
+
</View>
|
|
62
|
+
<View style={styles.filterRow}>
|
|
63
|
+
<FilterButton title={FilterTypes.All} activeTitle={active} hidden={!canFilterByGroups || !canFilterByTeams} onPress={() => navigation.setParams({
|
|
64
|
+
chat_group_graph_id: undefined,
|
|
65
|
+
group_source_app_name: undefined,
|
|
66
|
+
})}/>
|
|
67
|
+
<FilterButton title={FilterTypes.Groups} activeTitle={active} hidden={hideAppFilters} onPress={() => navigation.setParams({
|
|
68
|
+
chat_group_graph_id: undefined,
|
|
69
|
+
group_source_app_name: 'Groups',
|
|
70
|
+
})}/>
|
|
71
|
+
<FilterButton title={FilterTypes.Teams} activeTitle={active} hidden={hideAppFilters} onPress={() => navigation.setParams({
|
|
72
|
+
chat_group_graph_id: undefined,
|
|
73
|
+
group_source_app_name: 'Services',
|
|
74
|
+
})}/>
|
|
75
|
+
<Button title={hideAppFilters ? 'Filter' : FilterTypes.More} onPress={() => navigation.navigate('ConversationFilters', {
|
|
76
|
+
chat_group_graph_id,
|
|
77
|
+
group_source_app_name,
|
|
78
|
+
})} variant={active === FilterTypes.More ? 'fill' : 'outline'} iconNameRight="general.threeReducingHorizontalBars"/>
|
|
79
|
+
</View>
|
|
80
|
+
<Badges />
|
|
81
|
+
</View>);
|
|
82
|
+
};
|
|
83
|
+
const Badges = () => {
|
|
84
|
+
const styles = useStyles();
|
|
85
|
+
const navigation = useNavigation();
|
|
86
|
+
const route = useRoute();
|
|
87
|
+
const { chat_group_graph_id } = route.params;
|
|
88
|
+
const { data: group } = useApiGet({
|
|
89
|
+
url: `/me/groups/${chat_group_graph_id}`,
|
|
90
|
+
data: {
|
|
91
|
+
fields: {
|
|
92
|
+
Group: [],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
enabled: !!chat_group_graph_id,
|
|
96
|
+
app: 'chat',
|
|
97
|
+
});
|
|
98
|
+
const handleBadgePress = useCallback(() => {
|
|
99
|
+
navigation.setParams({
|
|
100
|
+
chat_group_graph_id: undefined,
|
|
101
|
+
group_source_app_name: undefined,
|
|
102
|
+
});
|
|
103
|
+
}, [navigation]);
|
|
104
|
+
if (!group)
|
|
105
|
+
return null;
|
|
106
|
+
return (<View style={styles.groupBadge}>
|
|
107
|
+
<Badge iconNameRight="general.x" label={group?.name || ''} onPress={handleBadgePress}/>
|
|
108
|
+
</View>);
|
|
109
|
+
};
|
|
110
|
+
function FilterButton({ title, activeTitle, onPress, hidden = false, ...restProps }) {
|
|
111
|
+
if (hidden)
|
|
112
|
+
return null;
|
|
113
|
+
return (<Button title={title} variant={activeTitle === title ? 'fill' : 'outline'} onPress={onPress} {...restProps}/>);
|
|
114
|
+
}
|
|
115
|
+
const useStyles = () => {
|
|
116
|
+
const theme = useTheme();
|
|
117
|
+
return StyleSheet.create({
|
|
118
|
+
container: {
|
|
119
|
+
flex: 1,
|
|
120
|
+
justifyContent: 'center',
|
|
121
|
+
},
|
|
122
|
+
listHeader: {
|
|
123
|
+
borderBottomWidth: 1,
|
|
124
|
+
borderBottomColor: theme.colors.fillColorNeutral050Base,
|
|
125
|
+
paddingHorizontal: 16,
|
|
126
|
+
paddingBottom: 16,
|
|
127
|
+
gap: 12,
|
|
128
|
+
},
|
|
129
|
+
titleRow: {
|
|
130
|
+
flexDirection: 'row',
|
|
131
|
+
justifyContent: 'space-between',
|
|
132
|
+
paddingTop: 8,
|
|
133
|
+
},
|
|
134
|
+
filterRow: {
|
|
135
|
+
flexDirection: 'row',
|
|
136
|
+
justifyContent: 'flex-start',
|
|
137
|
+
gap: 8,
|
|
138
|
+
},
|
|
139
|
+
groupBadge: {
|
|
140
|
+
flexDirection: 'row',
|
|
141
|
+
},
|
|
142
|
+
});
|
|
143
|
+
};
|
|
16
144
|
//# sourceMappingURL=conversations_screen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversations_screen.js","sourceRoot":"","sources":["../../src/screens/conversations_screen.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAO7C,MAAM,UAAU,mBAAmB,CAAC,MAA+B;IACjE,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;MAAA,CAAC,aAAa,CAAC,AAAD,EAChB;IAAA,EAAE,IAAI,CAAC,CACR,CAAA;AACH,CAAC;AAED,MAAM,MAAM,GAAG,UAAU,CAAC,MAAM,CAAC;IAC/B,SAAS,EAAE;QACT,IAAI,EAAE,CAAC;QACP,cAAc,EAAE,QAAQ;QACxB,GAAG,EAAE,CAAC;KACP;CACF,CAAC,CAAA","sourcesContent":["import { StaticScreenProps } from '@react-navigation/native'\nimport React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Conversations } from '../components'\n\nexport type ConversationScreenProps = StaticScreenProps<{\n title?: string\n chat_group_graph_id?: string\n}>\n\nexport function ConversationsScreen(_props: ConversationScreenProps) {\n return (\n <View style={styles.container}>\n <Conversations />\n </View>\n )\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n gap: 8,\n },\n})\n"]}
|
|
1
|
+
{"version":3,"file":"conversations_screen.js","sourceRoot":"","sources":["../../src/screens/conversations_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgC,aAAa,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAA;AAChG,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,EAAe,aAAa,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAA;AAClE,OAAO,EAAE,yBAAyB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAQzD,MAAM,UAAU,mBAAmB,CAAC,EAAE,KAAK,EAA2B;IACpE,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,sBAAsB,GAAG,yBAAyB,EAAE,CAAA;IAC1D,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,GAAG,KAAK,CAAC,MAAM,CAAA;IAEnE,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE;QAC1B,IAAI,mBAAmB,EAAE,CAAC;YACxB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AAO,CAAC,CAAC,OAAO,CAAC,CACjB,IAAI,SAAS,CAAC,EACd,CACH,CAAA;AACH,CAAC;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,IAAI,EAAE,CAAC;YACP,cAAc,EAAE,QAAQ;SACzB;QACD,UAAU,EAAE;YACV,iBAAiB,EAAE,CAAC;YACpB,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB;YACvD,iBAAiB,EAAE,EAAE;YACrB,aAAa,EAAE,EAAE;YACjB,GAAG,EAAE,EAAE;SACR;QACD,QAAQ,EAAE;YACR,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,eAAe;YAC/B,UAAU,EAAE,CAAC;SACd;QACD,SAAS,EAAE;YACT,aAAa,EAAE,KAAK;YACpB,cAAc,EAAE,YAAY;YAC5B,GAAG,EAAE,CAAC;SACP;QACD,UAAU,EAAE;YACV,aAAa,EAAE,KAAK;SACrB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { RouteProp, StaticScreenProps, useNavigation, useRoute } from '@react-navigation/native'\nimport React, { useCallback, useMemo } from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Badge, Button, ButtonProps, Conversations, Heading, TextButton } from '../components'\nimport { ActionButton } from '../components/display/action_button'\nimport { useCanCreateConversations, useTheme } from '../hooks'\nimport { useApiGet } from '../hooks/use_api'\nimport { GraphId, GroupResource } from '../types/resources/group_resource'\nimport { useCanDisplayGroups } from '../hooks/use_groups'\n\nexport type ConversationScreenProps = StaticScreenProps<{\n title?: string\n chat_group_graph_id?: GraphId\n group_source_app_name?: string\n}>\n\nexport function ConversationsScreen({ route }: ConversationScreenProps) {\n const navigation = useNavigation()\n const canCreateConversations = useCanCreateConversations()\n const styles = useStyles()\n const { chat_group_graph_id, group_source_app_name } = route.params\n\n const filter = useMemo(() => {\n if (chat_group_graph_id) {\n return 'group'\n } else if (group_source_app_name) {\n return 'group_source_app_name'\n }\n\n return 'mine_or_not_empty'\n }, [chat_group_graph_id, group_source_app_name])\n\n return (\n <View style={styles.container}>\n <Conversations\n ListHeaderComponent={ListHeaderComponent}\n group={chat_group_graph_id}\n group_source_app_name={group_source_app_name}\n filter={filter}\n />\n <ActionButton\n visible={canCreateConversations}\n title=\"New conversation\"\n onPress={() => navigation.navigate('Create')}\n />\n </View>\n )\n}\n\nenum FilterTypes {\n All = 'All',\n Groups = 'Groups',\n Teams = 'Teams',\n More = 'More',\n}\n\nconst ListHeaderComponent = () => {\n const styles = useStyles()\n const navigation = useNavigation()\n const canFilterByTeams = useCanDisplayGroups({ source_app_name: 'Services', source_type: 'Team' })\n const canFilterByGroups = useCanDisplayGroups({ source_app_name: 'Groups', source_type: 'Group' })\n const route = useRoute<RouteProp<ConversationScreenProps['route']>>()\n const { chat_group_graph_id, group_source_app_name = '' } = route.params\n\n const active: FilterTypes = useMemo(() => {\n if (chat_group_graph_id) {\n return FilterTypes.More\n } else if (/groups/i.test(group_source_app_name)) {\n return FilterTypes.Groups\n } else if (/services/i.test(group_source_app_name)) {\n return FilterTypes.Teams\n }\n\n return FilterTypes.All\n }, [chat_group_graph_id, group_source_app_name])\n\n const hideAppFilters = !canFilterByGroups || !canFilterByTeams\n\n return (\n <View style={styles.listHeader}>\n <View style={styles.titleRow}>\n <Heading numberOfLines={1} variant=\"h2\">\n Conversations\n </Heading>\n <TextButton>Mark all read</TextButton>\n </View>\n <View style={styles.filterRow}>\n <FilterButton\n title={FilterTypes.All}\n activeTitle={active}\n hidden={!canFilterByGroups || !canFilterByTeams}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: undefined,\n })\n }\n />\n <FilterButton\n title={FilterTypes.Groups}\n activeTitle={active}\n hidden={hideAppFilters}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: 'Groups',\n })\n }\n />\n <FilterButton\n title={FilterTypes.Teams}\n activeTitle={active}\n hidden={hideAppFilters}\n onPress={() =>\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: 'Services',\n })\n }\n />\n <Button\n title={hideAppFilters ? 'Filter' : FilterTypes.More}\n onPress={() =>\n navigation.navigate('ConversationFilters', {\n chat_group_graph_id,\n group_source_app_name,\n })\n }\n variant={active === FilterTypes.More ? 'fill' : 'outline'}\n iconNameRight=\"general.threeReducingHorizontalBars\"\n />\n </View>\n <Badges />\n </View>\n )\n}\n\nconst Badges = () => {\n const styles = useStyles()\n const navigation = useNavigation()\n const route = useRoute<RouteProp<ConversationScreenProps['route']>>()\n const { chat_group_graph_id } = route.params\n const { data: group } = useApiGet<GroupResource>({\n url: `/me/groups/${chat_group_graph_id}`,\n data: {\n fields: {\n Group: [],\n },\n },\n enabled: !!chat_group_graph_id,\n app: 'chat',\n })\n\n const handleBadgePress = useCallback(() => {\n navigation.setParams({\n chat_group_graph_id: undefined,\n group_source_app_name: undefined,\n })\n }, [navigation])\n\n if (!group) return null\n\n return (\n <View style={styles.groupBadge}>\n <Badge iconNameRight=\"general.x\" label={group?.name || ''} onPress={handleBadgePress} />\n </View>\n )\n}\n\nfunction FilterButton({\n title,\n activeTitle,\n onPress,\n hidden = false,\n ...restProps\n}: {\n title: string\n activeTitle: string\n onPress: () => void\n hidden?: boolean\n} & ButtonProps) {\n if (hidden) return null\n\n return (\n <Button\n title={title}\n variant={activeTitle === title ? 'fill' : 'outline'}\n onPress={onPress}\n {...restProps}\n />\n )\n}\n\nconst useStyles = () => {\n const theme = useTheme()\n return StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n },\n listHeader: {\n borderBottomWidth: 1,\n borderBottomColor: theme.colors.fillColorNeutral050Base,\n paddingHorizontal: 16,\n paddingBottom: 16,\n gap: 12,\n },\n titleRow: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n paddingTop: 8,\n },\n filterRow: {\n flexDirection: 'row',\n justifyContent: 'flex-start',\n gap: 8,\n },\n groupBadge: {\n flexDirection: 'row',\n },\n })\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_select_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/create/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"conversation_select_recipients_screen.d.ts","sourceRoot":"","sources":["../../../src/screens/create/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,KAAK,uCAAuC,GAAG,iBAAiB,CAAC;IAC/D,mBAAmB,CAAC,EAAE,MAAM,CAAA;CAC7B,CAAC,CAAA;AAMF,eAAO,MAAM,kCAAkC,OAAQ,uCAAuC,sBAgE7F,CAAA"}
|
|
@@ -4,23 +4,15 @@ import React from 'react';
|
|
|
4
4
|
import { ScrollView, StyleSheet, View } from 'react-native';
|
|
5
5
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
6
6
|
import { Button, Heading, Icon, Image, Text } from '../../components';
|
|
7
|
-
import {
|
|
7
|
+
import { useTheme } from '../../hooks';
|
|
8
|
+
import { useGroupsGroups } from '../../hooks/use_groups_groups';
|
|
8
9
|
const ASPECT_RATIO = 16 / 9;
|
|
9
10
|
const THUMBNAIL_WIDTH = 80;
|
|
10
11
|
const THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO;
|
|
11
12
|
export const ConversationSelectRecipientsScreen = ({}) => {
|
|
12
13
|
const styles = useStyles();
|
|
13
14
|
const navigation = useNavigation();
|
|
14
|
-
const { data: groups = [] } =
|
|
15
|
-
url: '/me/groups',
|
|
16
|
-
data: {
|
|
17
|
-
perPage: 100,
|
|
18
|
-
fields: {
|
|
19
|
-
Group: ['can_create_conversation', 'name', 'header_image', 'memberships_count'],
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
app: 'groups',
|
|
23
|
-
});
|
|
15
|
+
const { data: groups = [] } = useGroupsGroups();
|
|
24
16
|
const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation);
|
|
25
17
|
const handleNavigateToCreateConversation = (group) => {
|
|
26
18
|
navigation.navigate('Create', {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_select_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/create/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACrE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"conversation_select_recipients_screen.js","sourceRoot":"","sources":["../../../src/screens/create/conversation_select_recipients_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EA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ACrD;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { ScrollView, StyleSheet, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Button, Heading, Icon, Image, Text } from '../../components'\nimport { useTheme } from '../../hooks'\nimport { GroupsGroupResource } from '../../types'\nimport { useGroupsGroups } from '../../hooks/use_groups_groups'\n\ntype ConversationSelectRecipientsScreenProps = StaticScreenProps<{\n chat_group_graph_id?: string\n}>\n\nconst ASPECT_RATIO = 16 / 9\nconst THUMBNAIL_WIDTH = 80\nconst THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO\n\nexport const ConversationSelectRecipientsScreen = ({}: ConversationSelectRecipientsScreenProps) => {\n const styles = useStyles()\n const navigation = useNavigation()\n const { data: groups = [] } = useGroupsGroups()\n const groupsWithCreatePermission = groups.filter(g => g.canCreateConversation)\n\n const handleNavigateToCreateConversation = (group: GroupsGroupResource) => {\n navigation.navigate('Create', {\n screen: 'ConversationCreate',\n params: {\n group_id: group.id,\n },\n })\n }\n\n return (\n <ScrollView style={styles.container}>\n <View style={styles.section}>\n <View style={styles.sectionHeader}>\n <Heading>My groups</Heading>\n </View>\n <View>\n {groupsWithCreatePermission.map(group => (\n <PlatformPressable\n key={group.id}\n style={styles.row}\n onPress={() => handleNavigateToCreateConversation(group)}\n >\n <Image\n source={{ uri: group.headerImage?.thumbnail }}\n resizeMode=\"cover\"\n style={styles.rowImage}\n alt={`Image for ${group.name}`}\n />\n <View>\n <Heading variant=\"h3\">{group.name}</Heading>\n <Text>{group.membershipsCount} members</Text>\n </View>\n <Icon name=\"general.rightChevron\" size={16} style={styles.rowIconRight} />\n </PlatformPressable>\n ))}\n </View>\n </View>\n <View style={styles.section}>\n <View style={styles.sectionHeader}>\n <Heading>Teams I lead</Heading>\n <Button\n style={styles.selectTeamsButton}\n onPress={() =>\n navigation.navigate('Create', {\n screen: 'ConversationFilterRecipients',\n params: {\n conversation_id: '2196252',\n },\n })\n }\n title=\"Select teams\"\n variant=\"outline\"\n iconNameLeft=\"general.search\"\n />\n </View>\n </View>\n </ScrollView>\n )\n}\n\nconst useStyles = () => {\n const { bottom } = useSafeAreaInsets()\n const theme = useTheme()\n\n return StyleSheet.create({\n container: {\n flex: 1,\n gap: 8,\n },\n section: {\n padding: 16,\n flex: 1,\n },\n sectionHeader: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n selectTeamsButton: {},\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n paddingVertical: 16,\n borderBottomWidth: 1,\n borderColor: theme.colors.fillColorNeutral050Base,\n },\n rowImage: {\n width: THUMBNAIL_WIDTH,\n height: THUMBNAIL_HEIGHT,\n borderRadius: 4,\n },\n rowIconRight: {\n marginLeft: 'auto',\n color: theme.colors.fillColorNeutral030,\n },\n routeDebug: {\n alignContent: 'center',\n padding: 16,\n paddingBottom: bottom,\n borderTopWidth: 1,\n borderTopColor: theme.colors.fillColorNeutral050Base,\n },\n })\n}\n"]}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { AppName } from './app_name';
|
|
2
|
+
export type SourceType = 'Team' | 'Group' | 'PlanTeam';
|
|
3
|
+
export type GraphId = `${AppName}-${SourceType}-${number}`;
|
|
2
4
|
export interface GroupResource {
|
|
5
|
+
id: GraphId;
|
|
3
6
|
type: 'Group';
|
|
4
|
-
id: string;
|
|
5
7
|
links: {
|
|
6
8
|
self: string;
|
|
7
9
|
};
|
|
8
10
|
name: string | null;
|
|
9
11
|
sourceAppName: AppName;
|
|
10
|
-
sourceType:
|
|
12
|
+
sourceType: SourceType;
|
|
11
13
|
}
|
|
12
14
|
//# sourceMappingURL=group_resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group_resource.d.ts","sourceRoot":"","sources":["../../../src/types/resources/group_resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,MAAM,WAAW,aAAa;IAC5B,
|
|
1
|
+
{"version":3,"file":"group_resource.d.ts","sourceRoot":"","sources":["../../../src/types/resources/group_resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAA;AACtD,MAAM,MAAM,OAAO,GAAG,GAAG,OAAO,IAAI,UAAU,IAAI,MAAM,EAAE,CAAA;AAE1D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,OAAO,CAAA;IACX,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,aAAa,EAAE,OAAO,CAAA;IACtB,UAAU,EAAE,UAAU,CAAA;CACvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"group_resource.js","sourceRoot":"","sources":["../../../src/types/resources/group_resource.ts"],"names":[],"mappings":"","sourcesContent":["import { AppName } from './app_name'\n\nexport interface GroupResource {\n
|
|
1
|
+
{"version":3,"file":"group_resource.js","sourceRoot":"","sources":["../../../src/types/resources/group_resource.ts"],"names":[],"mappings":"","sourcesContent":["import { AppName } from './app_name'\n\nexport type SourceType = 'Team' | 'Group' | 'PlanTeam'\nexport type GraphId = `${AppName}-${SourceType}-${number}`\n\nexport interface GroupResource {\n id: GraphId\n type: 'Group'\n links: { self: string }\n name: string | null\n sourceAppName: AppName\n sourceType: SourceType\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA","sourcesContent":["export * from './conversation'\nexport * from './member'\nexport * from './message'\nexport * from './oauth_token'\nexport * from './person'\nexport * from './groups'\nexport * from './app_grant'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,YAAY,CAAA","sourcesContent":["export * from './conversation'\nexport * from './member'\nexport * from './message'\nexport * from './oauth_token'\nexport * from './person'\nexport * from './groups'\nexport * from './app_grant'\nexport * from './services'\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/resources/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/resources/services/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA","sourcesContent":["export * from './team_resource'\n"]}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { ResourceObject } from '../../api_primitives';
|
|
2
|
+
interface ServicesChatResource extends ResourceObject {
|
|
3
|
+
type: 'Chat';
|
|
4
|
+
}
|
|
5
|
+
export interface TeamResource extends ServicesChatResource {
|
|
6
|
+
teamsILead: TeamResponseItem[];
|
|
7
|
+
}
|
|
8
|
+
export interface TeamResponseItem {
|
|
9
|
+
name: string;
|
|
10
|
+
value: {
|
|
11
|
+
teamId: number;
|
|
12
|
+
serviceTypeId: number;
|
|
13
|
+
};
|
|
14
|
+
serviceTypeName: string;
|
|
15
|
+
teamName: string;
|
|
16
|
+
order: [number, string, string];
|
|
17
|
+
}
|
|
18
|
+
export interface TeamOptionResource extends ServicesChatResource {
|
|
19
|
+
teams: TeamOptionResponseItem[];
|
|
20
|
+
}
|
|
21
|
+
export interface TeamOptionResponseItem extends TeamResponseItem {
|
|
22
|
+
group: TeamOptionResponseItemGroupName;
|
|
23
|
+
}
|
|
24
|
+
export type TeamOptionResponseItemGroupName = 'teams_i_lead' | 'other_teams';
|
|
25
|
+
export interface PlansResource extends ServicesChatResource {
|
|
26
|
+
plans: PlansResponseItem[];
|
|
27
|
+
}
|
|
28
|
+
interface PlansResponseItem {
|
|
29
|
+
value: number;
|
|
30
|
+
name: string;
|
|
31
|
+
}
|
|
32
|
+
export interface TeamPeopleResource extends ServicesChatResource {
|
|
33
|
+
people: PersonResponseItem[];
|
|
34
|
+
}
|
|
35
|
+
interface PersonResponseItem {
|
|
36
|
+
id: number;
|
|
37
|
+
name: string;
|
|
38
|
+
avatar: string;
|
|
39
|
+
badges: {
|
|
40
|
+
title: string;
|
|
41
|
+
}[];
|
|
42
|
+
child: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface ServicesChatPayloadResource extends ServicesChatResource {
|
|
45
|
+
payload: string;
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
48
|
+
//# sourceMappingURL=team_resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team_resource.d.ts","sourceRoot":"","sources":["../../../../src/types/resources/services/team_resource.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAErD,UAAU,oBAAqB,SAAQ,cAAc;IACnD,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,YAAa,SAAQ,oBAAoB;IACxD,UAAU,EAAE,gBAAgB,EAAE,CAAA;CAC/B;AACD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE;QACL,MAAM,EAAE,MAAM,CAAA;QACd,aAAa,EAAE,MAAM,CAAA;KACtB,CAAA;IACD,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;CAChC;AAED,MAAM,WAAW,kBAAmB,SAAQ,oBAAoB;IAC9D,KAAK,EAAE,sBAAsB,EAAE,CAAA;CAChC;AAED,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D,KAAK,EAAE,+BAA+B,CAAA;CACvC;AAED,MAAM,MAAM,+BAA+B,GAAG,cAAc,GAAG,aAAa,CAAA;AAE5E,MAAM,WAAW,aAAc,SAAQ,oBAAoB;IACzD,KAAK,EAAE,iBAAiB,EAAE,CAAA;CAC3B;AAED,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,WAAW,kBAAmB,SAAQ,oBAAoB;IAC9D,MAAM,EAAE,kBAAkB,EAAE,CAAA;CAC7B;AAED,UAAU,kBAAkB;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC3B,KAAK,EAAE,OAAO,CAAA;CACf;AAED,MAAM,WAAW,2BAA4B,SAAQ,oBAAoB;IACvE,OAAO,EAAE,MAAM,CAAA;CAChB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// All of our calls out to services go out to /chat, which isn't a typical pco-api vertex.
|
|
2
|
+
// They all have a shared type of 'Chat' which has the following array attributes:
|
|
3
|
+
// group_identifiers, people, plans, teams and, teams_i_lead.
|
|
4
|
+
// All of these have a type array, are only rendered on request, and are exclusively used for this form.
|
|
5
|
+
// There is also a payload which is a string, and is used to create a conversation in chat.
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=team_resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team_resource.js","sourceRoot":"","sources":["../../../../src/types/resources/services/team_resource.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,kFAAkF;AAClF,6DAA6D;AAC7D,wGAAwG;AACxG,2FAA2F","sourcesContent":["// All of our calls out to services go out to /chat, which isn't a typical pco-api vertex.\n// They all have a shared type of 'Chat' which has the following array attributes:\n// group_identifiers, people, plans, teams and, teams_i_lead.\n// All of these have a type array, are only rendered on request, and are exclusively used for this form.\n// There is also a payload which is a string, and is used to create a conversation in chat.\n\nimport { ResourceObject } from '../../api_primitives'\n\ninterface ServicesChatResource extends ResourceObject {\n type: 'Chat'\n}\n\nexport interface TeamResource extends ServicesChatResource {\n teamsILead: TeamResponseItem[]\n}\nexport interface TeamResponseItem {\n name: string\n value: {\n teamId: number\n serviceTypeId: number\n }\n serviceTypeName: string\n teamName: string\n order: [number, string, string] // [serviceTypeId, serviceTypeName, teamName]\n}\n\nexport interface TeamOptionResource extends ServicesChatResource {\n teams: TeamOptionResponseItem[]\n}\n\nexport interface TeamOptionResponseItem extends TeamResponseItem {\n group: TeamOptionResponseItemGroupName\n}\n\nexport type TeamOptionResponseItemGroupName = 'teams_i_lead' | 'other_teams'\n\nexport interface PlansResource extends ServicesChatResource {\n plans: PlansResponseItem[]\n}\n\ninterface PlansResponseItem {\n value: number\n name: string\n}\n\nexport interface TeamPeopleResource extends ServicesChatResource {\n people: PersonResponseItem[]\n}\n\ninterface PersonResponseItem {\n id: number\n name: string\n avatar: string\n badges: { title: string }[]\n child: boolean\n}\n\nexport interface ServicesChatPayloadResource extends ServicesChatResource {\n payload: string\n}\n"]}
|
package/build/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA"}
|
package/build/utils/index.js
CHANGED
package/build/utils/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA","sourcesContent":["export * from './session'\nexport * from './theme'\nexport * from './styles'\nexport * from './space'\nexport * from './client'\nexport * from './uri'\nexport * from './cache'\nexport * from './native_adapters'\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,OAAO,CAAA;AACrB,cAAc,SAAS,CAAA;AACvB,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA","sourcesContent":["export * from './session'\nexport * from './theme'\nexport * from './styles'\nexport * from './space'\nexport * from './client'\nexport * from './uri'\nexport * from './cache'\nexport * from './native_adapters'\nexport * from './pluralize'\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
interface Audio {
|
|
2
|
+
play: () => void;
|
|
3
|
+
pause: () => void;
|
|
4
|
+
isPlaying: boolean;
|
|
5
|
+
duration: number;
|
|
6
|
+
position: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class AudioAdapter {
|
|
9
|
+
useAudio: (_: string) => Audio;
|
|
10
|
+
constructor(methods: AudioAdapter);
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=audio.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio.d.ts","sourceRoot":"","sources":["../../../src/utils/native_adapters/audio.ts"],"names":[],"mappings":"AAAA,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,KAAK,EAAE,MAAM,IAAI,CAAA;IACjB,SAAS,EAAE,OAAO,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,qBAAa,YAAY;IACvB,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,KAAK,CAAA;gBAElB,OAAO,EAAE,YAAY;CAGlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audio.js","sourceRoot":"","sources":["../../../src/utils/native_adapters/audio.ts"],"names":[],"mappings":"AAQA,MAAM,OAAO,YAAY;IACvB,QAAQ,CAAsB;IAE9B,YAAY,OAAqB;QAC/B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;IAClC,CAAC;CACF","sourcesContent":["interface Audio {\n play: () => void\n pause: () => void\n isPlaying: boolean\n duration: number\n position: number\n}\n\nexport class AudioAdapter {\n useAudio: (_: string) => Audio\n\n constructor(methods: AudioAdapter) {\n this.useAudio = methods.useAudio\n }\n}\n"]}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { AudioAdapter } from './audio';
|
|
1
2
|
import { ClipboardAdapter } from './clipboard';
|
|
3
|
+
import { VideoAdapter } from './video';
|
|
2
4
|
type ChatConfigurations = {
|
|
3
5
|
clipboard: ClipboardAdapter;
|
|
6
|
+
audio: AudioAdapter;
|
|
7
|
+
video: VideoAdapter;
|
|
4
8
|
};
|
|
5
9
|
export declare class ChatAdapters {
|
|
6
10
|
static configure(configurations: ChatConfigurations): void;
|
|
7
11
|
}
|
|
8
12
|
declare let Clipboard: ClipboardAdapter;
|
|
9
|
-
|
|
13
|
+
declare let Audio: AudioAdapter;
|
|
14
|
+
declare let Video: VideoAdapter;
|
|
15
|
+
export { Clipboard, Audio, Video };
|
|
10
16
|
//# sourceMappingURL=configuration.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/utils/native_adapters/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../../../src/utils/native_adapters/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEtC,KAAK,kBAAkB,GAAG;IACxB,SAAS,EAAE,gBAAgB,CAAA;IAC3B,KAAK,EAAE,YAAY,CAAA;IACnB,KAAK,EAAE,YAAY,CAAA;CACpB,CAAA;AAED,qBAAa,YAAY;IACvB,MAAM,CAAC,SAAS,CAAC,cAAc,EAAE,kBAAkB;CAKpD;AAMD,QAAA,IAAI,SAAS,EAAE,gBAMb,CAAA;AAEF,QAAA,IAAI,KAAK,EAAE,YAKT,CAAA;AAEF,QAAA,IAAI,KAAK,EAAE,YAQT,CAAA;AAEF,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import { AudioAdapter } from './audio';
|
|
1
2
|
import { ClipboardAdapter } from './clipboard';
|
|
3
|
+
import { VideoAdapter } from './video';
|
|
2
4
|
export class ChatAdapters {
|
|
3
5
|
static configure(configurations) {
|
|
4
6
|
Clipboard = configurations.clipboard;
|
|
7
|
+
Audio = configurations.audio;
|
|
8
|
+
Video = configurations.video;
|
|
5
9
|
}
|
|
6
10
|
}
|
|
7
11
|
const methodMissing = () => {
|
|
@@ -14,5 +18,17 @@ let Clipboard = new ClipboardAdapter({
|
|
|
14
18
|
},
|
|
15
19
|
setStringAsync: async (_) => methodMissing(),
|
|
16
20
|
});
|
|
17
|
-
|
|
21
|
+
let Audio = new AudioAdapter({
|
|
22
|
+
useAudio: (_) => {
|
|
23
|
+
methodMissing();
|
|
24
|
+
return {};
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
let Video = new VideoAdapter({
|
|
28
|
+
Player: Object.assign(() => {
|
|
29
|
+
methodMissing();
|
|
30
|
+
return null;
|
|
31
|
+
}, { $$typeof: Symbol.for('react.forward_ref') }),
|
|
32
|
+
});
|
|
33
|
+
export { Clipboard, Audio, Video };
|
|
18
34
|
//# sourceMappingURL=configuration.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../src/utils/native_adapters/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../src/utils/native_adapters/configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAQtC,MAAM,OAAO,YAAY;IACvB,MAAM,CAAC,SAAS,CAAC,cAAkC;QACjD,SAAS,GAAG,cAAc,CAAC,SAAS,CAAA;QACpC,KAAK,GAAG,cAAc,CAAC,KAAK,CAAA;QAC5B,KAAK,GAAG,cAAc,CAAC,KAAK,CAAA;IAC9B,CAAC;CACF;AAED,MAAM,aAAa,GAAG,GAAG,EAAE;IACzB,OAAO,CAAC,IAAI,CAAC,mEAAmE,CAAC,CAAA;AACnF,CAAC,CAAA;AAED,IAAI,SAAS,GAAqB,IAAI,gBAAgB,CAAC;IACrD,cAAc,EAAE,KAAK,IAAI,EAAE;QACzB,aAAa,EAAE,CAAA;QACf,OAAO,EAAE,CAAA;IACX,CAAC;IACD,cAAc,EAAE,KAAK,EAAE,CAAS,EAAE,EAAE,CAAC,aAAa,EAAE;CACrD,CAAC,CAAA;AAEF,IAAI,KAAK,GAAiB,IAAI,YAAY,CAAC;IACzC,QAAQ,EAAE,CAAC,CAAS,EAAE,EAAE;QACtB,aAAa,EAAE,CAAA;QACf,OAAO,EAAS,CAAA;IAClB,CAAC;CACF,CAAC,CAAA;AAEF,IAAI,KAAK,GAAiB,IAAI,YAAY,CAAC;IACzC,MAAM,EAAE,MAAM,CAAC,MAAM,CACnB,GAAG,EAAE;QACH,aAAa,EAAE,CAAA;QACf,OAAO,IAAI,CAAA;IACb,CAAC,EACD,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,CAAC,mBAAmB,CAAC,EAAE,CAC9C;CACF,CAAC,CAAA;AAEF,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA","sourcesContent":["import { AudioAdapter } from './audio'\nimport { ClipboardAdapter } from './clipboard'\nimport { VideoAdapter } from './video'\n\ntype ChatConfigurations = {\n clipboard: ClipboardAdapter\n audio: AudioAdapter\n video: VideoAdapter\n}\n\nexport class ChatAdapters {\n static configure(configurations: ChatConfigurations) {\n Clipboard = configurations.clipboard\n Audio = configurations.audio\n Video = configurations.video\n }\n}\n\nconst methodMissing = () => {\n console.warn('ChatAdapters.configure() must be called before using any adapters')\n}\n\nlet Clipboard: ClipboardAdapter = new ClipboardAdapter({\n getStringAsync: async () => {\n methodMissing()\n return ''\n },\n setStringAsync: async (_: string) => methodMissing(),\n})\n\nlet Audio: AudioAdapter = new AudioAdapter({\n useAudio: (_: string) => {\n methodMissing()\n return {} as any\n },\n})\n\nlet Video: VideoAdapter = new VideoAdapter({\n Player: Object.assign(\n () => {\n methodMissing()\n return null\n },\n { $$typeof: Symbol.for('react.forward_ref') }\n ),\n})\n\nexport { Clipboard, Audio, Video }\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/native_adapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/native_adapters/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
|