react-native-screen-transitions 3.0.0-rc.1 → 3.0.0-rc.2
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/lib/commonjs/blank-stack/components/Overlay.js +8 -11
- package/lib/commonjs/blank-stack/components/Overlay.js.map +1 -1
- package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js +2 -3
- package/lib/commonjs/blank-stack/hooks/use-overlay-animation.js.map +1 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +1 -0
- package/lib/{module/blank-stack/utils/with-stack-navigation/_utils → commonjs/blank-stack/utils/with-stack-navigation/helpers}/calculate-active-screens-limit.js.map +1 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +1 -0
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +1 -0
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +1 -0
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +1 -0
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +1 -0
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.js +4 -4
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +1 -0
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js +2 -2
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/index.js.map +1 -1
- package/lib/commonjs/shared/configs/presets.js +8 -2
- package/lib/commonjs/shared/configs/presets.js.map +1 -1
- package/lib/commonjs/shared/hooks/animation/use-screen-animation.js +6 -1
- package/lib/commonjs/shared/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/module/blank-stack/components/Overlay.js +8 -11
- package/lib/module/blank-stack/components/Overlay.js.map +1 -1
- package/lib/module/blank-stack/hooks/use-overlay-animation.js +2 -3
- package/lib/module/blank-stack/hooks/use-overlay-animation.js.map +1 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-closing-route-keys.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-previous.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.js +4 -4
- package/lib/module/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.js.map +1 -0
- package/lib/module/blank-stack/utils/with-stack-navigation/index.js +2 -2
- package/lib/module/blank-stack/utils/with-stack-navigation/index.js.map +1 -1
- package/lib/module/shared/configs/presets.js +8 -2
- package/lib/module/shared/configs/presets.js.map +1 -1
- package/lib/module/shared/hooks/animation/use-screen-animation.js +6 -1
- package/lib/module/shared/hooks/animation/use-screen-animation.js.map +1 -1
- package/lib/typescript/blank-stack/components/Overlay.d.ts.map +1 -1
- package/lib/typescript/blank-stack/types.d.ts +19 -105
- package/lib/typescript/blank-stack/types.d.ts.map +1 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/are-descriptors-equal.d.ts.map +1 -0
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/calculate-active-screens-limit.d.ts.map +1 -0
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/compose-descriptors.d.ts.map +1 -0
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/have-same-route-keys.d.ts.map +1 -0
- package/lib/typescript/blank-stack/utils/with-stack-navigation/helpers/routes-are-identical.d.ts.map +1 -0
- package/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-closing-route-keys.d.ts.map +1 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.d.ts.map +1 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/hooks/use-stack-navigation-state.d.ts.map +1 -0
- package/lib/typescript/native-stack/types.d.ts +7 -1
- package/lib/typescript/native-stack/types.d.ts.map +1 -1
- package/lib/typescript/shared/configs/index.d.ts.map +1 -1
- package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/animation/use-screen-animation.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +14 -14
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/types/core.types.d.ts +0 -4
- package/lib/typescript/shared/types/core.types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/blank-stack/components/Overlay.tsx +7 -11
- package/src/blank-stack/hooks/use-overlay-animation.tsx +11 -11
- package/src/blank-stack/types.ts +26 -102
- package/src/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.tsx +4 -4
- package/src/blank-stack/utils/with-stack-navigation/index.tsx +2 -2
- package/src/native-stack/types.ts +8 -1
- package/src/shared/configs/presets.ts +8 -2
- package/src/shared/hooks/animation/use-screen-animation.tsx +12 -4
- package/src/shared/types/core.types.ts +4 -6
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_hooks/use-previous.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/calculate-active-screens-limit.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.js.map +0 -1
- package/lib/commonjs/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/_hooks/use-previous.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.js.map +0 -1
- package/lib/module/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.js.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/_hooks/use-stack-navigation-state.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/_utils/are-descriptors-equal.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/_utils/calculate-active-screens-limit.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/_utils/compose-descriptors.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/_utils/have-same-route-keys.d.ts.map +0 -1
- package/lib/typescript/blank-stack/utils/with-stack-navigation/_utils/routes-are-identical.d.ts.map +0 -1
- /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_utils → helpers}/are-descriptors-equal.js +0 -0
- /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_utils → helpers}/calculate-active-screens-limit.js +0 -0
- /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_utils → helpers}/compose-descriptors.js +0 -0
- /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_utils → helpers}/have-same-route-keys.js +0 -0
- /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_utils → helpers}/routes-are-identical.js +0 -0
- /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-closing-route-keys.js +0 -0
- /package/lib/commonjs/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.js +0 -0
- /package/lib/module/blank-stack/utils/with-stack-navigation/{_utils → helpers}/are-descriptors-equal.js +0 -0
- /package/lib/module/blank-stack/utils/with-stack-navigation/{_utils → helpers}/calculate-active-screens-limit.js +0 -0
- /package/lib/module/blank-stack/utils/with-stack-navigation/{_utils → helpers}/compose-descriptors.js +0 -0
- /package/lib/module/blank-stack/utils/with-stack-navigation/{_utils → helpers}/have-same-route-keys.js +0 -0
- /package/lib/module/blank-stack/utils/with-stack-navigation/{_utils → helpers}/routes-are-identical.js +0 -0
- /package/lib/module/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-closing-route-keys.js +0 -0
- /package/lib/module/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.js +0 -0
- /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_utils → helpers}/are-descriptors-equal.d.ts +0 -0
- /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_utils → helpers}/calculate-active-screens-limit.d.ts +0 -0
- /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_utils → helpers}/compose-descriptors.d.ts +0 -0
- /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_utils → helpers}/have-same-route-keys.d.ts +0 -0
- /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_utils → helpers}/routes-are-identical.d.ts +0 -0
- /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-closing-route-keys.d.ts +0 -0
- /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.d.ts +0 -0
- /package/lib/typescript/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.d.ts +0 -0
- /package/src/blank-stack/utils/with-stack-navigation/{_utils → helpers}/are-descriptors-equal.ts +0 -0
- /package/src/blank-stack/utils/with-stack-navigation/{_utils → helpers}/calculate-active-screens-limit.ts +0 -0
- /package/src/blank-stack/utils/with-stack-navigation/{_utils → helpers}/compose-descriptors.ts +0 -0
- /package/src/blank-stack/utils/with-stack-navigation/{_utils → helpers}/have-same-route-keys.ts +0 -0
- /package/src/blank-stack/utils/with-stack-navigation/{_utils → helpers}/routes-are-identical.ts +0 -0
- /package/src/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-closing-route-keys.tsx +0 -0
- /package/src/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-previous.tsx +0 -0
|
@@ -312,17 +312,17 @@ declare const _default: {
|
|
|
312
312
|
accessibilityLargeContentTitle?: string | import("react-native-reanimated").SharedValue<string | undefined> | undefined;
|
|
313
313
|
accessibilityRespondsToUserInteraction?: boolean | import("react-native-reanimated").SharedValue<boolean | undefined> | undefined;
|
|
314
314
|
onPress?: ((event: import("react-native").GestureResponderEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").GestureResponderEvent) => void) | null | undefined> | null | undefined;
|
|
315
|
-
|
|
315
|
+
onHoverIn?: ((event: import("react-native").MouseEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").MouseEvent) => void) | null | undefined> | null | undefined;
|
|
316
|
+
onHoverOut?: ((event: import("react-native").MouseEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").MouseEvent) => void) | null | undefined> | null | undefined;
|
|
316
317
|
onPressIn?: ((event: import("react-native").GestureResponderEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").GestureResponderEvent) => void) | null | undefined> | null | undefined;
|
|
317
318
|
onPressOut?: ((event: import("react-native").GestureResponderEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").GestureResponderEvent) => void) | null | undefined> | null | undefined;
|
|
318
319
|
onLongPress?: ((event: import("react-native").GestureResponderEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").GestureResponderEvent) => void) | null | undefined> | null | undefined;
|
|
319
|
-
pressRetentionOffset?: number | import("react-native").Insets | import("react-native-reanimated").SharedValue<number | import("react-native").Insets | null | undefined> | null | undefined;
|
|
320
|
-
onHoverIn?: ((event: import("react-native").MouseEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").MouseEvent) => void) | null | undefined> | null | undefined;
|
|
321
|
-
onHoverOut?: ((event: import("react-native").MouseEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").MouseEvent) => void) | null | undefined> | null | undefined;
|
|
322
320
|
cancelable?: boolean | import("react-native-reanimated").SharedValue<boolean | null | undefined> | null | undefined;
|
|
323
321
|
delayHoverIn?: number | import("react-native-reanimated").SharedValue<number | null | undefined> | null | undefined;
|
|
324
322
|
delayHoverOut?: number | import("react-native-reanimated").SharedValue<number | null | undefined> | null | undefined;
|
|
325
323
|
delayLongPress?: number | import("react-native-reanimated").SharedValue<number | null | undefined> | null | undefined;
|
|
324
|
+
disabled?: boolean | import("react-native-reanimated").SharedValue<boolean | null | undefined> | null | undefined;
|
|
325
|
+
pressRetentionOffset?: number | import("react-native").Insets | import("react-native-reanimated").SharedValue<number | import("react-native").Insets | null | undefined> | null | undefined;
|
|
326
326
|
android_disableSound?: boolean | import("react-native-reanimated").SharedValue<boolean | null | undefined> | null | undefined;
|
|
327
327
|
android_ripple?: import("react-native").PressableAndroidRippleConfig | import("react-native-reanimated").SharedValue<import("react-native").PressableAndroidRippleConfig | null | undefined> | null | undefined;
|
|
328
328
|
testOnly_pressed?: boolean | import("react-native-reanimated").SharedValue<boolean | null | undefined> | null | undefined;
|
|
@@ -433,17 +433,17 @@ declare const _default: {
|
|
|
433
433
|
accessibilityLargeContentTitle?: string | import("react-native-reanimated").SharedValue<string | undefined> | undefined;
|
|
434
434
|
accessibilityRespondsToUserInteraction?: boolean | import("react-native-reanimated").SharedValue<boolean | undefined> | undefined;
|
|
435
435
|
onPress?: ((event: import("react-native").GestureResponderEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").GestureResponderEvent) => void) | null | undefined> | null | undefined;
|
|
436
|
-
|
|
436
|
+
onHoverIn?: ((event: import("react-native").MouseEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").MouseEvent) => void) | null | undefined> | null | undefined;
|
|
437
|
+
onHoverOut?: ((event: import("react-native").MouseEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").MouseEvent) => void) | null | undefined> | null | undefined;
|
|
437
438
|
onPressIn?: ((event: import("react-native").GestureResponderEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").GestureResponderEvent) => void) | null | undefined> | null | undefined;
|
|
438
439
|
onPressOut?: ((event: import("react-native").GestureResponderEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").GestureResponderEvent) => void) | null | undefined> | null | undefined;
|
|
439
440
|
onLongPress?: ((event: import("react-native").GestureResponderEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").GestureResponderEvent) => void) | null | undefined> | null | undefined;
|
|
440
|
-
pressRetentionOffset?: number | import("react-native").Insets | import("react-native-reanimated").SharedValue<number | import("react-native").Insets | null | undefined> | null | undefined;
|
|
441
|
-
onHoverIn?: ((event: import("react-native").MouseEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").MouseEvent) => void) | null | undefined> | null | undefined;
|
|
442
|
-
onHoverOut?: ((event: import("react-native").MouseEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").MouseEvent) => void) | null | undefined> | null | undefined;
|
|
443
441
|
cancelable?: boolean | import("react-native-reanimated").SharedValue<boolean | null | undefined> | null | undefined;
|
|
444
442
|
delayHoverIn?: number | import("react-native-reanimated").SharedValue<number | null | undefined> | null | undefined;
|
|
445
443
|
delayHoverOut?: number | import("react-native-reanimated").SharedValue<number | null | undefined> | null | undefined;
|
|
446
444
|
delayLongPress?: number | import("react-native-reanimated").SharedValue<number | null | undefined> | null | undefined;
|
|
445
|
+
disabled?: boolean | import("react-native-reanimated").SharedValue<boolean | null | undefined> | null | undefined;
|
|
446
|
+
pressRetentionOffset?: number | import("react-native").Insets | import("react-native-reanimated").SharedValue<number | import("react-native").Insets | null | undefined> | null | undefined;
|
|
447
447
|
android_disableSound?: boolean | import("react-native-reanimated").SharedValue<boolean | null | undefined> | null | undefined;
|
|
448
448
|
android_ripple?: import("react-native").PressableAndroidRippleConfig | import("react-native-reanimated").SharedValue<import("react-native").PressableAndroidRippleConfig | null | undefined> | null | undefined;
|
|
449
449
|
testOnly_pressed?: boolean | import("react-native-reanimated").SharedValue<boolean | null | undefined> | null | undefined;
|
|
@@ -594,7 +594,7 @@ declare const _default: {
|
|
|
594
594
|
centerContent?: boolean | import("react-native-reanimated").SharedValue<boolean | undefined> | undefined;
|
|
595
595
|
contentInset?: import("react-native").Insets | import("react-native-reanimated").SharedValue<import("react-native").Insets | undefined> | undefined;
|
|
596
596
|
contentOffset?: import("react-native").PointProp | import("react-native-reanimated").SharedValue<import("react-native").PointProp | undefined> | undefined;
|
|
597
|
-
contentInsetAdjustmentBehavior?: "
|
|
597
|
+
contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes" | import("react-native-reanimated").SharedValue<"always" | "never" | "automatic" | "scrollableAxes" | undefined> | undefined;
|
|
598
598
|
directionalLockEnabled?: boolean | import("react-native-reanimated").SharedValue<boolean | undefined> | undefined;
|
|
599
599
|
maintainVisibleContentPosition?: {
|
|
600
600
|
autoscrollToTopThreshold?: number | null | undefined;
|
|
@@ -769,7 +769,7 @@ declare const _default: {
|
|
|
769
769
|
centerContent?: boolean | import("react-native-reanimated").SharedValue<boolean | undefined> | undefined;
|
|
770
770
|
contentInset?: import("react-native").Insets | import("react-native-reanimated").SharedValue<import("react-native").Insets | undefined> | undefined;
|
|
771
771
|
contentOffset?: import("react-native").PointProp | import("react-native-reanimated").SharedValue<import("react-native").PointProp | undefined> | undefined;
|
|
772
|
-
contentInsetAdjustmentBehavior?: "
|
|
772
|
+
contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes" | import("react-native-reanimated").SharedValue<"always" | "never" | "automatic" | "scrollableAxes" | undefined> | undefined;
|
|
773
773
|
directionalLockEnabled?: boolean | import("react-native-reanimated").SharedValue<boolean | undefined> | undefined;
|
|
774
774
|
maintainVisibleContentPosition?: {
|
|
775
775
|
autoscrollToTopThreshold?: number | null | undefined;
|
|
@@ -818,8 +818,8 @@ declare const _default: {
|
|
|
818
818
|
horizontal?: boolean | import("react-native-reanimated").SharedValue<boolean | null | undefined> | null | undefined;
|
|
819
819
|
data: ArrayLike<unknown> | import("react-native-reanimated").SharedValue<ArrayLike<unknown> | null | undefined> | null | undefined;
|
|
820
820
|
children?: import("react").ReactNode | import("react-native-reanimated").SharedValue<import("react").ReactNode>;
|
|
821
|
-
inverted?: boolean | import("react-native-reanimated").SharedValue<boolean | null | undefined> | null | undefined;
|
|
822
821
|
pointerEvents?: "none" | "auto" | "box-none" | "box-only" | import("react-native-reanimated").SharedValue<"none" | "auto" | "box-none" | "box-only" | undefined> | undefined;
|
|
822
|
+
inverted?: boolean | import("react-native-reanimated").SharedValue<boolean | null | undefined> | null | undefined;
|
|
823
823
|
hitSlop?: number | import("react-native").Insets | import("react-native-reanimated").SharedValue<number | import("react-native").Insets | null | undefined> | null | undefined;
|
|
824
824
|
needsOffscreenAlphaCompositing?: boolean | import("react-native-reanimated").SharedValue<boolean | undefined> | undefined;
|
|
825
825
|
onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").LayoutChangeEvent) => void) | undefined> | undefined;
|
|
@@ -950,7 +950,7 @@ declare const _default: {
|
|
|
950
950
|
centerContent?: boolean | import("react-native-reanimated").SharedValue<boolean | undefined> | undefined;
|
|
951
951
|
contentInset?: import("react-native").Insets | import("react-native-reanimated").SharedValue<import("react-native").Insets | undefined> | undefined;
|
|
952
952
|
contentOffset?: import("react-native").PointProp | import("react-native-reanimated").SharedValue<import("react-native").PointProp | undefined> | undefined;
|
|
953
|
-
contentInsetAdjustmentBehavior?: "
|
|
953
|
+
contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes" | import("react-native-reanimated").SharedValue<"always" | "never" | "automatic" | "scrollableAxes" | undefined> | undefined;
|
|
954
954
|
directionalLockEnabled?: boolean | import("react-native-reanimated").SharedValue<boolean | undefined> | undefined;
|
|
955
955
|
maintainVisibleContentPosition?: {
|
|
956
956
|
autoscrollToTopThreshold?: number | null | undefined;
|
|
@@ -1060,8 +1060,8 @@ declare const _default: {
|
|
|
1060
1060
|
horizontal?: boolean | import("react-native-reanimated").SharedValue<boolean | null | undefined> | null | undefined;
|
|
1061
1061
|
data: ArrayLike<unknown> | import("react-native-reanimated").SharedValue<ArrayLike<unknown> | null | undefined> | null | undefined;
|
|
1062
1062
|
children?: import("react").ReactNode | import("react-native-reanimated").SharedValue<import("react").ReactNode>;
|
|
1063
|
-
inverted?: boolean | import("react-native-reanimated").SharedValue<boolean | null | undefined> | null | undefined;
|
|
1064
1063
|
pointerEvents?: "none" | "auto" | "box-none" | "box-only" | import("react-native-reanimated").SharedValue<"none" | "auto" | "box-none" | "box-only" | undefined> | undefined;
|
|
1064
|
+
inverted?: boolean | import("react-native-reanimated").SharedValue<boolean | null | undefined> | null | undefined;
|
|
1065
1065
|
hitSlop?: number | import("react-native").Insets | import("react-native-reanimated").SharedValue<number | import("react-native").Insets | null | undefined> | null | undefined;
|
|
1066
1066
|
needsOffscreenAlphaCompositing?: boolean | import("react-native-reanimated").SharedValue<boolean | undefined> | undefined;
|
|
1067
1067
|
onLayout?: ((event: import("react-native").LayoutChangeEvent) => void) | import("react-native-reanimated").SharedValue<((event: import("react-native").LayoutChangeEvent) => void) | undefined> | undefined;
|
|
@@ -1192,7 +1192,7 @@ declare const _default: {
|
|
|
1192
1192
|
centerContent?: boolean | import("react-native-reanimated").SharedValue<boolean | undefined> | undefined;
|
|
1193
1193
|
contentInset?: import("react-native").Insets | import("react-native-reanimated").SharedValue<import("react-native").Insets | undefined> | undefined;
|
|
1194
1194
|
contentOffset?: import("react-native").PointProp | import("react-native-reanimated").SharedValue<import("react-native").PointProp | undefined> | undefined;
|
|
1195
|
-
contentInsetAdjustmentBehavior?: "
|
|
1195
|
+
contentInsetAdjustmentBehavior?: "always" | "never" | "automatic" | "scrollableAxes" | import("react-native-reanimated").SharedValue<"always" | "never" | "automatic" | "scrollableAxes" | undefined> | undefined;
|
|
1196
1196
|
directionalLockEnabled?: boolean | import("react-native-reanimated").SharedValue<boolean | undefined> | undefined;
|
|
1197
1197
|
maintainVisibleContentPosition?: {
|
|
1198
1198
|
autoscrollToTopThreshold?: number | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,UAAU,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,EAAE,8BAA8B,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,UAAU,MAAM,uCAAuC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA2BivE,CAAC;;;;;;;;;;;;;;;;AAxBjzE,wBAaE;AAEF,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E,YAAY,EACX,eAAe,EACf,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,GACvB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -83,9 +83,5 @@ export type ScreenTransitionConfig = {
|
|
|
83
83
|
* The area of the screen where the gesture is activated.
|
|
84
84
|
*/
|
|
85
85
|
gestureActivationArea?: GestureActivationArea;
|
|
86
|
-
/**
|
|
87
|
-
* Whether to enable transitions. It sets the presentation to containedTransparentModal, animation none, and headerShown to false.
|
|
88
|
-
*/
|
|
89
|
-
enableTransitions?: boolean;
|
|
90
86
|
};
|
|
91
87
|
//# sourceMappingURL=core.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.types.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/core.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"core.types.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/core.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,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native";
|
|
5
5
|
import { useMemo } from "react";
|
|
6
6
|
import { Animated, StyleSheet, View } from "react-native";
|
|
7
|
-
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
8
7
|
import { useScreenAnimation } from "../../shared/hooks/animation/use-screen-animation";
|
|
9
8
|
import { KeysProvider, useKeys } from "../../shared/providers/keys.provider";
|
|
10
9
|
import { TransitionStylesProvider } from "../../shared/providers/transition-styles.provider";
|
|
@@ -45,8 +44,6 @@ const getActiveFloatOverlay = (scenes: BlankStackScene[], index: number) => {
|
|
|
45
44
|
};
|
|
46
45
|
|
|
47
46
|
const OverlayHost = ({ scene, isFloating }: OverlayHostProps) => {
|
|
48
|
-
const insets = useSafeAreaInsets();
|
|
49
|
-
|
|
50
47
|
const OverlayComponent = scene.descriptor.options.overlay;
|
|
51
48
|
|
|
52
49
|
const { overlayAnimation, optimisticActiveIndex } = useOverlayAnimation();
|
|
@@ -58,9 +55,9 @@ const OverlayHost = ({ scene, isFloating }: OverlayHostProps) => {
|
|
|
58
55
|
);
|
|
59
56
|
}, [scenes, scene.route.key]);
|
|
60
57
|
|
|
61
|
-
const
|
|
58
|
+
const focusedScene = useMemo(() => {
|
|
62
59
|
if (overlaySceneIndex === -1) {
|
|
63
|
-
return scene
|
|
60
|
+
return scene;
|
|
64
61
|
}
|
|
65
62
|
|
|
66
63
|
const maxOffset = Math.max(scenes.length - overlaySceneIndex - 1, 0);
|
|
@@ -69,8 +66,8 @@ const OverlayHost = ({ scene, isFloating }: OverlayHostProps) => {
|
|
|
69
66
|
maxOffset,
|
|
70
67
|
);
|
|
71
68
|
|
|
72
|
-
return scenes[overlaySceneIndex + normalizedIndex]
|
|
73
|
-
}, [overlaySceneIndex, optimisticActiveIndex, scenes, scene
|
|
69
|
+
return scenes[overlaySceneIndex + normalizedIndex] ?? scene;
|
|
70
|
+
}, [overlaySceneIndex, optimisticActiveIndex, scenes, scene]);
|
|
74
71
|
|
|
75
72
|
const screenAnimation = useScreenAnimation();
|
|
76
73
|
|
|
@@ -79,13 +76,12 @@ const OverlayHost = ({ scene, isFloating }: OverlayHostProps) => {
|
|
|
79
76
|
}
|
|
80
77
|
|
|
81
78
|
const overlayProps: BlankStackOverlayProps = {
|
|
82
|
-
|
|
83
|
-
|
|
79
|
+
focusedRoute: focusedScene.route,
|
|
80
|
+
focusedIndex: optimisticActiveIndex,
|
|
81
|
+
overlayOptions: focusedScene.descriptor.options.overlayOptions,
|
|
84
82
|
navigation: scene.descriptor.navigation,
|
|
85
83
|
overlayAnimation,
|
|
86
84
|
screenAnimation,
|
|
87
|
-
focusedIndex: optimisticActiveIndex,
|
|
88
|
-
insets,
|
|
89
85
|
};
|
|
90
86
|
|
|
91
87
|
return (
|
|
@@ -51,21 +51,21 @@ export const useOverlayAnimation = (): {
|
|
|
51
51
|
return total;
|
|
52
52
|
}, [progressValues]);
|
|
53
53
|
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const activeIndex = progressValues.length - 1;
|
|
54
|
+
const optimisticActiveIndex = useSharedValueState(
|
|
55
|
+
useDerivedValue(() => {
|
|
56
|
+
"worklet";
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
progressValues.some((value) => value.closing.value > 0),
|
|
61
|
-
);
|
|
58
|
+
const activeIndex = progressValues.length - 1;
|
|
62
59
|
|
|
63
|
-
|
|
60
|
+
const isOneDismissing = Number(
|
|
61
|
+
progressValues.some((value) => value.closing.value > 0),
|
|
62
|
+
);
|
|
64
63
|
|
|
65
|
-
|
|
66
|
-
});
|
|
64
|
+
const optimisticIndex = activeIndex - isOneDismissing;
|
|
67
65
|
|
|
68
|
-
|
|
66
|
+
return optimisticIndex;
|
|
67
|
+
}),
|
|
68
|
+
);
|
|
69
69
|
|
|
70
70
|
const screen = useWindowDimensions();
|
|
71
71
|
|
package/src/blank-stack/types.ts
CHANGED
|
@@ -12,8 +12,8 @@ import type {
|
|
|
12
12
|
Theme,
|
|
13
13
|
} from "@react-navigation/native";
|
|
14
14
|
import type { DerivedValue } from "react-native-reanimated";
|
|
15
|
-
import type { EdgeInsets } from "react-native-safe-area-context";
|
|
16
15
|
import type { ScreenProps } from "react-native-screens";
|
|
16
|
+
import type { ScreenTransitionConfig } from "../shared";
|
|
17
17
|
import type {
|
|
18
18
|
OverlayInterpolationProps,
|
|
19
19
|
ScreenInterpolationProps,
|
|
@@ -95,65 +95,41 @@ export type BlankStackNavigationConfig = {};
|
|
|
95
95
|
|
|
96
96
|
export type BlankStackOverlayProps = {
|
|
97
97
|
/**
|
|
98
|
-
*
|
|
98
|
+
* Route of the currently focused screen in the stack.
|
|
99
99
|
*/
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
* Title of the previous screen.
|
|
103
|
-
*/
|
|
104
|
-
title: string;
|
|
105
|
-
};
|
|
100
|
+
focusedRoute: Route<string>;
|
|
101
|
+
|
|
106
102
|
/**
|
|
107
|
-
*
|
|
103
|
+
* Index of the focused route in the stack.
|
|
108
104
|
*/
|
|
109
|
-
|
|
105
|
+
focusedIndex: number;
|
|
106
|
+
|
|
110
107
|
/**
|
|
111
|
-
*
|
|
108
|
+
* Options passed to the overlay component.
|
|
112
109
|
*/
|
|
113
|
-
|
|
110
|
+
overlayOptions?: {
|
|
111
|
+
title?: string;
|
|
112
|
+
subtitle?: string;
|
|
113
|
+
[key: string]: unknown;
|
|
114
|
+
};
|
|
115
|
+
|
|
114
116
|
/**
|
|
115
117
|
* Navigation prop for the overlay.
|
|
116
118
|
*/
|
|
117
119
|
navigation: BlankStackNavigationProp<ParamListBase>;
|
|
118
|
-
|
|
119
|
-
* Safe area insets for the screen.
|
|
120
|
-
*/
|
|
121
|
-
insets: EdgeInsets;
|
|
120
|
+
|
|
122
121
|
/**
|
|
123
122
|
* Animation values for the overlay.
|
|
124
123
|
*/
|
|
125
124
|
overlayAnimation: DerivedValue<OverlayInterpolationProps>;
|
|
125
|
+
|
|
126
126
|
/**
|
|
127
127
|
* Animation values for the screen.
|
|
128
128
|
*/
|
|
129
129
|
screenAnimation: DerivedValue<ScreenInterpolationProps>;
|
|
130
|
-
/**
|
|
131
|
-
* Index of the active route
|
|
132
|
-
*/
|
|
133
|
-
focusedIndex: number;
|
|
134
130
|
};
|
|
135
131
|
|
|
136
|
-
export type BlankStackScreenTransitionConfig = {
|
|
137
|
-
/**
|
|
138
|
-
* The user-provided function to calculate styles based on animation progress.
|
|
139
|
-
*/
|
|
140
|
-
screenStyleInterpolator?: ScreenStyleInterpolator;
|
|
141
|
-
/**
|
|
142
|
-
* The Reanimated animation config for opening and closing transitions.
|
|
143
|
-
*/
|
|
144
|
-
transitionSpec?: TransitionSpec;
|
|
145
|
-
/**
|
|
146
|
-
* Whether the gesture is enabled.
|
|
147
|
-
*/
|
|
148
|
-
gestureEnabled?: boolean;
|
|
149
|
-
/**
|
|
150
|
-
* The direction of the swipe gesture used to dismiss the screen.
|
|
151
|
-
*/
|
|
152
|
-
gestureDirection?: GestureDirection | GestureDirection[];
|
|
153
|
-
/**
|
|
154
|
-
* How much the gesture's final velocity impacts the dismiss decision.
|
|
155
|
-
*/
|
|
156
|
-
gestureVelocityImpact?: number;
|
|
132
|
+
export type BlankStackScreenTransitionConfig = ScreenTransitionConfig & {
|
|
157
133
|
/**
|
|
158
134
|
* Whether to detach the previous screen from the view hierarchy to save memory.
|
|
159
135
|
* Set it to `false` if you need the previous screen to be seen through the active screen.
|
|
@@ -161,18 +137,6 @@ export type BlankStackScreenTransitionConfig = {
|
|
|
161
137
|
* Defaults to `false` for the last screen for modals, otherwise `true`.
|
|
162
138
|
*/
|
|
163
139
|
detachPreviousScreen?: boolean;
|
|
164
|
-
/**
|
|
165
|
-
* Distance threshold for gesture recognition throughout the screen.
|
|
166
|
-
*/
|
|
167
|
-
gestureResponseDistance?: number;
|
|
168
|
-
/**
|
|
169
|
-
* Whether the gesture drives the progress.
|
|
170
|
-
*/
|
|
171
|
-
gestureDrivesProgress?: boolean;
|
|
172
|
-
/**
|
|
173
|
-
* The area of the screen where the gesture is activated.
|
|
174
|
-
*/
|
|
175
|
-
gestureActivationArea?: GestureActivationArea;
|
|
176
140
|
};
|
|
177
141
|
|
|
178
142
|
export type BlankStackNavigationOptions = BlankStackScreenTransitionConfig & {
|
|
@@ -180,6 +144,7 @@ export type BlankStackNavigationOptions = BlankStackScreenTransitionConfig & {
|
|
|
180
144
|
* Function that given `OverlayProps` returns a React Element to display as a overlay.
|
|
181
145
|
*/
|
|
182
146
|
overlay?: (props: BlankStackOverlayProps) => React.ReactNode;
|
|
147
|
+
|
|
183
148
|
/**
|
|
184
149
|
* Layout: How the Overlay is positioned
|
|
185
150
|
* - 'float': Single persistent overlay above all screens (like iOS)
|
|
@@ -187,6 +152,7 @@ export type BlankStackNavigationOptions = BlankStackScreenTransitionConfig & {
|
|
|
187
152
|
* @default 'screen'
|
|
188
153
|
*/
|
|
189
154
|
overlayMode?: "float" | "screen";
|
|
155
|
+
|
|
190
156
|
/**
|
|
191
157
|
* Whether to show the overlay. The overlay is shown by default.
|
|
192
158
|
* Setting this to `false` hides the overlay.
|
|
@@ -194,56 +160,14 @@ export type BlankStackNavigationOptions = BlankStackScreenTransitionConfig & {
|
|
|
194
160
|
overlayShown?: boolean;
|
|
195
161
|
|
|
196
162
|
/**
|
|
197
|
-
*
|
|
198
|
-
*
|
|
199
|
-
* @platform ios
|
|
200
|
-
*/
|
|
201
|
-
autoHideHomeIndicator?: boolean;
|
|
202
|
-
/**
|
|
203
|
-
* Whether the keyboard should hide when swiping to the previous screen. Defaults to `false`.
|
|
204
|
-
*
|
|
205
|
-
* @platform ios
|
|
206
|
-
*/
|
|
207
|
-
keyboardHandlingEnabled?: boolean;
|
|
208
|
-
/**
|
|
209
|
-
* Sets the visibility of the navigation bar. Defaults to `false`.
|
|
210
|
-
*
|
|
211
|
-
* @platform android
|
|
212
|
-
*/
|
|
213
|
-
navigationBarHidden?: boolean;
|
|
214
|
-
/**
|
|
215
|
-
* Sets the status bar animation (similar to the `StatusBar` component).
|
|
216
|
-
* On Android, setting either `fade` or `slide` will set the transition of status bar color. On iOS, this option applies to appereance animation of the status bar.
|
|
217
|
-
* Requires setting `View controller-based status bar appearance -> YES` (or removing the config) in your `Info.plist` file.
|
|
218
|
-
*
|
|
219
|
-
* Defaults to `fade` on iOS and `none` on Android.
|
|
220
|
-
*
|
|
221
|
-
* Only supported on Android and iOS.
|
|
222
|
-
*
|
|
223
|
-
* @platform android, ios
|
|
224
|
-
*/
|
|
225
|
-
statusBarAnimation?: ScreenProps["statusBarAnimation"];
|
|
226
|
-
/**
|
|
227
|
-
* Whether the status bar should be hidden on this screen.
|
|
228
|
-
* Requires setting `View controller-based status bar appearance -> YES` in your Info.plist file.
|
|
229
|
-
*
|
|
230
|
-
* Only supported on Android and iOS.
|
|
231
|
-
*
|
|
232
|
-
* @platform android, ios
|
|
163
|
+
* Options passed to the overlay component.
|
|
233
164
|
*/
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
* Defaults to `auto` on iOS and `light` on Android.
|
|
241
|
-
*
|
|
242
|
-
* Only supported on Android and iOS.
|
|
243
|
-
*
|
|
244
|
-
* @platform android, ios
|
|
245
|
-
*/
|
|
246
|
-
statusBarStyle?: ScreenProps["statusBarStyle"];
|
|
165
|
+
overlayOptions?: {
|
|
166
|
+
title?: string;
|
|
167
|
+
subtitle?: string;
|
|
168
|
+
[key: string]: unknown;
|
|
169
|
+
};
|
|
170
|
+
|
|
247
171
|
/**
|
|
248
172
|
* Whether inactive screens should be suspended from re-rendering. Defaults to `false`.
|
|
249
173
|
* Defaults to `true` when `enableFreeze()` is run at the top of the application.
|
package/src/blank-stack/utils/with-stack-navigation/{_hooks → hooks}/use-stack-navigation-state.tsx
RENAMED
|
@@ -3,10 +3,10 @@ import { useLayoutEffect, useState } from "react";
|
|
|
3
3
|
import useStableCallback from "../../../../shared/hooks/use-stable-callback";
|
|
4
4
|
import type { BlankStackDescriptorMap } from "../../../types";
|
|
5
5
|
import type { StackNavigationContextProps } from "../_types";
|
|
6
|
-
import { areDescriptorsEqual } from "../
|
|
7
|
-
import { composeDescriptors } from "../
|
|
8
|
-
import { haveSameRouteKeys } from "../
|
|
9
|
-
import { routesAreIdentical } from "../
|
|
6
|
+
import { areDescriptorsEqual } from "../helpers/are-descriptors-equal";
|
|
7
|
+
import { composeDescriptors } from "../helpers/compose-descriptors";
|
|
8
|
+
import { haveSameRouteKeys } from "../helpers/have-same-route-keys";
|
|
9
|
+
import { routesAreIdentical } from "../helpers/routes-are-identical";
|
|
10
10
|
import { useClosingRouteKeys } from "./use-closing-route-keys";
|
|
11
11
|
import { usePrevious } from "./use-previous";
|
|
12
12
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type ComponentType, createContext, useContext, useMemo } from "react";
|
|
2
2
|
import type { BlankStackScene } from "../../types";
|
|
3
|
-
import { useStackNavigationState } from "./
|
|
3
|
+
import { useStackNavigationState } from "./hooks/use-stack-navigation-state";
|
|
4
4
|
import type {
|
|
5
5
|
StackNavigationContextProps,
|
|
6
6
|
StackNavigationContextValue,
|
|
7
7
|
} from "./_types";
|
|
8
|
-
import { calculateActiveScreensLimit } from "./
|
|
8
|
+
import { calculateActiveScreensLimit } from "./helpers/calculate-active-screens-limit";
|
|
9
9
|
|
|
10
10
|
export const StackNavigationContext =
|
|
11
11
|
createContext<StackNavigationContextValue | null>(null);
|
|
@@ -143,7 +143,14 @@ export type NativeStackHeaderLeftProps = NativeStackHeaderRightProps & {
|
|
|
143
143
|
href?: string;
|
|
144
144
|
};
|
|
145
145
|
|
|
146
|
-
export type
|
|
146
|
+
export type NativeStackScreenTransitionConfig = ScreenTransitionConfig & {
|
|
147
|
+
/**
|
|
148
|
+
* Whether to enable transitions. It sets the presentation to containedTransparentModal, animation none, and headerShown to false.
|
|
149
|
+
*/
|
|
150
|
+
enableTransitions?: boolean;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
export type NativeStackNavigationOptions = NativeStackScreenTransitionConfig & {
|
|
147
154
|
/**
|
|
148
155
|
* String that can be displayed in the header as a fallback for `headerTitle`.
|
|
149
156
|
*/
|
|
@@ -13,6 +13,7 @@ export const SlideFromTop = (
|
|
|
13
13
|
config: Partial<ScreenTransitionConfig> = {},
|
|
14
14
|
): ScreenTransitionConfig => {
|
|
15
15
|
return {
|
|
16
|
+
//@ts-expect-error - Should not lead to any issues
|
|
16
17
|
enableTransitions: true,
|
|
17
18
|
gestureEnabled: true,
|
|
18
19
|
gestureDirection: "vertical-inverted",
|
|
@@ -45,6 +46,7 @@ export const ZoomIn = (
|
|
|
45
46
|
config: Partial<ScreenTransitionConfig> = {},
|
|
46
47
|
): ScreenTransitionConfig => {
|
|
47
48
|
return {
|
|
49
|
+
//@ts-expect-error - Should not lead to any issues
|
|
48
50
|
enableTransitions: true,
|
|
49
51
|
gestureEnabled: false,
|
|
50
52
|
screenStyleInterpolator: ({ progress }) => {
|
|
@@ -83,6 +85,7 @@ export const SlideFromBottom = (
|
|
|
83
85
|
config: Partial<ScreenTransitionConfig> = {},
|
|
84
86
|
): ScreenTransitionConfig => {
|
|
85
87
|
return {
|
|
88
|
+
//@ts-expect-error - Should not lead to any issues
|
|
86
89
|
enableTransitions: true,
|
|
87
90
|
gestureEnabled: true,
|
|
88
91
|
gestureDirection: "vertical",
|
|
@@ -114,6 +117,7 @@ export const DraggableCard = (
|
|
|
114
117
|
config: Partial<ScreenTransitionConfig> = {},
|
|
115
118
|
): ScreenTransitionConfig => {
|
|
116
119
|
return {
|
|
120
|
+
//@ts-expect-error - Should not lead to any issues
|
|
117
121
|
enableTransitions: true,
|
|
118
122
|
gestureEnabled: true,
|
|
119
123
|
gestureDirection: ["horizontal", "vertical"],
|
|
@@ -159,6 +163,7 @@ export const ElasticCard = (
|
|
|
159
163
|
} = { elasticFactor: 0.5 },
|
|
160
164
|
): ScreenTransitionConfig => {
|
|
161
165
|
return {
|
|
166
|
+
//@ts-expect-error - Should not lead to any issues
|
|
162
167
|
enableTransitions: true,
|
|
163
168
|
gestureEnabled: true,
|
|
164
169
|
gestureDirection: "bidirectional",
|
|
@@ -535,7 +540,7 @@ export const SharedAppleMusic = ({
|
|
|
535
540
|
damping: 500,
|
|
536
541
|
mass: 3,
|
|
537
542
|
overshootClamping: true,
|
|
538
|
-
//@ts-expect-error
|
|
543
|
+
//@ts-expect-error - Should not lead to any issues
|
|
539
544
|
restSpeedThreshold: 0.02,
|
|
540
545
|
},
|
|
541
546
|
close: {
|
|
@@ -543,7 +548,7 @@ export const SharedAppleMusic = ({
|
|
|
543
548
|
damping: 60,
|
|
544
549
|
mass: 4,
|
|
545
550
|
overshootClamping: false,
|
|
546
|
-
//@ts-expect-error
|
|
551
|
+
//@ts-expect-error - Should not lead to any issues
|
|
547
552
|
restSpeedThreshold: 0.02,
|
|
548
553
|
restDisplacementThreshold: 0.002,
|
|
549
554
|
},
|
|
@@ -559,6 +564,7 @@ export const SharedXImage = ({
|
|
|
559
564
|
sharedBoundTag: string;
|
|
560
565
|
}): ScreenTransitionConfig => {
|
|
561
566
|
return {
|
|
567
|
+
//@ts-expect-error - Should not lead to any issues
|
|
562
568
|
enableTransitions: true,
|
|
563
569
|
gestureEnabled: true,
|
|
564
570
|
gestureDirection: ["vertical", "vertical-inverted"],
|
|
@@ -3,16 +3,19 @@ import { useMemo } from "react";
|
|
|
3
3
|
import { useWindowDimensions } from "react-native";
|
|
4
4
|
import { type SharedValue, useDerivedValue } from "react-native-reanimated";
|
|
5
5
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
6
|
-
|
|
6
|
+
import type { NativeStackScreenTransitionConfig } from "../../../native-stack/types";
|
|
7
7
|
import { DEFAULT_SCREEN_TRANSITION_STATE } from "../../constants";
|
|
8
|
-
import {
|
|
9
|
-
|
|
8
|
+
import {
|
|
9
|
+
type TransitionDescriptor,
|
|
10
|
+
useKeys,
|
|
11
|
+
} from "../../providers/keys.provider";
|
|
10
12
|
import { AnimationStore } from "../../stores/animation.store";
|
|
11
13
|
import { GestureStore, type GestureStoreMap } from "../../stores/gesture.store";
|
|
12
14
|
import type {
|
|
13
15
|
ScreenInterpolationProps,
|
|
14
16
|
ScreenTransitionState,
|
|
15
17
|
} from "../../types/animation.types";
|
|
18
|
+
import type { ScreenTransitionConfig } from "../../types/core.types";
|
|
16
19
|
import { derivations } from "../../utils/animation/derivations";
|
|
17
20
|
import { createBounds } from "../../utils/bounds";
|
|
18
21
|
|
|
@@ -66,6 +69,11 @@ const useBuildScreenTransitionState = (
|
|
|
66
69
|
}, [key, descriptor?.route]);
|
|
67
70
|
};
|
|
68
71
|
|
|
72
|
+
const hasTransitionsEnabled = (options?: ScreenTransitionConfig) => {
|
|
73
|
+
"worklet";
|
|
74
|
+
return !!(options as NativeStackScreenTransitionConfig)?.enableTransitions;
|
|
75
|
+
};
|
|
76
|
+
|
|
69
77
|
export function _useScreenAnimation() {
|
|
70
78
|
const dimensions = useWindowDimensions();
|
|
71
79
|
const insets = useSafeAreaInsets();
|
|
@@ -87,7 +95,7 @@ export function _useScreenAnimation() {
|
|
|
87
95
|
|
|
88
96
|
const previous = unwrap(prevAnimation, previousDescriptor?.route.key);
|
|
89
97
|
|
|
90
|
-
const next = nextDescriptor?.options
|
|
98
|
+
const next = hasTransitionsEnabled(nextDescriptor?.options)
|
|
91
99
|
? unwrap(nextAnimation, nextDescriptor?.route.key)
|
|
92
100
|
: undefined;
|
|
93
101
|
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { AnimatedProps } from "react-native-reanimated";
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
ScreenStyleInterpolator,
|
|
4
|
+
TransitionSpec,
|
|
5
|
+
} from "./animation.types";
|
|
3
6
|
import type { GestureActivationArea, GestureDirection } from "./gesture.types";
|
|
4
7
|
|
|
5
8
|
export type Layout = {
|
|
@@ -97,9 +100,4 @@ export type ScreenTransitionConfig = {
|
|
|
97
100
|
* The area of the screen where the gesture is activated.
|
|
98
101
|
*/
|
|
99
102
|
gestureActivationArea?: GestureActivationArea;
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Whether to enable transitions. It sets the presentation to containedTransparentModal, animation none, and headerShown to false.
|
|
103
|
-
*/
|
|
104
|
-
enableTransitions?: boolean;
|
|
105
103
|
};
|
package/lib/commonjs/blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNativeReanimated","_useStableCallback","_interopRequireDefault","e","__esModule","default","useClosingRouteKeys","keysRef","useRef","Set","finishedRef","shared","useSharedValue","add","useStableCallback","key","keys","current","has","delete","modify","prev","includes","push","remove","index","indexOf","splice","clear","size","length","useMemo","ref","exports"],"sourceRoot":"../../../../../../src","sources":["blank-stack/utils/with-stack-navigation/_hooks/use-closing-route-keys.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAC,sBAAA,CAAAH,OAAA;AAA6E,SAAAG,uBAAAC,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEtE,MAAMG,mBAAmB,GAAGA,CAAA,KAAM;EACxC,MAAMC,OAAO,GAAG,IAAAC,aAAM,EAAc,IAAIC,GAAG,CAAC,CAAC,CAAC;EAC9C,MAAMC,WAAW,GAAG,IAAAF,aAAM,EAAc,IAAIC,GAAG,CAAC,CAAC,CAAC;EAClD,MAAME,MAAM,GAAG,IAAAC,qCAAc,EAAW,EAAE,CAAC;EAE3C,MAAMC,GAAG,GAAG,IAAAC,0BAAiB,EAAEC,GAAW,IAAK;IAC9C,MAAMC,IAAI,GAAGT,OAAO,CAACU,OAAO;IAC5B,IAAID,IAAI,CAACE,GAAG,CAACH,GAAG,CAAC,EAAE;MAClB;IACD;IAEAL,WAAW,CAACO,OAAO,CAACE,MAAM,CAACJ,GAAG,CAAC;IA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T,IAAI;IACZ,CAAC,CAAC;EACH,CAAC,CAAC;EAEF,OAAO,IAAAU,cAAO,EACb,OAAO;IACNC,GAAG,EAAEzB,OAAO;IACZI,MAAM;IACNE,GAAG;IACHW,MAAM;IACNI;EACD,CAAC,CAAC,EACF,CAACjB,MAAM,EAAEE,GAAG,EAAEW,MAAM,EAAEI,KAAK,CAC5B,CAAC;AACF,CAAC;AAACK,OAAA,CAAA3B,mBAAA,GAAAA,mBAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","usePrevious","value","ref","useRef","useEffect","current","exports"],"sourceRoot":"../../../../../../src","sources":["blank-stack/utils/with-stack-navigation/_hooks/use-previous.tsx"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,MAAMC,WAAW,GAAQC,KAAQ,IAAe;EACtD,MAAMC,GAAG,GAAG,IAAAC,aAAM,EAAI,IAAI,CAAC;EAE3B,IAAAC,gBAAS,EAAC,MAAM;IACfF,GAAG,CAACG,OAAO,GAAGJ,KAAK;EACpB,CAAC,CAAC;EAEF,OAAOC,GAAG,CAACG,OAAO;AACnB,CAAC;AAACC,OAAA,CAAAN,WAAA,GAAAA,WAAA","ignoreList":[]}
|