react-native-screen-transitions 3.4.0-alpha.7 → 3.4.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js +6 -4
- package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js +22 -60
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +56 -41
- 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-auto-source-measurement.js +7 -1
- 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 +4 -23
- 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-pending-destination-measurement.js +111 -2
- 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-pre-transition-measurement.js +69 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/index.js +10 -5
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/commonjs/shared/components/create-transition-aware-component.js +8 -32
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +11 -9
- 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 +7 -5
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/index.js +3 -1
- package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/commonjs/shared/constants.js +17 -3
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/reanimated/use-animated-debounce.js +43 -0
- package/lib/commonjs/shared/hooks/reanimated/use-animated-debounce.js.map +1 -0
- package/lib/commonjs/shared/index.js +6 -0
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +7 -0
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/commonjs/shared/providers/register-bounds.provider.js +9 -1
- package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js +23 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/styles.provider.js +1 -11
- package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +1 -1
- package/lib/commonjs/shared/stores/animation.store.js +9 -3
- package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/clear.js +23 -167
- package/lib/commonjs/shared/stores/bounds/internals/clear.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/presence.js +0 -3
- package/lib/commonjs/shared/stores/bounds/internals/presence.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/registry.js +18 -7
- package/lib/commonjs/shared/stores/bounds/internals/registry.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +7 -51
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/state.js +1 -83
- package/lib/commonjs/shared/stores/bounds/internals/state.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +10 -0
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/constants.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/{resolve-bound-tag.js → create-bound-tag.js} +5 -5
- package/lib/commonjs/shared/utils/bounds/helpers/create-bound-tag.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/{interpolators.js → create-interpolators.js} +6 -6
- package/lib/commonjs/shared/utils/bounds/helpers/create-interpolators.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/{link-accessor.js → create-link-accessor.js} +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +70 -0
- package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/{style-composers.js → styles/composers.js} +22 -22
- package/lib/commonjs/shared/utils/bounds/helpers/styles/composers.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/{compute-bounds-styles.js → styles/compute.js} +14 -20
- package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/{interpolate-style.js → styles/interpolate-link-style.js} +4 -4
- package/lib/commonjs/shared/utils/bounds/helpers/styles/interpolate-link-style.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/styles/styles.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/index.js +16 -44
- package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/build.js +234 -50
- package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/config.js +10 -1
- package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/math.js +34 -1
- package/lib/commonjs/shared/utils/bounds/zoom/math.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/components/boundary-target.js +6 -4
- package/lib/module/shared/components/create-boundary-component/components/boundary-target.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js +23 -61
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +1 -1
- package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +54 -39
- 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-auto-source-measurement.js +7 -1
- 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 +4 -23
- 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-pending-destination-measurement.js +114 -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-pre-transition-measurement.js +64 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/index.js +10 -5
- package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/module/shared/components/create-transition-aware-component.js +10 -34
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +11 -9
- 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 +7 -5
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/index.js +3 -1
- package/lib/module/shared/components/screen-lifecycle/index.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/reanimated/use-animated-debounce.js +39 -0
- package/lib/module/shared/hooks/reanimated/use-animated-debounce.js.map +1 -0
- package/lib/module/shared/index.js +1 -1
- package/lib/module/shared/index.js.map +1 -1
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js +7 -0
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/module/shared/providers/register-bounds.provider.js +9 -1
- package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js +23 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -0
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/styles.provider.js +1 -11
- package/lib/module/shared/providers/screen/styles/styles.provider.js.map +1 -1
- package/lib/module/shared/stores/animation.store.js +9 -3
- package/lib/module/shared/stores/animation.store.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/clear.js +24 -168
- package/lib/module/shared/stores/bounds/internals/clear.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/presence.js +1 -4
- package/lib/module/shared/stores/bounds/internals/presence.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/registry.js +19 -8
- package/lib/module/shared/stores/bounds/internals/registry.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +8 -52
- package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/state.js +0 -78
- package/lib/module/shared/stores/bounds/internals/state.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +10 -0
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/bounds/constants.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/{resolve-bound-tag.js → create-bound-tag.js} +3 -3
- package/lib/module/shared/utils/bounds/helpers/create-bound-tag.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/{interpolators.js → create-interpolators.js} +5 -5
- package/lib/module/shared/utils/bounds/helpers/create-interpolators.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/{link-accessor.js → create-link-accessor.js} +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +64 -0
- package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/{style-composers.js → styles/composers.js} +22 -22
- package/lib/module/shared/utils/bounds/helpers/styles/composers.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/{compute-bounds-styles.js → styles/compute.js} +12 -18
- package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/{interpolate-style.js → styles/interpolate-link-style.js} +4 -4
- package/lib/module/shared/utils/bounds/helpers/styles/interpolate-link-style.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/styles/styles.js.map +1 -0
- package/lib/module/shared/utils/bounds/index.js +14 -42
- package/lib/module/shared/utils/bounds/index.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/build.js +238 -54
- package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/config.js +9 -0
- package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/math.js +31 -0
- package/lib/module/shared/utils/bounds/zoom/math.js.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +17 -11
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts +3 -1
- 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 +1 -2
- 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-pending-destination-measurement.d.ts +20 -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-pre-transition-measurement.d.ts +12 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts +10 -4
- 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 +1 -1
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-transition-aware-component.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-lifecycle/index.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +33 -1
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/reanimated/use-animated-debounce.d.ts +13 -0
- package/lib/typescript/shared/hooks/reanimated/use-animated-debounce.d.ts.map +1 -0
- 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/register-bounds.provider.d.ts +7 -0
- package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts +3 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +3 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +1 -1
- package/lib/typescript/shared/stores/animation.store.d.ts +5 -2
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/clear.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/registry.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/state.d.ts +0 -3
- package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts +0 -2
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +11 -0
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +106 -1
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +1 -1
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts +2 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/constants.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/create-bound-tag.d.ts +7 -0
- package/lib/typescript/shared/utils/bounds/helpers/create-bound-tag.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/{interpolators.d.ts → create-interpolators.d.ts} +3 -3
- package/lib/typescript/shared/utils/bounds/helpers/create-interpolators.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/{link-accessor.d.ts → create-link-accessor.d.ts} +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts +20 -0
- package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/{style-composers.d.ts → styles/composers.d.ts} +4 -4
- package/lib/typescript/shared/utils/bounds/helpers/styles/composers.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/{compute-bounds-styles.d.ts → styles/compute.d.ts} +3 -3
- package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/{interpolate-style.d.ts → styles/interpolate-link-style.d.ts} +2 -2
- package/lib/typescript/shared/utils/bounds/helpers/styles/interpolate-link-style.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/styles/styles.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/options.d.ts +3 -2
- package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +9 -0
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/math.d.ts +17 -0
- package/lib/typescript/shared/utils/bounds/zoom/math.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/components/create-boundary-component/components/boundary-target.tsx +6 -4
- package/src/shared/components/create-boundary-component/create-boundary-component.tsx +28 -60
- package/src/shared/components/create-boundary-component/helpers/resolve-pending-source-key.ts +5 -1
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +72 -53
- package/src/shared/components/create-boundary-component/hooks/use-auto-source-measurement.ts +19 -3
- package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts +5 -34
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts +180 -6
- package/src/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.ts +110 -0
- package/src/shared/components/create-boundary-component/index.tsx +10 -5
- package/src/shared/components/create-boundary-component/types.ts +1 -2
- package/src/shared/components/create-transition-aware-component.tsx +10 -47
- package/src/shared/components/screen-container/hooks/use-content-layout.ts +10 -17
- package/src/shared/components/screen-container/layers/backdrop.tsx +6 -9
- package/src/shared/components/screen-lifecycle/index.tsx +1 -4
- package/src/shared/constants.ts +11 -1
- package/src/shared/hooks/reanimated/use-animated-debounce.ts +56 -0
- package/src/shared/index.ts +3 -0
- package/src/shared/providers/gestures/handlers/use-handlers.ts +9 -0
- package/src/shared/providers/register-bounds.provider.tsx +8 -1
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state.ts +27 -1
- package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +6 -0
- package/src/shared/providers/screen/styles/styles.provider.tsx +1 -12
- package/src/shared/stores/animation.store.ts +11 -2
- package/src/shared/stores/bounds/internals/clear.ts +47 -220
- package/src/shared/stores/bounds/internals/presence.ts +1 -4
- package/src/shared/stores/bounds/internals/registry.ts +25 -14
- package/src/shared/stores/bounds/internals/resolver.ts +7 -84
- package/src/shared/stores/bounds/internals/state.ts +0 -98
- package/src/shared/stores/bounds/types.ts +0 -2
- package/src/shared/types/animation.types.ts +13 -0
- package/src/shared/types/bounds.types.ts +108 -1
- package/src/shared/types/index.ts +2 -0
- package/src/shared/utils/animation/animate-to-progress.ts +11 -1
- package/src/shared/utils/bounds/{helpers/constants.ts → constants.ts} +1 -1
- package/src/shared/utils/bounds/helpers/{resolve-bound-tag.ts → create-bound-tag.ts} +2 -2
- package/src/shared/utils/bounds/helpers/{interpolators.ts → create-interpolators.ts} +19 -12
- package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +100 -0
- package/src/shared/utils/bounds/helpers/{style-composers.ts → styles/composers.ts} +119 -53
- package/src/shared/utils/bounds/helpers/{compute-bounds-styles.ts → styles/compute.ts} +10 -20
- package/src/shared/utils/bounds/helpers/{interpolate-style.ts → styles/interpolate-link-style.ts} +9 -4
- package/src/shared/utils/bounds/index.ts +13 -53
- package/src/shared/utils/bounds/types/options.ts +3 -2
- package/src/shared/utils/bounds/zoom/build.ts +316 -95
- package/src/shared/utils/bounds/zoom/config.ts +11 -0
- package/src/shared/utils/bounds/zoom/math.ts +57 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +0 -54
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +0 -122
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +0 -72
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +0 -66
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +0 -58
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +0 -53
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/build-bounds-options.js +0 -41
- package/lib/commonjs/shared/utils/bounds/helpers/build-bounds-options.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/constants.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/interpolate-style.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/interpolate.js +0 -20
- package/lib/commonjs/shared/utils/bounds/helpers/interpolate.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/interpolators.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/link-accessor.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/styles.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +0 -49
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +0 -118
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +0 -67
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +0 -61
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +0 -53
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +0 -48
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/build-bounds-options.js +0 -36
- package/lib/module/shared/utils/bounds/helpers/build-bounds-options.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/constants.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/interpolate-style.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/interpolate.js +0 -16
- package/lib/module/shared/utils/bounds/helpers/interpolate.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/interpolators.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/link-accessor.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/styles.js.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts +0 -11
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +0 -17
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts +0 -11
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts +0 -10
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts +0 -11
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts +0 -10
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts +0 -14
- package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/constants.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/interpolate-style.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/interpolate.d.ts +0 -2
- package/lib/typescript/shared/utils/bounds/helpers/interpolate.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/interpolators.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/link-accessor.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts +0 -7
- package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts.map +0 -1
- package/src/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.ts +0 -58
- package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +0 -162
- package/src/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.ts +0 -82
- package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +0 -92
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts +0 -87
- package/src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts +0 -49
- package/src/shared/utils/bounds/helpers/build-bounds-options.ts +0 -48
- package/src/shared/utils/bounds/helpers/interpolate.ts +0 -19
- /package/lib/commonjs/shared/utils/bounds/{helpers/constants.js → constants.js} +0 -0
- /package/lib/commonjs/shared/utils/bounds/helpers/{styles.js → styles/styles.js} +0 -0
- /package/lib/module/shared/utils/bounds/{helpers/constants.js → constants.js} +0 -0
- /package/lib/module/shared/utils/bounds/helpers/{styles.js → styles/styles.js} +0 -0
- /package/lib/typescript/shared/utils/bounds/{helpers/constants.d.ts → constants.d.ts} +0 -0
- /package/lib/typescript/shared/utils/bounds/helpers/{styles.d.ts → styles/styles.d.ts} +0 -0
- /package/src/shared/utils/bounds/helpers/{link-accessor.ts → create-link-accessor.ts} +0 -0
- /package/src/shared/utils/bounds/helpers/{styles.ts → styles/styles.ts} +0 -0
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { interpolate } from "react-native-reanimated";
|
|
1
|
+
import { interpolate, makeMutable } from "react-native-reanimated";
|
|
2
2
|
import {
|
|
3
3
|
EPSILON,
|
|
4
|
-
HIDDEN_STYLE,
|
|
5
4
|
NAVIGATION_MASK_CONTAINER_STYLE_ID,
|
|
6
5
|
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
7
6
|
VISIBLE_STYLE,
|
|
@@ -12,27 +11,38 @@ import {
|
|
|
12
11
|
} from "../../../stores/bounds";
|
|
13
12
|
import type { TransitionInterpolatedStyle } from "../../../types/animation.types";
|
|
14
13
|
import type { Layout } from "../../../types/screen.types";
|
|
15
|
-
import {
|
|
14
|
+
import { prepareBoundStyles } from "../helpers/prepare-bound-styles";
|
|
16
15
|
import type { BoundsOptions } from "../types/options";
|
|
17
16
|
import {
|
|
18
17
|
getZoomAnchor,
|
|
19
18
|
toNumber,
|
|
19
|
+
ZOOM_BACKGROUND_SCALE,
|
|
20
|
+
ZOOM_DRAG_DIRECTIONAL_SCALE_EXPONENT,
|
|
20
21
|
ZOOM_DRAG_DIRECTIONAL_SCALE_MAX,
|
|
21
22
|
ZOOM_DRAG_DIRECTIONAL_SCALE_MIN,
|
|
22
23
|
ZOOM_DRAG_RESISTANCE,
|
|
24
|
+
ZOOM_DRAG_TRANSLATION_EXPONENT,
|
|
25
|
+
ZOOM_DRAG_TRANSLATION_NEGATIVE_MAX,
|
|
26
|
+
ZOOM_DRAG_TRANSLATION_POSITIVE_MAX,
|
|
27
|
+
ZOOM_FOCUSED_ELEMENT_CLOSE_OPACITY_RANGE,
|
|
28
|
+
ZOOM_FOCUSED_ELEMENT_OPEN_OPACITY_RANGE,
|
|
23
29
|
ZOOM_MASK_OUTSET,
|
|
24
30
|
ZOOM_SHARED_OPTIONS,
|
|
31
|
+
ZOOM_UNFOCUSED_ELEMENT_CLOSE_OPACITY_RANGE,
|
|
32
|
+
ZOOM_UNFOCUSED_ELEMENT_OPEN_OPACITY_RANGE,
|
|
25
33
|
} from "./config";
|
|
26
34
|
import {
|
|
27
35
|
combineScales,
|
|
28
36
|
composeCompensatedTranslation,
|
|
29
37
|
computeCenterScaleShift,
|
|
30
|
-
normalizedToTranslation,
|
|
31
38
|
resolveDirectionalDragScale,
|
|
39
|
+
resolveDirectionalDragTranslation,
|
|
40
|
+
resolveOpacityRangeTuple,
|
|
32
41
|
} from "./math";
|
|
33
42
|
import type { BuildZoomStylesParams, ZoomInterpolatedStyle } from "./types";
|
|
34
43
|
|
|
35
44
|
const IDENTITY_DRAG_SCALE_OUTPUT = [1, 1] as const;
|
|
45
|
+
const presentedZoomTagByRoute = makeMutable<Record<string, string>>({});
|
|
36
46
|
|
|
37
47
|
/* -------------------------------------------------------------------------- */
|
|
38
48
|
/* LOCAL HELPERS */
|
|
@@ -94,6 +104,119 @@ function getZoomContentTarget({
|
|
|
94
104
|
};
|
|
95
105
|
}
|
|
96
106
|
|
|
107
|
+
function resolveDragScaleTuple(
|
|
108
|
+
value:
|
|
109
|
+
| readonly [shrinkMin: number, growMax: number, exponent?: number]
|
|
110
|
+
| undefined,
|
|
111
|
+
) {
|
|
112
|
+
"worklet";
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
shrinkMin: value?.[0] ?? ZOOM_DRAG_DIRECTIONAL_SCALE_MIN,
|
|
116
|
+
growMax: value?.[1] ?? ZOOM_DRAG_DIRECTIONAL_SCALE_MAX,
|
|
117
|
+
exponent: value?.[2] ?? ZOOM_DRAG_DIRECTIONAL_SCALE_EXPONENT,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function resolveDragTranslationTuple(
|
|
122
|
+
value:
|
|
123
|
+
| readonly [negativeMax: number, positiveMax: number, exponent?: number]
|
|
124
|
+
| undefined,
|
|
125
|
+
) {
|
|
126
|
+
"worklet";
|
|
127
|
+
|
|
128
|
+
return {
|
|
129
|
+
negativeMax: value?.[0] ?? ZOOM_DRAG_TRANSLATION_NEGATIVE_MAX,
|
|
130
|
+
positiveMax: value?.[1] ?? ZOOM_DRAG_TRANSLATION_POSITIVE_MAX,
|
|
131
|
+
exponent: value?.[2] ?? ZOOM_DRAG_TRANSLATION_EXPONENT,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function resolveBackgroundScale(value: number | undefined) {
|
|
136
|
+
"worklet";
|
|
137
|
+
|
|
138
|
+
return value ?? ZOOM_BACKGROUND_SCALE;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function interpolateOpacityRange(params: {
|
|
142
|
+
progress: number;
|
|
143
|
+
range: {
|
|
144
|
+
inputStart: number;
|
|
145
|
+
inputEnd: number;
|
|
146
|
+
outputStart: number;
|
|
147
|
+
outputEnd: number;
|
|
148
|
+
};
|
|
149
|
+
}) {
|
|
150
|
+
"worklet";
|
|
151
|
+
|
|
152
|
+
const { progress, range } = params;
|
|
153
|
+
|
|
154
|
+
return interpolate(
|
|
155
|
+
progress,
|
|
156
|
+
[range.inputStart, range.inputEnd],
|
|
157
|
+
[range.outputStart, range.outputEnd],
|
|
158
|
+
"clamp",
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function resolveEffectiveZoomTag(params: {
|
|
163
|
+
resolvedTag: string;
|
|
164
|
+
activeRouteKey?: string;
|
|
165
|
+
entering: boolean;
|
|
166
|
+
animating: boolean;
|
|
167
|
+
activeProgress: number;
|
|
168
|
+
livePairReady: boolean;
|
|
169
|
+
}) {
|
|
170
|
+
"worklet";
|
|
171
|
+
|
|
172
|
+
const {
|
|
173
|
+
resolvedTag,
|
|
174
|
+
activeRouteKey,
|
|
175
|
+
entering,
|
|
176
|
+
animating,
|
|
177
|
+
activeProgress,
|
|
178
|
+
livePairReady,
|
|
179
|
+
} = params;
|
|
180
|
+
|
|
181
|
+
// Only grouped ids need retarget stabilization. Plain ids should keep their
|
|
182
|
+
// normal behavior with no route-level caching.
|
|
183
|
+
if (!activeRouteKey || !resolvedTag.includes(":")) {
|
|
184
|
+
return resolvedTag;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const cachedTag = presentedZoomTagByRoute.value[activeRouteKey];
|
|
188
|
+
const isFreshOpenFrame = entering && activeProgress <= 0.05;
|
|
189
|
+
const shouldFreezeDuringEnter = entering && animating && !isFreshOpenFrame;
|
|
190
|
+
|
|
191
|
+
if (!cachedTag || isFreshOpenFrame) {
|
|
192
|
+
presentedZoomTagByRoute.modify((state) => ({
|
|
193
|
+
...state,
|
|
194
|
+
[activeRouteKey]: resolvedTag,
|
|
195
|
+
}));
|
|
196
|
+
return resolvedTag;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if (shouldFreezeDuringEnter) {
|
|
200
|
+
return cachedTag;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// After the enter animation, grouped retargeting can still briefly point at a
|
|
204
|
+
// new active id before that tag has usable bounds. Keep presenting the last
|
|
205
|
+
// good tag until the next one is transition-ready.
|
|
206
|
+
if (cachedTag !== resolvedTag && !livePairReady) {
|
|
207
|
+
return cachedTag;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
if (cachedTag !== resolvedTag) {
|
|
211
|
+
presentedZoomTagByRoute.modify((state) => ({
|
|
212
|
+
...state,
|
|
213
|
+
[activeRouteKey]: resolvedTag,
|
|
214
|
+
}));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
return resolvedTag;
|
|
218
|
+
}
|
|
219
|
+
|
|
97
220
|
/* -------------------------------------------------------------------------- */
|
|
98
221
|
/* BUILD ZOOM STYLES */
|
|
99
222
|
/* -------------------------------------------------------------------------- */
|
|
@@ -110,56 +233,129 @@ export function buildZoomStyles({
|
|
|
110
233
|
/* ------------------------------ Shared Setup ------------------------------ */
|
|
111
234
|
|
|
112
235
|
const explicitTarget = zoomOptions?.target;
|
|
113
|
-
const debug = zoomOptions?.DEBUG === true;
|
|
114
236
|
const focused = props.focused;
|
|
115
237
|
const progress = props.progress;
|
|
116
238
|
const screenLayout = props.layouts.screen;
|
|
117
239
|
const isEnteringTransition = !props.next;
|
|
240
|
+
const activeRouteKey = props.active.route.key;
|
|
118
241
|
const currentRouteKey = props.current?.route.key;
|
|
119
242
|
const previousRouteKey = props.previous?.route.key;
|
|
120
243
|
const nextRouteKey = props.next?.route.key;
|
|
121
244
|
const resolvedZoomAnchor = getZoomAnchor(explicitTarget);
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
245
|
+
const liveResolvedPair = BoundStore.resolveTransitionPair(resolvedTag, {
|
|
246
|
+
currentScreenKey: currentRouteKey,
|
|
247
|
+
previousScreenKey: previousRouteKey,
|
|
248
|
+
nextScreenKey: nextRouteKey,
|
|
249
|
+
entering: isEnteringTransition,
|
|
250
|
+
});
|
|
251
|
+
const effectiveTag = resolveEffectiveZoomTag({
|
|
252
|
+
resolvedTag,
|
|
253
|
+
activeRouteKey,
|
|
254
|
+
entering: !!props.active.entering,
|
|
255
|
+
animating: !!props.active.animating,
|
|
256
|
+
activeProgress: props.active.progress,
|
|
257
|
+
livePairReady: !!liveResolvedPair.sourceBounds,
|
|
258
|
+
});
|
|
131
259
|
|
|
132
260
|
const baseRawOptions = {
|
|
133
|
-
id:
|
|
261
|
+
id: effectiveTag,
|
|
134
262
|
raw: true,
|
|
135
263
|
scaleMode: ZOOM_SHARED_OPTIONS.scaleMode,
|
|
136
264
|
} as const;
|
|
137
265
|
|
|
138
|
-
const resolvedPair =
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
266
|
+
const resolvedPair =
|
|
267
|
+
effectiveTag === resolvedTag
|
|
268
|
+
? liveResolvedPair
|
|
269
|
+
: BoundStore.resolveTransitionPair(effectiveTag, {
|
|
270
|
+
currentScreenKey: currentRouteKey,
|
|
271
|
+
previousScreenKey: previousRouteKey,
|
|
272
|
+
nextScreenKey: nextRouteKey,
|
|
273
|
+
entering: isEnteringTransition,
|
|
274
|
+
});
|
|
144
275
|
|
|
145
276
|
const sourceBorderRadius = getSourceBorderRadius(resolvedPair);
|
|
146
277
|
const targetBorderRadius = zoomOptions?.borderRadius ?? sourceBorderRadius;
|
|
278
|
+
const focusedElementOpacity = {
|
|
279
|
+
open: resolveOpacityRangeTuple({
|
|
280
|
+
value: zoomOptions?.focusedElementOpacity?.open,
|
|
281
|
+
fallback: ZOOM_FOCUSED_ELEMENT_OPEN_OPACITY_RANGE,
|
|
282
|
+
}),
|
|
283
|
+
close: resolveOpacityRangeTuple({
|
|
284
|
+
value: zoomOptions?.focusedElementOpacity?.close,
|
|
285
|
+
fallback: ZOOM_FOCUSED_ELEMENT_CLOSE_OPACITY_RANGE,
|
|
286
|
+
}),
|
|
287
|
+
};
|
|
288
|
+
const unfocusedElementOpacity = {
|
|
289
|
+
open: resolveOpacityRangeTuple({
|
|
290
|
+
value: zoomOptions?.unfocusedElementOpacity?.open,
|
|
291
|
+
fallback: ZOOM_UNFOCUSED_ELEMENT_OPEN_OPACITY_RANGE,
|
|
292
|
+
}),
|
|
293
|
+
close: resolveOpacityRangeTuple({
|
|
294
|
+
value: zoomOptions?.unfocusedElementOpacity?.close,
|
|
295
|
+
fallback: ZOOM_UNFOCUSED_ELEMENT_CLOSE_OPACITY_RANGE,
|
|
296
|
+
}),
|
|
297
|
+
};
|
|
147
298
|
const sourceVisibilityStyle = {
|
|
148
|
-
[
|
|
299
|
+
[effectiveTag]: VISIBLE_STYLE,
|
|
149
300
|
} satisfies TransitionInterpolatedStyle;
|
|
150
301
|
const focusedContentSlot = props.navigationMaskEnabled
|
|
151
302
|
? NAVIGATION_MASK_CONTAINER_STYLE_ID
|
|
152
303
|
: "content";
|
|
153
304
|
|
|
305
|
+
/**
|
|
306
|
+
* Local bounds compute helper for navigation zoom.
|
|
307
|
+
*
|
|
308
|
+
* If you're building a custom transition, prefer the public `bounds()` helper.
|
|
309
|
+
* We keep a local version here so zoom can share the same low-level compute path
|
|
310
|
+
* without re-entering the decorated public accessor.
|
|
311
|
+
*/
|
|
312
|
+
const bounds = <T extends BoundsOptions>(options: T) => {
|
|
313
|
+
"worklet";
|
|
314
|
+
|
|
315
|
+
return prepareBoundStyles({
|
|
316
|
+
props,
|
|
317
|
+
options,
|
|
318
|
+
resolvedPair,
|
|
319
|
+
syncGroupActiveId: false,
|
|
320
|
+
});
|
|
321
|
+
};
|
|
322
|
+
|
|
154
323
|
/* --------------------------- Missing Source Guard -------------------------- */
|
|
155
324
|
|
|
156
|
-
//
|
|
157
|
-
//
|
|
158
|
-
//
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
325
|
+
// Only the focused entering route should be hidden when source bounds are
|
|
326
|
+
// missing. During rapid chained pushes, source measurement can briefly race
|
|
327
|
+
// the focused destination. In that case, degrading to a fullscreen destination
|
|
328
|
+
// is safer than blanking the entire screen until another gesture/animation
|
|
329
|
+
// re-runs the pipeline.
|
|
330
|
+
if (focused && !resolvedPair.sourceBounds && props.active.entering) {
|
|
331
|
+
const fallbackStyles: ZoomInterpolatedStyle = {
|
|
332
|
+
[focusedContentSlot]: {
|
|
333
|
+
style: {
|
|
334
|
+
opacity: zoomOptions?.debug ? 0.5 : 1,
|
|
335
|
+
transform: [{ translateX: 0 }, { translateY: 0 }, { scale: 1 }],
|
|
336
|
+
borderRadius: 0,
|
|
337
|
+
overflow: "hidden",
|
|
338
|
+
},
|
|
339
|
+
},
|
|
162
340
|
};
|
|
341
|
+
|
|
342
|
+
if (props.navigationMaskEnabled) {
|
|
343
|
+
const { top, right, bottom, left } = ZOOM_MASK_OUTSET;
|
|
344
|
+
fallbackStyles[NAVIGATION_MASK_ELEMENT_STYLE_ID] = {
|
|
345
|
+
style: {
|
|
346
|
+
width: Math.max(1, screenLayout.width + left + right),
|
|
347
|
+
height: Math.max(1, screenLayout.height + top + bottom),
|
|
348
|
+
borderRadius: 0,
|
|
349
|
+
transform: [
|
|
350
|
+
{ translateX: -left },
|
|
351
|
+
{ translateY: -top },
|
|
352
|
+
{ scale: 1 },
|
|
353
|
+
],
|
|
354
|
+
},
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
return fallbackStyles;
|
|
163
359
|
}
|
|
164
360
|
|
|
165
361
|
/* --------------------------- Gesture / Drag Values ------------------------- */
|
|
@@ -173,25 +369,44 @@ export function buildZoomStyles({
|
|
|
173
369
|
const isVerticalDismiss =
|
|
174
370
|
initialDirection === "vertical" || initialDirection === "vertical-inverted";
|
|
175
371
|
|
|
176
|
-
const
|
|
372
|
+
const horizontalDragTranslation = resolveDragTranslationTuple(
|
|
373
|
+
zoomOptions?.horizontalDragTranslation,
|
|
374
|
+
);
|
|
375
|
+
const verticalDragTranslation = resolveDragTranslationTuple(
|
|
376
|
+
zoomOptions?.verticalDragTranslation,
|
|
377
|
+
);
|
|
378
|
+
const dragX = resolveDirectionalDragTranslation({
|
|
177
379
|
normalized: normX,
|
|
178
380
|
dimension: screenLayout.width,
|
|
179
381
|
resistance: ZOOM_DRAG_RESISTANCE,
|
|
382
|
+
negativeMax: horizontalDragTranslation.negativeMax,
|
|
383
|
+
positiveMax: horizontalDragTranslation.positiveMax,
|
|
384
|
+
exponent: horizontalDragTranslation.exponent,
|
|
180
385
|
});
|
|
181
|
-
const dragY =
|
|
386
|
+
const dragY = resolveDirectionalDragTranslation({
|
|
182
387
|
normalized: normY,
|
|
183
388
|
dimension: screenLayout.height,
|
|
184
389
|
resistance: ZOOM_DRAG_RESISTANCE,
|
|
390
|
+
negativeMax: verticalDragTranslation.negativeMax,
|
|
391
|
+
positiveMax: verticalDragTranslation.positiveMax,
|
|
392
|
+
exponent: verticalDragTranslation.exponent,
|
|
185
393
|
});
|
|
394
|
+
const horizontalDragScale = resolveDragScaleTuple(
|
|
395
|
+
zoomOptions?.horizontalDragScale,
|
|
396
|
+
);
|
|
397
|
+
const verticalDragScale = resolveDragScaleTuple(
|
|
398
|
+
zoomOptions?.verticalDragScale,
|
|
399
|
+
);
|
|
400
|
+
const backgroundScale = resolveBackgroundScale(zoomOptions?.backgroundScale);
|
|
186
401
|
|
|
187
402
|
const dragXScale = isHorizontalDismiss
|
|
188
403
|
? resolveDirectionalDragScale({
|
|
189
404
|
normalized: normX,
|
|
190
405
|
dismissDirection:
|
|
191
406
|
initialDirection === "horizontal-inverted" ? "negative" : "positive",
|
|
192
|
-
shrinkMin:
|
|
193
|
-
growMax:
|
|
194
|
-
exponent:
|
|
407
|
+
shrinkMin: horizontalDragScale.shrinkMin,
|
|
408
|
+
growMax: horizontalDragScale.growMax,
|
|
409
|
+
exponent: horizontalDragScale.exponent,
|
|
195
410
|
})
|
|
196
411
|
: IDENTITY_DRAG_SCALE_OUTPUT[0];
|
|
197
412
|
const dragYScale = isVerticalDismiss
|
|
@@ -199,9 +414,9 @@ export function buildZoomStyles({
|
|
|
199
414
|
normalized: normY,
|
|
200
415
|
dismissDirection:
|
|
201
416
|
initialDirection === "vertical-inverted" ? "negative" : "positive",
|
|
202
|
-
shrinkMin:
|
|
203
|
-
growMax:
|
|
204
|
-
exponent:
|
|
417
|
+
shrinkMin: verticalDragScale.shrinkMin,
|
|
418
|
+
growMax: verticalDragScale.growMax,
|
|
419
|
+
exponent: verticalDragScale.exponent,
|
|
205
420
|
})
|
|
206
421
|
: IDENTITY_DRAG_SCALE_OUTPUT[1];
|
|
207
422
|
const dragScale = combineScales(dragXScale, dragYScale);
|
|
@@ -216,32 +431,30 @@ export function buildZoomStyles({
|
|
|
216
431
|
resolvedPair,
|
|
217
432
|
});
|
|
218
433
|
|
|
219
|
-
const contentRaw =
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
...baseRawOptions,
|
|
234
|
-
anchor: ZOOM_SHARED_OPTIONS.anchor,
|
|
235
|
-
method: "size",
|
|
236
|
-
space: "absolute",
|
|
237
|
-
target: "fullscreen",
|
|
238
|
-
},
|
|
239
|
-
resolvedPair,
|
|
240
|
-
) as Record<string, unknown>;
|
|
434
|
+
const contentRaw = bounds({
|
|
435
|
+
...baseRawOptions,
|
|
436
|
+
anchor: resolvedZoomAnchor,
|
|
437
|
+
method: "content",
|
|
438
|
+
target: focusedContentTarget,
|
|
439
|
+
} as const);
|
|
440
|
+
|
|
441
|
+
const maskRaw = bounds({
|
|
442
|
+
...baseRawOptions,
|
|
443
|
+
anchor: ZOOM_SHARED_OPTIONS.anchor,
|
|
444
|
+
method: "size",
|
|
445
|
+
space: "absolute",
|
|
446
|
+
target: "fullscreen",
|
|
447
|
+
} as const);
|
|
241
448
|
|
|
242
449
|
const focusedFade = props.active?.closing
|
|
243
|
-
?
|
|
244
|
-
|
|
450
|
+
? interpolateOpacityRange({
|
|
451
|
+
progress,
|
|
452
|
+
range: focusedElementOpacity.close,
|
|
453
|
+
})
|
|
454
|
+
: interpolateOpacityRange({
|
|
455
|
+
progress,
|
|
456
|
+
range: focusedElementOpacity.open,
|
|
457
|
+
});
|
|
245
458
|
|
|
246
459
|
/**
|
|
247
460
|
* This is also how swiftui handles their navigation zoom.
|
|
@@ -265,7 +478,7 @@ export function buildZoomStyles({
|
|
|
265
478
|
const maskTranslateY = toNumber(maskRaw.translateY) + dragY - top;
|
|
266
479
|
|
|
267
480
|
const focusedContentStyle = {
|
|
268
|
-
opacity: focusedFade,
|
|
481
|
+
opacity: zoomOptions?.debug ? 0.5 : focusedFade,
|
|
269
482
|
transform: [
|
|
270
483
|
{ translateX: contentTranslateX },
|
|
271
484
|
{ translateY: contentTranslateY },
|
|
@@ -303,35 +516,43 @@ export function buildZoomStyles({
|
|
|
303
516
|
/* ---------------------------- Unfocused Screen ---------------------------- */
|
|
304
517
|
|
|
305
518
|
const unfocusedFade = props.active?.closing
|
|
306
|
-
?
|
|
307
|
-
|
|
308
|
-
|
|
519
|
+
? interpolateOpacityRange({
|
|
520
|
+
progress,
|
|
521
|
+
range: unfocusedElementOpacity.close,
|
|
522
|
+
})
|
|
523
|
+
: interpolateOpacityRange({
|
|
524
|
+
progress,
|
|
525
|
+
range: unfocusedElementOpacity.open,
|
|
526
|
+
});
|
|
527
|
+
const unfocusedScale = interpolate(
|
|
528
|
+
progress,
|
|
529
|
+
[1, 2],
|
|
530
|
+
[1, backgroundScale],
|
|
531
|
+
"clamp",
|
|
532
|
+
);
|
|
309
533
|
const isUnfocusedIdle = props.active.settled === 1;
|
|
310
|
-
const shouldHideUnfocusedIdle = isUnfocusedIdle
|
|
311
|
-
const
|
|
312
|
-
props.active.
|
|
313
|
-
|
|
314
|
-
const
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
: ("fullscreen" as const);
|
|
323
|
-
|
|
324
|
-
const elementRaw = computeBoundStyles(
|
|
325
|
-
zoomComputeParams,
|
|
326
|
-
{
|
|
327
|
-
...baseRawOptions,
|
|
328
|
-
anchor: resolvedZoomAnchor,
|
|
329
|
-
method: "transform",
|
|
330
|
-
space: "relative",
|
|
331
|
-
target: unfocusedElementTarget,
|
|
332
|
-
},
|
|
534
|
+
const shouldHideUnfocusedIdle = isUnfocusedIdle;
|
|
535
|
+
const didSourceComponentVisiblyHide =
|
|
536
|
+
!props.active.closing && unfocusedFade <= EPSILON;
|
|
537
|
+
|
|
538
|
+
const shouldResetUnfocusedElement =
|
|
539
|
+
!props.active.closing &&
|
|
540
|
+
(!!props.active.logicallySettled || didSourceComponentVisiblyHide);
|
|
541
|
+
|
|
542
|
+
const unfocusedElementTarget = getZoomContentTarget({
|
|
543
|
+
explicitTarget,
|
|
544
|
+
screenLayout,
|
|
545
|
+
anchor: ZOOM_SHARED_OPTIONS.anchor,
|
|
333
546
|
resolvedPair,
|
|
334
|
-
)
|
|
547
|
+
});
|
|
548
|
+
|
|
549
|
+
const elementRaw = bounds({
|
|
550
|
+
...baseRawOptions,
|
|
551
|
+
anchor: resolvedZoomAnchor,
|
|
552
|
+
method: "transform",
|
|
553
|
+
space: "relative",
|
|
554
|
+
target: unfocusedElementTarget,
|
|
555
|
+
} as const);
|
|
335
556
|
|
|
336
557
|
const boundTargetCenterX =
|
|
337
558
|
explicitTarget === "bound" && resolvedPair.destinationBounds
|
|
@@ -394,26 +615,26 @@ export function buildZoomStyles({
|
|
|
394
615
|
{ scaleX: 1 },
|
|
395
616
|
{ scaleY: 1 },
|
|
396
617
|
],
|
|
397
|
-
opacity: 0,
|
|
618
|
+
opacity: zoomOptions?.debug ? 1 : 0,
|
|
398
619
|
zIndex: 0,
|
|
399
620
|
elevation: 0,
|
|
400
621
|
}
|
|
401
622
|
: {
|
|
402
623
|
transform: [
|
|
403
624
|
{
|
|
404
|
-
translateX:
|
|
625
|
+
translateX: shouldResetUnfocusedElement ? 0 : elementTranslateX,
|
|
405
626
|
},
|
|
406
627
|
{
|
|
407
|
-
translateY:
|
|
628
|
+
translateY: shouldResetUnfocusedElement ? 0 : elementTranslateY,
|
|
408
629
|
},
|
|
409
630
|
{
|
|
410
|
-
scaleX:
|
|
631
|
+
scaleX: shouldResetUnfocusedElement ? 1 : elementScaleX,
|
|
411
632
|
},
|
|
412
633
|
{
|
|
413
|
-
scaleY:
|
|
634
|
+
scaleY: shouldResetUnfocusedElement ? 1 : elementScaleY,
|
|
414
635
|
},
|
|
415
636
|
],
|
|
416
|
-
opacity: debug ?
|
|
637
|
+
opacity: zoomOptions?.debug ? 1 : unfocusedFade,
|
|
417
638
|
zIndex: 9999,
|
|
418
639
|
elevation: 9999,
|
|
419
640
|
};
|
|
@@ -424,7 +645,7 @@ export function buildZoomStyles({
|
|
|
424
645
|
transform: [{ scale: unfocusedScale }],
|
|
425
646
|
},
|
|
426
647
|
},
|
|
427
|
-
[
|
|
648
|
+
[effectiveTag]: {
|
|
428
649
|
style: resolvedElementStyle,
|
|
429
650
|
},
|
|
430
651
|
};
|
|
@@ -8,6 +8,17 @@ export const ZOOM_SHARED_OPTIONS = Object.freeze({
|
|
|
8
8
|
export const ZOOM_DRAG_RESISTANCE = 0.4;
|
|
9
9
|
export const ZOOM_DRAG_DIRECTIONAL_SCALE_MIN = 0.25;
|
|
10
10
|
export const ZOOM_DRAG_DIRECTIONAL_SCALE_MAX = 1.06;
|
|
11
|
+
export const ZOOM_DRAG_DIRECTIONAL_SCALE_EXPONENT = 2;
|
|
12
|
+
export const ZOOM_DRAG_TRANSLATION_NEGATIVE_MAX = 1;
|
|
13
|
+
export const ZOOM_DRAG_TRANSLATION_POSITIVE_MAX = 1;
|
|
14
|
+
export const ZOOM_DRAG_TRANSLATION_EXPONENT = 1;
|
|
15
|
+
export const ZOOM_BACKGROUND_SCALE = 0.9375;
|
|
16
|
+
export const ZOOM_FOCUSED_ELEMENT_OPEN_OPACITY_RANGE = [0, 0.5, 0, 1] as const;
|
|
17
|
+
export const ZOOM_FOCUSED_ELEMENT_CLOSE_OPACITY_RANGE = [0.6, 1, 0, 1] as const;
|
|
18
|
+
export const ZOOM_UNFOCUSED_ELEMENT_OPEN_OPACITY_RANGE = [1, 2, 1, 0] as const;
|
|
19
|
+
export const ZOOM_UNFOCUSED_ELEMENT_CLOSE_OPACITY_RANGE = [
|
|
20
|
+
1.9, 2, 1, 0,
|
|
21
|
+
] as const;
|
|
11
22
|
|
|
12
23
|
export const ZOOM_MASK_OUTSET = Object.freeze({
|
|
13
24
|
top: 0,
|
|
@@ -191,3 +191,60 @@ export const resolveDirectionalDragScale = ({
|
|
|
191
191
|
const oppositeDrag = Math.min(1, Math.abs(dismissalRelative));
|
|
192
192
|
return interpolate(oppositeDrag, [0, 1], [1, growMax], "clamp");
|
|
193
193
|
};
|
|
194
|
+
|
|
195
|
+
export const resolveDirectionalDragTranslation = ({
|
|
196
|
+
normalized,
|
|
197
|
+
dimension,
|
|
198
|
+
resistance,
|
|
199
|
+
negativeMax,
|
|
200
|
+
positiveMax,
|
|
201
|
+
exponent = 1,
|
|
202
|
+
}: {
|
|
203
|
+
normalized: number;
|
|
204
|
+
dimension: number;
|
|
205
|
+
resistance: number;
|
|
206
|
+
negativeMax: number;
|
|
207
|
+
positiveMax: number;
|
|
208
|
+
exponent?: number;
|
|
209
|
+
}) => {
|
|
210
|
+
"worklet";
|
|
211
|
+
|
|
212
|
+
const clampedMagnitude = Math.min(1, Math.abs(normalized));
|
|
213
|
+
const curvedMagnitude = clampedMagnitude ** Math.max(1, exponent);
|
|
214
|
+
const baseDistance = Math.max(0, dimension) * resistance;
|
|
215
|
+
|
|
216
|
+
if (normalized < 0) {
|
|
217
|
+
return -baseDistance * negativeMax * curvedMagnitude;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return baseDistance * positiveMax * curvedMagnitude;
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
export const resolveOpacityRangeTuple = ({
|
|
224
|
+
value,
|
|
225
|
+
fallback,
|
|
226
|
+
}: {
|
|
227
|
+
value:
|
|
228
|
+
| readonly [
|
|
229
|
+
inputStart: number,
|
|
230
|
+
inputEnd: number,
|
|
231
|
+
outputStart?: number,
|
|
232
|
+
outputEnd?: number,
|
|
233
|
+
]
|
|
234
|
+
| undefined;
|
|
235
|
+
fallback: readonly [
|
|
236
|
+
inputStart: number,
|
|
237
|
+
inputEnd: number,
|
|
238
|
+
outputStart?: number,
|
|
239
|
+
outputEnd?: number,
|
|
240
|
+
];
|
|
241
|
+
}) => {
|
|
242
|
+
"worklet";
|
|
243
|
+
|
|
244
|
+
return {
|
|
245
|
+
inputStart: value?.[0] ?? fallback[0],
|
|
246
|
+
inputEnd: value?.[1] ?? fallback[1],
|
|
247
|
+
outputStart: value?.[2] ?? fallback[2] ?? 0,
|
|
248
|
+
outputEnd: value?.[3] ?? fallback[3] ?? 1,
|
|
249
|
+
};
|
|
250
|
+
};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useDeferredMeasurementTrigger = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNativeReanimated = require("react-native-reanimated");
|
|
9
|
-
const useDeferredMeasurementTrigger = params => {
|
|
10
|
-
const {
|
|
11
|
-
enabled,
|
|
12
|
-
isAnimating,
|
|
13
|
-
canFlush,
|
|
14
|
-
onFlush
|
|
15
|
-
} = params;
|
|
16
|
-
const hasPendingMeasurement = (0, _reactNativeReanimated.useSharedValue)(false);
|
|
17
|
-
const clearPendingMeasurement = (0, _react.useCallback)(() => {
|
|
18
|
-
"worklet";
|
|
19
|
-
|
|
20
|
-
hasPendingMeasurement.value = false;
|
|
21
|
-
}, [hasPendingMeasurement]);
|
|
22
|
-
const queueOrFlushMeasurement = (0, _react.useCallback)(() => {
|
|
23
|
-
"worklet";
|
|
24
|
-
|
|
25
|
-
if (!enabled) return;
|
|
26
|
-
if (isAnimating.value) {
|
|
27
|
-
hasPendingMeasurement.value = true;
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
hasPendingMeasurement.value = false;
|
|
31
|
-
onFlush();
|
|
32
|
-
}, [enabled, isAnimating, hasPendingMeasurement, onFlush]);
|
|
33
|
-
(0, _reactNativeReanimated.useAnimatedReaction)(() => {
|
|
34
|
-
"worklet";
|
|
35
|
-
|
|
36
|
-
if (!enabled) return false;
|
|
37
|
-
if (!hasPendingMeasurement.value) return false;
|
|
38
|
-
if (isAnimating.value) return false;
|
|
39
|
-
return canFlush ? canFlush() : true;
|
|
40
|
-
}, (shouldFlush, previousShouldFlush) => {
|
|
41
|
-
"worklet";
|
|
42
|
-
|
|
43
|
-
if (!enabled) return;
|
|
44
|
-
if (!shouldFlush || shouldFlush === previousShouldFlush) return;
|
|
45
|
-
hasPendingMeasurement.value = false;
|
|
46
|
-
onFlush();
|
|
47
|
-
}, [enabled, isAnimating, hasPendingMeasurement, canFlush, onFlush]);
|
|
48
|
-
return {
|
|
49
|
-
clearPendingMeasurement,
|
|
50
|
-
queueOrFlushMeasurement
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
exports.useDeferredMeasurementTrigger = useDeferredMeasurementTrigger;
|
|
54
|
-
//# sourceMappingURL=use-deferred-measurement-trigger.js.map
|