@planningcenter/chat-react-native 3.15.0-rc.1 → 3.15.0-rc.10
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/conversations/conversation_actions.js +1 -1
- package/build/components/conversations/conversation_actions.js.map +1 -1
- package/build/components/display/action_button.js +1 -3
- package/build/components/display/action_button.js.map +1 -1
- package/build/components/display/avatar.d.ts +3 -1
- package/build/components/display/avatar.d.ts.map +1 -1
- package/build/components/display/avatar.js +2 -2
- package/build/components/display/avatar.js.map +1 -1
- package/build/components/display/avatar_group.d.ts +3 -1
- package/build/components/display/avatar_group.d.ts.map +1 -1
- package/build/components/display/avatar_group.js +2 -2
- package/build/components/display/avatar_group.js.map +1 -1
- package/build/components/display/icon.d.ts +26 -13
- package/build/components/display/icon.d.ts.map +1 -1
- package/build/components/display/icon.js +0 -12
- package/build/components/display/icon.js.map +1 -1
- package/build/components/display/index.d.ts +1 -0
- package/build/components/display/index.d.ts.map +1 -1
- package/build/components/display/index.js +1 -0
- package/build/components/display/index.js.map +1 -1
- package/build/components/display/pressable_row.d.ts +14 -0
- package/build/components/display/pressable_row.d.ts.map +1 -0
- package/build/components/display/pressable_row.js +65 -0
- package/build/components/display/pressable_row.js.map +1 -0
- package/build/components/primitive/avatar_primitive.d.ts +2 -0
- package/build/components/primitive/avatar_primitive.d.ts.map +1 -1
- package/build/components/primitive/avatar_primitive.js +20 -19
- package/build/components/primitive/avatar_primitive.js.map +1 -1
- package/build/components/primitive/form_sheet.d.ts +3 -2
- package/build/components/primitive/form_sheet.d.ts.map +1 -1
- package/build/components/primitive/form_sheet.js +5 -3
- package/build/components/primitive/form_sheet.js.map +1 -1
- package/build/hooks/use_api.d.ts +1 -1
- package/build/hooks/use_api.d.ts.map +1 -1
- package/build/hooks/use_api.js.map +1 -1
- package/build/hooks/use_api_client.d.ts +1 -1
- package/build/hooks/use_api_client.d.ts.map +1 -1
- package/build/hooks/use_api_client.js +1 -1
- package/build/hooks/use_api_client.js.map +1 -1
- package/build/hooks/use_app_name.d.ts +3 -0
- package/build/hooks/use_app_name.d.ts.map +1 -0
- package/build/hooks/use_app_name.js +12 -0
- package/build/hooks/use_app_name.js.map +1 -0
- package/build/hooks/use_async_storage.d.ts +1 -1
- package/build/hooks/use_async_storage.d.ts.map +1 -1
- package/build/hooks/use_async_storage.js +6 -5
- package/build/hooks/use_async_storage.js.map +1 -1
- package/build/hooks/use_report_bug_action.d.ts +1 -1
- package/build/hooks/use_report_bug_action.d.ts.map +1 -1
- package/build/hooks/use_report_bug_action.js +1 -9
- package/build/hooks/use_report_bug_action.js.map +1 -1
- package/build/hooks/use_suspense_api.d.ts +1 -1
- package/build/hooks/use_suspense_api.d.ts.map +1 -1
- package/build/hooks/use_suspense_api.js.map +1 -1
- package/build/index.d.ts +2 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/navigation/index.d.ts +20 -5
- package/build/navigation/index.d.ts.map +1 -1
- package/build/navigation/index.js +23 -15
- package/build/navigation/index.js.map +1 -1
- package/build/polyfills/events/CustomEvent.d.ts +21 -0
- package/build/polyfills/events/CustomEvent.d.ts.map +1 -0
- package/build/polyfills/events/CustomEvent.js +22 -0
- package/build/polyfills/events/CustomEvent.js.map +1 -0
- package/build/polyfills/events/Event.d.ts +49 -0
- package/build/polyfills/events/Event.d.ts.map +1 -0
- package/build/polyfills/events/Event.js +125 -0
- package/build/polyfills/events/Event.js.map +1 -0
- package/build/polyfills/events/EventHandlerAttributes.d.ts +8 -0
- package/build/polyfills/events/EventHandlerAttributes.d.ts.map +1 -0
- package/build/polyfills/events/EventHandlerAttributes.js +46 -0
- package/build/polyfills/events/EventHandlerAttributes.js.map +1 -0
- package/build/polyfills/events/EventTarget.d.ts +33 -0
- package/build/polyfills/events/EventTarget.d.ts.map +1 -0
- package/build/polyfills/events/EventTarget.js +238 -0
- package/build/polyfills/events/EventTarget.js.map +1 -0
- package/build/polyfills/events/internals/EventInternals.d.ts +30 -0
- package/build/polyfills/events/internals/EventInternals.d.ts.map +1 -0
- package/build/polyfills/events/internals/EventInternals.js +76 -0
- package/build/polyfills/events/internals/EventInternals.js.map +1 -0
- package/build/polyfills/events/internals/EventTargetInternals.d.ts +9 -0
- package/build/polyfills/events/internals/EventTargetInternals.d.ts.map +1 -0
- package/build/polyfills/events/internals/EventTargetInternals.js +11 -0
- package/build/polyfills/events/internals/EventTargetInternals.js.map +1 -0
- package/build/polyfills/webidl/PlatformObjects.d.ts +31 -0
- package/build/polyfills/webidl/PlatformObjects.d.ts.map +1 -0
- package/build/polyfills/webidl/PlatformObjects.js +39 -0
- package/build/polyfills/webidl/PlatformObjects.js.map +1 -0
- package/build/screens/bug_report_screen.d.ts.map +1 -1
- package/build/screens/bug_report_screen.js +62 -57
- package/build/screens/bug_report_screen.js.map +1 -1
- package/build/screens/conversation_filters/components/conversation_filters.js +9 -7
- package/build/screens/conversation_filters/components/conversation_filters.js.map +1 -1
- package/build/screens/conversation_filters/components/rows.d.ts.map +1 -1
- package/build/screens/conversation_filters/components/rows.js +50 -31
- package/build/screens/conversation_filters/components/rows.js.map +1 -1
- package/build/screens/conversations/conversations_screen.d.ts.map +1 -1
- package/build/screens/conversations/conversations_screen.js +6 -6
- package/build/screens/conversations/conversations_screen.js.map +1 -1
- package/build/screens/design_system_screen.js +1 -1
- package/build/screens/design_system_screen.js.map +1 -1
- package/build/screens/get_help_screen.d.ts +5 -0
- package/build/screens/get_help_screen.d.ts.map +1 -0
- package/build/screens/get_help_screen.js +94 -0
- package/build/screens/get_help_screen.js.map +1 -0
- package/build/screens/message_actions_screen.d.ts +1 -1
- package/build/screens/message_actions_screen.d.ts.map +1 -1
- package/build/screens/message_actions_screen.js +14 -11
- package/build/screens/message_actions_screen.js.map +1 -1
- package/build/utils/client/index.d.ts +1 -0
- package/build/utils/client/index.d.ts.map +1 -1
- package/build/utils/client/index.js +1 -0
- package/build/utils/client/index.js.map +1 -1
- package/build/utils/client/types.d.ts +61 -0
- package/build/utils/client/types.d.ts.map +1 -0
- package/build/utils/client/types.js +2 -0
- package/build/utils/client/types.js.map +1 -0
- package/build/utils/theme.d.ts +1 -0
- package/build/utils/theme.d.ts.map +1 -1
- package/build/utils/theme.js +2 -0
- package/build/utils/theme.js.map +1 -1
- package/package.json +5 -5
- package/src/__tests__/event-polyfill.test.ts +314 -0
- package/src/components/conversations/conversation_actions.tsx +1 -1
- package/src/components/display/action_button.tsx +1 -4
- package/src/components/display/avatar.tsx +5 -1
- package/src/components/display/avatar_group.tsx +5 -1
- package/src/components/display/icon.tsx +17 -14
- package/src/components/display/index.ts +1 -0
- package/src/components/display/pressable_row.tsx +103 -0
- package/src/components/primitive/avatar_primitive.tsx +35 -19
- package/src/components/primitive/form_sheet.tsx +33 -5
- package/src/hooks/use_api.ts +1 -1
- package/src/hooks/use_api_client.ts +2 -2
- package/src/hooks/use_app_name.ts +17 -0
- package/src/hooks/use_async_storage.ts +8 -5
- package/src/hooks/use_report_bug_action.ts +2 -10
- package/src/hooks/use_suspense_api.ts +1 -1
- package/src/index.tsx +2 -0
- package/src/navigation/index.tsx +38 -25
- package/src/polyfills/events/CustomEvent.ts +32 -0
- package/src/polyfills/events/Event.ts +186 -0
- package/src/polyfills/events/EventHandlerAttributes.ts +67 -0
- package/src/polyfills/events/EventTarget.ts +360 -0
- package/src/polyfills/events/README.md +1 -0
- package/src/polyfills/events/internals/EventInternals.ts +95 -0
- package/src/polyfills/events/internals/EventTargetInternals.ts +16 -0
- package/src/polyfills/webidl/PlatformObjects.ts +50 -0
- package/src/screens/bug_report_screen.tsx +79 -67
- package/src/screens/conversation_filters/components/conversation_filters.tsx +10 -7
- package/src/screens/conversation_filters/components/rows.tsx +63 -50
- package/src/screens/conversations/conversations_screen.tsx +7 -7
- package/src/screens/design_system_screen.tsx +1 -1
- package/src/screens/get_help_screen.tsx +131 -0
- package/src/screens/message_actions_screen.tsx +34 -12
- package/src/utils/client/index.ts +1 -0
- package/src/utils/theme.ts +3 -0
- /package/src/utils/client/{types.d.ts → types.ts} +0 -0
|
@@ -14,6 +14,7 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context'
|
|
|
14
14
|
import { useTheme } from '../../hooks'
|
|
15
15
|
import type { ButtonProps, TextButtonProps } from '../display'
|
|
16
16
|
import { Button, Heading, Icon, IconString, Text, TextButton } from '../display'
|
|
17
|
+
import { MAX_FONT_SIZE_MULTIPLIER_LANDMARK } from '../../utils'
|
|
17
18
|
|
|
18
19
|
// =================================
|
|
19
20
|
// ====== Exports ==================
|
|
@@ -146,7 +147,11 @@ function FormSheetHeaderTitle({ children }: FormSheetHeaderTitleProps) {
|
|
|
146
147
|
const styles = useStyles()
|
|
147
148
|
|
|
148
149
|
return (
|
|
149
|
-
<Heading
|
|
150
|
+
<Heading
|
|
151
|
+
variant="h3"
|
|
152
|
+
style={styles.headerTitle}
|
|
153
|
+
maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}
|
|
154
|
+
>
|
|
150
155
|
{children}
|
|
151
156
|
</Heading>
|
|
152
157
|
)
|
|
@@ -174,10 +179,23 @@ FormSheetHeaderActions.displayName = 'FormSheet.HeaderActions'
|
|
|
174
179
|
// ====== FormSheetHeaderTextButton ==========
|
|
175
180
|
// ===========================================
|
|
176
181
|
|
|
177
|
-
|
|
182
|
+
// We are omitting `onLongPress` because we are instead supporting `accessibilityShowsLargeContentViewer`.
|
|
183
|
+
// This is triggered by an `onLongPress` event when an iOS device is in Apple's accessible font scale range.
|
|
184
|
+
// Triggering this prop will display an almost full screen iOS a11y button.
|
|
185
|
+
interface FormSheetHeaderTextButtonProps
|
|
186
|
+
extends Omit<TextButtonProps, 'maxFontSizeMultiplier' | 'onLongPress'> {
|
|
187
|
+
children: string
|
|
188
|
+
}
|
|
178
189
|
|
|
179
190
|
function FormSheetHeaderTextButton(props: FormSheetHeaderTextButtonProps) {
|
|
180
|
-
return
|
|
191
|
+
return (
|
|
192
|
+
<TextButton
|
|
193
|
+
{...props}
|
|
194
|
+
maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}
|
|
195
|
+
accessibilityShowsLargeContentViewer
|
|
196
|
+
accessibilityLargeContentTitle={props.children}
|
|
197
|
+
/>
|
|
198
|
+
)
|
|
181
199
|
}
|
|
182
200
|
|
|
183
201
|
FormSheetHeaderTextButton.displayName = 'FormSheet.HeaderTextButton'
|
|
@@ -186,10 +204,19 @@ FormSheetHeaderTextButton.displayName = 'FormSheet.HeaderTextButton'
|
|
|
186
204
|
// ====== FormSheetHeaderButton ============
|
|
187
205
|
// =========================================
|
|
188
206
|
|
|
189
|
-
|
|
207
|
+
// Same `onLongPress`note as `FormSheetHeaderTextButtonProps`
|
|
208
|
+
interface FormSheetHeaderButtonProps
|
|
209
|
+
extends Omit<ButtonProps, 'maxFontSizeMultiplier' | 'onLongPress'> {}
|
|
190
210
|
|
|
191
211
|
function FormSheetHeaderButton(props: FormSheetHeaderButtonProps) {
|
|
192
|
-
return
|
|
212
|
+
return (
|
|
213
|
+
<Button
|
|
214
|
+
{...props}
|
|
215
|
+
maxFontSizeMultiplier={MAX_FONT_SIZE_MULTIPLIER_LANDMARK}
|
|
216
|
+
accessibilityShowsLargeContentViewer
|
|
217
|
+
accessibilityLargeContentTitle={props.title}
|
|
218
|
+
/>
|
|
219
|
+
)
|
|
193
220
|
}
|
|
194
221
|
|
|
195
222
|
FormSheetHeaderButton.displayName = 'FormSheet.HeaderButton'
|
|
@@ -324,6 +351,7 @@ const useStyles = ({ appearance = 'neutral' }: Styles = {}) => {
|
|
|
324
351
|
},
|
|
325
352
|
headerTitle: {
|
|
326
353
|
textAlign: 'left',
|
|
354
|
+
flex: 1,
|
|
327
355
|
},
|
|
328
356
|
headerActions: {
|
|
329
357
|
flexDirection: 'row',
|
package/src/hooks/use_api.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useQuery,
|
|
6
6
|
} from '@tanstack/react-query'
|
|
7
7
|
import { ApiCollection, ApiError, ApiResource, ResourceObject } from '../types'
|
|
8
|
-
import { GetRequest, RequestData } from '../utils/client
|
|
8
|
+
import { GetRequest, RequestData } from '../utils/client'
|
|
9
9
|
import { App, useApiClient } from './use_api_client'
|
|
10
10
|
import { getRequestQueryKey, RequestQueryKey } from './use_suspense_api'
|
|
11
11
|
|
|
@@ -3,8 +3,8 @@ import { ChatContext } from '../contexts/chat_context'
|
|
|
3
3
|
import { Client } from '../utils/client'
|
|
4
4
|
import { Uri } from '../utils'
|
|
5
5
|
|
|
6
|
-
export type App = 'chat' | 'groups' | 'services'
|
|
7
|
-
const apps: App[] = ['chat', 'groups', 'services']
|
|
6
|
+
export type App = 'chat' | 'groups' | 'services' | 'people'
|
|
7
|
+
const apps: App[] = ['chat', 'groups', 'services', 'people']
|
|
8
8
|
|
|
9
9
|
export type ApiClient = { [_K in App]: Client }
|
|
10
10
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import DeviceInfo from 'react-native-device-info'
|
|
2
|
+
|
|
3
|
+
export type AppName = 'chat' | 'churchcenter' | 'services'
|
|
4
|
+
|
|
5
|
+
export const useAppName = (): AppName => {
|
|
6
|
+
const applicationName = DeviceInfo.getApplicationName()
|
|
7
|
+
|
|
8
|
+
if (/churchcenter/i.test(applicationName)) {
|
|
9
|
+
return 'churchcenter'
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (/services/i.test(applicationName)) {
|
|
13
|
+
return 'services'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return 'chat'
|
|
17
|
+
}
|
|
@@ -4,7 +4,7 @@ import { useCallback } from 'react'
|
|
|
4
4
|
|
|
5
5
|
const cacheKeyGenerator = (key: string) => [`AsyncStorageResource:${key}`]
|
|
6
6
|
|
|
7
|
-
type SetValue<TCacheData> = (_itemValue?: TCacheData | null) => void
|
|
7
|
+
type SetValue<TCacheData> = (_itemValue?: TCacheData | null) => Promise<void>
|
|
8
8
|
|
|
9
9
|
export function useAsyncStorage<TCacheData>(
|
|
10
10
|
key: string,
|
|
@@ -28,11 +28,14 @@ export function useAsyncStorage<TCacheData>(
|
|
|
28
28
|
const setValue: SetValue<TCacheData> = useCallback(
|
|
29
29
|
itemValue => {
|
|
30
30
|
if (itemValue === null || itemValue === undefined) {
|
|
31
|
-
AsyncStorage.removeItem(key)
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
return AsyncStorage.removeItem(key).then(() => {
|
|
32
|
+
refetch()
|
|
33
|
+
})
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
|
|
36
|
+
return AsyncStorage.setItem(key, JSON.stringify(itemValue)).then(() => {
|
|
37
|
+
refetch()
|
|
38
|
+
})
|
|
36
39
|
},
|
|
37
40
|
[key, refetch]
|
|
38
41
|
)
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/react-query'
|
|
2
2
|
import { useApiClient } from './use_api_client'
|
|
3
|
-
import DeviceInfo from 'react-native-device-info'
|
|
4
|
-
const brand = DeviceInfo.getBrand()
|
|
5
|
-
const model = DeviceInfo.getModel()
|
|
6
|
-
const systemName = DeviceInfo.getSystemName()
|
|
7
|
-
const systemVersion = DeviceInfo.getSystemVersion()
|
|
8
|
-
const readableVersion = DeviceInfo.getReadableVersion()
|
|
9
|
-
const appName = DeviceInfo.getApplicationName()
|
|
10
3
|
|
|
11
4
|
export const useReportBugAction = () => {
|
|
12
5
|
const apiClient = useApiClient()
|
|
@@ -18,7 +11,7 @@ export const useReportBugAction = () => {
|
|
|
18
11
|
attachmentIds,
|
|
19
12
|
}: {
|
|
20
13
|
description: string
|
|
21
|
-
description_json: string
|
|
14
|
+
description_json: Record<string, any>
|
|
22
15
|
attachmentIds: string[]
|
|
23
16
|
}) => {
|
|
24
17
|
return apiClient.chat.post({
|
|
@@ -28,8 +21,7 @@ export const useReportBugAction = () => {
|
|
|
28
21
|
type: '',
|
|
29
22
|
attributes: {
|
|
30
23
|
description,
|
|
31
|
-
description_json,
|
|
32
|
-
device_info: `${appName}/${readableVersion} (${brand}, ${model}, ${systemName}, ${systemVersion})`,
|
|
24
|
+
description_json: JSON.stringify(description_json),
|
|
33
25
|
attachment_ids: attachmentIds,
|
|
34
26
|
},
|
|
35
27
|
},
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
UseSuspenseQueryOptions,
|
|
7
7
|
} from '@tanstack/react-query'
|
|
8
8
|
import { ApiCollection, ApiResource, ResourceObject } from '../types'
|
|
9
|
-
import { GetRequest, RequestData } from '../utils/client
|
|
9
|
+
import { GetRequest, RequestData } from '../utils/client'
|
|
10
10
|
import { App, useApiClient } from './use_api_client'
|
|
11
11
|
import { Log } from '../utils'
|
|
12
12
|
import { ApiError } from '../types/api_primitives'
|
package/src/index.tsx
CHANGED
|
@@ -8,3 +8,5 @@ export * from './types'
|
|
|
8
8
|
export { platformFontWeightBold, Session, TemporaryDefaultColorsType, Uri } from './utils'
|
|
9
9
|
export * from './utils/client'
|
|
10
10
|
export * from './utils/native_adapters'
|
|
11
|
+
export { default as Event } from './polyfills/events/Event'
|
|
12
|
+
export { CustomEvent } from './polyfills/events/CustomEvent'
|
package/src/navigation/index.tsx
CHANGED
|
@@ -4,47 +4,50 @@ import {
|
|
|
4
4
|
createNativeStackNavigator,
|
|
5
5
|
NativeStackHeaderRightProps,
|
|
6
6
|
} from '@react-navigation/native-stack'
|
|
7
|
+
import { CardStyleInterpolators } from '@react-navigation/stack'
|
|
7
8
|
import React from 'react'
|
|
9
|
+
import { Platform } from 'react-native'
|
|
8
10
|
import { Icon } from '../components'
|
|
11
|
+
import { HeaderTextButton } from '../components/display/platform_modal_header_buttons'
|
|
12
|
+
import {
|
|
13
|
+
AttachmentActionsScreen,
|
|
14
|
+
AttachmentActionsScreenOptions,
|
|
15
|
+
} from '../screens/attachment_actions/attachment_actions_screen'
|
|
16
|
+
import { BugReportScreen, BugReportScreenOptions } from '../screens/bug_report_screen'
|
|
17
|
+
import {
|
|
18
|
+
MessageReadReceiptsScreen,
|
|
19
|
+
MessageReadReceiptsScreenOptions,
|
|
20
|
+
} from '../screens/conversation/message_read_receipts_screen'
|
|
9
21
|
import { ConversationDetailsScreen } from '../screens/conversation_details_screen'
|
|
22
|
+
import {
|
|
23
|
+
ConversationFilterReceipientsScreenOptions,
|
|
24
|
+
ConversationFilterRecipientsScreen,
|
|
25
|
+
} from '../screens/conversation_filter_recipients/conversation_filter_recipients_screen'
|
|
26
|
+
import { ConversationFiltersParams } from '../screens/conversation_filters/screen_props'
|
|
27
|
+
import {
|
|
28
|
+
ConversationFiltersScreen,
|
|
29
|
+
ConversationFiltersScreenOptions,
|
|
30
|
+
} from '../screens/conversation_filters_screen'
|
|
31
|
+
import { ConversationNewScreen } from '../screens/conversation_new/conversation_new_screen'
|
|
10
32
|
import {
|
|
11
33
|
ConversationRouteProps,
|
|
12
34
|
ConversationScreen,
|
|
13
35
|
ConversationScreenTitle,
|
|
14
36
|
} from '../screens/conversation_screen'
|
|
15
|
-
import {
|
|
16
|
-
import { ConversationNewScreen } from '../screens/conversation_new/conversation_new_screen'
|
|
17
|
-
import {
|
|
18
|
-
ConversationFilterReceipientsScreenOptions,
|
|
19
|
-
ConversationFilterRecipientsScreen,
|
|
20
|
-
} from '../screens/conversation_filter_recipients/conversation_filter_recipients_screen'
|
|
37
|
+
import { ConversationSelectGroupRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_group_recipients_screen'
|
|
21
38
|
import { ConversationSelectRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_recipients_screen'
|
|
39
|
+
import { ConversationSelectTeamsILeadRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen'
|
|
40
|
+
import { ConversationsScreen } from '../screens/conversations/conversations_screen'
|
|
41
|
+
import { GetHelpScreen } from '../screens/get_help_screen'
|
|
22
42
|
import {
|
|
23
43
|
MessageActionsScreen,
|
|
24
44
|
MessageActionsScreenOptions,
|
|
25
45
|
} from '../screens/message_actions_screen'
|
|
26
|
-
import { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen'
|
|
27
46
|
import { NotFound } from '../screens/not_found'
|
|
28
47
|
import { ReactionsScreen, ReactionsScreenOptions } from '../screens/reactions_screen'
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
ConversationFiltersScreen,
|
|
32
|
-
ConversationFiltersScreenOptions,
|
|
33
|
-
} from '../screens/conversation_filters_screen'
|
|
34
|
-
import { ConversationFiltersParams } from '../screens/conversation_filters/screen_props'
|
|
35
|
-
import { ConversationSelectGroupRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_group_recipients_screen'
|
|
36
|
-
import { ConversationSelectTeamsILeadRecipientsScreen } from '../screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen'
|
|
37
|
-
import { AttachmentActionsScreenOptions } from '../screens/attachment_actions/attachment_actions_screen'
|
|
38
|
-
import { AttachmentActionsScreen } from '../screens/attachment_actions/attachment_actions_screen'
|
|
39
|
-
import { BugReportScreen, BugReportScreenOptions } from '../screens/bug_report_screen'
|
|
40
|
-
import {
|
|
41
|
-
MessageReadReceiptsScreen,
|
|
42
|
-
MessageReadReceiptsScreenOptions,
|
|
43
|
-
} from '../screens/conversation/message_read_receipts_screen'
|
|
44
|
-
import { Platform } from 'react-native'
|
|
45
|
-
import { HeaderTextButton } from '../components/display/platform_modal_header_buttons'
|
|
48
|
+
import { SendGiphyScreen, SendGiphyScreenOptions } from '../screens/send_giphy_screen'
|
|
46
49
|
import { TeamConversationScreen } from '../screens/team_conversation_screen'
|
|
47
|
-
import {
|
|
50
|
+
import { ScreenLayout } from './screenLayout'
|
|
48
51
|
|
|
49
52
|
const HEADER_BACK_BUTTON_LAYOUT_RESET_STYLES = {
|
|
50
53
|
marginLeft: Platform.select({ ios: -8, default: -3 }),
|
|
@@ -231,6 +234,16 @@ export const ChatStack = createNativeStackNavigator({
|
|
|
231
234
|
screen: BugReportScreen,
|
|
232
235
|
options: BugReportScreenOptions,
|
|
233
236
|
},
|
|
237
|
+
GetHelp: {
|
|
238
|
+
screen: GetHelpScreen,
|
|
239
|
+
options: ({ navigation }) => ({
|
|
240
|
+
headerTitle: 'Get help',
|
|
241
|
+
presentation: 'modal',
|
|
242
|
+
headerLeft: props => (
|
|
243
|
+
<HeaderTextButton {...props} onPress={navigation.goBack} title="Close" />
|
|
244
|
+
),
|
|
245
|
+
}),
|
|
246
|
+
},
|
|
234
247
|
NotFound: {
|
|
235
248
|
screen: NotFound,
|
|
236
249
|
options: {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This module implements the `CustomEvent` interface from the DOM.
|
|
10
|
+
* See https://dom.spec.whatwg.org/#interface-customevent.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import Event from './Event'
|
|
14
|
+
import type { EventInit as RNEventInit } from './Event'
|
|
15
|
+
|
|
16
|
+
export interface CustomEventInit extends RNEventInit {
|
|
17
|
+
detail?: unknown
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export class CustomEvent extends Event {
|
|
21
|
+
private _detail: unknown
|
|
22
|
+
|
|
23
|
+
constructor(type: string, options?: CustomEventInit) {
|
|
24
|
+
super(type, options)
|
|
25
|
+
|
|
26
|
+
this._detail = options?.detail
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
get detail(): unknown {
|
|
30
|
+
return this._detail
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* This module implements the `Event` interface from the DOM.
|
|
10
|
+
* See https://dom.spec.whatwg.org/#interface-event.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import type RNEventTarget from './EventTarget'
|
|
14
|
+
import {
|
|
15
|
+
getComposedPath,
|
|
16
|
+
getCurrentTarget,
|
|
17
|
+
getEventPhase,
|
|
18
|
+
getInPassiveListenerFlag,
|
|
19
|
+
getIsTrusted,
|
|
20
|
+
getTarget,
|
|
21
|
+
setStopImmediatePropagationFlag,
|
|
22
|
+
setStopPropagationFlag,
|
|
23
|
+
setIsTrusted,
|
|
24
|
+
setEventPhase,
|
|
25
|
+
} from './internals/EventInternals'
|
|
26
|
+
import { setPlatformObject } from '../webidl/PlatformObjects'
|
|
27
|
+
|
|
28
|
+
export interface EventInit {
|
|
29
|
+
bubbles?: boolean
|
|
30
|
+
cancelable?: boolean
|
|
31
|
+
composed?: boolean
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export type EventPhase = 0 | 1 | 2 | 3
|
|
35
|
+
|
|
36
|
+
export default class Event {
|
|
37
|
+
static NONE: 0
|
|
38
|
+
static CAPTURING_PHASE: 1
|
|
39
|
+
static AT_TARGET: 2
|
|
40
|
+
static BUBBLING_PHASE: 3
|
|
41
|
+
|
|
42
|
+
readonly NONE!: 0
|
|
43
|
+
readonly CAPTURING_PHASE!: 1
|
|
44
|
+
readonly AT_TARGET!: 2
|
|
45
|
+
readonly BUBBLING_PHASE!: 3
|
|
46
|
+
|
|
47
|
+
private _bubbles: boolean
|
|
48
|
+
private _cancelable: boolean
|
|
49
|
+
private _composed: boolean
|
|
50
|
+
private _type: string
|
|
51
|
+
|
|
52
|
+
private _defaultPrevented: boolean = false
|
|
53
|
+
private _timeStamp: number = performance.now()
|
|
54
|
+
|
|
55
|
+
// Symbol-keyed fields are internal and managed via helpers; not declared here.
|
|
56
|
+
|
|
57
|
+
constructor(type: string, options?: EventInit | null) {
|
|
58
|
+
if (arguments.length < 1) {
|
|
59
|
+
throw new TypeError("Failed to construct 'Event': 1 argument required, but only 0 present.")
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const typeOfOptions = typeof options
|
|
63
|
+
if (options != null && typeOfOptions !== 'object' && typeOfOptions !== 'function') {
|
|
64
|
+
throw new TypeError(
|
|
65
|
+
"Failed to construct 'Event': The provided value is not of type 'EventInit'."
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
this._type = String(type)
|
|
70
|
+
this._bubbles = Boolean((options as EventInit | undefined)?.bubbles)
|
|
71
|
+
this._cancelable = Boolean((options as EventInit | undefined)?.cancelable)
|
|
72
|
+
this._composed = Boolean((options as EventInit | undefined)?.composed)
|
|
73
|
+
|
|
74
|
+
// Initialize internal flags
|
|
75
|
+
setIsTrusted(this, false)
|
|
76
|
+
setEventPhase(this, 0 as 0)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
get bubbles(): boolean {
|
|
80
|
+
return this._bubbles
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
get cancelable(): boolean {
|
|
84
|
+
return this._cancelable
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
get composed(): boolean {
|
|
88
|
+
return this._composed
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
get currentTarget(): RNEventTarget | null {
|
|
92
|
+
return getCurrentTarget(this)
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
get defaultPrevented(): boolean {
|
|
96
|
+
return this._defaultPrevented
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
get eventPhase(): EventPhase {
|
|
100
|
+
return getEventPhase(this)
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
get isTrusted(): boolean {
|
|
104
|
+
return getIsTrusted(this)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
get target(): RNEventTarget | null {
|
|
108
|
+
return getTarget(this)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
get timeStamp(): number {
|
|
112
|
+
return this._timeStamp
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
get type(): string {
|
|
116
|
+
return this._type
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
composedPath(): ReadonlyArray<RNEventTarget> {
|
|
120
|
+
return getComposedPath(this).slice()
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
preventDefault(): void {
|
|
124
|
+
if (!this._cancelable) {
|
|
125
|
+
return
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (getInPassiveListenerFlag(this)) {
|
|
129
|
+
console.error(new Error('Unable to preventDefault inside passive event listener invocation.'))
|
|
130
|
+
return
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
this._defaultPrevented = true
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
stopImmediatePropagation(): void {
|
|
137
|
+
setStopPropagationFlag(this, true)
|
|
138
|
+
setStopImmediatePropagationFlag(this, true)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
stopPropagation(): void {
|
|
142
|
+
setStopPropagationFlag(this, true)
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
Object.defineProperty(Event, 'NONE', {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
value: 0,
|
|
149
|
+
})
|
|
150
|
+
|
|
151
|
+
Object.defineProperty(Event.prototype, 'NONE', {
|
|
152
|
+
enumerable: true,
|
|
153
|
+
value: 0,
|
|
154
|
+
})
|
|
155
|
+
|
|
156
|
+
Object.defineProperty(Event, 'CAPTURING_PHASE', {
|
|
157
|
+
enumerable: true,
|
|
158
|
+
value: 1,
|
|
159
|
+
})
|
|
160
|
+
|
|
161
|
+
Object.defineProperty(Event.prototype, 'CAPTURING_PHASE', {
|
|
162
|
+
enumerable: true,
|
|
163
|
+
value: 1,
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
Object.defineProperty(Event, 'AT_TARGET', {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
value: 2,
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
Object.defineProperty(Event.prototype, 'AT_TARGET', {
|
|
172
|
+
enumerable: true,
|
|
173
|
+
value: 2,
|
|
174
|
+
})
|
|
175
|
+
|
|
176
|
+
Object.defineProperty(Event, 'BUBBLING_PHASE', {
|
|
177
|
+
enumerable: true,
|
|
178
|
+
value: 3,
|
|
179
|
+
})
|
|
180
|
+
|
|
181
|
+
Object.defineProperty(Event.prototype, 'BUBBLING_PHASE', {
|
|
182
|
+
enumerable: true,
|
|
183
|
+
value: 3,
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
setPlatformObject(Event)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers to implement event handler IDL attributes.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import type EventTarget from './EventTarget'
|
|
6
|
+
import type { EventCallback } from './EventTarget'
|
|
7
|
+
|
|
8
|
+
type EventHandler = Readonly<{
|
|
9
|
+
handleEvent: EventCallback
|
|
10
|
+
}>
|
|
11
|
+
type EventHandlerAttributeMap = Map<string, EventHandler | null>
|
|
12
|
+
|
|
13
|
+
const EVENT_HANDLER_CONTENT_ATTRIBUTE_MAP_KEY = Symbol('eventHandlerAttributeMap')
|
|
14
|
+
|
|
15
|
+
function getEventHandlerAttributeMap(
|
|
16
|
+
target: EventTarget
|
|
17
|
+
): EventHandlerAttributeMap | null | undefined {
|
|
18
|
+
return (target as any)[EVENT_HANDLER_CONTENT_ATTRIBUTE_MAP_KEY]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function setEventHandlerAttributeMap(target: EventTarget, map: EventHandlerAttributeMap | null) {
|
|
22
|
+
;(target as any)[EVENT_HANDLER_CONTENT_ATTRIBUTE_MAP_KEY] = map
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function getEventHandlerAttribute(target: EventTarget, type: string): EventCallback | null {
|
|
26
|
+
const listener = getEventHandlerAttributeMap(target)?.get(type)
|
|
27
|
+
return listener != null ? listener.handleEvent : null
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function setEventHandlerAttribute(
|
|
31
|
+
target: EventTarget,
|
|
32
|
+
type: string,
|
|
33
|
+
callback: EventCallback | null | undefined
|
|
34
|
+
): void {
|
|
35
|
+
let map = getEventHandlerAttributeMap(target)
|
|
36
|
+
if (map != null) {
|
|
37
|
+
const currentListener = map.get(type)
|
|
38
|
+
if (currentListener) {
|
|
39
|
+
target.removeEventListener(type, currentListener)
|
|
40
|
+
map.delete(type)
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (
|
|
45
|
+
callback != null &&
|
|
46
|
+
(typeof callback === 'function' || typeof (callback as any) === 'object')
|
|
47
|
+
) {
|
|
48
|
+
const listener: EventHandler = {
|
|
49
|
+
handleEvent: callback as EventCallback,
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
try {
|
|
53
|
+
target.addEventListener(type, listener)
|
|
54
|
+
if (map == null) {
|
|
55
|
+
map = new Map()
|
|
56
|
+
setEventHandlerAttributeMap(target, map)
|
|
57
|
+
}
|
|
58
|
+
map.set(type, listener)
|
|
59
|
+
} catch (_e) {
|
|
60
|
+
// Assigning incorrect listener does not throw in setters.
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (map != null && map.size === 0) {
|
|
65
|
+
setEventHandlerAttributeMap(target, null)
|
|
66
|
+
}
|
|
67
|
+
}
|