@planningcenter/chat-react-native 2.0.1-rc.0 → 2.1.0-rc.1
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/message.d.ts.map +1 -1
- package/build/components/conversation/message.js +7 -2
- package/build/components/conversation/message.js.map +1 -1
- package/build/components/conversation/message_reaction.d.ts +1 -1
- package/build/components/conversation/message_reaction.d.ts.map +1 -1
- package/build/components/conversation/message_reaction.js +1 -1
- package/build/components/conversation/message_reaction.js.map +1 -1
- package/build/components/conversations.d.ts.map +1 -1
- package/build/components/conversations.js +76 -30
- package/build/components/conversations.js.map +1 -1
- package/build/components/display/badge.d.ts +2 -6
- package/build/components/display/badge.d.ts.map +1 -1
- package/build/components/display/badge.js +1 -5
- package/build/components/display/badge.js.map +1 -1
- package/build/components/display/tabs.d.ts +17 -0
- package/build/components/display/tabs.d.ts.map +1 -0
- package/build/components/display/tabs.js +97 -0
- package/build/components/display/tabs.js.map +1 -0
- 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/{error_boundary.d.ts → page/error_boundary.d.ts} +6 -4
- package/build/components/page/error_boundary.d.ts.map +1 -0
- package/build/components/page/error_boundary.js +115 -0
- package/build/components/page/error_boundary.js.map +1 -0
- package/build/components/page/loading.d.ts +3 -0
- package/build/components/page/loading.d.ts.map +1 -0
- package/build/components/page/loading.js +24 -0
- package/build/components/page/loading.js.map +1 -0
- package/build/contexts/api_provider.js +2 -2
- package/build/contexts/api_provider.js.map +1 -1
- package/build/hooks/use_conversation_jolt_events.d.ts +2 -0
- package/build/hooks/use_conversation_jolt_events.d.ts.map +1 -0
- package/build/hooks/use_conversation_jolt_events.js +47 -0
- package/build/hooks/use_conversation_jolt_events.js.map +1 -0
- package/build/hooks/use_conversation_messages.d.ts +2 -18
- package/build/hooks/use_conversation_messages.d.ts.map +1 -1
- package/build/hooks/use_conversation_messages.js +2 -2
- package/build/hooks/use_conversation_messages.js.map +1 -1
- package/build/hooks/use_conversations.d.ts +37 -0
- package/build/hooks/use_conversations.d.ts.map +1 -0
- package/build/hooks/use_conversations.js +48 -0
- package/build/hooks/use_conversations.js.map +1 -0
- package/build/hooks/use_jolt.d.ts +9 -0
- package/build/hooks/use_jolt.d.ts.map +1 -0
- package/build/hooks/use_jolt.js +71 -0
- package/build/hooks/use_jolt.js.map +1 -0
- package/build/hooks/use_suspense_api.d.ts +7 -2
- package/build/hooks/use_suspense_api.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.js +7 -2
- package/build/hooks/use_suspense_api.js.map +1 -1
- package/build/navigation/index.d.ts +11 -2
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +14 -6
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/screenLayout.d.ts.map +1 -1
- package/build/navigation/screenLayout.js +5 -8
- package/build/navigation/screenLayout.js.map +1 -1
- package/build/screens/message_actions_screen.d.ts +1 -1
- package/build/screens/message_actions_screen.d.ts.map +1 -1
- package/build/screens/message_actions_screen.js +1 -1
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/screens/reactions_screen.d.ts +11 -0
- package/build/screens/reactions_screen.d.ts.map +1 -0
- package/build/screens/reactions_screen.js +83 -0
- package/build/screens/reactions_screen.js.map +1 -0
- package/build/types/resources/app_name.d.ts +2 -0
- package/build/types/resources/app_name.d.ts.map +1 -0
- package/build/types/resources/app_name.js +2 -0
- package/build/types/resources/app_name.js.map +1 -0
- package/build/types/resources/conversation.d.ts +18 -10
- package/build/types/resources/conversation.d.ts.map +1 -1
- package/build/types/resources/conversation.js.map +1 -1
- package/build/types/resources/conversation_badge.d.ts +12 -0
- package/build/types/resources/conversation_badge.d.ts.map +1 -0
- package/build/types/resources/conversation_badge.js +2 -0
- package/build/types/resources/conversation_badge.js.map +1 -0
- package/build/types/resources/group_resource.d.ts +12 -0
- package/build/types/resources/group_resource.d.ts.map +1 -0
- package/build/types/resources/group_resource.js +2 -0
- package/build/types/resources/group_resource.js.map +1 -0
- package/build/types/resources/index.d.ts +2 -1
- package/build/types/resources/index.d.ts.map +1 -1
- package/build/types/resources/index.js +2 -1
- package/build/types/resources/index.js.map +1 -1
- package/build/types/resources/member.d.ts +23 -0
- package/build/types/resources/member.d.ts.map +1 -0
- package/build/types/resources/member.js +2 -0
- package/build/types/resources/member.js.map +1 -0
- package/build/types/resources/member_ability.d.ts +6 -0
- package/build/types/resources/member_ability.d.ts.map +1 -0
- package/build/types/resources/member_ability.js +2 -0
- package/build/types/resources/member_ability.js.map +1 -0
- package/build/types/resources/reaction.d.ts +1 -1
- package/build/types/resources/reaction.js.map +1 -1
- package/build/utils/cache/page_mutations.d.ts +19 -2
- package/build/utils/cache/page_mutations.d.ts.map +1 -1
- package/build/utils/cache/page_mutations.js +21 -7
- package/build/utils/cache/page_mutations.js.map +1 -1
- package/build/utils/date.d.ts +4 -0
- package/build/utils/date.d.ts.map +1 -0
- package/build/utils/date.js +23 -0
- package/build/utils/date.js.map +1 -0
- package/package.json +7 -3
- package/src/__tests__/utils/cache/page_mutations.ts +7 -46
- package/src/components/conversation/message.tsx +8 -3
- package/src/components/conversation/message_reaction.tsx +6 -2
- package/src/components/conversations.tsx +95 -32
- package/src/components/display/badge.tsx +3 -8
- package/src/components/display/tabs.tsx +142 -0
- package/src/components/index.tsx +1 -1
- package/src/components/page/error_boundary.tsx +135 -0
- package/src/components/page/loading.tsx +28 -0
- package/src/contexts/api_provider.tsx +3 -3
- package/src/hooks/use_conversation_jolt_events.ts +67 -0
- package/src/hooks/use_conversation_messages.ts +6 -2
- package/src/hooks/use_conversations.ts +53 -0
- package/src/hooks/use_jolt.ts +101 -0
- package/src/hooks/use_suspense_api.ts +10 -3
- package/src/navigation/index.tsx +23 -7
- package/src/navigation/screenLayout.tsx +5 -10
- package/src/screens/message_actions_screen.tsx +1 -1
- package/src/screens/reactions_screen.tsx +131 -0
- package/src/types/resources/app_name.ts +1 -0
- package/src/types/resources/conversation.ts +18 -10
- package/src/types/resources/conversation_badge.ts +10 -0
- package/src/types/resources/group_resource.ts +10 -0
- package/src/types/resources/index.ts +2 -1
- package/src/types/resources/member.ts +24 -0
- package/src/types/resources/member_ability.ts +5 -0
- package/src/types/resources/reaction.ts +1 -1
- package/src/utils/cache/page_mutations.ts +32 -9
- package/src/utils/date.ts +25 -0
- package/build/components/error_boundary.d.ts.map +0 -1
- package/build/components/error_boundary.js +0 -24
- package/build/components/error_boundary.js.map +0 -1
- package/src/components/error_boundary.tsx +0 -27
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_suspense_api.js","sourceRoot":"","sources":["../../src/hooks/use_suspense_api.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAIzC,MAAM,CAAC,MAAM,cAAc,GAAG,CAA8C,IAAgB,EAAE,EAAE;IAG9F,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,GAAG,gBAAgB,CAAqB;QAC9D,QAAQ,EAAE,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"use_suspense_api.js","sourceRoot":"","sources":["../../src/hooks/use_suspense_api.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,wBAAwB,EACxB,gBAAgB,GACjB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAIzC,MAAM,CAAC,MAAM,cAAc,GAAG,CAA8C,IAAgB,EAAE,EAAE;IAG9F,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,GAAG,gBAAgB,CAAqB;QAC9D,QAAQ,EAAE,kBAAkB,CAAC,IAAI,CAAC;KAC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MAAM,CAAC,EAAE,CAAA;YAE7C,OAAO,SAAS,CAAA;QAClB,CAAC;QACD,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC;KAChB,CAAC,CAAA;IAEF,MAAM,IAAI,GAAQ,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;IAEpE,OAAO,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,CAAA;AAC3B,CAAC,CAAA;AAGD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,IAAgB,EAAmB,EAAE,CAAC;IACvE,IAAI,CAAC,GAAG;IACR,IAAI,CAAC,IAAI;IACT,IAAI,CAAC,OAAO;CACb,CAAA","sourcesContent":["import {\n AnyUseSuspenseInfiniteQueryOptions,\n InfiniteData,\n useSuspenseInfiniteQuery,\n useSuspenseQuery,\n} from '@tanstack/react-query'\nimport { useContext } from 'react'\nimport { ChatContext } from '../contexts'\nimport { ApiCollection, ApiResource, ResourceObject } from '../types'\nimport { GetRequest, RequestData } from '../utils/client/types'\n\nexport const useSuspenseGet = <T extends ResourceObject | ResourceObject[]>(args: GetRequest) => {\n type Resource = ApiResource<T>\n\n const { data, ...query } = useSuspenseQuery<Resource, Response>({\n queryKey: getRequestQueryKey(args),\n })\n\n return { ...data, ...query }\n}\n\ntype NextMeta = Partial<{\n offset: string\n idLt: string\n}>\n\nexport type SuspensePaginatorOptions = Omit<\n AnyUseSuspenseInfiniteQueryOptions,\n 'getNextPageParam' | 'initialPageParam' | 'queryFn' | 'queryKey'\n>\n\nexport const useSuspensePaginator = <T extends ResourceObject>(\n args: GetRequest,\n opts?: SuspensePaginatorOptions\n) => {\n const { client } = useContext(ChatContext)\n const query = useSuspenseInfiniteQuery<\n ApiCollection<T>,\n Response,\n InfiniteData<ApiCollection<T>>,\n any,\n Partial<RequestData> | undefined\n >({\n queryKey: getRequestQueryKey(args),\n queryFn: ({ pageParam }) => {\n const pageParmWhere = pageParam?.where || {}\n const argsWhere = args.data.where || {}\n const where = { ...argsWhere, ...pageParmWhere }\n\n const offset = pageParam?.offset || args.data.offset\n const data = { ...args.data, where, offset }\n\n return client.get({\n url: args.url,\n data,\n })\n },\n initialPageParam: {} as Partial<RequestData>,\n getNextPageParam: lastPage => {\n const next: NextMeta = lastPage.meta?.next || {}\n const { offset, idLt } = next\n\n if (idLt) return { where: { id_lt: idLt } }\n if (offset) return { offset: Number(offset) }\n\n return undefined\n },\n ...(opts || {}),\n })\n\n const data: T[] = query.data?.pages.flatMap(page => page.data) || []\n\n return { ...query, data }\n}\n\nexport type RequestQueryKey = [GetRequest['url'], GetRequest['data'], GetRequest['headers']]\nexport const getRequestQueryKey = (args: GetRequest): RequestQueryKey => [\n args.url,\n args.data,\n args.headers,\n]\n"]}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StaticParamList } from '@react-navigation/native';
|
|
3
|
+
import { NativeStackHeaderLeftProps, NativeStackHeaderRightProps } from '@react-navigation/native-stack';
|
|
3
4
|
import { NotFound } from '../screens/not_found';
|
|
4
5
|
import { ScreenLayout } from './screenLayout';
|
|
5
6
|
import { ConversationsScreen } from '../screens/conversations_screen';
|
|
6
7
|
import { ConversationScreen } from '../screens/conversation_screen';
|
|
7
8
|
import { MessageActionsScreen } from '../screens/message_actions_screen';
|
|
9
|
+
import { ReactionsScreen } from '../screens/reactions_screen';
|
|
8
10
|
export declare const ChatStack: import("@react-navigation/native").TypedNavigator<{
|
|
9
11
|
ParamList: import("@react-navigation/native").ParamListBase;
|
|
10
12
|
NavigatorID: undefined;
|
|
@@ -16,6 +18,9 @@ export declare const ChatStack: import("@react-navigation/native").TypedNavigato
|
|
|
16
18
|
};
|
|
17
19
|
Navigator: ({ id, initialRouteName, children, layout, screenListeners, screenOptions, screenLayout, UNSTABLE_getStateForRouteNamesChange, ...rest }: import("@react-navigation/native-stack").NativeStackNavigatorProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
20
|
}, {
|
|
21
|
+
readonly screenOptions: {
|
|
22
|
+
readonly headerBackButtonDisplayMode: "minimal";
|
|
23
|
+
};
|
|
19
24
|
readonly screenLayout: typeof ScreenLayout;
|
|
20
25
|
readonly screens: {
|
|
21
26
|
readonly Conversations: {
|
|
@@ -26,8 +31,8 @@ export declare const ChatStack: import("@react-navigation/native").TypedNavigato
|
|
|
26
31
|
theme: ReactNavigation.Theme;
|
|
27
32
|
}) => {
|
|
28
33
|
headerTitle: string;
|
|
29
|
-
headerLeft: () => React.JSX.Element;
|
|
30
|
-
headerRight: () => React.JSX.Element;
|
|
34
|
+
headerLeft: ({ tintColor }: NativeStackHeaderLeftProps) => React.JSX.Element;
|
|
35
|
+
headerRight: (props: NativeStackHeaderRightProps) => React.JSX.Element;
|
|
31
36
|
};
|
|
32
37
|
};
|
|
33
38
|
readonly Conversation: {
|
|
@@ -37,6 +42,10 @@ export declare const ChatStack: import("@react-navigation/native").TypedNavigato
|
|
|
37
42
|
readonly screen: typeof MessageActionsScreen;
|
|
38
43
|
readonly options: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
39
44
|
};
|
|
45
|
+
readonly Reactions: {
|
|
46
|
+
readonly screen: typeof ReactionsScreen;
|
|
47
|
+
readonly options: import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
48
|
+
};
|
|
40
49
|
readonly NotFound: {
|
|
41
50
|
readonly screen: typeof NotFound;
|
|
42
51
|
readonly options: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC1D,OAAO,EAEL,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAA;AAGnE,OAAO,EACL,oBAAoB,EAErB,MAAM,mCAAmC,CAAA;AAC1C,OAAO,EAAE,eAAe,EAA0B,MAAM,6BAA6B,CAAA;AAErF,eAAO,MAAM,SAAS;;;;;;;;;uOARmC,mBACzD;;;;;;;;;;;;uBA8DyugB,gBAAiB,KAAK;;;4CA7C3tgB,0BAA0B;qCAKjC,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;EA+BtD,CAAA;AAEF,KAAK,kBAAkB,GAAG,eAAe,CAAC,OAAO,SAAS,CAAC,CAAA;AAE3D,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,eAAe,CAAC;QACxB,UAAU,aAAc,SAAQ,kBAAkB;SAAG;KACtD;CACF"}
|
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { createNativeStackNavigator } from '@react-navigation/native-stack';
|
|
2
|
+
import { createNativeStackNavigator, } from '@react-navigation/native-stack';
|
|
3
3
|
import { NotFound } from '../screens/not_found';
|
|
4
4
|
import { ScreenLayout } from './screenLayout';
|
|
5
5
|
import { ConversationsScreen } from '../screens/conversations_screen';
|
|
6
6
|
import { ConversationScreen } from '../screens/conversation_screen';
|
|
7
7
|
import { HeaderBackButton, HeaderButton } from '@react-navigation/elements';
|
|
8
8
|
import { Icon } from '../components';
|
|
9
|
-
import { MessageActionsScreen,
|
|
9
|
+
import { MessageActionsScreen, MessageActionsScreenOptions, } from '../screens/message_actions_screen';
|
|
10
|
+
import { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen';
|
|
10
11
|
export const ChatStack = createNativeStackNavigator({
|
|
12
|
+
screenOptions: {
|
|
13
|
+
headerBackButtonDisplayMode: 'minimal',
|
|
14
|
+
},
|
|
11
15
|
screenLayout: ScreenLayout,
|
|
12
16
|
screens: {
|
|
13
17
|
Conversations: {
|
|
14
18
|
screen: ConversationsScreen,
|
|
15
19
|
options: ({ route, navigation }) => ({
|
|
16
20
|
headerTitle: route.params?.title ?? 'Chat',
|
|
17
|
-
headerLeft: () => (<HeaderButton>
|
|
18
|
-
<Icon name="general.threeReducingHorizontalBars" size={18}/>
|
|
21
|
+
headerLeft: ({ tintColor }) => (<HeaderButton>
|
|
22
|
+
<Icon name="general.threeReducingHorizontalBars" size={18} color={tintColor}/>
|
|
19
23
|
</HeaderButton>),
|
|
20
|
-
headerRight: () => (<HeaderBackButton
|
|
24
|
+
headerRight: (props) => (<HeaderBackButton backImage={() => <Icon name="general.x" size={18} color={props.tintColor}/>} onPress={navigation.goBack} {...props}/>),
|
|
21
25
|
}),
|
|
22
26
|
},
|
|
23
27
|
Conversation: {
|
|
@@ -26,7 +30,11 @@ export const ChatStack = createNativeStackNavigator({
|
|
|
26
30
|
MessageActions: {
|
|
27
31
|
screen: MessageActionsScreen,
|
|
28
32
|
// Something about sheetAllowedDetents declared inline breaks TS
|
|
29
|
-
options:
|
|
33
|
+
options: MessageActionsScreenOptions,
|
|
34
|
+
},
|
|
35
|
+
Reactions: {
|
|
36
|
+
screen: ReactionsScreen,
|
|
37
|
+
options: ReactionsScreenOptions,
|
|
30
38
|
},
|
|
31
39
|
NotFound: {
|
|
32
40
|
screen: NotFound,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigation/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,
|
|
1
|
+
{"version":3,"file":"index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B,CACf,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,EAAG,CAAC,CAC7E,OAAO,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAC3B,IAAI,KAAK,CAAC,EACV,CACH;aACF,CAAC;SACH;QACD,YAAY,EAAE;YACZ,MAAM,EAAE,kBAAkB;SAC3B;QACD,cAAc,EAAE;YACd,MAAM,EAAE,oBAAoB;YAC5B,gEAAgE;YAChE,OAAO,EAAE,2BAA2B;SACrC;QACD,SAAS,EAAE;YACT,MAAM,EAAE,eAAe;YACvB,OAAO,EAAE,sBAAsB;SAChC;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,QAAQ;YAChB,OAAO,EAAE;gBACP,KAAK,EAAE,KAAK;aACb;YACD,OAAO,EAAE;gBACP,IAAI,EAAE,GAAG;aACV;SACF;KACF;CACF,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StaticParamList } from '@react-navigation/native'\nimport {\n createNativeStackNavigator,\n NativeStackHeaderLeftProps,\n NativeStackHeaderRightProps,\n} from '@react-navigation/native-stack'\nimport { NotFound } from '../screens/not_found'\nimport { ScreenLayout } from './screenLayout'\nimport { ConversationsScreen } from '../screens/conversations_screen'\nimport { ConversationScreen } from '../screens/conversation_screen'\nimport { HeaderBackButton, HeaderButton } from '@react-navigation/elements'\nimport { Icon } from '../components'\nimport {\n MessageActionsScreen,\n MessageActionsScreenOptions,\n} from '../screens/message_actions_screen'\nimport { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'\n\nexport const ChatStack = createNativeStackNavigator({\n screenOptions: {\n headerBackButtonDisplayMode: 'minimal',\n },\n screenLayout: ScreenLayout,\n screens: {\n Conversations: {\n screen: ConversationsScreen,\n options: ({ route, navigation }) => ({\n headerTitle: (route.params as { title?: string })?.title ?? 'Chat',\n headerLeft: ({ tintColor }: NativeStackHeaderLeftProps) => (\n <HeaderButton>\n <Icon name=\"general.threeReducingHorizontalBars\" size={18} color={tintColor} />\n </HeaderButton>\n ),\n headerRight: (props: NativeStackHeaderRightProps) => (\n <HeaderBackButton\n backImage={() => <Icon name=\"general.x\" size={18} color={props.tintColor} />}\n onPress={navigation.goBack}\n {...props}\n />\n ),\n }),\n },\n Conversation: {\n screen: ConversationScreen,\n },\n MessageActions: {\n screen: MessageActionsScreen,\n // Something about sheetAllowedDetents declared inline breaks TS\n options: MessageActionsScreenOptions,\n },\n Reactions: {\n screen: ReactionsScreen,\n options: ReactionsScreenOptions,\n },\n NotFound: {\n screen: NotFound,\n options: {\n title: '404',\n },\n linking: {\n path: '*',\n },\n },\n },\n})\n\ntype ChatStackParamList = StaticParamList<typeof ChatStack>\n\ndeclare global {\n namespace ReactNavigation {\n interface RootParamList extends ChatStackParamList {}\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenLayout.d.ts","sourceRoot":"","sources":["../../src/navigation/screenLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"screenLayout.d.ts","sourceRoot":"","sources":["../../src/navigation/screenLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAMzB,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,YAAY,CAAA;CAAE,qBAQ1E"}
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
3
|
-
import ErrorBoundary from '../components/error_boundary';
|
|
2
|
+
import ErrorBoundary from '../components/page/error_boundary';
|
|
4
3
|
import { Suspense } from 'react';
|
|
5
|
-
import { Text } from '../components/display';
|
|
6
4
|
import { ApiProvider } from '../contexts';
|
|
5
|
+
import { DefaultLoading } from '../components/page/loading';
|
|
7
6
|
export function ScreenLayout({ children }) {
|
|
8
7
|
return (<ApiProvider>
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</ErrorBoundary>)}
|
|
13
|
-
</QueryErrorResetBoundary>
|
|
8
|
+
<ErrorBoundary>
|
|
9
|
+
<Suspense fallback={<DefaultLoading />}>{children}</Suspense>
|
|
10
|
+
</ErrorBoundary>
|
|
14
11
|
</ApiProvider>);
|
|
15
12
|
}
|
|
16
13
|
//# sourceMappingURL=screenLayout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screenLayout.js","sourceRoot":"","sources":["../../src/navigation/screenLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,
|
|
1
|
+
{"version":3,"file":"screenLayout.js","sourceRoot":"","sources":["../../src/navigation/screenLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,aAAa,MAAM,mCAAmC,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAE3D,MAAM,UAAU,YAAY,CAAC,EAAE,QAAQ,EAAoC;IACzE,OAAO,CACL,CAAC,WAAW,CACV;MAAA,CAAC,aAAa,CACZ;QAAA,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC,AAAD,EAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAC9D;MAAA,EAAE,aAAa,CACjB;IAAA,EAAE,WAAW,CAAC,CACf,CAAA;AACH,CAAC","sourcesContent":["import React from 'react'\nimport ErrorBoundary from '../components/page/error_boundary'\nimport { Suspense } from 'react'\nimport { ApiProvider } from '../contexts'\nimport { DefaultLoading } from '../components/page/loading'\n\nexport function ScreenLayout({ children }: { children: React.ReactElement }) {\n return (\n <ApiProvider>\n <ErrorBoundary>\n <Suspense fallback={<DefaultLoading />}>{children}</Suspense>\n </ErrorBoundary>\n </ApiProvider>\n )\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
2
|
import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const MessageActionsScreenOptions: NativeStackNavigationOptions;
|
|
5
5
|
export type ReactionScreenProps = StaticScreenProps<{
|
|
6
6
|
message_id: string;
|
|
7
7
|
conversation_id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message_actions_screen.d.ts","sourceRoot":"","sources":["../../src/screens/message_actions_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAE7E,OAAO,KAAkC,MAAM,OAAO,CAAA;AAatD,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"message_actions_screen.d.ts","sourceRoot":"","sources":["../../src/screens/message_actions_screen.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAE7E,OAAO,KAAkC,MAAM,OAAO,CAAA;AAatD,eAAO,MAAM,2BAA2B,EAAE,4BAKzC,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;IAClD,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF,wBAAgB,oBAAoB,CAAC,EAAE,KAAK,EAAE,EAAE,mBAAmB,qBAiHlE"}
|
|
@@ -11,7 +11,7 @@ import { useTheme } from '../hooks';
|
|
|
11
11
|
import { getMessagesRequestArgs, useConversationMessages } from '../hooks/use_conversation_messages';
|
|
12
12
|
import { updateRecordInPagesData } from '../utils';
|
|
13
13
|
import { Clipboard } from '../utils/native_adapters';
|
|
14
|
-
export const
|
|
14
|
+
export const MessageActionsScreenOptions = {
|
|
15
15
|
presentation: 'formSheet',
|
|
16
16
|
headerShown: false,
|
|
17
17
|
sheetAllowedDetents: [0.25],
|
|
@@ -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,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE3E,OAAO,EAAgB,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAA;AAChG,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AACnC,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAGpG,OAAO,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEpD,MAAM,CAAC,MAAM,kBAAkB,GAAiC;IAC9D,YAAY,EAAE,WAAW;IACzB,WAAW,E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A;AAED,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IACxB,MAAM,EAAE,MAAM,EAAE,GAAG,mBAAmB,EAAE,CAAA;IACxC,MAAM,EAAE,MAAM,EAAE,GAAG,iBAAiB,EAAE,CAAA;IACtC,MAAM,cAAc,GAAG,CAAC,CAAA;IACxB,MAAM,QAAQ,GAAG,EAAE,CAAA;IACnB,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,SAAS,EAAE;YACT,cAAc,EAAE,YAAY;YAC5B,UAAU,EAAE,EAAE;YACd,aAAa,EAAE,MAAM;YACrB,KAAK,EAAE,MAAM;YACb,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,2BAA2B;YACzD,MAAM;SACP;QACD,QAAQ,EAAE;YACR,MAAM,EAAE,eAAe;YACvB,KAAK,EAAE,eAAe;YACtB,WAAW,EAAE,cAAc;YAC3B,YAAY,EAAE,EAAE;YAChB,cAAc,EAAE,QAAQ;SACzB;QACD,YAAY,EAAE;YACZ,cAAc,EAAE,QAAQ;YACxB,GAAG,EAAE,EAAE;YACP,eAAe,EAAE,EAAE;YACnB,aAAa,EAAE,KAAK;YACpB,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB;YACnD,iBAAiB,EAAE,CAAC;SACrB;QACD,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;QACpB,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE;KAC3D,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack'\nimport { InfiniteData, useMutation, useQueryClient } from '@tanstack/react-query'\nimport React, { useCallback, useContext } from 'react'\nimport { Alert, Platform, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Text, TextButton } from '../components'\nimport { REACTION_EMOJIS, useReactionStyles } from '../components/conversation/message_reaction'\nimport { ChatContext } from '../contexts'\nimport { useTheme } from '../hooks'\nimport { getMessagesRequestArgs, useConversationMessages } from '../hooks/use_conversation_messages'\nimport { ApiCollection, ApiResource, MessageResource } from '../types'\nimport { ReactionCountResource } from '../types/resources/reaction'\nimport { updateRecordInPagesData } from '../utils'\nimport { Clipboard } from '../utils/native_adapters'\n\nexport const ReactScreenOptions: NativeStackNavigationOptions = {\n presentation: 'formSheet',\n headerShown: false,\n sheetAllowedDetents: [0.25],\n sheetGrabberVisible: true,\n}\n\nexport type ReactionScreenProps = StaticScreenProps<{\n message_id: string\n conversation_id: string\n}>\n\nexport function MessageActionsScreen({ route }: ReactionScreenProps) {\n const navigation = useNavigation()\n const { conversation_id, message_id } = route.params\n\n const { client } = useContext(ChatContext)\n const queryClient = useQueryClient()\n const styles = useStyles()\n\n const { messages, queryKey, refetch } = useConversationMessages(\n { conversation_id },\n { refetchOnMount: false }\n )\n const message = messages.find(m => m.id === message_id)\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 handleCopyPress = (text?: string) => {\n Clipboard.setStringAsync(text || '')\n navigation.goBack()\n }\n\n const handleReactionPress = useCallback(\n ({ value, mine }: { value: keyof typeof REACTION_EMOJIS; mine?: boolean }) => {\n const requestParams = getMessagesRequestArgs({ conversation_id })\n\n // Value has already been updated\n const endpoint = !mine ? 'react' : 'unreact'\n const url = `/me/conversations/${conversation_id}/messages/${message_id}/${endpoint}`\n const fieldsWithValueJoined = Object.fromEntries(\n Object.entries(requestParams.data.fields).map(([k, v]) => [k, v.join(',')])\n )\n\n return client.post({\n url,\n data: {\n ...requestParams.data,\n data: {\n type: 'Message',\n attributes: { value: value },\n },\n fields: fieldsWithValueJoined,\n },\n })\n },\n [client, conversation_id, message_id]\n )\n\n const deleteMessage = useCallback(() => {\n const url = `/me/conversations/${conversation_id}/messages/${message_id}/`\n\n return client.delete({ url })\n }, [client, conversation_id, message_id])\n\n const { mutate: handleReaction, isPending } = useMutation({\n mutationFn: handleReactionPress,\n onSuccess: (result: ApiResource<MessageResource>) => {\n const updatedMessage = result.data\n type QueryData = InfiniteData<ApiCollection<MessageResource>>\n\n queryClient.setQueryData<QueryData>(queryKey, data =>\n updateRecordInPagesData({\n data,\n record: updatedMessage,\n })\n )\n navigation.goBack()\n },\n onError: () => {\n Alert.alert('Oops', 'We were unable to react to this message. Please try again.')\n },\n })\n\n const { mutate: handleDeleteMessage } = useMutation({\n mutationFn: deleteMessage,\n onSuccess: () => {\n refetch()\n navigation.goBack()\n },\n onError: () => {\n Alert.alert('Oops', 'We were unable to delete this message. Please try again.')\n },\n })\n\n return (\n <View style={styles.container}>\n <View style={styles.reactionList}>\n {availableReactions.map((reaction, index) => (\n <Reaction key={index} reaction={reaction} onPress={() => handleReaction(reaction)} />\n ))}\n </View>\n <View style={styles.actions}>\n <View style={styles.actionButton}>\n <TextButton onPress={() => handleCopyPress(message?.text)}>Copy</TextButton>\n <TextButton\n appearance=\"danger\"\n onPress={() => handleDeleteMessage()}\n disabled={isPending}\n >\n Delete\n </TextButton>\n </View>\n </View>\n </View>\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 return (\n <PlatformPressable\n key={reaction.value}\n style={[reactionStyles.reaction, styles.reaction]}\n onPress={onPress}\n >\n <Text style={reactionStyles.reactionEmoji}>{REACTION_EMOJIS[reaction.value]}</Text>\n </PlatformPressable>\n )\n}\n\nconst useStyles = () => {\n const theme = useTheme()\n const { height } = useWindowDimensions()\n const { bottom } = useSafeAreaInsets()\n const btnBorderWidth = 1\n const baseSize = 44\n const reactionBtnSize = Platform.select({\n ios: baseSize,\n android: baseSize + btnBorderWidth * 2,\n })\n\n return StyleSheet.create({\n container: {\n justifyContent: 'flex-start',\n paddingTop: 12,\n paddingBottom: bottom,\n width: '100%',\n backgroundColor: theme.colors.fillColorNeutral100Inverted,\n height,\n },\n reaction: {\n height: reactionBtnSize,\n width: reactionBtnSize,\n borderWidth: btnBorderWidth,\n borderRadius: 32,\n justifyContent: 'center',\n },\n reactionList: {\n justifyContent: 'center',\n gap: 24,\n paddingVertical: 12,\n flexDirection: 'row',\n borderBottomColor: theme.colors.fillColorNeutral040,\n borderBottomWidth: 1,\n },\n actions: { flex: 1 },\n actionButton: { padding: 12, paddingBottom: 100, gap: 12 },\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,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAE3E,OAAO,EAAgB,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACtD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAA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Q;YACxB,GAAG,EAAE,EAAE;YACP,eAAe,EAAE,EAAE;YACnB,aAAa,EAAE,KAAK;YACpB,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB;YACnD,iBAAiB,EAAE,CAAC;SACrB;QACD,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;QACpB,YAAY,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE;KAC3D,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack'\nimport { InfiniteData, useMutation, useQueryClient } from '@tanstack/react-query'\nimport React, { useCallback, useContext } from 'react'\nimport { Alert, Platform, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Text, TextButton } from '../components'\nimport { REACTION_EMOJIS, useReactionStyles } from '../components/conversation/message_reaction'\nimport { ChatContext } from '../contexts'\nimport { useTheme } from '../hooks'\nimport { getMessagesRequestArgs, useConversationMessages } from '../hooks/use_conversation_messages'\nimport { ApiCollection, ApiResource, MessageResource } from '../types'\nimport { ReactionCountResource } from '../types/resources/reaction'\nimport { updateRecordInPagesData } from '../utils'\nimport { Clipboard } from '../utils/native_adapters'\n\nexport const MessageActionsScreenOptions: NativeStackNavigationOptions = {\n presentation: 'formSheet',\n headerShown: false,\n sheetAllowedDetents: [0.25],\n sheetGrabberVisible: true,\n}\n\nexport type ReactionScreenProps = StaticScreenProps<{\n message_id: string\n conversation_id: string\n}>\n\nexport function MessageActionsScreen({ route }: ReactionScreenProps) {\n const navigation = useNavigation()\n const { conversation_id, message_id } = route.params\n\n const { client } = useContext(ChatContext)\n const queryClient = useQueryClient()\n const styles = useStyles()\n\n const { messages, queryKey, refetch } = useConversationMessages(\n { conversation_id },\n { refetchOnMount: false }\n )\n const message = messages.find(m => m.id === message_id)\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 handleCopyPress = (text?: string) => {\n Clipboard.setStringAsync(text || '')\n navigation.goBack()\n }\n\n const handleReactionPress = useCallback(\n ({ value, mine }: { value: keyof typeof REACTION_EMOJIS; mine?: boolean }) => {\n const requestParams = getMessagesRequestArgs({ conversation_id })\n\n // Value has already been updated\n const endpoint = !mine ? 'react' : 'unreact'\n const url = `/me/conversations/${conversation_id}/messages/${message_id}/${endpoint}`\n const fieldsWithValueJoined = Object.fromEntries(\n Object.entries(requestParams.data.fields).map(([k, v]) => [k, v.join(',')])\n )\n\n return client.post({\n url,\n data: {\n ...requestParams.data,\n data: {\n type: 'Message',\n attributes: { value: value },\n },\n fields: fieldsWithValueJoined,\n },\n })\n },\n [client, conversation_id, message_id]\n )\n\n const deleteMessage = useCallback(() => {\n const url = `/me/conversations/${conversation_id}/messages/${message_id}/`\n\n return client.delete({ url })\n }, [client, conversation_id, message_id])\n\n const { mutate: handleReaction, isPending } = useMutation({\n mutationFn: handleReactionPress,\n onSuccess: (result: ApiResource<MessageResource>) => {\n const updatedMessage = result.data\n type QueryData = InfiniteData<ApiCollection<MessageResource>>\n\n queryClient.setQueryData<QueryData>(queryKey, data =>\n updateRecordInPagesData({\n data,\n record: updatedMessage,\n })\n )\n navigation.goBack()\n },\n onError: () => {\n Alert.alert('Oops', 'We were unable to react to this message. Please try again.')\n },\n })\n\n const { mutate: handleDeleteMessage } = useMutation({\n mutationFn: deleteMessage,\n onSuccess: () => {\n refetch()\n navigation.goBack()\n },\n onError: () => {\n Alert.alert('Oops', 'We were unable to delete this message. Please try again.')\n },\n })\n\n return (\n <View style={styles.container}>\n <View style={styles.reactionList}>\n {availableReactions.map((reaction, index) => (\n <Reaction key={index} reaction={reaction} onPress={() => handleReaction(reaction)} />\n ))}\n </View>\n <View style={styles.actions}>\n <View style={styles.actionButton}>\n <TextButton onPress={() => handleCopyPress(message?.text)}>Copy</TextButton>\n <TextButton\n appearance=\"danger\"\n onPress={() => handleDeleteMessage()}\n disabled={isPending}\n >\n Delete\n </TextButton>\n </View>\n </View>\n </View>\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 return (\n <PlatformPressable\n key={reaction.value}\n style={[reactionStyles.reaction, styles.reaction]}\n onPress={onPress}\n >\n <Text style={reactionStyles.reactionEmoji}>{REACTION_EMOJIS[reaction.value]}</Text>\n </PlatformPressable>\n )\n}\n\nconst useStyles = () => {\n const theme = useTheme()\n const { height } = useWindowDimensions()\n const { bottom } = useSafeAreaInsets()\n const btnBorderWidth = 1\n const baseSize = 44\n const reactionBtnSize = Platform.select({\n ios: baseSize,\n android: baseSize + btnBorderWidth * 2,\n })\n\n return StyleSheet.create({\n container: {\n justifyContent: 'flex-start',\n paddingTop: 12,\n paddingBottom: bottom,\n width: '100%',\n backgroundColor: theme.colors.fillColorNeutral100Inverted,\n height,\n },\n reaction: {\n height: reactionBtnSize,\n width: reactionBtnSize,\n borderWidth: btnBorderWidth,\n borderRadius: 32,\n justifyContent: 'center',\n },\n reactionList: {\n justifyContent: 'center',\n gap: 24,\n paddingVertical: 12,\n flexDirection: 'row',\n borderBottomColor: theme.colors.fillColorNeutral040,\n borderBottomWidth: 1,\n },\n actions: { flex: 1 },\n actionButton: { padding: 12, paddingBottom: 100, gap: 12 },\n })\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
+
import { NativeStackNavigationOptions } from '@react-navigation/native-stack';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
export declare const ReactionsScreenOptions: NativeStackNavigationOptions;
|
|
5
|
+
export type ReactionScreenProps = StaticScreenProps<{
|
|
6
|
+
message_id: string;
|
|
7
|
+
conversation_id: string;
|
|
8
|
+
reaction_value?: string;
|
|
9
|
+
}>;
|
|
10
|
+
export declare function ReactionsScreen({ route }: ReactionScreenProps): React.JSX.Element;
|
|
11
|
+
//# sourceMappingURL=reactions_screen.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactions_screen.d.ts","sourceRoot":"","sources":["../../src/screens/reactions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAA;AAC7E,OAAO,KAAK,MAAM,OAAO,CAAA;AAWzB,eAAO,MAAM,sBAAsB,EAAE,4BAKpC,CAAA;AAED,MAAM,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;IAClD,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,EAAE,mBAAmB,qBAkD7D"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FlatList, StyleSheet, useWindowDimensions, View } from 'react-native';
|
|
3
|
+
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
|
+
import { Avatar, Text } from '../components';
|
|
5
|
+
import { REACTION_EMOJIS, useReactionStyles } from '../components/conversation/message_reaction';
|
|
6
|
+
import { Tabs } from '../components/display/tabs';
|
|
7
|
+
import { useSuspenseGet, useTheme } from '../hooks';
|
|
8
|
+
import { useConversationMessages } from '../hooks/use_conversation_messages';
|
|
9
|
+
export const ReactionsScreenOptions = {
|
|
10
|
+
presentation: 'formSheet',
|
|
11
|
+
headerShown: false,
|
|
12
|
+
sheetAllowedDetents: [0.5],
|
|
13
|
+
sheetGrabberVisible: true,
|
|
14
|
+
};
|
|
15
|
+
export function ReactionsScreen({ route }) {
|
|
16
|
+
const { conversation_id, message_id, reaction_value } = route.params;
|
|
17
|
+
const styles = useStyles();
|
|
18
|
+
const { messages } = useConversationMessages({ conversation_id }, { refetchOnMount: false });
|
|
19
|
+
const { data: members } = useSuspenseGet({
|
|
20
|
+
url: `/me/conversations/${conversation_id}/members`,
|
|
21
|
+
data: {
|
|
22
|
+
fields: {
|
|
23
|
+
Member: ['id', 'name', 'avatar', 'badges', 'child', 'role'],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
const message = messages.find(m => m.id === message_id);
|
|
28
|
+
const reactionCounts = message?.reactionCounts || [];
|
|
29
|
+
const initialReactionCount = reactionCounts.find(r => r.value === reaction_value) || reactionCounts[0];
|
|
30
|
+
const [reactionCount, setReactionCount] = React.useState(initialReactionCount);
|
|
31
|
+
const authorIds = reactionCount.authorIds;
|
|
32
|
+
const authors = members.filter(member => authorIds.includes(member.id));
|
|
33
|
+
return (<View style={styles.container}>
|
|
34
|
+
<Tabs data={reactionCounts} activeTab={reactionCount} onTabPress={setReactionCount} renderItem={({ item }) => (<Reaction active={reactionCount.id === item.id} reaction={item} onPress={() => setReactionCount(item)}/>)} style={styles.actions}/>
|
|
35
|
+
<FlatList data={authors} keyExtractor={item => item.id} renderItem={({ item: author }) => (<View style={styles.authorList}>
|
|
36
|
+
<Avatar size={'md'} sourceUri={author.avatar}/>
|
|
37
|
+
<Text key={author.id}>{author.name}</Text>
|
|
38
|
+
</View>)}/>
|
|
39
|
+
</View>);
|
|
40
|
+
}
|
|
41
|
+
const Reaction = ({ reaction, }) => {
|
|
42
|
+
const styles = useStyles();
|
|
43
|
+
const reactionStyles = useReactionStyles({ mine: reaction.mine ? 1 : 0 });
|
|
44
|
+
return (<View key={reaction.value} style={styles.reaction}>
|
|
45
|
+
<Text style={reactionStyles.reactionEmoji}>{REACTION_EMOJIS[reaction.value]}</Text>
|
|
46
|
+
<Text style={reactionStyles.reactionEmoji}>{reaction.count}</Text>
|
|
47
|
+
</View>);
|
|
48
|
+
};
|
|
49
|
+
const useStyles = () => {
|
|
50
|
+
const theme = useTheme();
|
|
51
|
+
const { height } = useWindowDimensions();
|
|
52
|
+
const { bottom } = useSafeAreaInsets();
|
|
53
|
+
return StyleSheet.create({
|
|
54
|
+
container: {
|
|
55
|
+
justifyContent: 'flex-start',
|
|
56
|
+
paddingTop: 12,
|
|
57
|
+
paddingBottom: bottom,
|
|
58
|
+
width: '100%',
|
|
59
|
+
backgroundColor: theme.colors.fillColorNeutral100Inverted,
|
|
60
|
+
height,
|
|
61
|
+
gap: 8,
|
|
62
|
+
},
|
|
63
|
+
authorList: {
|
|
64
|
+
flexDirection: 'row',
|
|
65
|
+
alignItems: 'center',
|
|
66
|
+
gap: 8,
|
|
67
|
+
paddingHorizontal: 12,
|
|
68
|
+
paddingVertical: 12,
|
|
69
|
+
},
|
|
70
|
+
reaction: {
|
|
71
|
+
paddingVertical: 12,
|
|
72
|
+
paddingHorizontal: 12,
|
|
73
|
+
flexDirection: 'row',
|
|
74
|
+
gap: 4,
|
|
75
|
+
},
|
|
76
|
+
actions: {
|
|
77
|
+
minHeight: 48,
|
|
78
|
+
borderBottomColor: theme.colors.fillColorNeutral040,
|
|
79
|
+
borderBottomWidth: 1,
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=reactions_screen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reactions_screen.js","sourceRoot":"","sources":["../../src/screens/reactions_screen.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAA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iBAAiB,EAAE,CAAA;IAEtC,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,SAAS,EAAE;YACT,cAAc,EAAE,YAAY;YAC5B,UAAU,EAAE,EAAE;YACd,aAAa,EAAE,MAAM;YACrB,KAAK,EAAE,MAAM;YACb,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,2BAA2B;YACzD,MAAM;YACN,GAAG,EAAE,CAAC;SACP;QACD,UAAU,EAAE;YACV,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,CAAC;YACN,iBAAiB,EAAE,EAAE;YACrB,eAAe,EAAE,EAAE;SACpB;QACD,QAAQ,EAAE;YACR,eAAe,EAAE,EAAE;YACnB,iBAAiB,EAAE,EAAE;YACrB,aAAa,EAAE,KAAK;YACpB,GAAG,EAAE,CAAC;SACP;QACD,OAAO,EAAE;YACP,SAAS,EAAE,EAAE;YACb,iBAAiB,EAAE,KAAK,CAAC,MAAM,CAAC,mBAAmB;YACnD,iBAAiB,EAAE,CAAC;SACrB;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StaticScreenProps } from '@react-navigation/native'\nimport { NativeStackNavigationOptions } from '@react-navigation/native-stack'\nimport React from 'react'\nimport { FlatList, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Avatar, Text } from '../components'\nimport { REACTION_EMOJIS, useReactionStyles } from '../components/conversation/message_reaction'\nimport { Tabs } from '../components/display/tabs'\nimport { useSuspenseGet, useTheme } from '../hooks'\nimport { useConversationMessages } from '../hooks/use_conversation_messages'\nimport { MemberResource } from '../types'\nimport { ReactionCountResource } from '../types/resources/reaction'\n\nexport const ReactionsScreenOptions: NativeStackNavigationOptions = {\n presentation: 'formSheet',\n headerShown: false,\n sheetAllowedDetents: [0.5],\n sheetGrabberVisible: true,\n}\n\nexport type ReactionScreenProps = StaticScreenProps<{\n message_id: string\n conversation_id: string\n reaction_value?: string\n}>\n\nexport function ReactionsScreen({ route }: ReactionScreenProps) {\n const { conversation_id, message_id, reaction_value } = route.params\n const styles = useStyles()\n\n const { messages } = useConversationMessages({ conversation_id }, { refetchOnMount: false })\n const { data: members } = useSuspenseGet<MemberResource[]>({\n url: `/me/conversations/${conversation_id}/members`,\n data: {\n fields: {\n Member: ['id', 'name', 'avatar', 'badges', 'child', 'role'],\n },\n },\n })\n const message = messages.find(m => m.id === message_id)\n const reactionCounts = message?.reactionCounts || []\n const initialReactionCount =\n reactionCounts.find(r => r.value === reaction_value) || reactionCounts[0]\n const [reactionCount, setReactionCount] =\n React.useState<ReactionCountResource>(initialReactionCount)\n\n const authorIds = reactionCount.authorIds\n const authors = members.filter(member => authorIds.includes(member.id))\n\n return (\n <View style={styles.container}>\n <Tabs\n data={reactionCounts}\n activeTab={reactionCount}\n onTabPress={setReactionCount}\n renderItem={({ item }) => (\n <Reaction\n active={reactionCount.id === item.id}\n reaction={item}\n onPress={() => setReactionCount(item)}\n />\n )}\n style={styles.actions}\n />\n <FlatList\n data={authors}\n keyExtractor={item => item.id}\n renderItem={({ item: author }) => (\n <View style={styles.authorList}>\n <Avatar size={'md'} sourceUri={author.avatar} />\n <Text key={author.id}>{author.name}</Text>\n </View>\n )}\n />\n </View>\n )\n}\n\nconst Reaction = ({\n reaction,\n}: {\n active: boolean\n reaction: ReactionCountResource\n onPress: () => void\n}) => {\n const styles = useStyles()\n const reactionStyles = useReactionStyles({ mine: reaction.mine ? 1 : 0 })\n\n return (\n <View key={reaction.value} style={styles.reaction}>\n <Text style={reactionStyles.reactionEmoji}>{REACTION_EMOJIS[reaction.value]}</Text>\n <Text style={reactionStyles.reactionEmoji}>{reaction.count}</Text>\n </View>\n )\n}\n\nconst useStyles = () => {\n const theme = useTheme()\n const { height } = useWindowDimensions()\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n container: {\n justifyContent: 'flex-start',\n paddingTop: 12,\n paddingBottom: bottom,\n width: '100%',\n backgroundColor: theme.colors.fillColorNeutral100Inverted,\n height,\n gap: 8,\n },\n authorList: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 8,\n paddingHorizontal: 12,\n paddingVertical: 12,\n },\n reaction: {\n paddingVertical: 12,\n paddingHorizontal: 12,\n flexDirection: 'row',\n gap: 4,\n },\n actions: {\n minHeight: 48,\n borderBottomColor: theme.colors.fillColorNeutral040,\n borderBottomWidth: 1,\n },\n })\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app_name.d.ts","sourceRoot":"","sources":["../../../src/types/resources/app_name.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,QAAQ,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app_name.js","sourceRoot":"","sources":["../../../src/types/resources/app_name.ts"],"names":[],"mappings":"","sourcesContent":["export type AppName = 'Services' | 'Groups'\n"]}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ConversationBadgeResource } from './conversation_badge';
|
|
2
|
+
import { GroupResource } from './group_resource';
|
|
3
|
+
import { MemberAbilityResource } from './member_ability';
|
|
4
|
+
export interface ConversationResource {
|
|
5
|
+
type: 'Conversation';
|
|
6
|
+
id: string;
|
|
7
|
+
badges?: ConversationBadgeResource[];
|
|
5
8
|
createdAt: string;
|
|
6
|
-
|
|
9
|
+
deleted?: boolean;
|
|
10
|
+
groups?: GroupResource[];
|
|
11
|
+
previewAvatarUrls?: string[];
|
|
12
|
+
lastMessageAuthorId?: string;
|
|
13
|
+
lastMessageAuthorName?: string;
|
|
14
|
+
lastMessageCreatedAt?: string;
|
|
15
|
+
lastMessageTextPreview?: string;
|
|
16
|
+
memberAbility?: MemberAbilityResource;
|
|
17
|
+
muted: boolean;
|
|
7
18
|
repliesDisabled: boolean;
|
|
8
|
-
|
|
9
|
-
lastMessageAuthorName: string;
|
|
10
|
-
lastMessageCreatedAt: string;
|
|
11
|
-
lastMessageTextPreview: string;
|
|
19
|
+
title: string;
|
|
12
20
|
unreadCount: number;
|
|
13
|
-
|
|
21
|
+
updatedAt: string;
|
|
14
22
|
}
|
|
15
23
|
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/types/resources/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/types/resources/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAExD,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,cAAc,CAAA;IACpB,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,CAAC,EAAE,yBAAyB,EAAE,CAAA;IACpC,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,CAAC,EAAE,aAAa,EAAE,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,aAAa,CAAC,EAAE,qBAAqB,CAAA;IACrC,KAAK,EAAE,OAAO,CAAA;IACd,eAAe,EAAE,OAAO,CAAA;IACxB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../../src/types/resources/conversation.ts"],"names":[],"mappings":"","sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../../src/types/resources/conversation.ts"],"names":[],"mappings":"","sourcesContent":["import { ConversationBadgeResource } from './conversation_badge'\nimport { GroupResource } from './group_resource'\nimport { MemberAbilityResource } from './member_ability'\n\nexport interface ConversationResource {\n type: 'Conversation'\n id: string\n badges?: ConversationBadgeResource[]\n createdAt: string\n deleted?: boolean\n groups?: GroupResource[]\n previewAvatarUrls?: string[]\n lastMessageAuthorId?: string\n lastMessageAuthorName?: string\n lastMessageCreatedAt?: string\n lastMessageTextPreview?: string\n memberAbility?: MemberAbilityResource\n muted: boolean\n repliesDisabled: boolean\n title: string\n unreadCount: number\n updatedAt: string\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AppName } from './app_name';
|
|
2
|
+
export interface ConversationBadgeResource {
|
|
3
|
+
type: 'ConversationBadge';
|
|
4
|
+
id: string;
|
|
5
|
+
links: {
|
|
6
|
+
self: string;
|
|
7
|
+
};
|
|
8
|
+
text: string | null;
|
|
9
|
+
appName: AppName;
|
|
10
|
+
pcoResourceType: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=conversation_badge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation_badge.d.ts","sourceRoot":"","sources":["../../../src/types/resources/conversation_badge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEpC,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,mBAAmB,CAAA;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,eAAe,EAAE,MAAM,CAAA;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conversation_badge.js","sourceRoot":"","sources":["../../../src/types/resources/conversation_badge.ts"],"names":[],"mappings":"","sourcesContent":["import { AppName } from './app_name'\n\nexport interface ConversationBadgeResource {\n type: 'ConversationBadge'\n id: string\n links: { self: string }\n text: string | null\n appName: AppName\n pcoResourceType: string\n}\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AppName } from './app_name';
|
|
2
|
+
export interface GroupResource {
|
|
3
|
+
type: 'Group';
|
|
4
|
+
id: string;
|
|
5
|
+
links: {
|
|
6
|
+
self: string;
|
|
7
|
+
};
|
|
8
|
+
name: string | null;
|
|
9
|
+
sourceAppName: AppName;
|
|
10
|
+
sourceType: string;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=group_resource.d.ts.map
|
|
@@ -0,0 +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,IAAI,EAAE,OAAO,CAAA;IACb,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;IACvB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,aAAa,EAAE,OAAO,CAAA;IACtB,UAAU,EAAE,MAAM,CAAA;CACnB"}
|
|
@@ -0,0 +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 type: 'Group'\n id: string\n links: { self: string }\n name: string | null\n sourceAppName: AppName\n sourceType: string\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,WAAW,CAAA;AACzB,cAAc,
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,WAAW,CAAA;AACzB,cAAc,
|
|
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","sourcesContent":["export * from './conversation'\nexport * from './member'\nexport * from './message'\nexport * from './oauth_token'\nexport * from './person'\n"]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface MemberResource {
|
|
2
|
+
type: 'Member';
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
avatar: string;
|
|
6
|
+
badges: MemberBadge[];
|
|
7
|
+
child: boolean;
|
|
8
|
+
role?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface MemberResourceWithPerson extends MemberResource {
|
|
11
|
+
person: {
|
|
12
|
+
firstName: string;
|
|
13
|
+
lastName: string;
|
|
14
|
+
avatarUrl: string;
|
|
15
|
+
child: boolean;
|
|
16
|
+
id: string;
|
|
17
|
+
type: 'Person';
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface MemberBadge {
|
|
21
|
+
title: string;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=member.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member.d.ts","sourceRoot":"","sources":["../../../src/types/resources/member.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAA;IACd,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,KAAK,EAAE,OAAO,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,wBAAyB,SAAQ,cAAc;IAC9D,MAAM,EAAE;QACN,SAAS,EAAE,MAAM,CAAA;QACjB,QAAQ,EAAE,MAAM,CAAA;QAChB,SAAS,EAAE,MAAM,CAAA;QACjB,KAAK,EAAE,OAAO,CAAA;QACd,EAAE,EAAE,MAAM,CAAA;QACV,IAAI,EAAE,QAAQ,CAAA;KACf,CAAA;CACF;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member.js","sourceRoot":"","sources":["../../../src/types/resources/member.ts"],"names":[],"mappings":"","sourcesContent":["export interface MemberResource {\n type: 'Member'\n id: string\n name: string\n avatar: string\n badges: MemberBadge[]\n child: boolean\n role?: string\n}\n\nexport interface MemberResourceWithPerson extends MemberResource {\n person: {\n firstName: string\n lastName: string\n avatarUrl: string\n child: boolean\n id: string\n type: 'Person'\n }\n}\n\nexport interface MemberBadge {\n title: string\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member_ability.d.ts","sourceRoot":"","sources":["../../../src/types/resources/member_ability.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,eAAe,CAAA;IACrB,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"member_ability.js","sourceRoot":"","sources":["../../../src/types/resources/member_ability.ts"],"names":[],"mappings":"","sourcesContent":["export interface MemberAbilityResource {\n type: 'MemberAbility'\n canUpdate: boolean\n canDelete: boolean\n}\n"]}
|