@planningcenter/chat-react-native 3.42.3-qa-staging.3 → 3.42.3-qa-staging.5
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/messages_disabled_banners.d.ts +2 -3
- package/build/components/conversation/messages_disabled_banners.d.ts.map +1 -1
- package/build/components/conversation/messages_disabled_banners.js +2 -7
- package/build/components/conversation/messages_disabled_banners.js.map +1 -1
- package/build/components/display/adult_requirement_notice.js +1 -1
- package/build/components/display/adult_requirement_notice.js.map +1 -1
- package/build/hooks/use_conversation.d.ts.map +1 -1
- package/build/hooks/use_conversation.js +1 -0
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_conversation_jolt_events.d.ts.map +1 -1
- package/build/hooks/use_conversation_jolt_events.js +10 -2
- package/build/hooks/use_conversation_jolt_events.js.map +1 -1
- package/build/screens/conversation_filters/components/rows.js +1 -1
- package/build/screens/conversation_filters/components/rows.js.map +1 -1
- package/build/screens/conversation_screen.js +1 -1
- package/build/screens/conversation_screen.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.js +1 -1
- package/build/screens/conversation_select_recipients/components/groups_recipient_row.js.map +1 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.js +1 -1
- package/build/screens/conversation_select_recipients/components/restricted_group_row.js.map +1 -1
- package/build/types/jolt_events/conversation_events.d.ts +2 -2
- package/build/types/jolt_events/conversation_events.d.ts.map +1 -1
- package/build/types/jolt_events/conversation_events.js.map +1 -1
- package/build/types/resources/conversation.d.ts +2 -2
- package/build/types/resources/conversation.d.ts.map +1 -1
- package/build/types/resources/conversation.js.map +1 -1
- package/build/utils/conversation_safety_constants.d.ts +1 -1
- package/build/utils/conversation_safety_constants.d.ts.map +1 -1
- package/build/utils/conversation_safety_constants.js +1 -1
- package/build/utils/conversation_safety_constants.js.map +1 -1
- package/build/utils/request/conversation.d.ts.map +1 -1
- package/build/utils/request/conversation.js +1 -0
- package/build/utils/request/conversation.js.map +1 -1
- package/package.json +3 -3
- package/src/components/conversation/messages_disabled_banners.tsx +3 -11
- package/src/components/display/adult_requirement_notice.tsx +1 -1
- package/src/hooks/use_conversation.ts +1 -0
- package/src/hooks/use_conversation_jolt_events.ts +16 -3
- package/src/screens/conversation_filters/components/rows.tsx +2 -2
- package/src/screens/conversation_screen.tsx +1 -1
- package/src/screens/conversation_select_recipients/components/groups_recipient_row.tsx +1 -1
- package/src/screens/conversation_select_recipients/components/restricted_group_row.tsx +2 -2
- package/src/types/jolt_events/conversation_events.ts +2 -2
- package/src/types/resources/conversation.ts +2 -3
- package/src/utils/conversation_safety_constants.ts +1 -1
- package/src/utils/request/conversation.ts +1 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import type { ConversationDisabledReason } from '../../types';
|
|
2
1
|
export declare const LeaderMessagesDisabledBanner: () => import("react/jsx-runtime").JSX.Element;
|
|
3
2
|
export declare const MemberMessagesDisabledBanner: () => import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
interface ConversationDisabledBannerProps {
|
|
5
|
-
|
|
4
|
+
message: string | null;
|
|
6
5
|
messageLink?: {
|
|
7
6
|
label: string;
|
|
8
7
|
onPress: () => void;
|
|
9
8
|
};
|
|
10
9
|
}
|
|
11
|
-
export declare const ConversationDisabledBanner: ({
|
|
10
|
+
export declare const ConversationDisabledBanner: ({ message, messageLink, }: ConversationDisabledBannerProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
11
|
export {};
|
|
13
12
|
//# sourceMappingURL=messages_disabled_banners.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages_disabled_banners.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/messages_disabled_banners.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"messages_disabled_banners.d.ts","sourceRoot":"","sources":["../../../src/components/conversation/messages_disabled_banners.tsx"],"names":[],"mappings":"AAKA,eAAO,MAAM,4BAA4B,+CAIxC,CAAA;AAED,eAAO,MAAM,4BAA4B,+CASxC,CAAA;AAID,UAAU,+BAA+B;IACvC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,WAAW,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,IAAI,CAAA;KAAE,CAAA;CACrD;AAED,eAAO,MAAM,0BAA0B,GAAI,2BAGxC,+BAA+B,4CAWjC,CAAA"}
|
|
@@ -2,7 +2,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { StyleSheet, View } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
import { useTheme } from '../../hooks';
|
|
5
|
-
import { ADULT_REQUIREMENT_BODY } from '../../utils';
|
|
6
5
|
import { Button, Text } from '../display';
|
|
7
6
|
export const LeaderMessagesDisabledBanner = () => {
|
|
8
7
|
return (_jsx(MessagesDisabledBanner, { description: "Only leaders can send messages in this conversation." }));
|
|
@@ -11,14 +10,10 @@ export const MemberMessagesDisabledBanner = () => {
|
|
|
11
10
|
const styles = useStyles();
|
|
12
11
|
return (_jsx(MessagesDisabledBanner, { description: "Only leaders can send messages, but you can still add reactions.", style: styles.memberBanner }));
|
|
13
12
|
};
|
|
14
|
-
const DISABLED_REASON_TEXT = {
|
|
15
|
-
safety_check: ADULT_REQUIREMENT_BODY,
|
|
16
|
-
direct_messages_disabled: 'Direct messages have been turned off by someone in this conversation.',
|
|
17
|
-
};
|
|
18
13
|
const DEFAULT_DISABLED_TEXT = 'This conversation has been disabled.';
|
|
19
|
-
export const ConversationDisabledBanner = ({
|
|
14
|
+
export const ConversationDisabledBanner = ({ message, messageLink, }) => {
|
|
20
15
|
const styles = useStyles();
|
|
21
|
-
const description =
|
|
16
|
+
const description = message ?? DEFAULT_DISABLED_TEXT;
|
|
22
17
|
return (_jsx(MessagesDisabledBanner, { description: description, style: styles.memberBanner, messageLink: messageLink }));
|
|
23
18
|
};
|
|
24
19
|
const MessagesDisabledBanner = ({ description, style, messageLink, }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages_disabled_banners.js","sourceRoot":"","sources":["../../../src/components/conversation/messages_disabled_banners.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"messages_disabled_banners.js","sourceRoot":"","sources":["../../../src/components/conversation/messages_disabled_banners.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAkB,MAAM,cAAc,CAAA;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,YAAY,CAAA;AAEzC,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,EAAE;IAC/C,OAAO,CACL,KAAC,sBAAsB,IAAC,WAAW,EAAC,sDAAsD,GAAG,CAC9F,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,EAAE;IAC/C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,OAAO,CACL,KAAC,sBAAsB,IACrB,WAAW,EAAC,kEAAkE,EAC9E,KAAK,EAAE,MAAM,CAAC,YAAY,GAC1B,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAG,sCAAsC,CAAA;AAOpE,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,EACzC,OAAO,EACP,WAAW,GACqB,EAAE,EAAE;IACpC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAC1B,MAAM,WAAW,GAAG,OA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AAM;SACtB;QACD,aAAa,EAAE;YACb,SAAS,EAAE,EAAE;SACd;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { StyleSheet, View, type ViewStyle } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { useTheme } from '../../hooks'\nimport { Button, Text } from '../display'\n\nexport const LeaderMessagesDisabledBanner = () => {\n return (\n <MessagesDisabledBanner description=\"Only leaders can send messages in this conversation.\" />\n )\n}\n\nexport const MemberMessagesDisabledBanner = () => {\n const styles = useStyles()\n\n return (\n <MessagesDisabledBanner\n description=\"Only leaders can send messages, but you can still add reactions.\"\n style={styles.memberBanner}\n />\n )\n}\n\nconst DEFAULT_DISABLED_TEXT = 'This conversation has been disabled.'\n\ninterface ConversationDisabledBannerProps {\n message: string | null\n messageLink?: { label: string; onPress: () => void }\n}\n\nexport const ConversationDisabledBanner = ({\n message,\n messageLink,\n}: ConversationDisabledBannerProps) => {\n const styles = useStyles()\n const description = message ?? DEFAULT_DISABLED_TEXT\n\n return (\n <MessagesDisabledBanner\n description={description}\n style={styles.memberBanner}\n messageLink={messageLink}\n />\n )\n}\n\ninterface MessagesDisabledBannerProps {\n description: string\n style?: ViewStyle\n messageLink?: { label: string; onPress: () => void }\n}\n\nconst MessagesDisabledBanner = ({\n description,\n style,\n messageLink,\n}: MessagesDisabledBannerProps) => {\n const styles = useStyles()\n\n return (\n <View style={[styles.baseBanner, style]}>\n <Text style={styles.text} variant=\"tertiary\">\n {description}\n </Text>\n {messageLink && (\n <Button\n variant=\"fill\"\n size=\"lg\"\n title={messageLink.label}\n onPress={messageLink.onPress}\n style={styles.messageButton}\n />\n )}\n </View>\n )\n}\n\nconst useStyles = () => {\n const { colors } = useTheme()\n const { bottom } = useSafeAreaInsets()\n\n return StyleSheet.create({\n baseBanner: {\n paddingHorizontal: 16,\n paddingVertical: 4,\n backgroundColor: colors.statusNeutralComposedBackground,\n borderTopWidth: 1,\n borderTopColor: colors.borderColorDefaultBase,\n },\n text: {\n textAlign: 'center',\n },\n memberBanner: {\n paddingTop: 16,\n paddingBottom: 16 + bottom,\n marginBottom: -bottom,\n },\n messageButton: {\n marginTop: 12,\n },\n })\n}\n"]}
|
|
@@ -3,6 +3,6 @@ import { ADULT_REQUIREMENT_BODY } from '../../utils';
|
|
|
3
3
|
import BannerPrimitive from '../primitive/banner_primitive';
|
|
4
4
|
import { BannerCollapsible } from './banner_collapsible';
|
|
5
5
|
export function AdultRequirementNotice({ style }) {
|
|
6
|
-
return (_jsx(BannerCollapsible, { appearance: "warning", iconName: "general.shieldExclamation", heading: "
|
|
6
|
+
return (_jsx(BannerCollapsible, { appearance: "warning", iconName: "general.shieldExclamation", heading: "Two adults required to chat", style: style, children: _jsx(BannerPrimitive.Text, { children: ADULT_REQUIREMENT_BODY }) }));
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=adult_requirement_notice.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adult_requirement_notice.js","sourceRoot":"","sources":["../../../src/components/display/adult_requirement_notice.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,eAAe,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAMxD,MAAM,UAAU,sBAAsB,CAAC,EAAE,KAAK,EAA+B;IAC3E,OAAO,CACL,KAAC,iBAAiB,IAChB,UAAU,EAAC,SAAS,EACpB,QAAQ,EAAC,2BAA2B,EACpC,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"adult_requirement_notice.js","sourceRoot":"","sources":["../../../src/components/display/adult_requirement_notice.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,eAAe,MAAM,+BAA+B,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAMxD,MAAM,UAAU,sBAAsB,CAAC,EAAE,KAAK,EAA+B;IAC3E,OAAO,CACL,KAAC,iBAAiB,IAChB,UAAU,EAAC,SAAS,EACpB,QAAQ,EAAC,2BAA2B,EACpC,OAAO,EAAC,6BAA6B,EACrC,KAAK,EAAE,KAAK,YAEZ,KAAC,eAAe,CAAC,IAAI,cAAE,sBAAsB,GAAwB,GACnD,CACrB,CAAA;AACH,CAAC","sourcesContent":["import React from 'react'\nimport type { ViewStyle } from 'react-native'\nimport { ADULT_REQUIREMENT_BODY } from '../../utils'\nimport BannerPrimitive from '../primitive/banner_primitive'\nimport { BannerCollapsible } from './banner_collapsible'\n\ninterface AdultRequirementNoticeProps {\n style?: ViewStyle\n}\n\nexport function AdultRequirementNotice({ style }: AdultRequirementNoticeProps) {\n return (\n <BannerCollapsible\n appearance=\"warning\"\n iconName=\"general.shieldExclamation\"\n heading=\"Two adults required to chat\"\n style={style}\n >\n <BannerPrimitive.Text>{ADULT_REQUIREMENT_BODY}</BannerPrimitive.Text>\n </BannerCollapsible>\n )\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_conversation.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAO5D,eAAO,MAAM,0BAA0B,GAAI,qBAAqB;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"use_conversation.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAO5D,eAAO,MAAM,0BAA0B,GAAI,qBAAqB;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE;;;;;;;;;;;;;CA6DzF,CAAA;AAEF,eAAO,MAAM,eAAe,GAAI,qBAAqB;IAAE,eAAe,EAAE,M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EAAE,CAAC,4BAA4B,CAAC;QAC3C,UAAU,EAAE,KAAK,EAAE,eAAwB,EAAE,EAAE;YAC7C,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,CAAoC;gBAC7D,GAAG,EAAE,qBAAqB,eAAe,EAAE;gBAC3C,IAAI,EAAE;oBACJ,IAAI,EAAE;wBACJ,IAAI,EAAE,cAAc;wBACpB,UAAU,EAAE;4BACV,gBAAgB,EAAE,eAAe;yBAClC;qBACF;iBACF;aACF,CAAC,CAAA;QACJ,CAAC;QACD,SAAS,EAAE,CAAC,QAA2C,EAAE,EAAE;YACzD,WAAW,CAAC,YAAY,CAAoC,QAAQ,EAAE,IAAI,CAAC,EAAE;gBAC3E,IAAI,CAAC,IAAI,EAAE,IAAI;oBAAE,OAAO,IAAI,CAAA;gBAE5B,IAAI,CAAC,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAA;gBACzD,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;gBAEvC,OAAO,IAAI,CAAA;YACb,CAAC,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;IAEF,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,kBAAkB,EAAE,GAAG,QAAQ,EAAE,CAAA;AACpE,CAAC,CAAA","sourcesContent":["import { useMutation, useQueryClient } from '@tanstack/react-query'\nimport { useState } from 'react'\nimport { ApiResource, ConversationResource } from '../types'\nimport { transformGetToPost } from '../utils/client/request_helpers'\nimport { Haptic } from '../utils/native_adapters'\nimport { getConversationsRequestArgs } from '../utils/request/conversation'\nimport { useApiClient } from './use_api_client'\nimport { getRequestQueryKey, useSuspenseGet } from './use_suspense_api'\n\nexport const getConversationRequestArgs = ({ conversation_id }: { conversation_id: number }) => ({\n url: `/me/conversations/${conversation_id}`,\n data: {\n fields: {\n Conversation: [\n 'analytics_metadata',\n 'created_at',\n 'badges',\n 'conversation_membership',\n 'conversation_preview',\n 'gender_option',\n 'groups',\n 'last_message_author_id',\n 'last_message_author_name',\n 'last_message_created_at',\n 'last_message_text_preview',\n 'latest_read_message_sort_key',\n 'preview_avatar_urls',\n 'custom_avatar_type',\n 'custom_avatar_key',\n 'custom_avatar_color',\n 'custom_avatar_image_url',\n 'direct_message',\n 'disabled',\n 'disabled_reason',\n 'member_ability',\n 'muted',\n 'replies_disabled',\n 'title',\n 'unread_count',\n 'unread_reaction',\n 'updated_at',\n ],\n AnalyticsMetadata: ['metadata'],\n MemberAbility: [\n 'can_update',\n 'can_delete',\n 'leader',\n 'can_reply',\n 'can_delete_non_authored_messages',\n 'can_message_available_members',\n ],\n ConversationMembership: [\n 'last_read_message_sort_key',\n 'notification_level',\n 'notification_level_description',\n 'notification_level_options',\n 'muted',\n ],\n ConversationBadge: ['app_name', 'pco_resource_type', 'text'],\n Group: ['type', 'id', 'links', 'name', 'source_app_name', 'source_type'],\n },\n include: [\n 'badges',\n 'conversation_membership',\n 'member_ability',\n 'groups',\n 'analytics_metadata',\n ],\n },\n})\n\nexport const useConversation = ({ conversation_id }: { conversation_id: number }) => {\n const args = getConversationRequestArgs({ conversation_id })\n\n return useSuspenseGet<ConversationResource>(args)\n}\n\nexport const useConversationMute = ({ conversation_id }: { conversation_id: number }) => {\n const apiClient = useApiClient()\n const queryClient = useQueryClient()\n const requestArgs = getConversationRequestArgs({ conversation_id })\n const queryKey = getRequestQueryKey(requestArgs)\n const { data: conversation } = useConversation({ conversation_id })\n const [value, setValue] = useState<boolean>(conversation.muted)\n\n const { mutate: setMuted, ...mutation } = useMutation({\n onMutate: async (muted: boolean) => {\n return queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n setValue(muted)\n prev.data.muted = muted\n if (prev.data.conversationMembership) {\n prev.data.conversationMembership.muted = muted\n }\n\n return prev\n })\n },\n mutationKey: ['muteConversation'],\n mutationFn: async (muted: boolean) => {\n const action = muted ? 'mute' : 'unmute'\n\n return apiClient.chat.post<ApiResource<ConversationResource>>({\n url: `/me/conversations/${conversation_id}/${action}`,\n data: { data: { type: '', attributes: {} }, fields: { Conversation: 'muted' } },\n })\n },\n onSuccess: (response: ApiResource<ConversationResource>) => {\n queryClient.invalidateQueries({ queryKey: ['/me/conversations'] })\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n\n // Posting to the mute action endpoint can't return all the fields\n // so we need to set only the fields we require\n prev.data.muted = response.data.muted\n if (prev.data.conversationMembership) {\n prev.data.conversationMembership.muted = response.data.muted\n }\n setValue(response.data.muted)\n\n return prev\n })\n },\n })\n\n return { muted: value, setMuted, ...mutation }\n}\n\nexport const useConversationUpdate = ({ conversation_id }: { conversation_id: number }) => {\n const apiClient = useApiClient()\n const queryClient = useQueryClient()\n const requestArgs = getConversationRequestArgs({ conversation_id })\n const queryKey = getRequestQueryKey(requestArgs)\n\n return useMutation({\n onMutate: async (update: Partial<ConversationResource>) => {\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (prev?.data) {\n prev.data = {\n ...prev.data,\n ...update,\n }\n }\n\n return prev\n })\n },\n mutationKey: ['mutateConversation'],\n mutationFn: async (update: Partial<ConversationResource>) => {\n const postArgs = transformGetToPost(requestArgs).data\n return apiClient.chat.patch<ApiResource<ConversationResource>>({\n url: `/me/conversations/${conversation_id}/`,\n data: { data: { type: '', attributes: update }, ...postArgs },\n })\n },\n onSuccess: response => {\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, () => response)\n },\n })\n}\n\nexport const useConversationDelete = ({ conversation_id }: { conversation_id: number }) => {\n const apiClient = useApiClient()\n const queryClient = useQueryClient()\n const { url } = getConversationsRequestArgs()\n\n return useMutation({\n mutationKey: ['deleteConversation'],\n mutationFn: async () => {\n return apiClient.chat.delete({\n url: `/me/conversations/${conversation_id}`,\n })\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [url] })\n Haptic.notificationSuccess()\n },\n })\n}\n\nexport const useConversationDisableReplies = ({ conversation_id }: { conversation_id: number }) => {\n const apiClient = useApiClient()\n const queryClient = useQueryClient()\n const requestArgs = getConversationRequestArgs({ conversation_id })\n const queryKey = getRequestQueryKey(requestArgs)\n const { data: conversation } = useConversation({ conversation_id })\n const [value, setValue] = useState<boolean>(conversation.repliesDisabled)\n\n const { mutate: setRepliesDisabled, ...mutation } = useMutation({\n onMutate: async (repliesDisabled: boolean) => {\n return queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n setValue(repliesDisabled)\n prev.data.repliesDisabled = repliesDisabled\n\n return prev\n })\n },\n mutationKey: ['disableRepliesConversation'],\n mutationFn: async (repliesDisabled: boolean) => {\n return apiClient.chat.patch<ApiResource<ConversationResource>>({\n url: `/me/conversations/${conversation_id}`,\n data: {\n data: {\n type: 'Conversation',\n attributes: {\n replies_disabled: repliesDisabled,\n },\n },\n },\n })\n },\n onSuccess: (response: ApiResource<ConversationResource>) => {\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n\n prev.data.repliesDisabled = response.data.repliesDisabled\n setValue(response.data.repliesDisabled)\n\n return prev\n })\n },\n })\n\n return { repliesDisabled: value, setRepliesDisabled, ...mutation }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"use_conversation.js","sourceRoot":"","sources":["../../src/hooks/use_conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACjD,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,kBAAkB,EAAE,cAAc,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AAO,IAAI,CAAA;gBAC5B,QAAQ,CAAC,eAAe,CAAC,CAAA;gBACzB,IAAI,CAAC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAA;gBAE3C,OAAO,IAAI,CAAA;YACb,CAAC,CAAC,CAAA;QACJ,CAAC;QACD,WAAW,EAAE,CAAC,4BAA4B,CAAC;QAC3C,UAAU,EAAE,KAAK,EAAE,eAAwB,EAAE,EAAE;YAC7C,OAAO,SAAS,CAAC,IAAI,CAAC,KAAK,CAAoC;gBAC7D,GAAG,EAAE,qBAAqB,eAAe,EAAE;gBAC3C,IAAI,EAAE;oBACJ,IAAI,EAAE;wBACJ,IAAI,EAAE,cAAc;wBACpB,UAAU,EAAE;4BACV,gBAAgB,EAAE,eAAe;yBAClC;qBACF;iBACF;aACF,CAAC,CAAA;QACJ,CAAC;QACD,SAAS,EAAE,CAAC,QAA2C,EAAE,EAAE;YACzD,WAAW,CAAC,YAAY,CAAoC,QAAQ,EAAE,IAAI,CAAC,EAAE;gBAC3E,IAAI,CAAC,IAAI,EAAE,IAAI;oBAAE,OAAO,IAAI,CAAA;gBAE5B,IAAI,CAAC,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAA;gBACzD,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;gBAEvC,OAAO,IAAI,CAAA;YACb,CAAC,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,CAAA;IAEF,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,kBAAkB,EAAE,GAAG,QAAQ,EAAE,CAAA;AACpE,CAAC,CAAA","sourcesContent":["import { useMutation, useQueryClient } from '@tanstack/react-query'\nimport { useState } from 'react'\nimport { ApiResource, ConversationResource } from '../types'\nimport { transformGetToPost } from '../utils/client/request_helpers'\nimport { Haptic } from '../utils/native_adapters'\nimport { getConversationsRequestArgs } from '../utils/request/conversation'\nimport { useApiClient } from './use_api_client'\nimport { getRequestQueryKey, useSuspenseGet } from './use_suspense_api'\n\nexport const getConversationRequestArgs = ({ conversation_id }: { conversation_id: number }) => ({\n url: `/me/conversations/${conversation_id}`,\n data: {\n fields: {\n Conversation: [\n 'analytics_metadata',\n 'created_at',\n 'badges',\n 'conversation_membership',\n 'conversation_preview',\n 'gender_option',\n 'groups',\n 'last_message_author_id',\n 'last_message_author_name',\n 'last_message_created_at',\n 'last_message_text_preview',\n 'latest_read_message_sort_key',\n 'preview_avatar_urls',\n 'custom_avatar_type',\n 'custom_avatar_key',\n 'custom_avatar_color',\n 'custom_avatar_image_url',\n 'direct_message',\n 'disabled',\n 'disabled_reason',\n 'disabled_message',\n 'member_ability',\n 'muted',\n 'replies_disabled',\n 'title',\n 'unread_count',\n 'unread_reaction',\n 'updated_at',\n ],\n AnalyticsMetadata: ['metadata'],\n MemberAbility: [\n 'can_update',\n 'can_delete',\n 'leader',\n 'can_reply',\n 'can_delete_non_authored_messages',\n 'can_message_available_members',\n ],\n ConversationMembership: [\n 'last_read_message_sort_key',\n 'notification_level',\n 'notification_level_description',\n 'notification_level_options',\n 'muted',\n ],\n ConversationBadge: ['app_name', 'pco_resource_type', 'text'],\n Group: ['type', 'id', 'links', 'name', 'source_app_name', 'source_type'],\n },\n include: [\n 'badges',\n 'conversation_membership',\n 'member_ability',\n 'groups',\n 'analytics_metadata',\n ],\n },\n})\n\nexport const useConversation = ({ conversation_id }: { conversation_id: number }) => {\n const args = getConversationRequestArgs({ conversation_id })\n\n return useSuspenseGet<ConversationResource>(args)\n}\n\nexport const useConversationMute = ({ conversation_id }: { conversation_id: number }) => {\n const apiClient = useApiClient()\n const queryClient = useQueryClient()\n const requestArgs = getConversationRequestArgs({ conversation_id })\n const queryKey = getRequestQueryKey(requestArgs)\n const { data: conversation } = useConversation({ conversation_id })\n const [value, setValue] = useState<boolean>(conversation.muted)\n\n const { mutate: setMuted, ...mutation } = useMutation({\n onMutate: async (muted: boolean) => {\n return queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n setValue(muted)\n prev.data.muted = muted\n if (prev.data.conversationMembership) {\n prev.data.conversationMembership.muted = muted\n }\n\n return prev\n })\n },\n mutationKey: ['muteConversation'],\n mutationFn: async (muted: boolean) => {\n const action = muted ? 'mute' : 'unmute'\n\n return apiClient.chat.post<ApiResource<ConversationResource>>({\n url: `/me/conversations/${conversation_id}/${action}`,\n data: { data: { type: '', attributes: {} }, fields: { Conversation: 'muted' } },\n })\n },\n onSuccess: (response: ApiResource<ConversationResource>) => {\n queryClient.invalidateQueries({ queryKey: ['/me/conversations'] })\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n\n // Posting to the mute action endpoint can't return all the fields\n // so we need to set only the fields we require\n prev.data.muted = response.data.muted\n if (prev.data.conversationMembership) {\n prev.data.conversationMembership.muted = response.data.muted\n }\n setValue(response.data.muted)\n\n return prev\n })\n },\n })\n\n return { muted: value, setMuted, ...mutation }\n}\n\nexport const useConversationUpdate = ({ conversation_id }: { conversation_id: number }) => {\n const apiClient = useApiClient()\n const queryClient = useQueryClient()\n const requestArgs = getConversationRequestArgs({ conversation_id })\n const queryKey = getRequestQueryKey(requestArgs)\n\n return useMutation({\n onMutate: async (update: Partial<ConversationResource>) => {\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (prev?.data) {\n prev.data = {\n ...prev.data,\n ...update,\n }\n }\n\n return prev\n })\n },\n mutationKey: ['mutateConversation'],\n mutationFn: async (update: Partial<ConversationResource>) => {\n const postArgs = transformGetToPost(requestArgs).data\n return apiClient.chat.patch<ApiResource<ConversationResource>>({\n url: `/me/conversations/${conversation_id}/`,\n data: { data: { type: '', attributes: update }, ...postArgs },\n })\n },\n onSuccess: response => {\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, () => response)\n },\n })\n}\n\nexport const useConversationDelete = ({ conversation_id }: { conversation_id: number }) => {\n const apiClient = useApiClient()\n const queryClient = useQueryClient()\n const { url } = getConversationsRequestArgs()\n\n return useMutation({\n mutationKey: ['deleteConversation'],\n mutationFn: async () => {\n return apiClient.chat.delete({\n url: `/me/conversations/${conversation_id}`,\n })\n },\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: [url] })\n Haptic.notificationSuccess()\n },\n })\n}\n\nexport const useConversationDisableReplies = ({ conversation_id }: { conversation_id: number }) => {\n const apiClient = useApiClient()\n const queryClient = useQueryClient()\n const requestArgs = getConversationRequestArgs({ conversation_id })\n const queryKey = getRequestQueryKey(requestArgs)\n const { data: conversation } = useConversation({ conversation_id })\n const [value, setValue] = useState<boolean>(conversation.repliesDisabled)\n\n const { mutate: setRepliesDisabled, ...mutation } = useMutation({\n onMutate: async (repliesDisabled: boolean) => {\n return queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n setValue(repliesDisabled)\n prev.data.repliesDisabled = repliesDisabled\n\n return prev\n })\n },\n mutationKey: ['disableRepliesConversation'],\n mutationFn: async (repliesDisabled: boolean) => {\n return apiClient.chat.patch<ApiResource<ConversationResource>>({\n url: `/me/conversations/${conversation_id}`,\n data: {\n data: {\n type: 'Conversation',\n attributes: {\n replies_disabled: repliesDisabled,\n },\n },\n },\n })\n },\n onSuccess: (response: ApiResource<ConversationResource>) => {\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n\n prev.data.repliesDisabled = response.data.repliesDisabled\n setValue(response.data.repliesDisabled)\n\n return prev\n })\n },\n })\n\n return { repliesDisabled: value, setRepliesDisabled, ...mutation }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_conversation_jolt_events.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversation_jolt_events.ts"],"names":[],"mappings":"AAWA,UAAU,KAAK;IACb,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,wBAAgB,yBAAyB,CAAC,EAAE,cAAc,EAAE,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"use_conversation_jolt_events.d.ts","sourceRoot":"","sources":["../../src/hooks/use_conversation_jolt_events.ts"],"names":[],"mappings":"AAWA,UAAU,KAAK;IACb,cAAc,EAAE,MAAM,CAAA;CACvB;AAED,wBAAgB,yBAAyB,CAAC,EAAE,cAAc,EAAE,EAAE,KAAK,QAuGlE"}
|
|
@@ -14,7 +14,7 @@ export function useConversationJoltEvents({ conversationId }) {
|
|
|
14
14
|
const apiClient = useApiClient();
|
|
15
15
|
const queryKey = useMemo(() => getRequestQueryKey(getConversationRequestArgs({ conversation_id: conversationId })), [conversationId]);
|
|
16
16
|
const handleUpdatedConversation = useCallback((e) => {
|
|
17
|
-
const { last_message_idempotent_key, last_message_author_id, disabled, disabled_reason } = e.data.data;
|
|
17
|
+
const { last_message_idempotent_key, last_message_author_id, disabled, disabled_reason, disabled_message, } = e.data.data;
|
|
18
18
|
if (last_message_idempotent_key && last_message_author_id === currentPersonId) {
|
|
19
19
|
completeMessageCreationConversationTracking({
|
|
20
20
|
apiClient,
|
|
@@ -24,7 +24,15 @@ export function useConversationJoltEvents({ conversationId }) {
|
|
|
24
24
|
queryClient.setQueryData(queryKey, prev => {
|
|
25
25
|
if (!prev?.data)
|
|
26
26
|
return prev;
|
|
27
|
-
return {
|
|
27
|
+
return {
|
|
28
|
+
...prev,
|
|
29
|
+
data: {
|
|
30
|
+
...prev.data,
|
|
31
|
+
disabled,
|
|
32
|
+
disabledReason: disabled_reason,
|
|
33
|
+
disabledMessage: disabled_message,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
28
36
|
});
|
|
29
37
|
queryClient.invalidateQueries({ queryKey });
|
|
30
38
|
}, [queryClient, queryKey, currentPersonId, apiClient]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_conversation_jolt_events.js","sourceRoot":"","sources":["../../src/hooks/use_conversation_jolt_events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,O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CAAC,CAAA;IACJ,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAA;IAE3B,MAAM,uBAAuB,GAAG,WAAW,CACzC,CAAC,KAAwB,EAAE,EAAE;QAC3B,IAAI,KAAK,CAAC,KAAK,KAAK,kBAAkB;YAAE,OAAM;QAC9C,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,KAAK,eAAe;YAAE,OAAM;QACzD,IAAI,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,iBAAiB,KAAK,eAAe;YAAE,OAAM;QAEjE,WAAW,CAAC,YAAY,CAAoC,QAAQ,EAAE,IAAI,CAAC,EAAE;YAC3E,IAAI,CAAC,IAAI,EAAE,IAAI;gBAAE,OAAO,IAAI,CAAA;YAC5B,OAAO,EAAE,GAAG,IAAI,EAAE,IAAI,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,CAAA;QAClE,CAAC,CAAC,CAAA;IACJ,CAAC,EACD,CAAC,WAAW,EAAE,QAAQ,EAAE,eAAe,CAAC,CACzC,CAAA;IAED,YAAY,CAAC,WAAW,EAAE,sBAAsB,EAAE,yBAAyB,CAAC,CAAA;IAC5E,YAAY,CAAC,WAAW,EAAE,mBAAmB,EAAE,sBAAsB,CAAC,CAAA;IACtE,YAAY,CAAC,WAAW,EAAE,wBAAwB,EAAE,2BAA2B,CAAC,CAAA;IAChF,YAAY,CAAC,WAAW,EAAE,YAAY,EAAE,uBAAuB,CAAC,CAAA;AAClE,CAAC","sourcesContent":["import { useQueryClient } from '@tanstack/react-query'\nimport { useCallback, useMemo } from 'react'\nimport { ApiResource, ConversationResource } from '../types'\nimport { JoltConversationEvent, JoltReactionEvent } from '../types/jolt_events'\nimport { completeMessageCreationConversationTracking } from '../utils/performance_tracking'\nimport { useApiClient } from './use_api_client'\nimport { getConversationRequestArgs } from './use_conversation'\nimport { useCurrentPerson } from './use_current_person'\nimport { useJoltChannel, useJoltEvent } from './use_jolt'\nimport { getRequestQueryKey } from './use_suspense_api'\n\ninterface Props {\n conversationId: number\n}\n\nexport function useConversationJoltEvents({ conversationId }: Props) {\n const joltChannel = useJoltChannel(`chat.conversations.${conversationId}`)\n const queryClient = useQueryClient()\n const currentPerson = useCurrentPerson()\n const currentPersonId = currentPerson?.id\n const apiClient = useApiClient()\n const queryKey = useMemo(\n () => getRequestQueryKey(getConversationRequestArgs({ conversation_id: conversationId })),\n [conversationId]\n )\n\n const handleUpdatedConversation = useCallback(\n (e: JoltConversationEvent) => {\n const {\n last_message_idempotent_key,\n last_message_author_id,\n disabled,\n disabled_reason,\n disabled_message,\n } = e.data.data\n\n if (last_message_idempotent_key && last_message_author_id === currentPersonId) {\n completeMessageCreationConversationTracking({\n apiClient,\n idempotentKey: last_message_idempotent_key,\n })\n }\n\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n return {\n ...prev,\n data: {\n ...prev.data,\n disabled,\n disabledReason: disabled_reason,\n disabledMessage: disabled_message,\n },\n }\n })\n\n queryClient.invalidateQueries({ queryKey })\n },\n [queryClient, queryKey, currentPersonId, apiClient]\n )\n\n const handleConversationRead = useCallback(\n (e: JoltConversationEvent) => {\n const { latest_read_message_sort_key } = e.data.data\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data || !latest_read_message_sort_key) return prev\n if (\n prev.data.latestReadMessageSortKey &&\n prev.data.latestReadMessageSortKey >= latest_read_message_sort_key\n ) {\n return prev\n }\n\n return {\n ...prev,\n data: {\n ...prev.data,\n latestReadMessageSortKey: latest_read_message_sort_key,\n unreadReaction: false,\n },\n }\n })\n },\n [queryClient, queryKey]\n )\n\n const handleConversationDestroyed = useCallback(() => {\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n\n return {\n ...prev,\n data: {\n ...prev.data,\n deleted: true,\n },\n }\n })\n }, [queryClient, queryKey])\n\n const handleReactionJoltEvent = useCallback(\n (event: JoltReactionEvent) => {\n if (event.event !== 'reaction.created') return\n if (event.data.data.author_id === currentPersonId) return\n if (event.data.data.message_author_id !== currentPersonId) return\n\n queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {\n if (!prev?.data) return prev\n return { ...prev, data: { ...prev.data, unreadReaction: true } }\n })\n },\n [queryClient, queryKey, currentPersonId]\n )\n\n useJoltEvent(joltChannel, 'conversation.updated', handleUpdatedConversation)\n useJoltEvent(joltChannel, 'conversation.read', handleConversationRead)\n useJoltEvent(joltChannel, 'conversation.destroyed', handleConversationDestroyed)\n useJoltEvent(joltChannel, 'reaction.*', handleReactionJoltEvent)\n}\n"]}
|
|
@@ -19,7 +19,7 @@ export const GroupRow = ({ group, isActive }) => {
|
|
|
19
19
|
setGroupFilter({ chat_group_graph_id: group.id });
|
|
20
20
|
};
|
|
21
21
|
const { headerImage, membershipsCount } = group;
|
|
22
|
-
return (_jsxs(PressableRow, { onPress: handleFilterByGroup, isActive: isActive, children: [headerImage?.
|
|
22
|
+
return (_jsxs(PressableRow, { onPress: handleFilterByGroup, isActive: isActive, children: [headerImage?.medium && (_jsx(Image, { source: { uri: headerImage?.medium }, resizeMode: "cover", style: styles.rowImage, alt: "" })), _jsxs(View, { style: styles.rowTextContainer, children: [_jsx(Heading, { variant: "h3", style: styles.rowTitle, children: group.name }), membershipsCount && (_jsxs(Text, { style: styles.rowSubtitle, children: [group.membershipsCount, " members"] }))] })] }));
|
|
23
23
|
};
|
|
24
24
|
export const TeamRow = ({ team }) => {
|
|
25
25
|
const { setGroupFilter } = useContext(FilterContext);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rows.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/components/rows.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAkB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACx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;YACnB,YAAY,EAAE,EAAE;SACjB;QACD,QAAQ,EAAE;YACR,aAAa,EAAE,qBAAqB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK;YACvD,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,QAAQ;YAC3D,GAAG,EAAE,EAAE;YACP,UAAU,EAAE,CAAC;SACd;QACD,gBAAgB,EAAE;YAChB,UAAU,EAAE,CAAC;SACd;QACD,gBAAgB,EAAE;YAChB,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;YACP,eAAe,EAAE,EAAE;YACnB,YAAY,EAAE,EAAE;YAChB,WAAW,EAAE,EAAE;SAChB;QACD,cAAc,EAAE;YACd,IAAI,EAAE,CAAC;SACR;QACD,QAAQ,EAAE;YACR,KAAK,EAAE,eAAe,GAAG,SAAS;YAClC,MAAM,EAAE,gBAAgB,GAAG,SAAS;YACpC,YAAY,EAAE,CAAC,GAAG,SAAS;SAC5B;QACD,YAAY,EAAE;YACZ,QAAQ,EAAE,EAAE;YACZ,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,iBAAiB;YACrC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SAC1B;QACD,QAAQ,EAAE;YACR,QAAQ,EAAE,EAAE;YACZ,UAAU,EAAE,CAAC;YACb,UAAU,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,sBAAsB;SACjE;QACD,WAAW,EAAE;YACX,KAAK,EAAE,qBAAqB;gBAC1B,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,yBAAyB;gBACxC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,uBAAuB;SACzC;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import { PlatformPressable } from '@react-navigation/elements'\nimport { NavigationProp, useNavigation } from '@react-navigation/native'\nimport React, { PropsWithChildren, useContext } from 'react'\nimport { StyleSheet, View, ViewStyle } from 'react-native'\nimport { Heading, Icon, Image, Text, TextButton } from '../../../components'\nimport {\n useAtFontScaleBreakpoint,\n useFontScale,\n useScalableNumberOfLines,\n useTheme,\n} from '../../../hooks'\nimport { useServicesTeamsMap } from '../../../hooks/services/use_services_team'\nimport { GroupResource } from '../../../types/resources/group_resource'\nimport { MAX_FONT_SIZE_MULTIPLIER, platformFontWeightBold } from '../../../utils/styles'\nimport { FilterContext } from '../context/conversation_filter_context'\nimport { FilterTypes } from '../filter_types'\nimport { FilteredGroup } from '../hooks/filters'\nimport { ConversationFilterStackParamList } from '../screen_props'\n\nexport type FilterProps = {\n group_source_app_name?: string\n show_direct_messages?: boolean\n isActive: boolean\n filter: FilterTypes\n}\n\nexport const FilterRow = ({\n group_source_app_name,\n show_direct_messages,\n isActive,\n filter,\n}: FilterProps) => {\n const { setAppFilter } = useContext(FilterContext)\n\n return (\n <PressableRow\n onPress={() => setAppFilter({ group_source_app_name, show_direct_messages })}\n isActive={isActive}\n >\n <Text>{filter}</Text>\n </PressableRow>\n )\n}\n\nexport type GroupRowProps = {\n group: FilteredGroup\n isActive: boolean\n}\n\nexport const GroupRow = ({ group, isActive }: GroupRowProps) => {\n const styles = useRowStyles()\n const { setGroupFilter } = useContext(FilterContext)\n\n const handleFilterByGroup = () => {\n setGroupFilter({ chat_group_graph_id: group.id })\n }\n\n const { headerImage, membershipsCount } = group\n\n return (\n <PressableRow onPress={handleFilterByGroup} isActive={isActive}>\n {headerImage?.thumbnail && (\n <Image\n source={{ uri: headerImage?.thumbnail }}\n resizeMode=\"cover\"\n style={styles.rowImage}\n alt=\"\"\n />\n )}\n <View style={styles.rowTextContainer}>\n <Heading variant=\"h3\" style={styles.rowTitle}>\n {group.name}\n </Heading>\n {membershipsCount && (\n <Text style={styles.rowSubtitle}>{group.membershipsCount} members</Text>\n )}\n </View>\n </PressableRow>\n )\n}\n\nexport type TeamRowProps = {\n team: GroupResource\n isActive: boolean\n}\n\nexport const TeamRow = ({ team }: TeamRowProps) => {\n const { setGroupFilter } = useContext(FilterContext)\n const servicesTeams = useServicesTeamsMap()\n const { params } = useContext(FilterContext)\n const { chat_group_graph_id } = params\n const isActive = chat_group_graph_id === team.id.toString()\n const styles = useRowStyles()\n const scalableNumberOfLines = useScalableNumberOfLines()\n\n const handleFilterByGroup = () => {\n setGroupFilter({ chat_group_graph_id: team.id })\n }\n\n const servicesTeam = servicesTeams[team.id]\n const concatedServiceTypeNames = servicesTeam?.serviceTypeNames.join(', ')\n const serviceTypeName = concatedServiceTypeNames || servicesTeam?.group\n\n return (\n <PressableRow onPress={handleFilterByGroup} isActive={isActive}>\n <View style={styles.rowTextContainer}>\n <Heading variant=\"h3\" style={styles.rowTitle}>\n {team.name}\n </Heading>\n <Text numberOfLines={scalableNumberOfLines} style={styles.rowSubtitle}>\n {serviceTypeName}\n </Text>\n </View>\n </PressableRow>\n )\n}\n\nexport type ViewMoreRowProps = { routeName: keyof ConversationFilterStackParamList }\n\nexport const ViewMore = ({ routeName }: ViewMoreRowProps) => {\n const styles = useRowStyles()\n const navigation = useNavigation<NavigationProp<ConversationFilterStackParamList, 'Filters'>>()\n\n return (\n <View style={[styles.rowWithoutBorder]}>\n <TextButton onPress={() => navigation.navigate(routeName, {})} style={styles.viewMoreButton}>\n View more\n </TextButton>\n </View>\n )\n}\n\nexport const PressableRow = ({\n children,\n isActive,\n onPress,\n style,\n}: PropsWithChildren<{ isActive: boolean; onPress: () => void; style?: ViewStyle }>) => {\n const styles = useRowStyles({ isActive })\n return (\n <PlatformPressable\n style={styles.pressable}\n onPress={onPress}\n accessibilityRole=\"radio\"\n accessibilityState={{ selected: isActive }}\n >\n <View style={styles.row}>\n <View style={[styles.rowInner, style]}>{children}</View>\n <Icon\n name=\"general.check\"\n style={styles.rowIconRight}\n accessibilityElementsHidden\n maxFontSizeMultiplier={2.5}\n />\n </View>\n </PlatformPressable>\n )\n}\n\nconst ASPECT_RATIO = 16 / 9\nconst THUMBNAIL_WIDTH = 80\nconst THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO\n\nconst useRowStyles = ({ isActive = false }: { isActive?: boolean } = {}) => {\n const theme = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER })\n const atFontScaleBreakpoint = useAtFontScaleBreakpoint()\n\n return StyleSheet.create({\n pressable: {\n paddingLeft: 16,\n },\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 12,\n borderBottomWidth: 1,\n borderBottomColor: atFontScaleBreakpoint\n ? theme.colors.borderColorDefaultDark\n : theme.colors.borderColorDefaultBase,\n paddingVertical: 12,\n paddingRight: 16,\n },\n rowInner: {\n flexDirection: atFontScaleBreakpoint ? 'column' : 'row',\n alignItems: atFontScaleBreakpoint ? 'flex-start' : 'center',\n gap: 12,\n flexShrink: 1,\n },\n rowTextContainer: {\n flexShrink: 1,\n },\n rowWithoutBorder: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n paddingVertical: 12,\n paddingRight: 16,\n paddingLeft: 16,\n },\n viewMoreButton: {\n flex: 1,\n },\n rowImage: {\n width: THUMBNAIL_WIDTH * fontScale,\n height: THUMBNAIL_HEIGHT * fontScale,\n borderRadius: 4 * fontScale,\n },\n rowIconRight: {\n fontSize: 16,\n color: theme.colors.statusSuccessIcon,\n opacity: isActive ? 1 : 0,\n },\n rowTitle: {\n fontSize: 16,\n flexShrink: 1,\n fontWeight: atFontScaleBreakpoint ? 400 : platformFontWeightBold,\n },\n rowSubtitle: {\n color: atFontScaleBreakpoint\n ? theme.colors.textColorDefaultSecondary\n : theme.colors.textColorDefaultPrimary,\n },\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"rows.js","sourceRoot":"","sources":["../../../../src/screens/conversation_filters/components/rows.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAA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atformPressable } from '@react-navigation/elements'\nimport { NavigationProp, useNavigation } from '@react-navigation/native'\nimport React, { PropsWithChildren, useContext } from 'react'\nimport { StyleSheet, View, ViewStyle } from 'react-native'\nimport { Heading, Icon, Image, Text, TextButton } from '../../../components'\nimport {\n useAtFontScaleBreakpoint,\n useFontScale,\n useScalableNumberOfLines,\n useTheme,\n} from '../../../hooks'\nimport { useServicesTeamsMap } from '../../../hooks/services/use_services_team'\nimport { GroupResource } from '../../../types/resources/group_resource'\nimport { MAX_FONT_SIZE_MULTIPLIER, platformFontWeightBold } from '../../../utils/styles'\nimport { FilterContext } from '../context/conversation_filter_context'\nimport { FilterTypes } from '../filter_types'\nimport { FilteredGroup } from '../hooks/filters'\nimport { ConversationFilterStackParamList } from '../screen_props'\n\nexport type FilterProps = {\n group_source_app_name?: string\n show_direct_messages?: boolean\n isActive: boolean\n filter: FilterTypes\n}\n\nexport const FilterRow = ({\n group_source_app_name,\n show_direct_messages,\n isActive,\n filter,\n}: FilterProps) => {\n const { setAppFilter } = useContext(FilterContext)\n\n return (\n <PressableRow\n onPress={() => setAppFilter({ group_source_app_name, show_direct_messages })}\n isActive={isActive}\n >\n <Text>{filter}</Text>\n </PressableRow>\n )\n}\n\nexport type GroupRowProps = {\n group: FilteredGroup\n isActive: boolean\n}\n\nexport const GroupRow = ({ group, isActive }: GroupRowProps) => {\n const styles = useRowStyles()\n const { setGroupFilter } = useContext(FilterContext)\n\n const handleFilterByGroup = () => {\n setGroupFilter({ chat_group_graph_id: group.id })\n }\n\n const { headerImage, membershipsCount } = group\n\n return (\n <PressableRow onPress={handleFilterByGroup} isActive={isActive}>\n {headerImage?.medium && (\n <Image\n source={{ uri: headerImage?.medium }}\n resizeMode=\"cover\"\n style={styles.rowImage}\n alt=\"\"\n />\n )}\n <View style={styles.rowTextContainer}>\n <Heading variant=\"h3\" style={styles.rowTitle}>\n {group.name}\n </Heading>\n {membershipsCount && (\n <Text style={styles.rowSubtitle}>{group.membershipsCount} members</Text>\n )}\n </View>\n </PressableRow>\n )\n}\n\nexport type TeamRowProps = {\n team: GroupResource\n isActive: boolean\n}\n\nexport const TeamRow = ({ team }: TeamRowProps) => {\n const { setGroupFilter } = useContext(FilterContext)\n const servicesTeams = useServicesTeamsMap()\n const { params } = useContext(FilterContext)\n const { chat_group_graph_id } = params\n const isActive = chat_group_graph_id === team.id.toString()\n const styles = useRowStyles()\n const scalableNumberOfLines = useScalableNumberOfLines()\n\n const handleFilterByGroup = () => {\n setGroupFilter({ chat_group_graph_id: team.id })\n }\n\n const servicesTeam = servicesTeams[team.id]\n const concatedServiceTypeNames = servicesTeam?.serviceTypeNames.join(', ')\n const serviceTypeName = concatedServiceTypeNames || servicesTeam?.group\n\n return (\n <PressableRow onPress={handleFilterByGroup} isActive={isActive}>\n <View style={styles.rowTextContainer}>\n <Heading variant=\"h3\" style={styles.rowTitle}>\n {team.name}\n </Heading>\n <Text numberOfLines={scalableNumberOfLines} style={styles.rowSubtitle}>\n {serviceTypeName}\n </Text>\n </View>\n </PressableRow>\n )\n}\n\nexport type ViewMoreRowProps = { routeName: keyof ConversationFilterStackParamList }\n\nexport const ViewMore = ({ routeName }: ViewMoreRowProps) => {\n const styles = useRowStyles()\n const navigation = useNavigation<NavigationProp<ConversationFilterStackParamList, 'Filters'>>()\n\n return (\n <View style={[styles.rowWithoutBorder]}>\n <TextButton onPress={() => navigation.navigate(routeName, {})} style={styles.viewMoreButton}>\n View more\n </TextButton>\n </View>\n )\n}\n\nexport const PressableRow = ({\n children,\n isActive,\n onPress,\n style,\n}: PropsWithChildren<{ isActive: boolean; onPress: () => void; style?: ViewStyle }>) => {\n const styles = useRowStyles({ isActive })\n return (\n <PlatformPressable\n style={styles.pressable}\n onPress={onPress}\n accessibilityRole=\"radio\"\n accessibilityState={{ selected: isActive }}\n >\n <View style={styles.row}>\n <View style={[styles.rowInner, style]}>{children}</View>\n <Icon\n name=\"general.check\"\n style={styles.rowIconRight}\n accessibilityElementsHidden\n maxFontSizeMultiplier={2.5}\n />\n </View>\n </PlatformPressable>\n )\n}\n\nconst ASPECT_RATIO = 16 / 9\nconst THUMBNAIL_WIDTH = 80\nconst THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO\n\nconst useRowStyles = ({ isActive = false }: { isActive?: boolean } = {}) => {\n const theme = useTheme()\n const fontScale = useFontScale({ maxFontSizeMultiplier: MAX_FONT_SIZE_MULTIPLIER })\n const atFontScaleBreakpoint = useAtFontScaleBreakpoint()\n\n return StyleSheet.create({\n pressable: {\n paddingLeft: 16,\n },\n row: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'space-between',\n gap: 12,\n borderBottomWidth: 1,\n borderBottomColor: atFontScaleBreakpoint\n ? theme.colors.borderColorDefaultDark\n : theme.colors.borderColorDefaultBase,\n paddingVertical: 12,\n paddingRight: 16,\n },\n rowInner: {\n flexDirection: atFontScaleBreakpoint ? 'column' : 'row',\n alignItems: atFontScaleBreakpoint ? 'flex-start' : 'center',\n gap: 12,\n flexShrink: 1,\n },\n rowTextContainer: {\n flexShrink: 1,\n },\n rowWithoutBorder: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n paddingVertical: 12,\n paddingRight: 16,\n paddingLeft: 16,\n },\n viewMoreButton: {\n flex: 1,\n },\n rowImage: {\n width: THUMBNAIL_WIDTH * fontScale,\n height: THUMBNAIL_HEIGHT * fontScale,\n borderRadius: 4 * fontScale,\n },\n rowIconRight: {\n fontSize: 16,\n color: theme.colors.statusSuccessIcon,\n opacity: isActive ? 1 : 0,\n },\n rowTitle: {\n fontSize: 16,\n flexShrink: 1,\n fontWeight: atFontScaleBreakpoint ? 400 : platformFontWeightBold,\n },\n rowSubtitle: {\n color: atFontScaleBreakpoint\n ? theme.colors.textColorDefaultSecondary\n : theme.colors.textColorDefaultPrimary,\n },\n })\n}\n"]}
|
|
@@ -116,7 +116,7 @@ function ConversationScreenContent({ route }) {
|
|
|
116
116
|
function ConversationBottomBar({ conversation, canReply, replyRootAuthorFirstName, replyRootId, currentlyEditingMessage, onFlaggedInMessageForm, }) {
|
|
117
117
|
const messageLink = useMessageAvailableMembersAction(conversation);
|
|
118
118
|
if (conversation.disabled)
|
|
119
|
-
return (_jsx(ConversationDisabledBanner, {
|
|
119
|
+
return (_jsx(ConversationDisabledBanner, { message: conversation.disabledMessage ?? null, messageLink: messageLink }));
|
|
120
120
|
if (!canReply)
|
|
121
121
|
return _jsx(MemberMessagesDisabledBanner, {});
|
|
122
122
|
return (_jsxs(MessageForm.Root, { replyRootAuthorFirstName: replyRootAuthorFirstName, conversation: conversation, replyRootId: replyRootId, currentlyEditingMessage: currentlyEditingMessage, onFlaggedInMessageForm: onFlaggedInMessageForm, children: [_jsx(MessageForm.AttachmentPicker, {}), _jsx(MessageForm.Commands, {}), _jsx(MessageForm.TextInput, {}), _jsx(MessageForm.SubmitButton, {})] }, currentlyEditingMessage
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,WAAW,EAAoB,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC7F,OAAO,EACL,aAAa,EAGb,aAAa,EACb,QAAQ,IAAI,kBAAkB,EAC9B,QAAQ,GACT,MAAM,0BAA0B,CAAA;AACjC,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,uBAAuB,EA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AAE,mBAAmB,CAAC,CAAC,CAAA;AAC/C,CAAC,CAAA","sourcesContent":["import { date as formatDate } from '@planningcenter/datetime-fmt'\nimport { HeaderTitle, HeaderTitleProps, PlatformPressable } from '@react-navigation/elements'\nimport {\n CommonActions,\n RouteProp,\n StaticScreenProps,\n useNavigation,\n useTheme as useNavigationTheme,\n useRoute,\n} from '@react-navigation/native'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\nimport { FlatList, Platform, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Badge, Icon, Text } from '../components'\nimport { ConversationStartBanner } from '../components/conversation/conversation_start_banner'\nimport { JumpToBottomButton } from '../components/conversation/jump_to_bottom_button'\nimport { Message } from '../components/conversation/message'\nimport { MessageForm } from '../components/conversation/message_form'\nimport {\n ConversationDisabledBanner,\n LeaderMessagesDisabledBanner,\n MemberMessagesDisabledBanner,\n} from '../components/conversation/messages_disabled_banners'\nimport { ReplyShadowMessage } from '../components/conversation/reply_shadow_message'\nimport { SystemMessage } from '../components/conversation/system_message'\nimport { TypingIndicator } from '../components/conversation/typing_indicator'\nimport { KeyboardView } from '../components/display/keyboard_view'\nimport { useHeaderSlotReserve } from '../components/display/platform_modal_header_buttons'\nimport BlankState from '../components/primitive/blank_state_primitive'\nimport { ConversationContextProvider } from '../contexts/conversation_context'\nimport { useTheme } from '../hooks'\nimport { useMessageAvailableMembersAction } from '../hooks/direct_messages/use_message_available_members_action'\nimport { useConversation } from '../hooks/use_conversation'\nimport { useConversationJoltEvents } from '../hooks/use_conversation_jolt_events'\nimport { useConversationMessages } from '../hooks/use_conversation_messages'\nimport { useConversationMessagesJoltEvents } from '../hooks/use_conversation_messages_jolt_events'\nimport { useMarkLatestMessageRead } from '../hooks/use_mark_latest_message_read'\nimport {\n analyticsEvents,\n normalizeAnalyticsMetadata,\n usePublishProductAnalyticsEvent,\n} from '../hooks/use_product_analytics'\nimport { useVideoModerationJoltEvents } from '../hooks/use_video_moderation_jolt_events'\nimport { ConversationResource } from '../types/resources/conversation'\nimport { ConversationBadgeResource } from '../types/resources/conversation_badge'\nimport { MessageResource } from '../types/resources/message'\nimport { getRelativeDateStatus } from '../utils/date'\nimport { groupMessages, type DateSeparator } from '../utils/group_messages'\nimport { isLiquidGlassEnabled } from '../utils/liquid_glass'\nimport { CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL } from '../utils/styles'\nimport { isSystemMessage } from '../utils/system_messages'\n\nexport type ConversationRouteProps = {\n conversation_id: number\n reply_root_id?: string | null\n reply_root_author_name?: string\n chat_group_graph_id?: string\n clear_input?: boolean\n editing_message_id?: number | null\n title?: string\n subtitle?: string\n badge?: ConversationBadgeResource\n deleted?: boolean\n muted?: boolean\n}\n\nexport type ConversationScreenProps = StaticScreenProps<ConversationRouteProps>\n\nexport function ConversationScreen({ route }: ConversationScreenProps) {\n const { conversation_id, reply_root_id } = route.params\n\n const { data: conversation } = useConversation({ conversation_id })\n\n usePublishProductAnalyticsEvent(analyticsEvents.conversation_show_opened, {\n reply_root_id,\n ...normalizeAnalyticsMetadata(conversation),\n })\n\n return (\n <ConversationContextProvider\n conversationId={conversation_id}\n currentPageReplyRootId={reply_root_id ?? null}\n >\n <ConversationScreenContent route={route} />\n </ConversationContextProvider>\n )\n}\n\nfunction ConversationScreenContent({ route }: ConversationScreenProps) {\n const styles = useStyles()\n const navigation = useNavigation()\n const { conversation_id, editing_message_id, reply_root_id, reply_root_author_name } =\n route.params\n const { data: conversation } = useConversation(route.params)\n const { messages, fetchNextPage, hasNextPage } = useConversationMessages({\n conversation_id,\n reply_root_id,\n })\n useConversationJoltEvents({ conversationId: conversation_id })\n useConversationMessagesJoltEvents({ conversationId: conversation_id })\n const { markHandledByMessageForm } = useVideoModerationJoltEvents()\n useEnsureConversationsRouteExists()\n useMarkLatestMessageRead({ conversation, messages })\n const messagesWithSeparators = groupMessages({\n ms: messages,\n inReplyScreen: !!reply_root_id,\n })\n const noMessages = messagesWithSeparators.length === 0\n\n const { repliesDisabled, memberAbility, badges, title } = conversation\n const canReply = memberAbility?.canReply\n const showLeaderDisabledReplyBanner = canReply && repliesDisabled\n const canDeleteNonAuthoredMessages = memberAbility?.canDeleteNonAuthoredMessages ?? false\n const currentlyEditingMessage = messages.find(m => String(m.id) === String(editing_message_id))\n const replyRootAuthorFirstName = reply_root_author_name?.split(' ')[0]\n const replyHeaderTitle = replyRootAuthorFirstName\n ? `Reply to ${replyRootAuthorFirstName}`\n : 'Reply'\n // Prefer the membership for optimistic updates.\n const muted = conversation.conversationMembership?.muted ?? conversation.muted\n\n const listRef = useRef<FlatList>(null)\n const [showJumpToBottomButton, setShowJumpToBottomButton] = useState(false)\n\n const trackScroll = (event: any) => {\n const offsetY = event.nativeEvent.contentOffset.y\n setShowJumpToBottomButton(offsetY > 200)\n }\n\n const handleReturnToBottom = useCallback(() => {\n listRef.current?.scrollToOffset({\n offset: 0,\n })\n }, [])\n\n useEffect(() => {\n if (reply_root_id) {\n navigation.setParams({\n title: replyHeaderTitle,\n })\n } else {\n navigation.setParams({\n title: title,\n badge: badges?.[0],\n deleted: conversation?.deleted,\n muted,\n })\n }\n }, [navigation, title, badges, conversation?.deleted, reply_root_id, replyHeaderTitle, muted])\n\n if (!conversation || conversation.deleted) {\n return (\n <View style={styles.container}>\n <BlankState.Root>\n <BlankState.Imagery name=\"general.outlinedTextMessage\" />\n <BlankState.Content>\n <BlankState.Heading>This conversation has been deleted</BlankState.Heading>\n </BlankState.Content>\n <BlankState.Button\n onPress={navigation.goBack}\n title=\"Back to conversations\"\n accessibilityHint=\"Navigates back to the conversations list\"\n accessibilityRole=\"link\"\n />\n </BlankState.Root>\n </View>\n )\n }\n\n return (\n <View style={styles.container}>\n <KeyboardView>\n {noMessages ? (\n <View style={styles.emptyState}>\n <ConversationStartBanner conversation={conversation} hasMessages={false} />\n </View>\n ) : (\n <FlatList\n inverted\n ref={listRef}\n contentContainerStyle={styles.listContainer}\n data={messagesWithSeparators}\n keyExtractor={item => item.id}\n onScroll={trackScroll}\n scrollEventThrottle={10}\n ListFooterComponent={\n hasNextPage ? null : (\n <ConversationStartBanner conversation={conversation} hasMessages={true} />\n )\n }\n renderItem={({ item }) => {\n if (item.type === 'DateSeparator') {\n return <InlineDateSeparator {...item} />\n }\n\n if (item.type === 'ReplyShadowMessage') {\n return (\n <ReplyShadowMessage\n {...(item as any)}\n conversation_id={conversation_id}\n inReplyScreen={!!reply_root_id}\n />\n )\n }\n\n if (isSystemMessage(item)) {\n return <SystemMessage message={item} conversationId={conversation_id} />\n }\n\n return (\n <Message\n {...item}\n canDeleteNonAuthoredMessages={canDeleteNonAuthoredMessages}\n conversation_id={conversation_id}\n latestReadMessageSortKey={conversation?.latestReadMessageSortKey}\n inReplyScreen={!!reply_root_id}\n />\n )\n }}\n onEndReached={() => fetchNextPage()}\n ListHeaderComponent={<View style={styles.listHeader} />}\n />\n )}\n <JumpToBottomButton onPress={handleReturnToBottom} visible={showJumpToBottomButton} />\n {!noMessages && <TypingIndicator />}\n {showLeaderDisabledReplyBanner && <LeaderMessagesDisabledBanner />}\n <ConversationBottomBar\n conversation={conversation}\n canReply={canReply}\n replyRootAuthorFirstName={replyRootAuthorFirstName}\n replyRootId={reply_root_id}\n currentlyEditingMessage={currentlyEditingMessage}\n onFlaggedInMessageForm={markHandledByMessageForm}\n />\n </KeyboardView>\n </View>\n )\n}\n\ninterface ConversationBottomBarProps {\n conversation: ConversationResource\n canReply: boolean | undefined\n replyRootAuthorFirstName: string | undefined\n replyRootId: string | null | undefined\n currentlyEditingMessage: MessageResource | undefined\n onFlaggedInMessageForm?: (id: string) => void\n}\n\nfunction ConversationBottomBar({\n conversation,\n canReply,\n replyRootAuthorFirstName,\n replyRootId,\n currentlyEditingMessage,\n onFlaggedInMessageForm,\n}: ConversationBottomBarProps) {\n const messageLink = useMessageAvailableMembersAction(conversation)\n\n if (conversation.disabled)\n return (\n <ConversationDisabledBanner\n disabledReason={conversation.disabledReason}\n messageLink={messageLink}\n />\n )\n if (!canReply) return <MemberMessagesDisabledBanner />\n return (\n <MessageForm.Root\n replyRootAuthorFirstName={replyRootAuthorFirstName}\n conversation={conversation}\n replyRootId={replyRootId}\n currentlyEditingMessage={currentlyEditingMessage}\n onFlaggedInMessageForm={onFlaggedInMessageForm}\n key={\n currentlyEditingMessage\n ? `edit-message-form-${currentlyEditingMessage.id}`\n : 'new-message-form'\n }\n >\n <MessageForm.AttachmentPicker />\n <MessageForm.Commands />\n <MessageForm.TextInput />\n <MessageForm.SubmitButton />\n </MessageForm.Root>\n )\n}\n\nfunction InlineDateSeparator({ date }: DateSeparator) {\n const styles = useDateSeparatorStyles()\n const { isThisYear } = getRelativeDateStatus(date)\n const showYear = !isThisYear\n const dateStamp = formatDate(date, { style: 'long', year: showYear })\n\n return (\n <View style={styles.container}>\n <View style={styles.separator} />\n <Text variant=\"footnote\" style={styles.dateText}>\n {dateStamp}\n </Text>\n <View style={styles.separator} />\n </View>\n )\n}\n\nconst useDateSeparatorStyles = () => {\n const theme = useTheme()\n return StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n paddingHorizontal: CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n paddingVertical: 16,\n },\n separator: {\n flex: 1,\n height: 1,\n borderTopWidth: 1,\n borderTopColor: theme.colors.borderColorDefaultBase,\n },\n dateText: {\n paddingHorizontal: 8,\n },\n })\n}\n\ninterface ConversationScreenTitleProps extends HeaderTitleProps {\n conversation_id: number\n badge?: ConversationBadgeResource\n deleted?: boolean\n muted?: boolean\n}\n\nexport const ConversationScreenTitle = ({\n conversation_id,\n badge,\n children,\n style,\n deleted,\n muted,\n}: ConversationScreenTitleProps) => {\n const styles = usePressableHeaderStyle()\n const navigation = useNavigation()\n const resourceType = badge?.pcoResourceType || ''\n const productName = badge?.appName\n const name = badge?.text || undefined\n\n return (\n <PlatformPressable\n accessibilityHint=\"Opens details about members and settings\"\n style={styles.container}\n onPress={() => {\n if (deleted) return\n\n navigation.navigate('ConversationDetails', { conversation_id })\n }}\n >\n <View style={styles.titleWrapper}>\n <View style={styles.titleTextContainer}>\n <HeaderTitle maxFontSizeMultiplier={1} style={style}>\n {children}\n </HeaderTitle>\n </View>\n {muted && <Icon name=\"general.bellMuted\" size={12} />}\n {!deleted && <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 maxFontSizeMultiplier={1}\n />\n </PlatformPressable>\n )\n}\n\nconst usePressableHeaderStyle = () => {\n const { width } = useWindowDimensions()\n const slotReserve = useHeaderSlotReserve()\n const headerContainerStyle = isLiquidGlassEnabled()\n ? { maxWidth: width - slotReserve * 2 }\n : { marginRight: Platform.select({ default: 20, android: 16 }) }\n\n return StyleSheet.create({\n container: {\n alignItems: Platform.select({ android: 'flex-start', default: 'center' }),\n flex: 1,\n ...headerContainerStyle,\n },\n titleWrapper: {\n alignItems: 'center',\n columnGap: 4,\n flexDirection: 'row',\n flexShrink: 1,\n },\n titleTextContainer: {\n flexShrink: 1,\n minWidth: 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 emptyState: {\n flex: 1,\n justifyContent: 'center',\n },\n listContainer: {\n paddingVertical: 12,\n },\n listHeader: {\n // Just whitespace to provide space where the typing indicator can be\n height: 16,\n },\n })\n}\n\n/**\n * useEnsureConversationsRouteExists\n */\nconst useEnsureConversationsRouteExists = () => {\n const navigation = useNavigation()\n const { params } = useRoute<RouteProp<ConversationScreenProps['route']>>()\n\n useEffect(() => {\n const navigationState = navigation.getState()\n const routes = navigationState?.routes || []\n const conversationsRoute = routes.find(r => r.name === 'Conversations')\n\n if (conversationsRoute) return\n\n navigation.dispatch(state => {\n return CommonActions.reset({\n ...state,\n routes: [\n { name: 'Conversations', params: { chat_group_graph_id: params?.chat_group_graph_id } },\n ...routes,\n ],\n index: state.index + 1,\n })\n })\n }, [navigation, params?.chat_group_graph_id])\n}\n"]}
|
|
1
|
+
{"version":3,"file":"conversation_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_screen.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,EAAE,WAAW,EAAoB,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC7F,OAAO,EACL,aAAa,EAGb,aAAa,EACb,QAAQ,IAAI,kBAAkB,EAC9B,QAAQ,GACT,MAAM,0BAA0B,CAAA;AACjC,OAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACvE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAA;AAClE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAA;AAC9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,kDAAkD,CAAA;AACrF,OAAO,EAAE,OAAO,EAAE,MAAM,oCAAoC,CAAA;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAA;AACrE,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,sDAAsD,CAAA;AAC7D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iDAAiD,CAAA;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAA;AACzE,OAAO,EAAE,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CAAA;AACJ,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,iCAAiC,GAAG,GAAG,EAAE;IAC7C,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAA+C,CAAA;IAE1E,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,eAAe,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAA;QAC7C,MAAM,MAAM,GAAG,eAAe,EAAE,MAAM,IAAI,EAAE,CAAA;QAC5C,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,eAAe,CAAC,CAAA;QAEvE,IAAI,kBAAkB;YAAE,OAAM;QAE9B,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;YAC1B,OAAO,aAAa,CAAC,KAAK,CAAC;gBACzB,GAAG,KAAK;gBACR,MAAM,EAAE;oBACN,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE,mBAAmB,EAAE,EAAE;oBACvF,GAAG,MAAM;iBACV;gBACD,KAAK,EAAE,KAAK,CAAC,KAAK,GAAG,CAAC;aACvB,CAAC,CAAA;QACJ,CAAC,CAAC,CAAA;IACJ,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAA;AAC/C,CAAC,CAAA","sourcesContent":["import { date as formatDate } from '@planningcenter/datetime-fmt'\nimport { HeaderTitle, HeaderTitleProps, PlatformPressable } from '@react-navigation/elements'\nimport {\n CommonActions,\n RouteProp,\n StaticScreenProps,\n useNavigation,\n useTheme as useNavigationTheme,\n useRoute,\n} from '@react-navigation/native'\nimport React, { useCallback, useEffect, useRef, useState } from 'react'\nimport { FlatList, Platform, StyleSheet, useWindowDimensions, View } from 'react-native'\nimport { useSafeAreaInsets } from 'react-native-safe-area-context'\nimport { Badge, Icon, Text } from '../components'\nimport { ConversationStartBanner } from '../components/conversation/conversation_start_banner'\nimport { JumpToBottomButton } from '../components/conversation/jump_to_bottom_button'\nimport { Message } from '../components/conversation/message'\nimport { MessageForm } from '../components/conversation/message_form'\nimport {\n ConversationDisabledBanner,\n LeaderMessagesDisabledBanner,\n MemberMessagesDisabledBanner,\n} from '../components/conversation/messages_disabled_banners'\nimport { ReplyShadowMessage } from '../components/conversation/reply_shadow_message'\nimport { SystemMessage } from '../components/conversation/system_message'\nimport { TypingIndicator } from '../components/conversation/typing_indicator'\nimport { KeyboardView } from '../components/display/keyboard_view'\nimport { useHeaderSlotReserve } from '../components/display/platform_modal_header_buttons'\nimport BlankState from '../components/primitive/blank_state_primitive'\nimport { ConversationContextProvider } from '../contexts/conversation_context'\nimport { useTheme } from '../hooks'\nimport { useMessageAvailableMembersAction } from '../hooks/direct_messages/use_message_available_members_action'\nimport { useConversation } from '../hooks/use_conversation'\nimport { useConversationJoltEvents } from '../hooks/use_conversation_jolt_events'\nimport { useConversationMessages } from '../hooks/use_conversation_messages'\nimport { useConversationMessagesJoltEvents } from '../hooks/use_conversation_messages_jolt_events'\nimport { useMarkLatestMessageRead } from '../hooks/use_mark_latest_message_read'\nimport {\n analyticsEvents,\n normalizeAnalyticsMetadata,\n usePublishProductAnalyticsEvent,\n} from '../hooks/use_product_analytics'\nimport { useVideoModerationJoltEvents } from '../hooks/use_video_moderation_jolt_events'\nimport { ConversationResource } from '../types/resources/conversation'\nimport { ConversationBadgeResource } from '../types/resources/conversation_badge'\nimport { MessageResource } from '../types/resources/message'\nimport { getRelativeDateStatus } from '../utils/date'\nimport { groupMessages, type DateSeparator } from '../utils/group_messages'\nimport { isLiquidGlassEnabled } from '../utils/liquid_glass'\nimport { CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL } from '../utils/styles'\nimport { isSystemMessage } from '../utils/system_messages'\n\nexport type ConversationRouteProps = {\n conversation_id: number\n reply_root_id?: string | null\n reply_root_author_name?: string\n chat_group_graph_id?: string\n clear_input?: boolean\n editing_message_id?: number | null\n title?: string\n subtitle?: string\n badge?: ConversationBadgeResource\n deleted?: boolean\n muted?: boolean\n}\n\nexport type ConversationScreenProps = StaticScreenProps<ConversationRouteProps>\n\nexport function ConversationScreen({ route }: ConversationScreenProps) {\n const { conversation_id, reply_root_id } = route.params\n\n const { data: conversation } = useConversation({ conversation_id })\n\n usePublishProductAnalyticsEvent(analyticsEvents.conversation_show_opened, {\n reply_root_id,\n ...normalizeAnalyticsMetadata(conversation),\n })\n\n return (\n <ConversationContextProvider\n conversationId={conversation_id}\n currentPageReplyRootId={reply_root_id ?? null}\n >\n <ConversationScreenContent route={route} />\n </ConversationContextProvider>\n )\n}\n\nfunction ConversationScreenContent({ route }: ConversationScreenProps) {\n const styles = useStyles()\n const navigation = useNavigation()\n const { conversation_id, editing_message_id, reply_root_id, reply_root_author_name } =\n route.params\n const { data: conversation } = useConversation(route.params)\n const { messages, fetchNextPage, hasNextPage } = useConversationMessages({\n conversation_id,\n reply_root_id,\n })\n useConversationJoltEvents({ conversationId: conversation_id })\n useConversationMessagesJoltEvents({ conversationId: conversation_id })\n const { markHandledByMessageForm } = useVideoModerationJoltEvents()\n useEnsureConversationsRouteExists()\n useMarkLatestMessageRead({ conversation, messages })\n const messagesWithSeparators = groupMessages({\n ms: messages,\n inReplyScreen: !!reply_root_id,\n })\n const noMessages = messagesWithSeparators.length === 0\n\n const { repliesDisabled, memberAbility, badges, title } = conversation\n const canReply = memberAbility?.canReply\n const showLeaderDisabledReplyBanner = canReply && repliesDisabled\n const canDeleteNonAuthoredMessages = memberAbility?.canDeleteNonAuthoredMessages ?? false\n const currentlyEditingMessage = messages.find(m => String(m.id) === String(editing_message_id))\n const replyRootAuthorFirstName = reply_root_author_name?.split(' ')[0]\n const replyHeaderTitle = replyRootAuthorFirstName\n ? `Reply to ${replyRootAuthorFirstName}`\n : 'Reply'\n // Prefer the membership for optimistic updates.\n const muted = conversation.conversationMembership?.muted ?? conversation.muted\n\n const listRef = useRef<FlatList>(null)\n const [showJumpToBottomButton, setShowJumpToBottomButton] = useState(false)\n\n const trackScroll = (event: any) => {\n const offsetY = event.nativeEvent.contentOffset.y\n setShowJumpToBottomButton(offsetY > 200)\n }\n\n const handleReturnToBottom = useCallback(() => {\n listRef.current?.scrollToOffset({\n offset: 0,\n })\n }, [])\n\n useEffect(() => {\n if (reply_root_id) {\n navigation.setParams({\n title: replyHeaderTitle,\n })\n } else {\n navigation.setParams({\n title: title,\n badge: badges?.[0],\n deleted: conversation?.deleted,\n muted,\n })\n }\n }, [navigation, title, badges, conversation?.deleted, reply_root_id, replyHeaderTitle, muted])\n\n if (!conversation || conversation.deleted) {\n return (\n <View style={styles.container}>\n <BlankState.Root>\n <BlankState.Imagery name=\"general.outlinedTextMessage\" />\n <BlankState.Content>\n <BlankState.Heading>This conversation has been deleted</BlankState.Heading>\n </BlankState.Content>\n <BlankState.Button\n onPress={navigation.goBack}\n title=\"Back to conversations\"\n accessibilityHint=\"Navigates back to the conversations list\"\n accessibilityRole=\"link\"\n />\n </BlankState.Root>\n </View>\n )\n }\n\n return (\n <View style={styles.container}>\n <KeyboardView>\n {noMessages ? (\n <View style={styles.emptyState}>\n <ConversationStartBanner conversation={conversation} hasMessages={false} />\n </View>\n ) : (\n <FlatList\n inverted\n ref={listRef}\n contentContainerStyle={styles.listContainer}\n data={messagesWithSeparators}\n keyExtractor={item => item.id}\n onScroll={trackScroll}\n scrollEventThrottle={10}\n ListFooterComponent={\n hasNextPage ? null : (\n <ConversationStartBanner conversation={conversation} hasMessages={true} />\n )\n }\n renderItem={({ item }) => {\n if (item.type === 'DateSeparator') {\n return <InlineDateSeparator {...item} />\n }\n\n if (item.type === 'ReplyShadowMessage') {\n return (\n <ReplyShadowMessage\n {...(item as any)}\n conversation_id={conversation_id}\n inReplyScreen={!!reply_root_id}\n />\n )\n }\n\n if (isSystemMessage(item)) {\n return <SystemMessage message={item} conversationId={conversation_id} />\n }\n\n return (\n <Message\n {...item}\n canDeleteNonAuthoredMessages={canDeleteNonAuthoredMessages}\n conversation_id={conversation_id}\n latestReadMessageSortKey={conversation?.latestReadMessageSortKey}\n inReplyScreen={!!reply_root_id}\n />\n )\n }}\n onEndReached={() => fetchNextPage()}\n ListHeaderComponent={<View style={styles.listHeader} />}\n />\n )}\n <JumpToBottomButton onPress={handleReturnToBottom} visible={showJumpToBottomButton} />\n {!noMessages && <TypingIndicator />}\n {showLeaderDisabledReplyBanner && <LeaderMessagesDisabledBanner />}\n <ConversationBottomBar\n conversation={conversation}\n canReply={canReply}\n replyRootAuthorFirstName={replyRootAuthorFirstName}\n replyRootId={reply_root_id}\n currentlyEditingMessage={currentlyEditingMessage}\n onFlaggedInMessageForm={markHandledByMessageForm}\n />\n </KeyboardView>\n </View>\n )\n}\n\ninterface ConversationBottomBarProps {\n conversation: ConversationResource\n canReply: boolean | undefined\n replyRootAuthorFirstName: string | undefined\n replyRootId: string | null | undefined\n currentlyEditingMessage: MessageResource | undefined\n onFlaggedInMessageForm?: (id: string) => void\n}\n\nfunction ConversationBottomBar({\n conversation,\n canReply,\n replyRootAuthorFirstName,\n replyRootId,\n currentlyEditingMessage,\n onFlaggedInMessageForm,\n}: ConversationBottomBarProps) {\n const messageLink = useMessageAvailableMembersAction(conversation)\n\n if (conversation.disabled)\n return (\n <ConversationDisabledBanner\n message={conversation.disabledMessage ?? null}\n messageLink={messageLink}\n />\n )\n if (!canReply) return <MemberMessagesDisabledBanner />\n return (\n <MessageForm.Root\n replyRootAuthorFirstName={replyRootAuthorFirstName}\n conversation={conversation}\n replyRootId={replyRootId}\n currentlyEditingMessage={currentlyEditingMessage}\n onFlaggedInMessageForm={onFlaggedInMessageForm}\n key={\n currentlyEditingMessage\n ? `edit-message-form-${currentlyEditingMessage.id}`\n : 'new-message-form'\n }\n >\n <MessageForm.AttachmentPicker />\n <MessageForm.Commands />\n <MessageForm.TextInput />\n <MessageForm.SubmitButton />\n </MessageForm.Root>\n )\n}\n\nfunction InlineDateSeparator({ date }: DateSeparator) {\n const styles = useDateSeparatorStyles()\n const { isThisYear } = getRelativeDateStatus(date)\n const showYear = !isThisYear\n const dateStamp = formatDate(date, { style: 'long', year: showYear })\n\n return (\n <View style={styles.container}>\n <View style={styles.separator} />\n <Text variant=\"footnote\" style={styles.dateText}>\n {dateStamp}\n </Text>\n <View style={styles.separator} />\n </View>\n )\n}\n\nconst useDateSeparatorStyles = () => {\n const theme = useTheme()\n return StyleSheet.create({\n container: {\n alignItems: 'center',\n flexDirection: 'row',\n paddingHorizontal: CONVERSATION_MESSAGE_LIST_PADDING_HORIZONTAL,\n paddingVertical: 16,\n },\n separator: {\n flex: 1,\n height: 1,\n borderTopWidth: 1,\n borderTopColor: theme.colors.borderColorDefaultBase,\n },\n dateText: {\n paddingHorizontal: 8,\n },\n })\n}\n\ninterface ConversationScreenTitleProps extends HeaderTitleProps {\n conversation_id: number\n badge?: ConversationBadgeResource\n deleted?: boolean\n muted?: boolean\n}\n\nexport const ConversationScreenTitle = ({\n conversation_id,\n badge,\n children,\n style,\n deleted,\n muted,\n}: ConversationScreenTitleProps) => {\n const styles = usePressableHeaderStyle()\n const navigation = useNavigation()\n const resourceType = badge?.pcoResourceType || ''\n const productName = badge?.appName\n const name = badge?.text || undefined\n\n return (\n <PlatformPressable\n accessibilityHint=\"Opens details about members and settings\"\n style={styles.container}\n onPress={() => {\n if (deleted) return\n\n navigation.navigate('ConversationDetails', { conversation_id })\n }}\n >\n <View style={styles.titleWrapper}>\n <View style={styles.titleTextContainer}>\n <HeaderTitle maxFontSizeMultiplier={1} style={style}>\n {children}\n </HeaderTitle>\n </View>\n {muted && <Icon name=\"general.bellMuted\" size={12} />}\n {!deleted && <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 maxFontSizeMultiplier={1}\n />\n </PlatformPressable>\n )\n}\n\nconst usePressableHeaderStyle = () => {\n const { width } = useWindowDimensions()\n const slotReserve = useHeaderSlotReserve()\n const headerContainerStyle = isLiquidGlassEnabled()\n ? { maxWidth: width - slotReserve * 2 }\n : { marginRight: Platform.select({ default: 20, android: 16 }) }\n\n return StyleSheet.create({\n container: {\n alignItems: Platform.select({ android: 'flex-start', default: 'center' }),\n flex: 1,\n ...headerContainerStyle,\n },\n titleWrapper: {\n alignItems: 'center',\n columnGap: 4,\n flexDirection: 'row',\n flexShrink: 1,\n },\n titleTextContainer: {\n flexShrink: 1,\n minWidth: 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 emptyState: {\n flex: 1,\n justifyContent: 'center',\n },\n listContainer: {\n paddingVertical: 12,\n },\n listHeader: {\n // Just whitespace to provide space where the typing indicator can be\n height: 16,\n },\n })\n}\n\n/**\n * useEnsureConversationsRouteExists\n */\nconst useEnsureConversationsRouteExists = () => {\n const navigation = useNavigation()\n const { params } = useRoute<RouteProp<ConversationScreenProps['route']>>()\n\n useEffect(() => {\n const navigationState = navigation.getState()\n const routes = navigationState?.routes || []\n const conversationsRoute = routes.find(r => r.name === 'Conversations')\n\n if (conversationsRoute) return\n\n navigation.dispatch(state => {\n return CommonActions.reset({\n ...state,\n routes: [\n { name: 'Conversations', params: { chat_group_graph_id: params?.chat_group_graph_id } },\n ...routes,\n ],\n index: state.index + 1,\n })\n })\n }, [navigation, params?.chat_group_graph_id])\n}\n"]}
|
|
@@ -3,6 +3,6 @@ import { pluralize } from '../../../utils';
|
|
|
3
3
|
import { RecipientLinkRow } from './recipient_link_row';
|
|
4
4
|
export const GroupsRecipientRow = ({ group, onPress }) => {
|
|
5
5
|
const groupAccessibilityLabel = `Select ${group.name} with ${pluralize(group.membershipsCount, 'member')}`;
|
|
6
|
-
return (_jsx(RecipientLinkRow, { imageUri: group.headerImage?.
|
|
6
|
+
return (_jsx(RecipientLinkRow, { imageUri: group.headerImage?.medium, title: group.name, subtitle: `${group.membershipsCount} members`, onPress: () => onPress(group), accessibilityLabel: groupAccessibilityLabel, accessibilityHint: `Selects group as recipient and navigates to the final screen to finish creating the conversation` }));
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=groups_recipient_row.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"groups_recipient_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/groups_recipient_row.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAOvD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAA2B,EAAE,EAAE;IAChF,MAAM,uBAAuB,GAAG,UAAU,KAAK,CAAC,IAAI,SAAS,SAAS,CAAC,KAAK,CAAC,gBAAgB,EAAE,QAAQ,CAAC,EAAE,CAAA;IAE1G,OAAO,CACL,KAAC,gBAAgB,IACf,QAAQ,EAAE,KAAK,CAAC,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"groups_recipient_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/groups_recipient_row.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAOvD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAAE,OAAO,EAA2B,EAAE,EAAE;IAChF,MAAM,uBAAuB,GAAG,UAAU,KAAK,CAAC,IAAI,SAAS,SAAS,CAAC,KAAK,CAAC,gBAAgB,EAAE,QAAQ,CAAC,EAAE,CAAA;IAE1G,OAAO,CACL,KAAC,gBAAgB,IACf,QAAQ,EAAE,KAAK,CAAC,WAAW,EAAE,MAAM,EACnC,KAAK,EAAE,KAAK,CAAC,IAAI,EACjB,QAAQ,EAAE,GAAG,KAAK,CAAC,gBAAgB,UAAU,EAC7C,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAC7B,kBAAkB,EAAE,uBAAuB,EAC3C,iBAAiB,EAAE,kGAAkG,GACrH,CACH,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { GroupsGroupResource } from '../../../types'\nimport { pluralize } from '../../../utils'\nimport { RecipientLinkRow } from './recipient_link_row'\n\ninterface GroupsRecipientRowProps {\n group: GroupsGroupResource\n onPress: (group: GroupsGroupResource) => void\n}\n\nexport const GroupsRecipientRow = ({ group, onPress }: GroupsRecipientRowProps) => {\n const groupAccessibilityLabel = `Select ${group.name} with ${pluralize(group.membershipsCount, 'member')}`\n\n return (\n <RecipientLinkRow\n imageUri={group.headerImage?.medium}\n title={group.name}\n subtitle={`${group.membershipsCount} members`}\n onPress={() => onPress(group)}\n accessibilityLabel={groupAccessibilityLabel}\n accessibilityHint={`Selects group as recipient and navigates to the final screen to finish creating the conversation`}\n />\n )\n}\n"]}
|
|
@@ -15,7 +15,7 @@ function reasonText(reasonCode) {
|
|
|
15
15
|
}
|
|
16
16
|
export const RestrictedGroupRow = ({ group }) => {
|
|
17
17
|
const styles = useStyles();
|
|
18
|
-
return (_jsx(View, { style: styles.row, accessibilityLabel: `${group.name} — ${reasonText(group.canCreateConversationReasonCode)}`, children: _jsxs(View, { style: styles.innerContainer, children: [group.headerImage?.
|
|
18
|
+
return (_jsx(View, { style: styles.row, accessibilityLabel: `${group.name} — ${reasonText(group.canCreateConversationReasonCode)}`, children: _jsxs(View, { style: styles.innerContainer, children: [group.headerImage?.medium && (_jsx(Image, { source: { uri: group.headerImage.medium }, resizeMode: "cover", style: styles.image, alt: "" })), _jsxs(View, { style: styles.content, children: [_jsx(Text, { style: styles.title, numberOfLines: 2, children: group.name }), _jsx(Text, { variant: "tertiary", numberOfLines: 1, children: reasonText(group.canCreateConversationReasonCode) })] })] }) }));
|
|
19
19
|
};
|
|
20
20
|
const ASPECT_RATIO = 16 / 9;
|
|
21
21
|
const THUMBNAIL_WIDTH = 80;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"restricted_group_row.js","sourceRoot":"","sources":["../../../../src/screens/conversation_select_recipients/components/restricted_group_row.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAMzD,MAAM,cAAc,GAAG,oCAAoC,CAAA;AAC3D,MAAM,mBAAmB,GAA2B;IAClD,YAAY,EAAE,sCAAsC;IACpD,aAAa,EAAE,cAAc;CAC9B,CAAA;AAED,SAAS,UAAU,CAAC,UAAyB;IAC3C,IAAI,CAAC,UAAU;QAAE,OAAO,cAAc,CAAA;IACtC,OAAO,mBAAmB,CAAC,UAAU,CAAC,IAAI,cAAc,CAAA;AAC1D,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,EAAE,KAAK,EAA2B,EAAE,EAAE;IACvE,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;IAE1B,OAAO,CACL,KAAC,IAAI,IACH,KAAK,EAAE,MAAM,CAAC,GAAG,EACjB,kBAAkB,EAAE,GAAG,KAAK,CAAC,IAAI,MAAM,UAAU,CAAC,KAAK,CAAC,+BAA+B,CAAC,EAAE,YAE1F,MAAC,IAAI,IAAC,KAAK,EAAE,MAAM,CAAC,cAAc,aAC/B,KAAK,CAAC,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"restricted_group_row.js","sourceRoot":"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KAAK,EAAE,aAAa,EAAE,CAAC,YACxC,KAAK,CAAC,IAAI,GACN,EACP,KAAC,IAAI,IAAC,OAAO,EAAC,UAAU,EAAC,aAAa,EAAE,CAAC,YACtC,UAAU,CAAC,KAAK,CAAC,+BAA+B,CAAC,GAC7C,IACF,IACF,GACF,CACR,CAAA;AACH,CAAC,CAAA;AAED,MAAM,YAAY,GAAG,EAAE,GAAG,CAAC,CAAA;AAC3B,MAAM,eAAe,GAAG,EAAE,CAAA;AAC1B,MAAM,gBAAgB,GAAG,eAAe,GAAG,YAAY,CAAA;AAEvD,MAAM,SAAS,GAAG,GAAG,EAAE;IACrB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAA;IAExB,OAAO,UAAU,CAAC,MAAM,CAAC;QACvB,GAAG,EAAE;YACH,WAAW,EAAE,EAAE;YACf,OAAO,EAAE,GAAG;SACb;QACD,cAAc,EAAE;YACd,aAAa,EAAE,KAAK;YACpB,UAAU,EAAE,QAAQ;YACpB,GAAG,EAAE,EAAE;YACP,eAAe,EAAE,EAAE;YACnB,YAAY,EAAE,EAAE;YAChB,iBAAiB,EAAE,CAAC;YACpB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,uBAAuB;SAClD;QACD,KAAK,EAAE;YACL,KAAK,EAAE,eAAe;YACtB,MAAM,EAAE,gBAAgB;YACxB,YAAY,EAAE,CAAC;SAChB;QACD,KAAK,EAAE;YACL,UAAU,EAAE,wBAAwB;YACpC,UAAU,EAAE,CAAC;SACd;QACD,OAAO,EAAE;YACP,UAAU,EAAE,CAAC;YACb,GAAG,EAAE,CAAC;SACP;KACF,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { StyleSheet, View } from 'react-native'\nimport { Image, Text } from '../../../components'\nimport { useTheme } from '../../../hooks'\nimport { GroupsGroupResource } from '../../../types'\nimport { platformFontWeightMedium } from '../../../utils'\n\ninterface RestrictedGroupRowProps {\n group: GroupsGroupResource\n}\n\nconst DEFAULT_REASON = 'Chat is not enabled for this group'\nconst REASON_DISPLAY_TEXT: Record<string, string> = {\n leaders_only: 'Only leaders can start conversations',\n chat_disabled: DEFAULT_REASON,\n}\n\nfunction reasonText(reasonCode: string | null): string {\n if (!reasonCode) return DEFAULT_REASON\n return REASON_DISPLAY_TEXT[reasonCode] || DEFAULT_REASON\n}\n\nexport const RestrictedGroupRow = ({ group }: RestrictedGroupRowProps) => {\n const styles = useStyles()\n\n return (\n <View\n style={styles.row}\n accessibilityLabel={`${group.name} — ${reasonText(group.canCreateConversationReasonCode)}`}\n >\n <View style={styles.innerContainer}>\n {group.headerImage?.medium && (\n <Image\n source={{ uri: group.headerImage.medium }}\n resizeMode=\"cover\"\n style={styles.image}\n alt=\"\"\n />\n )}\n <View style={styles.content}>\n <Text style={styles.title} numberOfLines={2}>\n {group.name}\n </Text>\n <Text variant=\"tertiary\" numberOfLines={1}>\n {reasonText(group.canCreateConversationReasonCode)}\n </Text>\n </View>\n </View>\n </View>\n )\n}\n\nconst ASPECT_RATIO = 16 / 9\nconst THUMBNAIL_WIDTH = 80\nconst THUMBNAIL_HEIGHT = THUMBNAIL_WIDTH / ASPECT_RATIO\n\nconst useStyles = () => {\n const theme = useTheme()\n\n return StyleSheet.create({\n row: {\n paddingLeft: 16,\n opacity: 0.5,\n },\n innerContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n gap: 12,\n paddingVertical: 16,\n paddingRight: 16,\n borderBottomWidth: 1,\n borderColor: theme.colors.fillColorNeutral050Base,\n },\n image: {\n width: THUMBNAIL_WIDTH,\n height: THUMBNAIL_HEIGHT,\n borderRadius: 4,\n },\n title: {\n fontWeight: platformFontWeightMedium,\n flexShrink: 1,\n },\n content: {\n flexShrink: 1,\n gap: 2,\n },\n })\n}\n"]}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { CustomMessage } from '@planningcenter/jolt-client/dist/types/JoltConnection';
|
|
2
|
-
import type { ConversationDisabledReason } from '../resources/conversation';
|
|
3
2
|
type DateString = string;
|
|
4
3
|
interface BaseConversationEventData extends Record<string, unknown> {
|
|
5
4
|
data: {
|
|
@@ -15,7 +14,8 @@ interface BaseConversationEventData extends Record<string, unknown> {
|
|
|
15
14
|
latest_read_message_sort_key?: string;
|
|
16
15
|
organization_id: number;
|
|
17
16
|
disabled: boolean;
|
|
18
|
-
disabled_reason
|
|
17
|
+
disabled_reason: string | null;
|
|
18
|
+
disabled_message: string | null;
|
|
19
19
|
replies_disabled: boolean;
|
|
20
20
|
subtitle?: string;
|
|
21
21
|
title: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_events.d.ts","sourceRoot":"","sources":["../../../src/types/jolt_events/conversation_events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAA;
|
|
1
|
+
{"version":3,"file":"conversation_events.d.ts","sourceRoot":"","sources":["../../../src/types/jolt_events/conversation_events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uDAAuD,CAAA;AAE1F,KAAK,UAAU,GAAG,MAAM,CAAA;AACxB,UAAU,yBAA0B,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACjE,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAA;QACV,WAAW,EAAE,UAAU,CAAA;QACvB,UAAU,EAAE,UAAU,CAAA;QACtB,sBAAsB,CAAC,EAAE,MAAM,CAAA;QAC/B,wBAAwB,CAAC,EAAE,MAAM,CAAA;QACjC,uBAAuB,CAAC,EAAE,UAAU,CAAA;QACpC,qBAAqB,CAAC,EAAE,MAAM,CAAA;QAC9B,2BAA2B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;QAC3C,yBAAyB,CAAC,EAAE,MAAM,CAAA;QAClC,4BAA4B,CAAC,EAAE,MAAM,CAAA;QACrC,eAAe,EAAE,MAAM,CAAA;QACvB,QAAQ,EAAE,OAAO,CAAA;QACjB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;QAC9B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;QAC/B,gBAAgB,EAAE,OAAO,CAAA;QACzB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,KAAK,EAAE,MAAM,CAAA;QACb,UAAU,EAAE,UAAU,CAAA;KACvB,CAAA;CACF;AAED,MAAM,WAAW,wBAAyB,SAAQ,aAAa;IAC7D,KAAK,EAAE,sBAAsB,CAAA;IAC7B,IAAI,EAAE,yBAAyB,CAAA;CAChC;AAED,MAAM,WAAW,wBAAyB,SAAQ,aAAa;IAC7D,KAAK,EAAE,sBAAsB,CAAA;IAC7B,IAAI,EAAE,yBAAyB,CAAA;CAChC;AAED,MAAM,WAAW,wBAAyB,SAAQ,aAAa;IAC7D,KAAK,EAAE,wBAAwB,CAAA;IAC/B,IAAI,EAAE,yBAAyB,CAAA;CAChC;AAED,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC1D,KAAK,EAAE,mBAAmB,CAAA;IAC1B,IAAI,EAAE,yBAAyB,CAAA;CAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_events.js","sourceRoot":"","sources":["../../../src/types/jolt_events/conversation_events.ts"],"names":[],"mappings":"","sourcesContent":["import type { CustomMessage } from '@planningcenter/jolt-client/dist/types/JoltConnection'\
|
|
1
|
+
{"version":3,"file":"conversation_events.js","sourceRoot":"","sources":["../../../src/types/jolt_events/conversation_events.ts"],"names":[],"mappings":"","sourcesContent":["import type { CustomMessage } from '@planningcenter/jolt-client/dist/types/JoltConnection'\n\ntype DateString = string\ninterface BaseConversationEventData extends Record<string, unknown> {\n data: {\n id: number\n archived_at: DateString\n created_at: DateString\n last_message_author_id?: number\n last_message_author_name?: string\n last_message_created_at?: DateString\n last_message_sort_key?: string\n last_message_idempotent_key?: string | null\n last_message_text_preview?: string\n latest_read_message_sort_key?: string\n organization_id: number\n disabled: boolean\n disabled_reason: string | null\n disabled_message: string | null\n replies_disabled: boolean\n subtitle?: string\n title: string\n updated_at: DateString\n }\n}\n\nexport interface ConversationCreatedEvent extends CustomMessage {\n event: 'conversation.created'\n data: BaseConversationEventData\n}\n\nexport interface ConversationUpdatedEvent extends CustomMessage {\n event: 'conversation.updated'\n data: BaseConversationEventData\n}\n\nexport interface ConversationDeletedEvent extends CustomMessage {\n event: 'conversation.destroyed'\n data: BaseConversationEventData\n}\n\nexport interface ConversationReadEvent extends CustomMessage {\n event: 'conversation.read'\n data: BaseConversationEventData\n}\n"]}
|
|
@@ -4,7 +4,6 @@ import { ConversationMembershipResource } from './conversation_membership';
|
|
|
4
4
|
import { GroupResource } from './group_resource';
|
|
5
5
|
import { MemberAbilityResource } from './member_ability';
|
|
6
6
|
import { ReactionCountResource } from './reaction';
|
|
7
|
-
export type ConversationDisabledReason = 'safety_check' | 'direct_messages_disabled';
|
|
8
7
|
export interface ConversationPreviewData {
|
|
9
8
|
kind: 'reaction' | 'message';
|
|
10
9
|
authorName: string;
|
|
@@ -23,7 +22,8 @@ export interface ConversationResource {
|
|
|
23
22
|
deleted?: boolean;
|
|
24
23
|
directMessage?: boolean;
|
|
25
24
|
disabled?: boolean;
|
|
26
|
-
disabledReason?:
|
|
25
|
+
disabledReason?: string | null;
|
|
26
|
+
disabledMessage?: string | null;
|
|
27
27
|
genderOption?: string | null;
|
|
28
28
|
groups?: GroupResource[];
|
|
29
29
|
previewAvatarUrls?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/types/resources/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,qBAAqB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I,CAAA;IAC/B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,MAAM,CAAC,EAAE,aAAa,EAAE,CAAA;IACxB,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAA;IAC5B,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;IACpD,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACjC,oBAAoB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC,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,wBAAwB,CAAC,EAAE,MAAM,CAAA;IACjC,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,cAAc,EAAE,OAAO,CAAA;IACvB,SAAS,EAAE,MAAM,CAAA;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../../src/types/resources/conversation.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnalyticsMetadataResource } from './analytics_metadata'\nimport { ConversationBadgeResource } from './conversation_badge'\nimport { ConversationMembershipResource } from './conversation_membership'\nimport { GroupResource } from './group_resource'\nimport { MemberAbilityResource } from './member_ability'\nimport { ReactionCountResource } from './reaction'\n\nexport
|
|
1
|
+
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../../src/types/resources/conversation.ts"],"names":[],"mappings":"","sourcesContent":["import type { AnalyticsMetadataResource } from './analytics_metadata'\nimport { ConversationBadgeResource } from './conversation_badge'\nimport { ConversationMembershipResource } from './conversation_membership'\nimport { GroupResource } from './group_resource'\nimport { MemberAbilityResource } from './member_ability'\nimport { ReactionCountResource } from './reaction'\n\nexport interface ConversationPreviewData {\n kind: 'reaction' | 'message'\n authorName: string\n value: ReactionCountResource['value'] | null\n text: string\n createdAt: string\n}\n\nexport interface ConversationResource {\n type: 'Conversation'\n id: number\n badges?: ConversationBadgeResource[]\n analyticsMetadata?: AnalyticsMetadataResource\n conversationMembership?: Partial<ConversationMembershipResource>\n conversationPreview: ConversationPreviewData | null\n createdAt: string\n deleted?: boolean\n directMessage?: boolean\n disabled?: boolean\n disabledReason?: string | null\n disabledMessage?: string | null\n genderOption?: string | null\n groups?: GroupResource[]\n previewAvatarUrls?: string[]\n customAvatarType?: 'image' | 'icon' | 'emoji' | null\n customAvatarKey?: string | null\n customAvatarColor?: string | null\n customAvatarImageUrl?: string | null\n lastMessageAuthorId?: string\n lastMessageAuthorName?: string\n lastMessageCreatedAt?: string\n lastMessageTextPreview?: string\n latestReadMessageSortKey?: string\n memberAbility?: MemberAbilityResource\n muted: boolean\n repliesDisabled: boolean\n title: string\n unreadCount: number\n unreadReaction: boolean\n updatedAt: string\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const ADULT_REQUIREMENT_BODY = "Conversations with
|
|
1
|
+
export declare const ADULT_REQUIREMENT_BODY = "Conversations with minors require at least two adults. This chat is paused until more adults are added.";
|
|
2
2
|
//# sourceMappingURL=conversation_safety_constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_safety_constants.d.ts","sourceRoot":"","sources":["../../src/utils/conversation_safety_constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"conversation_safety_constants.d.ts","sourceRoot":"","sources":["../../src/utils/conversation_safety_constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,4GACwE,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const ADULT_REQUIREMENT_BODY = 'Conversations with
|
|
1
|
+
export const ADULT_REQUIREMENT_BODY = 'Conversations with minors require at least two adults. This chat is paused until more adults are added.';
|
|
2
2
|
//# sourceMappingURL=conversation_safety_constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_safety_constants.js","sourceRoot":"","sources":["../../src/utils/conversation_safety_constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GACjC,
|
|
1
|
+
{"version":3,"file":"conversation_safety_constants.js","sourceRoot":"","sources":["../../src/utils/conversation_safety_constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GACjC,yGAAyG,CAAA","sourcesContent":["export const ADULT_REQUIREMENT_BODY =\n 'Conversations with minors require at least two adults. This chat is paused until more adults are added.'\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/utils/request/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED,eAAO,MAAM,2BAA2B,GAAI,8EAKzC,OAAO,CAAC,uBAAuB,CAAM,KAAG,
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/utils/request/conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sCAAsC,CAAA;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B;AAED,eAAO,MAAM,2BAA2B,GAAI,8EAKzC,OAAO,CAAC,uBAAuB,CAAM,KAAG,UAqD1C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../../src/utils/request/conversation.ts"],"names":[],"mappings":"AAUA,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,EAC1C,IAAI,EACJ,mBAAmB,EACnB,qBAAqB,EACrB,oBAAoB,MACgB,EAAE,EAAc,EAAE;IACtD,IAAI,MAAc,CAAA;IAClB,IAAI,mBAAmB,EAAE,CAAC;QACxB,MAAM,GAAG,yBAAyB,CAAA;IACpC,CAAC;SAAM,IAAI,oBAAoB,EAAE,CAAC;QAChC,MAAM,GAAG,kCAAkC,CAAA;IAC7C,CAAC;SAAM,IAAI,qBAAqB,EAAE,CAAC;QACjC,MAAM,GAAG,yCAAyC,CAAA;IACpD,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,mBAAmB,CAAA;IAC9B,CAAC;IAED,OAAO;QACL,GAAG,EAAE,mBAAmB;QACxB,IAAI,EAAE;YACJ,OAAO,EAAE,EAAE;YACX,KAAK,EAAE,eAAe;YACtB,MAAM;YACN,IAAI;YACJ,KAAK,EAAE,mBAAmB;YAC1B,qBAAqB;YACrB,MAAM,EAAE;gBACN,YAAY,EAAE;oBACZ,YAAY;oBACZ,QAAQ;oBACR,sBAAsB;oBACtB,UAAU;oBACV,iBAAiB;oBACjB,QAAQ;oBACR,wBAAwB;oBACxB,0BAA0B;oBAC1B,yBAAyB;oBACzB,2BAA2B;oBAC3B,qBAAqB;oBACrB,oBAAoB;oBACpB,mBAAmB;oBACnB,qBAAqB;oBACrB,yBAAyB;oBACzB,gBAAgB;oBAChB,OAAO;oBACP,kBAAkB;oBAClB,OAAO;oBACP,cAAc;oBACd,iBAAiB;oBACjB,YAAY;iBACb;gBACD,iBAAiB,EAAE,CAAC,UAAU,CAAC;gBAC/B,iBAAiB,EAAE,CAAC,UAAU,EAAE,mBAAmB,EAAE,MAAM,CAAC;aAC7D;YACD,OAAO,EAAE,CAAC,QAAQ,EAAE,oBAAoB,CAAC;SAC1C;KACF,CAAA;AACH,CAAC,CAAA","sourcesContent":["import { GraphId } from '../../types/resources/group_resource'\nimport { GetRequest } from '../client/types'\n\nexport interface ConversationRequestArgs {\n gids: string\n chat_group_graph_id?: GraphId\n group_source_app_name?: string\n show_direct_messages?: boolean\n}\n\nexport const getConversationsRequestArgs = ({\n gids,\n chat_group_graph_id,\n group_source_app_name,\n show_direct_messages,\n}: Partial<ConversationRequestArgs> = {}): GetRequest => {\n let filter: string\n if (chat_group_graph_id) {\n filter = 'mine_or_not_empty,group'\n } else if (show_direct_messages) {\n filter = 'mine_or_not_empty,direct_message'\n } else if (group_source_app_name) {\n filter = 'mine_or_not_empty,group_source_app_name'\n } else {\n filter = 'mine_or_not_empty'\n }\n\n return {\n url: '/me/conversations',\n data: {\n perPage: 20,\n order: '-last_message',\n filter,\n gids,\n group: chat_group_graph_id,\n group_source_app_name,\n fields: {\n Conversation: [\n 'created_at',\n 'badges',\n 'conversation_preview',\n 'disabled',\n 'disabled_reason',\n 'groups',\n 'last_message_author_id',\n 'last_message_author_name',\n 'last_message_created_at',\n 'last_message_text_preview',\n 'preview_avatar_urls',\n 'custom_avatar_type',\n 'custom_avatar_key',\n 'custom_avatar_color',\n 'custom_avatar_image_url',\n 'member_ability',\n 'muted',\n 'replies_disabled',\n 'title',\n 'unread_count',\n 'unread_reaction',\n 'updated_at',\n ],\n AnalyticsMetadata: ['metadata'],\n ConversationBadge: ['app_name', 'pco_resource_type', 'text'],\n },\n include: ['badges', 'analytics_metadata'],\n },\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"convers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CAAA","sourcesContent":["import { GraphId } from '../../types/resources/group_resource'\nimport { GetRequest } from '../client/types'\n\nexport interface ConversationRequestArgs {\n gids: string\n chat_group_graph_id?: GraphId\n group_source_app_name?: string\n show_direct_messages?: boolean\n}\n\nexport const getConversationsRequestArgs = ({\n gids,\n chat_group_graph_id,\n group_source_app_name,\n show_direct_messages,\n}: Partial<ConversationRequestArgs> = {}): GetRequest => {\n let filter: string\n if (chat_group_graph_id) {\n filter = 'mine_or_not_empty,group'\n } else if (show_direct_messages) {\n filter = 'mine_or_not_empty,direct_message'\n } else if (group_source_app_name) {\n filter = 'mine_or_not_empty,group_source_app_name'\n } else {\n filter = 'mine_or_not_empty'\n }\n\n return {\n url: '/me/conversations',\n data: {\n perPage: 20,\n order: '-last_message',\n filter,\n gids,\n group: chat_group_graph_id,\n group_source_app_name,\n fields: {\n Conversation: [\n 'created_at',\n 'badges',\n 'conversation_preview',\n 'disabled',\n 'disabled_reason',\n 'disabled_message',\n 'groups',\n 'last_message_author_id',\n 'last_message_author_name',\n 'last_message_created_at',\n 'last_message_text_preview',\n 'preview_avatar_urls',\n 'custom_avatar_type',\n 'custom_avatar_key',\n 'custom_avatar_color',\n 'custom_avatar_image_url',\n 'member_ability',\n 'muted',\n 'replies_disabled',\n 'title',\n 'unread_count',\n 'unread_reaction',\n 'updated_at',\n ],\n AnalyticsMetadata: ['metadata'],\n ConversationBadge: ['app_name', 'pco_resource_type', 'text'],\n },\n include: ['badges', 'analytics_metadata'],\n },\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "3.42.3-qa-staging.
|
|
3
|
+
"version": "3.42.3-qa-staging.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"react-native": "./src/index.tsx",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
28
28
|
"@fortawesome/react-native-fontawesome": "^0.3.2",
|
|
29
|
-
"@planningcenter/emoji-keyboard": "3.42.3-qa-staging.
|
|
29
|
+
"@planningcenter/emoji-keyboard": "3.42.3-qa-staging.5",
|
|
30
30
|
"lodash-inflection": "^1.5.0",
|
|
31
31
|
"react-compiler-runtime": "^1.0.0"
|
|
32
32
|
},
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"react-native-url-polyfill": "^2.0.0",
|
|
73
73
|
"typescript": "~6.0.3"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "54c012866735babf1d60cd7ceaa5d4b68368d315"
|
|
76
76
|
}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { StyleSheet, View, type ViewStyle } from 'react-native'
|
|
2
2
|
import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
3
3
|
import { useTheme } from '../../hooks'
|
|
4
|
-
import type { ConversationDisabledReason } from '../../types'
|
|
5
|
-
import { ADULT_REQUIREMENT_BODY } from '../../utils'
|
|
6
4
|
import { Button, Text } from '../display'
|
|
7
5
|
|
|
8
6
|
export const LeaderMessagesDisabledBanner = () => {
|
|
@@ -22,25 +20,19 @@ export const MemberMessagesDisabledBanner = () => {
|
|
|
22
20
|
)
|
|
23
21
|
}
|
|
24
22
|
|
|
25
|
-
const DISABLED_REASON_TEXT: Record<ConversationDisabledReason, string> = {
|
|
26
|
-
safety_check: ADULT_REQUIREMENT_BODY,
|
|
27
|
-
direct_messages_disabled: 'Direct messages have been turned off by someone in this conversation.',
|
|
28
|
-
}
|
|
29
|
-
|
|
30
23
|
const DEFAULT_DISABLED_TEXT = 'This conversation has been disabled.'
|
|
31
24
|
|
|
32
25
|
interface ConversationDisabledBannerProps {
|
|
33
|
-
|
|
26
|
+
message: string | null
|
|
34
27
|
messageLink?: { label: string; onPress: () => void }
|
|
35
28
|
}
|
|
36
29
|
|
|
37
30
|
export const ConversationDisabledBanner = ({
|
|
38
|
-
|
|
31
|
+
message,
|
|
39
32
|
messageLink,
|
|
40
33
|
}: ConversationDisabledBannerProps) => {
|
|
41
34
|
const styles = useStyles()
|
|
42
|
-
const description =
|
|
43
|
-
(disabledReason && DISABLED_REASON_TEXT[disabledReason]) ?? DEFAULT_DISABLED_TEXT
|
|
35
|
+
const description = message ?? DEFAULT_DISABLED_TEXT
|
|
44
36
|
|
|
45
37
|
return (
|
|
46
38
|
<MessagesDisabledBanner
|
|
@@ -13,7 +13,7 @@ export function AdultRequirementNotice({ style }: AdultRequirementNoticeProps) {
|
|
|
13
13
|
<BannerCollapsible
|
|
14
14
|
appearance="warning"
|
|
15
15
|
iconName="general.shieldExclamation"
|
|
16
|
-
heading="
|
|
16
|
+
heading="Two adults required to chat"
|
|
17
17
|
style={style}
|
|
18
18
|
>
|
|
19
19
|
<BannerPrimitive.Text>{ADULT_REQUIREMENT_BODY}</BannerPrimitive.Text>
|
|
@@ -26,8 +26,13 @@ export function useConversationJoltEvents({ conversationId }: Props) {
|
|
|
26
26
|
|
|
27
27
|
const handleUpdatedConversation = useCallback(
|
|
28
28
|
(e: JoltConversationEvent) => {
|
|
29
|
-
const {
|
|
30
|
-
|
|
29
|
+
const {
|
|
30
|
+
last_message_idempotent_key,
|
|
31
|
+
last_message_author_id,
|
|
32
|
+
disabled,
|
|
33
|
+
disabled_reason,
|
|
34
|
+
disabled_message,
|
|
35
|
+
} = e.data.data
|
|
31
36
|
|
|
32
37
|
if (last_message_idempotent_key && last_message_author_id === currentPersonId) {
|
|
33
38
|
completeMessageCreationConversationTracking({
|
|
@@ -38,7 +43,15 @@ export function useConversationJoltEvents({ conversationId }: Props) {
|
|
|
38
43
|
|
|
39
44
|
queryClient.setQueryData<ApiResource<ConversationResource>>(queryKey, prev => {
|
|
40
45
|
if (!prev?.data) return prev
|
|
41
|
-
return {
|
|
46
|
+
return {
|
|
47
|
+
...prev,
|
|
48
|
+
data: {
|
|
49
|
+
...prev.data,
|
|
50
|
+
disabled,
|
|
51
|
+
disabledReason: disabled_reason,
|
|
52
|
+
disabledMessage: disabled_message,
|
|
53
|
+
},
|
|
54
|
+
}
|
|
42
55
|
})
|
|
43
56
|
|
|
44
57
|
queryClient.invalidateQueries({ queryKey })
|
|
@@ -59,9 +59,9 @@ export const GroupRow = ({ group, isActive }: GroupRowProps) => {
|
|
|
59
59
|
|
|
60
60
|
return (
|
|
61
61
|
<PressableRow onPress={handleFilterByGroup} isActive={isActive}>
|
|
62
|
-
{headerImage?.
|
|
62
|
+
{headerImage?.medium && (
|
|
63
63
|
<Image
|
|
64
|
-
source={{ uri: headerImage?.
|
|
64
|
+
source={{ uri: headerImage?.medium }}
|
|
65
65
|
resizeMode="cover"
|
|
66
66
|
style={styles.rowImage}
|
|
67
67
|
alt=""
|
|
@@ -12,7 +12,7 @@ export const GroupsRecipientRow = ({ group, onPress }: GroupsRecipientRowProps)
|
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
14
|
<RecipientLinkRow
|
|
15
|
-
imageUri={group.headerImage?.
|
|
15
|
+
imageUri={group.headerImage?.medium}
|
|
16
16
|
title={group.name}
|
|
17
17
|
subtitle={`${group.membershipsCount} members`}
|
|
18
18
|
onPress={() => onPress(group)}
|
|
@@ -29,9 +29,9 @@ export const RestrictedGroupRow = ({ group }: RestrictedGroupRowProps) => {
|
|
|
29
29
|
accessibilityLabel={`${group.name} — ${reasonText(group.canCreateConversationReasonCode)}`}
|
|
30
30
|
>
|
|
31
31
|
<View style={styles.innerContainer}>
|
|
32
|
-
{group.headerImage?.
|
|
32
|
+
{group.headerImage?.medium && (
|
|
33
33
|
<Image
|
|
34
|
-
source={{ uri: group.headerImage.
|
|
34
|
+
source={{ uri: group.headerImage.medium }}
|
|
35
35
|
resizeMode="cover"
|
|
36
36
|
style={styles.image}
|
|
37
37
|
alt=""
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { CustomMessage } from '@planningcenter/jolt-client/dist/types/JoltConnection'
|
|
2
|
-
import type { ConversationDisabledReason } from '../resources/conversation'
|
|
3
2
|
|
|
4
3
|
type DateString = string
|
|
5
4
|
interface BaseConversationEventData extends Record<string, unknown> {
|
|
@@ -16,7 +15,8 @@ interface BaseConversationEventData extends Record<string, unknown> {
|
|
|
16
15
|
latest_read_message_sort_key?: string
|
|
17
16
|
organization_id: number
|
|
18
17
|
disabled: boolean
|
|
19
|
-
disabled_reason
|
|
18
|
+
disabled_reason: string | null
|
|
19
|
+
disabled_message: string | null
|
|
20
20
|
replies_disabled: boolean
|
|
21
21
|
subtitle?: string
|
|
22
22
|
title: string
|
|
@@ -5,8 +5,6 @@ import { GroupResource } from './group_resource'
|
|
|
5
5
|
import { MemberAbilityResource } from './member_ability'
|
|
6
6
|
import { ReactionCountResource } from './reaction'
|
|
7
7
|
|
|
8
|
-
export type ConversationDisabledReason = 'safety_check' | 'direct_messages_disabled'
|
|
9
|
-
|
|
10
8
|
export interface ConversationPreviewData {
|
|
11
9
|
kind: 'reaction' | 'message'
|
|
12
10
|
authorName: string
|
|
@@ -26,7 +24,8 @@ export interface ConversationResource {
|
|
|
26
24
|
deleted?: boolean
|
|
27
25
|
directMessage?: boolean
|
|
28
26
|
disabled?: boolean
|
|
29
|
-
disabledReason?:
|
|
27
|
+
disabledReason?: string | null
|
|
28
|
+
disabledMessage?: string | null
|
|
30
29
|
genderOption?: string | null
|
|
31
30
|
groups?: GroupResource[]
|
|
32
31
|
previewAvatarUrls?: string[]
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const ADULT_REQUIREMENT_BODY =
|
|
2
|
-
'Conversations with
|
|
2
|
+
'Conversations with minors require at least two adults. This chat is paused until more adults are added.'
|