react-native-screen-transitions 4.1.0-beta.0 → 4.1.0-beta.1
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/components/boundary/components/boundary-lifecycle.js +40 -8
- package/lib/commonjs/components/boundary/components/boundary-lifecycle.js.map +1 -1
- package/lib/commonjs/components/boundary/components/boundary-target.js +10 -17
- package/lib/commonjs/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/commonjs/components/boundary/create-boundary-component.js +13 -16
- package/lib/commonjs/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/commonjs/components/boundary/helpers/presentation.js +56 -0
- package/lib/commonjs/components/boundary/helpers/presentation.js.map +1 -0
- package/lib/commonjs/components/boundary/hooks/use-boundary-presentation.js +65 -0
- package/lib/commonjs/components/boundary/hooks/use-boundary-presentation.js.map +1 -0
- package/lib/commonjs/components/boundary/hooks/use-composed-boundary-style.js +43 -0
- package/lib/commonjs/components/boundary/hooks/use-composed-boundary-style.js.map +1 -0
- package/lib/commonjs/components/boundary/index.js +2 -3
- package/lib/commonjs/components/boundary/index.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/components/portal-host.js +39 -0
- package/lib/commonjs/components/boundary/portal/components/portal-host.js.map +1 -0
- package/lib/commonjs/components/boundary/portal/components/portal-overlay.js +170 -0
- package/lib/commonjs/components/boundary/portal/components/portal-overlay.js.map +1 -0
- package/lib/commonjs/components/boundary/portal/components/portal.js +88 -0
- package/lib/commonjs/components/boundary/portal/components/portal.js.map +1 -0
- package/lib/commonjs/components/boundary/portal/helpers/offset-style.js.map +1 -0
- package/lib/commonjs/components/boundary/portal/hooks/use-active-portal-boundary-host.js +35 -0
- package/lib/commonjs/components/boundary/portal/hooks/use-active-portal-boundary-host.js.map +1 -0
- package/lib/commonjs/components/boundary/portal/hooks/use-host-measurement.js +83 -0
- package/lib/commonjs/components/boundary/portal/hooks/use-host-measurement.js.map +1 -0
- package/lib/commonjs/components/boundary/portal/hooks/use-placeholder-styles.js.map +1 -0
- package/lib/commonjs/components/boundary/portal/hooks/use-portal-destination.js +58 -0
- package/lib/commonjs/components/boundary/portal/hooks/use-portal-destination.js.map +1 -0
- package/lib/commonjs/components/boundary/portal/index.js +0 -7
- package/lib/commonjs/components/boundary/portal/index.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/{components/boundary-portal/stores → stores}/host-registry.store.js +1 -12
- package/lib/commonjs/components/boundary/portal/stores/host-registry.store.js.map +1 -0
- package/lib/commonjs/components/boundary/portal/{components/boundary-portal/stores → stores}/portal-boundary-host.store.js +17 -17
- package/lib/commonjs/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -0
- package/lib/commonjs/components/boundary/portal/utils/naming.js +8 -1
- package/lib/commonjs/components/boundary/portal/utils/naming.js.map +1 -1
- package/lib/commonjs/components/boundary/portal/utils/resolve-portal.js +7 -27
- package/lib/commonjs/components/boundary/portal/utils/resolve-portal.js.map +1 -1
- package/lib/commonjs/components/boundary/providers/boundary-root.provider.js +13 -7
- package/lib/commonjs/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/commonjs/components/screen/container/helpers/layer-component.js +39 -0
- package/lib/commonjs/components/screen/container/helpers/layer-component.js.map +1 -0
- package/lib/commonjs/components/screen/container/{layers/render-component.js → helpers/uses-layer-render-props.js} +1 -1
- package/lib/commonjs/components/screen/container/helpers/uses-layer-render-props.js.map +1 -0
- package/lib/commonjs/components/screen/container/layers/backdrop.js +4 -13
- package/lib/commonjs/components/screen/container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/components/screen/container/layers/clip.js +117 -0
- package/lib/commonjs/components/screen/container/layers/clip.js.map +1 -0
- package/lib/commonjs/components/screen/container/layers/content.js +17 -33
- package/lib/commonjs/components/screen/container/layers/content.js.map +1 -1
- package/lib/commonjs/components/screen/container/layers/surface.js +3 -15
- package/lib/commonjs/components/screen/container/layers/surface.js.map +1 -1
- package/lib/commonjs/components/screen/lifecycle/hooks/use-open-transition-intent.js +15 -0
- package/lib/commonjs/components/screen/lifecycle/hooks/use-open-transition-intent.js.map +1 -1
- package/lib/commonjs/constants.js +3 -1
- package/lib/commonjs/constants.js.map +1 -1
- package/lib/commonjs/hooks/navigation/use-navigation-helpers.js +16 -4
- package/lib/commonjs/hooks/navigation/use-navigation-helpers.js.map +1 -1
- package/lib/commonjs/providers/screen/motion/animation/helpers/build-screen-transition-options.js +0 -1
- package/lib/commonjs/providers/screen/motion/animation/helpers/build-screen-transition-options.js.map +1 -1
- package/lib/commonjs/providers/screen/motion/animation/helpers/hydrate-transition-state/index.js +3 -2
- package/lib/commonjs/providers/screen/motion/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/commonjs/providers/screen/motion/options/helpers.js +1 -3
- package/lib/commonjs/providers/screen/motion/options/helpers.js.map +1 -1
- package/lib/commonjs/providers/screen/orchestrator/helpers/use-interpolator-state.js +4 -2
- package/lib/commonjs/providers/screen/orchestrator/helpers/use-interpolator-state.js.map +1 -1
- package/lib/commonjs/providers/screen/orchestrator/helpers/use-pair-presentation.js +79 -0
- package/lib/commonjs/providers/screen/orchestrator/helpers/use-pair-presentation.js.map +1 -0
- package/lib/commonjs/providers/screen/orchestrator/orchestrator.provider.js +3 -0
- package/lib/commonjs/providers/screen/orchestrator/orchestrator.provider.js.map +1 -1
- package/lib/commonjs/providers/screen/orchestrator/styles/constants.js +1 -0
- package/lib/commonjs/providers/screen/orchestrator/styles/constants.js.map +1 -1
- package/lib/commonjs/providers/screen/orchestrator/styles/hooks/slot-resolvers.js +5 -8
- package/lib/commonjs/providers/screen/orchestrator/styles/hooks/slot-resolvers.js.map +1 -1
- package/lib/commonjs/utils/bounds/navigation/reveal/build.js +28 -61
- package/lib/commonjs/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/commonjs/utils/bounds/navigation/reveal/config.js +3 -4
- package/lib/commonjs/utils/bounds/navigation/reveal/config.js.map +1 -1
- package/lib/commonjs/utils/bounds/navigation/reveal/math.js +8 -8
- package/lib/commonjs/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/commonjs/utils/bounds/navigation/reveal/types.js +3 -1
- package/lib/commonjs/utils/bounds/navigation/reveal/types.js.map +1 -1
- package/lib/commonjs/utils/bounds/navigation/zoom/build.js +4 -6
- package/lib/commonjs/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/commonjs/utils/bounds/navigation/zoom/clip.js +64 -0
- package/lib/commonjs/utils/bounds/navigation/zoom/clip.js.map +1 -0
- package/lib/commonjs/utils/bounds/navigation/zoom/drag.js +1 -1
- package/lib/commonjs/utils/bounds/navigation/zoom/drag.js.map +1 -1
- package/lib/commonjs/utils/bounds/navigation/zoom/types.js +3 -1
- package/lib/commonjs/utils/bounds/navigation/zoom/types.js.map +1 -1
- package/lib/module/components/boundary/components/boundary-lifecycle.js +41 -9
- package/lib/module/components/boundary/components/boundary-lifecycle.js.map +1 -1
- package/lib/module/components/boundary/components/boundary-target.js +10 -17
- package/lib/module/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/module/components/boundary/create-boundary-component.js +13 -16
- package/lib/module/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/module/components/boundary/helpers/presentation.js +50 -0
- package/lib/module/components/boundary/helpers/presentation.js.map +1 -0
- package/lib/module/components/boundary/hooks/use-boundary-presentation.js +62 -0
- package/lib/module/components/boundary/hooks/use-boundary-presentation.js.map +1 -0
- package/lib/module/components/boundary/hooks/use-composed-boundary-style.js +39 -0
- package/lib/module/components/boundary/hooks/use-composed-boundary-style.js.map +1 -0
- package/lib/module/components/boundary/index.js +2 -3
- package/lib/module/components/boundary/index.js.map +1 -1
- package/lib/module/components/boundary/portal/components/portal-host.js +34 -0
- package/lib/module/components/boundary/portal/components/portal-host.js.map +1 -0
- package/lib/module/components/boundary/portal/components/portal-overlay.js +165 -0
- package/lib/module/components/boundary/portal/components/portal-overlay.js.map +1 -0
- package/lib/module/components/boundary/portal/components/portal.js +83 -0
- package/lib/module/components/boundary/portal/components/portal.js.map +1 -0
- package/lib/module/components/boundary/portal/helpers/offset-style.js.map +1 -0
- package/lib/module/components/boundary/portal/hooks/use-active-portal-boundary-host.js +31 -0
- package/lib/module/components/boundary/portal/hooks/use-active-portal-boundary-host.js.map +1 -0
- package/lib/module/components/boundary/portal/hooks/use-host-measurement.js +78 -0
- package/lib/module/components/boundary/portal/hooks/use-host-measurement.js.map +1 -0
- package/lib/module/components/boundary/portal/hooks/use-placeholder-styles.js.map +1 -0
- package/lib/module/components/boundary/portal/hooks/use-portal-destination.js +54 -0
- package/lib/module/components/boundary/portal/hooks/use-portal-destination.js.map +1 -0
- package/lib/module/components/boundary/portal/index.js +0 -1
- package/lib/module/components/boundary/portal/index.js.map +1 -1
- package/lib/module/components/boundary/portal/{components/boundary-portal/stores → stores}/host-registry.store.js +1 -12
- package/lib/module/components/boundary/portal/stores/host-registry.store.js.map +1 -0
- package/lib/module/components/boundary/portal/{components/boundary-portal/stores → stores}/portal-boundary-host.store.js +17 -17
- package/lib/module/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -0
- package/lib/module/components/boundary/portal/utils/naming.js +6 -0
- package/lib/module/components/boundary/portal/utils/naming.js.map +1 -1
- package/lib/module/components/boundary/portal/utils/resolve-portal.js +7 -27
- package/lib/module/components/boundary/portal/utils/resolve-portal.js.map +1 -1
- package/lib/module/components/boundary/providers/boundary-root.provider.js +13 -7
- package/lib/module/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/module/components/screen/container/helpers/layer-component.js +35 -0
- package/lib/module/components/screen/container/helpers/layer-component.js.map +1 -0
- package/lib/module/components/screen/container/{layers/render-component.js → helpers/uses-layer-render-props.js} +1 -1
- package/lib/module/components/screen/container/helpers/uses-layer-render-props.js.map +1 -0
- package/lib/module/components/screen/container/layers/backdrop.js +5 -13
- package/lib/module/components/screen/container/layers/backdrop.js.map +1 -1
- package/lib/module/components/screen/container/layers/clip.js +112 -0
- package/lib/module/components/screen/container/layers/clip.js.map +1 -0
- package/lib/module/components/screen/container/layers/content.js +18 -33
- package/lib/module/components/screen/container/layers/content.js.map +1 -1
- package/lib/module/components/screen/container/layers/surface.js +4 -15
- package/lib/module/components/screen/container/layers/surface.js.map +1 -1
- package/lib/module/components/screen/lifecycle/hooks/use-open-transition-intent.js +17 -2
- package/lib/module/components/screen/lifecycle/hooks/use-open-transition-intent.js.map +1 -1
- package/lib/module/constants.js +3 -1
- package/lib/module/constants.js.map +1 -1
- package/lib/module/hooks/navigation/use-navigation-helpers.js +16 -4
- package/lib/module/hooks/navigation/use-navigation-helpers.js.map +1 -1
- package/lib/module/providers/screen/motion/animation/helpers/build-screen-transition-options.js +0 -1
- package/lib/module/providers/screen/motion/animation/helpers/build-screen-transition-options.js.map +1 -1
- package/lib/module/providers/screen/motion/animation/helpers/hydrate-transition-state/index.js +3 -2
- package/lib/module/providers/screen/motion/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/module/providers/screen/motion/options/helpers.js +1 -3
- package/lib/module/providers/screen/motion/options/helpers.js.map +1 -1
- package/lib/module/providers/screen/orchestrator/helpers/use-interpolator-state.js +6 -4
- package/lib/module/providers/screen/orchestrator/helpers/use-interpolator-state.js.map +1 -1
- package/lib/module/providers/screen/orchestrator/helpers/use-pair-presentation.js +73 -0
- package/lib/module/providers/screen/orchestrator/helpers/use-pair-presentation.js.map +1 -0
- package/lib/module/providers/screen/orchestrator/orchestrator.provider.js +3 -0
- package/lib/module/providers/screen/orchestrator/orchestrator.provider.js.map +1 -1
- package/lib/module/providers/screen/orchestrator/styles/constants.js +1 -0
- package/lib/module/providers/screen/orchestrator/styles/constants.js.map +1 -1
- package/lib/module/providers/screen/orchestrator/styles/hooks/slot-resolvers.js +5 -8
- package/lib/module/providers/screen/orchestrator/styles/hooks/slot-resolvers.js.map +1 -1
- package/lib/module/types/animation.types.js +3 -1
- package/lib/module/types/animation.types.js.map +1 -1
- package/lib/module/utils/bounds/navigation/reveal/build.js +30 -63
- package/lib/module/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/module/utils/bounds/navigation/reveal/config.js +2 -3
- package/lib/module/utils/bounds/navigation/reveal/config.js.map +1 -1
- package/lib/module/utils/bounds/navigation/reveal/math.js +7 -7
- package/lib/module/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/module/utils/bounds/navigation/reveal/types.js +1 -1
- package/lib/module/utils/bounds/navigation/reveal/types.js.map +1 -1
- package/lib/module/utils/bounds/navigation/zoom/build.js +5 -7
- package/lib/module/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/module/utils/bounds/navigation/zoom/clip.js +59 -0
- package/lib/module/utils/bounds/navigation/zoom/clip.js.map +1 -0
- package/lib/module/utils/bounds/navigation/zoom/drag.js +1 -1
- package/lib/module/utils/bounds/navigation/zoom/drag.js.map +1 -1
- package/lib/module/utils/bounds/navigation/zoom/types.js +1 -1
- package/lib/module/utils/bounds/navigation/zoom/types.js.map +1 -1
- package/lib/typescript/components/boundary/components/boundary-lifecycle.d.ts.map +1 -1
- package/lib/typescript/components/boundary/components/boundary-target.d.ts.map +1 -1
- package/lib/typescript/components/boundary/create-boundary-component.d.ts.map +1 -1
- package/lib/typescript/components/boundary/helpers/presentation.d.ts +14 -0
- package/lib/typescript/components/boundary/helpers/presentation.d.ts.map +1 -0
- package/lib/typescript/components/boundary/hooks/use-boundary-presentation.d.ts +9 -0
- package/lib/typescript/components/boundary/hooks/use-boundary-presentation.d.ts.map +1 -0
- package/lib/typescript/components/boundary/hooks/use-composed-boundary-style.d.ts +4 -0
- package/lib/typescript/components/boundary/hooks/use-composed-boundary-style.d.ts.map +1 -0
- package/lib/typescript/components/boundary/index.d.ts +3 -2
- package/lib/typescript/components/boundary/index.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/components/portal-host.d.ts +15 -0
- package/lib/typescript/components/boundary/portal/components/portal-host.d.ts.map +1 -0
- package/lib/typescript/components/boundary/portal/components/portal-overlay.d.ts +20 -0
- package/lib/typescript/components/boundary/portal/components/portal-overlay.d.ts.map +1 -0
- package/lib/typescript/components/boundary/portal/components/portal.d.ts +23 -0
- package/lib/typescript/components/boundary/portal/components/portal.d.ts.map +1 -0
- package/lib/typescript/components/boundary/portal/helpers/offset-style.d.ts.map +1 -0
- package/lib/typescript/components/boundary/portal/hooks/use-active-portal-boundary-host.d.ts +11 -0
- package/lib/typescript/components/boundary/portal/hooks/use-active-portal-boundary-host.d.ts.map +1 -0
- package/lib/typescript/components/boundary/portal/hooks/use-host-measurement.d.ts +13 -0
- package/lib/typescript/components/boundary/portal/hooks/use-host-measurement.d.ts.map +1 -0
- package/lib/typescript/components/boundary/portal/hooks/use-placeholder-styles.d.ts.map +1 -0
- package/lib/typescript/components/boundary/portal/hooks/use-portal-destination.d.ts +8 -0
- package/lib/typescript/components/boundary/portal/hooks/use-portal-destination.d.ts.map +1 -0
- package/lib/typescript/components/boundary/portal/index.d.ts +0 -1
- package/lib/typescript/components/boundary/portal/index.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/stores/host-registry.store.d.ts.map +1 -0
- package/lib/typescript/components/boundary/portal/{components/boundary-portal/stores → stores}/portal-boundary-host.store.d.ts +2 -3
- package/lib/typescript/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +1 -0
- package/lib/typescript/components/boundary/portal/utils/naming.d.ts +1 -0
- package/lib/typescript/components/boundary/portal/utils/naming.d.ts.map +1 -1
- package/lib/typescript/components/boundary/portal/utils/resolve-portal.d.ts +2 -7
- package/lib/typescript/components/boundary/portal/utils/resolve-portal.d.ts.map +1 -1
- package/lib/typescript/components/boundary/providers/boundary-root.provider.d.ts +5 -2
- package/lib/typescript/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
- package/lib/typescript/components/screen/container/helpers/layer-component.d.ts +10 -0
- package/lib/typescript/components/screen/container/helpers/layer-component.d.ts.map +1 -0
- package/lib/typescript/components/screen/container/{layers/render-component.d.ts → helpers/uses-layer-render-props.d.ts} +1 -1
- package/lib/typescript/components/screen/container/helpers/uses-layer-render-props.d.ts.map +1 -0
- package/lib/typescript/components/screen/container/layers/backdrop.d.ts.map +1 -1
- package/lib/typescript/components/screen/container/layers/clip.d.ts +7 -0
- package/lib/typescript/components/screen/container/layers/clip.d.ts.map +1 -0
- package/lib/typescript/components/screen/container/layers/content.d.ts.map +1 -1
- package/lib/typescript/components/screen/container/layers/surface.d.ts.map +1 -1
- package/lib/typescript/components/screen/lifecycle/hooks/use-open-transition-intent.d.ts.map +1 -1
- package/lib/typescript/constants.d.ts +3 -1
- package/lib/typescript/constants.d.ts.map +1 -1
- package/lib/typescript/hooks/navigation/use-navigation-helpers.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/providers/screen/motion/animation/helpers/build-screen-transition-options.d.ts.map +1 -1
- package/lib/typescript/providers/screen/motion/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
- package/lib/typescript/providers/screen/motion/options/helpers.d.ts.map +1 -1
- package/lib/typescript/providers/screen/motion/options/types.d.ts +0 -1
- package/lib/typescript/providers/screen/motion/options/types.d.ts.map +1 -1
- package/lib/typescript/providers/screen/orchestrator/helpers/use-interpolator-state.d.ts.map +1 -1
- package/lib/typescript/providers/screen/orchestrator/helpers/use-pair-presentation.d.ts +21 -0
- package/lib/typescript/providers/screen/orchestrator/helpers/use-pair-presentation.d.ts.map +1 -0
- package/lib/typescript/providers/screen/orchestrator/orchestrator.provider.d.ts +2 -0
- package/lib/typescript/providers/screen/orchestrator/orchestrator.provider.d.ts.map +1 -1
- package/lib/typescript/providers/screen/orchestrator/styles/constants.d.ts.map +1 -1
- package/lib/typescript/providers/screen/orchestrator/styles/hooks/slot-resolvers.d.ts +1 -1
- package/lib/typescript/providers/screen/orchestrator/styles/hooks/slot-resolvers.d.ts.map +1 -1
- package/lib/typescript/providers/screen/orchestrator/styles/types.d.ts +1 -1
- package/lib/typescript/providers/screen/orchestrator/styles/types.d.ts.map +1 -1
- package/lib/typescript/types/animation.types.d.ts +16 -4
- package/lib/typescript/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/types/bounds.types.d.ts +7 -15
- package/lib/typescript/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/types/index.d.ts +1 -1
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/lib/typescript/types/screen.types.d.ts +1 -8
- package/lib/typescript/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/navigation/reveal/config.d.ts +2 -3
- package/lib/typescript/utils/bounds/navigation/reveal/config.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/navigation/reveal/math.d.ts +3 -3
- package/lib/typescript/utils/bounds/navigation/reveal/types.d.ts +1 -5
- package/lib/typescript/utils/bounds/navigation/reveal/types.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
- package/lib/typescript/utils/bounds/navigation/zoom/{mask.d.ts → clip.d.ts} +5 -5
- package/lib/typescript/utils/bounds/navigation/zoom/clip.d.ts.map +1 -0
- package/lib/typescript/utils/bounds/navigation/zoom/drag.d.ts +1 -1
- package/lib/typescript/utils/bounds/navigation/zoom/types.d.ts +1 -5
- package/lib/typescript/utils/bounds/navigation/zoom/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/boundary/components/boundary-lifecycle.tsx +44 -8
- package/src/components/boundary/components/boundary-target.tsx +14 -36
- package/src/components/boundary/create-boundary-component.tsx +16 -17
- package/src/components/boundary/helpers/presentation.ts +88 -0
- package/src/components/boundary/hooks/use-boundary-presentation.ts +82 -0
- package/src/components/boundary/hooks/use-composed-boundary-style.ts +58 -0
- package/src/components/boundary/index.tsx +10 -5
- package/src/components/boundary/portal/components/portal-host.tsx +36 -0
- package/src/components/boundary/portal/components/portal-overlay.tsx +223 -0
- package/src/components/boundary/portal/components/portal.tsx +124 -0
- package/src/components/boundary/portal/hooks/use-active-portal-boundary-host.ts +52 -0
- package/src/components/boundary/portal/hooks/use-host-measurement.ts +101 -0
- package/src/components/boundary/portal/hooks/use-portal-destination.ts +53 -0
- package/src/components/boundary/portal/index.ts +0 -1
- package/src/components/boundary/portal/{components/boundary-portal/stores → stores}/host-registry.store.ts +1 -20
- package/src/components/boundary/portal/{components/boundary-portal/stores → stores}/portal-boundary-host.store.ts +19 -26
- package/src/components/boundary/portal/utils/naming.ts +10 -0
- package/src/components/boundary/portal/utils/resolve-portal.ts +9 -48
- package/src/components/boundary/providers/boundary-root.provider.tsx +34 -22
- package/src/components/screen/container/helpers/layer-component.tsx +38 -0
- package/src/components/screen/container/layers/backdrop.tsx +8 -31
- package/src/components/screen/container/layers/clip.tsx +124 -0
- package/src/components/screen/container/layers/content.tsx +21 -62
- package/src/components/screen/container/layers/surface.tsx +5 -23
- package/src/components/screen/lifecycle/hooks/use-open-transition-intent.ts +26 -2
- package/src/constants.ts +3 -1
- package/src/hooks/navigation/use-navigation-helpers.ts +13 -7
- package/src/index.ts +1 -0
- package/src/providers/screen/motion/animation/helpers/build-screen-transition-options.ts +0 -1
- package/src/providers/screen/motion/animation/helpers/hydrate-transition-state/index.ts +3 -2
- package/src/providers/screen/motion/options/helpers.ts +0 -6
- package/src/providers/screen/motion/options/types.ts +0 -1
- package/src/providers/screen/orchestrator/helpers/use-interpolator-state.ts +13 -8
- package/src/providers/screen/orchestrator/helpers/use-pair-presentation.ts +103 -0
- package/src/providers/screen/orchestrator/orchestrator.provider.tsx +4 -0
- package/src/providers/screen/orchestrator/styles/constants.ts +1 -0
- package/src/providers/screen/orchestrator/styles/hooks/slot-resolvers.tsx +8 -11
- package/src/providers/screen/orchestrator/styles/types.ts +1 -0
- package/src/types/animation.types.ts +35 -4
- package/src/types/bounds.types.ts +7 -15
- package/src/types/index.ts +1 -0
- package/src/types/screen.types.ts +1 -8
- package/src/utils/bounds/navigation/reveal/build.ts +46 -80
- package/src/utils/bounds/navigation/reveal/config.ts +2 -4
- package/src/utils/bounds/navigation/reveal/math.ts +9 -9
- package/src/utils/bounds/navigation/reveal/types.ts +1 -8
- package/src/utils/bounds/navigation/zoom/build.ts +16 -26
- package/src/utils/bounds/navigation/zoom/{mask.ts → clip.ts} +42 -48
- package/src/utils/bounds/navigation/zoom/drag.ts +2 -2
- package/src/utils/bounds/navigation/zoom/types.ts +1 -8
- package/lib/commonjs/components/boundary/hooks/use-boundary-measurement.js +0 -83
- package/lib/commonjs/components/boundary/hooks/use-boundary-measurement.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/components/host.js +0 -45
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/components/host.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +0 -119
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/helpers/handoff-visibility.js +0 -20
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/helpers/handoff-visibility.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js +0 -14
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +0 -136
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/index.js +0 -53
- package/lib/commonjs/components/boundary/portal/components/boundary-content-portal/index.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/host.js +0 -99
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/host.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +0 -104
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +0 -13
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +0 -82
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +0 -58
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +0 -67
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/index.js +0 -68
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/index.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +0 -1
- package/lib/commonjs/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +0 -1
- package/lib/commonjs/components/screen/container/layers/maybe-masked-navigation-container.js +0 -83
- package/lib/commonjs/components/screen/container/layers/maybe-masked-navigation-container.js.map +0 -1
- package/lib/commonjs/components/screen/container/layers/render-component.js.map +0 -1
- package/lib/commonjs/utils/bounds/navigation/zoom/mask.js +0 -73
- package/lib/commonjs/utils/bounds/navigation/zoom/mask.js.map +0 -1
- package/lib/module/components/boundary/hooks/use-boundary-measurement.js +0 -78
- package/lib/module/components/boundary/hooks/use-boundary-measurement.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-content-portal/components/host.js +0 -40
- package/lib/module/components/boundary/portal/components/boundary-content-portal/components/host.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +0 -110
- package/lib/module/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-content-portal/helpers/handoff-visibility.js +0 -16
- package/lib/module/components/boundary/portal/components/boundary-content-portal/helpers/handoff-visibility.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js +0 -9
- package/lib/module/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +0 -131
- package/lib/module/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-content-portal/index.js +0 -42
- package/lib/module/components/boundary/portal/components/boundary-content-portal/index.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/components/host.js +0 -94
- package/lib/module/components/boundary/portal/components/boundary-portal/components/host.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +0 -99
- package/lib/module/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js +0 -8
- package/lib/module/components/boundary/portal/components/boundary-portal/helpers/local-measurement.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js +0 -76
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +0 -53
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js +0 -62
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/index.js +0 -63
- package/lib/module/components/boundary/portal/components/boundary-portal/index.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +0 -1
- package/lib/module/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +0 -1
- package/lib/module/components/screen/container/layers/maybe-masked-navigation-container.js +0 -78
- package/lib/module/components/screen/container/layers/maybe-masked-navigation-container.js.map +0 -1
- package/lib/module/components/screen/container/layers/render-component.js.map +0 -1
- package/lib/module/utils/bounds/navigation/zoom/mask.js +0 -68
- package/lib/module/utils/bounds/navigation/zoom/mask.js.map +0 -1
- package/lib/typescript/components/boundary/hooks/use-boundary-measurement.d.ts +0 -28
- package/lib/typescript/components/boundary/hooks/use-boundary-measurement.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/components/host.d.ts +0 -10
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/components/host.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts +0 -45
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/helpers/handoff-visibility.d.ts +0 -8
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/helpers/handoff-visibility.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/helpers/host-name.d.ts +0 -2
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/helpers/host-name.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts +0 -10
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/index.d.ts +0 -9
- package/lib/typescript/components/boundary/portal/components/boundary-content-portal/index.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/components/host.d.ts +0 -7
- package/lib/typescript/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts +0 -13
- package/lib/typescript/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts +0 -4
- package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/local-measurement.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts +0 -21
- package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts +0 -10
- package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts +0 -12
- package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/index.d.ts +0 -12
- package/lib/typescript/components/boundary/portal/components/boundary-portal/index.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/stores/host-registry.store.d.ts.map +0 -1
- package/lib/typescript/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +0 -1
- package/lib/typescript/components/screen/container/layers/maybe-masked-navigation-container.d.ts +0 -9
- package/lib/typescript/components/screen/container/layers/maybe-masked-navigation-container.d.ts.map +0 -1
- package/lib/typescript/components/screen/container/layers/render-component.d.ts.map +0 -1
- package/lib/typescript/utils/bounds/navigation/zoom/mask.d.ts.map +0 -1
- package/src/components/boundary/hooks/use-boundary-measurement.ts +0 -98
- package/src/components/boundary/portal/components/boundary-content-portal/components/host.tsx +0 -56
- package/src/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.ts +0 -192
- package/src/components/boundary/portal/components/boundary-content-portal/helpers/handoff-visibility.ts +0 -23
- package/src/components/boundary/portal/components/boundary-content-portal/helpers/host-name.ts +0 -9
- package/src/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +0 -252
- package/src/components/boundary/portal/components/boundary-content-portal/index.tsx +0 -81
- package/src/components/boundary/portal/components/boundary-portal/components/host.tsx +0 -119
- package/src/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +0 -139
- package/src/components/boundary/portal/components/boundary-portal/helpers/local-measurement.ts +0 -10
- package/src/components/boundary/portal/components/boundary-portal/hooks/use-active-portal-boundary-host.ts +0 -118
- package/src/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +0 -64
- package/src/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.ts +0 -90
- package/src/components/boundary/portal/components/boundary-portal/index.tsx +0 -97
- package/src/components/screen/container/layers/maybe-masked-navigation-container.tsx +0 -113
- /package/lib/commonjs/components/boundary/portal/{components/boundary-portal/helpers → helpers}/offset-style.js +0 -0
- /package/lib/commonjs/components/boundary/portal/{components/boundary-portal/hooks → hooks}/use-placeholder-styles.js +0 -0
- /package/lib/module/components/boundary/portal/{components/boundary-portal/helpers → helpers}/offset-style.js +0 -0
- /package/lib/module/components/boundary/portal/{components/boundary-portal/hooks → hooks}/use-placeholder-styles.js +0 -0
- /package/lib/typescript/components/boundary/portal/{components/boundary-portal/helpers → helpers}/offset-style.d.ts +0 -0
- /package/lib/typescript/components/boundary/portal/{components/boundary-portal/hooks → hooks}/use-placeholder-styles.d.ts +0 -0
- /package/lib/typescript/components/boundary/portal/{components/boundary-portal/stores → stores}/host-registry.store.d.ts +0 -0
- /package/src/components/boundary/portal/{components/boundary-portal/helpers → helpers}/offset-style.ts +0 -0
- /package/src/components/boundary/portal/{components/boundary-portal/hooks → hooks}/use-placeholder-styles.ts +0 -0
- /package/src/components/screen/container/{layers/render-component.ts → helpers/uses-layer-render-props.ts} +0 -0
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { memo, useCallback } from "react";
|
|
2
|
+
import {
|
|
3
|
+
I18nManager,
|
|
4
|
+
type LayoutChangeEvent,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
View,
|
|
7
|
+
type ViewProps,
|
|
8
|
+
type ViewStyle,
|
|
9
|
+
} from "react-native";
|
|
10
|
+
import Animated, {
|
|
11
|
+
useAnimatedStyle,
|
|
12
|
+
useDerivedValue,
|
|
13
|
+
useSharedValue,
|
|
14
|
+
} from "react-native-reanimated";
|
|
15
|
+
import { useOrchestratorStore } from "../../../../providers/screen/orchestrator/orchestrator.provider";
|
|
16
|
+
import type { Layout } from "../../../../types/screen.types";
|
|
17
|
+
|
|
18
|
+
/** Stable layout host: changing the viewport must never resize the screen. */
|
|
19
|
+
export const Clip = memo(
|
|
20
|
+
({
|
|
21
|
+
children,
|
|
22
|
+
pointerEvents,
|
|
23
|
+
}: {
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
pointerEvents: ViewProps["pointerEvents"];
|
|
26
|
+
}) => {
|
|
27
|
+
const slotsMap = useOrchestratorStore((store) => store.slotsMap);
|
|
28
|
+
const screenInterpolatorProps = useOrchestratorStore(
|
|
29
|
+
(store) => store.screenInterpolatorProps,
|
|
30
|
+
);
|
|
31
|
+
const layout = useSharedValue<Layout | null>(null);
|
|
32
|
+
|
|
33
|
+
const onLayout = useCallback(
|
|
34
|
+
(event: LayoutChangeEvent) => {
|
|
35
|
+
const { width, height } = event.nativeEvent.layout;
|
|
36
|
+
layout.set({ width, height });
|
|
37
|
+
},
|
|
38
|
+
[layout],
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const clippingStyles = useDerivedValue(() => {
|
|
42
|
+
const clipStyle = slotsMap.get().clip?.style;
|
|
43
|
+
// Reset-only slots have no rectangle dimensions.
|
|
44
|
+
const clip =
|
|
45
|
+
clipStyle?.width !== undefined && clipStyle.height !== undefined
|
|
46
|
+
? clipStyle
|
|
47
|
+
: undefined;
|
|
48
|
+
// Keep content independent of the viewport, even before onLayout.
|
|
49
|
+
const contentLayout =
|
|
50
|
+
layout.get() ?? screenInterpolatorProps.get().layouts.screen;
|
|
51
|
+
const x = clip?.x ?? 0;
|
|
52
|
+
const y = clip?.y ?? 0;
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
viewport: {
|
|
56
|
+
width: clip ? clip.width : "100%",
|
|
57
|
+
height: clip ? clip.height : "100%",
|
|
58
|
+
overflow: clip ? "hidden" : "visible",
|
|
59
|
+
borderRadius: clip?.borderRadius,
|
|
60
|
+
borderTopLeftRadius: clip?.borderTopLeftRadius,
|
|
61
|
+
borderTopRightRadius: clip?.borderTopRightRadius,
|
|
62
|
+
borderBottomLeftRadius: clip?.borderBottomLeftRadius,
|
|
63
|
+
borderBottomRightRadius: clip?.borderBottomRightRadius,
|
|
64
|
+
borderTopStartRadius: clip?.borderTopStartRadius,
|
|
65
|
+
borderTopEndRadius: clip?.borderTopEndRadius,
|
|
66
|
+
borderBottomStartRadius: clip?.borderBottomStartRadius,
|
|
67
|
+
borderBottomEndRadius: clip?.borderBottomEndRadius,
|
|
68
|
+
borderStartStartRadius: clip?.borderStartStartRadius,
|
|
69
|
+
borderStartEndRadius: clip?.borderStartEndRadius,
|
|
70
|
+
borderEndStartRadius: clip?.borderEndStartRadius,
|
|
71
|
+
borderEndEndRadius: clip?.borderEndEndRadius,
|
|
72
|
+
borderCurve: clip?.borderCurve,
|
|
73
|
+
transform: [{ translateX: x }, { translateY: y }],
|
|
74
|
+
} satisfies ViewStyle,
|
|
75
|
+
content: {
|
|
76
|
+
width: contentLayout.width,
|
|
77
|
+
height: contentLayout.height,
|
|
78
|
+
transform: [{ translateX: -x }, { translateY: -y }],
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const viewportStyle = useAnimatedStyle(() => clippingStyles.get().viewport);
|
|
84
|
+
const innerStyle = useAnimatedStyle(() => clippingStyles.get().content);
|
|
85
|
+
|
|
86
|
+
return (
|
|
87
|
+
<View
|
|
88
|
+
style={styles.host}
|
|
89
|
+
onLayout={onLayout}
|
|
90
|
+
pointerEvents={pointerEvents}
|
|
91
|
+
collapsable={false}
|
|
92
|
+
>
|
|
93
|
+
<Animated.View
|
|
94
|
+
style={[styles.viewport, viewportStyle]}
|
|
95
|
+
pointerEvents={pointerEvents}
|
|
96
|
+
collapsable={false}
|
|
97
|
+
>
|
|
98
|
+
<Animated.View
|
|
99
|
+
style={[styles.inner, innerStyle]}
|
|
100
|
+
pointerEvents={pointerEvents}
|
|
101
|
+
collapsable={false}
|
|
102
|
+
>
|
|
103
|
+
{children}
|
|
104
|
+
</Animated.View>
|
|
105
|
+
</Animated.View>
|
|
106
|
+
</View>
|
|
107
|
+
);
|
|
108
|
+
},
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
const styles = StyleSheet.create({
|
|
112
|
+
host: { flex: 1 },
|
|
113
|
+
// Pin to the physical left under both native layout directions.
|
|
114
|
+
viewport: {
|
|
115
|
+
position: "absolute",
|
|
116
|
+
top: 0,
|
|
117
|
+
...(I18nManager.isRTL ? { end: 0 } : { left: 0 }),
|
|
118
|
+
},
|
|
119
|
+
inner: {
|
|
120
|
+
...(I18nManager.isRTL
|
|
121
|
+
? { alignSelf: "flex-end" as const }
|
|
122
|
+
: { alignSelf: "flex-start" as const }),
|
|
123
|
+
},
|
|
124
|
+
});
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { memo } from "react";
|
|
2
2
|
import { StyleSheet, View } from "react-native";
|
|
3
3
|
import { GestureDetector } from "react-native-gesture-handler";
|
|
4
|
-
import Animated from "react-native-reanimated";
|
|
5
4
|
import { useBuilderStore } from "../../../../providers/screen/builder";
|
|
6
5
|
import { useMotionStore } from "../../../../providers/screen/motion";
|
|
7
6
|
import {
|
|
8
7
|
useSlotProps,
|
|
9
8
|
useSlotStyles,
|
|
10
9
|
} from "../../../../providers/screen/orchestrator/styles";
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
10
|
+
import { PortalOverlay } from "../../../boundary/portal/components/portal-overlay";
|
|
11
|
+
import { LayerComponent } from "../helpers/layer-component";
|
|
13
12
|
import { useContentLayout } from "../hooks/use-content-layout";
|
|
14
|
-
import {
|
|
15
|
-
import { usesLayerRenderProps } from "./render-component";
|
|
13
|
+
import { Clip } from "./clip";
|
|
16
14
|
import { SurfaceLayer } from "./surface";
|
|
17
15
|
|
|
18
16
|
type Props = {
|
|
@@ -27,32 +25,17 @@ export const ContentLayer = memo(
|
|
|
27
25
|
const ContentComponent = useBuilderStore(
|
|
28
26
|
(store) => store.options.contentComponent,
|
|
29
27
|
);
|
|
30
|
-
const isNavigationMaskEnabled = useBuilderStore(
|
|
31
|
-
(store) => !!store.options.navigationMaskEnabled,
|
|
32
|
-
);
|
|
33
28
|
const hasAutoSnapPoint = useBuilderStore(
|
|
34
29
|
(store) => store.options.snapPoints?.includes("auto") ?? false,
|
|
35
30
|
);
|
|
36
31
|
const contentPointerEvents = isBackdropActive ? "box-none" : pointerEvents;
|
|
37
32
|
|
|
38
|
-
const AnimatedContentComponent = useMemo(() => {
|
|
39
|
-
return ContentComponent && !usesLayerRenderProps(ContentComponent)
|
|
40
|
-
? Animated.createAnimatedComponent(
|
|
41
|
-
ContentComponent as ComponentType<any>,
|
|
42
|
-
)
|
|
43
|
-
: null;
|
|
44
|
-
}, [ContentComponent]);
|
|
45
|
-
|
|
46
33
|
const handleContentLayout = useContentLayout("content");
|
|
47
34
|
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
animatedContentStyle,
|
|
53
|
-
] as ScreenContentComponentProps["styles"];
|
|
54
|
-
const contentProps =
|
|
55
|
-
animatedContentProps as ScreenContentComponentProps["props"];
|
|
35
|
+
const contentStyle = useSlotStyles("content");
|
|
36
|
+
const contentProps = useSlotProps("content");
|
|
37
|
+
|
|
38
|
+
const contentStyles = [styles.content, contentStyle];
|
|
56
39
|
|
|
57
40
|
const screenChildren = hasAutoSnapPoint ? (
|
|
58
41
|
<View collapsable={false} onLayout={handleContentLayout}>
|
|
@@ -62,45 +45,21 @@ export const ContentLayer = memo(
|
|
|
62
45
|
children
|
|
63
46
|
);
|
|
64
47
|
|
|
65
|
-
const contentChildren = (
|
|
66
|
-
<MaybeMaskedNavigationContainer
|
|
67
|
-
pointerEvents={contentPointerEvents}
|
|
68
|
-
enabled={isNavigationMaskEnabled}
|
|
69
|
-
>
|
|
70
|
-
<SurfaceLayer pointerEvents={contentPointerEvents}>
|
|
71
|
-
{screenChildren}
|
|
72
|
-
</SurfaceLayer>
|
|
73
|
-
<ScreenFallbackHost />
|
|
74
|
-
</MaybeMaskedNavigationContainer>
|
|
75
|
-
);
|
|
76
|
-
|
|
77
48
|
return (
|
|
78
49
|
<GestureDetector gesture={gestureContext.detectorGesture}>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
>
|
|
93
|
-
{contentChildren}
|
|
94
|
-
</ContentComponent>
|
|
95
|
-
) : (
|
|
96
|
-
<Animated.View
|
|
97
|
-
style={contentStyles}
|
|
98
|
-
animatedProps={animatedContentProps}
|
|
99
|
-
pointerEvents={contentPointerEvents}
|
|
100
|
-
>
|
|
101
|
-
{contentChildren}
|
|
102
|
-
</Animated.View>
|
|
103
|
-
)}
|
|
50
|
+
<LayerComponent
|
|
51
|
+
component={ContentComponent}
|
|
52
|
+
styles={contentStyles}
|
|
53
|
+
props={contentProps}
|
|
54
|
+
pointerEvents={contentPointerEvents}
|
|
55
|
+
>
|
|
56
|
+
<Clip pointerEvents={contentPointerEvents}>
|
|
57
|
+
<SurfaceLayer pointerEvents={contentPointerEvents}>
|
|
58
|
+
{screenChildren}
|
|
59
|
+
</SurfaceLayer>
|
|
60
|
+
<PortalOverlay fallback />
|
|
61
|
+
</Clip>
|
|
62
|
+
</LayerComponent>
|
|
104
63
|
</GestureDetector>
|
|
105
64
|
);
|
|
106
65
|
},
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { memo } from "react";
|
|
2
2
|
import { StyleSheet } from "react-native";
|
|
3
|
-
import Animated from "react-native-reanimated";
|
|
4
3
|
import { useBuilderStore } from "../../../../providers/screen/builder";
|
|
5
4
|
import {
|
|
6
5
|
useSlotProps,
|
|
7
6
|
useSlotStyles,
|
|
8
7
|
} from "../../../../providers/screen/orchestrator/styles";
|
|
9
8
|
import type { ScreenSurfaceComponentProps } from "../../../../types";
|
|
10
|
-
import {
|
|
9
|
+
import { LayerComponent } from "../helpers/layer-component";
|
|
11
10
|
|
|
12
11
|
type Props = {
|
|
13
12
|
children: React.ReactNode;
|
|
@@ -19,12 +18,6 @@ export const SurfaceLayer = memo(({ children, pointerEvents }: Props) => {
|
|
|
19
18
|
(store) => store.options.surfaceComponent,
|
|
20
19
|
);
|
|
21
20
|
|
|
22
|
-
const AnimatedSurfaceComponent = useMemo(() => {
|
|
23
|
-
return SurfaceComponent && !usesLayerRenderProps(SurfaceComponent)
|
|
24
|
-
? Animated.createAnimatedComponent(SurfaceComponent as ComponentType<any>)
|
|
25
|
-
: null;
|
|
26
|
-
}, [SurfaceComponent]);
|
|
27
|
-
|
|
28
21
|
const animatedSurfaceStyle = useSlotStyles("surface");
|
|
29
22
|
const animatedSurfaceProps = useSlotProps("surface");
|
|
30
23
|
const surfaceStyles = [
|
|
@@ -38,26 +31,15 @@ export const SurfaceLayer = memo(({ children, pointerEvents }: Props) => {
|
|
|
38
31
|
return children;
|
|
39
32
|
}
|
|
40
33
|
|
|
41
|
-
if (AnimatedSurfaceComponent) {
|
|
42
|
-
return (
|
|
43
|
-
<AnimatedSurfaceComponent
|
|
44
|
-
style={surfaceStyles}
|
|
45
|
-
animatedProps={animatedSurfaceProps}
|
|
46
|
-
pointerEvents={pointerEvents}
|
|
47
|
-
>
|
|
48
|
-
{children}
|
|
49
|
-
</AnimatedSurfaceComponent>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
34
|
return (
|
|
54
|
-
<
|
|
35
|
+
<LayerComponent
|
|
36
|
+
component={SurfaceComponent}
|
|
55
37
|
styles={surfaceStyles}
|
|
56
38
|
props={surfaceProps}
|
|
57
39
|
pointerEvents={pointerEvents}
|
|
58
40
|
>
|
|
59
41
|
{children}
|
|
60
|
-
</
|
|
42
|
+
</LayerComponent>
|
|
61
43
|
);
|
|
62
44
|
});
|
|
63
45
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useLayoutEffect } from "react";
|
|
1
|
+
import { useLayoutEffect, useRef } from "react";
|
|
2
2
|
import { useAnimatedReaction } from "react-native-reanimated";
|
|
3
|
-
import { scheduleOnRN } from "react-native-worklets";
|
|
3
|
+
import { scheduleOnRN, scheduleOnUI } from "react-native-worklets";
|
|
4
4
|
import { AnimationProgress } from "../../../../constants";
|
|
5
5
|
import useStableCallback from "../../../../hooks/use-stable-callback";
|
|
6
6
|
import {
|
|
@@ -46,6 +46,7 @@ export function useOpenTransitionIntent(
|
|
|
46
46
|
system: MotionTransitionValues,
|
|
47
47
|
onComplete?: () => void,
|
|
48
48
|
) {
|
|
49
|
+
const initialized = useRef(false);
|
|
49
50
|
const isFirstKey = useBuilderStore((store) => store.derivations.isFirstKey);
|
|
50
51
|
const { requestLifecycleTransition } = system.actions;
|
|
51
52
|
const completeOpen = useStableCallback(() => {
|
|
@@ -71,6 +72,29 @@ export function useOpenTransitionIntent(
|
|
|
71
72
|
|
|
72
73
|
// biome-ignore lint/correctness/useExhaustiveDependencies: Must only run once on mount
|
|
73
74
|
useLayoutEffect(() => {
|
|
75
|
+
// TODO: Find a cleaner way to handle effect setup and resumption across Activity pauses.
|
|
76
|
+
// Activity reconnects effects when a retained screen becomes visible again.
|
|
77
|
+
if (initialized.current) {
|
|
78
|
+
// Activity cleanup cancels shared-value animations; resume only unfinished opens.
|
|
79
|
+
scheduleOnUI(() => {
|
|
80
|
+
"worklet";
|
|
81
|
+
if (
|
|
82
|
+
animations.entering.get() &&
|
|
83
|
+
!animations.closing.get() &&
|
|
84
|
+
!animations.progressSettled.get() &&
|
|
85
|
+
system.pendingLifecycleRequestKind.get() ===
|
|
86
|
+
LifecycleTransitionRequestKind.None
|
|
87
|
+
) {
|
|
88
|
+
requestLifecycleTransition(
|
|
89
|
+
LifecycleTransitionRequestKind.Open,
|
|
90
|
+
system.targetProgress.get(),
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
initialized.current = true;
|
|
97
|
+
|
|
74
98
|
const {
|
|
75
99
|
snapPoints,
|
|
76
100
|
initialSnapIndex = 0,
|
package/src/constants.ts
CHANGED
|
@@ -15,10 +15,12 @@ import type {
|
|
|
15
15
|
import type { BaseStackRoute } from "./types/stack.types";
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Legacy navigation mask identifiers (ignored).
|
|
19
19
|
*/
|
|
20
|
+
/** @deprecated Ignored. Return `clip` geometry from the interpolator instead. */
|
|
20
21
|
export const NAVIGATION_MASK_ELEMENT_STYLE_ID =
|
|
21
22
|
"NAVIGATION_MASK_ELEMENT_STYLE_ID";
|
|
23
|
+
/** @deprecated Ignored. Return `clip` geometry from the interpolator instead. */
|
|
22
24
|
export const NAVIGATION_MASK_CONTAINER_STYLE_ID =
|
|
23
25
|
"NAVIGATION_MASK_CONTAINER_STYLE_ID";
|
|
24
26
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useCallback } from "react";
|
|
2
|
+
import { runOnUISync } from "react-native-worklets";
|
|
2
3
|
import { useBuilderStore } from "../../providers/screen/builder";
|
|
3
4
|
import { getMotionStore } from "../../providers/screen/motion";
|
|
4
5
|
import { LifecycleTransitionRequestKind } from "../../providers/screen/motion/hooks/use-transition-values";
|
|
@@ -45,13 +46,18 @@ export function useNavigationHelpers() {
|
|
|
45
46
|
if (routeIndex <= 0) return false;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
const {
|
|
50
|
+
closing,
|
|
51
|
+
actions: { requestLifecycleTransition },
|
|
52
|
+
} = getMotionStore(route.key).state;
|
|
53
|
+
|
|
54
|
+
// Publish before the remaining React commit delays JS's queued UI writes.
|
|
55
|
+
runOnUISync(() => {
|
|
56
|
+
"worklet";
|
|
57
|
+
if (!closing.get()) {
|
|
58
|
+
requestLifecycleTransition(LifecycleTransitionRequestKind.Close, 0);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
55
61
|
return true;
|
|
56
62
|
}, [navigation, route, requestStackDismiss]);
|
|
57
63
|
|
package/src/index.ts
CHANGED
|
@@ -7,7 +7,6 @@ export const buildScreenTransitionOptions = (
|
|
|
7
7
|
options: ScreenTransitionConfig,
|
|
8
8
|
): ScreenTransitionOptions => {
|
|
9
9
|
return {
|
|
10
|
-
navigationMaskEnabled: options.navigationMaskEnabled,
|
|
11
10
|
gestureEnabled: options.gestureEnabled,
|
|
12
11
|
gestureTracking: options.gestureTracking,
|
|
13
12
|
gestureDirection: options.gestureDirection,
|
|
@@ -21,7 +21,6 @@ const mergeTransitionOptions = (
|
|
|
21
21
|
return base;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
slot.navigationMaskEnabled = base.navigationMaskEnabled;
|
|
25
24
|
slot.gestureEnabled = effective.gestureEnabled ?? base.gestureEnabled;
|
|
26
25
|
slot.gestureTracking = base.gestureTracking;
|
|
27
26
|
slot.gestureDirection = effective.gestureDirection ?? base.gestureDirection;
|
|
@@ -191,7 +190,9 @@ export const hydrateTransitionState = (
|
|
|
191
190
|
|
|
192
191
|
out.meta = s.meta;
|
|
193
192
|
out.options = options;
|
|
194
|
-
|
|
193
|
+
// navigate() can replace params on a route that is still closing. Its
|
|
194
|
+
// interpolator must finish with the identity that began that close.
|
|
195
|
+
if (!out.closing || out.route.key !== s.route.key) out.route = s.route;
|
|
195
196
|
out.layouts.screen.width = dimensions.width;
|
|
196
197
|
out.layouts.screen.height = dimensions.height;
|
|
197
198
|
|
|
@@ -204,7 +204,6 @@ const areScreenOptionsEqual = (
|
|
|
204
204
|
) => {
|
|
205
205
|
"worklet";
|
|
206
206
|
return (
|
|
207
|
-
left.navigationMaskEnabled === right.navigationMaskEnabled &&
|
|
208
207
|
left.gestureEnabled === right.gestureEnabled &&
|
|
209
208
|
left.gestureTracking === right.gestureTracking &&
|
|
210
209
|
areGestureDirectionsEqual(left.gestureDirection, right.gestureDirection) &&
|
|
@@ -225,10 +224,6 @@ export const resolveBaseScreenOptions = (
|
|
|
225
224
|
options: ScreenTransitionConfig,
|
|
226
225
|
): ScreenOptionsSnapshot => {
|
|
227
226
|
return {
|
|
228
|
-
navigationMaskEnabled: resolveBooleanOption(
|
|
229
|
-
options.navigationMaskEnabled,
|
|
230
|
-
undefined,
|
|
231
|
-
),
|
|
232
227
|
gestureEnabled: resolveBooleanOption(options.gestureEnabled, undefined),
|
|
233
228
|
gestureTracking: resolveGestureTrackingOption(
|
|
234
229
|
options.gestureTracking,
|
|
@@ -298,7 +293,6 @@ export const syncScreenOptionsOverrides = (
|
|
|
298
293
|
const base = screenOptions.get().baseOptions;
|
|
299
294
|
|
|
300
295
|
const next: ScreenOptionsState = {
|
|
301
|
-
navigationMaskEnabled: base.navigationMaskEnabled,
|
|
302
296
|
gestureEnabled: resolveBooleanOption(
|
|
303
297
|
options?.gestureEnabled,
|
|
304
298
|
base.gestureEnabled,
|
|
@@ -8,7 +8,6 @@ export type OptionalScreenOption<K extends keyof ScreenTransitionConfig> =
|
|
|
8
8
|
ScreenTransitionConfig[K];
|
|
9
9
|
|
|
10
10
|
export type ScreenOptionsSnapshot = {
|
|
11
|
-
navigationMaskEnabled: OptionalScreenOption<"navigationMaskEnabled">;
|
|
12
11
|
gestureEnabled: OptionalScreenOption<"gestureEnabled">;
|
|
13
12
|
gestureTracking: RequiredScreenOption<"gestureTracking">;
|
|
14
13
|
gestureDirection: RequiredScreenOption<"gestureDirection">;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { useMemo } from "react";
|
|
2
|
-
import {
|
|
1
|
+
import { useMemo, useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
createScreenTransitionState,
|
|
4
|
+
DEFAULT_SCREEN_TRANSITION_STATE,
|
|
5
|
+
} from "../../../../constants";
|
|
3
6
|
import type {
|
|
4
7
|
BuiltState,
|
|
5
8
|
MotionAnimationState,
|
|
@@ -10,6 +13,12 @@ import type {
|
|
|
10
13
|
export function useInterpolatorState(
|
|
11
14
|
motion: MotionAnimationState | null,
|
|
12
15
|
): BuiltState | undefined {
|
|
16
|
+
// The UI output survives descriptor updates; hydration owns its contents.
|
|
17
|
+
const [unwrapped] = useState(() =>
|
|
18
|
+
createScreenTransitionState(
|
|
19
|
+
motion?.route ?? DEFAULT_SCREEN_TRANSITION_STATE.route,
|
|
20
|
+
),
|
|
21
|
+
);
|
|
13
22
|
return useMemo(
|
|
14
23
|
() =>
|
|
15
24
|
motion
|
|
@@ -18,13 +27,9 @@ export function useInterpolatorState(
|
|
|
18
27
|
gesture: motion,
|
|
19
28
|
optionsSlot: {},
|
|
20
29
|
contentLayoutSlot: { width: 0, height: 0 },
|
|
21
|
-
unwrapped
|
|
22
|
-
motion.route,
|
|
23
|
-
motion.meta,
|
|
24
|
-
motion.options,
|
|
25
|
-
),
|
|
30
|
+
unwrapped,
|
|
26
31
|
}
|
|
27
32
|
: undefined,
|
|
28
|
-
[motion],
|
|
33
|
+
[motion, unwrapped],
|
|
29
34
|
);
|
|
30
35
|
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useDerivedValue } from "react-native-reanimated";
|
|
2
|
+
import { NO_STYLES } from "../../../../constants";
|
|
3
|
+
import { pairs } from "../../../../stores/bounds/internals/state";
|
|
4
|
+
import type {
|
|
5
|
+
NormalizedTransitionInterpolatedStyle,
|
|
6
|
+
ScreenStyleInterpolator,
|
|
7
|
+
} from "../../../../types/animation.types";
|
|
8
|
+
import { useBuilderStore } from "../../builder";
|
|
9
|
+
import { useMotionStore } from "../../motion";
|
|
10
|
+
import { createInterpolatorScope } from "../styles/helpers/create-interpolator-scope";
|
|
11
|
+
import { normalizeSlots } from "../styles/helpers/normalize-slots";
|
|
12
|
+
import { selectInterpolatorFrame } from "../styles/helpers/select-interpolator-frame";
|
|
13
|
+
import { stripInterpolatorOptions } from "../styles/helpers/strip-interpolator-options";
|
|
14
|
+
import { updateDerivations } from "./derivations";
|
|
15
|
+
import type {
|
|
16
|
+
ScreenAnimationPipeline,
|
|
17
|
+
ScreenInterpolatorFrame,
|
|
18
|
+
} from "./pipeline";
|
|
19
|
+
|
|
20
|
+
export type BoundaryPairPresentation = {
|
|
21
|
+
pairKey: string;
|
|
22
|
+
sourceKey: string;
|
|
23
|
+
destinationKey: string;
|
|
24
|
+
ready: boolean;
|
|
25
|
+
source: NormalizedTransitionInterpolatedStyle;
|
|
26
|
+
destination: NormalizedTransitionInterpolatedStyle;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export function boundarySourceFrame(
|
|
30
|
+
frame: ScreenInterpolatorFrame,
|
|
31
|
+
): ScreenInterpolatorFrame | undefined {
|
|
32
|
+
"worklet";
|
|
33
|
+
if (!frame.previous) return undefined;
|
|
34
|
+
const source = {
|
|
35
|
+
...frame,
|
|
36
|
+
previous: undefined,
|
|
37
|
+
current: frame.previous,
|
|
38
|
+
next: frame.current,
|
|
39
|
+
layouts: frame.previous.layouts,
|
|
40
|
+
};
|
|
41
|
+
updateDerivations(source);
|
|
42
|
+
return source;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function runBoundaryInterpolator(
|
|
46
|
+
interpolator: ScreenStyleInterpolator,
|
|
47
|
+
frame: ScreenInterpolatorFrame,
|
|
48
|
+
side: "source" | "destination",
|
|
49
|
+
) {
|
|
50
|
+
"worklet";
|
|
51
|
+
const raw = interpolator(
|
|
52
|
+
createInterpolatorScope({
|
|
53
|
+
frame,
|
|
54
|
+
selectedFrame: selectInterpolatorFrame(frame, side === "destination"),
|
|
55
|
+
}),
|
|
56
|
+
);
|
|
57
|
+
return raw && typeof raw === "object"
|
|
58
|
+
? normalizeSlots(stripInterpolatorOptions(raw))
|
|
59
|
+
: NO_STYLES;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Each destination owns the output of its incoming pair, even when its source
|
|
63
|
+
// has moved on to another route. All boundaries read this same UI value.
|
|
64
|
+
export function usePairPresentation({
|
|
65
|
+
screenInterpolatorProps,
|
|
66
|
+
currentInterpolator,
|
|
67
|
+
}: ScreenAnimationPipeline) {
|
|
68
|
+
const pairKey = useBuilderStore((s) => s.derivations.destinationPairKey);
|
|
69
|
+
const ready = useMotionStore((s) => s.isScreenReady);
|
|
70
|
+
return useDerivedValue(() => {
|
|
71
|
+
const links = pairKey ? pairs.get()[pairKey]?.links : undefined;
|
|
72
|
+
if (!pairKey || !links || !currentInterpolator) return undefined;
|
|
73
|
+
let hasPortal = false;
|
|
74
|
+
for (const key in links) {
|
|
75
|
+
const { source, destination } = links[key];
|
|
76
|
+
if (
|
|
77
|
+
source?.handoff ||
|
|
78
|
+
source?.escapeClipping ||
|
|
79
|
+
destination?.handoff ||
|
|
80
|
+
destination?.escapeClipping
|
|
81
|
+
) {
|
|
82
|
+
hasPortal = true;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (!hasPortal) return undefined;
|
|
87
|
+
const frame = screenInterpolatorProps.get();
|
|
88
|
+
const source = boundarySourceFrame(frame);
|
|
89
|
+
if (!source) return undefined;
|
|
90
|
+
return {
|
|
91
|
+
pairKey,
|
|
92
|
+
sourceKey: source.current.route.key,
|
|
93
|
+
destinationKey: frame.current.route.key,
|
|
94
|
+
ready: ready.get(),
|
|
95
|
+
source: runBoundaryInterpolator(currentInterpolator, source, "source"),
|
|
96
|
+
destination: runBoundaryInterpolator(
|
|
97
|
+
currentInterpolator,
|
|
98
|
+
frame,
|
|
99
|
+
"destination",
|
|
100
|
+
),
|
|
101
|
+
} satisfies BoundaryPairPresentation;
|
|
102
|
+
});
|
|
103
|
+
}
|
|
@@ -7,6 +7,7 @@ import createProvider from "../../../utils/create-provider";
|
|
|
7
7
|
import { useBuilderStore } from "../builder";
|
|
8
8
|
import { useMotionStore } from "../motion";
|
|
9
9
|
import { useScreenAnimationPipeline } from "./helpers/pipeline";
|
|
10
|
+
import { usePairPresentation } from "./helpers/use-pair-presentation";
|
|
10
11
|
import { useRegisterGestureOwnership } from "./hooks/use-register-gesture-ownership";
|
|
11
12
|
import { useInterpolatedStylesMap } from "./styles/hooks/use-interpolated-style-maps";
|
|
12
13
|
import { useResolvedStylesMap } from "./styles/hooks/use-resolved-slot-style-map";
|
|
@@ -21,6 +22,7 @@ export type OrchestratorState = ReturnType<
|
|
|
21
22
|
typeof useScreenAnimationPipeline
|
|
22
23
|
> & {
|
|
23
24
|
boundsAccessor: BoundsAccessor;
|
|
25
|
+
pairPresentation: ReturnType<typeof usePairPresentation>;
|
|
24
26
|
slotsMap: SharedValue<NormalizedTransitionInterpolatedStyle>;
|
|
25
27
|
};
|
|
26
28
|
|
|
@@ -37,6 +39,7 @@ export const {
|
|
|
37
39
|
const gestures = useMotionStore((store) => store.gestures);
|
|
38
40
|
|
|
39
41
|
const pipeline = useScreenAnimationPipeline();
|
|
42
|
+
const pairPresentation = usePairPresentation(pipeline);
|
|
40
43
|
|
|
41
44
|
const localStylesMaps = useInterpolatedStylesMap({ pipeline });
|
|
42
45
|
const slotsMap = useResolvedStylesMap({ localStylesMaps });
|
|
@@ -62,6 +65,7 @@ export const {
|
|
|
62
65
|
key: currentScreenKey,
|
|
63
66
|
value: {
|
|
64
67
|
...pipeline,
|
|
68
|
+
pairPresentation,
|
|
65
69
|
boundsAccessor,
|
|
66
70
|
slotsMap,
|
|
67
71
|
},
|