react-native-screen-transitions 3.4.0-alpha.0 → 3.4.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1046
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js +69 -2
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js +9 -0
- package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js.map +1 -1
- package/lib/commonjs/shared/animation/snap-to.js +5 -1
- package/lib/commonjs/shared/animation/snap-to.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +195 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -14
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +19 -18
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +54 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +40 -8
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +72 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +16 -7
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +7 -4
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +14 -15
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +27 -9
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/index.js +22 -8
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js +5 -10
- package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +1 -1
- package/lib/commonjs/shared/components/create-transition-aware-component.js +3 -2
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/native-screen-container.js +12 -6
- package/lib/commonjs/shared/components/native-screen-container.js.map +1 -1
- package/lib/commonjs/shared/components/native-screen.js +35 -8
- package/lib/commonjs/shared/components/native-screen.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js +2 -2
- package/lib/commonjs/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/index.js +1 -3
- package/lib/commonjs/shared/components/overlay/index.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/variations/overlay-host.js +2 -16
- package/lib/commonjs/shared/components/overlay/variations/overlay-host.js.map +1 -1
- package/lib/commonjs/shared/components/scene-view.js +2 -4
- package/lib/commonjs/shared/components/scene-view.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +60 -0
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -0
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +9 -6
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +16 -56
- package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +86 -0
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js +17 -4
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
- package/lib/commonjs/shared/constants.js +6 -2
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/gestures/resolve-screen-gesture-target.js +49 -0
- package/lib/commonjs/shared/hooks/gestures/resolve-screen-gesture-target.js.map +1 -0
- package/lib/commonjs/shared/hooks/gestures/types.js +2 -0
- package/lib/commonjs/shared/hooks/gestures/types.js.map +1 -0
- package/lib/commonjs/shared/hooks/gestures/use-screen-gesture.js +7 -3
- package/lib/commonjs/shared/hooks/gestures/use-screen-gesture.js.map +1 -1
- package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/commonjs/shared/index.js +15 -3
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +61 -25
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-activation.js +11 -6
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js +44 -0
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -0
- package/lib/commonjs/shared/providers/layout-anchor.provider.js +4 -6
- package/lib/commonjs/shared/providers/layout-anchor.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/animation.provider.js +31 -17
- package/lib/commonjs/shared/providers/screen/animation/animation.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js +1 -9
- package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +25 -13
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js +33 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/animation/types.js +2 -0
- package/lib/commonjs/shared/providers/screen/animation/types.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js +9 -3
- package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/core.provider.js +14 -21
- package/lib/commonjs/shared/providers/stack/core.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/direct.provider.js +1 -1
- package/lib/commonjs/shared/providers/stack/direct.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js +1 -1
- package/lib/commonjs/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
- package/lib/commonjs/shared/stores/animation.store.js +10 -2
- package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/presence.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +7 -0
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +6 -0
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +33 -9
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/geometry.js +3 -2
- package/lib/commonjs/shared/utils/bounds/helpers/geometry.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/interpolators.js +3 -2
- package/lib/commonjs/shared/utils/bounds/helpers/interpolators.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/link-accessor.js +2 -2
- package/lib/commonjs/shared/utils/bounds/helpers/link-accessor.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js +4 -8
- package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js +4 -3
- package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/index.js +13 -3
- package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/types/frame-props.js +6 -0
- package/lib/commonjs/shared/utils/bounds/types/frame-props.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/accessor.js +54 -0
- package/lib/commonjs/shared/utils/bounds/zoom/accessor.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/build.js +548 -0
- package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/config.js +118 -0
- package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/index.js +20 -0
- package/lib/commonjs/shared/utils/bounds/zoom/index.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/types.js.map +1 -0
- package/lib/commonjs/shared/utils/gesture/validate-snap-points.js +11 -5
- package/lib/commonjs/shared/utils/gesture/validate-snap-points.js.map +1 -1
- package/lib/commonjs/shared/utils/overlay/visibility.js +2 -9
- package/lib/commonjs/shared/utils/overlay/visibility.js.map +1 -1
- package/lib/commonjs/shared/utils/resolve-screen-transition-options.js +25 -0
- package/lib/commonjs/shared/utils/resolve-screen-transition-options.js.map +1 -0
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js +69 -3
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/module/component-stack/navigators/create-component-stack-navigator.js +9 -0
- package/lib/module/component-stack/navigators/create-component-stack-navigator.js.map +1 -1
- package/lib/module/shared/animation/snap-to.js +5 -1
- package/lib/module/shared/animation/snap-to.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +182 -0
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -14
- package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +19 -18
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +49 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +41 -8
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +67 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +16 -7
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +7 -4
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +14 -15
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +27 -9
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/index.js +22 -8
- package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js +5 -10
- package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +1 -1
- package/lib/module/shared/components/create-transition-aware-component.js +3 -2
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/native-screen-container.js +12 -6
- package/lib/module/shared/components/native-screen-container.js.map +1 -1
- package/lib/module/shared/components/native-screen.js +35 -8
- package/lib/module/shared/components/native-screen.js.map +1 -1
- package/lib/module/shared/components/overlay/helpers/get-active-overlay.js +3 -3
- package/lib/module/shared/components/overlay/helpers/get-active-overlay.js.map +1 -1
- package/lib/module/shared/components/overlay/index.js +1 -3
- package/lib/module/shared/components/overlay/index.js.map +1 -1
- package/lib/module/shared/components/overlay/variations/overlay-host.js +3 -17
- package/lib/module/shared/components/overlay/variations/overlay-host.js.map +1 -1
- package/lib/module/shared/components/scene-view.js +3 -5
- package/lib/module/shared/components/scene-view.js.map +1 -1
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +56 -0
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -0
- package/lib/module/shared/components/screen-container/layers/backdrop.js +9 -6
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +18 -58
- package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +81 -0
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js +17 -4
- package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
- package/lib/module/shared/constants.js +6 -2
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/hooks/gestures/resolve-screen-gesture-target.js +45 -0
- package/lib/module/shared/hooks/gestures/resolve-screen-gesture-target.js.map +1 -0
- package/lib/module/shared/hooks/gestures/types.js +2 -0
- package/lib/module/shared/hooks/gestures/types.js.map +1 -0
- package/lib/module/shared/hooks/gestures/use-screen-gesture.js +7 -4
- package/lib/module/shared/hooks/gestures/use-screen-gesture.js.map +1 -1
- package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/module/shared/index.js +1 -2
- package/lib/module/shared/index.js.map +1 -1
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js +61 -25
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/gesture-activation.js +11 -6
- package/lib/module/shared/providers/gestures/helpers/gesture-activation.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js +38 -0
- package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -0
- package/lib/module/shared/providers/layout-anchor.provider.js +4 -6
- package/lib/module/shared/providers/layout-anchor.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/animation.provider.js +30 -15
- package/lib/module/shared/providers/screen/animation/animation.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/derivations.js +1 -9
- package/lib/module/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +25 -13
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js +29 -0
- package/lib/module/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js.map +1 -0
- package/lib/module/shared/providers/screen/animation/index.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/types.js +2 -0
- package/lib/module/shared/providers/screen/animation/types.js.map +1 -0
- package/lib/module/shared/providers/screen/animation/use-screen-animation.js +9 -3
- package/lib/module/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
- package/lib/module/shared/providers/stack/core.provider.js +14 -21
- package/lib/module/shared/providers/stack/core.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/direct.provider.js +2 -2
- package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/helpers/use-processed-routes.js +2 -2
- package/lib/module/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
- package/lib/module/shared/stores/animation.store.js +10 -2
- package/lib/module/shared/stores/animation.store.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/presence.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +7 -0
- package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +6 -0
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +33 -9
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/geometry.js +3 -2
- package/lib/module/shared/utils/bounds/helpers/geometry.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/interpolators.js +3 -2
- package/lib/module/shared/utils/bounds/helpers/interpolators.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/link-accessor.js +2 -2
- package/lib/module/shared/utils/bounds/helpers/link-accessor.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js +4 -8
- package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/style-composers.js +4 -3
- package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +1 -1
- package/lib/module/shared/utils/bounds/index.js +13 -3
- package/lib/module/shared/utils/bounds/index.js.map +1 -1
- package/lib/module/shared/utils/bounds/types/frame-props.js +4 -0
- package/lib/module/shared/utils/bounds/types/frame-props.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/accessor.js +49 -0
- package/lib/module/shared/utils/bounds/zoom/accessor.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/build.js +543 -0
- package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/config.js +112 -0
- package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/index.js +5 -0
- package/lib/module/shared/utils/bounds/zoom/index.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/types.js.map +1 -0
- package/lib/module/shared/utils/gesture/validate-snap-points.js +11 -5
- package/lib/module/shared/utils/gesture/validate-snap-points.js.map +1 -1
- package/lib/module/shared/utils/overlay/visibility.js +1 -7
- package/lib/module/shared/utils/overlay/visibility.js.map +1 -1
- package/lib/module/shared/utils/resolve-screen-transition-options.js +19 -0
- package/lib/module/shared/utils/resolve-screen-transition-options.js.map +1 -0
- package/lib/typescript/blank-stack/index.d.ts +1 -1
- package/lib/typescript/blank-stack/index.d.ts.map +1 -1
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +29 -4
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/blank-stack/types.d.ts +33 -4
- package/lib/typescript/blank-stack/types.d.ts.map +1 -1
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +8 -0
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/shared/animation/snap-to.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +81 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts +2 -3
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts +11 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +2 -2
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts +11 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts +3 -3
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts +2 -2
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts +5 -3
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts +2 -4
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts +0 -1
- package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts +1 -0
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/native-screen-container.d.ts.map +1 -1
- package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/helpers/get-active-overlay.d.ts +1 -1
- package/lib/typescript/shared/components/overlay/index.d.ts +0 -2
- package/lib/typescript/shared/components/overlay/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts +3 -0
- package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-container/layers/backdrop.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-container/layers/maybe-masked-navigation-container.d.ts +9 -0
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +3 -0
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/gestures/resolve-screen-gesture-target.d.ts +10 -0
- package/lib/typescript/shared/hooks/gestures/resolve-screen-gesture-target.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/gestures/types.d.ts +4 -0
- package/lib/typescript/shared/hooks/gestures/types.d.ts.map +1 -0
- package/lib/typescript/shared/hooks/gestures/use-screen-gesture.d.ts +4 -2
- package/lib/typescript/shared/hooks/gestures/use-screen-gesture.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +1 -2
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +16 -18
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts +1 -1
- package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts +18 -0
- package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts.map +1 -0
- package/lib/typescript/shared/providers/layout-anchor.provider.d.ts +1 -1
- package/lib/typescript/shared/providers/layout-anchor.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts +6 -3
- package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts +0 -2
- package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/resolve-screen-animation-target.d.ts +11 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/resolve-screen-animation-target.d.ts.map +1 -0
- 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 +4 -0
- package/lib/typescript/shared/providers/screen/animation/types.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts +5 -1
- package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/stack/core.provider.d.ts +2 -0
- 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 +8 -2
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/presence.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts +2 -0
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +33 -51
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +46 -9
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +3 -3
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/types/overlay.types.d.ts +1 -22
- package/lib/typescript/shared/types/overlay.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +62 -37
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts +2 -2
- package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts +3 -2
- package/lib/typescript/shared/utils/bounds/helpers/geometry.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/interpolators.d.ts +3 -2
- package/lib/typescript/shared/utils/bounds/helpers/interpolators.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/link-accessor.d.ts +3 -2
- package/lib/typescript/shared/utils/bounds/helpers/link-accessor.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts +2 -1
- package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts +4 -3
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/index.d.ts +2 -2
- package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts +5 -0
- package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/types/options.d.ts +5 -4
- package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +17 -0
- package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +4 -0
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +43 -0
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/zoom/index.d.ts +3 -0
- package/lib/typescript/shared/utils/bounds/zoom/index.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/zoom/types.d.ts +17 -0
- package/lib/typescript/shared/utils/bounds/zoom/types.d.ts.map +1 -0
- package/lib/typescript/shared/utils/gesture/validate-snap-points.d.ts +5 -3
- package/lib/typescript/shared/utils/gesture/validate-snap-points.d.ts.map +1 -1
- package/lib/typescript/shared/utils/overlay/visibility.d.ts +1 -4
- package/lib/typescript/shared/utils/overlay/visibility.d.ts.map +1 -1
- package/lib/typescript/shared/utils/resolve-screen-transition-options.d.ts +5 -0
- package/lib/typescript/shared/utils/resolve-screen-transition-options.d.ts.map +1 -0
- package/package.json +3 -2
- package/src/blank-stack/index.ts +1 -0
- package/src/blank-stack/navigators/create-blank-stack-navigator.tsx +138 -19
- package/src/blank-stack/types.ts +33 -5
- package/src/component-stack/navigators/create-component-stack-navigator.tsx +8 -0
- package/src/shared/animation/snap-to.ts +12 -1
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +258 -0
- package/src/shared/components/create-boundary-component/hooks/use-auto-source-measurement.ts +7 -17
- package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts +38 -28
- package/src/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.ts +58 -0
- package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +41 -10
- package/src/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.ts +82 -0
- package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +24 -12
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts +11 -9
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts +29 -26
- package/src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts +26 -17
- package/src/shared/components/create-boundary-component/index.tsx +25 -6
- package/src/shared/components/create-boundary-component/types.ts +8 -4
- package/src/shared/components/create-boundary-component/utils/build-boundary-match-key.ts +2 -14
- package/src/shared/components/create-transition-aware-component.tsx +5 -2
- package/src/shared/components/native-screen-container.tsx +11 -3
- package/src/shared/components/native-screen.tsx +65 -20
- package/src/shared/components/overlay/helpers/get-active-overlay.ts +3 -3
- package/src/shared/components/overlay/index.ts +0 -2
- package/src/shared/components/overlay/variations/overlay-host.tsx +2 -16
- package/src/shared/components/scene-view.tsx +0 -3
- package/src/shared/components/screen-container/hooks/use-content-layout.ts +82 -0
- package/src/shared/components/screen-container/layers/backdrop.tsx +25 -6
- package/src/shared/components/screen-container/layers/content.tsx +23 -82
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +101 -0
- package/src/shared/components/screen-lifecycle/hooks/use-close-transition/index.ts +1 -2
- package/src/shared/components/screen-lifecycle/hooks/use-open-transition.ts +20 -6
- package/src/shared/constants.ts +6 -2
- package/src/shared/hooks/gestures/resolve-screen-gesture-target.ts +66 -0
- package/src/shared/hooks/gestures/types.ts +5 -0
- package/src/shared/hooks/gestures/use-screen-gesture.ts +10 -3
- package/src/shared/hooks/navigation/use-stack.tsx +1 -2
- package/src/shared/index.ts +14 -16
- package/src/shared/providers/gestures/handlers/use-handlers.ts +75 -29
- package/src/shared/providers/gestures/helpers/gesture-activation.ts +11 -6
- package/src/shared/providers/gestures/helpers/gesture-snap-points.ts +72 -0
- package/src/shared/providers/layout-anchor.provider.tsx +2 -5
- package/src/shared/providers/register-bounds.provider.tsx +1 -1
- package/src/shared/providers/screen/animation/animation.provider.tsx +46 -10
- package/src/shared/providers/screen/animation/helpers/derivations.ts +0 -8
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +51 -14
- package/src/shared/providers/screen/animation/helpers/resolve-screen-animation-target.ts +44 -0
- package/src/shared/providers/screen/animation/index.tsx +4 -1
- package/src/shared/providers/screen/animation/types.ts +5 -0
- package/src/shared/providers/screen/animation/use-screen-animation.tsx +16 -3
- package/src/shared/providers/stack/core.provider.tsx +27 -14
- package/src/shared/providers/stack/direct.provider.tsx +2 -5
- package/src/shared/providers/stack/helpers/use-processed-routes.ts +2 -2
- package/src/shared/stores/animation.store.ts +21 -5
- package/src/shared/stores/bounds/internals/presence.ts +3 -1
- package/src/shared/stores/bounds/internals/resolver.ts +13 -1
- package/src/shared/stores/bounds/types.ts +2 -0
- package/src/shared/types/animation.types.ts +32 -58
- package/src/shared/types/bounds.types.ts +30 -10
- package/src/shared/types/index.ts +2 -15
- package/src/shared/types/overlay.types.ts +1 -28
- package/src/shared/types/screen.types.ts +67 -38
- package/src/shared/utils/animation/animate-to-progress.ts +7 -0
- package/src/shared/utils/bounds/helpers/build-bounds-options.ts +2 -2
- package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +47 -8
- package/src/shared/utils/bounds/helpers/geometry.ts +3 -2
- package/src/shared/utils/bounds/helpers/interpolators.ts +8 -6
- package/src/shared/utils/bounds/helpers/link-accessor.ts +10 -6
- package/src/shared/utils/bounds/helpers/resolve-bound-tag.ts +7 -10
- package/src/shared/utils/bounds/helpers/style-composers.ts +4 -3
- package/src/shared/utils/bounds/index.ts +22 -13
- package/src/shared/utils/bounds/types/frame-props.ts +5 -0
- package/src/shared/utils/bounds/types/options.ts +6 -4
- package/src/shared/utils/bounds/zoom/accessor.ts +69 -0
- package/src/shared/utils/bounds/zoom/build.ts +715 -0
- package/src/shared/utils/bounds/zoom/config.ts +179 -0
- package/src/shared/utils/bounds/zoom/index.ts +2 -0
- package/src/shared/utils/bounds/zoom/types.ts +22 -0
- package/src/shared/utils/gesture/validate-snap-points.ts +20 -8
- package/src/shared/utils/overlay/visibility.ts +1 -16
- package/src/shared/utils/resolve-screen-transition-options.ts +37 -0
- package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js +0 -64
- package/lib/commonjs/shared/components/overlay/variations/screen-overlay.js.map +0 -1
- package/lib/commonjs/shared/providers/viewport.provider.js +0 -33
- package/lib/commonjs/shared/providers/viewport.provider.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/math.js +0 -132
- package/lib/commonjs/shared/utils/bounds/helpers/math.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/navigation-accessor.js +0 -45
- package/lib/commonjs/shared/utils/bounds/helpers/navigation-accessor.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/helpers.js +0 -60
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/helpers.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/index.js +0 -20
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/index.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/types.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/zoom.js +0 -295
- package/lib/commonjs/shared/utils/bounds/sugar/navigation/zoom.js.map +0 -1
- package/lib/module/shared/components/overlay/variations/screen-overlay.js +0 -61
- package/lib/module/shared/components/overlay/variations/screen-overlay.js.map +0 -1
- package/lib/module/shared/providers/viewport.provider.js +0 -27
- package/lib/module/shared/providers/viewport.provider.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/math.js +0 -115
- package/lib/module/shared/utils/bounds/helpers/math.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/navigation-accessor.js +0 -40
- package/lib/module/shared/utils/bounds/helpers/navigation-accessor.js.map +0 -1
- package/lib/module/shared/utils/bounds/sugar/navigation/helpers.js +0 -54
- package/lib/module/shared/utils/bounds/sugar/navigation/helpers.js.map +0 -1
- package/lib/module/shared/utils/bounds/sugar/navigation/index.js +0 -15
- package/lib/module/shared/utils/bounds/sugar/navigation/index.js.map +0 -1
- package/lib/module/shared/utils/bounds/sugar/navigation/types.js.map +0 -1
- package/lib/module/shared/utils/bounds/sugar/navigation/zoom.js +0 -290
- package/lib/module/shared/utils/bounds/sugar/navigation/zoom.js.map +0 -1
- package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts +0 -10
- package/lib/typescript/shared/components/overlay/variations/screen-overlay.d.ts.map +0 -1
- package/lib/typescript/shared/providers/viewport.provider.d.ts +0 -13
- package/lib/typescript/shared/providers/viewport.provider.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/math.d.ts +0 -38
- package/lib/typescript/shared/utils/bounds/helpers/math.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/navigation-accessor.d.ts +0 -16
- package/lib/typescript/shared/utils/bounds/helpers/navigation-accessor.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/sugar/navigation/helpers.d.ts +0 -17
- package/lib/typescript/shared/utils/bounds/sugar/navigation/helpers.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/sugar/navigation/index.d.ts +0 -3
- package/lib/typescript/shared/utils/bounds/sugar/navigation/index.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/sugar/navigation/types.d.ts +0 -18
- package/lib/typescript/shared/utils/bounds/sugar/navigation/types.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/sugar/navigation/zoom.d.ts +0 -4
- package/lib/typescript/shared/utils/bounds/sugar/navigation/zoom.d.ts.map +0 -1
- package/src/shared/components/overlay/variations/screen-overlay.tsx +0 -68
- package/src/shared/providers/viewport.provider.tsx +0 -39
- package/src/shared/utils/bounds/helpers/math.ts +0 -161
- package/src/shared/utils/bounds/helpers/navigation-accessor.ts +0 -61
- package/src/shared/utils/bounds/sugar/navigation/helpers.ts +0 -74
- package/src/shared/utils/bounds/sugar/navigation/index.ts +0 -14
- package/src/shared/utils/bounds/sugar/navigation/types.ts +0 -26
- package/src/shared/utils/bounds/sugar/navigation/zoom.ts +0 -348
- /package/lib/commonjs/shared/utils/bounds/{sugar/navigation → zoom}/types.js +0 -0
- /package/lib/module/shared/utils/bounds/{sugar/navigation → zoom}/types.js +0 -0
|
@@ -9,8 +9,17 @@ var _buildBoundsOptions = require("./helpers/build-bounds-options");
|
|
|
9
9
|
var _computeBoundsStyles = require("./helpers/compute-bounds-styles");
|
|
10
10
|
var _interpolators = require("./helpers/interpolators");
|
|
11
11
|
var _linkAccessor = require("./helpers/link-accessor");
|
|
12
|
-
var _navigationAccessor = require("./helpers/navigation-accessor");
|
|
13
12
|
var _resolveBoundTag = require("./helpers/resolve-bound-tag");
|
|
13
|
+
var _zoom = require("./zoom");
|
|
14
|
+
const syncGroupActiveMember = (group, id) => {
|
|
15
|
+
"worklet";
|
|
16
|
+
|
|
17
|
+
if (!group) return;
|
|
18
|
+
if (id === undefined || id === null || id === "") return;
|
|
19
|
+
const normalizedId = String(id);
|
|
20
|
+
if (_bounds.BoundStore.getGroupActiveId(group) === normalizedId) return;
|
|
21
|
+
_bounds.BoundStore.setGroupActiveId(group, normalizedId);
|
|
22
|
+
};
|
|
14
23
|
const createBoundsAccessor = getProps => {
|
|
15
24
|
"worklet";
|
|
16
25
|
|
|
@@ -30,6 +39,7 @@ const createBoundsAccessor = getProps => {
|
|
|
30
39
|
"worklet";
|
|
31
40
|
|
|
32
41
|
const props = getProps();
|
|
42
|
+
syncGroupActiveMember(params?.group, params?.id);
|
|
33
43
|
const resolved = (0, _buildBoundsOptions.buildBoundsOptions)({
|
|
34
44
|
props,
|
|
35
45
|
id: params?.id,
|
|
@@ -65,7 +75,7 @@ const createBoundsAccessor = getProps => {
|
|
|
65
75
|
cachedNavigationPair = nextPair;
|
|
66
76
|
return nextPair;
|
|
67
77
|
};
|
|
68
|
-
const navigation = (0,
|
|
78
|
+
const navigation = (0, _zoom.createZoomAccessor)({
|
|
69
79
|
id: params?.id,
|
|
70
80
|
group: params?.group,
|
|
71
81
|
getProps,
|
|
@@ -81,7 +91,7 @@ const createBoundsAccessor = getProps => {
|
|
|
81
91
|
mode: "navigation",
|
|
82
92
|
resolveBoundTag: _resolveBoundTag.resolveBoundTag
|
|
83
93
|
});
|
|
84
|
-
const resolvedPair = resolveNavigationPair(resolvedNavigationOptions.id, currentProps);
|
|
94
|
+
const resolvedPair = resolveNavigationPair(String(resolvedNavigationOptions.id), currentProps);
|
|
85
95
|
return computeForResolvedOptions(resolvedNavigationOptions, currentProps, resolvedPair);
|
|
86
96
|
})()
|
|
87
97
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_bounds","require","_buildBoundsOptions","_computeBoundsStyles","_interpolators","_linkAccessor","
|
|
1
|
+
{"version":3,"names":["_bounds","require","_buildBoundsOptions","_computeBoundsStyles","_interpolators","_linkAccessor","_resolveBoundTag","_zoom","syncGroupActiveMember","group","id","undefined","normalizedId","String","BoundStore","getGroupActiveId","setGroupActiveId","createBoundsAccessor","getProps","computeForResolvedOptions","resolvedOptions","props","resolvedPair","computeBoundStyles","previous","current","next","progress","dimensions","layouts","screen","computeElementBoundsStyles","params","resolved","buildBoundsOptions","overrides","mode","resolveBoundTag","computed","zoomBaseOptions","anchor","scaleMode","target","cachedNavigationPairProps","cachedNavigationPairTag","cachedNavigationPair","resolveNavigationPair","tag","frameProps","nextPair","resolveTransitionPair","currentScreenKey","route","key","previousScreenKey","nextScreenKey","entering","navigation","createZoomAccessor","computeRaw","currentProps","resolvedNavigationOptions","Object","isExtensible","defineProperty","value","enumerable","configurable","getSnapshot","getLink","createLinkAccessor","interpolateStyle","interpolateBounds","createInterpolators","assign","exports"],"sourceRoot":"../../../../../src","sources":["shared/utils/bounds/index.ts"],"mappings":"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","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../../src","sources":["shared/utils/bounds/types/frame-props.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createZoomAccessor = void 0;
|
|
7
|
+
var _build = require("./build");
|
|
8
|
+
const createZoomAccessor = ({
|
|
9
|
+
id,
|
|
10
|
+
group,
|
|
11
|
+
getProps,
|
|
12
|
+
resolveBoundTag,
|
|
13
|
+
computeRaw,
|
|
14
|
+
zoomBaseOptions
|
|
15
|
+
}) => {
|
|
16
|
+
"worklet";
|
|
17
|
+
|
|
18
|
+
const resolvedId = id ?? "";
|
|
19
|
+
const computeZoomStyles = zoomOptions => {
|
|
20
|
+
"worklet";
|
|
21
|
+
|
|
22
|
+
const frameProps = getProps();
|
|
23
|
+
return (0, _build.buildZoomStyles)({
|
|
24
|
+
id: resolvedId,
|
|
25
|
+
group,
|
|
26
|
+
zoomOptions,
|
|
27
|
+
props: frameProps,
|
|
28
|
+
resolveTag: resolveBoundTag,
|
|
29
|
+
computeRaw: overrides => computeRaw({
|
|
30
|
+
...(overrides ?? {}),
|
|
31
|
+
raw: true
|
|
32
|
+
}, frameProps)
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
zoom: options => {
|
|
37
|
+
"worklet";
|
|
38
|
+
|
|
39
|
+
const mergedOptions = zoomBaseOptions || options ? {
|
|
40
|
+
...(zoomBaseOptions ?? {}),
|
|
41
|
+
...(options ?? {}),
|
|
42
|
+
...(options?.mask ? {
|
|
43
|
+
mask: options.mask
|
|
44
|
+
} : {}),
|
|
45
|
+
...(options?.motion ? {
|
|
46
|
+
motion: options.motion
|
|
47
|
+
} : {})
|
|
48
|
+
} : undefined;
|
|
49
|
+
return computeZoomStyles(mergedOptions);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
exports.createZoomAccessor = createZoomAccessor;
|
|
54
|
+
//# sourceMappingURL=accessor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_build","require","createZoomAccessor","id","group","getProps","resolveBoundTag","computeRaw","zoomBaseOptions","resolvedId","computeZoomStyles","zoomOptions","frameProps","buildZoomStyles","props","resolveTag","overrides","raw","zoom","options","mergedOptions","mask","motion","undefined","exports"],"sourceRoot":"../../../../../../src","sources":["shared/utils/bounds/zoom/accessor.ts"],"mappings":";;;;;;AAIA,IAAAA,MAAA,GAAAC,OAAA;AAiBO,MAAMC,kBAAkB,GAAGA,CAAC;EAClCC,EAAE;EACFC,KAAK;EACLC,QAAQ;EACRC,eAAe;EACfC,UAAU;EACVC;AACmB,CAAC,KAAK;EACzB,SAAS;;EAET,MAAMC,UAAU,GAAGN,EAAE,IAAI,EAAE;EAE3B,MAAMO,iBAAiB,GAAIC,WAAyC,IAAK;IACxE,SAAS;;IACT,MAAMC,UAAU,GAAGP,QAAQ,CAAC,CAAC;IAC7B,OAAO,IAAAQ,sBAAe,EAAC;MACtBV,EAAE,EAAEM,UAAU;MACdL,KAAK;MACLO,WAAW;MACXG,KAAK,EAAEF,UAAU;MACjBG,UAAU,EAAET,eAAe;MAC3BC,UAAU,EAAGS,SAAS,IACrBT,UAAU,CACT;QACC,IAAIS,SAAS,IAAI,CAAC,CAAC,CAAC;QACpBC,GAAG,EAAE;MACN,CAAC,EACDL,UACD;IACF,CAAC,CAAC;EACH,CAAC;EAED,OAAO;IACNM,IAAI,EAAGC,OAAqC,IAAK;MAChD,SAAS;;MACT,MAAMC,aAAa,GAClBZ,eAAe,IAAIW,OAAO,GACvB;QACA,IAAIX,eAAe,IAAI,CAAC,CAAC,CAAC;QAC1B,IAAIW,OAAO,IAAI,CAAC,CAAC,CAAC;QAClB,IAAIA,OAAO,EAAEE,IAAI,GAAG;UAAEA,IAAI,EAAEF,OAAO,CAACE;QAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAChD,IAAIF,OAAO,EAAEG,MAAM,GAAG;UAAEA,MAAM,EAAEH,OAAO,CAACG;QAAO,CAAC,GAAG,CAAC,CAAC;MACtD,CAAC,GACAC,SAAS;MACb,OAAOb,iBAAiB,CAACU,aAAa,CAAC;IACxC;EACD,CAAC;AACF,CAAC;AAACI,OAAA,CAAAtB,kBAAA,GAAAA,kBAAA","ignoreList":[]}
|
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buildZoomStyles = void 0;
|
|
7
|
+
var _reactNativeReanimated = require("react-native-reanimated");
|
|
8
|
+
var _constants = require("../../../constants");
|
|
9
|
+
var _bounds = require("../../../stores/bounds");
|
|
10
|
+
var _config = require("./config");
|
|
11
|
+
const IDENTITY_DRAG_SCALE_OUTPUT = [1, 1];
|
|
12
|
+
const clamp = (value, min, max) => {
|
|
13
|
+
"worklet";
|
|
14
|
+
|
|
15
|
+
const lower = min < max ? min : max;
|
|
16
|
+
const upper = max > min ? max : min;
|
|
17
|
+
if (value < lower) return lower;
|
|
18
|
+
if (value > upper) return upper;
|
|
19
|
+
return value;
|
|
20
|
+
};
|
|
21
|
+
const clamp01 = value => {
|
|
22
|
+
"worklet";
|
|
23
|
+
|
|
24
|
+
return clamp(value, 0, 1);
|
|
25
|
+
};
|
|
26
|
+
const lerp = (from, to, t) => {
|
|
27
|
+
"worklet";
|
|
28
|
+
|
|
29
|
+
return from + (to - from) * t;
|
|
30
|
+
};
|
|
31
|
+
const safeDivide = (numerator, denominator, fallback = 0) => {
|
|
32
|
+
"worklet";
|
|
33
|
+
|
|
34
|
+
if (denominator === 0) return fallback;
|
|
35
|
+
return numerator / denominator;
|
|
36
|
+
};
|
|
37
|
+
const inverseLerp = (value, inMin, inMax) => {
|
|
38
|
+
"worklet";
|
|
39
|
+
|
|
40
|
+
return safeDivide(value - inMin, inMax - inMin, 0);
|
|
41
|
+
};
|
|
42
|
+
const mapRangeClamped = (value, inMin, inMax, outMin, outMax) => {
|
|
43
|
+
"worklet";
|
|
44
|
+
|
|
45
|
+
const t = clamp01(inverseLerp(value, inMin, inMax));
|
|
46
|
+
return lerp(outMin, outMax, t);
|
|
47
|
+
};
|
|
48
|
+
const applyPowerCurve = (value, exponent) => {
|
|
49
|
+
"worklet";
|
|
50
|
+
|
|
51
|
+
const safeExponent = exponent > 0 ? exponent : 1;
|
|
52
|
+
const magnitude = Math.abs(value) ** safeExponent;
|
|
53
|
+
return value < 0 ? -magnitude : magnitude;
|
|
54
|
+
};
|
|
55
|
+
const normalizedToTranslation = ({
|
|
56
|
+
normalized,
|
|
57
|
+
dimension,
|
|
58
|
+
resistance
|
|
59
|
+
}) => {
|
|
60
|
+
"worklet";
|
|
61
|
+
|
|
62
|
+
const distance = Math.max(0, dimension) * resistance;
|
|
63
|
+
return mapRangeClamped(normalized, -1, 1, -distance, distance);
|
|
64
|
+
};
|
|
65
|
+
const normalizedToScale = ({
|
|
66
|
+
normalized,
|
|
67
|
+
outputRange,
|
|
68
|
+
exponent = 1,
|
|
69
|
+
positiveOnly = true
|
|
70
|
+
}) => {
|
|
71
|
+
"worklet";
|
|
72
|
+
|
|
73
|
+
const [outputStart, outputEnd] = outputRange;
|
|
74
|
+
const raw = positiveOnly ? mapRangeClamped(normalized, 0, 1, outputStart, outputEnd) : mapRangeClamped(normalized, -1, 1, outputStart, outputEnd);
|
|
75
|
+
return applyPowerCurve(raw, exponent);
|
|
76
|
+
};
|
|
77
|
+
const combineScales = (scaleX, scaleY, mode = "multiply") => {
|
|
78
|
+
"worklet";
|
|
79
|
+
|
|
80
|
+
switch (mode) {
|
|
81
|
+
case "average":
|
|
82
|
+
return (scaleX + scaleY) / 2;
|
|
83
|
+
case "max":
|
|
84
|
+
return Math.max(scaleX, scaleY);
|
|
85
|
+
case "min":
|
|
86
|
+
return Math.min(scaleX, scaleY);
|
|
87
|
+
default:
|
|
88
|
+
return scaleX * scaleY;
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const computeCenterScaleShift = ({
|
|
92
|
+
center,
|
|
93
|
+
containerCenter,
|
|
94
|
+
scale
|
|
95
|
+
}) => {
|
|
96
|
+
"worklet";
|
|
97
|
+
|
|
98
|
+
return (center - containerCenter) * (scale - 1);
|
|
99
|
+
};
|
|
100
|
+
const compensateTranslationForParentScale = ({
|
|
101
|
+
translation,
|
|
102
|
+
parentScale,
|
|
103
|
+
epsilon
|
|
104
|
+
}) => {
|
|
105
|
+
"worklet";
|
|
106
|
+
|
|
107
|
+
const safeParentScale = Math.max(parentScale, epsilon);
|
|
108
|
+
return safeDivide(translation, safeParentScale, translation);
|
|
109
|
+
};
|
|
110
|
+
const composeCompensatedTranslation = ({
|
|
111
|
+
gesture,
|
|
112
|
+
parentScale,
|
|
113
|
+
centerShift = 0,
|
|
114
|
+
epsilon
|
|
115
|
+
}) => {
|
|
116
|
+
"worklet";
|
|
117
|
+
|
|
118
|
+
return compensateTranslationForParentScale({
|
|
119
|
+
translation: gesture,
|
|
120
|
+
parentScale,
|
|
121
|
+
epsilon
|
|
122
|
+
}) + centerShift;
|
|
123
|
+
};
|
|
124
|
+
const resolveDirectionalDragScale = ({
|
|
125
|
+
normalized,
|
|
126
|
+
dismissDirection,
|
|
127
|
+
shrinkMin,
|
|
128
|
+
growMax,
|
|
129
|
+
exponent
|
|
130
|
+
}) => {
|
|
131
|
+
"worklet";
|
|
132
|
+
|
|
133
|
+
const dismissalRelative = dismissDirection === "negative" ? -normalized : normalized;
|
|
134
|
+
if (dismissalRelative >= 0) {
|
|
135
|
+
return normalizedToScale({
|
|
136
|
+
normalized: dismissalRelative,
|
|
137
|
+
outputRange: [1, shrinkMin],
|
|
138
|
+
exponent
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
const oppositeDrag = Math.min(1, Math.abs(dismissalRelative));
|
|
142
|
+
return (0, _reactNativeReanimated.interpolate)(oppositeDrag, [0, 1], [1, growMax], "clamp");
|
|
143
|
+
};
|
|
144
|
+
const getZoomContentTarget = ({
|
|
145
|
+
explicitTarget,
|
|
146
|
+
resolvedTag,
|
|
147
|
+
currentRouteKey,
|
|
148
|
+
previousRouteKey,
|
|
149
|
+
nextRouteKey,
|
|
150
|
+
entering,
|
|
151
|
+
screenLayout,
|
|
152
|
+
anchor,
|
|
153
|
+
resolvedPair
|
|
154
|
+
}) => {
|
|
155
|
+
"worklet";
|
|
156
|
+
|
|
157
|
+
if (explicitTarget !== undefined) return explicitTarget;
|
|
158
|
+
const pair = resolvedPair ?? _bounds.BoundStore.resolveTransitionPair(resolvedTag, {
|
|
159
|
+
currentScreenKey: currentRouteKey,
|
|
160
|
+
previousScreenKey: previousRouteKey,
|
|
161
|
+
nextScreenKey: nextRouteKey,
|
|
162
|
+
entering
|
|
163
|
+
});
|
|
164
|
+
const sourceBounds = pair.sourceBounds;
|
|
165
|
+
const screenWidth = screenLayout.width;
|
|
166
|
+
if (!sourceBounds || sourceBounds.width <= 0 || screenWidth <= 0) {
|
|
167
|
+
return "fullscreen";
|
|
168
|
+
}
|
|
169
|
+
const height = sourceBounds.height / sourceBounds.width * screenWidth;
|
|
170
|
+
let horizontalAnchor;
|
|
171
|
+
switch (anchor) {
|
|
172
|
+
case "topLeading":
|
|
173
|
+
case "leading":
|
|
174
|
+
case "bottomLeading":
|
|
175
|
+
horizontalAnchor = "leading";
|
|
176
|
+
break;
|
|
177
|
+
case "topTrailing":
|
|
178
|
+
case "trailing":
|
|
179
|
+
case "bottomTrailing":
|
|
180
|
+
horizontalAnchor = "trailing";
|
|
181
|
+
break;
|
|
182
|
+
default:
|
|
183
|
+
horizontalAnchor = "center";
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
let verticalAnchor;
|
|
187
|
+
switch (anchor) {
|
|
188
|
+
case "topLeading":
|
|
189
|
+
case "top":
|
|
190
|
+
case "topTrailing":
|
|
191
|
+
verticalAnchor = "top";
|
|
192
|
+
break;
|
|
193
|
+
case "bottomLeading":
|
|
194
|
+
case "bottom":
|
|
195
|
+
case "bottomTrailing":
|
|
196
|
+
verticalAnchor = "bottom";
|
|
197
|
+
break;
|
|
198
|
+
default:
|
|
199
|
+
verticalAnchor = "center";
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
const x = horizontalAnchor === "leading" ? 0 : horizontalAnchor === "trailing" ? screenLayout.width - screenWidth : (screenLayout.width - screenWidth) / 2;
|
|
203
|
+
const y = verticalAnchor === "top" ? 0 : verticalAnchor === "bottom" ? screenLayout.height - height : (screenLayout.height - height) / 2;
|
|
204
|
+
return {
|
|
205
|
+
x,
|
|
206
|
+
y,
|
|
207
|
+
pageX: x,
|
|
208
|
+
pageY: y,
|
|
209
|
+
width: screenWidth,
|
|
210
|
+
height
|
|
211
|
+
};
|
|
212
|
+
};
|
|
213
|
+
const getStyleRadius = (styles, property) => {
|
|
214
|
+
"worklet";
|
|
215
|
+
|
|
216
|
+
if (!styles || typeof styles !== "object") return undefined;
|
|
217
|
+
const styleRecord = styles;
|
|
218
|
+
const direct = styleRecord[property];
|
|
219
|
+
if (typeof direct === "number") return direct;
|
|
220
|
+
if (property !== "borderRadius") {
|
|
221
|
+
const fallback = styleRecord.borderRadius;
|
|
222
|
+
if (typeof fallback === "number") return fallback;
|
|
223
|
+
}
|
|
224
|
+
return undefined;
|
|
225
|
+
};
|
|
226
|
+
const resolveRadiusRange = ({
|
|
227
|
+
value,
|
|
228
|
+
progress,
|
|
229
|
+
sourceRadius,
|
|
230
|
+
destinationRadius,
|
|
231
|
+
fallback
|
|
232
|
+
}) => {
|
|
233
|
+
"worklet";
|
|
234
|
+
|
|
235
|
+
if (typeof value === "number") return value;
|
|
236
|
+
if (value === "auto") {
|
|
237
|
+
const from = sourceRadius ?? fallback;
|
|
238
|
+
const to = destinationRadius ?? fallback;
|
|
239
|
+
return (0, _reactNativeReanimated.interpolate)(progress, [0, 1], [from, to], "clamp");
|
|
240
|
+
}
|
|
241
|
+
if (value && typeof value === "object") {
|
|
242
|
+
const from = typeof value.from === "number" ? value.from : fallback;
|
|
243
|
+
const to = typeof value.to === "number" ? value.to : fallback;
|
|
244
|
+
return (0, _reactNativeReanimated.interpolate)(progress, [0, 1], [from, to], "clamp");
|
|
245
|
+
}
|
|
246
|
+
const from = sourceRadius ?? fallback;
|
|
247
|
+
const to = destinationRadius ?? fallback;
|
|
248
|
+
return (0, _reactNativeReanimated.interpolate)(progress, [0, 1], [from, to], "clamp");
|
|
249
|
+
};
|
|
250
|
+
const resolveMaskRadii = ({
|
|
251
|
+
progress,
|
|
252
|
+
zoomOptions,
|
|
253
|
+
resolvedPair
|
|
254
|
+
}) => {
|
|
255
|
+
"worklet";
|
|
256
|
+
|
|
257
|
+
const sourceStyles = resolvedPair.sourceStyles;
|
|
258
|
+
const destinationStyles = resolvedPair.destinationStyles;
|
|
259
|
+
const defaultRadius = resolveRadiusRange({
|
|
260
|
+
value: zoomOptions.mask.borderRadius,
|
|
261
|
+
progress,
|
|
262
|
+
sourceRadius: getStyleRadius(sourceStyles, "borderRadius"),
|
|
263
|
+
destinationRadius: getStyleRadius(destinationStyles, "borderRadius"),
|
|
264
|
+
fallback: 12
|
|
265
|
+
});
|
|
266
|
+
const topLeftValue = zoomOptions.mask.borderTopLeftRadius ?? zoomOptions.mask.borderRadius;
|
|
267
|
+
const topRightValue = zoomOptions.mask.borderTopRightRadius ?? zoomOptions.mask.borderRadius;
|
|
268
|
+
const bottomLeftValue = zoomOptions.mask.borderBottomLeftRadius ?? zoomOptions.mask.borderRadius;
|
|
269
|
+
const bottomRightValue = zoomOptions.mask.borderBottomRightRadius ?? zoomOptions.mask.borderRadius;
|
|
270
|
+
return {
|
|
271
|
+
borderRadius: defaultRadius,
|
|
272
|
+
borderTopLeftRadius: resolveRadiusRange({
|
|
273
|
+
value: topLeftValue,
|
|
274
|
+
progress,
|
|
275
|
+
sourceRadius: getStyleRadius(sourceStyles, "borderTopLeftRadius"),
|
|
276
|
+
destinationRadius: getStyleRadius(destinationStyles, "borderTopLeftRadius"),
|
|
277
|
+
fallback: defaultRadius
|
|
278
|
+
}),
|
|
279
|
+
borderTopRightRadius: resolveRadiusRange({
|
|
280
|
+
value: topRightValue,
|
|
281
|
+
progress,
|
|
282
|
+
sourceRadius: getStyleRadius(sourceStyles, "borderTopRightRadius"),
|
|
283
|
+
destinationRadius: getStyleRadius(destinationStyles, "borderTopRightRadius"),
|
|
284
|
+
fallback: defaultRadius
|
|
285
|
+
}),
|
|
286
|
+
borderBottomLeftRadius: resolveRadiusRange({
|
|
287
|
+
value: bottomLeftValue,
|
|
288
|
+
progress,
|
|
289
|
+
sourceRadius: getStyleRadius(sourceStyles, "borderBottomLeftRadius"),
|
|
290
|
+
destinationRadius: getStyleRadius(destinationStyles, "borderBottomLeftRadius"),
|
|
291
|
+
fallback: defaultRadius
|
|
292
|
+
}),
|
|
293
|
+
borderBottomRightRadius: resolveRadiusRange({
|
|
294
|
+
value: bottomRightValue,
|
|
295
|
+
progress,
|
|
296
|
+
sourceRadius: getStyleRadius(sourceStyles, "borderBottomRightRadius"),
|
|
297
|
+
destinationRadius: getStyleRadius(destinationStyles, "borderBottomRightRadius"),
|
|
298
|
+
fallback: defaultRadius
|
|
299
|
+
})
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
const buildZoomStyles = ({
|
|
303
|
+
id,
|
|
304
|
+
group,
|
|
305
|
+
zoomOptions,
|
|
306
|
+
props,
|
|
307
|
+
resolveTag,
|
|
308
|
+
computeRaw
|
|
309
|
+
}) => {
|
|
310
|
+
"worklet";
|
|
311
|
+
|
|
312
|
+
const focused = props.focused;
|
|
313
|
+
const progress = props.progress;
|
|
314
|
+
const currentRouteKey = props.current?.route.key;
|
|
315
|
+
const previousRouteKey = props.previous?.route.key;
|
|
316
|
+
const nextRouteKey = props.next?.route.key;
|
|
317
|
+
const entering = !props.next;
|
|
318
|
+
const screenLayout = props.layouts.screen;
|
|
319
|
+
const transitionContext = {
|
|
320
|
+
currentScreenKey: currentRouteKey,
|
|
321
|
+
previousScreenKey: previousRouteKey,
|
|
322
|
+
nextScreenKey: nextRouteKey,
|
|
323
|
+
entering
|
|
324
|
+
};
|
|
325
|
+
const resolvedConfig = (0, _config.resolveZoomConfig)({
|
|
326
|
+
id,
|
|
327
|
+
group,
|
|
328
|
+
zoomOptions,
|
|
329
|
+
currentRouteKey,
|
|
330
|
+
resolveTag,
|
|
331
|
+
defaultAnchor: "top"
|
|
332
|
+
});
|
|
333
|
+
if (!resolvedConfig) return _constants.NO_STYLES;
|
|
334
|
+
const {
|
|
335
|
+
resolvedTag,
|
|
336
|
+
sharedOptions,
|
|
337
|
+
explicitTarget,
|
|
338
|
+
zoomOptions: resolvedZoomOptions
|
|
339
|
+
} = resolvedConfig;
|
|
340
|
+
const resolvedPair = _bounds.BoundStore.resolveTransitionPair(resolvedTag, transitionContext);
|
|
341
|
+
const focusedVisibilityStyles = {
|
|
342
|
+
[resolvedTag]: {
|
|
343
|
+
style: {
|
|
344
|
+
opacity: 1
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
};
|
|
348
|
+
if (!resolvedPair.sourceBounds) {
|
|
349
|
+
return focused ? focusedVisibilityStyles : _constants.NO_STYLES;
|
|
350
|
+
}
|
|
351
|
+
const normX = props.active.gesture.normX;
|
|
352
|
+
const normY = props.active.gesture.normY;
|
|
353
|
+
const initialDirection = props.active.gesture.direction;
|
|
354
|
+
const dragX = normalizedToTranslation({
|
|
355
|
+
normalized: normX,
|
|
356
|
+
dimension: screenLayout.width,
|
|
357
|
+
resistance: resolvedZoomOptions.motion.dragResistance
|
|
358
|
+
});
|
|
359
|
+
const dragY = normalizedToTranslation({
|
|
360
|
+
normalized: normY,
|
|
361
|
+
dimension: screenLayout.height,
|
|
362
|
+
resistance: resolvedZoomOptions.motion.dragResistance
|
|
363
|
+
});
|
|
364
|
+
const dragXScale = initialDirection === "horizontal" || initialDirection === "horizontal-inverted" ? resolveDirectionalDragScale({
|
|
365
|
+
normalized: normX,
|
|
366
|
+
dismissDirection: initialDirection === "horizontal-inverted" ? "negative" : "positive",
|
|
367
|
+
shrinkMin: resolvedZoomOptions.motion.dragDirectionalScaleMin,
|
|
368
|
+
growMax: resolvedZoomOptions.motion.dragDirectionalScaleMax,
|
|
369
|
+
exponent: 2
|
|
370
|
+
}) : IDENTITY_DRAG_SCALE_OUTPUT[0];
|
|
371
|
+
const dragYScale = initialDirection === "vertical" || initialDirection === "vertical-inverted" ? resolveDirectionalDragScale({
|
|
372
|
+
normalized: normY,
|
|
373
|
+
dismissDirection: initialDirection === "vertical-inverted" ? "negative" : "positive",
|
|
374
|
+
shrinkMin: resolvedZoomOptions.motion.dragDirectionalScaleMin,
|
|
375
|
+
growMax: resolvedZoomOptions.motion.dragDirectionalScaleMax,
|
|
376
|
+
exponent: 2
|
|
377
|
+
}) : IDENTITY_DRAG_SCALE_OUTPUT[1];
|
|
378
|
+
const dragScale = combineScales(dragXScale, dragYScale);
|
|
379
|
+
if (focused) {
|
|
380
|
+
const contentTarget = getZoomContentTarget({
|
|
381
|
+
explicitTarget,
|
|
382
|
+
resolvedTag,
|
|
383
|
+
currentRouteKey,
|
|
384
|
+
previousRouteKey,
|
|
385
|
+
nextRouteKey,
|
|
386
|
+
entering,
|
|
387
|
+
screenLayout,
|
|
388
|
+
anchor: sharedOptions.anchor,
|
|
389
|
+
resolvedPair
|
|
390
|
+
});
|
|
391
|
+
const contentRaw = computeRaw({
|
|
392
|
+
...sharedOptions,
|
|
393
|
+
method: "content",
|
|
394
|
+
target: contentTarget
|
|
395
|
+
});
|
|
396
|
+
const maskRaw = computeRaw({
|
|
397
|
+
...sharedOptions,
|
|
398
|
+
method: "size",
|
|
399
|
+
space: "absolute",
|
|
400
|
+
target: "fullscreen"
|
|
401
|
+
});
|
|
402
|
+
const focusedFade = props.active?.closing ? (0, _reactNativeReanimated.interpolate)(progress, [0.6, 1], [0, 1], "clamp") : (0, _reactNativeReanimated.interpolate)(progress, [0, 0.5], [0, 1], "clamp");
|
|
403
|
+
const {
|
|
404
|
+
top,
|
|
405
|
+
right,
|
|
406
|
+
bottom,
|
|
407
|
+
left
|
|
408
|
+
} = resolvedZoomOptions.mask.outset;
|
|
409
|
+
const maskWidth = Math.max(1, (0, _config.toNumber)(maskRaw.width) + left + right);
|
|
410
|
+
const maskHeight = Math.max(1, (0, _config.toNumber)(maskRaw.height) + top + bottom);
|
|
411
|
+
const contentTranslateX = (0, _config.toNumber)(contentRaw.translateX) + dragX;
|
|
412
|
+
const contentTranslateY = (0, _config.toNumber)(contentRaw.translateY) + dragY;
|
|
413
|
+
const contentScale = (0, _config.toNumber)(contentRaw.scale, 1) * dragScale;
|
|
414
|
+
const maskTranslateX = (0, _config.toNumber)(maskRaw.translateX) + dragX - left;
|
|
415
|
+
const maskTranslateY = (0, _config.toNumber)(maskRaw.translateY) + dragY - top;
|
|
416
|
+
const maskRadii = resolveMaskRadii({
|
|
417
|
+
progress,
|
|
418
|
+
zoomOptions: resolvedZoomOptions,
|
|
419
|
+
resolvedPair
|
|
420
|
+
});
|
|
421
|
+
const focusedContentStyle = {
|
|
422
|
+
opacity: focusedFade,
|
|
423
|
+
transform: [{
|
|
424
|
+
translateX: contentTranslateX
|
|
425
|
+
}, {
|
|
426
|
+
translateY: contentTranslateY
|
|
427
|
+
}, {
|
|
428
|
+
scale: contentScale
|
|
429
|
+
}]
|
|
430
|
+
};
|
|
431
|
+
return {
|
|
432
|
+
[_constants.NAVIGATION_CONTAINER_STYLE_ID]: {
|
|
433
|
+
style: {
|
|
434
|
+
...focusedContentStyle
|
|
435
|
+
}
|
|
436
|
+
},
|
|
437
|
+
[_constants.NAVIGATION_MASK_STYLE_ID]: {
|
|
438
|
+
style: {
|
|
439
|
+
width: maskWidth,
|
|
440
|
+
height: maskHeight,
|
|
441
|
+
transform: [{
|
|
442
|
+
translateX: maskTranslateX
|
|
443
|
+
}, {
|
|
444
|
+
translateY: maskTranslateY
|
|
445
|
+
}, {
|
|
446
|
+
scale: dragScale
|
|
447
|
+
}],
|
|
448
|
+
borderRadius: maskRadii.borderRadius,
|
|
449
|
+
borderTopLeftRadius: maskRadii.borderTopLeftRadius,
|
|
450
|
+
borderTopRightRadius: maskRadii.borderTopRightRadius,
|
|
451
|
+
borderBottomLeftRadius: maskRadii.borderBottomLeftRadius,
|
|
452
|
+
borderBottomRightRadius: maskRadii.borderBottomRightRadius,
|
|
453
|
+
...(resolvedZoomOptions.mask.borderCurve ? {
|
|
454
|
+
borderCurve: resolvedZoomOptions.mask.borderCurve
|
|
455
|
+
} : {})
|
|
456
|
+
}
|
|
457
|
+
},
|
|
458
|
+
...focusedVisibilityStyles
|
|
459
|
+
};
|
|
460
|
+
}
|
|
461
|
+
const unfocusedFade = props.active?.closing ? (0, _reactNativeReanimated.interpolate)(progress, [1.6, 2], [1, 0], "clamp") : (0, _reactNativeReanimated.interpolate)(progress, [1, 1.5], [1, 0], "clamp");
|
|
462
|
+
const unfocusedScale = (0, _reactNativeReanimated.interpolate)(progress, [1, 2], [1, 0.95], "clamp");
|
|
463
|
+
const isUnfocusedIdle = props.active.settled === 1;
|
|
464
|
+
const elementTarget = sharedOptions.scaleMode === "match" ? "fullscreen" : getZoomContentTarget({
|
|
465
|
+
explicitTarget,
|
|
466
|
+
resolvedTag,
|
|
467
|
+
currentRouteKey,
|
|
468
|
+
previousRouteKey,
|
|
469
|
+
nextRouteKey,
|
|
470
|
+
entering,
|
|
471
|
+
screenLayout,
|
|
472
|
+
anchor: sharedOptions.anchor,
|
|
473
|
+
resolvedPair
|
|
474
|
+
});
|
|
475
|
+
const elementRaw = computeRaw({
|
|
476
|
+
...sharedOptions,
|
|
477
|
+
method: "transform",
|
|
478
|
+
space: "relative",
|
|
479
|
+
target: elementTarget
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
// Keep compensation tied to the element target's center. In `scaleMode: "match"`
|
|
483
|
+
// this target is fullscreen, so the center offset should resolve to zero.
|
|
484
|
+
const elementCenterY = typeof elementTarget === "object" ? elementTarget.pageY + elementTarget.height / 2 : screenLayout.height / 2;
|
|
485
|
+
const scaleShiftY = computeCenterScaleShift({
|
|
486
|
+
center: elementCenterY,
|
|
487
|
+
containerCenter: screenLayout.height / 2,
|
|
488
|
+
scale: dragScale
|
|
489
|
+
});
|
|
490
|
+
const compensatedGestureX = composeCompensatedTranslation({
|
|
491
|
+
gesture: dragX,
|
|
492
|
+
parentScale: unfocusedScale,
|
|
493
|
+
epsilon: _constants.EPSILON
|
|
494
|
+
});
|
|
495
|
+
// dragY is measured in screen space and must be unscaled by the parent
|
|
496
|
+
// content shrink, while scaleShiftY is already in the parent's local space.
|
|
497
|
+
const compensatedGestureY = composeCompensatedTranslation({
|
|
498
|
+
gesture: dragY,
|
|
499
|
+
parentScale: unfocusedScale,
|
|
500
|
+
centerShift: scaleShiftY,
|
|
501
|
+
epsilon: _constants.EPSILON
|
|
502
|
+
});
|
|
503
|
+
const elementTranslateX = (0, _config.toNumber)(elementRaw.translateX) + compensatedGestureX;
|
|
504
|
+
const elementTranslateY = (0, _config.toNumber)(elementRaw.translateY) + compensatedGestureY;
|
|
505
|
+
const elementScaleX = (0, _config.toNumber)(elementRaw.scaleX, 1) * dragScale;
|
|
506
|
+
const elementScaleY = (0, _config.toNumber)(elementRaw.scaleY, 1) * dragScale;
|
|
507
|
+
const resolvedElementStyle = isUnfocusedIdle ? {
|
|
508
|
+
transform: [{
|
|
509
|
+
translateX: 0
|
|
510
|
+
}, {
|
|
511
|
+
translateY: 0
|
|
512
|
+
}, {
|
|
513
|
+
scaleX: 1
|
|
514
|
+
}, {
|
|
515
|
+
scaleY: 1
|
|
516
|
+
}],
|
|
517
|
+
opacity: 0,
|
|
518
|
+
zIndex: 0,
|
|
519
|
+
elevation: 0
|
|
520
|
+
} : {
|
|
521
|
+
transform: [{
|
|
522
|
+
translateX: elementTranslateX
|
|
523
|
+
}, {
|
|
524
|
+
translateY: elementTranslateY
|
|
525
|
+
}, {
|
|
526
|
+
scaleX: elementScaleX
|
|
527
|
+
}, {
|
|
528
|
+
scaleY: elementScaleY
|
|
529
|
+
}],
|
|
530
|
+
opacity: unfocusedFade,
|
|
531
|
+
zIndex: 9999,
|
|
532
|
+
elevation: 9999
|
|
533
|
+
};
|
|
534
|
+
return {
|
|
535
|
+
content: {
|
|
536
|
+
style: {
|
|
537
|
+
transform: [{
|
|
538
|
+
scale: unfocusedScale
|
|
539
|
+
}]
|
|
540
|
+
}
|
|
541
|
+
},
|
|
542
|
+
[resolvedTag]: {
|
|
543
|
+
style: resolvedElementStyle
|
|
544
|
+
}
|
|
545
|
+
};
|
|
546
|
+
};
|
|
547
|
+
exports.buildZoomStyles = buildZoomStyles;
|
|
548
|
+
//# sourceMappingURL=build.js.map
|