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 +1 @@
|
|
|
1
|
-
{"version":3,"names":["measure","useStableCallbackValue","useLayoutAnchorContext","BoundStore","applyMeasuredBoundsWrites","resolvePendingSourceKey","getMeasurementIntentFlags","resolveMeasurementWritePlan","SNAPSHOT_EPSILON","areMeasurementsEqual","a","b","Math","abs","x","y","pageX","pageY","width","height","useBoundaryMeasureAndStore","params","enabled","sharedBoundTag","preferredSourceScreenKey","currentScreenKey","ancestorKeys","navigatorKey","ancestorNavigatorKeys","
|
|
1
|
+
{"version":3,"names":["measure","useStableCallbackValue","useLayoutAnchorContext","BoundStore","applyMeasuredBoundsWrites","resolvePendingSourceKey","getMeasurementIntentFlags","resolveMeasurementWritePlan","SNAPSHOT_EPSILON","areMeasurementsEqual","a","b","Math","abs","x","y","pageX","pageY","width","height","useBoundaryMeasureAndStore","params","enabled","sharedBoundTag","preferredSourceScreenKey","currentScreenKey","ancestorKeys","navigatorKey","ancestorNavigatorKeys","preparedStyles","measuredAnimatedRef","layoutAnchor","intent","intents","expectedSourceScreenKey","undefined","hasPendingLink","hasPendingLinkFromSource","hasAttachableSourceLink","hasSourceLink","hasDestinationLink","writePlan","writesAny","measured","correctedMeasured","correctMeasurement","destinationInViewport","wantsDestinationWrite","isMeasurementInViewport","captureSource","refreshSource","existingSnapshot","getSnapshot","hasSnapshotChanged","bounds","shouldWriteSnapshot","shouldRegisterSnapshot","shouldSetSource","shouldUpdateSource","shouldUpdateDestination","refreshDestination","shouldSetDestination","completeDestination"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts"],"mappings":";;AACA,SAGCA,OAAO,QAED,yBAAyB;AAChC,OAAOC,sBAAsB,MAAM,0CAA0C;AAC7E,SAASC,sBAAsB,QAAQ,2CAA2C;AAClF,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,yBAAyB,QAAQ,6DAA6D;AACvG,SAASC,uBAAuB,QAAQ,uCAAuC;AAE/E,SACCC,yBAAyB,EACzBC,2BAA2B,QACrB,6BAA6B;AAEpC,MAAMC,gBAAgB,GAAG,GAAG;AAE5B,MAAMC,oBAAoB,GAAGA,CAC5BC,CAAqB,EACrBC,CAAqB,KACR;EACb,SAAS;;EAET,OACCC,IAAI,CAACC,GAAG,CAACH,CAAC,CAACI,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC,IAAIN,gBAAgB,IACvCI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACK,CAAC,GAAGJ,CAAC,CAACI,CAAC,CAAC,IAAIP,gBAAgB,IACvCI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACM,KAAK,GAAGL,CAAC,CAACK,KAAK,CAAC,IAAIR,gBAAgB,IAC/CI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACO,KAAK,GAAGN,CAAC,CAACM,KAAK,CAAC,IAAIT,gBAAgB,IAC/CI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACQ,KAAK,GAAGP,CAAC,CAACO,KAAK,CAAC,IAAIV,gBAAgB,IAC/CI,IAAI,CAACC,GAAG,CAACH,CAAC,CAACS,MAAM,GAAGR,CAAC,CAACQ,MAAM,CAAC,IAAIX,gBAAgB;AAEnD,CAAC;AAED,OAAO,MAAMY,0BAA0B,GAAIC,MAU1C,IAAK;EACL,MAAM;IACLC,OAAO;IACPC,cAAc;IACdC,wBAAwB;IACxBC,gBAAgB;IAChBC,YAAY;IACZC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,IACb,CAACA,YAAY,CAACiB,uBAAuB,IACrCjB,YAAY,CAACiB,uBAAuB,CAACJ,iBAAiB,CAAC;IAExD,IACC,CAACE,qBAAqB,IACtB,CAACL,SAAS,CAACQ,aAAa,IACxB,CAACR,SAAS,CAACS,aAAa,EACvB;MACD;IACD;IAEA,MAAMC,gBAAgB,GAAGhD,UAAU,CAACiD,WAAW,CAC9C7B,cAAc,EACdE,gBACD,CAAC;IACD,MAAM4B,kBAAkB,GACvB,CAACF,gBAAgB,IACjB,CAAC1C,oBAAoB,CAAC0C,gBAAgB,CAACG,MAAM,EAAEV,iBAAiB,CAAC;IAClE,MAAMW,mBAAmB,GAAGF,kBAAkB;IAE9CjD,yBAAyB,CAAC;MACzBmB,cAAc;MACdE,gBAAgB;MAChBkB,QAAQ,EAAEC,iBAAiB;MAC3Bf,cAAc;MACdH,YAAY;MACZC,YAAY;MACZC,qBAAqB;MACrBM,uBAAuB;MACvBsB,sBAAsB,EAAED,mBAAmB;MAC3CE,eAAe,EAAEhB,SAAS,CAACQ,aAAa;MACxCS,kBAAkB,EAAEjB,SAAS,CAACS,aAAa,IAAIG,kBAAkB;MACjEM,uBAAuB,EACtBlB,SAAS,CAACmB,kBAAkB,IAC5Bd,qBAAqB,IACrBO,kBAAkB;MACnBQ,oBAAoB,EACnBpB,SAAS,CAACqB,mBAAmB,IAAIhB;IACnC,CAAC,CAAC;EACH,CACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,24 +1,92 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { useLayoutEffect } from "react";
|
|
4
|
+
import { runOnUI, useAnimatedReaction, useSharedValue } from "react-native-reanimated";
|
|
5
|
+
import { AnimationStore } from "../../../stores/animation.store";
|
|
4
6
|
import { BoundStore } from "../../../stores/bounds";
|
|
5
7
|
import { resolvePendingSourceKey } from "../helpers/resolve-pending-source-key";
|
|
6
|
-
import { resolvePendingDestinationCaptureSignal } from "./helpers/measurement-rules";
|
|
8
|
+
import { resolvePendingDestinationCaptureSignal, resolvePendingDestinationRetrySignal } from "./helpers/measurement-rules";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The current v3.4 behavior intentionally favors correctness over efficiency:
|
|
12
|
+
* when destination layout races transition start, this hook may re-measure
|
|
13
|
+
* multiple times to recover a usable pair for `navigation.zoom()`.
|
|
14
|
+
*
|
|
15
|
+
* This works well enough for now, but it is not the ideal architecture. A more
|
|
16
|
+
* complete v4 solution should allow open-animation deferral and broader
|
|
17
|
+
* readiness coordination so we can avoid repeated measurement work while still
|
|
18
|
+
* handling multiple transition scenarios correctly. Until that system exists,
|
|
19
|
+
* `navigation.zoom()` remains fast in practice, just not as performant as it
|
|
20
|
+
* could be.
|
|
21
|
+
*
|
|
22
|
+
* For now, you may notice a slight stutter towards the end of the animation.
|
|
23
|
+
*/
|
|
7
24
|
export const usePendingDestinationMeasurement = params => {
|
|
8
25
|
const {
|
|
9
26
|
sharedBoundTag,
|
|
10
27
|
enabled,
|
|
28
|
+
id,
|
|
29
|
+
group,
|
|
30
|
+
currentScreenKey,
|
|
11
31
|
expectedSourceScreenKey,
|
|
32
|
+
animating,
|
|
12
33
|
maybeMeasureAndStore
|
|
13
34
|
} = params;
|
|
35
|
+
const progress = AnimationStore.getValue(currentScreenKey, "progress");
|
|
36
|
+
const closing = AnimationStore.getValue(currentScreenKey, "closing");
|
|
37
|
+
const retryCount = useSharedValue(0);
|
|
38
|
+
const MAX_RETRIES = 4;
|
|
39
|
+
const RETRY_PROGRESS_BUCKETS = 8;
|
|
40
|
+
const RETRY_PROGRESS_MAX = 1.05;
|
|
41
|
+
useLayoutEffect(() => {
|
|
42
|
+
if (!enabled) return;
|
|
43
|
+
runOnUI(() => {
|
|
44
|
+
"worklet";
|
|
45
|
+
|
|
46
|
+
if (closing.get()) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
const currentGroupActiveId = group ? BoundStore.getGroupActiveId(group) : null;
|
|
50
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const resolvedSourceKey = resolvePendingSourceKey(sharedBoundTag, expectedSourceScreenKey);
|
|
54
|
+
const hasAttachableSourceLink = resolvedSourceKey ? BoundStore.hasPendingLinkFromSource(sharedBoundTag, resolvedSourceKey) || BoundStore.hasSourceLink(sharedBoundTag, resolvedSourceKey) : false;
|
|
55
|
+
if (!hasAttachableSourceLink) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey)) {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
maybeMeasureAndStore({
|
|
62
|
+
intent: "complete-destination"
|
|
63
|
+
});
|
|
64
|
+
})();
|
|
65
|
+
}, [enabled, id, group, sharedBoundTag, currentScreenKey, expectedSourceScreenKey, closing, maybeMeasureAndStore]);
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* This exessive retry for groups with {target:"bound"} will have to change in v4.
|
|
69
|
+
* .navigation.zoom() is stable and works great for non groups and groups that are non {target: "bound"}.
|
|
70
|
+
*
|
|
71
|
+
* The retry logic is needed for dst screen when we do an initialScrollIndex, the system is competing with the (i assume) useLayoutEffect
|
|
72
|
+
* in the scrollable, causing a race here and giving us wrong measurements. I believe, in simialr fashion to how
|
|
73
|
+
* system.store defers the screen from animating, we could possibly do the same here. Registering it up, once we get valid measurements, we can
|
|
74
|
+
* un defer? Is that the word? Undefer the screen, removing this block compeltely, avoiding any potential flickers ( which currently happens.)
|
|
75
|
+
*
|
|
76
|
+
* You can replicate this bug by dismissing dst, as dst reaches its ending tail (0.01->0.10), if we tap again, we notice a flicker.
|
|
77
|
+
*/
|
|
14
78
|
useAnimatedReaction(() => {
|
|
15
79
|
"worklet";
|
|
16
80
|
|
|
81
|
+
if (closing.get()) {
|
|
82
|
+
return 0;
|
|
83
|
+
}
|
|
17
84
|
const resolvedSourceKey = resolvePendingSourceKey(sharedBoundTag, expectedSourceScreenKey);
|
|
18
85
|
return resolvePendingDestinationCaptureSignal({
|
|
19
86
|
enabled,
|
|
20
87
|
resolvedSourceKey,
|
|
21
|
-
|
|
88
|
+
hasAttachableSourceLink: resolvedSourceKey ? BoundStore.hasPendingLinkFromSource(sharedBoundTag, resolvedSourceKey) || BoundStore.hasSourceLink(sharedBoundTag, resolvedSourceKey) : false,
|
|
89
|
+
hasDestinationLink: BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey)
|
|
22
90
|
});
|
|
23
91
|
}, (captureSignal, previousCaptureSignal) => {
|
|
24
92
|
"worklet";
|
|
@@ -27,9 +95,51 @@ export const usePendingDestinationMeasurement = params => {
|
|
|
27
95
|
if (!captureSignal || captureSignal === previousCaptureSignal) {
|
|
28
96
|
return;
|
|
29
97
|
}
|
|
98
|
+
const currentGroupActiveId = group ? BoundStore.getGroupActiveId(group) : null;
|
|
99
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
maybeMeasureAndStore({
|
|
103
|
+
intent: "complete-destination"
|
|
104
|
+
});
|
|
105
|
+
}, [enabled, id, group, sharedBoundTag, expectedSourceScreenKey, closing, maybeMeasureAndStore]);
|
|
106
|
+
useAnimatedReaction(() => {
|
|
107
|
+
"worklet";
|
|
108
|
+
|
|
109
|
+
if (closing.get()) {
|
|
110
|
+
return 0;
|
|
111
|
+
}
|
|
112
|
+
const resolvedSourceKey = resolvePendingSourceKey(sharedBoundTag, expectedSourceScreenKey);
|
|
113
|
+
return resolvePendingDestinationRetrySignal({
|
|
114
|
+
enabled,
|
|
115
|
+
retryCount: retryCount.get(),
|
|
116
|
+
maxRetries: MAX_RETRIES,
|
|
117
|
+
isAnimating: !!animating.get(),
|
|
118
|
+
hasDestinationLink: BoundStore.hasDestinationLink(sharedBoundTag, currentScreenKey),
|
|
119
|
+
progress: progress.get(),
|
|
120
|
+
retryProgressMax: RETRY_PROGRESS_MAX,
|
|
121
|
+
retryProgressBuckets: RETRY_PROGRESS_BUCKETS,
|
|
122
|
+
resolvedSourceKey,
|
|
123
|
+
hasAttachableSourceLink: resolvedSourceKey ? BoundStore.hasPendingLinkFromSource(sharedBoundTag, resolvedSourceKey) || BoundStore.hasSourceLink(sharedBoundTag, resolvedSourceKey) : false
|
|
124
|
+
});
|
|
125
|
+
}, captureSignal => {
|
|
126
|
+
"worklet";
|
|
127
|
+
|
|
128
|
+
// if (!group) return;
|
|
129
|
+
if (!enabled) return;
|
|
130
|
+
if (!captureSignal) {
|
|
131
|
+
retryCount.set(0);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
const currentGroupActiveId = group ? BoundStore.getGroupActiveId(group) : null;
|
|
135
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
if (retryCount.get() >= MAX_RETRIES) return;
|
|
139
|
+
retryCount.set(retryCount.get() + 1);
|
|
30
140
|
maybeMeasureAndStore({
|
|
31
141
|
intent: "complete-destination"
|
|
32
142
|
});
|
|
33
|
-
}
|
|
143
|
+
});
|
|
34
144
|
};
|
|
35
145
|
//# sourceMappingURL=use-pending-destination-measurement.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useAnimatedReaction","BoundStore","resolvePendingSourceKey","resolvePendingDestinationCaptureSignal","usePendingDestinationMeasurement","params","sharedBoundTag","enabled","expectedSourceScreenKey","maybeMeasureAndStore","resolvedSourceKey","hasPendingLinkFromSource","captureSignal","previousCaptureSignal","
|
|
1
|
+
{"version":3,"names":["useLayoutEffect","runOnUI","useAnimatedReaction","useSharedValue","AnimationStore","BoundStore","resolvePendingSourceKey","resolvePendingDestinationCaptureSignal","resolvePendingDestinationRetrySignal","usePendingDestinationMeasurement","params","sharedBoundTag","enabled","id","group","currentScreenKey","expectedSourceScreenKey","animating","maybeMeasureAndStore","progress","getValue","closing","retryCount","MAX_RETRIES","RETRY_PROGRESS_BUCKETS","RETRY_PROGRESS_MAX","get","currentGroupActiveId","getGroupActiveId","String","resolvedSourceKey","hasAttachableSourceLink","hasPendingLinkFromSource","hasSourceLink","hasDestinationLink","intent","captureSignal","previousCaptureSignal","maxRetries","isAnimating","retryProgressMax","retryProgressBuckets","set"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,OAAO;AACvC,SACCC,OAAO,EAEPC,mBAAmB,EACnBC,cAAc,QACR,yBAAyB;AAChC,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,uBAAuB,QAAQ,uCAAuC;AAE/E,SACCC,sCAAsC,EACtCC,oCAAoC,QAC9B,6BAA6B;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gCAAgC,GAAIC,MAShD,IAAK;EACL,MAAM;IACLC,cAAc;IACdC,OAAO;IACPC,EAAE;IACFC,KAAK;IACLC,gBAAgB;IAChBC,uBAAuB;IACvBC,SAAS;IACTC;EACD,CAAC,GAAGR,MAAM;EAEV,MAAMS,QAAQ,GAAGf,cAAc,CAACgB,QAAQ,CAACL,gBAAgB,EAAE,UAAU,CAAC;EACtE,MAAMM,OAAO,GAAGjB,cAAc,CAACgB,QAAQ,CAACL,gBAAgB,EAAE,SAAS,CAAC;EAEpE,MAAMO,UAAU,GAAGnB,cAAc,CAAC,CAAC,CAAC;EACpC,MAAMoB,WAAW,GAAG,CAAC;EACrB,MAAMC,sBAAsB,GAAG,CAAC;EAChC,MAAMC,kBAAkB,GAAG,IAAI;EAE/BzB,eAAe,CAAC,MAAM;IACrB,IAAI,CAACY,OAAO,EAAE;IAEdX,OAAO,CAAC,MAAM;MACb,SAAS;;MACT,IAAIoB,OAAO,CAACK,GAAG,CAAC,CAAC,EAAE;QAClB;MACD;MAEA,MAAMC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GACvCzB,UAAU,CAAC2B,wBAAwB,CACnCrB,cAAc,EACdmB,iBACD,CAAC,IAAIzB,UAAU,CAAC4B,aAAa,CAACtB,cAAc,EAAEmB,iBAAiB,CAAC,GAC/D;IACJ,CAAC,CAAC;EACH,CAAC,EACAM,aAAa,IAAK;IAClB,SAAS;;IACT;IACA,IAAI,CAACxB,OAAO,EAAE;IACd,IAAI,CAACwB,aAAa,EAAE;MACnBd,UAAU,CAACoB,GAAG,CAAC,CAAC,CAAC;MACjB;IACD;IACA,MAAMf,oBAAoB,GAAGb,KAAK,GAC/BT,UAAU,CAACuB,gBAAgB,CAACd,KAAK,CAAC,GAClC,IAAI;IACP,IAAIA,KAAK,IAAIa,oBAAoB,KAAKE,MAAM,CAAChB,EAAE,CAAC,EAAE;MACjD;IACD;IAEA,IAAIS,UAAU,CAACI,GAAG,CAAC,CAAC,IAAIH,WAAW,EAAE;IACrCD,UAAU,CAACoB,GAAG,CAACpB,UAAU,CAACI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IACpCR,oBAAoB,CAAC;MAAEiB,MAAM,EAAE;IAAuB,CAAC,CAAC;EACzD,CACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useAnimatedReaction } from "react-native-reanimated";
|
|
4
|
+
import { AnimationStore } from "../../../stores/animation.store";
|
|
5
|
+
import { BoundStore } from "../../../stores/bounds";
|
|
6
|
+
import { GestureStore } from "../../../stores/gesture.store";
|
|
7
|
+
import { PREPARE_DESTINATION_MEASUREMENT_INTENT, resolvePrepareSourceMeasurementIntent } from "./helpers/measurement-rules";
|
|
8
|
+
export const usePreTransitionMeasurement = params => {
|
|
9
|
+
const {
|
|
10
|
+
enabled,
|
|
11
|
+
sharedBoundTag,
|
|
12
|
+
id,
|
|
13
|
+
group,
|
|
14
|
+
currentScreenKey,
|
|
15
|
+
nextScreenKey,
|
|
16
|
+
hasNextScreen,
|
|
17
|
+
maybeMeasureAndStore
|
|
18
|
+
} = params;
|
|
19
|
+
const currentWillAnimate = AnimationStore.getValue(currentScreenKey, "willAnimate");
|
|
20
|
+
const currentAnimating = AnimationStore.getValue(currentScreenKey, "animating");
|
|
21
|
+
const currentDragging = GestureStore.getValue(currentScreenKey, "dragging");
|
|
22
|
+
const nextWillAnimate = nextScreenKey ? AnimationStore.getValue(nextScreenKey, "willAnimate") : null;
|
|
23
|
+
const nextAnimating = nextScreenKey ? AnimationStore.getValue(nextScreenKey, "animating") : null;
|
|
24
|
+
const nextDragging = nextScreenKey ? GestureStore.getValue(nextScreenKey, "dragging") : null;
|
|
25
|
+
useAnimatedReaction(() => hasNextScreen ? nextWillAnimate?.get() ?? 0 : 0, (nextValue, previousValue) => {
|
|
26
|
+
"worklet";
|
|
27
|
+
|
|
28
|
+
if (!enabled || !hasNextScreen) return;
|
|
29
|
+
if (nextValue === 0 || nextValue === previousValue) return;
|
|
30
|
+
const currentGroupActiveId = group ? BoundStore.getGroupActiveId(group) : null;
|
|
31
|
+
if (group && currentGroupActiveId !== String(id)) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const shouldCancelMeasurement = !!nextAnimating?.get() && !!nextDragging?.get();
|
|
35
|
+
if (shouldCancelMeasurement) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const hasSourceLink = BoundStore.hasSourceLink(sharedBoundTag, currentScreenKey);
|
|
39
|
+
const intent = resolvePrepareSourceMeasurementIntent({
|
|
40
|
+
hasSourceLink,
|
|
41
|
+
shouldRefreshExistingSource: !!group
|
|
42
|
+
});
|
|
43
|
+
if (!intent) {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
maybeMeasureAndStore({
|
|
47
|
+
intent
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
useAnimatedReaction(() => !hasNextScreen ? currentWillAnimate.get() : 0, (nextValue, previousValue) => {
|
|
51
|
+
"worklet";
|
|
52
|
+
|
|
53
|
+
if (!enabled || hasNextScreen) return;
|
|
54
|
+
if (nextValue === 0 || nextValue === previousValue) return;
|
|
55
|
+
const currentGroupActiveId = group ? BoundStore.getGroupActiveId(group) : null;
|
|
56
|
+
if (group && currentGroupActiveId !== String(id)) return;
|
|
57
|
+
const shouldCancelMeasurement = !!currentAnimating.get() && !!currentDragging.get();
|
|
58
|
+
if (shouldCancelMeasurement) return;
|
|
59
|
+
maybeMeasureAndStore({
|
|
60
|
+
intent: PREPARE_DESTINATION_MEASUREMENT_INTENT
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
//# sourceMappingURL=use-pre-transition-measurement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useAnimatedReaction","AnimationStore","BoundStore","GestureStore","PREPARE_DESTINATION_MEASUREMENT_INTENT","resolvePrepareSourceMeasurementIntent","usePreTransitionMeasurement","params","enabled","sharedBoundTag","id","group","currentScreenKey","nextScreenKey","hasNextScreen","maybeMeasureAndStore","currentWillAnimate","getValue","currentAnimating","currentDragging","nextWillAnimate","nextAnimating","nextDragging","get","nextValue","previousValue","currentGroupActiveId","getGroupActiveId","String","shouldCancelMeasurement","hasSourceLink","intent","shouldRefreshExistingSource"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-pre-transition-measurement.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,UAAU,QAAQ,wBAAwB;AACnD,SAASC,YAAY,QAAQ,+BAA+B;AAE5D,SACCC,sCAAsC,EACtCC,qCAAqC,QAC/B,6BAA6B;AAEpC,OAAO,MAAMC,2BAA2B,GAAIC,MAS3C,IAAK;EACL,MAAM;IACLC,OAAO;IACPC,cAAc;IACdC,EAAE;IACFC,KAAK;IACLC,gBAAgB;IAChBC,aAAa;IACbC,aAAa;IACbC;EACD,CAAC,GAAGR,MAAM;EAEV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,CAAC;IAED,MAAMmB,MAAM,GAAG1B,qCAAqC,CAAC;MACpDyB,aAAa;MACbE,2BAA2B,EAAE,CAAC,CAACrB;IAChC,CAAC,CAAC;IAEF,IAAI,CAACoB,MAAM,EAAE;MACZ;IACD;IAEAhB,oBAAoB,CAAC;MAAEgB;IAAO,CAAC,CAAC;EACjC,CACD,CAAC;EAED/B,mBAAmB,CAClB,MAAO,CAACc,aAAa,GAAGE,kBAAkB,CAACO,GAAG,CAAC,CAAC,GAAG,CAAE,EACrD,CAACC,SAAS,EAAEC,aAAa,KAAK;IAC7B,SAAS;;IACT,IAAI,CAACjB,OAAO,IAAIM,aAAa,EAAE;IAC/B,IAAIU,SAAS,KAAK,CAAC,IAAIA,SAAS,KAAKC,aAAa,EAAE;IACpD,MAAMC,oBAAoB,GAAGf,KAAK,GAC/BT,UAAU,CAACyB,gBAAgB,CAAChB,KAAK,CAAC,GAClC,IAAI;IACP,IAAIA,KAAK,IAAIe,oBAAoB,KAAKE,MAAM,CAAClB,EAAE,CAAC,EAAE;IAElD,MAAMmB,uBAAuB,GAC5B,CAAC,CAACX,gBAAgB,CAACK,GAAG,CAAC,CAAC,IAAI,CAAC,CAACJ,eAAe,CAACI,GAAG,CAAC,CAAC;IACpD,IAAIM,uBAAuB,EAAE;IAE7Bd,oBAAoB,CAAC;MACpBgB,MAAM,EAAE3B;IACT,CAAC,CAAC;EACH,CACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import { View } from "react-native";
|
|
4
|
-
import { Pressable } from "react-native-gesture-handler";
|
|
3
|
+
import { Pressable, View } from "react-native";
|
|
5
4
|
import { BoundaryTarget } from "./components/boundary-target";
|
|
6
5
|
import { createBoundaryComponent } from "./create-boundary-component";
|
|
7
6
|
export { createBoundaryComponent };
|
|
@@ -30,11 +29,17 @@ BoundaryTarget.displayName = "Transition.Boundary.Target";
|
|
|
30
29
|
* - `Boundary.Target` to measure a nested descendant instead of the owner.
|
|
31
30
|
*/
|
|
32
31
|
export const Boundary = {
|
|
33
|
-
/**
|
|
32
|
+
/**
|
|
33
|
+
* Passive boundary wrapper (no built-in press semantics).
|
|
34
|
+
*/
|
|
34
35
|
View: BoundaryView,
|
|
35
|
-
/**
|
|
36
|
+
/**
|
|
37
|
+
* Pressable boundary wrapper with press-priority source capture.
|
|
38
|
+
*/
|
|
36
39
|
Trigger: BoundaryTrigger,
|
|
37
|
-
/**
|
|
40
|
+
/**
|
|
41
|
+
* Optional nested measurement override inside a boundary owner.
|
|
42
|
+
*/
|
|
38
43
|
Target: BoundaryTarget
|
|
39
44
|
};
|
|
40
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["Pressable","View","BoundaryTarget","createBoundaryComponent","BoundaryView","BoundaryTrigger","displayName","Boundary","Trigger","Target"],"sourceRoot":"../../../../../src","sources":["shared/components/create-boundary-component/index.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9C,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,uBAAuB,QAAQ,6BAA6B;AAErE,SAASA,uBAAuB;AAEhC,MAAMC,YAAY,GAAGD,uBAAuB,CAACF,IAAI,CAAC;AAClD,MAAMI,eAAe,GAAGF,uBAAuB,CAACH,SAAS,CAAC;AAC1DI,YAAY,CAACE,WAAW,GAAG,0BAA0B;AACrDD,eAAe,CAACC,WAAW,GAAG,6BAA6B;AAC3DJ,cAAc,CAACI,WAAW,GAAG,4BAA4B;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAG;EACvB;AACD;AACA;EACCN,IAAI,EAAEG,YAAY;EAClB;AACD;AACA;EACCI,OAAO,EAAEH,eAAe;EACxB;AACD;AACA;EACCI,MAAM,EAAEP;AACT,CAAC","ignoreList":[]}
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
/** biome-ignore-all lint/style/noNonNullAssertion: <This helper is usually being used inside a transitionable stack> */
|
|
4
4
|
|
|
5
|
-
import { forwardRef, memo
|
|
5
|
+
import { forwardRef, memo } from "react";
|
|
6
6
|
import { GestureDetector } from "react-native-gesture-handler";
|
|
7
|
-
import Animated, { runOnUI, useAnimatedProps, useAnimatedRef, useAnimatedStyle, useComposedEventHandler
|
|
7
|
+
import Animated, { runOnUI, useAnimatedProps, useAnimatedRef, useAnimatedStyle, useComposedEventHandler } from "react-native-reanimated";
|
|
8
8
|
import { NO_PROPS, NO_STYLES } from "../constants";
|
|
9
9
|
import { useScrollRegistry } from "../hooks/gestures/use-scroll-registry";
|
|
10
10
|
import { RegisterBoundsProvider } from "../providers/register-bounds.provider";
|
|
11
11
|
import { useScreenStyles } from "../providers/screen/styles";
|
|
12
|
-
import { ScrollSettleProvider } from "../providers/scroll-settle.provider";
|
|
13
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
13
|
export function createTransitionAwareComponent(Wrapped, options = {}) {
|
|
15
14
|
const {
|
|
@@ -25,14 +24,6 @@ export function createTransitionAwareComponent(Wrapped, options = {}) {
|
|
|
25
24
|
onScrollEndDrag: userOnScrollEndDrag,
|
|
26
25
|
...scrollableProps
|
|
27
26
|
} = props;
|
|
28
|
-
const settledSignal = useSharedValue(0);
|
|
29
|
-
const emitScrollSettled = useCallback(() => {
|
|
30
|
-
runOnUI(() => {
|
|
31
|
-
"worklet";
|
|
32
|
-
|
|
33
|
-
settledSignal.value = settledSignal.value + 1;
|
|
34
|
-
})();
|
|
35
|
-
}, [settledSignal]);
|
|
36
27
|
|
|
37
28
|
// Determine scroll direction from the horizontal prop (standard ScrollView API)
|
|
38
29
|
const scrollDirection = scrollableProps.horizontal ? "horizontal" : "vertical";
|
|
@@ -49,39 +40,24 @@ export function createTransitionAwareComponent(Wrapped, options = {}) {
|
|
|
49
40
|
direction: scrollDirection
|
|
50
41
|
});
|
|
51
42
|
const composedScrollHandler = useComposedEventHandler([scrollHandler, userOnScroll ?? null]);
|
|
52
|
-
const handleMomentumScrollEnd = useCallback(event => {
|
|
53
|
-
userOnMomentumScrollEnd?.(event);
|
|
54
|
-
emitScrollSettled();
|
|
55
|
-
}, [userOnMomentumScrollEnd, emitScrollSettled]);
|
|
56
|
-
const handleScrollEndDrag = useCallback(event => {
|
|
57
|
-
userOnScrollEndDrag?.(event);
|
|
58
|
-
const velocityX = Math.abs(event?.nativeEvent?.velocity?.x ?? 0);
|
|
59
|
-
const velocityY = Math.abs(event?.nativeEvent?.velocity?.y ?? 0);
|
|
60
|
-
|
|
61
|
-
// If there is no momentum, onMomentumScrollEnd may not fire.
|
|
62
|
-
// Emit settled signal here only when velocity is effectively zero.
|
|
63
|
-
if (velocityX < 0.01 && velocityY < 0.01) {
|
|
64
|
-
emitScrollSettled();
|
|
65
|
-
}
|
|
66
|
-
}, [userOnScrollEndDrag, emitScrollSettled]);
|
|
67
43
|
const scrollableComponent = /*#__PURE__*/_jsx(AnimatedComponent, {
|
|
68
44
|
...scrollableProps,
|
|
69
45
|
ref: ref,
|
|
70
46
|
onScroll: composedScrollHandler,
|
|
71
|
-
onMomentumScrollEnd:
|
|
72
|
-
onScrollEndDrag:
|
|
47
|
+
onMomentumScrollEnd: userOnMomentumScrollEnd,
|
|
48
|
+
onScrollEndDrag: userOnScrollEndDrag,
|
|
73
49
|
onContentSizeChange: onContentSizeChange,
|
|
74
50
|
onLayout: onLayout,
|
|
75
51
|
scrollEventThrottle: scrollableProps.scrollEventThrottle || 16
|
|
76
52
|
});
|
|
53
|
+
if (!nativeGesture) {
|
|
54
|
+
return scrollableComponent;
|
|
55
|
+
}
|
|
77
56
|
|
|
78
57
|
// If no gesture owner found for this axis, render without GestureDetector
|
|
79
|
-
return /*#__PURE__*/_jsx(
|
|
80
|
-
|
|
81
|
-
children:
|
|
82
|
-
gesture: nativeGesture,
|
|
83
|
-
children: scrollableComponent
|
|
84
|
-
})
|
|
58
|
+
return /*#__PURE__*/_jsx(GestureDetector, {
|
|
59
|
+
gesture: nativeGesture,
|
|
60
|
+
children: scrollableComponent
|
|
85
61
|
});
|
|
86
62
|
});
|
|
87
63
|
const Inner = /*#__PURE__*/forwardRef((props, _) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","memo","
|
|
1
|
+
{"version":3,"names":["forwardRef","memo","GestureDetector","Animated","runOnUI","useAnimatedProps","useAnimatedRef","useAnimatedStyle","useComposedEventHandler","NO_PROPS","NO_STYLES","useScrollRegistry","RegisterBoundsProvider","useScreenStyles","jsx","_jsx","createTransitionAwareComponent","Wrapped","options","isScrollable","alreadyAnimated","AnimatedComponent","createAnimatedComponent","ScrollableInner","props","ref","remeasureOnFocus","_remeasureOnFocus","onScroll","userOnScroll","onMomentumScrollEnd","userOnMomentumScrollEnd","onScrollEndDrag","userOnScrollEndDrag","scrollableProps","scrollDirection","horizontal","scrollHandler","onContentSizeChange","onLayout","nativeGesture","direction","composedScrollHandler","scrollableComponent","scrollEventThrottle","gesture","children","Inner","_","style","sharedBoundTag","styleId","onPress","rest","animatedRef","elementStylesMap","associatedId","associatedStyles","opacity","baseStyle","value","associatedProps","captureActiveOnPress","handleInitialLayout","animatedProps","collapsable"],"sourceRoot":"../../../../src","sources":["shared/components/create-transition-aware-component.tsx"],"mappings":";;AAAA;;AAEA,SAA6BA,UAAU,EAAEC,IAAI,QAAQ,OAAO;AAE5D,SAASC,eAAe,QAAQ,8BAA8B;AAC9D,OAAOC,QAAQ,IACdC,OAAO,EACPC,gBAAgB,EAChBC,cAAc,EACdC,gBAAgB,EAChBC,uBAAuB,QACjB,yBAAyB;AAChC,SAASC,QAAQ,EAAEC,SAAS,QAAQ,cAAc;AAClD,SAASC,iBAAiB,QAAQ,uCAAuC;AACzE,SAASC,sBAAsB,QAAQ,uCAAuC;AAC9E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AAsB;MACtB0C,WAAW,EAAEA,WAAY;MACzBL,KAAK,EAAEA,KAAM;MACbG,OAAO,EAAEA,OAAQ;MACjBF,cAAc,EAAEA,cAAe;MAC/BxB,gBAAgB,EAAEA,gBAAiB;MAAAoB,QAAA,EAElCA,CAAC;QAAEgB,oBAAoB;QAAEC;MAAoB,CAAC,kBAC9ChD,IAAA,CAACM,iBAAiB;QAAA,GACZgC,IAAI;QACT5B,GAAG,EAAE6B,WAAY;QACjBL,KAAK,EAAE,CAACA,KAAK,EAAEQ,gBAAgB,CAAE;QACjCO,aAAa,EAAEH,eAAgB;QAC/BT,OAAO,EAAEU,oBAAqB;QAC9BvB,QAAQ,EAAEnC,OAAO,CAAC2D,mBAAmB,CAAE;QACvCE,WAAW,EAAE,CAACf,cAAe;QAAAJ,QAAA,EAE5BA;MAAQ,CACS;IACnB,CACsB,CAAC;EAE3B,CAAC,CAAC;EAEF,IAAI3B,YAAY,EAAE;IACjB,oBAAOlB,IAAI,CAACsB,eAAe,CAAC;EAM7B;EAEA,oBAAOtB,IAAI,CAAC8C,KAAK,CAAC;AAMnB","ignoreList":[]}
|
|
@@ -19,9 +19,11 @@ export function useContentLayout() {
|
|
|
19
19
|
} = useWindowDimensions();
|
|
20
20
|
const routeKey = current.route.key;
|
|
21
21
|
const animations = AnimationStore.getBag(routeKey);
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
const {
|
|
23
|
+
targetProgress,
|
|
24
|
+
resolvedAutoSnapPoint,
|
|
25
|
+
measuredContentLayout
|
|
26
|
+
} = SystemStore.getBag(routeKey);
|
|
25
27
|
const experimental_animateOnInitialMount = current.options.experimental_animateOnInitialMount;
|
|
26
28
|
const transitionSpec = current.options.transitionSpec;
|
|
27
29
|
return useCallback(event => {
|
|
@@ -34,17 +36,17 @@ export function useContentLayout() {
|
|
|
34
36
|
runOnUI((nextWidth, nextHeight, nextFraction) => {
|
|
35
37
|
"worklet";
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
measuredContentLayout.value = {
|
|
38
40
|
width: nextWidth,
|
|
39
41
|
height: nextHeight
|
|
40
42
|
};
|
|
41
|
-
const isFirstMeasurement =
|
|
42
|
-
|
|
43
|
+
const isFirstMeasurement = resolvedAutoSnapPoint.value <= 0;
|
|
44
|
+
resolvedAutoSnapPoint.value = nextFraction;
|
|
43
45
|
if (!isFirstMeasurement || animations.progress.value !== 0 || animations.animating.value !== 0) {
|
|
44
46
|
return;
|
|
45
47
|
}
|
|
46
48
|
if (isFirstKey && !experimental_animateOnInitialMount) {
|
|
47
|
-
|
|
49
|
+
targetProgress.value = nextFraction;
|
|
48
50
|
animations.progress.value = nextFraction;
|
|
49
51
|
return;
|
|
50
52
|
}
|
|
@@ -52,9 +54,9 @@ export function useContentLayout() {
|
|
|
52
54
|
target: nextFraction,
|
|
53
55
|
spec: transitionSpec,
|
|
54
56
|
animations,
|
|
55
|
-
targetProgress
|
|
57
|
+
targetProgress
|
|
56
58
|
});
|
|
57
59
|
})(width, height, fraction);
|
|
58
|
-
}, [animations,
|
|
60
|
+
}, [animations, targetProgress, resolvedAutoSnapPoint, measuredContentLayout, isFirstKey, screenHeight, experimental_animateOnInitialMount, transitionSpec]);
|
|
59
61
|
}
|
|
60
62
|
//# sourceMappingURL=use-content-layout.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useWindowDimensions","runOnUI","useDescriptorDerivations","useDescriptors","AnimationStore","SystemStore","animateToProgress","useContentLayout","current","isFirstKey","height","screenHeight","routeKey","route","key","animations","getBag","
|
|
1
|
+
{"version":3,"names":["useCallback","useWindowDimensions","runOnUI","useDescriptorDerivations","useDescriptors","AnimationStore","SystemStore","animateToProgress","useContentLayout","current","isFirstKey","height","screenHeight","routeKey","route","key","animations","getBag","targetProgress","resolvedAutoSnapPoint","measuredContentLayout","experimental_animateOnInitialMount","options","transitionSpec","event","width","nativeEvent","layout","fraction","Math","min","nextWidth","nextHeight","nextFraction","value","isFirstMeasurement","progress","animating","target","spec"],"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,CAAC,GAAGL,cAAc,CAAC,CAAC;EACpC,MAAM;IAAEM;EAAW,CAAC,GAAGP,wBAAwB,CAAC,CAAC;EACjD,MAAM;IAAEQ,MAAM,EAAEC;EAAa,CAAC,GAAGX,mBAAmB,CAAC,CAAC;EACtD,MAAMY,QAAQ,GAAGJ,OAAO,CAACK,KAAK,CAACC,GAAG;EAClC,MAAMC,UAAU,GAAGX,cAAc,CAACY,MAAM,CAACJ,QAAQ,CAAC;EAClD,MAAM;IAAEK,cAAc;IAAEC,qBAAqB;IAAEC;EAAsB,CAAC,GACrEd,WAAW,CAACW,MAAM,CAACJ,QAAQ,CAAC;EAC7B,MAAMQ,kCAAkC,GACvCZ,OAAO,CAACa,OAAO,CAACD,kCAAkC;EACnD,MAAME,cAAc,GAAGd,OAAO,CAACa,OAAO,CAACC,cAAc;EAErD,OAAOvB,WAAW,CAChBwB,KAAwB,IAAK;IAC7B,MAAM;MAAEC,KAAK;MAAEd;IAAO,CAAC,GAAGa,KAAK,CAACE,WAAW,CAACC,MAAM;IAClD,IAAIF,KAAK,IAAI,CAAC,IAAId,MAAM,IAAI,CAAC,EAAE;IAE/B,MAAMiB,QAAQ,GAAGC,IAAI,CAACC,GAAG,CAACnB,MAAM,GAAGC,YAAY,EAAE,CAAC,CAAC;IAEnDV,OAAO,CAAC,CAAC6B,SAAiB,EAAEC,UAAkB,EAAEC,YAAoB,KAAK;MACxE,SAAS;;MACTb,qBAAqB,CAACc,KAAK,GAAG;QAC7BT,KAAK,EAAEM,SAAS;QAChBpB,MAAM,EAAEqB;MACT,CAAC;MAED,MAAMG,kBAAkB,GAAGhB,qBAAqB,CAACe,KAAK,IAAI,CAAC;MAC3Df,qBAAqB,CAACe,KAAK,GAAGD,YAAY;MAE1C,IACC,CAACE,kBAAkB,IACnBnB,UAAU,CAACoB,QAAQ,CAACF,KAAK,KAAK,CAAC,IAC/BlB,UAAU,CAACqB,SAAS,CAACH,KAAK,KAAK,CAAC,EAC/B;QACD;MACD;MAEA,IAAIxB,UAAU,IAAI,CAACW,kCAAkC,EAAE;QACtDH,cAAc,CAACgB,KAAK,GAAGD,YAAY;QACnCjB,UAAU,CAACoB,QAAQ,CAACF,KAAK,GAAGD,YAAY;QACxC;MACD;MAEA1B,iBAAiB,CAAC;QACjB+B,MAAM,EAAEL,YAAY;QACpBM,IAAI,EAAEhB,cAAc;QACpBP,UAAU;QACVE;MACD,CAAC,CAAC;IACH,CAAC,CAAC,CAACO,KAAK,EAAEd,MAAM,EAAEiB,QAAQ,CAAC;EAC5B,CAAC,EACD,CACCZ,UAAU,EACVE,cAAc,EACdC,qBAAqB,EACrBC,qBAAqB,EACrBV,UAAU,EACVE,YAAY,EACZS,kCAAkC,EAClCE,cAAc,CAEhB,CAAC;AACF","ignoreList":[]}
|
|
@@ -30,8 +30,10 @@ export const BackdropLayer = /*#__PURE__*/memo(function BackdropLayer({
|
|
|
30
30
|
const BackdropComponent = current.options.backdropComponent;
|
|
31
31
|
const routeKey = current.route.key;
|
|
32
32
|
const animations = AnimationStore.getBag(routeKey);
|
|
33
|
-
const
|
|
34
|
-
|
|
33
|
+
const {
|
|
34
|
+
targetProgress,
|
|
35
|
+
resolvedAutoSnapPoint
|
|
36
|
+
} = SystemStore.getBag(routeKey);
|
|
35
37
|
const AnimatedBackdropComponent = useMemo(() => BackdropComponent ? Animated.createAnimatedComponent(BackdropComponent) : null, [BackdropComponent]);
|
|
36
38
|
const handleBackdropPress = useCallback(() => {
|
|
37
39
|
if (backdropBehavior === "dismiss") {
|
|
@@ -52,7 +54,7 @@ export const BackdropLayer = /*#__PURE__*/memo(function BackdropLayer({
|
|
|
52
54
|
runOnUI(() => {
|
|
53
55
|
"worklet";
|
|
54
56
|
|
|
55
|
-
const resolvedSnaps = rawSnapPoints.map(point => point === "auto" ?
|
|
57
|
+
const resolvedSnaps = rawSnapPoints.map(point => point === "auto" ? resolvedAutoSnapPoint.value : point).filter(point => typeof point === "number");
|
|
56
58
|
const {
|
|
57
59
|
target,
|
|
58
60
|
shouldDismiss
|
|
@@ -69,12 +71,12 @@ export const BackdropLayer = /*#__PURE__*/memo(function BackdropLayer({
|
|
|
69
71
|
target,
|
|
70
72
|
spec,
|
|
71
73
|
animations,
|
|
72
|
-
targetProgress
|
|
74
|
+
targetProgress,
|
|
73
75
|
onAnimationFinish: shouldDismiss ? dismissScreen : undefined
|
|
74
76
|
});
|
|
75
77
|
})();
|
|
76
78
|
}
|
|
77
|
-
}, [animations,
|
|
79
|
+
}, [animations, targetProgress, resolvedAutoSnapPoint, backdropBehavior, current, dismissScreen, routeKey]);
|
|
78
80
|
const animatedBackdropStyle = useAnimatedStyle(() => {
|
|
79
81
|
"worklet";
|
|
80
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","SystemStore","animateToProgress","findCollapseTarget","jsx","_jsx","jsxs","_jsxs","BackdropLayer","backdropBehavior","isBackdropActive","layerStylesMap","current","dismissScreen","BackdropComponent","options","backdropComponent","routeKey","route","key","animations","getBag","
|
|
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","jsx","_jsx","jsxs","_jsxs","BackdropLayer","backdropBehavior","isBackdropActive","layerStylesMap","current","dismissScreen","BackdropComponent","options","backdropComponent","routeKey","route","key","animations","getBag","targetProgress","resolvedAutoSnapPoint","AnimatedBackdropComponent","createAnimatedComponent","handleBackdropPress","rawSnapPoints","snapPoints","canDismiss","gestureEnabled","length","gestures","transitionSpec","resolvedSnaps","map","point","value","filter","target","shouldDismiss","progress","dismissing","spec","open","expand","close","collapse","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,cAAc,QAAQ,uCAAuC;AACtE,SAASC,eAAe,QAAQ,kCAAkC;AAClE,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,YAAY,QAAQ,+BAA+B;AAC5D,SAASC,WAAW,QAAQ,8BAA8B;AAE1D,SAASC,iBAAiB,QAAQ,8CAA8C;AAChF,SAASC,kBAAkB,QAAQ,6CAA6C;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEjF,OAAO,MAAMC,aAAa,gBAAGxB,IAAI,CAAC,SAASwB,aAAaA,CAAC;EACxDC,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AEF,oBACCa,KAAA,CAACpB,SAAS;IACTiE,KAAK,EAAEhE,UAAU,CAACmE,kBAAmB;IACrCC,aAAa,EAAE9C,gBAAgB,GAAG,MAAM,GAAG,MAAO;IAClD+C,OAAO,EAAE/C,gBAAgB,GAAGgB,mBAAmB,GAAGuB,SAAU;IAAAS,QAAA,GAK3DlC,yBAAyB,iBACzBnB,IAAA,CAACmB,yBAAyB;MACzB4B,KAAK,EAAE,CAAChE,UAAU,CAACmE,kBAAkB,CAAE;MACvCI,aAAa,EAAEN;IAAsB,CACrC,CACD,eACDhD,IAAA,CAAChB,QAAQ,CAACuE,IAAI;MACbR,KAAK,EAAE,CAAChE,UAAU,CAACmE,kBAAkB,EAAEL,qBAAqB;IAAE,CAC9D,CAAC;EAAA,CACQ,CAAC;AAEd,CAAC,CAAC","ignoreList":[]}
|
|
@@ -21,7 +21,9 @@ export const ScreenLifecycle = ({
|
|
|
21
21
|
isFirstKey
|
|
22
22
|
} = useDescriptorDerivations();
|
|
23
23
|
const animations = AnimationStore.getBag(current.route.key);
|
|
24
|
-
const
|
|
24
|
+
const {
|
|
25
|
+
targetProgress
|
|
26
|
+
} = SystemStore.getBag(current.route.key);
|
|
25
27
|
const {
|
|
26
28
|
activateHighRefreshRate,
|
|
27
29
|
deactivateHighRefreshRate
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useDescriptorDerivations","useDescriptors","AnimationStore","SystemStore","useCloseTransition","useOpenTransition","useScreenEvents","ScreenLifecycle","children","current","previous","isFirstKey","animations","getBag","route","key","targetProgress","
|
|
1
|
+
{"version":3,"names":["useDescriptorDerivations","useDescriptors","AnimationStore","SystemStore","useCloseTransition","useOpenTransition","useScreenEvents","ScreenLifecycle","children","current","previous","isFirstKey","animations","getBag","route","key","targetProgress","activateHighRefreshRate","deactivateHighRefreshRate"],"sourceRoot":"../../../../../src","sources":["shared/components/screen-lifecycle/index.tsx"],"mappings":";;AAAA,SACCA,wBAAwB,EACxBC,cAAc,QACR,oCAAoC;AAC3C,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,WAAW,QAAQ,2BAA2B;AACvD,SAASC,kBAAkB,QAAQ,8BAA8B;AACjE,SAASC,iBAAiB,QAAQ,6BAA6B;AAC/D,SAASC,eAAe,QAAQ,2BAA2B;AAM3D;AACA;AACA;AACA;AACA,OAAO,MAAMC,eAAe,GAAGA,CAAC;EAAEC;AAAgB,CAAC,KAAK;EACvD,MAAM;IAAEC,OAAO;IAAEC;EAAS,CAAC,GAAGT,cAAc,CAAC,CAAC;EAC9C,MAAM;IAAEU;EAAW,CAAC,GAAGX,wBAAwB,CAAC,CAAC;EACjD,MAAMY,UAAU,GAAGV,cAAc,CAACW,MAAM,CAACJ,OAAO,CAACK,KAAK,CAACC,GAAG,CAAC;EAC3D,MAAM;IAAEC;EAAe,CAAC,GAAGb,WAAW,CAACU,MAAM,CAACJ,OAAO,CAACK,KAAK,CAACC,GAAG,CAAC;EAEhE,MAAM;IAAEE,uBAAuB;IAAEC;EAA0B,CAAC,GAC3Db,iBAAiB,CAACI,OAAO,EAAEG,UAAU,EAAEI,cAAc,EAAEL,UAAU,CAAC;EAEnEP,kBAAkB,CACjBK,OAAO,EACPG,UAAU,EACVI,cAAc,EACdC,uBAAuB,EACvBC,yBACD,CAAC;EAEDZ,eAAe,CAACG,OAAO,EAAEC,QAAQ,EAAEE,UAAU,CAAC;EAE9C,OAAOJ,QAAQ;AAChB,CAAC","ignoreList":[]}
|
|
@@ -51,6 +51,7 @@ export const createScreenTransitionState = (route, meta) => ({
|
|
|
51
51
|
progress: 0,
|
|
52
52
|
closing: 0,
|
|
53
53
|
animating: 0,
|
|
54
|
+
willAnimate: 0,
|
|
54
55
|
settled: 1,
|
|
55
56
|
logicallySettled: 1,
|
|
56
57
|
entering: 0,
|
|
@@ -75,6 +76,7 @@ export const DEFAULT_SCREEN_TRANSITION_STATE = Object.freeze({
|
|
|
75
76
|
progress: 0,
|
|
76
77
|
closing: 0,
|
|
77
78
|
animating: 0,
|
|
79
|
+
willAnimate: 0,
|
|
78
80
|
settled: 1,
|
|
79
81
|
logicallySettled: 1,
|
|
80
82
|
entering: 0,
|
|
@@ -100,8 +102,20 @@ export const EMPTY_BOUND_HELPER_RESULT_RAW = Object.freeze({
|
|
|
100
102
|
translateX: 0,
|
|
101
103
|
translateY: 0,
|
|
102
104
|
width: 0,
|
|
103
|
-
height: 0
|
|
104
|
-
|
|
105
|
+
height: 0
|
|
106
|
+
});
|
|
107
|
+
export const TRANSFORM_RESET = Object.freeze({
|
|
108
|
+
transform: [{
|
|
109
|
+
translateX: 0
|
|
110
|
+
}, {
|
|
111
|
+
translateY: 0
|
|
112
|
+
}, {
|
|
113
|
+
scale: 1
|
|
114
|
+
}, {
|
|
115
|
+
scaleX: 1
|
|
116
|
+
}, {
|
|
117
|
+
scaleY: 1
|
|
118
|
+
}]
|
|
105
119
|
});
|
|
106
120
|
export const ENTER_RANGE = [0, 1];
|
|
107
121
|
export const EXIT_RANGE = [1, 2];
|