@planningcenter/chat-react-native 4.7.1-qa-staging.3 → 4.7.1-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/conversation/attachments/expanded_link.js +8 -8
- package/build/components/conversation/attachments/expanded_link.js.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/generic_file_attachment.js +2 -2
- package/build/components/conversation/attachments/generic_file_attachment.js.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.d.ts.map +1 -1
- package/build/components/conversation/attachments/giphy_attachment.js +2 -2
- package/build/components/conversation/attachments/giphy_attachment.js.map +1 -1
- package/build/components/conversation/attachments/image_attachment.js +2 -2
- package/build/components/conversation/attachments/image_attachment.js.map +1 -1
- package/build/components/conversation/message_form.js +2 -2
- package/build/components/conversation/message_form.js.map +1 -1
- package/build/components/conversation/message_markdown.js +2 -2
- package/build/components/conversation/message_markdown.js.map +1 -1
- package/build/components/conversations/conversation_actions.d.ts.map +1 -1
- package/build/components/conversations/conversation_actions.js +193 -333
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/conversations/conversation_preview.d.ts.map +1 -1
- package/build/components/conversations/conversation_preview.js +91 -106
- package/build/components/conversations/conversation_preview.js.map +1 -1
- package/build/components/conversations/conversations.d.ts.map +1 -1
- package/build/components/conversations/conversations.js +56 -63
- package/build/components/conversations/conversations.js.map +1 -1
- package/build/components/conversations/conversations_blank_state.d.ts +1 -2
- package/build/components/conversations/conversations_blank_state.d.ts.map +1 -1
- package/build/components/conversations/conversations_blank_state.js +39 -71
- package/build/components/conversations/conversations_blank_state.js.map +1 -1
- package/build/components/group_conversation_list.d.ts.map +1 -1
- package/build/components/group_conversation_list.js +0 -1
- package/build/components/group_conversation_list.js.map +1 -1
- package/build/contexts/conversations_context.d.ts +1 -3
- package/build/contexts/conversations_context.d.ts.map +1 -1
- package/build/contexts/conversations_context.js +31 -39
- package/build/contexts/conversations_context.js.map +1 -1
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts +0 -6
- package/build/hooks/groups/use_group_members_for_new_conversation.d.ts.map +1 -1
- package/build/hooks/use_api.d.ts +0 -6
- package/build/hooks/use_api.d.ts.map +1 -1
- package/build/hooks/use_api.js +5 -8
- package/build/hooks/use_api.js.map +1 -1
- package/build/hooks/use_clear_conversation_filters.d.ts.map +1 -1
- package/build/hooks/use_clear_conversation_filters.js +0 -1
- package/build/hooks/use_clear_conversation_filters.js.map +1 -1
- package/build/hooks/use_conversation.d.ts.map +1 -1
- package/build/hooks/use_conversation.js +1 -1
- package/build/hooks/use_conversation.js.map +1 -1
- package/build/hooks/use_features.d.ts +0 -1
- package/build/hooks/use_features.d.ts.map +1 -1
- package/build/hooks/use_features.js +1 -2
- package/build/hooks/use_features.js.map +1 -1
- package/build/hooks/use_groups.d.ts +0 -6
- package/build/hooks/use_groups.d.ts.map +1 -1
- package/build/hooks/use_groups_groups.d.ts +0 -6
- package/build/hooks/use_groups_groups.d.ts.map +1 -1
- package/build/hooks/use_live_relative_time.js +6 -5
- package/build/hooks/use_live_relative_time.js.map +1 -1
- package/build/hooks/use_teams.d.ts +0 -6
- package/build/hooks/use_teams.d.ts.map +1 -1
- package/build/navigation/index.d.ts +0 -5
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +0 -5
- package/build/navigation/index.js.map +1 -1
- package/build/screens/age_check/age_check_underage_screen.js +3 -3
- package/build/screens/age_check/age_check_underage_screen.js.map +1 -1
- package/build/screens/attachment_actions/attachment_actions_screen.js +2 -2
- package/build/screens/attachment_actions/attachment_actions_screen.js.map +1 -1
- package/build/screens/bug_report_screen.js +4 -4
- package/build/screens/bug_report_screen.js.map +1 -1
- package/build/screens/conversation_details_screen.d.ts.map +1 -1
- package/build/screens/conversation_details_screen.js +394 -460
- package/build/screens/conversation_details_screen.js.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.js +12 -53
- package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
- package/build/screens/conversation_filters/components/rows.d.ts +3 -6
- package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/rows.js +62 -99
- package/build/screens/conversation_filters/components/rows.js.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.d.ts.map +1 -1
- package/build/screens/conversation_filters/context/conversation_filter_context.js +0 -4
- package/build/screens/conversation_filters/context/conversation_filter_context.js.map +1 -1
- package/build/screens/conversation_filters/filter_types.d.ts +0 -1
- package/build/screens/conversation_filters/filter_types.d.ts.map +1 -1
- package/build/screens/conversation_filters/filter_types.js +0 -1
- package/build/screens/conversation_filters/filter_types.js.map +1 -1
- package/build/screens/conversation_filters/hooks/filters.d.ts +0 -12
- package/build/screens/conversation_filters/hooks/filters.d.ts.map +1 -1
- package/build/screens/conversation_filters/screen_props.d.ts +0 -1
- package/build/screens/conversation_filters/screen_props.d.ts.map +1 -1
- package/build/screens/conversation_filters/screen_props.js.map +1 -1
- package/build/screens/conversations/components/filter_dropdown_list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/filter_dropdown_list_header_component.js +126 -138
- package/build/screens/conversations/components/filter_dropdown_list_header_component.js.map +1 -1
- package/build/screens/conversations/components/list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/list_header_component.js +90 -95
- package/build/screens/conversations/components/list_header_component.js.map +1 -1
- package/build/screens/conversations/components/search_list_header_component.d.ts.map +1 -1
- package/build/screens/conversations/components/search_list_header_component.js +95 -100
- package/build/screens/conversations/components/search_list_header_component.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts +0 -1
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +10 -18
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/screens/get_help_screen.d.ts.map +1 -1
- package/build/screens/get_help_screen.js +21 -5
- package/build/screens/get_help_screen.js.map +1 -1
- package/build/screens/index.d.ts +0 -1
- package/build/screens/index.d.ts.map +1 -1
- package/build/screens/index.js +0 -1
- package/build/screens/index.js.map +1 -1
- package/build/types/resources/conversation_membership.d.ts +0 -1
- package/build/types/resources/conversation_membership.d.ts.map +1 -1
- package/build/types/resources/conversation_membership.js.map +1 -1
- package/build/utils/date.d.ts +1 -1
- package/build/utils/date.d.ts.map +1 -1
- package/build/utils/date.js +4 -4
- package/build/utils/date.js.map +1 -1
- package/build/utils/index.d.ts +0 -1
- package/build/utils/index.d.ts.map +1 -1
- package/build/utils/index.js +0 -1
- package/build/utils/index.js.map +1 -1
- package/build/utils/request/conversation.d.ts +1 -3
- package/build/utils/request/conversation.d.ts.map +1 -1
- package/build/utils/request/conversation.js +0 -4
- package/build/utils/request/conversation.js.map +1 -1
- package/build/vendor/font_awesome_pro_solid_icons.d.ts +0 -1
- package/build/vendor/font_awesome_pro_solid_icons.d.ts.map +1 -1
- package/build/vendor/font_awesome_pro_solid_icons.js +0 -5
- package/build/vendor/font_awesome_pro_solid_icons.js.map +1 -1
- package/package.json +3 -3
- package/src/__tests__/components/conversation/attachments/giphy_attachment.test.tsx +1 -1
- package/src/__tests__/screens/conversation_filters/components/conversation_filters.test.tsx +0 -6
- package/src/__tests__/screens/get_help_screen.test.ts +1 -1
- package/src/components/conversation/attachments/expanded_link.tsx +4 -4
- package/src/components/conversation/attachments/generic_file_attachment.tsx +5 -2
- package/src/components/conversation/attachments/giphy_attachment.tsx +4 -2
- package/src/components/conversation/attachments/image_attachment.tsx +2 -2
- package/src/components/conversation/message_form.tsx +2 -2
- package/src/components/conversation/message_markdown.tsx +2 -2
- package/src/components/conversations/__tests__/conversation_actions.test.tsx +2 -77
- package/src/components/conversations/__tests__/conversation_preview.test.tsx +0 -29
- package/src/components/conversations/__tests__/conversations.test.tsx +0 -26
- package/src/components/conversations/__tests__/conversations_blank_state.test.tsx +0 -17
- package/src/components/conversations/conversation_actions.tsx +4 -73
- package/src/components/conversations/conversation_preview.tsx +1 -12
- package/src/components/conversations/conversations.tsx +0 -9
- package/src/components/conversations/conversations_blank_state.tsx +0 -18
- package/src/components/group_conversation_list.tsx +1 -4
- package/src/contexts/conversations_context.tsx +1 -8
- package/src/hooks/__tests__/use_live_relative_time.test.tsx +22 -0
- package/src/hooks/use_api.ts +1 -2
- package/src/hooks/use_clear_conversation_filters.ts +0 -1
- package/src/hooks/use_conversation.ts +0 -1
- package/src/hooks/use_features.ts +0 -1
- package/src/hooks/use_live_relative_time.ts +1 -1
- package/src/navigation/index.tsx +0 -8
- package/src/screens/__tests__/conversation_details_screen.test.tsx +1 -49
- package/src/screens/age_check/age_check_underage_screen.tsx +3 -3
- package/src/screens/attachment_actions/attachment_actions_screen.tsx +2 -2
- package/src/screens/bug_report_screen.tsx +4 -4
- package/src/screens/conversation_details_screen.tsx +0 -19
- package/src/screens/conversation_filters/__tests__/conversation_filters.test.tsx +0 -42
- package/src/screens/conversation_filters/components/conversation_filters.tsx +3 -22
- package/src/screens/conversation_filters/components/rows.tsx +10 -44
- package/src/screens/conversation_filters/context/conversation_filter_context.tsx +0 -4
- package/src/screens/conversation_filters/filter_types.ts +0 -1
- package/src/screens/conversation_filters/screen_props.ts +0 -1
- package/src/screens/conversations/__tests__/conversations_screen.test.tsx +0 -1
- package/src/screens/conversations/components/__tests__/filter_dropdown_list_header_component.test.tsx +0 -42
- package/src/screens/conversations/components/__tests__/list_header_component.test.tsx +0 -1
- package/src/screens/conversations/components/filter_dropdown_list_header_component.tsx +5 -21
- package/src/screens/conversations/components/list_header_component.tsx +4 -14
- package/src/screens/conversations/components/search_list_header_component.tsx +4 -14
- package/src/screens/conversations/conversations_screen.tsx +0 -3
- package/src/screens/get_help_screen.tsx +19 -5
- package/src/screens/index.ts +0 -1
- package/src/types/resources/conversation_membership.ts +0 -1
- package/src/utils/__tests__/date.test.ts +10 -1
- package/src/utils/date.ts +4 -4
- package/src/utils/index.ts +0 -1
- package/src/utils/request/conversation.ts +0 -6
- package/src/vendor/font_awesome_pro_solid_icons.ts +0 -12
- package/build/components/conversations/hidden_indicator.d.ts +0 -4
- package/build/components/conversations/hidden_indicator.d.ts.map +0 -1
- package/build/components/conversations/hidden_indicator.js +0 -52
- package/build/components/conversations/hidden_indicator.js.map +0 -1
- package/build/components/conversations/hidden_results_footer.d.ts +0 -2
- package/build/components/conversations/hidden_results_footer.d.ts.map +0 -1
- package/build/components/conversations/hidden_results_footer.js +0 -34
- package/build/components/conversations/hidden_results_footer.js.map +0 -1
- package/build/components/display/toast.d.ts +0 -3
- package/build/components/display/toast.d.ts.map +0 -1
- package/build/components/display/toast.js +0 -224
- package/build/components/display/toast.js.map +0 -1
- package/build/hooks/use_hidden_conversations_count.d.ts +0 -2
- package/build/hooks/use_hidden_conversations_count.d.ts.map +0 -1
- package/build/hooks/use_hidden_conversations_count.js +0 -32
- package/build/hooks/use_hidden_conversations_count.js.map +0 -1
- package/build/hooks/use_hide_conversation.d.ts +0 -108
- package/build/hooks/use_hide_conversation.d.ts.map +0 -1
- package/build/hooks/use_hide_conversation.js +0 -243
- package/build/hooks/use_hide_conversation.js.map +0 -1
- package/build/hooks/use_hide_conversations_enabled.d.ts +0 -2
- package/build/hooks/use_hide_conversations_enabled.d.ts.map +0 -1
- package/build/hooks/use_hide_conversations_enabled.js +0 -18
- package/build/hooks/use_hide_conversations_enabled.js.map +0 -1
- package/build/screens/conversation_actions_screen.d.ts +0 -7
- package/build/screens/conversation_actions_screen.d.ts.map +0 -1
- package/build/screens/conversation_actions_screen.js +0 -89
- package/build/screens/conversation_actions_screen.js.map +0 -1
- package/build/utils/open_url.d.ts +0 -11
- package/build/utils/open_url.d.ts.map +0 -1
- package/build/utils/open_url.js +0 -46
- package/build/utils/open_url.js.map +0 -1
- package/build/utils/toast_store.d.ts +0 -21
- package/build/utils/toast_store.d.ts.map +0 -1
- package/build/utils/toast_store.js +0 -27
- package/build/utils/toast_store.js.map +0 -1
- package/src/components/conversations/hidden_indicator.tsx +0 -30
- package/src/components/conversations/hidden_results_footer.tsx +0 -25
- package/src/components/display/__tests__/toast.test.tsx +0 -55
- package/src/components/display/toast.tsx +0 -115
- package/src/hooks/__tests__/use_hide_conversation.test.tsx +0 -189
- package/src/hooks/use_hidden_conversations_count.ts +0 -14
- package/src/hooks/use_hide_conversation.ts +0 -128
- package/src/hooks/use_hide_conversations_enabled.ts +0 -7
- package/src/screens/__tests__/conversation_actions_screen.test.tsx +0 -79
- package/src/screens/conversation_actions_screen.tsx +0 -53
- package/src/utils/__tests__/open_url.test.ts +0 -67
- package/src/utils/open_url.ts +0 -47
- package/src/utils/toast_store.ts +0 -45
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { getConversationsRequestArgs } from '../utils/request/conversation';
|
|
3
|
-
import { useApiPaginator } from './use_api';
|
|
4
|
-
import { useHideConversationsEnabled } from './use_hide_conversations_enabled';
|
|
5
|
-
export function useHiddenConversationsCount() {
|
|
6
|
-
const $ = _c(3);
|
|
7
|
-
const enabled = useHideConversationsEnabled();
|
|
8
|
-
let t0;
|
|
9
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
10
|
-
t0 = getConversationsRequestArgs({
|
|
11
|
-
show_hidden: true
|
|
12
|
-
});
|
|
13
|
-
$[0] = t0;
|
|
14
|
-
} else {
|
|
15
|
-
t0 = $[0];
|
|
16
|
-
}
|
|
17
|
-
let t1;
|
|
18
|
-
if ($[1] !== enabled) {
|
|
19
|
-
t1 = {
|
|
20
|
-
enabled
|
|
21
|
-
};
|
|
22
|
-
$[1] = enabled;
|
|
23
|
-
$[2] = t1;
|
|
24
|
-
} else {
|
|
25
|
-
t1 = $[2];
|
|
26
|
-
}
|
|
27
|
-
const {
|
|
28
|
-
totalCount
|
|
29
|
-
} = useApiPaginator(t0, t1);
|
|
30
|
-
return enabled ? totalCount : 0;
|
|
31
|
-
}
|
|
32
|
-
//# sourceMappingURL=use_hidden_conversations_count.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use_hidden_conversations_count.js","names":["getConversationsRequestArgs","useApiPaginator","useHideConversationsEnabled","useHiddenConversationsCount","$","_c","enabled","t0","Symbol","for","show_hidden","t1","totalCount"],"sources":["../../src/hooks/use_hidden_conversations_count.ts"],"sourcesContent":["import { ConversationResource } from '../types'\nimport { getConversationsRequestArgs } from '../utils/request/conversation'\nimport { useApiPaginator } from './use_api'\nimport { useHideConversationsEnabled } from './use_hide_conversations_enabled'\n\nexport function useHiddenConversationsCount() {\n const enabled = useHideConversationsEnabled()\n const { totalCount } = useApiPaginator<ConversationResource>(\n getConversationsRequestArgs({ show_hidden: true }),\n { enabled }\n )\n\n return enabled ? totalCount : 0\n}\n"],"mappings":";AACA,SAASA,2BAA2B,QAAQ,+BAA+B;AAC3E,SAASC,eAAe,QAAQ,WAAW;AAC3C,SAASC,2BAA2B,QAAQ,kCAAkC;AAE9E,OAAO,SAAAC,4BAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EACL,MAAAC,OAAA,GAAgBJ,2BAA2B,CAAC,CAAC;EAAA,IAAAK,EAAA;EAAA,IAAAH,CAAA,QAAAI,MAAA,CAAAC,GAAA;IAE3CF,EAAA,GAAAP,2BAA2B,CAAC;MAAAU,WAAA,EAAe;IAAK,CAAC,CAAC;IAAAN,CAAA,MAAAG,EAAA;EAAA;IAAAA,EAAA,GAAAH,CAAA;EAAA;EAAA,IAAAO,EAAA;EAAA,IAAAP,CAAA,QAAAE,OAAA;IAClDK,EAAA;MAAAL;IAAU,CAAC;IAAAF,CAAA,MAAAE,OAAA;IAAAF,CAAA,MAAAO,EAAA;EAAA;IAAAA,EAAA,GAAAP,CAAA;EAAA;EAFb;IAAAQ;EAAA,IAAuBX,eAAe,CACpCM,EAAkD,EAClDI,EACF,CAAC;EAAA,OAEML,OAAO,GAAPM,UAAwB,GAAxB,CAAwB;AAAA","ignoreList":[]}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { InfiniteData } from '@tanstack/react-query';
|
|
2
|
-
import { ApiCollection, ApiResource, ConversationMembershipResource, ConversationResource } from '../types';
|
|
3
|
-
type ConversationsData = InfiniteData<ApiCollection<ConversationResource>>;
|
|
4
|
-
export declare const HIDDEN_TOAST_TITLE = "Conversation hidden";
|
|
5
|
-
export declare const HIDDEN_TOAST_SUBTITLE = "It'll come back if someone sends a new message.";
|
|
6
|
-
export declare const HIDDEN_AND_SILENCED_TOAST_SUBTITLE = "It's silenced too, so it stays hidden until you unhide it.";
|
|
7
|
-
export declare const useHideConversation: ({ conversation, hidden: knownHidden, }: {
|
|
8
|
-
conversation: ConversationResource;
|
|
9
|
-
hidden?: boolean;
|
|
10
|
-
}) => {
|
|
11
|
-
data: undefined;
|
|
12
|
-
variables: undefined;
|
|
13
|
-
error: null;
|
|
14
|
-
isError: false;
|
|
15
|
-
isIdle: true;
|
|
16
|
-
isPending: false;
|
|
17
|
-
isSuccess: false;
|
|
18
|
-
status: "idle";
|
|
19
|
-
reset: () => void;
|
|
20
|
-
context: {
|
|
21
|
-
previousLists: [readonly unknown[], ConversationsData | undefined][];
|
|
22
|
-
} | undefined;
|
|
23
|
-
failureCount: number;
|
|
24
|
-
failureReason: Error | null;
|
|
25
|
-
isPaused: boolean;
|
|
26
|
-
submittedAt: number;
|
|
27
|
-
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
|
|
28
|
-
previousLists: [readonly unknown[], ConversationsData | undefined][];
|
|
29
|
-
}>;
|
|
30
|
-
hidden: boolean;
|
|
31
|
-
setHidden: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
|
|
32
|
-
previousLists: [readonly unknown[], ConversationsData | undefined][];
|
|
33
|
-
}>;
|
|
34
|
-
} | {
|
|
35
|
-
data: undefined;
|
|
36
|
-
variables: boolean;
|
|
37
|
-
error: null;
|
|
38
|
-
isError: false;
|
|
39
|
-
isIdle: false;
|
|
40
|
-
isPending: true;
|
|
41
|
-
isSuccess: false;
|
|
42
|
-
status: "pending";
|
|
43
|
-
reset: () => void;
|
|
44
|
-
context: {
|
|
45
|
-
previousLists: [readonly unknown[], ConversationsData | undefined][];
|
|
46
|
-
} | undefined;
|
|
47
|
-
failureCount: number;
|
|
48
|
-
failureReason: Error | null;
|
|
49
|
-
isPaused: boolean;
|
|
50
|
-
submittedAt: number;
|
|
51
|
-
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
|
|
52
|
-
previousLists: [readonly unknown[], ConversationsData | undefined][];
|
|
53
|
-
}>;
|
|
54
|
-
hidden: boolean;
|
|
55
|
-
setHidden: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
|
|
56
|
-
previousLists: [readonly unknown[], ConversationsData | undefined][];
|
|
57
|
-
}>;
|
|
58
|
-
} | {
|
|
59
|
-
data: undefined;
|
|
60
|
-
error: Error;
|
|
61
|
-
variables: boolean;
|
|
62
|
-
isError: true;
|
|
63
|
-
isIdle: false;
|
|
64
|
-
isPending: false;
|
|
65
|
-
isSuccess: false;
|
|
66
|
-
status: "error";
|
|
67
|
-
reset: () => void;
|
|
68
|
-
context: {
|
|
69
|
-
previousLists: [readonly unknown[], ConversationsData | undefined][];
|
|
70
|
-
} | undefined;
|
|
71
|
-
failureCount: number;
|
|
72
|
-
failureReason: Error | null;
|
|
73
|
-
isPaused: boolean;
|
|
74
|
-
submittedAt: number;
|
|
75
|
-
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
|
|
76
|
-
previousLists: [readonly unknown[], ConversationsData | undefined][];
|
|
77
|
-
}>;
|
|
78
|
-
hidden: boolean;
|
|
79
|
-
setHidden: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
|
|
80
|
-
previousLists: [readonly unknown[], ConversationsData | undefined][];
|
|
81
|
-
}>;
|
|
82
|
-
} | {
|
|
83
|
-
data: ApiResource<ConversationMembershipResource>;
|
|
84
|
-
error: null;
|
|
85
|
-
variables: boolean;
|
|
86
|
-
isError: false;
|
|
87
|
-
isIdle: false;
|
|
88
|
-
isPending: false;
|
|
89
|
-
isSuccess: true;
|
|
90
|
-
status: "success";
|
|
91
|
-
reset: () => void;
|
|
92
|
-
context: {
|
|
93
|
-
previousLists: [readonly unknown[], ConversationsData | undefined][];
|
|
94
|
-
} | undefined;
|
|
95
|
-
failureCount: number;
|
|
96
|
-
failureReason: Error | null;
|
|
97
|
-
isPaused: boolean;
|
|
98
|
-
submittedAt: number;
|
|
99
|
-
mutateAsync: import("@tanstack/react-query").UseMutateAsyncFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
|
|
100
|
-
previousLists: [readonly unknown[], ConversationsData | undefined][];
|
|
101
|
-
}>;
|
|
102
|
-
hidden: boolean;
|
|
103
|
-
setHidden: import("@tanstack/react-query").UseMutateFunction<ApiResource<ConversationMembershipResource>, Error, boolean, {
|
|
104
|
-
previousLists: [readonly unknown[], ConversationsData | undefined][];
|
|
105
|
-
}>;
|
|
106
|
-
};
|
|
107
|
-
export {};
|
|
108
|
-
//# sourceMappingURL=use_hide_conversation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use_hide_conversation.d.ts","sourceRoot":"","sources":["../../src/hooks/use_hide_conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAyC,MAAM,uBAAuB,CAAA;AAE3F,OAAO,EACL,aAAa,EACb,WAAW,EACX,8BAA8B,EAC9B,oBAAoB,EACrB,MAAM,UAAU,CAAA;AAYjB,KAAK,iBAAiB,GAAG,YAAY,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAAC,CAAA;AAG1E,eAAO,MAAM,kBAAkB,wBAAwB,CAAA;AACvD,eAAO,MAAM,qBAAqB,oDAAoD,CAAA;AACtF,eAAO,MAAM,kCAAkC,+DACe,CAAA;AAE9D,eAAO,MAAM,mBAAmB,GAAI,wCAGjC;IACD,YAAY,EAAE,oBAAoB,CAAA;IAClC,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8FA,CAAA"}
|
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
3
|
-
import { Alert } from 'react-native';
|
|
4
|
-
import { deleteRecordInPagesData } from '../utils/cache/page_mutations';
|
|
5
|
-
import { Haptic } from '../utils/native_adapters';
|
|
6
|
-
import { getConversationsRequestArgs, HIDDEN_CONVERSATIONS_FILTER } from '../utils/request/conversation';
|
|
7
|
-
import { showToast } from '../utils/toast_store';
|
|
8
|
-
import { useApiClient } from './use_api_client';
|
|
9
|
-
import { getConversationRequestArgs } from './use_conversation';
|
|
10
|
-
import { getRequestQueryKey } from './use_suspense_api';
|
|
11
|
-
export const HIDDEN_TOAST_TITLE = 'Conversation hidden';
|
|
12
|
-
export const HIDDEN_TOAST_SUBTITLE = "It'll come back if someone sends a new message.";
|
|
13
|
-
export const HIDDEN_AND_SILENCED_TOAST_SUBTITLE = "It's silenced too, so it stays hidden until you unhide it.";
|
|
14
|
-
export const useHideConversation = t0 => {
|
|
15
|
-
const $ = _c(30);
|
|
16
|
-
const {
|
|
17
|
-
conversation,
|
|
18
|
-
hidden: knownHidden
|
|
19
|
-
} = t0;
|
|
20
|
-
const apiClient = useApiClient();
|
|
21
|
-
const queryClient = useQueryClient();
|
|
22
|
-
let t1;
|
|
23
|
-
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
|
|
24
|
-
t1 = [getConversationsRequestArgs().url];
|
|
25
|
-
$[0] = t1;
|
|
26
|
-
} else {
|
|
27
|
-
t1 = $[0];
|
|
28
|
-
}
|
|
29
|
-
const listsQueryKey = t1;
|
|
30
|
-
let t2;
|
|
31
|
-
if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
|
|
32
|
-
t2 = [...listsQueryKey, {
|
|
33
|
-
filter: HIDDEN_CONVERSATIONS_FILTER
|
|
34
|
-
}];
|
|
35
|
-
$[1] = t2;
|
|
36
|
-
} else {
|
|
37
|
-
t2 = $[1];
|
|
38
|
-
}
|
|
39
|
-
const hiddenListsQueryKey = t2;
|
|
40
|
-
let t3;
|
|
41
|
-
if ($[2] !== conversation.id) {
|
|
42
|
-
t3 = getRequestQueryKey(getConversationRequestArgs({
|
|
43
|
-
conversation_id: conversation.id
|
|
44
|
-
}));
|
|
45
|
-
$[2] = conversation.id;
|
|
46
|
-
$[3] = t3;
|
|
47
|
-
} else {
|
|
48
|
-
t3 = $[3];
|
|
49
|
-
}
|
|
50
|
-
const conversationQueryKey = t3;
|
|
51
|
-
const hidden = knownHidden ?? !!conversation.conversationMembership?.hidden;
|
|
52
|
-
let t4;
|
|
53
|
-
if ($[4] !== conversationQueryKey || $[5] !== queryClient) {
|
|
54
|
-
t4 = value => queryClient.setQueryData(conversationQueryKey, prev => {
|
|
55
|
-
if (!prev?.data) {
|
|
56
|
-
return prev;
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
...prev,
|
|
60
|
-
data: {
|
|
61
|
-
...prev.data,
|
|
62
|
-
conversationMembership: {
|
|
63
|
-
...prev.data.conversationMembership,
|
|
64
|
-
hidden: value
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
});
|
|
69
|
-
$[4] = conversationQueryKey;
|
|
70
|
-
$[5] = queryClient;
|
|
71
|
-
$[6] = t4;
|
|
72
|
-
} else {
|
|
73
|
-
t4 = $[6];
|
|
74
|
-
}
|
|
75
|
-
const setMembershipHidden = t4;
|
|
76
|
-
let t5;
|
|
77
|
-
if ($[7] !== conversation.id || $[8] !== queryClient) {
|
|
78
|
-
t5 = queryKey => queryClient.setQueriesData({
|
|
79
|
-
queryKey
|
|
80
|
-
}, prev_0 => {
|
|
81
|
-
if (!prev_0?.pages) {
|
|
82
|
-
return prev_0;
|
|
83
|
-
}
|
|
84
|
-
return deleteRecordInPagesData({
|
|
85
|
-
data: prev_0,
|
|
86
|
-
record: {
|
|
87
|
-
id: conversation.id
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
});
|
|
91
|
-
$[7] = conversation.id;
|
|
92
|
-
$[8] = queryClient;
|
|
93
|
-
$[9] = t5;
|
|
94
|
-
} else {
|
|
95
|
-
t5 = $[9];
|
|
96
|
-
}
|
|
97
|
-
const removeFromLists = t5;
|
|
98
|
-
let t6;
|
|
99
|
-
if ($[10] !== queryClient) {
|
|
100
|
-
t6 = lists => {
|
|
101
|
-
lists.forEach(t7 => {
|
|
102
|
-
const [queryKey_0, data] = t7;
|
|
103
|
-
queryClient.setQueryData(queryKey_0, data);
|
|
104
|
-
});
|
|
105
|
-
};
|
|
106
|
-
$[10] = queryClient;
|
|
107
|
-
$[11] = t6;
|
|
108
|
-
} else {
|
|
109
|
-
t6 = $[11];
|
|
110
|
-
}
|
|
111
|
-
const restoreLists = t6;
|
|
112
|
-
let t7;
|
|
113
|
-
if ($[12] !== conversation.id) {
|
|
114
|
-
t7 = ["hideConversation", conversation.id];
|
|
115
|
-
$[12] = conversation.id;
|
|
116
|
-
$[13] = t7;
|
|
117
|
-
} else {
|
|
118
|
-
t7 = $[13];
|
|
119
|
-
}
|
|
120
|
-
const t8 = `hideConversation-${conversation.id}`;
|
|
121
|
-
let t9;
|
|
122
|
-
if ($[14] !== t8) {
|
|
123
|
-
t9 = {
|
|
124
|
-
id: t8
|
|
125
|
-
};
|
|
126
|
-
$[14] = t8;
|
|
127
|
-
$[15] = t9;
|
|
128
|
-
} else {
|
|
129
|
-
t9 = $[15];
|
|
130
|
-
}
|
|
131
|
-
let t10;
|
|
132
|
-
if ($[16] !== queryClient || $[17] !== removeFromLists || $[18] !== setMembershipHidden) {
|
|
133
|
-
t10 = async value_0 => {
|
|
134
|
-
await queryClient.cancelQueries({
|
|
135
|
-
queryKey: listsQueryKey
|
|
136
|
-
});
|
|
137
|
-
const previousLists = queryClient.getQueriesData({
|
|
138
|
-
queryKey: listsQueryKey
|
|
139
|
-
});
|
|
140
|
-
removeFromLists(value_0 ? listsQueryKey : hiddenListsQueryKey);
|
|
141
|
-
setMembershipHidden(value_0);
|
|
142
|
-
return {
|
|
143
|
-
previousLists
|
|
144
|
-
};
|
|
145
|
-
};
|
|
146
|
-
$[16] = queryClient;
|
|
147
|
-
$[17] = removeFromLists;
|
|
148
|
-
$[18] = setMembershipHidden;
|
|
149
|
-
$[19] = t10;
|
|
150
|
-
} else {
|
|
151
|
-
t10 = $[19];
|
|
152
|
-
}
|
|
153
|
-
let t11;
|
|
154
|
-
if ($[20] !== apiClient || $[21] !== conversation.id) {
|
|
155
|
-
t11 = value_1 => apiClient.chat.patch({
|
|
156
|
-
url: `/me/conversations/${conversation.id}/conversation_membership`,
|
|
157
|
-
data: {
|
|
158
|
-
data: {
|
|
159
|
-
type: "ConversationMembership",
|
|
160
|
-
attributes: {
|
|
161
|
-
hidden: value_1
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
fields: {
|
|
165
|
-
ConversationMembership: "hidden"
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
$[20] = apiClient;
|
|
170
|
-
$[21] = conversation.id;
|
|
171
|
-
$[22] = t11;
|
|
172
|
-
} else {
|
|
173
|
-
t11 = $[22];
|
|
174
|
-
}
|
|
175
|
-
let t13;
|
|
176
|
-
if ($[23] !== restoreLists || $[24] !== setMembershipHidden) {
|
|
177
|
-
t13 = (_error, value_3, context) => {
|
|
178
|
-
if (context) {
|
|
179
|
-
restoreLists(context.previousLists);
|
|
180
|
-
}
|
|
181
|
-
setMembershipHidden(!value_3);
|
|
182
|
-
Alert.alert("Oops", `Couldn't ${value_3 ? "hide" : "unhide"} this conversation. Please try again.`);
|
|
183
|
-
};
|
|
184
|
-
$[23] = restoreLists;
|
|
185
|
-
$[24] = setMembershipHidden;
|
|
186
|
-
$[25] = t13;
|
|
187
|
-
} else {
|
|
188
|
-
t13 = $[25];
|
|
189
|
-
}
|
|
190
|
-
const {
|
|
191
|
-
mutate: t14,
|
|
192
|
-
...mutation
|
|
193
|
-
} = useMutation({
|
|
194
|
-
mutationKey: t7,
|
|
195
|
-
scope: t9,
|
|
196
|
-
onMutate: t10,
|
|
197
|
-
mutationFn: t11,
|
|
198
|
-
onSuccess: (_response, value_2, t12) => {
|
|
199
|
-
const {
|
|
200
|
-
previousLists: previousLists_0
|
|
201
|
-
} = t12;
|
|
202
|
-
Haptic.notificationSuccess();
|
|
203
|
-
if (!value_2) {
|
|
204
|
-
queryClient.invalidateQueries({
|
|
205
|
-
queryKey: listsQueryKey
|
|
206
|
-
});
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
queryClient.invalidateQueries({
|
|
210
|
-
queryKey: hiddenListsQueryKey
|
|
211
|
-
});
|
|
212
|
-
showToast({
|
|
213
|
-
title: HIDDEN_TOAST_TITLE,
|
|
214
|
-
subtitle: conversation.muted ? HIDDEN_AND_SILENCED_TOAST_SUBTITLE : HIDDEN_TOAST_SUBTITLE,
|
|
215
|
-
action: {
|
|
216
|
-
label: "Undo",
|
|
217
|
-
onPress: () => {
|
|
218
|
-
restoreLists(previousLists_0);
|
|
219
|
-
setHidden(false);
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
},
|
|
224
|
-
onError: t13
|
|
225
|
-
});
|
|
226
|
-
const setHidden = t14;
|
|
227
|
-
let t15;
|
|
228
|
-
if ($[26] !== hidden || $[27] !== mutation || $[28] !== setHidden) {
|
|
229
|
-
t15 = {
|
|
230
|
-
hidden,
|
|
231
|
-
setHidden,
|
|
232
|
-
...mutation
|
|
233
|
-
};
|
|
234
|
-
$[26] = hidden;
|
|
235
|
-
$[27] = mutation;
|
|
236
|
-
$[28] = setHidden;
|
|
237
|
-
$[29] = t15;
|
|
238
|
-
} else {
|
|
239
|
-
t15 = $[29];
|
|
240
|
-
}
|
|
241
|
-
return t15;
|
|
242
|
-
};
|
|
243
|
-
//# sourceMappingURL=use_hide_conversation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use_hide_conversation.js","names":["useMutation","useQueryClient","Alert","deleteRecordInPagesData","Haptic","getConversationsRequestArgs","HIDDEN_CONVERSATIONS_FILTER","showToast","useApiClient","getConversationRequestArgs","getRequestQueryKey","HIDDEN_TOAST_TITLE","HIDDEN_TOAST_SUBTITLE","HIDDEN_AND_SILENCED_TOAST_SUBTITLE","useHideConversation","t0","$","_c","conversation","hidden","knownHidden","apiClient","queryClient","t1","Symbol","for","url","listsQueryKey","t2","filter","hiddenListsQueryKey","t3","id","conversation_id","conversationQueryKey","conversationMembership","t4","value","setQueryData","prev","data","setMembershipHidden","t5","queryKey","setQueriesData","prev_0","pages","record","removeFromLists","t6","lists","forEach","t7","queryKey_0","restoreLists","t8","t9","t10","value_0","cancelQueries","previousLists","getQueriesData","t11","value_1","chat","patch","type","attributes","fields","ConversationMembership","t13","_error","value_3","context","alert","mutate","t14","mutation","mutationKey","scope","onMutate","mutationFn","onSuccess","_response","value_2","t12","previousLists_0","notificationSuccess","invalidateQueries","title","subtitle","muted","action","label","onPress","setHidden","onError","t15"],"sources":["../../src/hooks/use_hide_conversation.ts"],"sourcesContent":["import { InfiniteData, QueryKey, useMutation, useQueryClient } from '@tanstack/react-query'\nimport { Alert } from 'react-native'\nimport {\n ApiCollection,\n ApiResource,\n ConversationMembershipResource,\n ConversationResource,\n} from '../types'\nimport { deleteRecordInPagesData } from '../utils/cache/page_mutations'\nimport { Haptic } from '../utils/native_adapters'\nimport {\n getConversationsRequestArgs,\n HIDDEN_CONVERSATIONS_FILTER,\n} from '../utils/request/conversation'\nimport { showToast } from '../utils/toast_store'\nimport { useApiClient } from './use_api_client'\nimport { getConversationRequestArgs } from './use_conversation'\nimport { getRequestQueryKey } from './use_suspense_api'\n\ntype ConversationsData = InfiniteData<ApiCollection<ConversationResource>>\ntype ListsSnapshot = Array<[QueryKey, ConversationsData | undefined]>\n\nexport const HIDDEN_TOAST_TITLE = 'Conversation hidden'\nexport const HIDDEN_TOAST_SUBTITLE = \"It'll come back if someone sends a new message.\"\nexport const HIDDEN_AND_SILENCED_TOAST_SUBTITLE =\n \"It's silenced too, so it stays hidden until you unhide it.\"\n\nexport const useHideConversation = ({\n conversation,\n hidden: knownHidden,\n}: {\n conversation: ConversationResource\n hidden?: boolean\n}) => {\n const apiClient = useApiClient()\n const queryClient = useQueryClient()\n const listsQueryKey = [getConversationsRequestArgs().url]\n const hiddenListsQueryKey = [...listsQueryKey, { filter: HIDDEN_CONVERSATIONS_FILTER }]\n const conversationQueryKey = getRequestQueryKey(\n getConversationRequestArgs({ conversation_id: conversation.id })\n )\n const hidden = knownHidden ?? !!conversation.conversationMembership?.hidden\n\n const setMembershipHidden = (value: boolean) =>\n queryClient.setQueryData<ApiResource<ConversationResource>>(conversationQueryKey, prev => {\n if (!prev?.data) return prev\n\n return {\n ...prev,\n data: {\n ...prev.data,\n conversationMembership: { ...prev.data.conversationMembership, hidden: value },\n },\n }\n })\n\n const removeFromLists = (queryKey: QueryKey) =>\n queryClient.setQueriesData<ConversationsData>({ queryKey }, prev => {\n if (!prev?.pages) return prev\n\n return deleteRecordInPagesData({ data: prev, record: { id: conversation.id } })\n })\n\n const restoreLists = (lists: ListsSnapshot) => {\n lists.forEach(([queryKey, data]) => {\n queryClient.setQueryData<ConversationsData>(queryKey, data)\n })\n }\n\n const { mutate: setHidden, ...mutation } = useMutation({\n mutationKey: ['hideConversation', conversation.id],\n scope: { id: `hideConversation-${conversation.id}` },\n onMutate: async (value: boolean) => {\n await queryClient.cancelQueries({ queryKey: listsQueryKey })\n const previousLists = queryClient.getQueriesData<ConversationsData>({\n queryKey: listsQueryKey,\n })\n\n removeFromLists(value ? listsQueryKey : hiddenListsQueryKey)\n setMembershipHidden(value)\n\n return { previousLists }\n },\n mutationFn: (value: boolean) =>\n apiClient.chat.patch<ApiResource<ConversationMembershipResource>>({\n url: `/me/conversations/${conversation.id}/conversation_membership`,\n data: {\n data: { type: 'ConversationMembership', attributes: { hidden: value } },\n fields: { ConversationMembership: 'hidden' },\n },\n }),\n onSuccess: (_response, value, { previousLists }) => {\n Haptic.notificationSuccess()\n\n if (!value) {\n queryClient.invalidateQueries({ queryKey: listsQueryKey })\n return\n }\n\n queryClient.invalidateQueries({ queryKey: hiddenListsQueryKey })\n showToast({\n title: HIDDEN_TOAST_TITLE,\n subtitle: conversation.muted ? HIDDEN_AND_SILENCED_TOAST_SUBTITLE : HIDDEN_TOAST_SUBTITLE,\n action: {\n label: 'Undo',\n onPress: () => {\n restoreLists(previousLists)\n setHidden(false)\n },\n },\n })\n },\n onError: (_error, value, context) => {\n if (context) restoreLists(context.previousLists)\n setMembershipHidden(!value)\n Alert.alert(\n 'Oops',\n `Couldn't ${value ? 'hide' : 'unhide'} this conversation. Please try again.`\n )\n },\n })\n\n return {\n hidden,\n setHidden,\n ...mutation,\n }\n}\n"],"mappings":";AAAA,SAAiCA,WAAW,EAAEC,cAAc,QAAQ,uBAAuB;AAC3F,SAASC,KAAK,QAAQ,cAAc;AAOpC,SAASC,uBAAuB,QAAQ,+BAA+B;AACvE,SAASC,MAAM,QAAQ,0BAA0B;AACjD,SACEC,2BAA2B,EAC3BC,2BAA2B,QACtB,+BAA+B;AACtC,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,YAAY,QAAQ,kBAAkB;AAC/C,SAASC,0BAA0B,QAAQ,oBAAoB;AAC/D,SAASC,kBAAkB,QAAQ,oBAAoB;AAKvD,OAAO,MAAMC,kBAAkB,GAAG,qBAAqB;AACvD,OAAO,MAAMC,qBAAqB,GAAG,iDAAiD;AACtF,OAAO,MAAMC,kCAAkC,GAC7C,4DAA4D;AAE9D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IN;AAAA,CACF","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use_hide_conversations_enabled.d.ts","sourceRoot":"","sources":["../../src/hooks/use_hide_conversations_enabled.ts"],"names":[],"mappings":"AAEA,wBAAgB,2BAA2B,YAI1C"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { availableFeatures, useFeatures } from './use_features';
|
|
3
|
-
export function useHideConversationsEnabled() {
|
|
4
|
-
const $ = _c(2);
|
|
5
|
-
const {
|
|
6
|
-
featureEnabled
|
|
7
|
-
} = useFeatures();
|
|
8
|
-
let t0;
|
|
9
|
-
if ($[0] !== featureEnabled) {
|
|
10
|
-
t0 = featureEnabled(availableFeatures.hide_conversations);
|
|
11
|
-
$[0] = featureEnabled;
|
|
12
|
-
$[1] = t0;
|
|
13
|
-
} else {
|
|
14
|
-
t0 = $[1];
|
|
15
|
-
}
|
|
16
|
-
return t0;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=use_hide_conversations_enabled.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use_hide_conversations_enabled.js","names":["availableFeatures","useFeatures","useHideConversationsEnabled","$","_c","featureEnabled","t0","hide_conversations"],"sources":["../../src/hooks/use_hide_conversations_enabled.ts"],"sourcesContent":["import { availableFeatures, useFeatures } from './use_features'\n\nexport function useHideConversationsEnabled() {\n const { featureEnabled } = useFeatures()\n\n return featureEnabled(availableFeatures.hide_conversations)\n}\n"],"mappings":";AAAA,SAASA,iBAAiB,EAAEC,WAAW,QAAQ,gBAAgB;AAE/D,OAAO,SAAAC,4BAAA;EAAA,MAAAC,CAAA,GAAAC,EAAA;EACL;IAAAC;EAAA,IAA2BJ,WAAW,CAAC,CAAC;EAAA,IAAAK,EAAA;EAAA,IAAAH,CAAA,QAAAE,cAAA;IAEjCC,EAAA,GAAAD,cAAc,CAACL,iBAAiB,CAAAO,kBAAmB,CAAC;IAAAJ,CAAA,MAAAE,cAAA;IAAAF,CAAA,MAAAG,EAAA;EAAA;IAAAA,EAAA,GAAAH,CAAA;EAAA;EAAA,OAApDG,EAAoD;AAAA","ignoreList":[]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { StaticScreenProps } from '@react-navigation/native';
|
|
2
|
-
export declare const ConversationActionsScreenOptions: () => import("@react-navigation/native-stack").NativeStackNavigationOptions;
|
|
3
|
-
export type ConversationActionsScreenProps = StaticScreenProps<{
|
|
4
|
-
conversation_id: number;
|
|
5
|
-
}>;
|
|
6
|
-
export declare function ConversationActionsScreen({ route }: ConversationActionsScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
//# sourceMappingURL=conversation_actions_screen.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_actions_screen.d.ts","sourceRoot":"","sources":["../../src/screens/conversation_actions_screen.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiB,MAAM,0BAA0B,CAAA;AAQ3E,eAAO,MAAM,gCAAgC,6EAE3C,CAAA;AAEF,MAAM,MAAM,8BAA8B,GAAG,iBAAiB,CAAC;IAC7D,eAAe,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF,wBAAgB,yBAAyB,CAAC,EAAE,KAAK,EAAE,EAAE,8BAA8B,2CA6BlF"}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { c as _c } from "react/compiler-runtime";
|
|
2
|
-
import { useNavigation } from '@react-navigation/native';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { StyleSheet } from 'react-native';
|
|
5
|
-
import FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet';
|
|
6
|
-
import { useConversation } from '../hooks/use_conversation';
|
|
7
|
-
import { useHideConversation } from '../hooks/use_hide_conversation';
|
|
8
|
-
import { useHideConversationsEnabled } from '../hooks/use_hide_conversations_enabled';
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
export const ConversationActionsScreenOptions = getFormSheetScreenOptions({
|
|
11
|
-
headerTitle: 'Conversation actions'
|
|
12
|
-
});
|
|
13
|
-
export function ConversationActionsScreen(t0) {
|
|
14
|
-
const $ = _c(14);
|
|
15
|
-
const {
|
|
16
|
-
route
|
|
17
|
-
} = t0;
|
|
18
|
-
const navigation = useNavigation();
|
|
19
|
-
const styles = useStyles();
|
|
20
|
-
const {
|
|
21
|
-
data: conversation
|
|
22
|
-
} = useConversation(route.params);
|
|
23
|
-
let t1;
|
|
24
|
-
if ($[0] !== conversation) {
|
|
25
|
-
t1 = {
|
|
26
|
-
conversation
|
|
27
|
-
};
|
|
28
|
-
$[0] = conversation;
|
|
29
|
-
$[1] = t1;
|
|
30
|
-
} else {
|
|
31
|
-
t1 = $[1];
|
|
32
|
-
}
|
|
33
|
-
const {
|
|
34
|
-
hidden,
|
|
35
|
-
setHidden,
|
|
36
|
-
isPending
|
|
37
|
-
} = useHideConversation(t1);
|
|
38
|
-
const hideConversationsEnabled = useHideConversationsEnabled();
|
|
39
|
-
let t2;
|
|
40
|
-
if ($[2] !== hidden || $[3] !== navigation || $[4] !== setHidden) {
|
|
41
|
-
t2 = () => {
|
|
42
|
-
setHidden(!hidden);
|
|
43
|
-
navigation.goBack();
|
|
44
|
-
};
|
|
45
|
-
$[2] = hidden;
|
|
46
|
-
$[3] = navigation;
|
|
47
|
-
$[4] = setHidden;
|
|
48
|
-
$[5] = t2;
|
|
49
|
-
} else {
|
|
50
|
-
t2 = $[5];
|
|
51
|
-
}
|
|
52
|
-
const handleHidePress = t2;
|
|
53
|
-
let t3;
|
|
54
|
-
if ($[6] !== handleHidePress || $[7] !== hidden || $[8] !== hideConversationsEnabled || $[9] !== isPending) {
|
|
55
|
-
t3 = hideConversationsEnabled && /*#__PURE__*/_jsx(FormSheet.Action, {
|
|
56
|
-
onPress: handleHidePress,
|
|
57
|
-
title: hidden ? "Unhide conversation" : "Hide conversation",
|
|
58
|
-
iconName: hidden ? "general.showEye" : "general.hideEye",
|
|
59
|
-
disabled: isPending,
|
|
60
|
-
accessibilityHint: hidden ? "Shows this conversation in your conversation list again." : "Hides this conversation from your conversation list."
|
|
61
|
-
});
|
|
62
|
-
$[6] = handleHidePress;
|
|
63
|
-
$[7] = hidden;
|
|
64
|
-
$[8] = hideConversationsEnabled;
|
|
65
|
-
$[9] = isPending;
|
|
66
|
-
$[10] = t3;
|
|
67
|
-
} else {
|
|
68
|
-
t3 = $[10];
|
|
69
|
-
}
|
|
70
|
-
let t4;
|
|
71
|
-
if ($[11] !== styles.formSheetContent || $[12] !== t3) {
|
|
72
|
-
t4 = /*#__PURE__*/_jsx(FormSheet.Root, {
|
|
73
|
-
style: styles.formSheetContent,
|
|
74
|
-
children: t3
|
|
75
|
-
});
|
|
76
|
-
$[11] = styles.formSheetContent;
|
|
77
|
-
$[12] = t3;
|
|
78
|
-
$[13] = t4;
|
|
79
|
-
} else {
|
|
80
|
-
t4 = $[13];
|
|
81
|
-
}
|
|
82
|
-
return t4;
|
|
83
|
-
}
|
|
84
|
-
const useStyles = () => StyleSheet.create({
|
|
85
|
-
formSheetContent: {
|
|
86
|
-
paddingTop: 16
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
//# sourceMappingURL=conversation_actions_screen.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"conversation_actions_screen.js","names":["useNavigation","React","StyleSheet","FormSheet","getFormSheetScreenOptions","useConversation","useHideConversation","useHideConversationsEnabled","jsx","_jsx","ConversationActionsScreenOptions","headerTitle","ConversationActionsScreen","t0","$","_c","route","navigation","styles","useStyles","data","conversation","params","t1","hidden","setHidden","isPending","hideConversationsEnabled","t2","goBack","handleHidePress","t3","Action","title","iconName","accessibilityHint","t4","formSheetContent","Root","style","children","create","paddingTop"],"sources":["../../src/screens/conversation_actions_screen.tsx"],"sourcesContent":["import { StaticScreenProps, useNavigation } from '@react-navigation/native'\nimport React from 'react'\nimport { StyleSheet } from 'react-native'\nimport FormSheet, { getFormSheetScreenOptions } from '../components/primitive/form_sheet'\nimport { useConversation } from '../hooks/use_conversation'\nimport { useHideConversation } from '../hooks/use_hide_conversation'\nimport { useHideConversationsEnabled } from '../hooks/use_hide_conversations_enabled'\n\nexport const ConversationActionsScreenOptions = getFormSheetScreenOptions({\n headerTitle: 'Conversation actions',\n})\n\nexport type ConversationActionsScreenProps = StaticScreenProps<{\n conversation_id: number\n}>\n\nexport function ConversationActionsScreen({ route }: ConversationActionsScreenProps) {\n const navigation = useNavigation()\n const styles = useStyles()\n const { data: conversation } = useConversation(route.params)\n const { hidden, setHidden, isPending } = useHideConversation({ conversation })\n const hideConversationsEnabled = useHideConversationsEnabled()\n\n const handleHidePress = () => {\n setHidden(!hidden)\n navigation.goBack()\n }\n\n return (\n <FormSheet.Root style={styles.formSheetContent}>\n {hideConversationsEnabled && (\n <FormSheet.Action\n onPress={handleHidePress}\n title={hidden ? 'Unhide conversation' : 'Hide conversation'}\n iconName={hidden ? 'general.showEye' : 'general.hideEye'}\n disabled={isPending}\n accessibilityHint={\n hidden\n ? 'Shows this conversation in your conversation list again.'\n : 'Hides this conversation from your conversation list.'\n }\n />\n )}\n </FormSheet.Root>\n )\n}\n\nconst useStyles = () =>\n StyleSheet.create({\n formSheetContent: {\n paddingTop: 16,\n },\n })\n"],"mappings":";AAAA,SAA4BA,aAAa,QAAQ,0BAA0B;AAC3E,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,SAAS,IAAIC,yBAAyB,QAAQ,oCAAoC;AACzF,SAASC,eAAe,QAAQ,2BAA2B;AAC3D,SAASC,mBAAmB,QAAQ,gCAAgC;AACpE,SAASC,2BAA2B,QAAQ,yCAAyC;AAAA,SAAAC,GAAA,IAAAC,IAAA;AAErF,OAAO,MAAMC,gCAAgC,GAAGN,yBAAyB,CAAC;EACxEO,WAAW,EAAE;AACf,CAAC,CAAC;AAMF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EAApDT,MAAM,GAAN,qBAAoD,GAApD,mBAAoD;MACjDU,QAA8C,EAA9CV,MAAM,GAAN,iBAA8C,GAA9C,iBAA8C;MAC9CE,QAAS,EAATA,SAAS;MAEjBS,iBAE0D,EAF1DX,MAAM,GAAN,0DAE0D,GAF1D;IAE0D,CAGhE,CAAC;IAAAV,CAAA,MAAAgB,eAAA;IAAAhB,CAAA,MAAAU,MAAA;IAAAV,CAAA,MAAAa,wBAAA;IAAAb,CAAA,MAAAY,SAAA;IAAAZ,CAAA,OAAAiB,EAAA;EAAA;IAAAA,EAAA,GAAAjB,CAAA;EAAA;EAAA,IAAAsB,EAAA;EAAA,IAAAtB,CAAA,SAAAI,MAAA,CAAAmB,gBAAA,IAAAvB,CAAA,SAAAiB,EAAA;IAbHK,EAAA,gBAAA3B,IAAA,CAAAN,SAAA,CAAAmC,IAAA;MAAuBC,KAAuB,EAAvBrB,MAAM,CAAAmB,gBAAiB;MAAAG,QAAA,EAC3CT;IAYA,CACa,CAAC;IAAAjB,CAAA,OAAAI,MAAA,CAAAmB,gBAAA;IAAAvB,CAAA,OAAAiB,EAAA;IAAAjB,CAAA,OAAAsB,EAAA;EAAA;IAAAA,EAAA,GAAAtB,CAAA;EAAA;EAAA,OAdjBsB,EAciB;AAAA;AAIrB,MAAMjB,SAAS,GAAGA,CAAA,KAChBjB,UAAU,CAACuC,MAAM,CAAC;EAChBJ,gBAAgB,EAAE;IAChBK,UAAU,EAAE;EACd;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { LinkingOpenURLOptions } from './native_adapters/linking';
|
|
2
|
-
/**
|
|
3
|
-
* Opens a URL through the host's Linking adapter and never leaves the
|
|
4
|
-
* rejection unhandled.
|
|
5
|
-
*
|
|
6
|
-
* mailto: and tel: links fail for ordinary reasons (no mail app, no phone),
|
|
7
|
-
* so the user gets an alert offering to copy the address. Any other failure
|
|
8
|
-
* is reported through the Log adapter so it stays visible as a handled error.
|
|
9
|
-
*/
|
|
10
|
-
export declare function openUrl(url: string, options?: LinkingOpenURLOptions): Promise<unknown>;
|
|
11
|
-
//# sourceMappingURL=open_url.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"open_url.d.ts","sourceRoot":"","sources":["../../src/utils/open_url.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAItE;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,oBASnE"}
|
package/build/utils/open_url.js
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Alert } from 'react-native';
|
|
2
|
-
import { Clipboard, Linking, Log } from './native_adapters';
|
|
3
|
-
const CONTACT_SCHEME = /^(mailto|tel):/i;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Opens a URL through the host's Linking adapter and never leaves the
|
|
7
|
-
* rejection unhandled.
|
|
8
|
-
*
|
|
9
|
-
* mailto: and tel: links fail for ordinary reasons (no mail app, no phone),
|
|
10
|
-
* so the user gets an alert offering to copy the address. Any other failure
|
|
11
|
-
* is reported through the Log adapter so it stays visible as a handled error.
|
|
12
|
-
*/
|
|
13
|
-
export function openUrl(url, options) {
|
|
14
|
-
return Linking.openURL(url, options).catch(error => {
|
|
15
|
-
if (CONTACT_SCHEME.test(url)) {
|
|
16
|
-
alertUnableToOpen(url);
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
Log.reportError(toError(error, url), {
|
|
20
|
-
extra: {
|
|
21
|
-
url
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
function alertUnableToOpen(url) {
|
|
27
|
-
const address = readableAddress(url);
|
|
28
|
-
Alert.alert('Oops', `Unable to open: ${address}`, [{
|
|
29
|
-
text: 'Copy to clipboard',
|
|
30
|
-
onPress: () => Clipboard.setStringAsync(address)
|
|
31
|
-
}, {
|
|
32
|
-
text: 'OK'
|
|
33
|
-
}]);
|
|
34
|
-
}
|
|
35
|
-
function readableAddress(url) {
|
|
36
|
-
const address = url.replace(CONTACT_SCHEME, '');
|
|
37
|
-
try {
|
|
38
|
-
return decodeURIComponent(address);
|
|
39
|
-
} catch {
|
|
40
|
-
return address;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function toError(error, url) {
|
|
44
|
-
return error instanceof Error ? error : new Error(`Unable to open URL: ${url}`);
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=open_url.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"open_url.js","names":["Alert","Clipboard","Linking","Log","CONTACT_SCHEME","openUrl","url","options","openURL","catch","error","test","alertUnableToOpen","reportError","toError","extra","address","readableAddress","alert","text","onPress","setStringAsync","replace","decodeURIComponent","Error"],"sources":["../../src/utils/open_url.ts"],"sourcesContent":["import { Alert } from 'react-native'\nimport { Clipboard, Linking, Log } from './native_adapters'\nimport type { LinkingOpenURLOptions } from './native_adapters/linking'\n\nconst CONTACT_SCHEME = /^(mailto|tel):/i\n\n/**\n * Opens a URL through the host's Linking adapter and never leaves the\n * rejection unhandled.\n *\n * mailto: and tel: links fail for ordinary reasons (no mail app, no phone),\n * so the user gets an alert offering to copy the address. Any other failure\n * is reported through the Log adapter so it stays visible as a handled error.\n */\nexport function openUrl(url: string, options?: LinkingOpenURLOptions) {\n return Linking.openURL(url, options).catch((error: unknown) => {\n if (CONTACT_SCHEME.test(url)) {\n alertUnableToOpen(url)\n return\n }\n\n Log.reportError(toError(error, url), { extra: { url } })\n })\n}\n\nfunction alertUnableToOpen(url: string) {\n const address = readableAddress(url)\n\n Alert.alert('Oops', `Unable to open: ${address}`, [\n { text: 'Copy to clipboard', onPress: () => Clipboard.setStringAsync(address) },\n { text: 'OK' },\n ])\n}\n\nfunction readableAddress(url: string) {\n const address = url.replace(CONTACT_SCHEME, '')\n\n try {\n return decodeURIComponent(address)\n } catch {\n return address\n }\n}\n\nfunction toError(error: unknown, url: string) {\n return error instanceof Error ? error : new Error(`Unable to open URL: ${url}`)\n}\n"],"mappings":"AAAA,SAASA,KAAK,QAAQ,cAAc;AACpC,SAASC,SAAS,EAAEC,OAAO,EAAEC,GAAG,QAAQ,mBAAmB;AAG3D,MAAMC,cAAc,GAAG,iBAAiB;;AAExC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,OAAOA,CAACC,GAAW,EAAEC,OAA+B,EAAE;EACpE,OAAOL,OAAO,CAACM,OAAO,CAACF,GAAG,EAAEC,OAAO,CAAC,CAACE,KAAK,CAAEC,KAAc,IAAK;IAC7D,IAAIN,cAAc,CAACO,IAAI,CAACL,GAAG,CAAC,EAAE;MAC5BM,iBAAiB,CAACN,GAAG,CAAC;MACtB;IACF;IAEAH,GAAG,CAACU,WAAW,CAACC,OAAO,CAACJ,KAAK,EAAEJ,GAAG,CAAC,EAAE;MAAES,KAAK,EAAE;QAAET;MAAI;IAAE,CAAC,CAAC;EAC1D,CAAC,CAAC;AACJ;AAEA,SAASM,iBAAiBA,CAACN,GAAW,EAAE;EACtC,MAAMU,OAAO,GAAGC,eAAe,CAACX,GAAG,CAAC;EAEpCN,KAAK,CAACkB,KAAK,CAAC,MAAM,EAAE,mBAAmBF,OAAO,EAAE,EAAE,CAChD;IAAEG,IAAI,EAAE,mBAAmB;IAAEC,OAAO,EAAEA,CAAA,KAAMnB,SAAS,CAACoB,cAAc,CAACL,OAAO;EAAE,CAAC,EAC/E;IAAEG,IAAI,EAAE;EAAK,CAAC,CACf,CAAC;AACJ;AAEA,SAASF,eAAeA,CAACX,GAAW,EAAE;EACpC,MAAMU,OAAO,GAAGV,GAAG,CAACgB,OAAO,CAAClB,cAAc,EAAE,EAAE,CAAC;EAE/C,IAAI;IACF,OAAOmB,kBAAkB,CAACP,OAAO,CAAC;EACpC,CAAC,CAAC,MAAM;IACN,OAAOA,OAAO;EAChB;AACF;AAEA,SAASF,OAAOA,CAACJ,KAAc,EAAEJ,GAAW,EAAE;EAC5C,OAAOI,KAAK,YAAYc,KAAK,GAAGd,KAAK,GAAG,IAAIc,KAAK,CAAC,uBAAuBlB,GAAG,EAAE,CAAC;AACjF","ignoreList":[]}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export interface ToastAction {
|
|
2
|
-
label: string;
|
|
3
|
-
onPress: () => void;
|
|
4
|
-
}
|
|
5
|
-
export interface ToastOptions {
|
|
6
|
-
title: string;
|
|
7
|
-
subtitle?: string;
|
|
8
|
-
action?: ToastAction;
|
|
9
|
-
}
|
|
10
|
-
export interface ToastState extends ToastOptions {
|
|
11
|
-
id: number;
|
|
12
|
-
}
|
|
13
|
-
type Listener = () => void;
|
|
14
|
-
export declare const toastStore: {
|
|
15
|
-
getSnapshot: () => ToastState | null;
|
|
16
|
-
subscribe: (listener: Listener) => () => void;
|
|
17
|
-
};
|
|
18
|
-
export declare function showToast(options: ToastOptions): void;
|
|
19
|
-
export declare function dismissToast(id?: number): void;
|
|
20
|
-
export {};
|
|
21
|
-
//# sourceMappingURL=toast_store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toast_store.d.ts","sourceRoot":"","sources":["../../src/utils/toast_store.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB;AAED,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C,EAAE,EAAE,MAAM,CAAA;CACX;AAED,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAA;AAQ1B,eAAO,MAAM,UAAU;;0BAEC,QAAQ;CAM/B,CAAA;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,YAAY,QAG9C;AAED,wBAAgB,YAAY,CAAC,EAAE,CAAC,EAAE,MAAM,QAMvC"}
|