@planningcenter/chat-react-native 4.7.1-qa-staging.5 → 4.7.1-qa-staging.7
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.
|
@@ -33,8 +33,8 @@ export declare const availableFeatures: {
|
|
|
33
33
|
readonly filter_dropdown_rollout: "ROLLOUT_MOBILE_filter_dropdown";
|
|
34
34
|
readonly manual_archiving: "QA_MOBILE_manual_archiving";
|
|
35
35
|
readonly manual_archiving_rollout: "ROLLOUT_MOBILE_manual_archiving";
|
|
36
|
-
readonly hide_conversations: "ROLLOUT_hide_conversations";
|
|
37
36
|
readonly groups_proxy: "ROLLOUT_groups_proxy";
|
|
37
|
+
readonly hide_conversations: "ROLLOUT_hide_conversations";
|
|
38
38
|
};
|
|
39
39
|
export {};
|
|
40
40
|
//# sourceMappingURL=use_features.d.ts.map
|
|
@@ -73,8 +73,8 @@ export const availableFeatures = {
|
|
|
73
73
|
filter_dropdown_rollout: 'ROLLOUT_MOBILE_filter_dropdown',
|
|
74
74
|
manual_archiving: 'QA_MOBILE_manual_archiving',
|
|
75
75
|
manual_archiving_rollout: 'ROLLOUT_MOBILE_manual_archiving',
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
groups_proxy: 'ROLLOUT_groups_proxy',
|
|
77
|
+
hide_conversations: 'ROLLOUT_hide_conversations'
|
|
78
78
|
};
|
|
79
79
|
const featureNames = Object.values(availableFeatures);
|
|
80
80
|
const stableEmptyFeatures = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use_features.js","names":["queryOptions","useSuspenseQuery","useCallback","getFeaturesRequestArgs","getFeaturesQueryKey","FIVE_MINUTES","ONE_MINUTE","useApiClient","useFeatures","$","_c","apiClient","t0","featuresQueryOptions","data","features","t1","featureName","some","feature","name","enabled","featureEnabled","t2","queryKey","featureNames","queryFn","chat","get","catch","error","stableEmptyFeatures","failure","status","staleTime","query","state","gcTime","Infinity","availableFeatures","gender_specific_conversations","message_reporting","granular_notifications_ui","custom_conversation_avatars","conversation_safety_lock","video_moderation","dm_search_clear_fix","search","search_rollout","filter_dropdown","filter_dropdown_rollout","manual_archiving","manual_archiving_rollout","
|
|
1
|
+
{"version":3,"file":"use_features.js","names":["queryOptions","useSuspenseQuery","useCallback","getFeaturesRequestArgs","getFeaturesQueryKey","FIVE_MINUTES","ONE_MINUTE","useApiClient","useFeatures","$","_c","apiClient","t0","featuresQueryOptions","data","features","t1","featureName","some","feature","name","enabled","featureEnabled","t2","queryKey","featureNames","queryFn","chat","get","catch","error","stableEmptyFeatures","failure","status","staleTime","query","state","gcTime","Infinity","availableFeatures","gender_specific_conversations","message_reporting","granular_notifications_ui","custom_conversation_avatars","conversation_safety_lock","video_moderation","dm_search_clear_fix","search","search_rollout","filter_dropdown","filter_dropdown_rollout","manual_archiving","manual_archiving_rollout","groups_proxy","hide_conversations","Object","values","links","meta","count","totalCount"],"sources":["../../src/hooks/use_features.ts"],"sourcesContent":["import { queryOptions, useSuspenseQuery } from '@tanstack/react-query'\nimport { useCallback } from 'react'\nimport { ApiCollection } from '../types'\nimport type { FeatureResource } from '../types/resources/feature_resource'\nimport { getFeaturesRequestArgs, getFeaturesQueryKey } from '../utils/request/get_features'\nimport { FIVE_MINUTES, ONE_MINUTE } from '../utils/time'\nimport { ApiClient, useApiClient } from './use_api_client'\n\ntype FeatureName = (typeof availableFeatures)[keyof typeof availableFeatures]\n\ntype FeaturesCollection = ApiCollection<FeatureResource> & {\n failure?: { status?: number }\n}\n\nexport function useFeatures() {\n const apiClient = useApiClient()\n const { data } = useSuspenseQuery(featuresQueryOptions(apiClient))\n\n const features = data.data\n\n const featureEnabled = useCallback(\n (featureName: FeatureName) =>\n features.some(feature => feature.name === featureName && feature.enabled),\n [features]\n )\n\n return {\n features,\n featureEnabled,\n }\n}\n\nexport const featuresQueryOptions = (apiClient: ApiClient) =>\n queryOptions({\n queryKey: getFeaturesQueryKey(featureNames),\n queryFn: (): Promise<FeaturesCollection> => {\n return apiClient.chat\n .get<ApiCollection<FeatureResource>>(getFeaturesRequestArgs(featureNames))\n .catch(error => ({ ...stableEmptyFeatures, failure: { status: error?.status } }))\n },\n staleTime: query => {\n const failure = query.state.data?.failure\n if (!failure) return FIVE_MINUTES\n\n return failure.status === 429 ? ONE_MINUTE : 0\n },\n gcTime: Infinity,\n })\n\nexport const availableFeatures = {\n gender_specific_conversations: 'ROLLOUT_gender_specific_conversations',\n message_reporting: 'ROLLOUT_MOBILE_message_reporting',\n granular_notifications_ui: 'ROLLOUT_granular_notification_preferences_ui',\n custom_conversation_avatars: 'ROLLOUT_custom_conversation_avatars',\n conversation_safety_lock: 'ROLLOUT_conversation_safety_lock',\n video_moderation: 'ROLLOUT_MOBILE_video_moderation',\n dm_search_clear_fix: 'ROLLOUT_MOBILE_dm_search_clear_fix',\n search: 'QA_MOBILE_search',\n search_rollout: 'ROLLOUT_MOBILE_search',\n filter_dropdown: 'QA_MOBILE_filter_dropdown',\n filter_dropdown_rollout: 'ROLLOUT_MOBILE_filter_dropdown',\n manual_archiving: 'QA_MOBILE_manual_archiving',\n manual_archiving_rollout: 'ROLLOUT_MOBILE_manual_archiving',\n groups_proxy: 'ROLLOUT_groups_proxy',\n hide_conversations: 'ROLLOUT_hide_conversations',\n} as const satisfies Record<string, `${'QA' | 'ROLLOUT'}_${string}`>\n\nconst featureNames = Object.values(availableFeatures)\n\nconst stableEmptyFeatures: ApiCollection<FeatureResource> = {\n data: [],\n links: {},\n meta: {\n count: 0,\n totalCount: 0,\n },\n}\n"],"mappings":";AAAA,SAASA,YAAY,EAAEC,gBAAgB,QAAQ,uBAAuB;AACtE,SAASC,WAAW,QAAQ,OAAO;AAGnC,SAASC,sBAAsB,EAAEC,mBAAmB,QAAQ,+BAA+B;AAC3F,SAASC,YAAY,EAAEC,UAAU,QAAQ,eAAe;AACxD,SAAoBC,YAAY,QAAQ,kBAAkB;AAQ1D,OAAO,SAAAC,YAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;E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E;QAAEC,MAAM,EAAEH,KAAK,EAAEG;MAAO;IAAE,CAAC,CAAC,CAAC;EACrF,CAAC;EACDC,SAAS,EAAEC,KAAK,IAAI;IAClB,MAAMH,OAAO,GAAGG,KAAK,CAACC,KAAK,CAACtB,IAAI,EAAEkB,OAAO;IACzC,IAAI,CAACA,OAAO,EAAE,OAAO3B,YAAY;IAEjC,OAAO2B,OAAO,CAACC,MAAM,KAAK,GAAG,GAAG3B,UAAU,GAAG,CAAC;EAChD,CAAC;EACD+B,MAAM,EAAEC;AACV,CAAC,CAAC;AAEJ,OAAO,MAAMC,iBAAiB,GAAG;EAC/BC,6BAA6B,EAAE,uCAAuC;EACtEC,iBAAiB,EAAE,kCAAkC;EACrDC,yBAAyB,EAAE,8CAA8C;EACzEC,2BAA2B,EAAE,qCAAqC;EAClEC,wBAAwB,EAAE,kCAAkC;EAC5DC,gBAAgB,EAAE,iCAAiC;EACnDC,mBAAmB,EAAE,oCAAoC;EACzDC,MAAM,EAAE,kBAAkB;EAC1BC,cAAc,EAAE,uBAAuB;EACvCC,eAAe,EAAE,2BAA2B;EAC5CC,uBAAuB,EAAE,gCAAgC;EACzDC,gBAAgB,EAAE,4BAA4B;EAC9CC,wBAAwB,EAAE,iCAAiC;EAC3DC,YAAY,EAAE,sBAAsB;EACpCC,kBAAkB,EAAE;AACtB,CAAoE;AAEpE,MAAM7B,YAAY,GAAG8B,MAAM,CAACC,MAAM,CAACjB,iBAAiB,CAAC;AAErD,MAAMR,mBAAmD,GAAG;EAC1DjB,IAAI,EAAE,EAAE;EACR2C,KAAK,EAAE,CAAC,CAAC;EACTC,IAAI,EAAE;IACJC,KAAK,EAAE,CAAC;IACRC,UAAU,EAAE;EACd;AACF,CAAC","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@planningcenter/chat-react-native",
|
|
3
|
-
"version": "4.7.1-qa-staging.
|
|
3
|
+
"version": "4.7.1-qa-staging.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
35
35
|
"@fortawesome/react-native-fontawesome": "^0.3.2",
|
|
36
|
-
"@planningcenter/emoji-keyboard": "4.7.1-qa-staging.
|
|
36
|
+
"@planningcenter/emoji-keyboard": "4.7.1-qa-staging.7",
|
|
37
37
|
"lodash-inflection": "^1.5.0"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
@@ -84,5 +84,5 @@
|
|
|
84
84
|
"sf-symbols-typescript": "^2.2.0",
|
|
85
85
|
"typescript": "~6.0.3"
|
|
86
86
|
},
|
|
87
|
-
"gitHead": "
|
|
87
|
+
"gitHead": "0b29d54eccb2151b5a6f26ad9c2a0bdec54cc251"
|
|
88
88
|
}
|
|
@@ -61,8 +61,8 @@ export const availableFeatures = {
|
|
|
61
61
|
filter_dropdown_rollout: 'ROLLOUT_MOBILE_filter_dropdown',
|
|
62
62
|
manual_archiving: 'QA_MOBILE_manual_archiving',
|
|
63
63
|
manual_archiving_rollout: 'ROLLOUT_MOBILE_manual_archiving',
|
|
64
|
-
hide_conversations: 'ROLLOUT_hide_conversations',
|
|
65
64
|
groups_proxy: 'ROLLOUT_groups_proxy',
|
|
65
|
+
hide_conversations: 'ROLLOUT_hide_conversations',
|
|
66
66
|
} as const satisfies Record<string, `${'QA' | 'ROLLOUT'}_${string}`>
|
|
67
67
|
|
|
68
68
|
const featureNames = Object.values(availableFeatures)
|