react-native-screen-transitions 3.13.0-beta.0 → 3.13.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/README.md +14 -0
- package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js +1 -2
- package/lib/commonjs/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
- package/lib/commonjs/shared/components/activity/helpers.js +50 -1
- package/lib/commonjs/shared/components/activity/helpers.js.map +1 -1
- package/lib/commonjs/shared/components/activity/variants/activity-screen.js +16 -67
- package/lib/commonjs/shared/components/activity/variants/activity-screen.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js +1 -1
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js +5 -1
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +2 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +8 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +3 -4
- 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-portal/hooks/use-boundary-portal-attachment.js +1 -6
- 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/teleport.js +1 -13
- package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +6 -6
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/helpers/create-overlay-interpolator-frame.js +9 -2
- package/lib/commonjs/shared/components/overlay/helpers/create-overlay-interpolator-frame.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +16 -4
- package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/hooks/use-overlay-slot.js +11 -6
- package/lib/commonjs/shared/components/overlay/hooks/use-overlay-slot.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +5 -4
- package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +1 -3
- package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +8 -6
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
- package/lib/commonjs/shared/factories/screen-topology/create-screen-topology.js +147 -0
- package/lib/commonjs/shared/factories/screen-topology/create-screen-topology.js.map +1 -0
- package/lib/commonjs/shared/factories/screen-topology/index.js +45 -0
- package/lib/commonjs/shared/factories/screen-topology/index.js.map +1 -0
- package/lib/commonjs/shared/factories/screen-topology/types.js +2 -0
- package/lib/commonjs/shared/factories/screen-topology/types.js.map +1 -0
- package/lib/commonjs/shared/factories/screen-topology/use-screen-relationships.js +15 -0
- package/lib/commonjs/shared/factories/screen-topology/use-screen-relationships.js.map +1 -0
- package/lib/commonjs/shared/factories/screen-topology/worklet.js +55 -0
- package/lib/commonjs/shared/factories/screen-topology/worklet.js.map +1 -0
- package/lib/commonjs/shared/hooks/navigation/use-screen-state.js.map +1 -1
- package/lib/commonjs/shared/hooks/navigation/use-stack.js +16 -16
- package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/animation.provider.js +26 -98
- package/lib/commonjs/shared/providers/screen/animation/animation.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +6 -52
- package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +14 -25
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js +4 -13
- package/lib/commonjs/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js +10 -26
- package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +0 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/index.js +6 -0
- package/lib/commonjs/shared/providers/screen/animation/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js +8 -7
- package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js +40 -25
- package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +1 -4
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js +24 -19
- package/lib/commonjs/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js +3 -3
- package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture.js +2 -3
- package/lib/commonjs/shared/providers/screen/gestures/hooks/use-screen-gesture.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/index.js +8 -2
- package/lib/commonjs/shared/providers/screen/gestures/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.js +11 -18
- package/lib/commonjs/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/ownership/resolve-ownership.js +5 -7
- package/lib/commonjs/shared/providers/screen/gestures/ownership/resolve-ownership.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +4 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.js +5 -8
- package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +5 -4
- package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/walk-up-scroll-gesture-coordination.js +1 -3
- package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/walk-up-scroll-gesture-coordination.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js +4 -4
- package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js +4 -2
- package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +5 -8
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/index.js +8 -2
- package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +17 -19
- package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/use-current-screen-relationships.js +14 -0
- package/lib/commonjs/shared/providers/screen/use-current-screen-relationships.js.map +1 -0
- package/lib/commonjs/shared/providers/stack/blank-stack.provider.js +13 -5
- package/lib/commonjs/shared/providers/stack/blank-stack.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/core.provider.js +1 -3
- package/lib/commonjs/shared/providers/stack/core.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/direct.provider.js +2 -5
- package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
- package/lib/commonjs/shared/stores/animation.store.js +0 -2
- package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/coordinator.js +23 -9
- package/lib/commonjs/shared/stores/bounds/internals/coordinator.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/links.js +2 -2
- package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/state.js +1 -1
- package/lib/commonjs/shared/utils/create-provider.js +51 -100
- package/lib/commonjs/shared/utils/create-provider.js.map +1 -1
- package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js +1 -2
- package/lib/module/shared/adapters/with-screen-transitions/stack-layout.js.map +1 -1
- package/lib/module/shared/components/activity/helpers.js +48 -0
- package/lib/module/shared/components/activity/helpers.js.map +1 -1
- package/lib/module/shared/components/activity/variants/activity-screen.js +17 -68
- package/lib/module/shared/components/activity/variants/activity-screen.js.map +1 -1
- package/lib/module/shared/components/boundary/components/boundary-target.js +2 -2
- package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/module/shared/components/boundary/create-boundary-component.js +6 -2
- package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-measurer.js +3 -2
- package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js +8 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +4 -5
- 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-portal/hooks/use-boundary-portal-attachment.js +2 -7
- 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/teleport.js +1 -14
- package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +5 -6
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/module/shared/components/overlay/helpers/create-overlay-interpolator-frame.js +7 -1
- package/lib/module/shared/components/overlay/helpers/create-overlay-interpolator-frame.js.map +1 -1
- package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +16 -4
- package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
- package/lib/module/shared/components/overlay/hooks/use-overlay-slot.js +12 -7
- package/lib/module/shared/components/overlay/hooks/use-overlay-slot.js.map +1 -1
- package/lib/module/shared/components/overlay/variations/overlay-host.js +7 -6
- package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +2 -3
- package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +9 -7
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -1
- package/lib/module/shared/factories/screen-topology/create-screen-topology.js +142 -0
- package/lib/module/shared/factories/screen-topology/create-screen-topology.js.map +1 -0
- package/lib/module/shared/factories/screen-topology/index.js +6 -0
- package/lib/module/shared/factories/screen-topology/index.js.map +1 -0
- package/lib/module/shared/factories/screen-topology/types.js +2 -0
- package/lib/module/shared/factories/screen-topology/types.js.map +1 -0
- package/lib/module/shared/factories/screen-topology/use-screen-relationships.js +10 -0
- package/lib/module/shared/factories/screen-topology/use-screen-relationships.js.map +1 -0
- package/lib/module/shared/factories/screen-topology/worklet.js +48 -0
- package/lib/module/shared/factories/screen-topology/worklet.js.map +1 -0
- package/lib/module/shared/hooks/navigation/use-screen-state.js.map +1 -1
- package/lib/module/shared/hooks/navigation/use-stack.js +17 -18
- package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/animation.provider.js +25 -98
- package/lib/module/shared/providers/screen/animation/animation.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +6 -52
- package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +16 -27
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js +4 -13
- package/lib/module/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js +9 -24
- package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +0 -1
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/index.js +1 -1
- package/lib/module/shared/providers/screen/animation/index.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/use-screen-animation.js +9 -8
- package/lib/module/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
- package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js +43 -27
- package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +1 -4
- package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/gestures.provider.js +21 -17
- package/lib/module/shared/providers/screen/gestures/gestures.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js +3 -3
- package/lib/module/shared/providers/screen/gestures/hooks/use-screen-gesture-config.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/hooks/use-screen-gesture.js +3 -4
- package/lib/module/shared/providers/screen/gestures/hooks/use-screen-gesture.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/index.js +1 -1
- package/lib/module/shared/providers/screen/gestures/index.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.js +13 -20
- package/lib/module/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/ownership/resolve-ownership.js +5 -7
- package/lib/module/shared/providers/screen/gestures/ownership/resolve-ownership.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +4 -1
- package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.js +4 -8
- package/lib/module/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +7 -6
- package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/scroll-coordination/walk-up-scroll-gesture-coordination.js +1 -3
- package/lib/module/shared/providers/screen/gestures/scroll-coordination/walk-up-scroll-gesture-coordination.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/policy.js +4 -4
- package/lib/module/shared/providers/screen/gestures/shared/policy.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js +5 -3
- package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +5 -8
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/index.js +1 -1
- package/lib/module/shared/providers/screen/styles/index.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/slot.provider.js +14 -16
- package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/use-current-screen-relationships.js +9 -0
- package/lib/module/shared/providers/screen/use-current-screen-relationships.js.map +1 -0
- package/lib/module/shared/providers/stack/blank-stack.provider.js +12 -5
- package/lib/module/shared/providers/stack/blank-stack.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/core.provider.js +1 -3
- package/lib/module/shared/providers/stack/core.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/direct.provider.js +2 -5
- package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
- package/lib/module/shared/stores/animation.store.js +0 -2
- package/lib/module/shared/stores/animation.store.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/coordinator.js +18 -4
- package/lib/module/shared/stores/bounds/internals/coordinator.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/links.js +1 -1
- package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/state.js +1 -1
- package/lib/module/shared/utils/create-provider.js +51 -100
- package/lib/module/shared/utils/create-provider.js.map +1 -1
- package/lib/typescript/native-stack/views/useHeaderConfigProps.d.ts +1 -1
- package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts.map +1 -1
- package/lib/typescript/shared/components/activity/helpers.d.ts +16 -0
- package/lib/typescript/shared/components/activity/helpers.d.ts.map +1 -1
- package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts +2 -4
- package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.d.ts +2 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.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-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts +2 -2
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -1
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +3 -0
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/helpers/create-overlay-interpolator-frame.d.ts +1 -0
- package/lib/typescript/shared/components/overlay/helpers/create-overlay-interpolator-frame.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/hooks/use-overlay-slot.d.ts +3 -2
- package/lib/typescript/shared/components/overlay/hooks/use-overlay-slot.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts.map +1 -1
- package/lib/typescript/shared/factories/screen-topology/create-screen-topology.d.ts +4 -0
- package/lib/typescript/shared/factories/screen-topology/create-screen-topology.d.ts.map +1 -0
- package/lib/typescript/shared/factories/screen-topology/index.d.ts +5 -0
- package/lib/typescript/shared/factories/screen-topology/index.d.ts.map +1 -0
- package/lib/typescript/shared/factories/screen-topology/types.d.ts +20 -0
- package/lib/typescript/shared/factories/screen-topology/types.d.ts.map +1 -0
- package/lib/typescript/shared/factories/screen-topology/use-screen-relationships.d.ts +5 -0
- package/lib/typescript/shared/factories/screen-topology/use-screen-relationships.d.ts.map +1 -0
- package/lib/typescript/shared/factories/screen-topology/worklet.d.ts +5 -0
- package/lib/typescript/shared/factories/screen-topology/worklet.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/navigation/use-screen-state.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +2 -0
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +0 -6
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts +14 -12
- package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.d.ts +4 -4
- package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts +0 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts +1 -2
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/read-screen-animation-revisions.d.ts +2 -2
- package/lib/typescript/shared/providers/screen/animation/helpers/read-screen-animation-revisions.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts +5 -2
- package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +0 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/index.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/animation/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/types.d.ts +1 -13
- package/lib/typescript/shared/providers/screen/animation/types.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts +5 -2
- package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts +1 -4
- package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/gestures.provider.d.ts +16 -4
- package/lib/typescript/shared/providers/screen/gestures/gestures.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/hooks/use-screen-gesture-config.d.ts +2 -2
- package/lib/typescript/shared/providers/screen/gestures/hooks/use-screen-gesture-config.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/hooks/use-screen-gesture.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/index.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/gestures/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/ownership/resolve-ownership.d.ts +2 -3
- package/lib/typescript/shared/providers/screen/gestures/ownership/resolve-ownership.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.d.ts +5 -3
- package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.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/scroll-coordination/walk-up-scroll-gesture-coordination.d.ts +2 -2
- package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/walk-up-scroll-gesture-coordination.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts +3 -3
- package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/types.d.ts +4 -2
- package/lib/typescript/shared/providers/screen/gestures/types.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts +4 -4
- package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +2 -2
- package/lib/typescript/shared/providers/screen/styles/index.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +9 -4
- package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/use-current-screen-relationships.d.ts +5 -0
- package/lib/typescript/shared/providers/screen/use-current-screen-relationships.d.ts.map +1 -0
- package/lib/typescript/shared/providers/stack/blank-stack.provider.d.ts +4 -1
- package/lib/typescript/shared/providers/stack/blank-stack.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/stack/core.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/stack/direct.provider.d.ts.map +1 -1
- package/lib/typescript/shared/stores/animation.store.d.ts +0 -1
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/coordinator.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/state.d.ts +1 -1
- package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts +0 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- package/lib/typescript/shared/types/providers/blank-stack-provider.types.d.ts +1 -0
- package/lib/typescript/shared/types/providers/blank-stack-provider.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +0 -9
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/create-provider.d.ts +24 -24
- package/lib/typescript/shared/utils/create-provider.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/shared/adapters/with-screen-transitions/stack-layout.tsx +1 -2
- package/src/shared/components/activity/helpers.ts +59 -0
- package/src/shared/components/activity/variants/activity-screen.tsx +28 -93
- package/src/shared/components/boundary/components/boundary-target.tsx +2 -2
- package/src/shared/components/boundary/create-boundary-component.tsx +10 -2
- package/src/shared/components/boundary/hooks/use-measurer.ts +3 -2
- package/src/shared/components/boundary/portal/components/boundary-content-portal/helpers/active-handoff-receiver.ts +22 -0
- package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +7 -3
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +2 -6
- package/src/shared/components/boundary/portal/teleport.ts +2 -23
- package/src/shared/components/boundary/providers/boundary-root.provider.tsx +10 -6
- package/src/shared/components/overlay/helpers/create-overlay-interpolator-frame.ts +14 -1
- package/src/shared/components/overlay/helpers/get-active-overlay.ts +29 -4
- package/src/shared/components/overlay/hooks/use-overlay-slot.ts +26 -8
- package/src/shared/components/overlay/variations/overlay-host.tsx +11 -6
- package/src/shared/components/screen-container/layers/content.tsx +3 -4
- package/src/shared/components/screen-lifecycle/hooks/use-close-transition-intent.ts +8 -12
- package/src/shared/factories/screen-topology/create-screen-topology.ts +199 -0
- package/src/shared/factories/screen-topology/index.ts +16 -0
- package/src/shared/factories/screen-topology/types.ts +22 -0
- package/src/shared/factories/screen-topology/use-screen-relationships.ts +15 -0
- package/src/shared/factories/screen-topology/worklet.ts +60 -0
- package/src/shared/hooks/navigation/use-screen-state.ts +2 -7
- package/src/shared/hooks/navigation/use-stack.tsx +28 -31
- package/src/shared/providers/screen/animation/animation.provider.tsx +73 -212
- package/src/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.ts +10 -81
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/types.ts +0 -1
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +45 -70
- package/src/shared/providers/screen/animation/helpers/read-screen-animation-revisions.ts +6 -30
- package/src/shared/providers/screen/animation/helpers/stack-progress.ts +13 -32
- package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +0 -2
- package/src/shared/providers/screen/animation/index.tsx +1 -0
- package/src/shared/providers/screen/animation/types.ts +1 -23
- package/src/shared/providers/screen/animation/use-screen-animation.tsx +10 -14
- package/src/shared/providers/screen/descriptors/descriptors.provider.tsx +56 -35
- package/src/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.ts +0 -6
- package/src/shared/providers/screen/gestures/gestures.provider.tsx +96 -85
- package/src/shared/providers/screen/gestures/hooks/use-screen-gesture-config.ts +4 -4
- package/src/shared/providers/screen/gestures/hooks/use-screen-gesture.ts +3 -4
- package/src/shared/providers/screen/gestures/index.tsx +2 -1
- package/src/shared/providers/screen/gestures/ownership/gesture-ownership-bridge.tsx +16 -29
- package/src/shared/providers/screen/gestures/ownership/resolve-ownership.ts +5 -8
- package/src/shared/providers/screen/gestures/pan/activation/use-pan-activation.ts +2 -3
- package/src/shared/providers/screen/gestures/scroll-coordination/scroll-metadata-owner.tsx +6 -9
- package/src/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.ts +11 -7
- package/src/shared/providers/screen/gestures/scroll-coordination/walk-up-scroll-gesture-coordination.ts +12 -12
- package/src/shared/providers/screen/gestures/shared/policy.ts +7 -7
- package/src/shared/providers/screen/gestures/types.ts +5 -2
- package/src/shared/providers/screen/styles/hooks/slot-resolvers.tsx +10 -3
- package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +7 -17
- package/src/shared/providers/screen/styles/index.tsx +2 -1
- package/src/shared/providers/screen/styles/slot.provider.tsx +25 -24
- package/src/shared/providers/screen/use-current-screen-relationships.ts +10 -0
- package/src/shared/providers/stack/blank-stack.provider.tsx +19 -6
- package/src/shared/providers/stack/core.provider.tsx +0 -1
- package/src/shared/providers/stack/direct.provider.tsx +2 -4
- package/src/shared/stores/animation.store.ts +0 -3
- package/src/shared/stores/bounds/internals/coordinator.ts +20 -8
- package/src/shared/stores/bounds/internals/links.ts +1 -1
- package/src/shared/stores/bounds/internals/state.ts +1 -1
- package/src/shared/stores/bounds/types.ts +0 -1
- package/src/shared/types/providers/blank-stack-provider.types.ts +1 -0
- package/src/shared/types/screen.types.ts +0 -10
- package/src/shared/utils/create-provider.tsx +135 -200
- package/lib/commonjs/shared/providers/screen/animation/helpers/interpolator-participation.js +0 -9
- package/lib/commonjs/shared/providers/screen/animation/helpers/interpolator-participation.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js +0 -12
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/ancestors.js +0 -23
- package/lib/commonjs/shared/providers/screen/gestures/shared/ancestors.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/internals/screen-graph.js +0 -45
- package/lib/commonjs/shared/stores/bounds/internals/screen-graph.js.map +0 -1
- package/lib/module/shared/providers/screen/animation/helpers/interpolator-participation.js +0 -4
- package/lib/module/shared/providers/screen/animation/helpers/interpolator-participation.js.map +0 -1
- package/lib/module/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js +0 -7
- package/lib/module/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.js.map +0 -1
- package/lib/module/shared/providers/screen/gestures/shared/ancestors.js +0 -19
- package/lib/module/shared/providers/screen/gestures/shared/ancestors.js.map +0 -1
- package/lib/module/shared/stores/bounds/internals/screen-graph.js +0 -39
- package/lib/module/shared/stores/bounds/internals/screen-graph.js.map +0 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/interpolator-participation.d.ts +0 -3
- package/lib/typescript/shared/providers/screen/animation/helpers/interpolator-participation.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.d.ts +0 -5
- package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/ancestors.d.ts +0 -11
- package/lib/typescript/shared/providers/screen/gestures/shared/ancestors.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/internals/screen-graph.d.ts +0 -5
- package/lib/typescript/shared/stores/bounds/internals/screen-graph.d.ts.map +0 -1
- package/src/shared/providers/screen/animation/helpers/interpolator-participation.ts +0 -6
- package/src/shared/providers/screen/descriptors/helpers/derive-structural-ancestor-keys.ts +0 -13
- package/src/shared/providers/screen/gestures/shared/ancestors.ts +0 -27
- package/src/shared/stores/bounds/internals/screen-graph.ts +0 -45
|
@@ -10,15 +10,14 @@ import {
|
|
|
10
10
|
type BaseDescriptor,
|
|
11
11
|
useDescriptorsStore,
|
|
12
12
|
} from "../../../screen/descriptors";
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { walkGestureAncestors } from "../shared/ancestors";
|
|
13
|
+
import { useOptionalBlankStackStore } from "../../../stack/blank-stack.provider";
|
|
14
|
+
import { useScreenGestureStore } from "../gestures.provider";
|
|
16
15
|
import { resolveScreenGestureConfig } from "../shared/policy";
|
|
17
|
-
import type {
|
|
16
|
+
import type { ScreenGestureSource } from "../types";
|
|
18
17
|
import { resolveShadowingClaimDirections } from "./shadowing-claims";
|
|
19
18
|
|
|
20
19
|
type ShadowedAncestor = {
|
|
21
|
-
ancestor:
|
|
20
|
+
ancestor: ScreenGestureSource;
|
|
22
21
|
directions: Direction[];
|
|
23
22
|
};
|
|
24
23
|
|
|
@@ -40,15 +39,15 @@ const findShadowedDirections = (
|
|
|
40
39
|
};
|
|
41
40
|
|
|
42
41
|
const findShadowedAncestors = (
|
|
43
|
-
|
|
42
|
+
ancestorGestures: readonly ScreenGestureSource[],
|
|
44
43
|
claimedDirections: ClaimedDirections,
|
|
45
44
|
) => {
|
|
46
|
-
if (
|
|
45
|
+
if (ancestorGestures.length === 0) {
|
|
47
46
|
return NO_SHADOWED_ANCESTORS;
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
const ancestors: ShadowedAncestor[] = [];
|
|
51
|
-
for (const ancestor of
|
|
50
|
+
for (const ancestor of ancestorGestures) {
|
|
52
51
|
const directions = findShadowedDirections(
|
|
53
52
|
claimedDirections,
|
|
54
53
|
ancestor.claimedDirections,
|
|
@@ -107,7 +106,7 @@ const getDescriptorIsFirstKey = (descriptor: BaseDescriptor): boolean => {
|
|
|
107
106
|
|
|
108
107
|
const getDescriptorClaimedDirections = (
|
|
109
108
|
descriptor: BaseDescriptor | undefined,
|
|
110
|
-
|
|
109
|
+
ancestorGestures: readonly ScreenGestureSource[],
|
|
111
110
|
): ClaimedDirections => {
|
|
112
111
|
if (!descriptor) {
|
|
113
112
|
return NO_CLAIMS;
|
|
@@ -116,32 +115,20 @@ const getDescriptorClaimedDirections = (
|
|
|
116
115
|
return resolveScreenGestureConfig({
|
|
117
116
|
options: descriptor.options,
|
|
118
117
|
isFirstKey: getDescriptorIsFirstKey(descriptor),
|
|
119
|
-
|
|
118
|
+
ancestorGestures,
|
|
120
119
|
}).participation.claimedDirections;
|
|
121
120
|
};
|
|
122
121
|
|
|
123
|
-
const requireGestureContext = (
|
|
124
|
-
gestureContext: GestureContextType | null,
|
|
125
|
-
): GestureContextType => {
|
|
126
|
-
if (!gestureContext) {
|
|
127
|
-
throw new Error(
|
|
128
|
-
"GestureOwnershipBridge must be rendered within a ScreenGestureProvider",
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return gestureContext;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
122
|
function ActiveGestureOwnershipBridge() {
|
|
136
|
-
const gestureContext =
|
|
123
|
+
const gestureContext = useScreenGestureStore();
|
|
137
124
|
const previous = useDescriptorsStore((store) => store.previous);
|
|
138
|
-
const isCurrentScreenClosing =
|
|
125
|
+
const isCurrentScreenClosing = useOptionalBlankStackStore(
|
|
139
126
|
(store) =>
|
|
140
127
|
store?.scenesByKey[gestureContext.routeKey]?.activity === "closing",
|
|
141
128
|
);
|
|
142
129
|
const {
|
|
143
130
|
claimedDirections,
|
|
144
|
-
|
|
131
|
+
ancestorGestures,
|
|
145
132
|
routeKey: currentScreenKey,
|
|
146
133
|
} = gestureContext;
|
|
147
134
|
// A retained closing screen cannot receive touches, so its ownership must
|
|
@@ -153,14 +140,14 @@ function ActiveGestureOwnershipBridge() {
|
|
|
153
140
|
currentClaimedDirections: claimedDirections,
|
|
154
141
|
previousClaimedDirections: getDescriptorClaimedDirections(
|
|
155
142
|
previous,
|
|
156
|
-
|
|
143
|
+
ancestorGestures,
|
|
157
144
|
),
|
|
158
145
|
}),
|
|
159
|
-
[isCurrentScreenClosing, claimedDirections, previous,
|
|
146
|
+
[isCurrentScreenClosing, claimedDirections, previous, ancestorGestures],
|
|
160
147
|
);
|
|
161
148
|
const shadowedAncestors = useMemo(
|
|
162
|
-
() => findShadowedAncestors(
|
|
163
|
-
[
|
|
149
|
+
() => findShadowedAncestors(ancestorGestures, effectiveClaimedDirections),
|
|
150
|
+
[ancestorGestures, effectiveClaimedDirections],
|
|
164
151
|
);
|
|
165
152
|
|
|
166
153
|
useLayoutEffect(() => {
|
|
@@ -16,7 +16,6 @@ import type { DirectionClaim } from "../types";
|
|
|
16
16
|
*/
|
|
17
17
|
interface AncestorClaimsContext {
|
|
18
18
|
claimedDirections: ClaimedDirections;
|
|
19
|
-
gestureContext: AncestorClaimsContext | null;
|
|
20
19
|
}
|
|
21
20
|
|
|
22
21
|
/**
|
|
@@ -31,12 +30,12 @@ interface AncestorClaimsContext {
|
|
|
31
30
|
* used in worklets since it's a plain object.
|
|
32
31
|
*
|
|
33
32
|
* @param selfClaims - The directions claimed by the current screen
|
|
34
|
-
* @param
|
|
33
|
+
* @param ancestors - Nearest-first ancestor gesture values from screen topology.
|
|
35
34
|
* @returns Ownership status for all four directions
|
|
36
35
|
*/
|
|
37
36
|
export function resolveOwnership(
|
|
38
37
|
selfClaims: ClaimedDirections,
|
|
39
|
-
|
|
38
|
+
ancestors: readonly AncestorClaimsContext[],
|
|
40
39
|
): DirectionOwnership {
|
|
41
40
|
const result: DirectionOwnership = { ...NO_OWNERSHIP };
|
|
42
41
|
|
|
@@ -44,7 +43,7 @@ export function resolveOwnership(
|
|
|
44
43
|
result[direction] = resolveDirectionOwnership(
|
|
45
44
|
direction,
|
|
46
45
|
selfClaims,
|
|
47
|
-
|
|
46
|
+
ancestors,
|
|
48
47
|
);
|
|
49
48
|
}
|
|
50
49
|
|
|
@@ -57,7 +56,7 @@ export function resolveOwnership(
|
|
|
57
56
|
function resolveDirectionOwnership(
|
|
58
57
|
direction: Direction,
|
|
59
58
|
selfClaims: ClaimedDirections,
|
|
60
|
-
|
|
59
|
+
ancestors: readonly AncestorClaimsContext[],
|
|
61
60
|
): OwnershipStatus {
|
|
62
61
|
// Check self first
|
|
63
62
|
if (selfClaims[direction]) {
|
|
@@ -65,12 +64,10 @@ function resolveDirectionOwnership(
|
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
// Walk ancestors looking for a claim
|
|
68
|
-
|
|
69
|
-
while (ancestor) {
|
|
67
|
+
for (const ancestor of ancestors) {
|
|
70
68
|
if (ancestor.claimedDirections?.[direction]) {
|
|
71
69
|
return "ancestor";
|
|
72
70
|
}
|
|
73
|
-
ancestor = ancestor.gestureContext;
|
|
74
71
|
}
|
|
75
72
|
|
|
76
73
|
// No one claims this direction
|
|
@@ -9,6 +9,7 @@ import { GestureActivationState } from "../../../../../types/gesture.types";
|
|
|
9
9
|
import type { Direction } from "../../../../../types/ownership.types";
|
|
10
10
|
import { useDescriptorsStore } from "../../../descriptors";
|
|
11
11
|
import type { ScreenOptionsContextValue } from "../../../options";
|
|
12
|
+
import { useCurrentScreenRelationships } from "../../../use-current-screen-relationships";
|
|
12
13
|
import { resolvePanRuntime } from "../../shared/runtime";
|
|
13
14
|
import type {
|
|
14
15
|
DirectionClaimMap,
|
|
@@ -39,9 +40,7 @@ export const usePanActivation = ({
|
|
|
39
40
|
const currentScreenKey = useDescriptorsStore(
|
|
40
41
|
(store) => store.derivations.currentScreenKey,
|
|
41
42
|
);
|
|
42
|
-
const parentScreenKey =
|
|
43
|
-
(store) => store.derivations.parentScreenKey,
|
|
44
|
-
);
|
|
43
|
+
const { parentScreenKey } = useCurrentScreenRelationships();
|
|
45
44
|
|
|
46
45
|
const ancestorDismissing = useMemo(() => {
|
|
47
46
|
if (!parentScreenKey) return null;
|
|
@@ -14,21 +14,20 @@ const DEFAULT_SCROLL_METADATA_OWNER_CONTEXT: ScrollMetadataOwnerContextValue = {
|
|
|
14
14
|
horizontal: false,
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
const {
|
|
17
|
+
export const {
|
|
18
18
|
ScrollMetadataOwnerProvider,
|
|
19
|
-
|
|
20
|
-
} = createProvider("ScrollMetadataOwner"
|
|
19
|
+
useOptionalScrollMetadataOwnerStore,
|
|
20
|
+
} = createProvider("ScrollMetadataOwner")<
|
|
21
21
|
ScrollMetadataOwnerProviderProps,
|
|
22
22
|
ScrollMetadataOwnerContextValue
|
|
23
23
|
>(({ children, value }) => ({ children, value }));
|
|
24
24
|
|
|
25
|
-
export const useScrollMetadataOwnerStore = () =>
|
|
26
|
-
useMaybeScrollMetadataOwnerStore() ?? DEFAULT_SCROLL_METADATA_OWNER_CONTEXT;
|
|
27
|
-
|
|
28
25
|
export const useScrollMetadataOwnerProviderValue = (
|
|
29
26
|
axis: ScrollGestureAxis,
|
|
30
27
|
) => {
|
|
31
|
-
const parent =
|
|
28
|
+
const parent =
|
|
29
|
+
useOptionalScrollMetadataOwnerStore() ??
|
|
30
|
+
DEFAULT_SCROLL_METADATA_OWNER_CONTEXT;
|
|
32
31
|
|
|
33
32
|
return useMemo(() => {
|
|
34
33
|
if (parent[axis]) return parent;
|
|
@@ -39,5 +38,3 @@ export const useScrollMetadataOwnerProviderValue = (
|
|
|
39
38
|
};
|
|
40
39
|
}, [axis, parent]);
|
|
41
40
|
};
|
|
42
|
-
|
|
43
|
-
export { ScrollMetadataOwnerProvider };
|
package/src/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { useSharedValueState } from "../../../../hooks/reanimated/use-shared-val
|
|
|
10
10
|
import useStableCallback from "../../../../hooks/use-stable-callback";
|
|
11
11
|
import { AnimationStore } from "../../../../stores/animation.store";
|
|
12
12
|
import { ScrollStore } from "../../../../stores/scroll.store";
|
|
13
|
-
import {
|
|
13
|
+
import { useOptionalScreenGestureStore } from "../gestures.provider";
|
|
14
14
|
import type {
|
|
15
15
|
ScrollGestureAxis,
|
|
16
16
|
ScrollGestureAxisState,
|
|
@@ -18,8 +18,8 @@ import type {
|
|
|
18
18
|
ScrollMetadataState,
|
|
19
19
|
} from "../types";
|
|
20
20
|
import {
|
|
21
|
+
useOptionalScrollMetadataOwnerStore,
|
|
21
22
|
useScrollMetadataOwnerProviderValue,
|
|
22
|
-
useScrollMetadataOwnerStore,
|
|
23
23
|
} from "./scroll-metadata-owner";
|
|
24
24
|
import {
|
|
25
25
|
clearScrollMetadataAxisState,
|
|
@@ -88,21 +88,25 @@ const clearScrollMetadataAxis = (
|
|
|
88
88
|
export const useScrollGestureCoordination = (
|
|
89
89
|
props: ScrollGestureCoordinationProps,
|
|
90
90
|
) => {
|
|
91
|
-
const context =
|
|
91
|
+
const context = useOptionalScreenGestureStore();
|
|
92
92
|
const scrollDirection = props.direction ?? "vertical";
|
|
93
|
+
const gesturePath = useMemo(
|
|
94
|
+
() => (context ? [context, ...context.ancestorGestures] : []),
|
|
95
|
+
[context],
|
|
96
|
+
);
|
|
93
97
|
|
|
94
|
-
const metadataOwnerContext =
|
|
98
|
+
const metadataOwnerContext = useOptionalScrollMetadataOwnerStore();
|
|
95
99
|
const metadataOwnerProviderValue =
|
|
96
100
|
useScrollMetadataOwnerProviderValue(scrollDirection);
|
|
97
|
-
const isFirstMetadataWriterInTree = !metadataOwnerContext[scrollDirection];
|
|
101
|
+
const isFirstMetadataWriterInTree = !metadataOwnerContext?.[scrollDirection];
|
|
98
102
|
const [metadataWriterId] = useState(() =>
|
|
99
103
|
ScrollStore.createMetadataWriterId(),
|
|
100
104
|
);
|
|
101
105
|
const [writesMetadata, setWritesMetadata] = useState(false);
|
|
102
106
|
|
|
103
107
|
const { scrollStates, panGestures, pinchGestures, ownerRouteKeys } = useMemo(
|
|
104
|
-
() => walkUpScrollGestureCoordination(
|
|
105
|
-
[
|
|
108
|
+
() => walkUpScrollGestureCoordination(gesturePath, scrollDirection),
|
|
109
|
+
[gesturePath, scrollDirection],
|
|
106
110
|
);
|
|
107
111
|
|
|
108
112
|
const routeKey = context?.routeKey;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
import type { SharedValue } from "react-native-reanimated";
|
|
2
2
|
import type { Direction } from "../../../../types/ownership.types";
|
|
3
|
-
import { walkGestureAncestors } from "../shared/ancestors";
|
|
4
3
|
import type {
|
|
5
|
-
GestureContextType,
|
|
6
4
|
PanGesture,
|
|
7
5
|
PinchGesture,
|
|
6
|
+
ScreenGestureSource,
|
|
8
7
|
ScrollGestureAxis,
|
|
9
8
|
ScrollGestureState,
|
|
10
9
|
} from "../types";
|
|
11
10
|
|
|
12
11
|
/** Walks up the gesture tree until it finds the owner for a specific direction. */
|
|
13
12
|
function findGestureOwnerForDirection(
|
|
14
|
-
ancestors:
|
|
13
|
+
ancestors: readonly ScreenGestureSource[],
|
|
15
14
|
direction: Direction,
|
|
16
|
-
):
|
|
15
|
+
): ScreenGestureSource | null {
|
|
17
16
|
for (const ancestor of ancestors) {
|
|
18
17
|
if (ancestor.claimedDirections?.[direction]) return ancestor;
|
|
19
18
|
}
|
|
@@ -28,8 +27,10 @@ const getDirectionsForAxis = (
|
|
|
28
27
|
? ["vertical", "vertical-inverted"]
|
|
29
28
|
: ["horizontal", "horizontal-inverted"];
|
|
30
29
|
|
|
31
|
-
const collectAncestorPinchGestures = (
|
|
32
|
-
|
|
30
|
+
const collectAncestorPinchGestures = (
|
|
31
|
+
ancestors: readonly ScreenGestureSource[],
|
|
32
|
+
) => {
|
|
33
|
+
const pinchGestures: ScreenGestureSource["pinchGesture"][] = [];
|
|
33
34
|
|
|
34
35
|
for (const ancestor of ancestors) {
|
|
35
36
|
if (!pinchGestures.includes(ancestor.pinchGesture)) {
|
|
@@ -41,12 +42,12 @@ const collectAncestorPinchGestures = (ancestors: GestureContextType[]) => {
|
|
|
41
42
|
};
|
|
42
43
|
|
|
43
44
|
const collectAxisOwners = (
|
|
44
|
-
ancestors:
|
|
45
|
+
ancestors: readonly ScreenGestureSource[],
|
|
45
46
|
directions: readonly [Direction, Direction],
|
|
46
47
|
) => {
|
|
47
|
-
const seenOwners:
|
|
48
|
-
const panGestures:
|
|
49
|
-
const scrollStates:
|
|
48
|
+
const seenOwners: ScreenGestureSource[] = [];
|
|
49
|
+
const panGestures: ScreenGestureSource["panGesture"][] = [];
|
|
50
|
+
const scrollStates: ScreenGestureSource["scrollState"][] = [];
|
|
50
51
|
const ownerRouteKeys: string[] = [];
|
|
51
52
|
|
|
52
53
|
for (const direction of directions) {
|
|
@@ -73,10 +74,9 @@ interface WalkUpScrollGestureCoordinationResult {
|
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
export function walkUpScrollGestureCoordination(
|
|
76
|
-
|
|
77
|
+
ancestors: readonly ScreenGestureSource[],
|
|
77
78
|
axis: ScrollGestureAxis,
|
|
78
79
|
): WalkUpScrollGestureCoordinationResult {
|
|
79
|
-
const ancestors = walkGestureAncestors(context);
|
|
80
80
|
const axisOwners = collectAxisOwners(ancestors, getDirectionsForAxis(axis));
|
|
81
81
|
|
|
82
82
|
return {
|
|
@@ -25,11 +25,11 @@ import type {
|
|
|
25
25
|
import { computeClaimedDirections } from "../ownership/compute-claimed-directions";
|
|
26
26
|
import { resolveOwnership } from "../ownership/resolve-ownership";
|
|
27
27
|
import type {
|
|
28
|
-
GestureContextType,
|
|
29
28
|
PanGesturePolicy,
|
|
30
29
|
PinchGesturePolicy,
|
|
31
30
|
ScreenGestureConfig,
|
|
32
31
|
ScreenGestureParticipation,
|
|
32
|
+
ScreenGestureSource,
|
|
33
33
|
} from "../types";
|
|
34
34
|
import {
|
|
35
35
|
getGestureDirectionEntries,
|
|
@@ -305,12 +305,12 @@ export const resolvePinchPolicy = (
|
|
|
305
305
|
const resolveGestureParticipation = ({
|
|
306
306
|
options,
|
|
307
307
|
isFirstKey,
|
|
308
|
-
|
|
308
|
+
ancestorGestures,
|
|
309
309
|
isRemovePrevented,
|
|
310
310
|
}: {
|
|
311
311
|
options: GesturePolicyOptions;
|
|
312
312
|
isFirstKey: boolean;
|
|
313
|
-
|
|
313
|
+
ancestorGestures: readonly ScreenGestureSource[];
|
|
314
314
|
isRemovePrevented: boolean;
|
|
315
315
|
}): ScreenGestureParticipation => {
|
|
316
316
|
const canDismiss =
|
|
@@ -342,25 +342,25 @@ const resolveGestureParticipation = ({
|
|
|
342
342
|
canTrackGesture,
|
|
343
343
|
effectiveSnapPoints,
|
|
344
344
|
claimedDirections,
|
|
345
|
-
ownershipStatus: resolveOwnership(claimedDirections,
|
|
345
|
+
ownershipStatus: resolveOwnership(claimedDirections, ancestorGestures),
|
|
346
346
|
};
|
|
347
347
|
};
|
|
348
348
|
|
|
349
349
|
export const resolveScreenGestureConfig = ({
|
|
350
350
|
options,
|
|
351
351
|
isFirstKey,
|
|
352
|
-
|
|
352
|
+
ancestorGestures,
|
|
353
353
|
isRemovePrevented = false,
|
|
354
354
|
}: {
|
|
355
355
|
options: ScreenTransitionConfig;
|
|
356
356
|
isFirstKey: boolean;
|
|
357
|
-
|
|
357
|
+
ancestorGestures: readonly ScreenGestureSource[];
|
|
358
358
|
isRemovePrevented?: boolean;
|
|
359
359
|
}): ScreenGestureConfig => {
|
|
360
360
|
const participation = resolveGestureParticipation({
|
|
361
361
|
options,
|
|
362
362
|
isFirstKey,
|
|
363
|
-
|
|
363
|
+
ancestorGestures,
|
|
364
364
|
isRemovePrevented,
|
|
365
365
|
});
|
|
366
366
|
const hasSnapPoints = participation.effectiveSnapPoints.hasSnapPoints;
|
|
@@ -71,17 +71,20 @@ export const NO_DIRECTION_CLAIMS: DirectionClaimMap = {
|
|
|
71
71
|
"horizontal-inverted": null,
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
-
export interface
|
|
74
|
+
export interface ScreenGestureSource {
|
|
75
75
|
routeKey: string;
|
|
76
76
|
detectorGesture: ComposedGesture;
|
|
77
77
|
panGesture: PanGesture;
|
|
78
78
|
pinchGesture: PinchGesture;
|
|
79
79
|
scrollState: SharedValue<ScrollGestureState | null>;
|
|
80
|
-
gestureContext: GestureContextType | null;
|
|
81
80
|
claimedDirections: ClaimedDirections;
|
|
82
81
|
childDirectionClaims: SharedValue<DirectionClaimMap>;
|
|
83
82
|
}
|
|
84
83
|
|
|
84
|
+
export interface GestureContextType extends ScreenGestureSource {
|
|
85
|
+
ancestorGestures: readonly ScreenGestureSource[];
|
|
86
|
+
}
|
|
87
|
+
|
|
85
88
|
export interface ScreenGestureParticipation {
|
|
86
89
|
/** Whether this route is the first route in its stack. First routes never track gestures. */
|
|
87
90
|
isFirstKey: boolean;
|
|
@@ -6,14 +6,21 @@ import {
|
|
|
6
6
|
composeSlotStyleWithLocalTransform,
|
|
7
7
|
getLocalTransformForSlotComposition,
|
|
8
8
|
} from "../helpers/compose-slot-style";
|
|
9
|
-
import {
|
|
9
|
+
import { useOptionalScreenSlotStore } from "../slot.provider";
|
|
10
10
|
|
|
11
11
|
const useCurrentScreenSlotsMap = () => {
|
|
12
12
|
const route = useRoute();
|
|
13
|
-
const
|
|
13
|
+
const localSlotsMap = useOptionalScreenSlotStore(
|
|
14
|
+
(store) => store?.slotsMap ?? null,
|
|
15
|
+
);
|
|
16
|
+
const keyedSlotsMap = useOptionalScreenSlotStore(
|
|
17
|
+
localSlotsMap ? null : route.key,
|
|
18
|
+
(store) => store.slotsMap,
|
|
19
|
+
);
|
|
20
|
+
const slotsMap = localSlotsMap ?? keyedSlotsMap;
|
|
14
21
|
|
|
15
22
|
if (!slotsMap) {
|
|
16
|
-
throw new Error(`
|
|
23
|
+
throw new Error(`ScreenSlotStore is unavailable for route "${route.key}"`);
|
|
17
24
|
}
|
|
18
25
|
|
|
19
26
|
return slotsMap;
|
|
@@ -148,9 +148,6 @@ export const useInterpolatedStylesMap = ({
|
|
|
148
148
|
const screenInterpolatorProps = useScreenAnimationStore(
|
|
149
149
|
(store) => store.screenInterpolatorProps,
|
|
150
150
|
);
|
|
151
|
-
const screenInterpolatorPropsRevision = useScreenAnimationStore(
|
|
152
|
-
(store) => store.screenInterpolatorPropsRevision,
|
|
153
|
-
);
|
|
154
151
|
const selectedInterpolatorOptions = useScreenAnimationStore(
|
|
155
152
|
(store) => store.selectedInterpolatorOptions,
|
|
156
153
|
);
|
|
@@ -160,17 +157,15 @@ export const useInterpolatedStylesMap = ({
|
|
|
160
157
|
const currentInterpolator = useScreenAnimationStore(
|
|
161
158
|
(store) => store.currentInterpolator,
|
|
162
159
|
);
|
|
163
|
-
const
|
|
164
|
-
(store) => store.
|
|
160
|
+
const transitionSources = useScreenAnimationStore(
|
|
161
|
+
(store) => store.transitionSources,
|
|
165
162
|
);
|
|
166
|
-
const
|
|
167
|
-
(store) => store.
|
|
163
|
+
const transitionOriginIndex = useScreenAnimationStore(
|
|
164
|
+
(store) => store.transitionOriginIndex,
|
|
168
165
|
);
|
|
169
166
|
const transition = useBuildTransitionAccessor({
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
ancestorScreenAnimationSources,
|
|
173
|
-
descendantScreenAnimationSources,
|
|
167
|
+
transitionSources,
|
|
168
|
+
transitionOriginIndex,
|
|
174
169
|
});
|
|
175
170
|
const hasCurrentInterpolator = !!currentInterpolator;
|
|
176
171
|
const { closing: currentClosing, entering: currentEntering } =
|
|
@@ -242,12 +237,7 @@ export const useInterpolatedStylesMap = ({
|
|
|
242
237
|
|
|
243
238
|
const localStylesMaps = useDerivedValue<LocalStyleLayers>(() => {
|
|
244
239
|
"worklet";
|
|
245
|
-
readScreenAnimationRevisions(
|
|
246
|
-
screenInterpolatorPropsRevision,
|
|
247
|
-
ancestorScreenAnimationSources,
|
|
248
|
-
descendantScreenAnimationSources,
|
|
249
|
-
interpolatorSharedValues,
|
|
250
|
-
);
|
|
240
|
+
readScreenAnimationRevisions(transitionSources, interpolatorSharedValues);
|
|
251
241
|
const props = screenInterpolatorProps.get();
|
|
252
242
|
|
|
253
243
|
const { current, next } = props;
|
|
@@ -8,6 +8,7 @@ import type {
|
|
|
8
8
|
import type { NormalizedTransitionInterpolatedStyle } from "../../../types/animation.types";
|
|
9
9
|
import createProvider from "../../../utils/create-provider";
|
|
10
10
|
import { useDescriptorsStore } from "../descriptors";
|
|
11
|
+
import { useCurrentScreenRelationships } from "../use-current-screen-relationships";
|
|
11
12
|
import { useInterpolatedStylesMap } from "./hooks/use-interpolated-style-maps";
|
|
12
13
|
import { useMaybeBlockVisibility } from "./hooks/use-maybe-block-visibility";
|
|
13
14
|
import { useResolvedStylesMap } from "./hooks/use-resolved-slot-style-map";
|
|
@@ -30,33 +31,32 @@ export type ScreenSlotContextValue = {
|
|
|
30
31
|
visibilityBlocked: SharedValue<boolean>;
|
|
31
32
|
};
|
|
32
33
|
|
|
33
|
-
const
|
|
34
|
+
const createScreenSlotProvider = createProvider("ScreenSlot", {
|
|
35
|
+
global: true,
|
|
36
|
+
})<Props, ScreenSlotContextValue>;
|
|
34
37
|
|
|
35
|
-
export const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
parentScreenKey ?? NO_PARENT_SCREEN_KEY,
|
|
42
|
-
(store) => store.visibilityBlocked,
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export const { ScreenSlotProvider, useScreenSlotStore: useScreenSlots } =
|
|
47
|
-
createProvider("ScreenSlot", {
|
|
48
|
-
guarded: true,
|
|
49
|
-
global: true,
|
|
50
|
-
})<Props, ScreenSlotContextValue>(({ children }, { useParentStore }) => {
|
|
51
|
-
const ancestorStylesMap = useParentStore(
|
|
52
|
-
(parentContext) => parentContext?.slotsMap,
|
|
53
|
-
);
|
|
38
|
+
export const {
|
|
39
|
+
ScreenSlotProvider,
|
|
40
|
+
useOptionalScreenSlotStore,
|
|
41
|
+
useScreenSlotStore,
|
|
42
|
+
}: ReturnType<typeof createScreenSlotProvider> = createScreenSlotProvider(
|
|
43
|
+
({ children }) => {
|
|
54
44
|
const currentScreenKey = useDescriptorsStore(
|
|
55
45
|
(store) => store.derivations.currentScreenKey,
|
|
56
46
|
);
|
|
57
|
-
const
|
|
47
|
+
const { parentScreenKey } = useCurrentScreenRelationships();
|
|
48
|
+
const ancestorStylesMap = useOptionalScreenSlotStore(
|
|
49
|
+
parentScreenKey,
|
|
50
|
+
(store) => store.slotsMap,
|
|
51
|
+
);
|
|
52
|
+
const ancestorVisibilityBlocked = useOptionalScreenSlotStore(
|
|
53
|
+
parentScreenKey,
|
|
54
|
+
(store) => store.visibilityBlocked,
|
|
55
|
+
);
|
|
58
56
|
const { animatedStyle, animatedProps, visibilityBlocked } =
|
|
59
|
-
useMaybeBlockVisibility({
|
|
57
|
+
useMaybeBlockVisibility({
|
|
58
|
+
ancestorVisibilityBlocked: ancestorVisibilityBlocked ?? null,
|
|
59
|
+
});
|
|
60
60
|
|
|
61
61
|
const { interpolatorReady, localStylesMaps } = useInterpolatedStylesMap({
|
|
62
62
|
enabled: true,
|
|
@@ -65,7 +65,7 @@ export const { ScreenSlotProvider, useScreenSlotStore: useScreenSlots } =
|
|
|
65
65
|
|
|
66
66
|
const slotsMap = useResolvedStylesMap({
|
|
67
67
|
localStylesMaps,
|
|
68
|
-
ancestorStylesMap,
|
|
68
|
+
ancestorStylesMap: ancestorStylesMap ?? undefined,
|
|
69
69
|
});
|
|
70
70
|
const value = useMemo(
|
|
71
71
|
() => ({
|
|
@@ -92,7 +92,8 @@ export const { ScreenSlotProvider, useScreenSlotStore: useScreenSlots } =
|
|
|
92
92
|
value,
|
|
93
93
|
children: content,
|
|
94
94
|
};
|
|
95
|
-
}
|
|
95
|
+
},
|
|
96
|
+
);
|
|
96
97
|
|
|
97
98
|
const styles = StyleSheet.create({
|
|
98
99
|
container: { flex: 1 },
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useScreenRelationships } from "../../factories/screen-topology";
|
|
2
|
+
import { useDescriptorsStore } from "./descriptors";
|
|
3
|
+
|
|
4
|
+
export const useCurrentScreenRelationships = () => {
|
|
5
|
+
const screenKey = useDescriptorsStore(
|
|
6
|
+
(store) => store.derivations.currentScreenKey,
|
|
7
|
+
);
|
|
8
|
+
|
|
9
|
+
return useScreenRelationships(screenKey);
|
|
10
|
+
};
|
|
@@ -42,11 +42,14 @@ type BlankStackStoreProviderProps = {
|
|
|
42
42
|
value: BlankStackStoreValue<BaseStackDescriptor>;
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
const {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
const {
|
|
46
|
+
BlankStackProvider: BlankStackStoreProvider,
|
|
47
|
+
useBlankStackStore,
|
|
48
|
+
useOptionalBlankStackStore,
|
|
49
|
+
} = createProvider("BlankStack")<
|
|
50
|
+
BlankStackStoreProviderProps,
|
|
51
|
+
BlankStackStoreValue<BaseStackDescriptor>
|
|
52
|
+
>(({ children, value }) => ({ children, value }));
|
|
50
53
|
|
|
51
54
|
function BlankStackProvider({
|
|
52
55
|
state: stackState,
|
|
@@ -68,6 +71,15 @@ function BlankStackProvider({
|
|
|
68
71
|
() => createScenesByKey(state.scenes),
|
|
69
72
|
[state.scenes],
|
|
70
73
|
);
|
|
74
|
+
const paintDriverRouteKeyByRouteKey = useMemo(() => {
|
|
75
|
+
const paintDrivers = new Map<string, string>();
|
|
76
|
+
|
|
77
|
+
for (let index = 0; index + 2 < state.routeKeys.length; index++) {
|
|
78
|
+
paintDrivers.set(state.routeKeys[index], state.routeKeys[index + 2]);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return paintDrivers;
|
|
82
|
+
}, [state.routeKeys]);
|
|
71
83
|
|
|
72
84
|
const stackValue = useMemo<StackContextValue>(
|
|
73
85
|
() => ({
|
|
@@ -95,6 +107,7 @@ function BlankStackProvider({
|
|
|
95
107
|
routes: state.routes,
|
|
96
108
|
scenes: state.scenes,
|
|
97
109
|
scenesByKey,
|
|
110
|
+
paintDriverRouteKeyByRouteKey,
|
|
98
111
|
focusedIndex,
|
|
99
112
|
requestDismiss,
|
|
100
113
|
shouldShowFloatOverlay: state.shouldShowFloatOverlay,
|
|
@@ -111,4 +124,4 @@ function BlankStackProvider({
|
|
|
111
124
|
}
|
|
112
125
|
|
|
113
126
|
export type { BlankStackProviderProps, BlankStackStoreValue };
|
|
114
|
-
export { BlankStackProvider, useBlankStackStore };
|
|
127
|
+
export { BlankStackProvider, useBlankStackStore, useOptionalBlankStackStore };
|
|
@@ -45,7 +45,6 @@ const StackCoreRoot = memo(function StackCoreRoot({
|
|
|
45
45
|
|
|
46
46
|
export const { StackCoreProvider, useStackCoreStore } = createProvider(
|
|
47
47
|
"StackCore",
|
|
48
|
-
{ guarded: true },
|
|
49
48
|
)<StackCoreProviderProps, StackCoreContextValue>(({ config, children }) => {
|
|
50
49
|
const {
|
|
51
50
|
TRANSITIONS_ALWAYS_ON = false,
|
|
@@ -23,7 +23,7 @@ type DirectStackStoreProviderProps = {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
const { DirectStackProvider: DirectStackStoreProvider, useDirectStackStore } =
|
|
26
|
-
createProvider("DirectStack"
|
|
26
|
+
createProvider("DirectStack")<
|
|
27
27
|
DirectStackStoreProviderProps,
|
|
28
28
|
DirectStackContextValue
|
|
29
29
|
>(({ children, value }) => ({ children, value }));
|
|
@@ -51,7 +51,7 @@ function DirectStackProvider({
|
|
|
51
51
|
useMemo(() => {
|
|
52
52
|
const allRoutes = state.routes.concat(state.preloadedRoutes);
|
|
53
53
|
const scenes: DirectStackScene[] = [];
|
|
54
|
-
const routeKeys
|
|
54
|
+
const routeKeys = state.routes.map((route) => route.key);
|
|
55
55
|
const allDescriptors: NativeStackDescriptorMap = {
|
|
56
56
|
...preloadedDescriptors,
|
|
57
57
|
...descriptors,
|
|
@@ -85,8 +85,6 @@ function DirectStackProvider({
|
|
|
85
85
|
descriptor,
|
|
86
86
|
isPreloaded,
|
|
87
87
|
});
|
|
88
|
-
routeKeys.push(route.key);
|
|
89
|
-
|
|
90
88
|
if (
|
|
91
89
|
!shouldShowFloatOverlay &&
|
|
92
90
|
descriptor.options?.enableTransitions === true &&
|