upgrade @types/react to 19 + run codemod
This commit is contained in:
+1
-1
@@ -277,7 +277,7 @@
|
|||||||
"@expo/image-utils": "0.6.3",
|
"@expo/image-utils": "0.6.3",
|
||||||
"@react-native/babel-preset": "0.79.2",
|
"@react-native/babel-preset": "0.79.2",
|
||||||
"@react-native/normalize-colors": "0.79.2",
|
"@react-native/normalize-colors": "0.79.2",
|
||||||
"@types/react": "^18",
|
"@types/react": "^19",
|
||||||
"**/expo-constants": "17.0.3",
|
"**/expo-constants": "17.0.3",
|
||||||
"**/expo-device": "7.0.1",
|
"**/expo-device": "7.0.1",
|
||||||
"**/zod": "3.23.8",
|
"**/zod": "3.23.8",
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/node_modules/@discord/bottom-sheet/src/hooks/useStableCallback.ts b/node_modules/@discord/bottom-sheet/src/hooks/useStableCallback.ts
|
||||||
|
index 1c788ab..d30f330 100644
|
||||||
|
--- a/node_modules/@discord/bottom-sheet/src/hooks/useStableCallback.ts
|
||||||
|
+++ b/node_modules/@discord/bottom-sheet/src/hooks/useStableCallback.ts
|
||||||
|
@@ -6,7 +6,7 @@ type Callback = (...args: any[]) => any;
|
||||||
|
* https://gist.github.com/JakeCoxon/c7ebf6e6496f8468226fd36b596e1985
|
||||||
|
*/
|
||||||
|
export const useStableCallback = (callback: Callback) => {
|
||||||
|
- const callbackRef = useRef<Callback>();
|
||||||
|
+ const callbackRef = useRef<Callback>(undefined);
|
||||||
|
const memoCallback = useCallback(
|
||||||
|
(...args: any) => callbackRef.current && callbackRef.current(...args),
|
||||||
|
[]
|
||||||
+1
-1
@@ -485,7 +485,7 @@ function commonScreens(Stack: typeof Flat, unreadCountLabel?: string) {
|
|||||||
*/
|
*/
|
||||||
function TabsNavigator() {
|
function TabsNavigator() {
|
||||||
const tabBar = React.useCallback(
|
const tabBar = React.useCallback(
|
||||||
(props: JSX.IntrinsicAttributes & BottomTabBarProps) => (
|
(props: React.JSX.IntrinsicAttributes & BottomTabBarProps) => (
|
||||||
<BottomBar {...props} />
|
<BottomBar {...props} />
|
||||||
),
|
),
|
||||||
[],
|
[],
|
||||||
|
|||||||
@@ -65,8 +65,8 @@ export type ButtonState = {
|
|||||||
export type ButtonContext = VariantProps & ButtonState
|
export type ButtonContext = VariantProps & ButtonState
|
||||||
|
|
||||||
type NonTextElements =
|
type NonTextElements =
|
||||||
| React.ReactElement
|
| React.ReactElement<any>
|
||||||
| Iterable<React.ReactElement | null | undefined | boolean>
|
| Iterable<React.ReactElement<any> | null | undefined | boolean>
|
||||||
|
|
||||||
export type ButtonProps = Pick<
|
export type ButtonProps = Pick<
|
||||||
PressableProps,
|
PressableProps,
|
||||||
|
|||||||
@@ -119,7 +119,8 @@ export function Root({children}: {children: React.ReactNode}) {
|
|||||||
const hoverablesSV = useSharedValue<
|
const hoverablesSV = useSharedValue<
|
||||||
Record<string, {id: string; rect: Measurement}>
|
Record<string, {id: string; rect: Measurement}>
|
||||||
>({})
|
>({})
|
||||||
const syncHoverablesThrottleRef = useRef<ReturnType<typeof setTimeout>>()
|
const syncHoverablesThrottleRef =
|
||||||
|
useRef<ReturnType<typeof setTimeout>>(undefined)
|
||||||
const [hoveredMenuItem, setHoveredMenuItem] = useState<string | null>(null)
|
const [hoveredMenuItem, setHoveredMenuItem] = useState<string | null>(null)
|
||||||
|
|
||||||
const onHoverableTouchUp = useCallback((id: string) => {
|
const onHoverableTouchUp = useCallback((id: string) => {
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import React from 'react'
|
import {
|
||||||
import type {
|
type AccessibilityProps,
|
||||||
AccessibilityProps,
|
type GestureResponderEvent,
|
||||||
GestureResponderEvent,
|
type ScrollViewProps,
|
||||||
ScrollViewProps,
|
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import {ViewStyle} from 'react-native'
|
import {type ViewStyle} from 'react-native'
|
||||||
import {StyleProp} from 'react-native'
|
import {type StyleProp} from 'react-native'
|
||||||
|
import type React from 'react'
|
||||||
|
|
||||||
import {ViewStyleProp} from '#/alf'
|
import {type ViewStyleProp} from '#/alf'
|
||||||
import {BottomSheetViewProps} from '../../../modules/bottom-sheet'
|
import {type BottomSheetViewProps} from '../../../modules/bottom-sheet'
|
||||||
import {BottomSheetSnapPoint} from '../../../modules/bottom-sheet/src/BottomSheet.types'
|
import {type BottomSheetSnapPoint} from '../../../modules/bottom-sheet/src/BottomSheet.types'
|
||||||
|
|
||||||
type A11yProps = Required<AccessibilityProps>
|
type A11yProps = Required<AccessibilityProps>
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ export type DialogControlRefProps = {
|
|||||||
*/
|
*/
|
||||||
export type DialogControlProps = DialogControlRefProps & {
|
export type DialogControlProps = DialogControlRefProps & {
|
||||||
id: string
|
id: string
|
||||||
ref: React.RefObject<DialogControlRefProps>
|
ref: React.RefObject<DialogControlRefProps | null>
|
||||||
isOpen?: boolean
|
isOpen?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
useState,
|
useState,
|
||||||
} from 'react'
|
} from 'react'
|
||||||
|
|
||||||
type Component = React.ReactElement
|
type Component = React.ReactElement<any>
|
||||||
|
|
||||||
type ContextType = {
|
type ContextType = {
|
||||||
outlet: Component | null
|
outlet: Component | null
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type React from 'react'
|
import type React from 'react'
|
||||||
|
|
||||||
export type ProfileHoverCardProps = {
|
export type ProfileHoverCardProps = {
|
||||||
children: React.ReactElement
|
children: React.ReactElement<any>
|
||||||
did: string
|
did: string
|
||||||
inline?: boolean
|
inline?: boolean
|
||||||
disable?: boolean
|
disable?: boolean
|
||||||
|
|||||||
@@ -301,8 +301,8 @@ let Header = ({
|
|||||||
interestsDisplayNames,
|
interestsDisplayNames,
|
||||||
}: {
|
}: {
|
||||||
guide: Follow10ProgressGuide
|
guide: Follow10ProgressGuide
|
||||||
inputRef: React.RefObject<TextInput>
|
inputRef: React.RefObject<TextInput | null>
|
||||||
listRef: React.RefObject<ListMethods>
|
listRef: React.RefObject<ListMethods | null>
|
||||||
onSelectTab: (v: string) => void
|
onSelectTab: (v: string) => void
|
||||||
searchText: string
|
searchText: string
|
||||||
setHeaderHeight: (v: number) => void
|
setHeaderHeight: (v: number) => void
|
||||||
@@ -653,7 +653,7 @@ function SearchInput({
|
|||||||
}: {
|
}: {
|
||||||
onChangeText: (text: string) => void
|
onChangeText: (text: string) => void
|
||||||
onEscape: () => void
|
onEscape: () => void
|
||||||
inputRef: React.RefObject<TextInput>
|
inputRef: React.RefObject<TextInput | null>
|
||||||
defaultValue: string
|
defaultValue: string
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import {useLingui} from '@lingui/react'
|
|||||||
import {isWeb} from '#/platform/detection'
|
import {isWeb} from '#/platform/detection'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {Portal} from '#/components/Portal'
|
import {Portal} from '#/components/Portal'
|
||||||
import {AnimatedCheck, AnimatedCheckRef} from '../anim/AnimatedCheck'
|
import {AnimatedCheck, type AnimatedCheckRef} from '../anim/AnimatedCheck'
|
||||||
import {Text} from '../Typography'
|
import {Text} from '../Typography'
|
||||||
|
|
||||||
export interface ProgressGuideToastRef {
|
export interface ProgressGuideToastRef {
|
||||||
@@ -39,7 +39,7 @@ export const ProgressGuideToast = React.forwardRef<
|
|||||||
const translateY = useSharedValue(0)
|
const translateY = useSharedValue(0)
|
||||||
const opacity = useSharedValue(0)
|
const opacity = useSharedValue(0)
|
||||||
const animatedCheckRef = React.useRef<AnimatedCheckRef | null>(null)
|
const animatedCheckRef = React.useRef<AnimatedCheckRef | null>(null)
|
||||||
const timeoutRef = React.useRef<NodeJS.Timeout | undefined>()
|
const timeoutRef = React.useRef<NodeJS.Timeout | undefined>(undefined)
|
||||||
const winDim = useWindowDimensions()
|
const winDim = useWindowDimensions()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ export type ContentProps<T> = {
|
|||||||
item: T,
|
item: T,
|
||||||
index: number,
|
index: number,
|
||||||
selectedValue?: string | null,
|
selectedValue?: string | null,
|
||||||
) => React.ReactElement
|
) => React.ReactElement<any>
|
||||||
/*
|
/*
|
||||||
* Extracts the value from an item. Defaults to `item => item.value`
|
* Extracts the value from an item. Defaults to `item => item.value`
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import React, {
|
|||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
} from 'react'
|
} from 'react'
|
||||||
import {TextInput, View} from 'react-native'
|
import {type TextInput, View} from 'react-native'
|
||||||
import {useWindowDimensions} from 'react-native'
|
import {useWindowDimensions} from 'react-native'
|
||||||
import {Image} from 'expo-image'
|
import {Image} from 'expo-image'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
@@ -15,13 +15,13 @@ import {logEvent} from '#/lib/statsig/statsig'
|
|||||||
import {cleanError} from '#/lib/strings/errors'
|
import {cleanError} from '#/lib/strings/errors'
|
||||||
import {isWeb} from '#/platform/detection'
|
import {isWeb} from '#/platform/detection'
|
||||||
import {
|
import {
|
||||||
Gif,
|
type Gif,
|
||||||
useFeaturedGifsQuery,
|
useFeaturedGifsQuery,
|
||||||
useGifSearchQuery,
|
useGifSearchQuery,
|
||||||
} from '#/state/queries/tenor'
|
} from '#/state/queries/tenor'
|
||||||
import {ErrorScreen} from '#/view/com/util/error/ErrorScreen'
|
import {ErrorScreen} from '#/view/com/util/error/ErrorScreen'
|
||||||
import {ErrorBoundary} from '#/view/com/util/ErrorBoundary'
|
import {ErrorBoundary} from '#/view/com/util/ErrorBoundary'
|
||||||
import {ListMethods} from '#/view/com/util/List'
|
import {type ListMethods} from '#/view/com/util/List'
|
||||||
import {atoms as a, ios, native, useBreakpoints, useTheme, web} from '#/alf'
|
import {atoms as a, ios, native, useBreakpoints, useTheme, web} from '#/alf'
|
||||||
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
import {Button, ButtonIcon, ButtonText} from '#/components/Button'
|
||||||
import * as Dialog from '#/components/Dialog'
|
import * as Dialog from '#/components/Dialog'
|
||||||
@@ -36,7 +36,7 @@ export function GifSelectDialog({
|
|||||||
onClose,
|
onClose,
|
||||||
onSelectGif: onSelectGifProp,
|
onSelectGif: onSelectGifProp,
|
||||||
}: {
|
}: {
|
||||||
controlRef: React.RefObject<{open: () => void}>
|
controlRef: React.RefObject<{open: () => void} | null>
|
||||||
onClose?: () => void
|
onClose?: () => void
|
||||||
onSelectGif: (gif: Gif) => void
|
onSelectGif: (gif: Gif) => void
|
||||||
}) {
|
}) {
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ function SearchInput({
|
|||||||
value: string
|
value: string
|
||||||
onChangeText: (text: string) => void
|
onChangeText: (text: string) => void
|
||||||
onEscape: () => void
|
onEscape: () => void
|
||||||
inputRef: React.RefObject<TextInput>
|
inputRef: React.RefObject<TextInput | null>
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {_} = useLingui()
|
const {_} = useLingui()
|
||||||
|
|||||||
@@ -21,11 +21,14 @@ export function InputGroup(props: React.PropsWithChildren<{}>) {
|
|||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{React.cloneElement(child, {
|
{React.cloneElement(child, {
|
||||||
// @ts-ignore
|
// @ts-expect-error
|
||||||
style: [
|
style: [
|
||||||
|
// @ts-expect-error
|
||||||
...(Array.isArray(child.props?.style)
|
...(Array.isArray(child.props?.style)
|
||||||
? child.props.style
|
? // @ts-expect-error
|
||||||
: [child.props.style || {}]),
|
child.props.style
|
||||||
|
: // @ts-expect-error
|
||||||
|
[child.props.style || {}]),
|
||||||
{
|
{
|
||||||
borderTopLeftRadius: i > 0 ? 0 : undefined,
|
borderTopLeftRadius: i > 0 ? 0 : undefined,
|
||||||
borderTopRightRadius: i > 0 ? 0 : undefined,
|
borderTopRightRadius: i > 0 ? 0 : undefined,
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {
|
import {
|
||||||
AccessibilityProps,
|
type AccessibilityProps,
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
TextInput,
|
TextInput,
|
||||||
TextInputProps,
|
type TextInputProps,
|
||||||
TextStyle,
|
type TextStyle,
|
||||||
View,
|
View,
|
||||||
ViewStyle,
|
type ViewStyle,
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
|
|
||||||
import {HITSLOP_20} from '#/lib/constants'
|
import {HITSLOP_20} from '#/lib/constants'
|
||||||
@@ -16,17 +16,17 @@ import {
|
|||||||
applyFonts,
|
applyFonts,
|
||||||
atoms as a,
|
atoms as a,
|
||||||
ios,
|
ios,
|
||||||
TextStyleProp,
|
type TextStyleProp,
|
||||||
useAlf,
|
useAlf,
|
||||||
useTheme,
|
useTheme,
|
||||||
web,
|
web,
|
||||||
} from '#/alf'
|
} from '#/alf'
|
||||||
import {useInteractionState} from '#/components/hooks/useInteractionState'
|
import {useInteractionState} from '#/components/hooks/useInteractionState'
|
||||||
import {Props as SVGIconProps} from '#/components/icons/common'
|
import {type Props as SVGIconProps} from '#/components/icons/common'
|
||||||
import {Text} from '#/components/Typography'
|
import {Text} from '#/components/Typography'
|
||||||
|
|
||||||
const Context = React.createContext<{
|
const Context = React.createContext<{
|
||||||
inputRef: React.RefObject<TextInput> | null
|
inputRef: React.RefObject<TextInput | null> | null
|
||||||
isInvalid: boolean
|
isInvalid: boolean
|
||||||
hovered: boolean
|
hovered: boolean
|
||||||
onHoverIn: () => void
|
onHoverIn: () => void
|
||||||
@@ -140,7 +140,7 @@ export type InputProps = Omit<TextInputProps, 'value' | 'onChangeText'> & {
|
|||||||
value?: string
|
value?: string
|
||||||
onChangeText?: (value: string) => void
|
onChangeText?: (value: string) => void
|
||||||
isInvalid?: boolean
|
isInvalid?: boolean
|
||||||
inputRef?: React.RefObject<TextInput> | React.ForwardedRef<TextInput>
|
inputRef?: React.RefObject<TextInput | null> | React.ForwardedRef<TextInput>
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createInput(Component: typeof TextInput) {
|
export function createInput(Component: typeof TextInput) {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {AccessibilityProps, TextStyle, View, ViewStyle} from 'react-native'
|
import {type AccessibilityProps, type TextStyle, View, type ViewStyle} from 'react-native'
|
||||||
|
|
||||||
import {atoms as a, native, useTheme} from '#/alf'
|
import {atoms as a, native, useTheme} from '#/alf'
|
||||||
import * as Toggle from '#/components/forms/Toggle'
|
import * as Toggle from '#/components/forms/Toggle'
|
||||||
@@ -7,7 +7,7 @@ import {Text} from '#/components/Typography'
|
|||||||
|
|
||||||
type ItemProps = Omit<Toggle.ItemProps, 'style' | 'role' | 'children'> &
|
type ItemProps = Omit<Toggle.ItemProps, 'style' | 'role' | 'children'> &
|
||||||
AccessibilityProps & {
|
AccessibilityProps & {
|
||||||
children: React.ReactElement
|
children: React.ReactElement<any>
|
||||||
testID?: string
|
testID?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ function fullscreenSubscribe(onChange: () => void) {
|
|||||||
return () => document.removeEventListener('fullscreenchange', onChange)
|
return () => document.removeEventListener('fullscreenchange', onChange)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function useFullscreen(ref?: React.RefObject<HTMLElement>) {
|
export function useFullscreen(ref?: React.RefObject<HTMLElement | null>) {
|
||||||
if (!isWeb) throw new Error("'useFullscreen' is a web-only hook")
|
if (!isWeb) throw new Error("'useFullscreen' is a web-only hook")
|
||||||
const isFullscreen = useSyncExternalStore(fullscreenSubscribe, () =>
|
const isFullscreen = useSyncExternalStore(fullscreenSubscribe, () =>
|
||||||
Boolean(document.fullscreenElement),
|
Boolean(document.fullscreenElement),
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import * as React from 'react'
|
|||||||
import {Animated} from 'react-native'
|
import {Animated} from 'react-native'
|
||||||
|
|
||||||
export function useAnimatedValue(initialValue: number) {
|
export function useAnimatedValue(initialValue: number) {
|
||||||
const lazyRef = React.useRef<Animated.Value>()
|
const lazyRef = React.useRef<Animated.Value>(undefined)
|
||||||
|
|
||||||
if (lazyRef.current === undefined) {
|
if (lazyRef.current === undefined) {
|
||||||
lazyRef.current = new Animated.Value(initialValue)
|
lazyRef.current = new Animated.Value(initialValue)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import {Alert, AppState, AppStateStatus} from 'react-native'
|
import {Alert, AppState, type AppStateStatus} from 'react-native'
|
||||||
import {nativeBuildVersion} from 'expo-application'
|
import {nativeBuildVersion} from 'expo-application'
|
||||||
import {
|
import {
|
||||||
checkForUpdateAsync,
|
checkForUpdateAsync,
|
||||||
@@ -35,7 +35,7 @@ export function useOTAUpdates() {
|
|||||||
const appState = React.useRef<AppStateStatus>('active')
|
const appState = React.useRef<AppStateStatus>('active')
|
||||||
const lastMinimize = React.useRef(0)
|
const lastMinimize = React.useRef(0)
|
||||||
const ranInitialCheck = React.useRef(false)
|
const ranInitialCheck = React.useRef(false)
|
||||||
const timeout = React.useRef<NodeJS.Timeout>()
|
const timeout = React.useRef<NodeJS.Timeout>(undefined)
|
||||||
const {isUpdatePending} = useUpdates()
|
const {isUpdatePending} = useUpdates()
|
||||||
|
|
||||||
const setCheckTimeout = React.useCallback(() => {
|
const setCheckTimeout = React.useCallback(() => {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
* returns a ref callback function that can be used to merge multiple refs into a single ref.
|
* returns a ref callback function that can be used to merge multiple refs into a single ref.
|
||||||
*/
|
*/
|
||||||
export function mergeRefs<T = any>(
|
export function mergeRefs<T = any>(
|
||||||
refs: Array<React.MutableRefObject<T> | React.LegacyRef<T>>,
|
refs: Array<React.MutableRefObject<T> | React.Ref<T>>,
|
||||||
): React.RefCallback<T> {
|
): React.RefCallback<T> {
|
||||||
return value => {
|
return value => {
|
||||||
refs.forEach(ref => {
|
refs.forEach(ref => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {ReactElement} from 'react'
|
import {type ReactElement} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {ComAtprotoServerDescribeServer} from '@atproto/api'
|
import {type ComAtprotoServerDescribeServer} from '@atproto/api'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ export const Policies = ({
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
let els: ReactElement
|
let els: ReactElement<any>
|
||||||
if (tos && pp) {
|
if (tos && pp) {
|
||||||
els = (
|
els = (
|
||||||
<Trans>
|
<Trans>
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ export function StepInfo({
|
|||||||
|
|
||||||
const [hasWarnedEmail, setHasWarnedEmail] = React.useState<boolean>(false)
|
const [hasWarnedEmail, setHasWarnedEmail] = React.useState<boolean>(false)
|
||||||
|
|
||||||
const tldtsRef = React.useRef<typeof tldts>()
|
const tldtsRef = React.useRef<typeof tldts>(undefined)
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
// @ts-expect-error - valid path
|
// @ts-expect-error - valid path
|
||||||
import('tldts/dist/index.cjs.min.js').then(tldts => {
|
import('tldts/dist/index.cjs.min.js').then(tldts => {
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ import React from 'react'
|
|||||||
import {
|
import {
|
||||||
AppBskyEmbedRecord,
|
AppBskyEmbedRecord,
|
||||||
AppBskyEmbedRecordWithMedia,
|
AppBskyEmbedRecordWithMedia,
|
||||||
AppBskyFeedDefs,
|
type AppBskyFeedDefs,
|
||||||
AppBskyFeedPostgate,
|
AppBskyFeedPostgate,
|
||||||
AtUri,
|
AtUri,
|
||||||
BskyAgent,
|
type BskyAgent,
|
||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query'
|
import {useMutation, useQuery, useQueryClient} from '@tanstack/react-query'
|
||||||
|
|
||||||
@@ -173,7 +173,7 @@ export function useToggleQuoteDetachmentMutation() {
|
|||||||
const agent = useAgent()
|
const agent = useAgent()
|
||||||
const queryClient = useQueryClient()
|
const queryClient = useQueryClient()
|
||||||
const getPosts = useGetPosts()
|
const getPosts = useGetPosts()
|
||||||
const prevEmbed = React.useRef<AppBskyFeedDefs.PostView['embed']>()
|
const prevEmbed = React.useRef<AppBskyFeedDefs.PostView['embed']>(undefined)
|
||||||
|
|
||||||
return useMutation({
|
return useMutation({
|
||||||
mutationFn: async ({
|
mutationFn: async ({
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ export const ComposePost = ({
|
|||||||
videoUri: initVideoUri,
|
videoUri: initVideoUri,
|
||||||
cancelRef,
|
cancelRef,
|
||||||
}: Props & {
|
}: Props & {
|
||||||
cancelRef?: React.RefObject<CancelRef>
|
cancelRef?: React.RefObject<CancelRef | null>
|
||||||
}) => {
|
}) => {
|
||||||
const {currentAccount} = useSession()
|
const {currentAccount} = useSession()
|
||||||
const agent = useAgent()
|
const agent = useAgent()
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ function EditImageInner({
|
|||||||
aspectRatio,
|
aspectRatio,
|
||||||
}: Required<Pick<EditImageDialogProps, 'image'>> &
|
}: Required<Pick<EditImageDialogProps, 'image'>> &
|
||||||
Omit<EditImageDialogProps, 'control' | 'image'> & {
|
Omit<EditImageDialogProps, 'control' | 'image'> & {
|
||||||
saveRef: React.RefObject<{save: () => Promise<void>}>
|
saveRef: React.RefObject<{save: () => Promise<void>} | null>
|
||||||
}) {
|
}) {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const [isDragging, setIsDragging] = useState(false)
|
const [isDragging, setIsDragging] = useState(false)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React from 'react'
|
import {type JSX} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {msg} from '@lingui/macro'
|
import {msg} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React from 'react'
|
import {type JSX} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import Animated from 'react-native-reanimated'
|
import Animated from 'react-native-reanimated'
|
||||||
import {msg} from '@lingui/macro'
|
import {msg} from '@lingui/macro'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, {useCallback} from 'react'
|
import React, {type JSX, useCallback} from 'react'
|
||||||
import {Dimensions, type StyleProp, View, type ViewStyle} from 'react-native'
|
import {Dimensions, type StyleProp, View, type ViewStyle} from 'react-native'
|
||||||
import {type AppBskyGraphDefs} from '@atproto/api'
|
import {type AppBskyGraphDefs} from '@atproto/api'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
import React from 'react'
|
import React, {type JSX} from 'react'
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
FlatList as RNFlatList,
|
FlatList as RNFlatList,
|
||||||
RefreshControl,
|
RefreshControl,
|
||||||
StyleProp,
|
type StyleProp,
|
||||||
View,
|
View,
|
||||||
ViewStyle,
|
type ViewStyle,
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import {AppBskyGraphDefs as GraphDefs} from '@atproto/api'
|
import {type AppBskyGraphDefs as GraphDefs} from '@atproto/api'
|
||||||
import {msg} from '@lingui/macro'
|
import {msg} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ import {cleanError} from '#/lib/strings/errors'
|
|||||||
import {s} from '#/lib/styles'
|
import {s} from '#/lib/styles'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||||
import {MyListsFilter, useMyListsQuery} from '#/state/queries/my-lists'
|
import {type MyListsFilter, useMyListsQuery} from '#/state/queries/my-lists'
|
||||||
import {atoms as a, useTheme} from '#/alf'
|
import {atoms as a, useTheme} from '#/alf'
|
||||||
import {BulletList_Stroke2_Corner0_Rounded as ListIcon} from '#/components/icons/BulletList'
|
import {BulletList_Stroke2_Corner0_Rounded as ListIcon} from '#/components/icons/BulletList'
|
||||||
import * as ListCard from '#/components/ListCard'
|
import * as ListCard from '#/components/ListCard'
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React from 'react'
|
import React, {type JSX} from 'react'
|
||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
type ListRenderItemInfo,
|
type ListRenderItemInfo,
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ let NotificationFeedItem = ({
|
|||||||
: ''
|
: ''
|
||||||
|
|
||||||
let a11yLabel = ''
|
let a11yLabel = ''
|
||||||
let notificationContent: ReactElement
|
let notificationContent: ReactElement<any>
|
||||||
let icon = (
|
let icon = (
|
||||||
<HeartIconFilled
|
<HeartIconFilled
|
||||||
size="xl"
|
size="xl"
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import React, {forwardRef, useCallback, useContext} from 'react'
|
import React, {forwardRef, type JSX, useCallback, useContext} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {DrawerGestureContext} from 'react-native-drawer-layout'
|
import {DrawerGestureContext} from 'react-native-drawer-layout'
|
||||||
import {Gesture, GestureDetector} from 'react-native-gesture-handler'
|
import {Gesture, GestureDetector} from 'react-native-gesture-handler'
|
||||||
import PagerView, {
|
import PagerView, {
|
||||||
PagerViewOnPageScrollEventData,
|
type PagerViewOnPageScrollEventData,
|
||||||
PagerViewOnPageSelectedEvent,
|
type PagerViewOnPageSelectedEvent,
|
||||||
PagerViewOnPageSelectedEventData,
|
type PagerViewOnPageSelectedEventData,
|
||||||
PageScrollStateChangedNativeEventData,
|
type PageScrollStateChangedNativeEventData,
|
||||||
} from 'react-native-pager-view'
|
} from 'react-native-pager-view'
|
||||||
import Animated, {
|
import Animated, {
|
||||||
runOnJS,
|
runOnJS,
|
||||||
SharedValue,
|
type SharedValue,
|
||||||
useEvent,
|
useEvent,
|
||||||
useHandler,
|
useHandler,
|
||||||
useSharedValue,
|
useSharedValue,
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React from 'react'
|
import React, {type JSX} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {flushSync} from 'react-dom'
|
import {flushSync} from 'react-dom'
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import {
|
import {
|
||||||
LayoutChangeEvent,
|
type LayoutChangeEvent,
|
||||||
NativeScrollEvent,
|
type NativeScrollEvent,
|
||||||
ScrollView,
|
type ScrollView,
|
||||||
StyleSheet,
|
StyleSheet,
|
||||||
View,
|
View,
|
||||||
} from 'react-native'
|
} from 'react-native'
|
||||||
import Animated, {
|
import Animated, {
|
||||||
AnimatedRef,
|
type AnimatedRef,
|
||||||
runOnJS,
|
runOnJS,
|
||||||
runOnUI,
|
runOnUI,
|
||||||
scrollTo,
|
scrollTo,
|
||||||
SharedValue,
|
type SharedValue,
|
||||||
useAnimatedRef,
|
useAnimatedRef,
|
||||||
useAnimatedStyle,
|
useAnimatedStyle,
|
||||||
useSharedValue,
|
useSharedValue,
|
||||||
@@ -20,9 +20,13 @@ import Animated, {
|
|||||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||||
import {ScrollProvider} from '#/lib/ScrollContext'
|
import {ScrollProvider} from '#/lib/ScrollContext'
|
||||||
import {isIOS} from '#/platform/detection'
|
import {isIOS} from '#/platform/detection'
|
||||||
import {Pager, PagerRef, RenderTabBarFnProps} from '#/view/com/pager/Pager'
|
import {
|
||||||
|
Pager,
|
||||||
|
type PagerRef,
|
||||||
|
type RenderTabBarFnProps,
|
||||||
|
} from '#/view/com/pager/Pager'
|
||||||
import {useTheme} from '#/alf'
|
import {useTheme} from '#/alf'
|
||||||
import {ListMethods} from '../util/List'
|
import {type ListMethods} from '../util/List'
|
||||||
import {PagerHeaderProvider} from './PagerHeaderContext'
|
import {PagerHeaderProvider} from './PagerHeaderContext'
|
||||||
import {TabBar} from './TabBar'
|
import {TabBar} from './TabBar'
|
||||||
|
|
||||||
@@ -35,15 +39,15 @@ export interface PagerWithHeaderChildParams {
|
|||||||
export interface PagerWithHeaderProps {
|
export interface PagerWithHeaderProps {
|
||||||
testID?: string
|
testID?: string
|
||||||
children:
|
children:
|
||||||
| (((props: PagerWithHeaderChildParams) => JSX.Element) | null)[]
|
| (((props: PagerWithHeaderChildParams) => React.JSX.Element) | null)[]
|
||||||
| ((props: PagerWithHeaderChildParams) => JSX.Element)
|
| ((props: PagerWithHeaderChildParams) => React.JSX.Element)
|
||||||
items: string[]
|
items: string[]
|
||||||
isHeaderReady: boolean
|
isHeaderReady: boolean
|
||||||
renderHeader?: ({
|
renderHeader?: ({
|
||||||
setMinimumHeight,
|
setMinimumHeight,
|
||||||
}: {
|
}: {
|
||||||
setMinimumHeight: (height: number) => void
|
setMinimumHeight: (height: number) => void
|
||||||
}) => JSX.Element
|
}) => React.JSX.Element
|
||||||
initialPage?: number
|
initialPage?: number
|
||||||
onPageSelected?: (index: number) => void
|
onPageSelected?: (index: number) => void
|
||||||
onCurrentPageSelected?: (index: number) => void
|
onCurrentPageSelected?: (index: number) => void
|
||||||
|
|||||||
@@ -1,11 +1,15 @@
|
|||||||
import * as React from 'react'
|
import * as React from 'react'
|
||||||
import {ScrollView, View} from 'react-native'
|
import {type ScrollView, View} from 'react-native'
|
||||||
import {useAnimatedRef} from 'react-native-reanimated'
|
import {useAnimatedRef} from 'react-native-reanimated'
|
||||||
|
|
||||||
import {Pager, PagerRef, RenderTabBarFnProps} from '#/view/com/pager/Pager'
|
import {
|
||||||
|
Pager,
|
||||||
|
type PagerRef,
|
||||||
|
type RenderTabBarFnProps,
|
||||||
|
} from '#/view/com/pager/Pager'
|
||||||
import {atoms as a, web} from '#/alf'
|
import {atoms as a, web} from '#/alf'
|
||||||
import * as Layout from '#/components/Layout'
|
import * as Layout from '#/components/Layout'
|
||||||
import {ListMethods} from '../util/List'
|
import {type ListMethods} from '../util/List'
|
||||||
import {TabBar} from './TabBar'
|
import {TabBar} from './TabBar'
|
||||||
|
|
||||||
export interface PagerWithHeaderChildParams {
|
export interface PagerWithHeaderChildParams {
|
||||||
@@ -17,15 +21,15 @@ export interface PagerWithHeaderChildParams {
|
|||||||
export interface PagerWithHeaderProps {
|
export interface PagerWithHeaderProps {
|
||||||
testID?: string
|
testID?: string
|
||||||
children:
|
children:
|
||||||
| (((props: PagerWithHeaderChildParams) => JSX.Element) | null)[]
|
| (((props: PagerWithHeaderChildParams) => React.JSX.Element) | null)[]
|
||||||
| ((props: PagerWithHeaderChildParams) => JSX.Element)
|
| ((props: PagerWithHeaderChildParams) => React.JSX.Element)
|
||||||
items: string[]
|
items: string[]
|
||||||
isHeaderReady: boolean
|
isHeaderReady: boolean
|
||||||
renderHeader?: ({
|
renderHeader?: ({
|
||||||
setMinimumHeight,
|
setMinimumHeight,
|
||||||
}: {
|
}: {
|
||||||
setMinimumHeight: () => void
|
setMinimumHeight: () => void
|
||||||
}) => JSX.Element
|
}) => React.JSX.Element
|
||||||
initialPage?: number
|
initialPage?: number
|
||||||
onPageSelected?: (index: number) => void
|
onPageSelected?: (index: number) => void
|
||||||
onCurrentPageSelected?: (index: number) => void
|
onCurrentPageSelected?: (index: number) => void
|
||||||
@@ -123,11 +127,11 @@ let PagerTabBar = ({
|
|||||||
setMinimumHeight,
|
setMinimumHeight,
|
||||||
}: {
|
}: {
|
||||||
setMinimumHeight: () => void
|
setMinimumHeight: () => void
|
||||||
}) => JSX.Element
|
}) => React.JSX.Element
|
||||||
isHeaderReady: boolean
|
isHeaderReady: boolean
|
||||||
onCurrentPageSelected?: (index: number) => void
|
onCurrentPageSelected?: (index: number) => void
|
||||||
onSelect?: (index: number) => void
|
onSelect?: (index: number) => void
|
||||||
tabBarAnchor?: JSX.Element | null | undefined
|
tabBarAnchor?: React.JSX.Element | null | undefined
|
||||||
}): React.ReactNode => {
|
}): React.ReactNode => {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -164,7 +168,7 @@ function PagerItem({
|
|||||||
renderTab,
|
renderTab,
|
||||||
}: {
|
}: {
|
||||||
isFocused: boolean
|
isFocused: boolean
|
||||||
renderTab: ((props: PagerWithHeaderChildParams) => JSX.Element) | null
|
renderTab: ((props: PagerWithHeaderChildParams) => React.JSX.Element) | null
|
||||||
}) {
|
}) {
|
||||||
const scrollElRef = useAnimatedRef()
|
const scrollElRef = useAnimatedRef()
|
||||||
if (renderTab == null) {
|
if (renderTab == null) {
|
||||||
|
|||||||
@@ -106,7 +106,9 @@ export function TabBar({
|
|||||||
<PressableWithHover
|
<PressableWithHover
|
||||||
testID={`${testID}-selector-${i}`}
|
testID={`${testID}-selector-${i}`}
|
||||||
key={`${item}-${i}`}
|
key={`${item}-${i}`}
|
||||||
ref={node => (itemRefs.current[i] = node as any)}
|
ref={node => {
|
||||||
|
itemRefs.current[i] = node as any
|
||||||
|
}}
|
||||||
style={styles.item}
|
style={styles.item}
|
||||||
hoverStyle={t.atoms.bg_contrast_25}
|
hoverStyle={t.atoms.bg_contrast_25}
|
||||||
onPress={() => onPressItem(i)}
|
onPress={() => onPressItem(i)}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, {memo} from 'react'
|
import React, {memo} from 'react'
|
||||||
import {RefreshControl, ViewToken} from 'react-native'
|
import {RefreshControl, type ViewToken} from 'react-native'
|
||||||
import {
|
import {
|
||||||
FlatListPropsWithLayout,
|
type FlatListPropsWithLayout,
|
||||||
runOnJS,
|
runOnJS,
|
||||||
useSharedValue,
|
useSharedValue,
|
||||||
} from 'react-native-reanimated'
|
} from 'react-native-reanimated'
|
||||||
@@ -57,7 +57,7 @@ let List = React.forwardRef<ListMethods, ListProps>(
|
|||||||
...props
|
...props
|
||||||
},
|
},
|
||||||
ref,
|
ref,
|
||||||
): React.ReactElement => {
|
): React.ReactElement<any> => {
|
||||||
const isScrolledDown = useSharedValue(false)
|
const isScrolledDown = useSharedValue(false)
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const dedupe = useDedupe(400)
|
const dedupe = useDedupe(400)
|
||||||
|
|||||||
@@ -1,6 +1,17 @@
|
|||||||
import React, {isValidElement, memo, startTransition, useRef} from 'react'
|
import React, {
|
||||||
import {FlatListProps, StyleSheet, View, ViewProps} from 'react-native'
|
isValidElement,
|
||||||
import {ReanimatedScrollEvent} from 'react-native-reanimated/lib/typescript/hook/commonTypes'
|
type JSX,
|
||||||
|
memo,
|
||||||
|
startTransition,
|
||||||
|
useRef,
|
||||||
|
} from 'react'
|
||||||
|
import {
|
||||||
|
type FlatListProps,
|
||||||
|
StyleSheet,
|
||||||
|
View,
|
||||||
|
type ViewProps,
|
||||||
|
} from 'react-native'
|
||||||
|
import {type ReanimatedScrollEvent} from 'react-native-reanimated/lib/typescript/hook/commonTypes'
|
||||||
|
|
||||||
import {batchedUpdates} from '#/lib/batchedUpdates'
|
import {batchedUpdates} from '#/lib/batchedUpdates'
|
||||||
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
import {useNonReactiveCallback} from '#/lib/hooks/useNonReactiveCallback'
|
||||||
@@ -377,10 +388,10 @@ function EdgeVisibility({
|
|||||||
containerRef,
|
containerRef,
|
||||||
onVisibleChange,
|
onVisibleChange,
|
||||||
}: {
|
}: {
|
||||||
root?: React.RefObject<HTMLDivElement> | null
|
root?: React.RefObject<HTMLDivElement | null> | null
|
||||||
topMargin?: string
|
topMargin?: string
|
||||||
bottomMargin?: string
|
bottomMargin?: string
|
||||||
containerRef: React.RefObject<Element>
|
containerRef: React.RefObject<Element | null>
|
||||||
onVisibleChange: (isVisible: boolean) => void
|
onVisibleChange: (isVisible: boolean) => void
|
||||||
}) {
|
}) {
|
||||||
const [containerHeight, setContainerHeight] = React.useState(0)
|
const [containerHeight, setContainerHeight] = React.useState(0)
|
||||||
@@ -399,7 +410,7 @@ function EdgeVisibility({
|
|||||||
}
|
}
|
||||||
|
|
||||||
function useResizeObserver(
|
function useResizeObserver(
|
||||||
ref: React.RefObject<Element>,
|
ref: React.RefObject<Element | null>,
|
||||||
onResize: undefined | ((w: number, h: number) => void),
|
onResize: undefined | ((w: number, h: number) => void),
|
||||||
) {
|
) {
|
||||||
const handleResize = useNonReactiveCallback(onResize ?? (() => {}))
|
const handleResize = useNonReactiveCallback(onResize ?? (() => {}))
|
||||||
@@ -504,7 +515,7 @@ let Visibility = ({
|
|||||||
onVisibleChange,
|
onVisibleChange,
|
||||||
style,
|
style,
|
||||||
}: {
|
}: {
|
||||||
root?: React.RefObject<HTMLDivElement> | null
|
root?: React.RefObject<HTMLDivElement | null> | null
|
||||||
topMargin?: string
|
topMargin?: string
|
||||||
bottomMargin?: string
|
bottomMargin?: string
|
||||||
onVisibleChange: (isVisible: boolean) => void
|
onVisibleChange: (isVisible: boolean) => void
|
||||||
@@ -546,7 +557,7 @@ Visibility = React.memo(Visibility)
|
|||||||
|
|
||||||
export const List = memo(React.forwardRef(ListImpl)) as <ItemT>(
|
export const List = memo(React.forwardRef(ListImpl)) as <ItemT>(
|
||||||
props: ListProps<ItemT> & {ref?: React.Ref<ListMethods>},
|
props: ListProps<ItemT> & {ref?: React.Ref<ListMethods>},
|
||||||
) => React.ReactElement
|
) => React.ReactElement<any>
|
||||||
|
|
||||||
// https://stackoverflow.com/questions/7944460/detect-safari-browser
|
// https://stackoverflow.com/questions/7944460/detect-safari-browser
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react'
|
import React, {type JSX} from 'react'
|
||||||
import {I18n} from '@lingui/core'
|
import {type I18n} from '@lingui/core'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
|
||||||
import {useGetTimeAgo} from '#/lib/hooks/useTimeAgo'
|
import {useGetTimeAgo} from '#/lib/hooks/useTimeAgo'
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ function Toast({
|
|||||||
}, 1e3)
|
}, 1e3)
|
||||||
}
|
}
|
||||||
|
|
||||||
const destroyTimeoutRef = useRef<ReturnType<typeof setTimeout>>()
|
const destroyTimeoutRef = useRef<ReturnType<typeof setTimeout>>(undefined)
|
||||||
const hideAndDestroyAfterTimeout = useNonReactiveCallback(() => {
|
const hideAndDestroyAfterTimeout = useNonReactiveCallback(() => {
|
||||||
clearTimeout(destroyTimeoutRef.current)
|
clearTimeout(destroyTimeoutRef.current)
|
||||||
destroyTimeoutRef.current = setTimeout(hideAndDestroyImmediately, TIMEOUT)
|
destroyTimeoutRef.current = setTimeout(hideAndDestroyImmediately, TIMEOUT)
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
import {type JSX} from 'react'
|
||||||
|
|
||||||
import {Header} from '#/components/Layout'
|
import {Header} from '#/components/Layout'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import React, {useEffect, useState} from 'react'
|
import React, {type JSX, useEffect, useState} from 'react'
|
||||||
import {
|
import {
|
||||||
NativeScrollEvent,
|
type NativeScrollEvent,
|
||||||
NativeSyntheticEvent,
|
type NativeSyntheticEvent,
|
||||||
Pressable,
|
Pressable,
|
||||||
RefreshControl,
|
RefreshControl,
|
||||||
ScrollView,
|
ScrollView,
|
||||||
@@ -36,7 +36,7 @@ export const ViewSelector = React.forwardRef<
|
|||||||
renderItem: (item: any) => JSX.Element
|
renderItem: (item: any) => JSX.Element
|
||||||
ListFooterComponent?:
|
ListFooterComponent?:
|
||||||
| React.ComponentType<any>
|
| React.ComponentType<any>
|
||||||
| React.ReactElement
|
| React.ReactElement<any>
|
||||||
| null
|
| null
|
||||||
| undefined
|
| undefined
|
||||||
onSelectView?: (viewIndex: number) => void
|
onSelectView?: (viewIndex: number) => void
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {ComponentProps} from 'react'
|
import {type ComponentProps, type JSX} from 'react'
|
||||||
import {StyleSheet, TouchableWithoutFeedback} from 'react-native'
|
import {StyleSheet, type TouchableWithoutFeedback} from 'react-native'
|
||||||
import Animated from 'react-native-reanimated'
|
import Animated from 'react-native-reanimated'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {LinearGradient} from 'expo-linear-gradient'
|
import {LinearGradient} from 'expo-linear-gradient'
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ function DropdownContent({
|
|||||||
menuRef,
|
menuRef,
|
||||||
}: {
|
}: {
|
||||||
items: DropdownItem[]
|
items: DropdownItem[]
|
||||||
menuRef: React.RefObject<HTMLDivElement>
|
menuRef: React.RefObject<HTMLDivElement | null>
|
||||||
}) {
|
}) {
|
||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
const theme = useTheme()
|
const theme = useTheme()
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import React, {useCallback, useEffect, useRef, useState} from 'react'
|
import {useCallback, useEffect, useRef, useState} from 'react'
|
||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {AppBskyEmbedVideo} from '@atproto/api'
|
import {type AppBskyEmbedVideo} from '@atproto/api'
|
||||||
import {msg} from '@lingui/macro'
|
import {msg} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
|
import type React from 'react';
|
||||||
|
|
||||||
import {isFirefox} from '#/lib/browser'
|
import {isFirefox} from '#/lib/browser'
|
||||||
import {ConstrainedImage} from '#/view/com/util/images/AutoSizedImage'
|
import {ConstrainedImage} from '#/view/com/util/images/AutoSizedImage'
|
||||||
@@ -30,7 +31,7 @@ export function VideoEmbed({
|
|||||||
useActiveVideoWeb()
|
useActiveVideoWeb()
|
||||||
const [onScreen, setOnScreen] = useState(false)
|
const [onScreen, setOnScreen] = useState(false)
|
||||||
const [isFullscreen] = useFullscreen()
|
const [isFullscreen] = useFullscreen()
|
||||||
const lastKnownTime = useRef<number | undefined>()
|
const lastKnownTime = useRef<number | undefined>(undefined)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!ref.current) return
|
if (!ref.current) return
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ function useHLS({
|
|||||||
playlist: string
|
playlist: string
|
||||||
setHasSubtitleTrack: (v: boolean) => void
|
setHasSubtitleTrack: (v: boolean) => void
|
||||||
setError: (v: Error | null) => void
|
setError: (v: Error | null) => void
|
||||||
videoRef: React.RefObject<HTMLVideoElement>
|
videoRef: React.RefObject<HTMLVideoElement | null>
|
||||||
setHlsLoading: (v: boolean) => void
|
setHlsLoading: (v: boolean) => void
|
||||||
}) {
|
}) {
|
||||||
const [Hls, setHls] = useState<typeof HlsTypes.default | undefined>(
|
const [Hls, setHls] = useState<typeof HlsTypes.default | undefined>(
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import React, {useCallback, useEffect, useRef, useState} from 'react'
|
import {useCallback, useEffect, useRef, useState} from 'react'
|
||||||
import {Pressable, View} from 'react-native'
|
import {Pressable, View} from 'react-native'
|
||||||
import {msg, Trans} from '@lingui/macro'
|
import {msg, Trans} from '@lingui/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
import {useLingui} from '@lingui/react'
|
||||||
import type Hls from 'hls.js'
|
import type Hls from 'hls.js'
|
||||||
|
import type React from 'react';
|
||||||
|
|
||||||
import {isTouchDevice} from '#/lib/browser'
|
import {isTouchDevice} from '#/lib/browser'
|
||||||
import {clamp} from '#/lib/numbers'
|
import {clamp} from '#/lib/numbers'
|
||||||
@@ -46,14 +47,14 @@ export function Controls({
|
|||||||
hlsLoading,
|
hlsLoading,
|
||||||
hasSubtitleTrack,
|
hasSubtitleTrack,
|
||||||
}: {
|
}: {
|
||||||
videoRef: React.RefObject<HTMLVideoElement>
|
videoRef: React.RefObject<HTMLVideoElement | null>
|
||||||
hlsRef: React.RefObject<Hls | undefined>
|
hlsRef: React.RefObject<Hls | undefined | null>
|
||||||
active: boolean
|
active: boolean
|
||||||
setActive: () => void
|
setActive: () => void
|
||||||
focused: boolean
|
focused: boolean
|
||||||
setFocused: (focused: boolean) => void
|
setFocused: (focused: boolean) => void
|
||||||
onScreen: boolean
|
onScreen: boolean
|
||||||
fullscreenRef: React.RefObject<HTMLDivElement>
|
fullscreenRef: React.RefObject<HTMLDivElement | null>
|
||||||
hlsLoading: boolean
|
hlsLoading: boolean
|
||||||
hasSubtitleTrack: boolean
|
hasSubtitleTrack: boolean
|
||||||
}) {
|
}) {
|
||||||
@@ -232,7 +233,7 @@ export function Controls({
|
|||||||
}, [onSeek, videoRef])
|
}, [onSeek, videoRef])
|
||||||
|
|
||||||
const [showCursor, setShowCursor] = useState(true)
|
const [showCursor, setShowCursor] = useState(true)
|
||||||
const cursorTimeoutRef = useRef<ReturnType<typeof setTimeout>>()
|
const cursorTimeoutRef = useRef<ReturnType<typeof setTimeout>>(undefined)
|
||||||
const onPointerMoveEmptySpace = useCallback(() => {
|
const onPointerMoveEmptySpace = useCallback(() => {
|
||||||
setShowCursor(true)
|
setShowCursor(true)
|
||||||
if (cursorTimeoutRef.current) {
|
if (cursorTimeoutRef.current) {
|
||||||
@@ -264,7 +265,7 @@ export function Controls({
|
|||||||
[hovered],
|
[hovered],
|
||||||
)
|
)
|
||||||
|
|
||||||
const timeoutRef = useRef<ReturnType<typeof setTimeout>>()
|
const timeoutRef = useRef<ReturnType<typeof setTimeout>>(undefined)
|
||||||
|
|
||||||
const onHoverWithTimeout = useCallback(() => {
|
const onHoverWithTimeout = useCallback(() => {
|
||||||
onHover()
|
onHover()
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
import React, {useCallback, useEffect, useRef, useState} from 'react'
|
import {useCallback, useEffect, useRef, useState} from 'react'
|
||||||
|
import type React from 'react';
|
||||||
|
|
||||||
import {isSafari} from '#/lib/browser'
|
import {isSafari} from '#/lib/browser'
|
||||||
import {useVideoVolumeState} from '../../VideoVolumeContext'
|
import {useVideoVolumeState} from '../../VideoVolumeContext'
|
||||||
|
|
||||||
export function useVideoElement(ref: React.RefObject<HTMLVideoElement>) {
|
export function useVideoElement(ref: React.RefObject<HTMLVideoElement | null>) {
|
||||||
const [playing, setPlaying] = useState(false)
|
const [playing, setPlaying] = useState(false)
|
||||||
const [muted, setMuted] = useState(true)
|
const [muted, setMuted] = useState(true)
|
||||||
const [currentTime, setCurrentTime] = useState(0)
|
const [currentTime, setCurrentTime] = useState(0)
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ export function Dialogs() {
|
|||||||
React.useState<boolean>()
|
React.useState<boolean>()
|
||||||
const [shouldRenderUnmountTest, setShouldRenderUnmountTest] =
|
const [shouldRenderUnmountTest, setShouldRenderUnmountTest] =
|
||||||
React.useState(false)
|
React.useState(false)
|
||||||
const unmountTestInterval = React.useRef<number>()
|
const unmountTestInterval = React.useRef<number>(undefined)
|
||||||
|
|
||||||
const onUnmountTestStartPressWithClose = () => {
|
const onUnmountTestStartPressWithClose = () => {
|
||||||
setShouldRenderUnmountTest(true)
|
setShouldRenderUnmountTest(true)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, {type ComponentProps} from 'react'
|
import React, {type ComponentProps, type JSX} from 'react'
|
||||||
import {Linking, ScrollView, TouchableOpacity, View} from 'react-native'
|
import {Linking, ScrollView, TouchableOpacity, View} from 'react-native'
|
||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {msg, Plural, plural, Trans} from '@lingui/macro'
|
import {msg, Plural, plural, Trans} from '@lingui/macro'
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {useNavigationState} from '@react-navigation/native'
|
|||||||
import {useMinimalShellFooterTransform} from '#/lib/hooks/useMinimalShellTransform'
|
import {useMinimalShellFooterTransform} from '#/lib/hooks/useMinimalShellTransform'
|
||||||
import {getCurrentRoute, isTab} from '#/lib/routes/helpers'
|
import {getCurrentRoute, isTab} from '#/lib/routes/helpers'
|
||||||
import {makeProfileLink} from '#/lib/routes/links'
|
import {makeProfileLink} from '#/lib/routes/links'
|
||||||
import {CommonNavigatorParams} from '#/lib/routes/types'
|
import {type CommonNavigatorParams} from '#/lib/routes/types'
|
||||||
import {useGate} from '#/lib/statsig/statsig'
|
import {useGate} from '#/lib/statsig/statsig'
|
||||||
import {useHomeBadge} from '#/state/home-badge'
|
import {useHomeBadge} from '#/state/home-badge'
|
||||||
import {useUnreadMessageCount} from '#/state/queries/messages/list-conversations'
|
import {useUnreadMessageCount} from '#/state/queries/messages/list-conversations'
|
||||||
@@ -223,7 +223,7 @@ export function BottomBarWeb() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const NavItem: React.FC<{
|
const NavItem: React.FC<{
|
||||||
children: (props: {isActive: boolean}) => React.ReactChild
|
children: (props: {isActive: boolean}) => React.ReactNode
|
||||||
href: string
|
href: string
|
||||||
routeName: string
|
routeName: string
|
||||||
hasNew?: boolean
|
hasNew?: boolean
|
||||||
|
|||||||
@@ -7542,11 +7542,6 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0"
|
resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0"
|
||||||
integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==
|
integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==
|
||||||
|
|
||||||
"@types/prop-types@*":
|
|
||||||
version "15.7.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf"
|
|
||||||
integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==
|
|
||||||
|
|
||||||
"@types/psl@^1.1.1":
|
"@types/psl@^1.1.1":
|
||||||
version "1.1.1"
|
version "1.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/@types/psl/-/psl-1.1.1.tgz#3ba9e6d4bd2a32652a639fd5df7e539151d0a3b2"
|
resolved "https://registry.yarnpkg.com/@types/psl/-/psl-1.1.1.tgz#3ba9e6d4bd2a32652a639fd5df7e539151d0a3b2"
|
||||||
@@ -7574,13 +7569,11 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@types/react" "*"
|
"@types/react" "*"
|
||||||
|
|
||||||
"@types/react@*", "@types/react@^18":
|
"@types/react@*", "@types/react@^19":
|
||||||
version "18.2.20"
|
version "19.1.4"
|
||||||
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.20.tgz#1605557a83df5c8a2cc4eeb743b3dfc0eb6aaeb2"
|
resolved "https://registry.yarnpkg.com/@types/react/-/react-19.1.4.tgz#4d125f014d6ac26b4759775698db118701e314fe"
|
||||||
integrity sha512-WKNtmsLWJM/3D5mG4U84cysVY31ivmyw85dE84fOCk5Hx78wezB/XEjVPWl2JTZ5FkEeaTJf+VgUAUn3PE7Isw==
|
integrity sha512-EB1yiiYdvySuIITtD5lhW4yPyJ31RkJkkDw794LaQYrxCSaQV/47y5o1FMC4zF9ZyjUjzJMZwbovEnT5yHTW6g==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/prop-types" "*"
|
|
||||||
"@types/scheduler" "*"
|
|
||||||
csstype "^3.0.2"
|
csstype "^3.0.2"
|
||||||
|
|
||||||
"@types/retry@0.12.0":
|
"@types/retry@0.12.0":
|
||||||
@@ -7588,11 +7581,6 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d"
|
resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d"
|
||||||
integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==
|
integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==
|
||||||
|
|
||||||
"@types/scheduler@*":
|
|
||||||
version "0.16.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.3.tgz#cef09e3ec9af1d63d2a6cc5b383a737e24e6dcf5"
|
|
||||||
integrity sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==
|
|
||||||
|
|
||||||
"@types/semver@^7.3.12":
|
"@types/semver@^7.3.12":
|
||||||
version "7.5.0"
|
version "7.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a"
|
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a"
|
||||||
|
|||||||
Reference in New Issue
Block a user