@planningcenter/chat-react-native 3.42.0-rc.0 → 3.42.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_select_type_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_select_type_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAC3E,OAAO,
|
|
1
|
+
{"version":3,"file":"conversation_select_type_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_select_type_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAA0B,MAAM,OAAO,CAAA;AAK9C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2CAA2C,CAAA;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAA;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,mCAAmC,CAAA;AAG3D,eAAO,MAAM,mCAAmC,uEAE9C,CAAA;AAEF,MAAM,MAAM,iCAAiC,GAAG,iBAAiB,CAAC;IAChE,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,yBAAyB,CAAC,EAAE,yBAAyB,CAAA;CACtD,CAAC,CAAA;AAOF,wBAAgB,4BAA4B,CAAC,EAAE,KAAK,EAAE,EAAE,iCAAiC,qBAiGxF"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useNavigation } from '@react-navigation/native';
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useLayoutEffect } from 'react';
|
|
3
3
|
import FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet';
|
|
4
4
|
import { useCurrentPerson } from '../hooks/use_current_person';
|
|
5
5
|
import { availableFeatures, useFeatures } from '../hooks/use_features';
|
|
@@ -16,6 +16,13 @@ export function ConversationSelectTypeScreen({ route }) {
|
|
|
16
16
|
const { newConversationFromFilter, chat_group_graph_id, group_source_app_name } = route.params || {};
|
|
17
17
|
const filterParams = { chat_group_graph_id, group_source_app_name };
|
|
18
18
|
const dmFeatureEnabled = featureEnabled(availableFeatures.direct_messages_eap);
|
|
19
|
+
const showDirectMessageOption = dmFeatureEnabled && !under_18;
|
|
20
|
+
// sheetAllowedDetents depends on the DM feature flag, which isn't known until render, so it's
|
|
21
|
+
// set here instead of in the static ConversationSelectTypeScreenOptions. useLayoutEffect applies
|
|
22
|
+
// it before paint so the sheet never visibly resizes after opening.
|
|
23
|
+
useLayoutEffect(() => {
|
|
24
|
+
navigation.setOptions({ sheetAllowedDetents: showDirectMessageOption ? [0.3] : [0.25] });
|
|
25
|
+
}, [navigation, showDirectMessageOption]);
|
|
19
26
|
const handleFilterPress = () => {
|
|
20
27
|
if (!newConversationFromFilter)
|
|
21
28
|
return;
|
|
@@ -59,7 +66,7 @@ export function ConversationSelectTypeScreen({ route }) {
|
|
|
59
66
|
{newConversationFromFilter && (<FormSheet.Action title={`New conversation in ${newConversationFromFilter.name}`} onPress={handleFilterPress} accessibilityHint="Creates a conversation pre-scoped to the current filter"/>)}
|
|
60
67
|
{canCreateGroupsConversations && (<FormSheet.Action title="Group" onPress={handleGroupPress} accessibilityHint="Opens group selection screen"/>)}
|
|
61
68
|
{canCreateServicesConversations && (<FormSheet.Action title="Team" onPress={handleTeamPress} accessibilityHint="Opens team selection screen"/>)}
|
|
62
|
-
{
|
|
69
|
+
{showDirectMessageOption && (<FormSheet.Action title="Direct message" onPress={handleDirectMessagePress} disabled={directMessagesDisabled} disabledReason={directMessagesDisabled ? 'Disabled in chat settings' : undefined} accessibilityHint="Opens direct message recipient selection screen"/>)}
|
|
63
70
|
</FormSheet.Root>);
|
|
64
71
|
}
|
|
65
72
|
//# sourceMappingURL=conversation_select_type_screen.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_select_type_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_select_type_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"conversation_select_type_screen.js","sourceRoot":"","sources":["../../src/screens/conversation_select_type_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqB,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAC3E,OAAO,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;AAC9C,OAAO,SAAS,EAAE,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAA;AACzF,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAC9D,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAA;AAI/E,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAEjD,MAAM,CAAC,MAAM,mCAAmC,GAAG,yBAAyB,CAAC;IAC3E,WAAW,EAAE,kBAAkB;CAChC,CAAC,CAAA;AAaF,MAAM,UAAU,4BAA4B,CAAC,EAAE,KAAK,EAAqC;IACvF,MAAM,UAAU,GAAG,aAAa,EAAE,CAAA;IAClC,MAAM,EAAE,4BAA4B,EAAE,8BAA8B,EAAE,GACpE,yBAAyB,EAAE,CAAA;IAC7B,MAAM,EAAE,cAAc,EAAE,GAAG,WAAW,EAAE,CAAA;IACxC,MAAM,EAAE,sBAAsB,EAAE,QAAQ,EAAE,GAAG,gBAAgB,EAAE,CAAA;IAC/D,MAAM,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,GAC7E,KAAK,CAAC,MAAM,IAAI,EAAE,CAAA;IAEpB,MAAM,YAAY,GAAG,EAAE,mBAAmB,EAAE,qBAAqB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KAAK,CAAC,gBAAgB,CACtB,OAAO,CAAC,CAAC,wBAAwB,CAAC,CAClC,QAAQ,CAAC,CAAC,sBAAsB,CAAC,CACjC,cAAc,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,SAAS,CAAC,CACjF,iBAAiB,CAAC,iDAAiD,EACnE,CACH,CACH;IAAA,EAAE,SAAS,CAAC,IAAI,CAAC,CAClB,CAAA;AACH,CAAC","sourcesContent":["import { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React, { useLayoutEffect } from 'react'\nimport FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'\nimport { useCurrentPerson } from '../hooks/use_current_person'\nimport { availableFeatures, useFeatures } from '../hooks/use_features'\nimport { useConversationTypeAccess } from '../hooks/use_new_conversation_entry'\nimport type { NewConversationFromFilter } from '../hooks/use_new_conversation_from_filter'\nimport { AppName } from '../types/resources/app_name'\nimport { GraphId } from '../types/resources/group_resource'\nimport { Haptic } from '../utils/native_adapters'\n\nexport const ConversationSelectTypeScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'New conversation',\n})\n\nexport type ConversationSelectTypeScreenProps = StaticScreenProps<{\n chat_group_graph_id?: GraphId\n group_source_app_name?: AppName\n newConversationFromFilter?: NewConversationFromFilter\n}>\n\ntype NewConversationTypeScreen =\n | 'ConversationSelectGroupRecipients'\n | 'ConversationSelectTeamsILeadRecipients'\n | 'ConversationSelectDirectMessageRecipients'\n\nexport function ConversationSelectTypeScreen({ route }: ConversationSelectTypeScreenProps) {\n const navigation = useNavigation()\n const { canCreateGroupsConversations, canCreateServicesConversations } =\n useConversationTypeAccess()\n const { featureEnabled } = useFeatures()\n const { directMessagesDisabled, under_18 } = useCurrentPerson()\n const { newConversationFromFilter, chat_group_graph_id, group_source_app_name } =\n route.params || {}\n\n const filterParams = { chat_group_graph_id, group_source_app_name }\n const dmFeatureEnabled = featureEnabled(availableFeatures.direct_messages_eap)\n const showDirectMessageOption = dmFeatureEnabled && !under_18\n\n // sheetAllowedDetents depends on the DM feature flag, which isn't known until render, so it's\n // set here instead of in the static ConversationSelectTypeScreenOptions. useLayoutEffect applies\n // it before paint so the sheet never visibly resizes after opening.\n useLayoutEffect(() => {\n navigation.setOptions({ sheetAllowedDetents: showDirectMessageOption ? [0.3] : [0.25] })\n }, [navigation, showDirectMessageOption])\n\n const handleFilterPress = () => {\n if (!newConversationFromFilter) return\n\n Haptic.impactLight()\n navigation.goBack()\n requestAnimationFrame(() => {\n if (newConversationFromFilter.sourceAppName === 'groups') {\n navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n ...filterParams,\n source_app_name: 'Groups' as AppName,\n group_id: newConversationFromFilter.groupId,\n },\n })\n } else {\n navigation.navigate('New', {\n screen: 'ConversationNew',\n params: {\n ...filterParams,\n source_app_name: 'Services' as AppName,\n team_ids: newConversationFromFilter.teamIds,\n },\n })\n }\n })\n }\n\n const navigateToNewConversationType = (screen: NewConversationTypeScreen) => {\n Haptic.impactLight()\n navigation.goBack()\n requestAnimationFrame(() => navigation.navigate('New', { screen, params: filterParams }))\n }\n\n const handleGroupPress = () => navigateToNewConversationType('ConversationSelectGroupRecipients')\n const handleTeamPress = () =>\n navigateToNewConversationType('ConversationSelectTeamsILeadRecipients')\n const handleDirectMessagePress = () =>\n navigateToNewConversationType('ConversationSelectDirectMessageRecipients')\n\n return (\n <FormSheet.Root>\n <FormSheet.Header>\n <FormSheet.HeaderTitle>Start a conversation by</FormSheet.HeaderTitle>\n </FormSheet.Header>\n {newConversationFromFilter && (\n <FormSheet.Action\n title={`New conversation in ${newConversationFromFilter.name}`}\n onPress={handleFilterPress}\n accessibilityHint=\"Creates a conversation pre-scoped to the current filter\"\n />\n )}\n {canCreateGroupsConversations && (\n <FormSheet.Action\n title=\"Group\"\n onPress={handleGroupPress}\n accessibilityHint=\"Opens group selection screen\"\n />\n )}\n {canCreateServicesConversations && (\n <FormSheet.Action\n title=\"Team\"\n onPress={handleTeamPress}\n accessibilityHint=\"Opens team selection screen\"\n />\n )}\n {showDirectMessageOption && (\n <FormSheet.Action\n title=\"Direct message\"\n onPress={handleDirectMessagePress}\n disabled={directMessagesDisabled}\n disabledReason={directMessagesDisabled ? 'Disabled in chat settings' : undefined}\n accessibilityHint=\"Opens direct message recipient selection screen\"\n />\n )}\n </FormSheet.Root>\n )\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "3.42.0-rc.
|
|
3
|
+
"version": "3.42.0-rc.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"react-native": "./src/index.tsx",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"react-native-url-polyfill": "^2.0.0",
|
|
73
73
|
"typescript": "~5.9.2"
|
|
74
74
|
},
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "e936d04b3480a93053e6453f550a2d573eba8390"
|
|
76
76
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StaticScreenProps, useNavigation } from '@react-navigation/native'
|
|
2
|
-
import React from 'react'
|
|
2
|
+
import React, { useLayoutEffect } from 'react'
|
|
3
3
|
import FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'
|
|
4
4
|
import { useCurrentPerson } from '../hooks/use_current_person'
|
|
5
5
|
import { availableFeatures, useFeatures } from '../hooks/use_features'
|
|
@@ -35,6 +35,14 @@ export function ConversationSelectTypeScreen({ route }: ConversationSelectTypeSc
|
|
|
35
35
|
|
|
36
36
|
const filterParams = { chat_group_graph_id, group_source_app_name }
|
|
37
37
|
const dmFeatureEnabled = featureEnabled(availableFeatures.direct_messages_eap)
|
|
38
|
+
const showDirectMessageOption = dmFeatureEnabled && !under_18
|
|
39
|
+
|
|
40
|
+
// sheetAllowedDetents depends on the DM feature flag, which isn't known until render, so it's
|
|
41
|
+
// set here instead of in the static ConversationSelectTypeScreenOptions. useLayoutEffect applies
|
|
42
|
+
// it before paint so the sheet never visibly resizes after opening.
|
|
43
|
+
useLayoutEffect(() => {
|
|
44
|
+
navigation.setOptions({ sheetAllowedDetents: showDirectMessageOption ? [0.3] : [0.25] })
|
|
45
|
+
}, [navigation, showDirectMessageOption])
|
|
38
46
|
|
|
39
47
|
const handleFilterPress = () => {
|
|
40
48
|
if (!newConversationFromFilter) return
|
|
@@ -102,7 +110,7 @@ export function ConversationSelectTypeScreen({ route }: ConversationSelectTypeSc
|
|
|
102
110
|
accessibilityHint="Opens team selection screen"
|
|
103
111
|
/>
|
|
104
112
|
)}
|
|
105
|
-
{
|
|
113
|
+
{showDirectMessageOption && (
|
|
106
114
|
<FormSheet.Action
|
|
107
115
|
title="Direct message"
|
|
108
116
|
onPress={handleDirectMessagePress}
|