react-native-screen-transitions 3.4.0-alpha.3 → 3.4.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/component-stack/components/component-screen.js +1 -1
- package/lib/commonjs/component-stack/components/component-screen.js.map +1 -1
- package/lib/commonjs/shared/animation/snap-to.js +6 -3
- package/lib/commonjs/shared/animation/snap-to.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +47 -4
- 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-initial-layout-handler.js +2 -2
- 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/index.js +6 -6
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/commonjs/shared/components/native-screen.js +3 -3
- package/lib/commonjs/shared/components/native-screen.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js +1 -1
- package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +18 -14
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +8 -5
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +12 -28
- 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 +17 -4
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js +4 -2
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js +6 -1
- 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 +13 -11
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/index.js +5 -3
- package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/commonjs/shared/configs/presets.js +3 -4
- package/lib/commonjs/shared/configs/presets.js.map +1 -1
- package/lib/commonjs/shared/constants.js +16 -2
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js +2 -2
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +12 -9
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-physics.js +3 -2
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-physics.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-reset.js +7 -5
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-reset.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js +5 -5
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-targets.js +9 -6
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-targets.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/register-direction-claims.js +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/register-direction-claims.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/use-build-gestures.js +1 -1
- package/lib/commonjs/shared/providers/gestures/use-build-gestures.js.map +1 -1
- package/lib/commonjs/shared/providers/register-bounds.provider.js +5 -5
- package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/has-transitions-enabled.js +17 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/has-transitions-enabled.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js +72 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +22 -108
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +42 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js +17 -3
- package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles.provider.js +4 -1
- package/lib/commonjs/shared/providers/screen/styles.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 +12 -40
- package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
- package/lib/commonjs/shared/stores/gesture.store.js +13 -33
- package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
- package/lib/commonjs/shared/stores/system.store.js +31 -0
- package/lib/commonjs/shared/stores/system.store.js.map +1 -0
- package/lib/commonjs/shared/types/bounds.types.js +1 -3
- package/lib/commonjs/shared/types/bounds.types.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +2 -2
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/index.js +23 -50
- package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/build.js +108 -362
- package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/config.js +15 -101
- package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/math.js +154 -0
- package/lib/commonjs/shared/utils/bounds/zoom/math.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/types.js +1 -3
- package/lib/commonjs/shared/utils/bounds/zoom/types.js.map +1 -1
- package/lib/commonjs/shared/utils/create-store.js +54 -0
- package/lib/commonjs/shared/utils/create-store.js.map +1 -0
- package/lib/module/component-stack/components/component-screen.js +1 -1
- package/lib/module/component-stack/components/component-screen.js.map +1 -1
- package/lib/module/shared/animation/snap-to.js +6 -3
- package/lib/module/shared/animation/snap-to.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +48 -5
- 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-initial-layout-handler.js +2 -2
- 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/index.js +6 -6
- package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/module/shared/components/native-screen.js +3 -3
- package/lib/module/shared/components/native-screen.js.map +1 -1
- package/lib/module/shared/components/screen-container/deferred-visibility-host.js +2 -2
- package/lib/module/shared/components/screen-container/deferred-visibility-host.js.map +1 -1
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +18 -14
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/backdrop.js +8 -5
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +13 -29
- 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 +19 -6
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js +4 -2
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js +6 -1
- 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 +13 -11
- package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/index.js +5 -3
- package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/module/shared/configs/presets.js +3 -4
- package/lib/module/shared/configs/presets.js.map +1 -1
- package/lib/module/shared/constants.js +16 -2
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/hooks/animation/use-associated-style.js +2 -2
- package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js +12 -9
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/gesture-physics.js +3 -2
- package/lib/module/shared/providers/gestures/helpers/gesture-physics.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/gesture-reset.js +7 -5
- package/lib/module/shared/providers/gestures/helpers/gesture-reset.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js +5 -5
- package/lib/module/shared/providers/gestures/helpers/gesture-snap-points.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/gesture-targets.js +9 -6
- package/lib/module/shared/providers/gestures/helpers/gesture-targets.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/register-direction-claims.js +1 -1
- package/lib/module/shared/providers/gestures/helpers/register-direction-claims.js.map +1 -1
- package/lib/module/shared/providers/gestures/use-build-gestures.js +1 -1
- package/lib/module/shared/providers/gestures/use-build-gestures.js.map +1 -1
- package/lib/module/shared/providers/register-bounds.provider.js +5 -5
- package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/has-transitions-enabled.js +12 -0
- package/lib/module/shared/providers/screen/animation/helpers/has-transitions-enabled.js.map +1 -0
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js +67 -0
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -0
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +22 -108
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +37 -0
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -0
- package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js +15 -2
- package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -1
- package/lib/module/shared/providers/screen/styles.provider.js +5 -2
- package/lib/module/shared/providers/screen/styles.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/direct.provider.js +1 -1
- package/lib/module/shared/providers/stack/direct.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/helpers/use-processed-routes.js +1 -1
- package/lib/module/shared/providers/stack/helpers/use-processed-routes.js.map +1 -1
- package/lib/module/shared/stores/animation.store.js +12 -40
- package/lib/module/shared/stores/animation.store.js.map +1 -1
- package/lib/module/shared/stores/gesture.store.js +13 -33
- package/lib/module/shared/stores/gesture.store.js.map +1 -1
- package/lib/module/shared/stores/system.store.js +27 -0
- package/lib/module/shared/stores/system.store.js.map +1 -0
- package/lib/module/shared/types/bounds.types.js +9 -1
- package/lib/module/shared/types/bounds.types.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +2 -2
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/index.js +23 -50
- package/lib/module/shared/utils/bounds/index.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/build.js +101 -355
- package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/config.js +12 -98
- package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/math.js +136 -0
- package/lib/module/shared/utils/bounds/zoom/math.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/types.js +1 -1
- package/lib/module/shared/utils/bounds/zoom/types.js.map +1 -1
- package/lib/module/shared/utils/create-store.js +50 -0
- package/lib/module/shared/utils/create-store.js.map +1 -0
- package/lib/typescript/shared/animation/snap-to.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +1 -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-initial-layout-handler.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -1
- 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.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts +2 -1
- 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 +2 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/index.d.ts.map +1 -1
- package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +3 -3
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-physics.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-reset.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts +2 -2
- package/lib/typescript/shared/providers/gestures/helpers/gesture-snap-points.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-targets.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/use-build-gestures.d.ts.map +1 -1
- package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/has-transitions-enabled.d.ts +8 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/has-transitions-enabled.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts +22 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts +4 -2
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +21 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts +6 -2
- package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -1
- package/lib/typescript/shared/stores/animation.store.d.ts +10 -17
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/gesture.store.d.ts +24 -14
- package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/system.store.d.ts +27 -0
- package/lib/typescript/shared/stores/system.store.d.ts.map +1 -0
- package/lib/typescript/shared/types/animation.types.d.ts +38 -9
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +14 -42
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +2 -2
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +11 -0
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts +3 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.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/index.d.ts +2 -3
- package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +2 -3
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +15 -41
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/math.d.ts +44 -0
- package/lib/typescript/shared/utils/bounds/zoom/math.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/zoom/types.d.ts +8 -13
- package/lib/typescript/shared/utils/bounds/zoom/types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/create-store.d.ts +14 -0
- package/lib/typescript/shared/utils/create-store.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/component-stack/components/component-screen.tsx +1 -1
- package/src/shared/animation/snap-to.ts +10 -4
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +1 -1
- package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +82 -10
- package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +2 -5
- package/src/shared/components/create-boundary-component/index.tsx +6 -12
- package/src/shared/components/native-screen.tsx +3 -9
- package/src/shared/components/screen-container/deferred-visibility-host.tsx +2 -2
- package/src/shared/components/screen-container/hooks/use-content-layout.ts +42 -43
- package/src/shared/components/screen-container/layers/backdrop.tsx +12 -6
- package/src/shared/components/screen-container/layers/content.tsx +17 -49
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +26 -5
- package/src/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.ts +4 -2
- package/src/shared/components/screen-lifecycle/hooks/use-close-transition/index.ts +8 -0
- package/src/shared/components/screen-lifecycle/hooks/use-open-transition.ts +21 -10
- package/src/shared/components/screen-lifecycle/index.tsx +8 -2
- package/src/shared/configs/presets.ts +8 -7
- package/src/shared/constants.ts +14 -0
- package/src/shared/hooks/animation/use-associated-style.ts +2 -8
- package/src/shared/index.ts +2 -0
- package/src/shared/providers/gestures/handlers/use-handlers.ts +13 -10
- package/src/shared/providers/gestures/helpers/gesture-physics.ts +4 -2
- package/src/shared/providers/gestures/helpers/gesture-reset.ts +9 -5
- package/src/shared/providers/gestures/helpers/gesture-snap-points.ts +12 -10
- package/src/shared/providers/gestures/helpers/gesture-targets.ts +14 -6
- package/src/shared/providers/gestures/helpers/register-direction-claims.ts +1 -1
- package/src/shared/providers/gestures/use-build-gestures.ts +1 -3
- package/src/shared/providers/register-bounds.provider.tsx +5 -11
- package/src/shared/providers/screen/animation/helpers/has-transitions-enabled.ts +14 -0
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state.ts +108 -0
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +37 -199
- package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +77 -0
- package/src/shared/providers/screen/helpers/resolve-interpolated-style-output.ts +24 -4
- package/src/shared/providers/screen/styles.provider.tsx +5 -1
- package/src/shared/providers/stack/direct.provider.tsx +1 -1
- package/src/shared/providers/stack/helpers/use-processed-routes.ts +1 -1
- package/src/shared/stores/animation.store.ts +11 -61
- package/src/shared/stores/gesture.store.ts +25 -45
- package/src/shared/stores/system.store.ts +44 -0
- package/src/shared/types/animation.types.ts +41 -9
- package/src/shared/types/bounds.types.ts +25 -25
- package/src/shared/types/index.ts +2 -0
- package/src/shared/types/screen.types.ts +12 -0
- package/src/shared/utils/animation/animate-to-progress.ts +4 -2
- package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +0 -1
- package/src/shared/utils/bounds/index.ts +26 -75
- package/src/shared/utils/bounds/zoom/build.ts +179 -502
- package/src/shared/utils/bounds/zoom/config.ts +14 -164
- package/src/shared/utils/bounds/zoom/math.ts +193 -0
- package/src/shared/utils/bounds/zoom/types.ts +15 -17
- package/src/shared/utils/create-store.ts +62 -0
- package/lib/commonjs/shared/utils/bounds/types/frame-props.js +0 -6
- package/lib/commonjs/shared/utils/bounds/types/frame-props.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/zoom/accessor.js +0 -54
- package/lib/commonjs/shared/utils/bounds/zoom/accessor.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/zoom/index.js +0 -20
- package/lib/commonjs/shared/utils/bounds/zoom/index.js.map +0 -1
- package/lib/module/shared/utils/bounds/types/frame-props.js +0 -4
- package/lib/module/shared/utils/bounds/types/frame-props.js.map +0 -1
- package/lib/module/shared/utils/bounds/zoom/accessor.js +0 -49
- package/lib/module/shared/utils/bounds/zoom/accessor.js.map +0 -1
- package/lib/module/shared/utils/bounds/zoom/index.js +0 -5
- package/lib/module/shared/utils/bounds/zoom/index.js.map +0 -1
- package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts +0 -5
- package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +0 -17
- package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/zoom/index.d.ts +0 -3
- package/lib/typescript/shared/utils/bounds/zoom/index.d.ts.map +0 -1
- package/src/shared/utils/bounds/types/frame-props.ts +0 -5
- package/src/shared/utils/bounds/zoom/accessor.ts +0 -69
- package/src/shared/utils/bounds/zoom/index.ts +0 -2
package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { useAnimatedReaction } from "react-native-reanimated";
|
|
3
|
+
import { useAnimatedReaction, useDerivedValue, useSharedValue } from "react-native-reanimated";
|
|
4
|
+
import { EPSILON } from "../../../constants";
|
|
5
|
+
import { AnimationStore } from "../../../stores/animation.store";
|
|
4
6
|
import { BoundStore } from "../../../stores/bounds";
|
|
7
|
+
import { GestureStore } from "../../../stores/gesture.store";
|
|
5
8
|
import { canFlushGroupActiveMeasurement, resolveGroupActiveMeasurementAction } from "./helpers/measurement-rules";
|
|
6
9
|
import { useDeferredMeasurementTrigger } from "./use-deferred-measurement-trigger";
|
|
7
10
|
|
|
@@ -17,18 +20,55 @@ export const useGroupActiveMeasurement = params => {
|
|
|
17
20
|
enabled,
|
|
18
21
|
group,
|
|
19
22
|
id,
|
|
23
|
+
currentScreenKey,
|
|
20
24
|
shouldUpdateDestination,
|
|
21
|
-
isAnimating,
|
|
22
25
|
maybeMeasureAndStore
|
|
23
26
|
} = params;
|
|
24
27
|
const idStr = String(id);
|
|
25
28
|
const allGroups = BoundStore.getGroups();
|
|
29
|
+
const progress = AnimationStore.getValue(currentScreenKey, "progress");
|
|
30
|
+
const animating = AnimationStore.getValue(currentScreenKey, "animating");
|
|
31
|
+
const entering = AnimationStore.getValue(currentScreenKey, "entering");
|
|
32
|
+
const closing = AnimationStore.getValue(currentScreenKey, "closing");
|
|
33
|
+
const dragging = GestureStore.getValue(currentScreenKey, "dragging");
|
|
34
|
+
const dismissing = GestureStore.getValue(currentScreenKey, "dismissing");
|
|
35
|
+
const hasSettledOpenOnce = useSharedValue(false);
|
|
36
|
+
useAnimatedReaction(() => {
|
|
37
|
+
"worklet";
|
|
38
|
+
|
|
39
|
+
if (!enabled || !shouldUpdateDestination) return false;
|
|
40
|
+
return progress.value >= 1 - EPSILON && animating.value === 0 && entering.value === 0 && closing.value === 0 && dragging.value === 0 && dismissing.value === 0;
|
|
41
|
+
}, isSettledOpen => {
|
|
42
|
+
"worklet";
|
|
43
|
+
|
|
44
|
+
if (isSettledOpen) {
|
|
45
|
+
hasSettledOpenOnce.value = true;
|
|
46
|
+
}
|
|
47
|
+
}, [enabled, shouldUpdateDestination, progress, animating, entering, closing, dragging, dismissing, hasSettledOpenOnce]);
|
|
48
|
+
const isRefreshBlocked = useDerivedValue(() => {
|
|
49
|
+
"worklet";
|
|
50
|
+
|
|
51
|
+
if (!enabled || !shouldUpdateDestination) return 0;
|
|
52
|
+
if (!hasSettledOpenOnce.value) return 1;
|
|
53
|
+
if (progress.value < 1 - EPSILON) return 1;
|
|
54
|
+
if (animating.value !== 0) return 1;
|
|
55
|
+
if (entering.value !== 0) return 1;
|
|
56
|
+
if (closing.value !== 0) return 1;
|
|
57
|
+
if (dragging.value !== 0) return 1;
|
|
58
|
+
if (dismissing.value !== 0) return 1;
|
|
59
|
+
return 0;
|
|
60
|
+
});
|
|
26
61
|
const {
|
|
27
62
|
clearPendingMeasurement,
|
|
28
63
|
queueOrFlushMeasurement
|
|
29
64
|
} = useDeferredMeasurementTrigger({
|
|
30
65
|
enabled,
|
|
31
|
-
|
|
66
|
+
/**
|
|
67
|
+
* The reason to do extra guard checks for isAnimating is because a user may mid animation drag, causing
|
|
68
|
+
* the src component to be wrongly measured. This in turns leads to faulty src measurements being used, giving us a weird teleport
|
|
69
|
+
* animation rather than a smooth 'SET' transition when dst is actually dismissing.
|
|
70
|
+
*/
|
|
71
|
+
isAnimating: isRefreshBlocked,
|
|
32
72
|
canFlush: () => {
|
|
33
73
|
"worklet";
|
|
34
74
|
|
|
@@ -37,7 +77,7 @@ export const useGroupActiveMeasurement = params => {
|
|
|
37
77
|
isEligible: !!group && shouldUpdateDestination,
|
|
38
78
|
memberId: idStr,
|
|
39
79
|
activeId: group ? allGroups.value[group]?.activeId ?? null : null
|
|
40
|
-
});
|
|
80
|
+
}) && hasSettledOpenOnce.value;
|
|
41
81
|
},
|
|
42
82
|
onFlush: () => {
|
|
43
83
|
"worklet";
|
|
@@ -68,8 +108,11 @@ export const useGroupActiveMeasurement = params => {
|
|
|
68
108
|
return;
|
|
69
109
|
}
|
|
70
110
|
if (action === "queue-or-flush") {
|
|
111
|
+
if (!hasSettledOpenOnce.value) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
71
114
|
queueOrFlushMeasurement();
|
|
72
115
|
}
|
|
73
|
-
}, [enabled, group, idStr, shouldUpdateDestination, clearPendingMeasurement, queueOrFlushMeasurement]);
|
|
116
|
+
}, [enabled, group, idStr, currentScreenKey, shouldUpdateDestination, hasSettledOpenOnce, clearPendingMeasurement, queueOrFlushMeasurement]);
|
|
74
117
|
};
|
|
75
118
|
//# sourceMappingURL=use-group-active-measurement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useAnimatedReaction","BoundStore","canFlushGroupActiveMeasurement","resolveGroupActiveMeasurementAction","useDeferredMeasurementTrigger","useGroupActiveMeasurement","params","enabled","group","id","
|
|
1
|
+
{"version":3,"names":["useAnimatedReaction","useDerivedValue","useSharedValue","EPSILON","AnimationStore","BoundStore","GestureStore","canFlushGroupActiveMeasurement","resolveGroupActiveMeasurementAction","useDeferredMeasurementTrigger","useGroupActiveMeasurement","params","enabled","group","id","currentScreenKey","shouldUpdateDestination","maybeMeasureAndStore","idStr","String","allGroups","getGroups","progress","getValue","animating","entering","closing","dragging","dismissing","hasSettledOpenOnce","value","isSettledOpen","isRefreshBlocked","clearPendingMeasurement","queueOrFlushMeasurement","isAnimating","canFlush","isEligible","memberId","activeId","onFlush","intent","previousActiveId","action"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-group-active-measurement.ts"],"mappings":";;AAAA,SACCA,mBAAmB,EACnBC,eAAe,EACfC,cAAc,QACR,yBAAyB;AAChC,SAASC,OAAO,QAAQ,oBAAoB;AAC5C,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,YAAY,QAAQ,+BAA+B;AAE5D,SACCC,8BAA8B,EAC9BC,mCAAmC,QAC7B,6BAA6B;AACpC,SAASC,6BAA6B,QAAQ,oCAAoC;;AAElF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,yBAAyB,GAAIC,MAOzC,IAAK;EACL,MAAM;IACLC,OAAO;IACPC,KAAK;IACLC,EAAE;IACFC,gBAAgB;IAChBC,uBAAuB;IACvBC;EACD,CAAC,GAAGN,MAAM;EACV,MAAMO,KAAK,GAAGC,MAAM,CAACL,EAAE,CAAC;EAExB,MAAMM,SAAS,GAAGf,UAAU,CAACgB,SAAS,CAAC,CAAC;EACxC,MAAMC,QAAQ,GAAGlB,cAAc,CAACmB,QAAQ,CAACR,gBAAgB,EAAE,UAAU,CAAC;EACtE,MAAMS,SAAS,G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EAChD,CAAC,EACD,CAACA,QAAQ,EAAEG,gBAAgB,KAAK;IAC/B,SAAS;;IACT,MAAMC,MAAM,GAAGnC,mCAAmC,CAAC;MAClDI,OAAO;MACPyB,UAAU,EAAE,CAAC,CAACxB,KAAK,IAAIG,uBAAuB;MAC9CsB,QAAQ,EAAEpB,KAAK;MACfqB,QAAQ;MACRG;IACD,CAAC,CAAC;IAEF,IAAIC,MAAM,KAAK,eAAe,EAAE;MAC/BV,uBAAuB,CAAC,CAAC;MACzB;IACD;IAEA,IAAIU,MAAM,KAAK,gBAAgB,EAAE;MAChC,IAAI,CAACd,kBAAkB,CAACC,KAAK,EAAE;QAC9B;MACD;MACAI,uBAAuB,CAAC,CAAC;IAC1B;EACD,CAAC,EACD,CACCtB,OAAO,EACPC,KAAK,EACLK,KAAK,EACLH,gBAAgB,EAChBC,uBAAuB,EACvBa,kBAAkB,EAClBI,uBAAuB,EACvBC,uBAAuB,CAEzB,CAAC;AACF,CAAC","ignoreList":[]}
|
package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js
CHANGED
|
@@ -15,8 +15,8 @@ export const useInitialLayoutHandler = params => {
|
|
|
15
15
|
expectedSourceScreenKey,
|
|
16
16
|
maybeMeasureAndStore
|
|
17
17
|
} = params;
|
|
18
|
-
const isAnimating = AnimationStore.
|
|
19
|
-
const ancestorAnimations = ancestorKeys.map(key => AnimationStore.
|
|
18
|
+
const isAnimating = AnimationStore.getValue(currentScreenKey, "animating");
|
|
19
|
+
const ancestorAnimations = ancestorKeys.map(key => AnimationStore.getValue(key, "animating"));
|
|
20
20
|
const hasMeasuredOnLayout = useSharedValue(false);
|
|
21
21
|
const handleInitialLayout = useCallback(() => {
|
|
22
22
|
"worklet";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useLayoutEffect","runOnUI","useSharedValue","AnimationStore","BoundStore","resolvePendingSourceKey","resolveInitialLayoutMeasurementIntent","useInitialLayoutHandler","params","enabled","sharedBoundTag","currentScreenKey","ancestorKeys","expectedSourceScreenKey","maybeMeasureAndStore","isAnimating","
|
|
1
|
+
{"version":3,"names":["useCallback","useLayoutEffect","runOnUI","useSharedValue","AnimationStore","BoundStore","resolvePendingSourceKey","resolveInitialLayoutMeasurementIntent","useInitialLayoutHandler","params","enabled","sharedBoundTag","currentScreenKey","ancestorKeys","expectedSourceScreenKey","maybeMeasureAndStore","isAnimating","getValue","ancestorAnimations","map","key","hasMeasuredOnLayout","handleInitialLayout","get","isAnyAnimating","i","length","hasPendingLinkFromSource","resolvedSourceKey","intent","hasSharedBoundTag","set"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,eAAe,QAAQ,OAAO;AACpD,SAASC,OAAO,EAAEC,cAAc,QAAQ,yBAAyB;AACjE,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,uBAAuB,QAAQ,uCAAuC;AAE/E,SAASC,qCAAqC,QAAQ,6BAA6B;AAEnF,OAAO,MAAMC,uBAAuB,GAAIC,MAOvC,IAAK;EACL,MAAM;IACLC,OAAO;IACPC,cAAc;IACdC,gBAAgB;IAChBC,YAAY;IACZC,uBAAuB;IACvBC;EACD,CAAC,GAAGN,MAAM;EAEV,MAAMO,WAAW,GAAGZ,cAAc,CAACa,QAAQ,CAACL,gBAAgB,EAAE,WAAW,CAAC;EAE1E,MAAMM,kBAAkB,GAAGL,YAAY,CAACM,GAAG,CAAEC,GAAG,IAC/ChB,cAAc,CAACa,QAAQ,CAACG,GAAG,EAAE,WAAW,CACzC,CAAC;EAED,MAAMC,mBAAmB,GAAGlB,cAAc,CAAC,KAAK,CAAC;EAEjD,MAAMmB,mBAAmB,GAAGtB,WAAW,CAAC,MAAM;IAC7C,SAAS;;IACT,IAAI,CAACU,OAAO,EAAE;IACd,IAAI,CAACC,cAAc,IAAIU,mBAAmB,CAACE,GA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@ export function createBoundaryComponent(Wrapped, options = {}) {
|
|
|
72
72
|
method
|
|
73
73
|
};
|
|
74
74
|
}, [anchor, scaleMode, target, method]);
|
|
75
|
-
const isAnimating = AnimationStore.
|
|
76
|
-
const progress = AnimationStore.
|
|
75
|
+
const isAnimating = AnimationStore.getValue(currentScreenKey, "animating");
|
|
76
|
+
const progress = AnimationStore.getValue(currentScreenKey, "progress");
|
|
77
77
|
const preparedStyles = useMemo(() => prepareStyleForBounds(style), [style]);
|
|
78
78
|
const {
|
|
79
79
|
associatedStyles
|
|
@@ -144,14 +144,14 @@ export function createBoundaryComponent(Wrapped, options = {}) {
|
|
|
144
144
|
enabled: runtimeEnabled,
|
|
145
145
|
group,
|
|
146
146
|
id,
|
|
147
|
+
currentScreenKey,
|
|
147
148
|
shouldUpdateDestination,
|
|
148
|
-
isAnimating,
|
|
149
149
|
maybeMeasureAndStore
|
|
150
150
|
});
|
|
151
151
|
|
|
152
|
-
// Source-side
|
|
153
|
-
//
|
|
154
|
-
//
|
|
152
|
+
// Source-side grouped retargeting: when an unfocused/source boundary
|
|
153
|
+
// becomes the active member, refresh its snapshot and source link so
|
|
154
|
+
// close transitions do not use stale pre-scroll geometry.
|
|
155
155
|
useGroupActiveSourceMeasurement({
|
|
156
156
|
enabled: runtimeEnabled,
|
|
157
157
|
group,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","memo","useCallback","useMemo","Pressable","View","RNView","Animated","runOnUI","useAnimatedRef","useAssociatedStyles","useLayoutAnchorContext","useDescriptorDerivations","AnimationStore","BoundStore","prepareStyleForBounds","useAutoSourceMeasurement","useBoundaryMeasureAndStore","useBoundaryPresence","useGroupActiveMeasurement","useGroupActiveSourceMeasurement","useInitialLayoutHandler","usePendingDestinationMeasurement","usePendingDestinationRetryMeasurement","useScrollSettledMeasurement","buildBoundaryMatchKey","jsx","_jsx","setGroupSelectionOnUI","group","id","setGroupActiveId","createBoundaryComponent","Wrapped","options","alreadyAnimated","AnimatedComponent","createAnimatedComponent","Inner","props","_ref","enabled","anchor","scaleMode","target","method","style","onPress","rest","sharedBoundTag","animatedRef","previousScreenKey","preferredSourceScreenKey","currentScreenKey","nextScreenKey","ancestorKeys","navigatorKey","ancestorNavigatorKeys","hasConfiguredInterpolator","runtimeEnabled","hasNextScreen","shouldUpdateDestination","layoutAnchor","boundaryConfig","undefined","isAnimating","
|
|
1
|
+
{"version":3,"names":["forwardRef","memo","useCallback","useMemo","Pressable","View","RNView","Animated","runOnUI","useAnimatedRef","useAssociatedStyles","useLayoutAnchorContext","useDescriptorDerivations","AnimationStore","BoundStore","prepareStyleForBounds","useAutoSourceMeasurement","useBoundaryMeasureAndStore","useBoundaryPresence","useGroupActiveMeasurement","useGroupActiveSourceMeasurement","useInitialLayoutHandler","usePendingDestinationMeasurement","usePendingDestinationRetryMeasurement","useScrollSettledMeasurement","buildBoundaryMatchKey","jsx","_jsx","setGroupSelectionOnUI","group","id","setGroupActiveId","createBoundaryComponent","Wrapped","options","alreadyAnimated","AnimatedComponent","createAnimatedComponent","Inner","props","_ref","enabled","anchor","scaleMode","target","method","style","onPress","rest","sharedBoundTag","animatedRef","previousScreenKey","preferredSourceScreenKey","currentScreenKey","nextScreenKey","ancestorKeys","navigatorKey","ancestorNavigatorKeys","hasConfiguredInterpolator","runtimeEnabled","hasNextScreen","shouldUpdateDestination","layoutAnchor","boundaryConfig","undefined","isAnimating","getValue","progress","preparedStyles","associatedStyles","resetTransformOnUnset","maybeMeasureAndStore","shouldRunDestinationEffects","expectedSourceScreenKey","animating","handlePress","args","String","intent","resolvedOnPress","ref","collapsable","BoundaryView","displayName","BoundaryPressable","Boundary"],"sourceRoot":"../../../../../src","sources":["shared/components/create-boundary-component/index.tsx"],"mappings":";;AAAA,SAECA,UAAU,EACVC,IAAI,EACJC,WAAW,EACXC,OAAO,QACD,OAAO;AACd,SAASC,SAAS,EAAEC,IAAI,IAAIC,MAAM,QAAmB,cAAc;AACnE,OAAOC,QAAQ,IAAI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AiB,CAACD,WAAW,GAAG,+BAA+B;;AAE/D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAME,QAAQ,GAAG;EACvB;EACAhF,IAAI,EAAE6E,YAAY;EAClB;EACA9E,SAAS,EAAEgF;AACZ,CAAC","ignoreList":[]}
|
|
@@ -42,9 +42,9 @@ export const NativeScreen = ({
|
|
|
42
42
|
const topIndex = routesLength - 1;
|
|
43
43
|
const topRouteKey = routes[topIndex]?.key ?? routeKey;
|
|
44
44
|
const screenRef = useAnimatedRef();
|
|
45
|
-
const sceneClosing = AnimationStore.
|
|
46
|
-
const topSceneProgress = AnimationStore.
|
|
47
|
-
const topSceneClosing = AnimationStore.
|
|
45
|
+
const sceneClosing = AnimationStore.getValue(routeKey, "closing");
|
|
46
|
+
const topSceneProgress = AnimationStore.getValue(topRouteKey, "progress");
|
|
47
|
+
const topSceneClosing = AnimationStore.getValue(topRouteKey, "closing");
|
|
48
48
|
const screenActivity = useSharedValue(ScreenActivity.TRANSITIONING_OR_BELOW_TOP);
|
|
49
49
|
useDerivedValue(() => {
|
|
50
50
|
if (!topSceneProgress) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StyleSheet","Animated","Extrapolation","interpolate","useAnimatedProps","useAnimatedRef","useDerivedValue","useSharedValue","Screen","RNSScreen","EPSILON","useStack","LayoutAnchorProvider","useManagedStackContext","AnimationStore","jsx","_jsx","PASSTHROUGH","ScreenActivity","POINT_NONE","POINT_BOX_NONE","AnimatedNativeScreen","createAnimatedComponent","NativeScreen","routeKey","index","isPreloaded","children","freezeOnBlur","shouldFreeze","flags","DISABLE_NATIVE_SCREENS","routes","optimisticFocusedIndex","activeScreensLimit","backdropBehaviors","routesLength","length","topIndex","topRouteKey","key","screenRef","sceneClosing","
|
|
1
|
+
{"version":3,"names":["StyleSheet","Animated","Extrapolation","interpolate","useAnimatedProps","useAnimatedRef","useDerivedValue","useSharedValue","Screen","RNSScreen","EPSILON","useStack","LayoutAnchorProvider","useManagedStackContext","AnimationStore","jsx","_jsx","PASSTHROUGH","ScreenActivity","POINT_NONE","POINT_BOX_NONE","AnimatedNativeScreen","createAnimatedComponent","NativeScreen","routeKey","index","isPreloaded","children","freezeOnBlur","shouldFreeze","flags","DISABLE_NATIVE_SCREENS","routes","optimisticFocusedIndex","activeScreensLimit","backdropBehaviors","routesLength","length","topIndex","topRouteKey","key","screenRef","sceneClosing","getValue","topSceneProgress","topSceneClosing","screenActivity","TRANSITIONING_OR_BELOW_TOP","set","INACTIVE","focusedIndex","value","topIsClosing","get","postCloseActiveStart","Math","max","next","ON_TOP","outputValue","v","CLAMP","trunc","animatedProps","activity","isClosing","activeIndex","isActive","activeBackdrop","activeAllowsPassthrough","isAllowedPassthroughBelow","pointerEvents","activityState","View","ref","collapsable","style","absoluteFill","anchorRef","enabled"],"sourceRoot":"../../../../src","sources":["shared/components/native-screen.tsx"],"mappings":";;AACA,SAASA,UAAU,QAAmB,cAAc;AACpD,OAAOC,QAAQ,IACdC,aAAa,EACbC,WAAW,EACXC,gBAAgB,EAChBC,cAAc,EACdC,eAAe,EACfC,cAAc,QACR,yBAAyB;AAChC,SAASC,MAAM,IAAIC,SAAS,QAAQ,sBAAsB;AAC1D,SAASC,OAAO,QAAQ,cAAc;AACtC,SAASC,QAAQ,QAAQ,+BAA+B;AACxD,SAASC,oBAAoB,QAAQ,qCAAqC;AAC1E,SAASC,sBAAsB,QAAQ,qCAAqC;AAC5E,SAASC,cAAc,QAAQ,2BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3D,MAAMC,WAAW,GAAG,aAAa;AAAC,IAU7BC,cAAc,0BAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAdA,cAAc,CAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA,EAAdA,cAAc;AAMnB,MAAMC,UAAU,GAAG,MAAe;AAClC,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AAO;IACPL,GAAG,EAAEjC,SAAU;IACfmC,KAAK,EAAE5E,UAAU,CAAC6E,YAAa;IAC/BjD,YAAY,EAAEA,YAAa;IAC3BmC,aAAa,EAAEA,aAAc;IAAApC,QAAA,eAE7BX,IAAA,CAACJ,oBAAoB;MAACkE,SAAS,EAAErC,SAAU;MAAAd,QAAA,EACzCA;IAAQ,CACY;EAAC,CACF,CAAC;AAEzB,CAAC","ignoreList":[]}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { memo } from "react";
|
|
4
4
|
import { StyleSheet } from "react-native";
|
|
5
5
|
import Animated, { useAnimatedStyle } from "react-native-reanimated";
|
|
6
|
-
import { HIDDEN_STYLE,
|
|
6
|
+
import { HIDDEN_STYLE, VISIBLE_STYLE } from "../../constants";
|
|
7
7
|
import { useScreenStyles } from "../../providers/screen/styles.provider";
|
|
8
8
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
9
|
/**
|
|
@@ -22,7 +22,7 @@ export const DeferredVisibilityHost = /*#__PURE__*/memo(({
|
|
|
22
22
|
const animatedStyle = useAnimatedStyle(() => {
|
|
23
23
|
"worklet";
|
|
24
24
|
|
|
25
|
-
return resolutionMode.value === "deferred" ? HIDDEN_STYLE :
|
|
25
|
+
return resolutionMode.value === "deferred" ? HIDDEN_STYLE : VISIBLE_STYLE;
|
|
26
26
|
});
|
|
27
27
|
return /*#__PURE__*/_jsx(Animated.View, {
|
|
28
28
|
collapsable: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memo","StyleSheet","Animated","useAnimatedStyle","HIDDEN_STYLE","
|
|
1
|
+
{"version":3,"names":["memo","StyleSheet","Animated","useAnimatedStyle","HIDDEN_STYLE","VISIBLE_STYLE","useScreenStyles","jsx","_jsx","DeferredVisibilityHost","children","resolutionMode","animatedStyle","value","View","collapsable","style","styles","host","create","flex"],"sourceRoot":"../../../../../src","sources":["shared/components/screen-container/deferred-visibility-host.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,QAAQ,IAAIC,gBAAgB,QAAQ,yBAAyB;AACpE,SAASC,YAAY,EAAEC,aAAa,QAAQ,iBAAiB;AAC7D,SAASC,eAAe,QAAQ,wCAAwC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,gBAAGT,IAAI,CAAC,CAAC;EAAEU;AAAgB,CAAC,KAAK;EACnE,MAAM;IAAEC;EAAe,CAAC,GAAGL,eAAe,CAAC,CAAC;EAE5C,MAAMM,aAAa,GAAGT,gBAAgB,CAAC,MAAM;IAC5C,SAAS;;IACT,OAAOQ,cAAc,CAACE,KAAK,KAAK,UAAU,GAAGT,YAAY,GAAGC,aAAa;EAC1E,CAAC,CAAC;EAEF,oBACCG,IAAA,CAACN,QAAQ,CAACY,IAAI;IAACC,WAAW,EAAE,KAAM;IAACC,KAAK,EAAE,CAACC,MAAM,CAACC,IAAI,EAAEN,aAAa,CAAE;IAAAF,QAAA,EACrEA;EAAQ,CACK,CAAC;AAElB,CAAC,CAAC;AAEF,MAAMO,MAAM,GAAGhB,UAAU,CAACkB,MAAM,CAAC;EAChCD,IAAI,EAAE;IACLE,IAAI,EAAE;EACP;AACD,CAAC,CAAC","ignoreList":[]}
|
|
@@ -5,6 +5,7 @@ import { useWindowDimensions } from "react-native";
|
|
|
5
5
|
import { runOnUI } from "react-native-reanimated";
|
|
6
6
|
import { useDescriptorDerivations, useDescriptors } from "../../../providers/screen/descriptors";
|
|
7
7
|
import { AnimationStore } from "../../../stores/animation.store";
|
|
8
|
+
import { SystemStore } from "../../../stores/system.store";
|
|
8
9
|
import { animateToProgress } from "../../../utils/animation/animate-to-progress";
|
|
9
10
|
export function useContentLayout() {
|
|
10
11
|
const {
|
|
@@ -17,9 +18,12 @@ export function useContentLayout() {
|
|
|
17
18
|
height: screenHeight
|
|
18
19
|
} = useWindowDimensions();
|
|
19
20
|
const routeKey = current.route.key;
|
|
20
|
-
const animations = AnimationStore.
|
|
21
|
-
const
|
|
22
|
-
const
|
|
21
|
+
const animations = AnimationStore.getBag(routeKey);
|
|
22
|
+
const targetProgressValue = SystemStore.getValue(routeKey, "targetProgress");
|
|
23
|
+
const resolvedAutoSnapPointValue = SystemStore.getValue(routeKey, "resolvedAutoSnapPoint");
|
|
24
|
+
const measuredContentLayoutValue = SystemStore.getValue(routeKey, "measuredContentLayout");
|
|
25
|
+
const experimental_animateOnInitialMount = current.options.experimental_animateOnInitialMount;
|
|
26
|
+
const transitionSpec = current.options.transitionSpec;
|
|
23
27
|
return useCallback(event => {
|
|
24
28
|
const {
|
|
25
29
|
width,
|
|
@@ -27,30 +31,30 @@ export function useContentLayout() {
|
|
|
27
31
|
} = event.nativeEvent.layout;
|
|
28
32
|
if (width <= 0 || height <= 0) return;
|
|
29
33
|
const fraction = Math.min(height / screenHeight, 1);
|
|
30
|
-
|
|
31
|
-
runOnUI((nextWidth, nextHeight, nextFraction, isInitialScreen, spec) => {
|
|
34
|
+
runOnUI((nextWidth, nextHeight, nextFraction) => {
|
|
32
35
|
"worklet";
|
|
33
36
|
|
|
34
|
-
|
|
37
|
+
measuredContentLayoutValue.value = {
|
|
35
38
|
width: nextWidth,
|
|
36
39
|
height: nextHeight
|
|
37
40
|
};
|
|
38
|
-
const isFirstMeasurement =
|
|
39
|
-
|
|
41
|
+
const isFirstMeasurement = resolvedAutoSnapPointValue.value <= 0;
|
|
42
|
+
resolvedAutoSnapPointValue.value = nextFraction;
|
|
40
43
|
if (!isFirstMeasurement || animations.progress.value !== 0 || animations.animating.value !== 0) {
|
|
41
44
|
return;
|
|
42
45
|
}
|
|
43
|
-
if (
|
|
44
|
-
|
|
46
|
+
if (isFirstKey && !experimental_animateOnInitialMount) {
|
|
47
|
+
targetProgressValue.value = nextFraction;
|
|
45
48
|
animations.progress.value = nextFraction;
|
|
46
49
|
return;
|
|
47
50
|
}
|
|
48
51
|
animateToProgress({
|
|
49
52
|
target: nextFraction,
|
|
50
|
-
spec,
|
|
51
|
-
animations
|
|
53
|
+
spec: transitionSpec,
|
|
54
|
+
animations,
|
|
55
|
+
targetProgress: targetProgressValue
|
|
52
56
|
});
|
|
53
|
-
})(width, height, fraction
|
|
54
|
-
}, [animations,
|
|
57
|
+
})(width, height, fraction);
|
|
58
|
+
}, [animations, targetProgressValue, resolvedAutoSnapPointValue, measuredContentLayoutValue, isFirstKey, screenHeight, experimental_animateOnInitialMount, transitionSpec]);
|
|
55
59
|
}
|
|
56
60
|
//# sourceMappingURL=use-content-layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useWindowDimensions","runOnUI","useDescriptorDerivations","useDescriptors","AnimationStore","animateToProgress","useContentLayout","current","isFirstKey","height","screenHeight","routeKey","route","key","animations","
|
|
1
|
+
{"version":3,"names":["useCallback","useWindowDimensions","runOnUI","useDescriptorDerivations","useDescriptors","AnimationStore","SystemStore","animateToProgress","useContentLayout","current","isFirstKey","height","screenHeight","routeKey","route","key","animations","getBag","targetProgressValue","getValue","resolvedAutoSnapPointValue","measuredContentLayoutValue","experimental_animateOnInitialMount","options","transitionSpec","event","width","nativeEvent","layout","fraction","Math","min","nextWidth","nextHeight","nextFraction","value","isFirstMeasurement","progress","animating","target","spec","targetProgress"],"sourceRoot":"../../../../../../src","sources":["shared/components/screen-container/hooks/use-content-layout.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,OAAO;AACnC,SAAiCC,mBAAmB,QAAQ,cAAc;AAC1E,SAASC,OAAO,QAAQ,yBAAyB;AACjD,SACCC,wBAAwB,EACxBC,cAAc,QACR,uCAAuC;AAC9C,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,iBAAiB,QAAQ,8CAA8C;AAEhF,OAAO,SAASC,gBAAgBA,CAAA,EAAG;EAClC,MAAM;IAAEC;EAAQ,C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nBpB,UAAU,CAACqB,QAAQ,CAACF,KAAK,KAAK,CAAC,IAC/BnB,UAAU,CAACsB,SAAS,CAACH,KAAK,KAAK,CAAC,EAC/B;QACD;MACD;MAEA,IAAIzB,UAAU,IAAI,CAACY,kCAAkC,EAAE;QACtDJ,mBAAmB,CAACiB,KAAK,GAAGD,YAAY;QACxClB,UAAU,CAACqB,QAAQ,CAACF,KAAK,GAAGD,YAAY;QACxC;MACD;MAEA3B,iBAAiB,CAAC;QACjBgC,MAAM,EAAEL,YAAY;QACpBM,IAAI,EAAEhB,cAAc;QACpBR,UAAU;QACVyB,cAAc,EAAEvB;MACjB,CAAC,CAAC;IACH,CAAC,CAAC,CAACQ,KAAK,EAAEf,MAAM,EAAEkB,QAAQ,CAAC;EAC5B,CAAC,EACD,CACCb,UAAU,EACVE,mBAAmB,EACnBE,0BAA0B,EAC1BC,0BAA0B,EAC1BX,UAAU,EACVE,YAAY,EACZU,kCAAkC,EAClCE,cAAc,CAEhB,CAAC;AACF","ignoreList":[]}
|
|
@@ -10,6 +10,7 @@ import { useDescriptors } from "../../../providers/screen/descriptors";
|
|
|
10
10
|
import { useScreenStyles } from "../../../providers/screen/styles.provider";
|
|
11
11
|
import { AnimationStore } from "../../../stores/animation.store";
|
|
12
12
|
import { GestureStore } from "../../../stores/gesture.store";
|
|
13
|
+
import { SystemStore } from "../../../stores/system.store";
|
|
13
14
|
import { animateToProgress } from "../../../utils/animation/animate-to-progress";
|
|
14
15
|
import { findCollapseTarget } from "../../../utils/gesture/find-collapse-target";
|
|
15
16
|
import { useBackdropPointerEvents } from "../hooks/use-backdrop-pointer-events";
|
|
@@ -30,8 +31,9 @@ export const BackdropLayer = /*#__PURE__*/memo(function BackdropLayer() {
|
|
|
30
31
|
} = useBackdropPointerEvents();
|
|
31
32
|
const BackdropComponent = current.options.backdropComponent;
|
|
32
33
|
const routeKey = current.route.key;
|
|
33
|
-
const animations = AnimationStore.
|
|
34
|
-
const
|
|
34
|
+
const animations = AnimationStore.getBag(routeKey);
|
|
35
|
+
const targetProgressValue = SystemStore.getValue(routeKey, "targetProgress");
|
|
36
|
+
const resolvedAutoSnapPointValue = SystemStore.getValue(routeKey, "resolvedAutoSnapPoint");
|
|
35
37
|
const AnimatedBackdropComponent = useMemo(() => BackdropComponent ? Animated.createAnimatedComponent(BackdropComponent) : null, [BackdropComponent]);
|
|
36
38
|
const handleBackdropPress = useCallback(() => {
|
|
37
39
|
if (backdropBehavior === "dismiss") {
|
|
@@ -47,12 +49,12 @@ export const BackdropLayer = /*#__PURE__*/memo(function BackdropLayer() {
|
|
|
47
49
|
dismissScreen();
|
|
48
50
|
return;
|
|
49
51
|
}
|
|
50
|
-
const gestures = GestureStore.
|
|
52
|
+
const gestures = GestureStore.getBag(routeKey);
|
|
51
53
|
const transitionSpec = current.options.transitionSpec;
|
|
52
54
|
runOnUI(() => {
|
|
53
55
|
"worklet";
|
|
54
56
|
|
|
55
|
-
const resolvedSnaps = rawSnapPoints.map(point => point === "auto" ?
|
|
57
|
+
const resolvedSnaps = rawSnapPoints.map(point => point === "auto" ? resolvedAutoSnapPointValue.value : point).filter(point => typeof point === "number");
|
|
56
58
|
const {
|
|
57
59
|
target,
|
|
58
60
|
shouldDismiss
|
|
@@ -69,11 +71,12 @@ export const BackdropLayer = /*#__PURE__*/memo(function BackdropLayer() {
|
|
|
69
71
|
target,
|
|
70
72
|
spec,
|
|
71
73
|
animations,
|
|
74
|
+
targetProgress: targetProgressValue,
|
|
72
75
|
onAnimationFinish: shouldDismiss ? dismissScreen : undefined
|
|
73
76
|
});
|
|
74
77
|
})();
|
|
75
78
|
}
|
|
76
|
-
}, [animations,
|
|
79
|
+
}, [animations, targetProgressValue, resolvedAutoSnapPointValue, backdropBehavior, current, dismissScreen, routeKey]);
|
|
77
80
|
const animatedBackdropStyle = useAnimatedStyle(() => {
|
|
78
81
|
"worklet";
|
|
79
82
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memo","useCallback","useMemo","Pressable","StyleSheet","Animated","runOnUI","useAnimatedProps","useAnimatedStyle","DefaultSnapSpec","NO_PROPS","NO_STYLES","useNavigationHelpers","useDescriptors","useScreenStyles","AnimationStore","GestureStore","animateToProgress","findCollapseTarget","useBackdropPointerEvents","jsx","_jsx","jsxs","_jsxs","BackdropLayer","stylesMap","current","dismissScreen","isBackdropActive","backdropBehavior","BackdropComponent","options","backdropComponent","routeKey","route","key","animations","
|
|
1
|
+
{"version":3,"names":["memo","useCallback","useMemo","Pressable","StyleSheet","Animated","runOnUI","useAnimatedProps","useAnimatedStyle","DefaultSnapSpec","NO_PROPS","NO_STYLES","useNavigationHelpers","useDescriptors","useScreenStyles","AnimationStore","GestureStore","SystemStore","animateToProgress","findCollapseTarget","useBackdropPointerEvents","jsx","_jsx","jsxs","_jsxs","BackdropLayer","stylesMap","current","dismissScreen","isBackdropActive","backdropBehavior","BackdropComponent","options","backdropComponent","routeKey","route","key","animations","getBag","targetProgressValue","getValue","resolvedAutoSnapPointValue","AnimatedBackdropComponent","createAnimatedComponent","handleBackdropPress","rawSnapPoints","snapPoints","canDismiss","gestureEnabled","length","gestures","transitionSpec","resolvedSnaps","map","point","value","filter","target","shouldDismiss","progress","dismissing","spec","open","expand","close","collapse","targetProgress","onAnimationFinish","undefined","animatedBackdropStyle","backdrop","style","animatedBackdropProps","props","absoluteFillObject","pointerEvents","onPress","children","animatedProps","View"],"sourceRoot":"../../../../../../src","sources":["shared/components/screen-container/layers/backdrop.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAClD,SAASC,SAAS,EAAEC,UAAU,QAAQ,cAAc;AACpD,OAAOC,QAAQ,IACdC,OAAO,EACPC,gBAAgB,EAChBC,gBAAgB,QACV,yBAAyB;AAChC,SAASC,eAAe,QAAQ,wBAAwB;AACxD,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SAASC,oBAAoB,QAAQ,kDAAkD;AACvF,SAASC,c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C4B,iBAAiB,EAAET,aAAa,GAAG9B,aAAa,GAAGwC;QACpD,CAAC,CAAC;MACH,CAAC,CAAC,CAAC,CAAC;IACL;EACD,CAAC,EAAE,CACF/B,UAAU,EACVE,mBAAmB,EACnBE,0BAA0B,EAC1BX,gBAAgB,EAChBH,OAAO,EACPC,aAAa,EACbM,QAAQ,CACR,CAAC;EAEF,MAAMmC,qBAAqB,GAAG7D,gBAAgB,CAAC,MAAM;IACpD,SAAS;;IACT,OAAOkB,SAAS,CAAC6B,KAAK,CAACe,QAAQ,EAAEC,KAAK,IAAI5D,SAAS;EACpD,CAAC,CAAC;EAEF,MAAM6D,qBAAqB,GAAGjE,gBAAgB,CAAC,MAAM;IACpD,SAAS;;IACT,OAAOmB,SAAS,CAAC6B,KAAK,CAACe,QAAQ,EAAEG,KAAK,IAAI/D,QAAQ;EACnD,CAAC,CAAC;EAEF,oBACCc,KAAA,CAACrB,SAAS;IACToE,KAAK,EAAEnE,UAAU,CAACsE,kBAAmB;IACrCC,aAAa,EAAE9C,gBAAgB,GAAG,MAAM,GAAG,MAAO;IAClD+C,OAAO,EAAE/C,gBAAgB,GAAGe,mBAAmB,GAAGwB,SAAU;IAAAS,QAAA,GAK3DnC,yBAAyB,iBACzBpB,IAAA,CAACoB,yBAAyB;MACzB6B,KAAK,EAAE,CAACnE,UAAU,CAACsE,kBAAkB,CAAE;MACvCI,aAAa,EAAEN;IAAsB,CACrC,CACD,eACDlD,IAAA,CAACjB,QAAQ,CAAC0E,IAAI;MACbR,KAAK,EAAE,CAACnE,UAAU,CAACsE,kBAAkB,EAAEL,qBAAqB;IAAE,CAC9D,CAAC;EAAA,CACQ,CAAC;AAEd,CAAC,CAAC","ignoreList":[]}
|
|
@@ -5,7 +5,7 @@ import { memo } from "react";
|
|
|
5
5
|
import { StyleSheet, View } from "react-native";
|
|
6
6
|
import { GestureDetector } from "react-native-gesture-handler";
|
|
7
7
|
import Animated, { useAnimatedProps, useAnimatedStyle } from "react-native-reanimated";
|
|
8
|
-
import {
|
|
8
|
+
import { NO_PROPS, NO_STYLES } from "../../../constants";
|
|
9
9
|
import { useGestureContext } from "../../../providers/gestures";
|
|
10
10
|
import { useDescriptors } from "../../../providers/screen/descriptors";
|
|
11
11
|
import { useScreenStyles } from "../../../providers/screen/styles.provider";
|
|
@@ -38,51 +38,35 @@ export const ContentLayer = /*#__PURE__*/memo(({
|
|
|
38
38
|
|
|
39
39
|
return stylesMap.value.content?.style || NO_STYLES;
|
|
40
40
|
});
|
|
41
|
-
const animatedNavigationContainerStyle = useAnimatedStyle(() => {
|
|
42
|
-
"worklet";
|
|
43
|
-
|
|
44
|
-
return stylesMap.value[NAVIGATION_MASK_CONTAINER_STYLE_ID]?.style || NO_STYLES;
|
|
45
|
-
});
|
|
46
41
|
const animatedContentProps = useAnimatedProps(() => {
|
|
47
42
|
"worklet";
|
|
48
43
|
|
|
49
44
|
return stylesMap.value.content?.props ?? NO_PROPS;
|
|
50
45
|
});
|
|
51
|
-
const surfaceChildren = /*#__PURE__*/_jsx(SurfaceContainer, {
|
|
52
|
-
pointerEvents: contentPointerEvents,
|
|
53
|
-
children: hasAutoSnapPoint ? /*#__PURE__*/_jsx(View, {
|
|
54
|
-
collapsable: false,
|
|
55
|
-
onLayout: handleContentLayout,
|
|
56
|
-
children: children
|
|
57
|
-
}) : children
|
|
58
|
-
});
|
|
59
|
-
const navigationContainer = /*#__PURE__*/_jsx(Animated.View, {
|
|
60
|
-
style: [styles.navigationContainer, animatedNavigationContainerStyle],
|
|
61
|
-
pointerEvents: contentPointerEvents,
|
|
62
|
-
collapsable: false,
|
|
63
|
-
children: surfaceChildren
|
|
64
|
-
});
|
|
65
|
-
const navigationScopedChildren = isNavigationMaskEnabled ? /*#__PURE__*/_jsx(MaybeMaskedNavigationContainer, {
|
|
66
|
-
pointerEvents: contentPointerEvents,
|
|
67
|
-
enabled: isNavigationMaskEnabled,
|
|
68
|
-
children: navigationContainer
|
|
69
|
-
}) : navigationContainer;
|
|
70
46
|
return /*#__PURE__*/_jsx(GestureDetector, {
|
|
71
47
|
gesture: gestureContext.panGesture,
|
|
72
48
|
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
73
49
|
style: [styles.content, animatedContentStyle],
|
|
74
50
|
animatedProps: animatedContentProps,
|
|
75
51
|
pointerEvents: contentPointerEvents,
|
|
76
|
-
children:
|
|
52
|
+
children: /*#__PURE__*/_jsx(MaybeMaskedNavigationContainer, {
|
|
53
|
+
pointerEvents: contentPointerEvents,
|
|
54
|
+
enabled: isNavigationMaskEnabled,
|
|
55
|
+
children: /*#__PURE__*/_jsx(SurfaceContainer, {
|
|
56
|
+
pointerEvents: contentPointerEvents,
|
|
57
|
+
children: hasAutoSnapPoint ? /*#__PURE__*/_jsx(View, {
|
|
58
|
+
collapsable: false,
|
|
59
|
+
onLayout: handleContentLayout,
|
|
60
|
+
children: children
|
|
61
|
+
}) : children
|
|
62
|
+
})
|
|
63
|
+
})
|
|
77
64
|
})
|
|
78
65
|
});
|
|
79
66
|
});
|
|
80
67
|
const styles = StyleSheet.create({
|
|
81
68
|
content: {
|
|
82
69
|
flex: 1
|
|
83
|
-
},
|
|
84
|
-
navigationContainer: {
|
|
85
|
-
flex: 1
|
|
86
70
|
}
|
|
87
71
|
});
|
|
88
72
|
//# sourceMappingURL=content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["memo","StyleSheet","View","GestureDetector","Animated","useAnimatedProps","useAnimatedStyle","
|
|
1
|
+
{"version":3,"names":["memo","StyleSheet","View","GestureDetector","Animated","useAnimatedProps","useAnimatedStyle","NO_PROPS","NO_STYLES","useGestureContext","useDescriptors","useScreenStyles","resolveNavigationMaskEnabled","useBackdropPointerEvents","useContentLayout","MaybeMaskedNavigationContainer","SurfaceContainer","jsx","_jsx","ContentLayer","children","stylesMap","current","pointerEvents","isBackdropActive","gestureContext","isNavigationMaskEnabled","options","contentPointerEvents","hasAutoSnapPoint","snapPoints","includes","handleContentLayout","animatedContentStyle","value","content","style","animatedContentProps","props","gesture","panGesture","styles","animatedProps","enabled","collapsable","onLayout","create","flex"],"sourceRoot":"../../../../../../src","sources":["shared/components/screen-container/layers/content.tsx"],"mappings":";;AAAA;AACA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,UAAU,EAAEC,IAAI,QAAQ,cAAc;AAC/C,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,OAAOC,QAAQ,IACdC,gBAAgB,EAChBC,gBAAgB,QACV,yBAAyB;AAChC,SAASC,QAAQ,EAAEC,SAAS,QAAQ,oBAAoB;AACxD,SAASC,iBAAiB,QAAQ,6BAA6B;AAC/D,SAASC,cAAc,QAAQ,uCAAuC;AACtE,SAASC,eAAe,QAAQ,2CAA2C;AAC3E,SAASC,4BAA4B,QAAQ,kDAAkD;AAC/F,SAASC,wBAAwB,QAAQ,sCAAsC;AAC/E,SAASC,gBAAgB,QAAQ,6BAA6B;AAC9D,SAASC,8BAA8B,QAAQ,qCAAqC;AACpF,SAASC,gBAAgB,QAAQ,qBAAqB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAMvD,OAAO,MAAMC,YAAY,gBAAGnB,IAAI,CAAC,CAAC;EAAEoB;AAAgB,CAAC,KAAK;EACzD,MAAM;IAAEC;EAAU,CAAC,GAAGV,eAAe,CAAC,CAAC;EACvC,MAAM;IAAEW;EAAQ,CAAC,GAAGZ,cAAc,CAAC,CAAC;EACpC,MAAM;IAAEa,aAAa;IAAEC;EAAiB,CAAC,GAAGX,wBAAwB,CAAC,CAAC;EAEtE,MAAMY,cAAc,GAAGhB,iBAAiB,CAAC,CAAC;EAC1C,MAAMiB,uBAAuB,GAAGd,4BAA4B,CAACU,OAAO,CAACK,OAAO,CAAC;EAC7E,MAAMC,oBAAoB,GAAGJ,gBAAgB,GAAG,UAAU,GAAGD,aAAa;EAE1E,MAAMM,gBAAgB,GACrBP,OAAO,CAACK,OAAO,CAACG,UAAU,EAAEC,QAAQ,CAAC,MAAM,CAAC,IAAI,KAAK;EAEtD,MAAMC,mBAAmB,GAAGlB,gBAAgB,CAAC,CAAC;EAE9C,MAAMmB,oBAAoB,GAAG3B,gBAAgB,CAAC,MAAM;IACnD,SAAS;;IACT,OAAOe,SAAS,CAACa,KAAK,CAACC,OAAO,EAAEC,KAAK,IAAI5B,SAAS;EACnD,CAAC,CAAC;EAEF,MAAM6B,oBAAoB,GAAGhC,gBAAgB,CAAC,MAAM;IACnD,SAAS;;IACT,OAAOgB,SAAS,CAACa,KAAK,CAACC,OAAO,EAAEG,KAAK,IAAI/B,QAAQ;EAClD,CAAC,CAAC;EAEF,oBACCW,IAAA,CAACf,eAAe;IAACoC,OAAO,EAAEd,cAAc,CAAEe,UAAW;IAAApB,QAAA,eACpDF,IAAA,CAACd,QAAQ,CAACF,IAAI;MACbkC,KAAK,EAAE,CAACK,MAAM,CAACN,OAAO,EAAEF,oBAAoB,CAAE;MAC9CS,aAAa,EAAEL,oBAAqB;MACpCd,aAAa,EAAEK,oBAAqB;MAAAR,QAAA,eAEpCF,IAAA,CAACH,8BAA8B;QAC9BQ,aAAa,EAAEK,oBAAqB;QACpCe,OAAO,EAAEjB,uBAAwB;QAAAN,QAAA,eAEjCF,IAAA,CAACF,gBAAgB;UAACO,aAAa,EAAEK,oBAAqB;UAAAR,QAAA,EACpDS,gBAAgB,gBAChBX,IAAA,CAAChB,IAAI;YAAC0C,WAAW,EAAE,KAAM;YAACC,QAAQ,EAAEb,mBAAoB;YAAAZ,QAAA,EACtDA;UAAQ,CACJ,CAAC,GAEPA;QACA,CACgB;MAAC,CACY;IAAC,CACnB;EAAC,CACA,CAAC;AAEpB,CAAC,CAAC;AAEF,MAAMqB,MAAM,GAAGxC,UAAU,CAAC6C,MAAM,CAAC;EAChCX,OAAO,EAAE;IACRY,IAAI,EAAE;EACP;AACD,CAAC,CAAC","ignoreList":[]}
|
package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { memo,
|
|
3
|
+
import { memo, useCallback } from "react";
|
|
4
4
|
import { StyleSheet, View } from "react-native";
|
|
5
5
|
import Animated, { useAnimatedStyle } from "react-native-reanimated";
|
|
6
|
-
import { NAVIGATION_MASK_ELEMENT_STYLE_ID, NO_STYLES } from "../../../constants";
|
|
6
|
+
import { NAVIGATION_MASK_CONTAINER_STYLE_ID, NAVIGATION_MASK_ELEMENT_STYLE_ID, NO_STYLES } from "../../../constants";
|
|
7
7
|
import { useScreenStyles } from "../../../providers/screen/styles.provider";
|
|
8
8
|
import { logger } from "../../../utils/logger";
|
|
9
9
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -27,15 +27,19 @@ export const MaybeMaskedNavigationContainer = /*#__PURE__*/memo(({
|
|
|
27
27
|
|
|
28
28
|
return stylesMap.value[NAVIGATION_MASK_ELEMENT_STYLE_ID]?.style || NO_STYLES;
|
|
29
29
|
});
|
|
30
|
-
|
|
30
|
+
const animatedNavigationMaskContainerStyle = useAnimatedStyle(() => {
|
|
31
|
+
"worklet";
|
|
32
|
+
|
|
33
|
+
return stylesMap.value[NAVIGATION_MASK_CONTAINER_STYLE_ID]?.style || NO_STYLES;
|
|
34
|
+
});
|
|
35
|
+
const maybeLogWarning = useCallback(() => {
|
|
31
36
|
if (!enabled) return;
|
|
32
37
|
if (LazyMaskedView !== View) return;
|
|
33
38
|
if (hasWarnedMissingMaskedView) return;
|
|
34
39
|
hasWarnedMissingMaskedView = true;
|
|
35
40
|
logger.warn("navigationMaskEnabled requires @react-native-masked-view/masked-view. Install it to enable navigation bounds masking.");
|
|
36
41
|
}, [enabled]);
|
|
37
|
-
if (!enabled)
|
|
38
|
-
if (LazyMaskedView === View) {
|
|
42
|
+
if (!enabled || LazyMaskedView === View) {
|
|
39
43
|
return children;
|
|
40
44
|
}
|
|
41
45
|
return /*#__PURE__*/_jsx(LazyMaskedView, {
|
|
@@ -47,13 +51,22 @@ export const MaybeMaskedNavigationContainer = /*#__PURE__*/memo(({
|
|
|
47
51
|
pointerEvents: "none"
|
|
48
52
|
}),
|
|
49
53
|
pointerEvents: pointerEvents,
|
|
50
|
-
|
|
54
|
+
onLayout: maybeLogWarning,
|
|
55
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
56
|
+
style: [styles.navigationContainer, animatedNavigationMaskContainerStyle],
|
|
57
|
+
pointerEvents: pointerEvents,
|
|
58
|
+
collapsable: false,
|
|
59
|
+
children: children
|
|
60
|
+
})
|
|
51
61
|
});
|
|
52
62
|
});
|
|
53
63
|
const styles = StyleSheet.create({
|
|
54
64
|
navigationMaskedRoot: {
|
|
55
65
|
flex: 1
|
|
56
66
|
},
|
|
67
|
+
navigationContainer: {
|
|
68
|
+
flex: 1
|
|
69
|
+
},
|
|
57
70
|
navigationMaskElement: {
|
|
58
71
|
backgroundColor: "white"
|
|
59
72
|
}
|