react-native-screen-transitions 3.9.0-beta.2 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js +19 -14
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +14 -7
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +32 -2
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js +4 -3
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js +3 -2
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +4 -3
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +2 -3
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js +1 -3
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/teleport.js +2 -1
- package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js +4 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +16 -3
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/commonjs/shared/configs/index.js +2 -1
- package/lib/commonjs/shared/configs/index.js.map +1 -1
- package/lib/commonjs/shared/configs/specs.js +23 -1
- package/lib/commonjs/shared/configs/specs.js.map +1 -1
- package/lib/commonjs/shared/constants.js +4 -0
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +25 -3
- package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
- package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js +2 -0
- package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/values.js +2 -0
- package/lib/commonjs/shared/providers/screen/gestures/shared/values.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +11 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/commonjs/shared/stores/gesture.store.js +8 -0
- package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +24 -7
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +5 -2
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +184 -314
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js +13 -18
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js +196 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +97 -108
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js +73 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js +90 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
- package/lib/module/shared/components/boundary/components/boundary-target.js +20 -15
- package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +14 -7
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +2 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +32 -2
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js +5 -4
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js +3 -2
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +5 -4
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +3 -4
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js +1 -3
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/teleport.js +1 -0
- package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/utils/ownership.js +4 -1
- package/lib/module/shared/components/boundary/portal/utils/ownership.js.map +1 -1
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +17 -4
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/module/shared/configs/index.js +3 -2
- package/lib/module/shared/configs/index.js.map +1 -1
- package/lib/module/shared/configs/specs.js +22 -0
- package/lib/module/shared/configs/specs.js.map +1 -1
- package/lib/module/shared/constants.js +4 -0
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
- package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
- package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +23 -2
- package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
- package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/snapshot.js +2 -0
- package/lib/module/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/values.js +2 -0
- package/lib/module/shared/providers/screen/gestures/shared/values.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +11 -0
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/module/shared/stores/gesture.store.js +8 -0
- package/lib/module/shared/stores/gesture.store.js.map +1 -1
- package/lib/module/shared/types/bounds.types.js +26 -0
- package/lib/module/shared/types/bounds.types.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +24 -7
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js +5 -2
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js +188 -318
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/config.js +12 -17
- package/lib/module/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/drag.js +184 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +94 -102
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/mask.js +68 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/targets.js +84 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
- package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +3 -1
- package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts +1 -3
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts +2 -3
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts +2 -3
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -0
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +1 -0
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
- package/lib/typescript/shared/configs/index.d.ts +16 -0
- package/lib/typescript/shared/configs/index.d.ts.map +1 -1
- package/lib/typescript/shared/configs/specs.d.ts +19 -0
- package/lib/typescript/shared/configs/specs.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +17 -1
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts +2 -0
- package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts +2 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts +2 -0
- package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/snapshot.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/values.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +4 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
- package/lib/typescript/shared/stores/gesture.store.d.ts +4 -0
- package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +115 -88
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/gesture.types.d.ts +10 -0
- package/lib/typescript/shared/types/gesture.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +1 -1
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts +3 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts +7 -17
- package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts +55 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +33 -34
- package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts +27 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts +22 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/shared/components/boundary/components/boundary-target.tsx +37 -26
- package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +16 -13
- package/src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx +6 -2
- package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +46 -3
- package/src/shared/components/boundary/portal/components/boundary-content-portal/index.tsx +8 -5
- package/src/shared/components/boundary/portal/components/boundary-portal/components/host.tsx +3 -2
- package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +5 -4
- package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx +4 -5
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +5 -1
- package/src/shared/components/boundary/portal/components/boundary-portal/index.tsx +1 -4
- package/src/shared/components/boundary/portal/teleport.ts +1 -0
- package/src/shared/components/boundary/portal/utils/ownership.ts +5 -1
- package/src/shared/components/boundary/providers/boundary-root.provider.tsx +23 -3
- package/src/shared/configs/index.ts +2 -1
- package/src/shared/configs/specs.ts +23 -0
- package/src/shared/constants.ts +4 -0
- package/src/shared/index.ts +2 -0
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +8 -0
- package/src/shared/providers/screen/gestures/pan/activation/use-pan-activation.ts +16 -7
- package/src/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +18 -1
- package/src/shared/providers/screen/gestures/pan/use-build-pan-gesture.ts +1 -0
- package/src/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.ts +40 -2
- package/src/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.ts +7 -11
- package/src/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.ts +12 -15
- package/src/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.ts +6 -1
- package/src/shared/providers/screen/gestures/shared/snapshot.ts +2 -0
- package/src/shared/providers/screen/gestures/shared/values.ts +2 -0
- package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +14 -1
- package/src/shared/stores/gesture.store.ts +12 -0
- package/src/shared/types/bounds.types.ts +119 -90
- package/src/shared/types/gesture.types.ts +10 -0
- package/src/shared/types/index.ts +2 -0
- package/src/shared/utils/animation/animate-to-progress.ts +23 -7
- package/src/shared/utils/bounds/navigation/reveal/math.ts +6 -1
- package/src/shared/utils/bounds/navigation/zoom/build.ts +231 -411
- package/src/shared/utils/bounds/navigation/zoom/config.ts +16 -18
- package/src/shared/utils/bounds/navigation/zoom/drag.ts +327 -0
- package/src/shared/utils/bounds/navigation/zoom/helpers.ts +127 -184
- package/src/shared/utils/bounds/navigation/zoom/mask.ts +133 -0
- package/src/shared/utils/bounds/navigation/zoom/targets.ts +132 -0
- package/src/shared/utils/bounds/navigation/zoom/types.ts +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js +0 -25
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/math.js +0 -20
- package/lib/module/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts +0 -8
- package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts.map +0 -1
- package/src/shared/utils/bounds/navigation/zoom/math.ts +0 -25
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { MeasuredDimensions } from "react-native-reanimated";
|
|
2
|
+
import type { BoundsLink, BoundsNavigationZoomOptions } from "../../../../types/bounds.types";
|
|
3
|
+
import type { Layout } from "../../../../types/screen.types";
|
|
4
|
+
import type { BoundsAnchor } from "../../types/options";
|
|
5
|
+
type ZoomContentTarget = Exclude<BoundsNavigationZoomOptions["target"], undefined>;
|
|
6
|
+
export declare function getZoomContentTarget({ explicitTarget, screenLayout, link, }: {
|
|
7
|
+
explicitTarget: BoundsNavigationZoomOptions["target"];
|
|
8
|
+
screenLayout: Layout;
|
|
9
|
+
link: BoundsLink;
|
|
10
|
+
}): ZoomContentTarget;
|
|
11
|
+
export declare function getZoomContentAnchor({ explicitTarget, screenLayout, link, }: {
|
|
12
|
+
explicitTarget: BoundsNavigationZoomOptions["target"];
|
|
13
|
+
screenLayout: Layout;
|
|
14
|
+
link: BoundsLink;
|
|
15
|
+
}): BoundsAnchor;
|
|
16
|
+
export declare function resolveZoomTrackingContentTarget({ contentTarget, link, screenLayout, }: {
|
|
17
|
+
contentTarget: ZoomContentTarget;
|
|
18
|
+
link: BoundsLink;
|
|
19
|
+
screenLayout: Layout;
|
|
20
|
+
}): MeasuredDimensions | undefined;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=targets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"targets.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/utils/bounds/navigation/zoom/targets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EACX,UAAU,EACV,2BAA2B,EAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,KAAK,iBAAiB,GAAG,OAAO,CAC/B,2BAA2B,CAAC,QAAQ,CAAC,EACrC,SAAS,CACT,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACpC,cAAc,EACd,YAAY,EACZ,IAAI,GACJ,EAAE;IACF,cAAc,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IACtD,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;CACjB,GAAG,iBAAiB,CAiDpB;AAED,wBAAgB,oBAAoB,CAAC,EACpC,cAAc,EACd,YAAY,EACZ,IAAI,GACJ,EAAE;IACF,cAAc,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IACtD,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;CACjB,GAAG,YAAY,CAsBf;AAED,wBAAgB,gCAAgC,CAAC,EAChD,aAAa,EACb,IAAI,EACJ,YAAY,GACZ,EAAE;IACF,aAAa,EAAE,iBAAiB,CAAC;IACjC,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACrB,GAAG,kBAAkB,GAAG,SAAS,CAmBjC"}
|
|
@@ -6,7 +6,7 @@ export type ZoomInterpolatedStyle = BoundsNavigationZoomStyle & {
|
|
|
6
6
|
};
|
|
7
7
|
export type BuildZoomStylesParams = {
|
|
8
8
|
tag?: string;
|
|
9
|
-
zoomOptions?: BoundsNavigationZoomOptions;
|
|
10
9
|
props: BoundsInterpolationProps;
|
|
10
|
+
zoomOptions?: BoundsNavigationZoomOptions;
|
|
11
11
|
};
|
|
12
12
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/utils/bounds/navigation/zoom/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kCAAkC,EAClC,gCAAgC,EAChC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACX,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,EACzB,MAAM,gCAAgC,CAAC;AAExC,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,GAAG;IAC/D,CAAC,kCAAkC,CAAC,CAAC,EAAE,yBAAyB,CAAC,OAAO,kCAAkC,CAAC,CAAC;IAC5G,CAAC,gCAAgC,CAAC,CAAC,EAAE,yBAAyB,CAAC,OAAO,gCAAgC,CAAC,CAAC;CACxG,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/utils/bounds/navigation/zoom/types.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,kCAAkC,EAClC,gCAAgC,EAChC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACX,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,EACzB,MAAM,gCAAgC,CAAC;AAExC,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,GAAG;IAC/D,CAAC,kCAAkC,CAAC,CAAC,EAAE,yBAAyB,CAAC,OAAO,kCAAkC,CAAC,CAAC;IAC5G,CAAC,gCAAgC,CAAC,CAAC,EAAE,yBAAyB,CAAC,OAAO,gCAAgC,CAAC,CAAC;CACxG,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IACnC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,wBAAwB,CAAC;IAChC,WAAW,CAAC,EAAE,2BAA2B,CAAC;CAC1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-screen-transitions",
|
|
3
|
-
"version": "3.9.0
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "Easy screen transitions for React Native and Expo",
|
|
5
5
|
"author": "Ed",
|
|
6
6
|
"license": "MIT",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"react-native-reanimated": ">=3.16.0 || >=4.0.0-",
|
|
86
86
|
"react-native-safe-area-context": "*",
|
|
87
87
|
"react-native-screens": ">=4.4.0",
|
|
88
|
-
"react-native-teleport": ">=1.1.0 <
|
|
88
|
+
"react-native-teleport": ">=1.1.0 <1.1.11"
|
|
89
89
|
},
|
|
90
90
|
"peerDependenciesMeta": {
|
|
91
91
|
"react-native-teleport": {
|
|
@@ -8,31 +8,38 @@ import {
|
|
|
8
8
|
} from "../../../providers/screen/styles";
|
|
9
9
|
import { prepareStyleForBounds } from "../../../utils/bounds/helpers/styles/styles";
|
|
10
10
|
import { useRegisterTarget } from "../hooks/use-register-target";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
BoundaryContentPortal,
|
|
13
|
+
BoundaryContentPortalHost,
|
|
14
|
+
} from "../portal/components/boundary-content-portal";
|
|
12
15
|
import { BoundaryPortal } from "../portal/components/boundary-portal";
|
|
13
16
|
import { useBoundaryRootContext } from "../providers/boundary-root.provider";
|
|
14
17
|
|
|
15
|
-
type BoundaryTargetProps =
|
|
18
|
+
type BoundaryTargetProps = Omit<
|
|
19
|
+
React.ComponentProps<typeof Animated.View>,
|
|
20
|
+
"children"
|
|
21
|
+
> & {
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
};
|
|
16
24
|
|
|
17
25
|
export const BoundaryTarget = memo(function BoundaryTarget(
|
|
18
26
|
props: BoundaryTargetProps,
|
|
19
27
|
) {
|
|
20
|
-
const { pointerEvents, style, ...rest } = props;
|
|
28
|
+
const { children, pointerEvents, style, ...rest } = props;
|
|
21
29
|
const targetAnimatedRef = useAnimatedRef<View>();
|
|
22
30
|
const targetEscapePlaceholderRef = useAnimatedRef<View>();
|
|
23
31
|
const rootContext = useBoundaryRootContext();
|
|
24
32
|
const boundaryId = rootContext?.boundTag.tag;
|
|
25
33
|
const isActiveTarget = rootContext?.activeTargetRef === targetAnimatedRef;
|
|
26
34
|
const portalRuntime = rootContext?.portalRuntime;
|
|
27
|
-
const
|
|
28
|
-
typeof pointerEvents === "string" ? pointerEvents : undefined;
|
|
35
|
+
const handoffEnabled = isActiveTarget && rootContext?.handoffEnabled === true;
|
|
29
36
|
const shouldEscapeTargetToScreenHost =
|
|
30
37
|
portalRuntime?.escapeClipping === true && boundaryId !== undefined;
|
|
31
38
|
|
|
32
39
|
const shouldApplyAssociatedStyleInline =
|
|
33
|
-
isActiveTarget && portalRuntime?.
|
|
40
|
+
isActiveTarget && portalRuntime?.escapeClipping !== true;
|
|
34
41
|
const shouldApplyPortalLayoutStyle =
|
|
35
|
-
isActiveTarget && portalRuntime?.
|
|
42
|
+
isActiveTarget && portalRuntime?.escapeClipping === true;
|
|
36
43
|
|
|
37
44
|
const associatedTargetStyles = useComposedSlotStyles(
|
|
38
45
|
rootContext?.boundTag.tag,
|
|
@@ -52,27 +59,31 @@ export const BoundaryTarget = memo(function BoundaryTarget(
|
|
|
52
59
|
boundaryId={boundaryId ?? ""}
|
|
53
60
|
enabled={shouldEscapeTargetToScreenHost}
|
|
54
61
|
placeholderRef={targetEscapePlaceholderRef}
|
|
55
|
-
pointerEvents={portalPointerEvents}
|
|
56
62
|
>
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
63
|
+
<Animated.View
|
|
64
|
+
{...rest}
|
|
65
|
+
pointerEvents={pointerEvents}
|
|
66
|
+
ref={targetAnimatedRef}
|
|
67
|
+
style={[
|
|
68
|
+
style,
|
|
69
|
+
shouldApplyAssociatedStyleInline ? associatedTargetStyles : undefined,
|
|
70
|
+
shouldApplyPortalLayoutStyle ? portalLayoutStyle : undefined,
|
|
71
|
+
]}
|
|
72
|
+
collapsable={false}
|
|
61
73
|
>
|
|
62
|
-
<
|
|
63
|
-
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</BoundaryContentPortal>
|
|
74
|
+
<BoundaryContentPortalHost
|
|
75
|
+
boundaryId={boundaryId ?? ""}
|
|
76
|
+
enabled={handoffEnabled}
|
|
77
|
+
screenKey={rootContext?.currentScreenKey ?? ""}
|
|
78
|
+
>
|
|
79
|
+
<BoundaryContentPortal
|
|
80
|
+
boundaryId={boundaryId}
|
|
81
|
+
enabled={handoffEnabled}
|
|
82
|
+
>
|
|
83
|
+
{children}
|
|
84
|
+
</BoundaryContentPortal>
|
|
85
|
+
</BoundaryContentPortalHost>
|
|
86
|
+
</Animated.View>
|
|
76
87
|
</BoundaryPortal>
|
|
77
88
|
);
|
|
78
89
|
});
|
package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts
CHANGED
|
@@ -80,21 +80,26 @@ export const useInitialDestinationMeasurement = ({
|
|
|
80
80
|
unblockLifecycleStart();
|
|
81
81
|
}, [isBlockingLifecycleStart, retryToken, unblockLifecycleStart]);
|
|
82
82
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
) {
|
|
83
|
+
const claimLifecycleStartBlock = useCallback(() => {
|
|
84
|
+
"worklet";
|
|
85
|
+
|
|
86
|
+
// The progress check and block claim must share one UI-thread operation.
|
|
87
|
+
// Otherwise a JS-thread layout effect can observe zero, enqueue the block,
|
|
88
|
+
// and let the opening animation start before that block reaches the UI thread.
|
|
89
|
+
if (progress.get() > 0 || isBlockingLifecycleStart.get()) {
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
// Boundary layout effects run before the parent screen's open intent. Claim
|
|
94
|
-
// this boundary's startup block before the transition controller can consume
|
|
95
|
-
// the request; the UI-thread handshake below releases it once matching is done.
|
|
96
93
|
blockLifecycleStart();
|
|
97
94
|
isBlockingLifecycleStart.set(1);
|
|
95
|
+
}, [blockLifecycleStart, isBlockingLifecycleStart, progress]);
|
|
96
|
+
|
|
97
|
+
useLayoutEffect(() => {
|
|
98
|
+
if (!destinationEnabled || !initialDestinationPairKey) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
runOnUI(claimLifecycleStartBlock)();
|
|
98
103
|
|
|
99
104
|
return () => {
|
|
100
105
|
if (escapeClipping) {
|
|
@@ -107,12 +112,10 @@ export const useInitialDestinationMeasurement = ({
|
|
|
107
112
|
runOnUI(releaseLifecycleStartBlock)();
|
|
108
113
|
};
|
|
109
114
|
}, [
|
|
110
|
-
|
|
115
|
+
claimLifecycleStartBlock,
|
|
111
116
|
destinationEnabled,
|
|
112
117
|
escapeClipping,
|
|
113
118
|
initialDestinationPairKey,
|
|
114
|
-
isBlockingLifecycleStart,
|
|
115
|
-
progress,
|
|
116
119
|
releaseLifecycleStartBlock,
|
|
117
120
|
]);
|
|
118
121
|
|
package/src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { memo, type ReactNode } from "react";
|
|
2
2
|
import { StyleSheet } from "react-native";
|
|
3
3
|
import Animated from "react-native-reanimated";
|
|
4
|
-
import { NativePortalHost } from "../../../teleport";
|
|
4
|
+
import { NativePortalHost, PORTAL_POINTER_EVENTS } from "../../../teleport";
|
|
5
5
|
import { createBoundaryContentPortalHostName } from "../helpers/host-name";
|
|
6
6
|
|
|
7
7
|
const AnimatedPortalHost = NativePortalHost
|
|
@@ -34,7 +34,11 @@ export const BoundaryContentPortalHost = memo(
|
|
|
34
34
|
return (
|
|
35
35
|
<>
|
|
36
36
|
{children}
|
|
37
|
-
<AnimatedPortalHost
|
|
37
|
+
<AnimatedPortalHost
|
|
38
|
+
name={portalHostName}
|
|
39
|
+
pointerEvents={PORTAL_POINTER_EVENTS}
|
|
40
|
+
style={styles.host}
|
|
41
|
+
/>
|
|
38
42
|
</>
|
|
39
43
|
);
|
|
40
44
|
},
|
|
@@ -9,6 +9,7 @@ import { useDescriptorsStore } from "../../../../../../providers/screen/descript
|
|
|
9
9
|
import { useScreenSlots } from "../../../../../../providers/screen/styles";
|
|
10
10
|
import { useRegisteredScreenSlots } from "../../../../../../providers/screen/styles/stores/slot-references.store";
|
|
11
11
|
import { AnimationStore } from "../../../../../../stores/animation.store";
|
|
12
|
+
import { getSourceScreenKeyFromPairKey } from "../../../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
12
13
|
import { pairs } from "../../../../../../stores/bounds/internals/state";
|
|
13
14
|
import { PORTAL_HOST_NAME_RESET_VALUE } from "../../../utils/naming";
|
|
14
15
|
import {
|
|
@@ -132,7 +133,7 @@ export const useBoundaryContentPortalAttachment = ({
|
|
|
132
133
|
useAnimatedReaction(
|
|
133
134
|
() => {
|
|
134
135
|
"worklet";
|
|
135
|
-
if (!enabled
|
|
136
|
+
if (!enabled) {
|
|
136
137
|
return {
|
|
137
138
|
hostScreenKey: null,
|
|
138
139
|
ownerPairKey: sourcePairKey,
|
|
@@ -144,13 +145,51 @@ export const useBoundaryContentPortalAttachment = ({
|
|
|
144
145
|
const progressAnimating = settledHostAnimating.get();
|
|
145
146
|
const progressSettled = settledHostProgress.get();
|
|
146
147
|
const willAnimate = settledHostWillAnimate.get();
|
|
148
|
+
const closing = settledHostClosing.get();
|
|
149
|
+
const isOwnedHostClosing =
|
|
150
|
+
!!closing &&
|
|
151
|
+
!!ownership &&
|
|
152
|
+
settledHostScreenKey === ownership.hostScreenKey;
|
|
153
|
+
|
|
154
|
+
if (isOwnedHostClosing && ownership) {
|
|
155
|
+
const isClosingComplete = isHandoffHostClosingComplete({
|
|
156
|
+
closing,
|
|
157
|
+
progressAnimating,
|
|
158
|
+
progressSettled,
|
|
159
|
+
willAnimate,
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
if (!isClosingComplete) {
|
|
163
|
+
return ownership;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const sourceScreenKey = getSourceScreenKeyFromPairKey(
|
|
167
|
+
ownership.ownerPairKey,
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
return {
|
|
171
|
+
hostScreenKey: sourceScreenKey,
|
|
172
|
+
ownerPairKey: ownership.ownerPairKey,
|
|
173
|
+
ownerScreenKey: sourceScreenKey,
|
|
174
|
+
status: "complete",
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (!sourcePairKey) {
|
|
179
|
+
return {
|
|
180
|
+
hostScreenKey: null,
|
|
181
|
+
ownerPairKey: sourcePairKey,
|
|
182
|
+
ownerScreenKey: null,
|
|
183
|
+
status: "clear",
|
|
184
|
+
};
|
|
185
|
+
}
|
|
147
186
|
|
|
148
187
|
return resolveBoundaryPortalOwnership({
|
|
149
188
|
boundaryId,
|
|
150
189
|
currentScreenKey,
|
|
151
190
|
handoff: true,
|
|
152
191
|
isSettledHostClosingComplete: isHandoffHostClosingComplete({
|
|
153
|
-
closing
|
|
192
|
+
closing,
|
|
154
193
|
progressAnimating,
|
|
155
194
|
progressSettled,
|
|
156
195
|
willAnimate,
|
|
@@ -251,7 +290,11 @@ export const useBoundaryContentPortalAttachment = ({
|
|
|
251
290
|
"worklet";
|
|
252
291
|
|
|
253
292
|
const slot = activeSlotsMap.get()[boundaryId];
|
|
254
|
-
const {
|
|
293
|
+
const {
|
|
294
|
+
pointerEvents: _pointerEvents,
|
|
295
|
+
teleport,
|
|
296
|
+
...slotProps
|
|
297
|
+
} = slot?.props ?? {};
|
|
255
298
|
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
256
299
|
enabled,
|
|
257
300
|
teleport,
|
|
@@ -4,9 +4,13 @@ import {
|
|
|
4
4
|
memo,
|
|
5
5
|
type ReactNode,
|
|
6
6
|
} from "react";
|
|
7
|
-
import
|
|
7
|
+
import { StyleSheet } from "react-native";
|
|
8
8
|
import Animated from "react-native-reanimated";
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
isTeleportAvailable,
|
|
11
|
+
NativePortal,
|
|
12
|
+
PORTAL_POINTER_EVENTS,
|
|
13
|
+
} from "../../teleport";
|
|
10
14
|
import { useBoundaryContentPortalAttachment } from "./hooks/use-boundary-content-portal-attachment";
|
|
11
15
|
|
|
12
16
|
export { BoundaryContentPortalHost } from "./components/host";
|
|
@@ -15,7 +19,6 @@ type BoundaryContentPortalProps = {
|
|
|
15
19
|
boundaryId?: string;
|
|
16
20
|
children: ReactNode;
|
|
17
21
|
enabled: boolean;
|
|
18
|
-
pointerEvents?: ViewProps["pointerEvents"];
|
|
19
22
|
};
|
|
20
23
|
|
|
21
24
|
type NullableHostNamePortalProps = Omit<
|
|
@@ -35,7 +38,6 @@ export const BoundaryContentPortal = memo(function BoundaryContentPortal({
|
|
|
35
38
|
boundaryId,
|
|
36
39
|
children,
|
|
37
40
|
enabled,
|
|
38
|
-
pointerEvents,
|
|
39
41
|
}: BoundaryContentPortalProps) {
|
|
40
42
|
const shouldEnablePortal = enabled && boundaryId !== undefined;
|
|
41
43
|
const { teleportProps } = useBoundaryContentPortalAttachment({
|
|
@@ -48,7 +50,8 @@ export const BoundaryContentPortal = memo(function BoundaryContentPortal({
|
|
|
48
50
|
<AnimatedNativePortal
|
|
49
51
|
animatedProps={teleportProps}
|
|
50
52
|
name={boundaryId}
|
|
51
|
-
pointerEvents={
|
|
53
|
+
pointerEvents={PORTAL_POINTER_EVENTS}
|
|
54
|
+
style={StyleSheet.absoluteFill}
|
|
52
55
|
>
|
|
53
56
|
{children}
|
|
54
57
|
</AnimatedNativePortal>
|
package/src/shared/components/boundary/portal/components/boundary-portal/components/host.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import Animated from "react-native-reanimated";
|
|
|
10
10
|
import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
|
|
11
11
|
import { useScreenSlots } from "../../../../../../providers/screen/styles";
|
|
12
12
|
import { SystemStore } from "../../../../../../stores/system.store";
|
|
13
|
+
import { PORTAL_POINTER_EVENTS } from "../../../teleport";
|
|
13
14
|
import { useHostMeasurement } from "../hooks/use-host-measurement";
|
|
14
15
|
import { registerHost, unregisterHost } from "../stores/host-registry.store";
|
|
15
16
|
import { useActivePortalBoundaryHosts } from "../stores/portal-boundary-host.store";
|
|
@@ -74,7 +75,7 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
|
74
75
|
? activeBoundaryHosts.map((host) => (
|
|
75
76
|
<View
|
|
76
77
|
key={host.portalHostName}
|
|
77
|
-
pointerEvents=
|
|
78
|
+
pointerEvents={PORTAL_POINTER_EVENTS}
|
|
78
79
|
style={[
|
|
79
80
|
styles.boundaryHostViewport,
|
|
80
81
|
{ width: viewportWidth, height: viewportHeight },
|
|
@@ -89,7 +90,7 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
|
89
90
|
return (
|
|
90
91
|
<Animated.View
|
|
91
92
|
ref={measurement.hostRef}
|
|
92
|
-
pointerEvents=
|
|
93
|
+
pointerEvents={PORTAL_POINTER_EVENTS}
|
|
93
94
|
style={[
|
|
94
95
|
styles.host,
|
|
95
96
|
{ width: viewportWidth, height: viewportHeight },
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
ScrollStore,
|
|
12
12
|
} from "../../../../../../stores/scroll.store";
|
|
13
13
|
import type { ScrollMeasuredDimensions } from "../../../../utils/measured-bounds";
|
|
14
|
-
import { NativePortalHost } from "../../../teleport";
|
|
14
|
+
import { NativePortalHost, PORTAL_POINTER_EVENTS } from "../../../teleport";
|
|
15
15
|
import { hasLocalSlot } from "../helpers/has-local-slot";
|
|
16
16
|
import { resolvePortalOffsetStyle } from "../helpers/offset-style";
|
|
17
17
|
import type { ActivePortalBoundaryHost } from "../stores/portal-boundary-host.store";
|
|
@@ -48,7 +48,7 @@ export const PortalBoundaryHost = memo(function PortalBoundaryHost({
|
|
|
48
48
|
// Strict per-member lookup - a fallback member's source rect would
|
|
49
49
|
// misplace this host's teleported content.
|
|
50
50
|
const link = getLink(host.pairKey, host.boundaryId);
|
|
51
|
-
if (!link?.source
|
|
51
|
+
if (!link?.source) {
|
|
52
52
|
return NO_STYLES;
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -95,7 +95,7 @@ export const PortalBoundaryHost = memo(function PortalBoundaryHost({
|
|
|
95
95
|
const contentFrameStyle = useAnimatedStyle(() => {
|
|
96
96
|
"worklet";
|
|
97
97
|
const link = getLink(host.pairKey, host.boundaryId);
|
|
98
|
-
if (!link?.source
|
|
98
|
+
if (!link?.source) {
|
|
99
99
|
return NO_STYLES;
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -142,12 +142,13 @@ export const PortalBoundaryHost = memo(function PortalBoundaryHost({
|
|
|
142
142
|
|
|
143
143
|
return (
|
|
144
144
|
<Animated.View
|
|
145
|
-
pointerEvents=
|
|
145
|
+
pointerEvents={PORTAL_POINTER_EVENTS}
|
|
146
146
|
style={[style, hostStyle]}
|
|
147
147
|
collapsable={false}
|
|
148
148
|
>
|
|
149
149
|
<AnimatedPortalBoundaryHost
|
|
150
150
|
name={host.portalHostName}
|
|
151
|
+
pointerEvents={PORTAL_POINTER_EVENTS}
|
|
151
152
|
style={[styles.content, contentFrameStyle, slotStyle]}
|
|
152
153
|
/>
|
|
153
154
|
</Animated.View>
|
package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx
CHANGED
|
@@ -4,11 +4,12 @@ import {
|
|
|
4
4
|
memo,
|
|
5
5
|
type ReactNode,
|
|
6
6
|
} from "react";
|
|
7
|
-
import type { View
|
|
7
|
+
import type { View } from "react-native";
|
|
8
8
|
import Animated, { type AnimatedRef, runOnUI } from "react-native-reanimated";
|
|
9
9
|
import { logger } from "../../../../../../utils/logger";
|
|
10
10
|
import {
|
|
11
11
|
isTeleportAvailable,
|
|
12
|
+
PORTAL_POINTER_EVENTS,
|
|
12
13
|
NativePortal as TeleportPortal,
|
|
13
14
|
} from "../../../teleport";
|
|
14
15
|
import { usePlaceholderStyles } from "../hooks/use-placeholder-styles";
|
|
@@ -31,7 +32,6 @@ type BoundaryPortalSlotProps = {
|
|
|
31
32
|
children: ReactNode;
|
|
32
33
|
enabled: boolean;
|
|
33
34
|
animatedProps: any;
|
|
34
|
-
pointerEvents?: ViewProps["pointerEvents"];
|
|
35
35
|
placeholderRef?: AnimatedRef<View>;
|
|
36
36
|
};
|
|
37
37
|
|
|
@@ -40,7 +40,6 @@ export const BoundaryPortalSlot = memo(function BoundaryPortalSlot({
|
|
|
40
40
|
children,
|
|
41
41
|
enabled,
|
|
42
42
|
animatedProps,
|
|
43
|
-
pointerEvents,
|
|
44
43
|
placeholderRef,
|
|
45
44
|
}: BoundaryPortalSlotProps) {
|
|
46
45
|
const isPortalEnabled = enabled && isTeleportAvailable;
|
|
@@ -62,13 +61,13 @@ export const BoundaryPortalSlot = memo(function BoundaryPortalSlot({
|
|
|
62
61
|
runOnUI(handleOnLayout)(layout)
|
|
63
62
|
}
|
|
64
63
|
style={placeholderStyle}
|
|
65
|
-
pointerEvents={
|
|
64
|
+
pointerEvents={PORTAL_POINTER_EVENTS}
|
|
66
65
|
collapsable={false}
|
|
67
66
|
>
|
|
68
67
|
<AnimatedNativePortal
|
|
69
68
|
animatedProps={animatedProps}
|
|
70
69
|
name={id}
|
|
71
|
-
pointerEvents={
|
|
70
|
+
pointerEvents={PORTAL_POINTER_EVENTS}
|
|
72
71
|
>
|
|
73
72
|
{children}
|
|
74
73
|
</AnimatedNativePortal>
|
|
@@ -227,7 +227,11 @@ export const useBoundaryPortalAttachment = ({
|
|
|
227
227
|
"worklet";
|
|
228
228
|
|
|
229
229
|
const slot = slotsMap.get()[boundaryId];
|
|
230
|
-
const {
|
|
230
|
+
const {
|
|
231
|
+
pointerEvents: _pointerEvents,
|
|
232
|
+
teleport,
|
|
233
|
+
...slotProps
|
|
234
|
+
} = slot?.props ?? {};
|
|
231
235
|
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
232
236
|
enabled,
|
|
233
237
|
teleport,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { memo, type ReactNode } from "react";
|
|
2
|
-
import type { View
|
|
2
|
+
import type { View } from "react-native";
|
|
3
3
|
import type { AnimatedRef } from "react-native-reanimated";
|
|
4
4
|
import { BoundaryPortalSlot } from "./components/portal-slot";
|
|
5
5
|
import { useBoundaryPortalAttachment } from "./hooks/use-boundary-portal-attachment";
|
|
@@ -9,7 +9,6 @@ type BoundaryPortalProps = {
|
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
enabled: boolean;
|
|
11
11
|
placeholderRef?: AnimatedRef<View>;
|
|
12
|
-
pointerEvents?: ViewProps["pointerEvents"];
|
|
13
12
|
};
|
|
14
13
|
|
|
15
14
|
export const BoundaryPortal = memo(function BoundaryPortal({
|
|
@@ -17,7 +16,6 @@ export const BoundaryPortal = memo(function BoundaryPortal({
|
|
|
17
16
|
children,
|
|
18
17
|
enabled,
|
|
19
18
|
placeholderRef,
|
|
20
|
-
pointerEvents,
|
|
21
19
|
}: BoundaryPortalProps) {
|
|
22
20
|
const { teleportProps } = useBoundaryPortalAttachment({
|
|
23
21
|
boundaryId,
|
|
@@ -30,7 +28,6 @@ export const BoundaryPortal = memo(function BoundaryPortal({
|
|
|
30
28
|
enabled={enabled}
|
|
31
29
|
animatedProps={teleportProps}
|
|
32
30
|
placeholderRef={placeholderRef}
|
|
33
|
-
pointerEvents={pointerEvents}
|
|
34
31
|
>
|
|
35
32
|
{children}
|
|
36
33
|
</BoundaryPortalSlot>
|
|
@@ -39,6 +39,7 @@ const SafeNativePortalProvider: ComponentType<{ children: ReactNode }> | null =
|
|
|
39
39
|
|
|
40
40
|
export const isTeleportAvailable =
|
|
41
41
|
mod !== null && SafeNativePortalProvider !== null;
|
|
42
|
+
export const PORTAL_POINTER_EVENTS = "box-none" as const;
|
|
42
43
|
export const NativePortal: ComponentType<any> | null = mod?.Portal ?? null;
|
|
43
44
|
export const NativePortalProvider: ComponentType<any> | null =
|
|
44
45
|
SafeNativePortalProvider;
|
|
@@ -196,7 +196,7 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
196
196
|
const linkKey = getLinkKeyFromTag(boundaryId);
|
|
197
197
|
const link = getPairLink(pairsState, sourcePairKey, linkKey);
|
|
198
198
|
|
|
199
|
-
if (link?.
|
|
199
|
+
if (!link?.source) {
|
|
200
200
|
return pendingSignal(sourcePairKey);
|
|
201
201
|
}
|
|
202
202
|
|
|
@@ -220,6 +220,10 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
if (link.status !== "complete") {
|
|
224
|
+
return pendingSignal(sourcePairKey);
|
|
225
|
+
}
|
|
226
|
+
|
|
223
227
|
let hostScreenKey = link.destination.screenKey;
|
|
224
228
|
let ownerPairKey = sourcePairKey;
|
|
225
229
|
const seenScreenKeys: ScreenKey[] = [
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
useCallback,
|
|
5
5
|
useImperativeHandle,
|
|
6
6
|
useMemo,
|
|
7
|
+
useRef,
|
|
7
8
|
useState,
|
|
8
9
|
} from "react";
|
|
9
10
|
import type { View } from "react-native";
|
|
@@ -59,6 +60,7 @@ export type BoundaryRootRenderState = {
|
|
|
59
60
|
attachedStyle: unknown;
|
|
60
61
|
boundTag: BoundTag;
|
|
61
62
|
currentScreenKey: string;
|
|
63
|
+
handoffEnabled: boolean;
|
|
62
64
|
portalRuntime: BoundaryPortalRuntime;
|
|
63
65
|
ref: AnimatedRef<View>;
|
|
64
66
|
rootEscapePlaceholderRef: AnimatedRef<View>;
|
|
@@ -96,7 +98,7 @@ export const {
|
|
|
96
98
|
id,
|
|
97
99
|
style,
|
|
98
100
|
}) => {
|
|
99
|
-
const
|
|
101
|
+
const requestedBoundTag = useMemo(
|
|
100
102
|
() => createBoundTag(String(id), group),
|
|
101
103
|
[id, group],
|
|
102
104
|
);
|
|
@@ -108,6 +110,21 @@ export const {
|
|
|
108
110
|
const currentScreenKey = useDescriptorsStore(
|
|
109
111
|
(s) => s.derivations.currentScreenKey,
|
|
110
112
|
);
|
|
113
|
+
const currentActivity = useDescriptorsStore(
|
|
114
|
+
(s) => s.descriptors.current.activity,
|
|
115
|
+
);
|
|
116
|
+
const retainedBoundTagRef = useRef(requestedBoundTag);
|
|
117
|
+
const shouldRetainClosingBoundTag =
|
|
118
|
+
portalRuntime.handoff && currentActivity === "closing";
|
|
119
|
+
|
|
120
|
+
// Navigation can update a retained closing route's params before that
|
|
121
|
+
// route leaves the stack. Keep its handoff identity stable so the payload
|
|
122
|
+
// remains attached to the closing destination instead of being orphaned.
|
|
123
|
+
if (!shouldRetainClosingBoundTag) {
|
|
124
|
+
retainedBoundTagRef.current = requestedBoundTag;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const boundTag = retainedBoundTagRef.current;
|
|
111
128
|
const hasConfiguredInterpolator = useDescriptorsStore(
|
|
112
129
|
(s) => s.derivations.hasConfiguredInterpolator,
|
|
113
130
|
);
|
|
@@ -183,6 +200,7 @@ export const {
|
|
|
183
200
|
|
|
184
201
|
const shouldRenderBoundaryRootThroughPortal =
|
|
185
202
|
shouldEscapeBoundaryRootToScreenHost && !hasActiveTarget;
|
|
203
|
+
const handoffEnabled = enabled && portalRuntime.handoff;
|
|
186
204
|
// A nested active target takes the full associated style, so the root keeps
|
|
187
205
|
// only its stacking context. Root-owned escape-clipping moves the root
|
|
188
206
|
// through a screen host, so its associated style is applied through the
|
|
@@ -204,19 +222,21 @@ export const {
|
|
|
204
222
|
activeTargetRef: targetEntry?.ref ?? null,
|
|
205
223
|
boundTag,
|
|
206
224
|
currentScreenKey,
|
|
225
|
+
handoffEnabled,
|
|
207
226
|
portalRuntime,
|
|
208
227
|
registerTargetRef,
|
|
209
228
|
ref: rootRef,
|
|
210
229
|
rootEscapePlaceholderRef,
|
|
211
230
|
shouldRenderBoundaryRootThroughPortal,
|
|
212
|
-
shouldRenderHandoffHost:
|
|
231
|
+
shouldRenderHandoffHost: handoffEnabled && !hasActiveTarget,
|
|
213
232
|
unregisterTargetRef,
|
|
214
233
|
}),
|
|
215
234
|
[
|
|
216
235
|
attachedStyle,
|
|
217
236
|
boundTag,
|
|
218
237
|
currentScreenKey,
|
|
219
|
-
|
|
238
|
+
handoffEnabled,
|
|
239
|
+
hasActiveTarget,
|
|
220
240
|
portalRuntime,
|
|
221
241
|
registerTargetRef,
|
|
222
242
|
rootRef,
|
|
@@ -8,12 +8,13 @@ import {
|
|
|
8
8
|
SlideFromTop,
|
|
9
9
|
ZoomIn,
|
|
10
10
|
} from "./presets";
|
|
11
|
-
import { DefaultSnapSpec, DefaultSpec, FlingSpec } from "./specs";
|
|
11
|
+
import { DefaultSnapSpec, DefaultSpec, FlingSpec, Zoom } from "./specs";
|
|
12
12
|
|
|
13
13
|
export const Specs = {
|
|
14
14
|
DefaultSpec,
|
|
15
15
|
DefaultSnapSpec,
|
|
16
16
|
FlingSpec,
|
|
17
|
+
Zoom,
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
export const Presets = {
|