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,10 +0,0 @@
|
|
|
1
|
-
import { type SharedValue } from "react-native-reanimated";
|
|
2
|
-
import type { MaybeMeasureAndStoreParams } from "../types";
|
|
3
|
-
export declare const useScrollSettledMeasurement: (params: {
|
|
4
|
-
enabled: boolean;
|
|
5
|
-
group: string | undefined;
|
|
6
|
-
hasNextScreen: boolean;
|
|
7
|
-
isAnimating: SharedValue<number>;
|
|
8
|
-
maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
|
|
9
|
-
}) => void;
|
|
10
|
-
//# sourceMappingURL=use-scroll-settled-measurement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-scroll-settled-measurement.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAuB,MAAM,yBAAyB,CAAC;AAEhF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAI3D,eAAO,MAAM,2BAA2B,GAAI,QAAQ;IACnD,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACjC,oBAAoB,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,IAAI,CAAC;CACpE,SAoCA,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { ScreenInterpolationProps } from "../../../types/animation.types";
|
|
2
|
-
import type { BoundId, BoundsOptions } from "../types/options";
|
|
3
|
-
import type { ResolveBoundTagParams } from "./resolve-bound-tag";
|
|
4
|
-
type BuildBoundsOptionsParams = {
|
|
5
|
-
props: Omit<ScreenInterpolationProps, "bounds">;
|
|
6
|
-
id?: BoundId;
|
|
7
|
-
group?: string;
|
|
8
|
-
overrides?: Partial<BoundsOptions>;
|
|
9
|
-
mode?: "style" | "navigation";
|
|
10
|
-
resolveBoundTag: (params: ResolveBoundTagParams) => string | undefined;
|
|
11
|
-
};
|
|
12
|
-
export declare const buildBoundsOptions: ({ props, id, group, overrides, mode, resolveBoundTag, }: BuildBoundsOptionsParams) => BoundsOptions;
|
|
13
|
-
export {};
|
|
14
|
-
//# sourceMappingURL=build-bounds-options.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build-bounds-options.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/build-bounds-options.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAEjE,KAAK,wBAAwB,GAAG;IAC/B,KAAK,EAAE,IAAI,CAAC,wBAAwB,EAAE,QAAQ,CAAC,CAAC;IAChD,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IACnC,IAAI,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC;IAC9B,eAAe,EAAE,CAAC,MAAM,EAAE,qBAAqB,KAAK,MAAM,GAAG,SAAS,CAAC;CACvE,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,yDAOhC,wBAAwB,KAAG,aAyB7B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compute-bounds-styles.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/compute-bounds-styles.ts"],"names":[],"mappings":"AASA,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAEX,mBAAmB,EACnB,aAAa,EACb,MAAM,kBAAkB,CAAC;AAoG1B,eAAO,MAAM,kBAAkB,GAC9B,uDAAuD,mBAAmB,EAC1E,iBAAgB,aAAkC,EAClD,eAAe,sBAAsB,iBAiGrC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/constants.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB;;;;;;;CAOkC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interpolate-style.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/interpolate-style.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAG9D,KAAK,uBAAuB,GAAG;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CACnC,IAAI,EAAE,UAAU,GAAG,IAAI,EACvB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,OAAO,EACjB,OAAO,GAAE,uBAA4B,GACnC,MAAM,CAaR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interpolate.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/interpolate.ts"],"names":[],"mappings":"AAAA,wBAAgB,kBAAkB,CACjC,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,EACrC,WAAW,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,MAAM,CAcR"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"interpolators.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/interpolators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAGlE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,KAAK,kBAAkB,GAAG;IACzB,QAAQ,EAAE,MAAM,IAAI,CAAC,wBAAwB,EAAE,QAAQ,CAAC,CAAC;IACzD,OAAO,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,wBAGjC,kBAAkB;4BAId,OAAO,YACF,MAAM,aACL,MAAM,KACf,MAAM;6BA8DH,OAAO,YACF,MAAM,kBAAkB,wBACZ,MAAM,GAAG,MAAM,aAC1B,MAAM,KACf,MAAM;CAmBT,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"link-accessor.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/link-accessor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,KAAK,QAAQ,GAAG,MAAM,IAAI,CAAC,wBAAwB,EAAE,QAAQ,CAAC,CAAC;AAE/D,MAAM,MAAM,YAAY,GAAG;IAC1B,WAAW,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,QAAQ,GAAG,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,UAAU,GAAG,IAAI,CAAC;CAC7C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,UAAU,QAAQ,KAAG,YA+BvD,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { BoundId } from "../types/options";
|
|
2
|
-
export type ResolveBoundTagParams = {
|
|
3
|
-
id?: BoundId;
|
|
4
|
-
group?: string;
|
|
5
|
-
};
|
|
6
|
-
export declare const resolveBoundTag: ({ id, group, }: ResolveBoundTagParams) => string | undefined;
|
|
7
|
-
//# sourceMappingURL=resolve-bound-tag.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-bound-tag.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/resolve-bound-tag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,MAAM,MAAM,qBAAqB,GAAG;IACnC,EAAE,CAAC,EAAE,OAAO,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,gBAG7B,qBAAqB,KAAG,MAAM,GAAG,SAYnC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style-composers.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/style-composers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE9E,OAAO,KAAK,EACX,wBAAwB,EACxB,gBAAgB,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGpE;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAClC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,GAAG,EAAE,kBAAkB,CAAC;IACxB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,cAAc,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF;;;;;;GAMG;AACH,KAAK,oBAAoB,GAAG;IAC3B,KAAK,EAAE,kBAAkB,CAAC;IAC1B,GAAG,EAAE,kBAAkB,CAAC;IACxB,QAAQ,EAAE,wBAAwB,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,cAAc,EAAE,aAAa,CAAC;CAC9B,CAAC;AAiEF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,GAAG,UAAU,CA0C5E;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,GAAG,UAAU,CA2C5E;AAED,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,oBAAoB,GAC1B,UAAU,CA+BZ;AAED,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,oBAAoB,GAC1B,UAAU,CAsCZ;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,GAAG,UAAU,CAiC5E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGhF,KAAK,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,CAAC;AACnD,KAAK,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AACtC,KAAK,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAqD5C,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,UAAU,GAAG,SAAS,GAC3B,gBAAgB,CAOlB"}
|
package/src/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { useCallback } from "react";
|
|
2
|
-
import {
|
|
3
|
-
type SharedValue,
|
|
4
|
-
useAnimatedReaction,
|
|
5
|
-
useSharedValue,
|
|
6
|
-
} from "react-native-reanimated";
|
|
7
|
-
|
|
8
|
-
export const useDeferredMeasurementTrigger = (params: {
|
|
9
|
-
enabled: boolean;
|
|
10
|
-
isAnimating: SharedValue<number>;
|
|
11
|
-
canFlush?: () => boolean;
|
|
12
|
-
onFlush: () => void;
|
|
13
|
-
}) => {
|
|
14
|
-
const { enabled, isAnimating, canFlush, onFlush } = params;
|
|
15
|
-
const hasPendingMeasurement = useSharedValue(false);
|
|
16
|
-
|
|
17
|
-
const clearPendingMeasurement = useCallback(() => {
|
|
18
|
-
"worklet";
|
|
19
|
-
hasPendingMeasurement.value = false;
|
|
20
|
-
}, [hasPendingMeasurement]);
|
|
21
|
-
|
|
22
|
-
const queueOrFlushMeasurement = useCallback(() => {
|
|
23
|
-
"worklet";
|
|
24
|
-
if (!enabled) return;
|
|
25
|
-
|
|
26
|
-
if (isAnimating.value) {
|
|
27
|
-
hasPendingMeasurement.value = true;
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
hasPendingMeasurement.value = false;
|
|
32
|
-
onFlush();
|
|
33
|
-
}, [enabled, isAnimating, hasPendingMeasurement, onFlush]);
|
|
34
|
-
|
|
35
|
-
useAnimatedReaction(
|
|
36
|
-
() => {
|
|
37
|
-
"worklet";
|
|
38
|
-
if (!enabled) return false;
|
|
39
|
-
if (!hasPendingMeasurement.value) return false;
|
|
40
|
-
if (isAnimating.value) return false;
|
|
41
|
-
return canFlush ? canFlush() : true;
|
|
42
|
-
},
|
|
43
|
-
(shouldFlush, previousShouldFlush) => {
|
|
44
|
-
"worklet";
|
|
45
|
-
if (!enabled) return;
|
|
46
|
-
if (!shouldFlush || shouldFlush === previousShouldFlush) return;
|
|
47
|
-
|
|
48
|
-
hasPendingMeasurement.value = false;
|
|
49
|
-
onFlush();
|
|
50
|
-
},
|
|
51
|
-
[enabled, isAnimating, hasPendingMeasurement, canFlush, onFlush],
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
return {
|
|
55
|
-
clearPendingMeasurement,
|
|
56
|
-
queueOrFlushMeasurement,
|
|
57
|
-
};
|
|
58
|
-
};
|
package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useAnimatedReaction,
|
|
3
|
-
useDerivedValue,
|
|
4
|
-
useSharedValue,
|
|
5
|
-
} from "react-native-reanimated";
|
|
6
|
-
import { EPSILON } from "../../../constants";
|
|
7
|
-
import { AnimationStore } from "../../../stores/animation.store";
|
|
8
|
-
import { BoundStore } from "../../../stores/bounds";
|
|
9
|
-
import { GestureStore } from "../../../stores/gesture.store";
|
|
10
|
-
import type { BoundaryId, MaybeMeasureAndStoreParams } from "../types";
|
|
11
|
-
import {
|
|
12
|
-
canFlushGroupActiveMeasurement,
|
|
13
|
-
resolveGroupActiveMeasurementAction,
|
|
14
|
-
} from "./helpers/measurement-rules";
|
|
15
|
-
import { useDeferredMeasurementTrigger } from "./use-deferred-measurement-trigger";
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Watches the group's active id in the BoundStore.
|
|
19
|
-
* When this boundary becomes the active member of its group,
|
|
20
|
-
* re-measures itself and updates the link destination with fresh bounds.
|
|
21
|
-
* This handles the case where a boundary scrolled into view after initial mount
|
|
22
|
-
* (e.g., paging ScrollView in a detail screen).
|
|
23
|
-
*/
|
|
24
|
-
export const useGroupActiveMeasurement = (params: {
|
|
25
|
-
enabled: boolean;
|
|
26
|
-
group: string | undefined;
|
|
27
|
-
id: BoundaryId;
|
|
28
|
-
currentScreenKey: string;
|
|
29
|
-
shouldUpdateDestination: boolean;
|
|
30
|
-
maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
|
|
31
|
-
}) => {
|
|
32
|
-
const {
|
|
33
|
-
enabled,
|
|
34
|
-
group,
|
|
35
|
-
id,
|
|
36
|
-
currentScreenKey,
|
|
37
|
-
shouldUpdateDestination,
|
|
38
|
-
maybeMeasureAndStore,
|
|
39
|
-
} = params;
|
|
40
|
-
const idStr = String(id);
|
|
41
|
-
|
|
42
|
-
const allGroups = BoundStore.getGroups();
|
|
43
|
-
const progress = AnimationStore.getValue(currentScreenKey, "progress");
|
|
44
|
-
const animating = AnimationStore.getValue(currentScreenKey, "animating");
|
|
45
|
-
const entering = AnimationStore.getValue(currentScreenKey, "entering");
|
|
46
|
-
const closing = AnimationStore.getValue(currentScreenKey, "closing");
|
|
47
|
-
const dragging = GestureStore.getValue(currentScreenKey, "dragging");
|
|
48
|
-
const dismissing = GestureStore.getValue(currentScreenKey, "dismissing");
|
|
49
|
-
const hasSettledOpenOnce = useSharedValue(false);
|
|
50
|
-
|
|
51
|
-
useAnimatedReaction(
|
|
52
|
-
() => {
|
|
53
|
-
"worklet";
|
|
54
|
-
if (!enabled || !shouldUpdateDestination) return false;
|
|
55
|
-
return (
|
|
56
|
-
progress.value >= 1 - EPSILON &&
|
|
57
|
-
animating.value === 0 &&
|
|
58
|
-
entering.value === 0 &&
|
|
59
|
-
closing.value === 0 &&
|
|
60
|
-
dragging.value === 0 &&
|
|
61
|
-
dismissing.value === 0
|
|
62
|
-
);
|
|
63
|
-
},
|
|
64
|
-
(isSettledOpen) => {
|
|
65
|
-
"worklet";
|
|
66
|
-
if (isSettledOpen) {
|
|
67
|
-
hasSettledOpenOnce.value = true;
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
[
|
|
71
|
-
enabled,
|
|
72
|
-
shouldUpdateDestination,
|
|
73
|
-
progress,
|
|
74
|
-
animating,
|
|
75
|
-
entering,
|
|
76
|
-
closing,
|
|
77
|
-
dragging,
|
|
78
|
-
dismissing,
|
|
79
|
-
hasSettledOpenOnce,
|
|
80
|
-
],
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
const isRefreshBlocked = useDerivedValue<number>(() => {
|
|
84
|
-
"worklet";
|
|
85
|
-
if (!enabled || !shouldUpdateDestination) return 0;
|
|
86
|
-
if (!hasSettledOpenOnce.value) return 1;
|
|
87
|
-
if (progress.value < 1 - EPSILON) return 1;
|
|
88
|
-
if (animating.value !== 0) return 1;
|
|
89
|
-
if (entering.value !== 0) return 1;
|
|
90
|
-
if (closing.value !== 0) return 1;
|
|
91
|
-
if (dragging.value !== 0) return 1;
|
|
92
|
-
if (dismissing.value !== 0) return 1;
|
|
93
|
-
return 0;
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
const { clearPendingMeasurement, queueOrFlushMeasurement } =
|
|
97
|
-
useDeferredMeasurementTrigger({
|
|
98
|
-
enabled,
|
|
99
|
-
/**
|
|
100
|
-
* The reason to do extra guard checks for isAnimating is because a user may mid animation drag, causing
|
|
101
|
-
* the src component to be wrongly measured. This in turns leads to faulty src measurements being used, giving us a weird teleport
|
|
102
|
-
* animation rather than a smooth 'SET' transition when dst is actually dismissing.
|
|
103
|
-
*/
|
|
104
|
-
isAnimating: isRefreshBlocked,
|
|
105
|
-
canFlush: () => {
|
|
106
|
-
"worklet";
|
|
107
|
-
return (
|
|
108
|
-
canFlushGroupActiveMeasurement({
|
|
109
|
-
enabled,
|
|
110
|
-
isEligible: !!group && shouldUpdateDestination,
|
|
111
|
-
memberId: idStr,
|
|
112
|
-
activeId: group ? (allGroups.value[group]?.activeId ?? null) : null,
|
|
113
|
-
}) && hasSettledOpenOnce.value
|
|
114
|
-
);
|
|
115
|
-
},
|
|
116
|
-
onFlush: () => {
|
|
117
|
-
"worklet";
|
|
118
|
-
maybeMeasureAndStore({ intent: "refresh-destination" });
|
|
119
|
-
},
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
useAnimatedReaction(
|
|
123
|
-
() => {
|
|
124
|
-
"worklet";
|
|
125
|
-
if (!enabled) return null;
|
|
126
|
-
if (!group) return null;
|
|
127
|
-
return allGroups.value[group]?.activeId ?? null;
|
|
128
|
-
},
|
|
129
|
-
(activeId, previousActiveId) => {
|
|
130
|
-
"worklet";
|
|
131
|
-
const action = resolveGroupActiveMeasurementAction({
|
|
132
|
-
enabled,
|
|
133
|
-
isEligible: !!group && shouldUpdateDestination,
|
|
134
|
-
memberId: idStr,
|
|
135
|
-
activeId,
|
|
136
|
-
previousActiveId,
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
if (action === "clear-pending") {
|
|
140
|
-
clearPendingMeasurement();
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (action === "queue-or-flush") {
|
|
145
|
-
if (!hasSettledOpenOnce.value) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
queueOrFlushMeasurement();
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
[
|
|
152
|
-
enabled,
|
|
153
|
-
group,
|
|
154
|
-
idStr,
|
|
155
|
-
currentScreenKey,
|
|
156
|
-
shouldUpdateDestination,
|
|
157
|
-
hasSettledOpenOnce,
|
|
158
|
-
clearPendingMeasurement,
|
|
159
|
-
queueOrFlushMeasurement,
|
|
160
|
-
],
|
|
161
|
-
);
|
|
162
|
-
};
|
package/src/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { type SharedValue, useAnimatedReaction } from "react-native-reanimated";
|
|
2
|
-
import { BoundStore } from "../../../stores/bounds";
|
|
3
|
-
import type { BoundaryId, MaybeMeasureAndStoreParams } from "../types";
|
|
4
|
-
import {
|
|
5
|
-
canFlushGroupActiveMeasurement,
|
|
6
|
-
resolveGroupActiveMeasurementAction,
|
|
7
|
-
} from "./helpers/measurement-rules";
|
|
8
|
-
import { useDeferredMeasurementTrigger } from "./use-deferred-measurement-trigger";
|
|
9
|
-
|
|
10
|
-
export const useGroupActiveSourceMeasurement = (params: {
|
|
11
|
-
enabled: boolean;
|
|
12
|
-
group: string | undefined;
|
|
13
|
-
id: BoundaryId;
|
|
14
|
-
hasNextScreen: boolean;
|
|
15
|
-
isAnimating: SharedValue<number>;
|
|
16
|
-
maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
|
|
17
|
-
}) => {
|
|
18
|
-
const {
|
|
19
|
-
enabled,
|
|
20
|
-
group,
|
|
21
|
-
id,
|
|
22
|
-
hasNextScreen,
|
|
23
|
-
isAnimating,
|
|
24
|
-
maybeMeasureAndStore,
|
|
25
|
-
} = params;
|
|
26
|
-
const idStr = String(id);
|
|
27
|
-
const allGroups = BoundStore.getGroups();
|
|
28
|
-
const { clearPendingMeasurement, queueOrFlushMeasurement } =
|
|
29
|
-
useDeferredMeasurementTrigger({
|
|
30
|
-
enabled,
|
|
31
|
-
isAnimating,
|
|
32
|
-
canFlush: () => {
|
|
33
|
-
"worklet";
|
|
34
|
-
return canFlushGroupActiveMeasurement({
|
|
35
|
-
enabled,
|
|
36
|
-
isEligible: !!group && hasNextScreen,
|
|
37
|
-
memberId: idStr,
|
|
38
|
-
activeId: group ? (allGroups.value[group]?.activeId ?? null) : null,
|
|
39
|
-
});
|
|
40
|
-
},
|
|
41
|
-
onFlush: () => {
|
|
42
|
-
"worklet";
|
|
43
|
-
maybeMeasureAndStore({ intent: "refresh-source" });
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
useAnimatedReaction(
|
|
48
|
-
() => {
|
|
49
|
-
"worklet";
|
|
50
|
-
if (!enabled) return null;
|
|
51
|
-
if (!group) return null;
|
|
52
|
-
return allGroups.value[group]?.activeId ?? null;
|
|
53
|
-
},
|
|
54
|
-
(activeId, previousActiveId) => {
|
|
55
|
-
"worklet";
|
|
56
|
-
const action = resolveGroupActiveMeasurementAction({
|
|
57
|
-
enabled,
|
|
58
|
-
isEligible: !!group && hasNextScreen,
|
|
59
|
-
memberId: idStr,
|
|
60
|
-
activeId,
|
|
61
|
-
previousActiveId,
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
if (action === "clear-pending") {
|
|
65
|
-
clearPendingMeasurement();
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
if (action === "queue-or-flush") {
|
|
70
|
-
queueOrFlushMeasurement();
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
[
|
|
74
|
-
enabled,
|
|
75
|
-
group,
|
|
76
|
-
idStr,
|
|
77
|
-
hasNextScreen,
|
|
78
|
-
clearPendingMeasurement,
|
|
79
|
-
queueOrFlushMeasurement,
|
|
80
|
-
],
|
|
81
|
-
);
|
|
82
|
-
};
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { useCallback, useLayoutEffect } from "react";
|
|
2
|
-
import { runOnUI, useSharedValue } from "react-native-reanimated";
|
|
3
|
-
import { AnimationStore } from "../../../stores/animation.store";
|
|
4
|
-
import { BoundStore } from "../../../stores/bounds";
|
|
5
|
-
import { resolvePendingSourceKey } from "../helpers/resolve-pending-source-key";
|
|
6
|
-
import type { MaybeMeasureAndStoreParams } from "../types";
|
|
7
|
-
import { resolveInitialLayoutMeasurementIntent } from "./helpers/measurement-rules";
|
|
8
|
-
|
|
9
|
-
export const useInitialLayoutHandler = (params: {
|
|
10
|
-
enabled: boolean;
|
|
11
|
-
sharedBoundTag: string;
|
|
12
|
-
currentScreenKey: string;
|
|
13
|
-
ancestorKeys: string[];
|
|
14
|
-
expectedSourceScreenKey?: string;
|
|
15
|
-
maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
|
|
16
|
-
}) => {
|
|
17
|
-
const {
|
|
18
|
-
enabled,
|
|
19
|
-
sharedBoundTag,
|
|
20
|
-
currentScreenKey,
|
|
21
|
-
ancestorKeys,
|
|
22
|
-
expectedSourceScreenKey,
|
|
23
|
-
maybeMeasureAndStore,
|
|
24
|
-
} = params;
|
|
25
|
-
|
|
26
|
-
const isAnimating = AnimationStore.getValue(currentScreenKey, "animating");
|
|
27
|
-
|
|
28
|
-
const ancestorAnimations = ancestorKeys.map((key) =>
|
|
29
|
-
AnimationStore.getValue(key, "animating"),
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
const hasMeasuredOnLayout = useSharedValue(false);
|
|
33
|
-
|
|
34
|
-
const handleInitialLayout = useCallback(() => {
|
|
35
|
-
"worklet";
|
|
36
|
-
if (!enabled) return;
|
|
37
|
-
if (!sharedBoundTag || hasMeasuredOnLayout.get()) return;
|
|
38
|
-
|
|
39
|
-
let isAnyAnimating = isAnimating.get();
|
|
40
|
-
for (let i = 0; i < ancestorAnimations.length; i++) {
|
|
41
|
-
if (ancestorAnimations[i].get()) {
|
|
42
|
-
isAnyAnimating = 1;
|
|
43
|
-
break;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
let hasPendingLinkFromSource = false;
|
|
48
|
-
|
|
49
|
-
if (isAnyAnimating) {
|
|
50
|
-
const resolvedSourceKey = resolvePendingSourceKey(
|
|
51
|
-
sharedBoundTag,
|
|
52
|
-
expectedSourceScreenKey,
|
|
53
|
-
);
|
|
54
|
-
if (
|
|
55
|
-
resolvedSourceKey &&
|
|
56
|
-
BoundStore.hasPendingLinkFromSource(sharedBoundTag, resolvedSourceKey)
|
|
57
|
-
) {
|
|
58
|
-
hasPendingLinkFromSource = true;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
const intent = resolveInitialLayoutMeasurementIntent({
|
|
63
|
-
enabled,
|
|
64
|
-
hasSharedBoundTag: !!sharedBoundTag,
|
|
65
|
-
hasMeasuredOnLayout: hasMeasuredOnLayout.get(),
|
|
66
|
-
isAnyAnimating: !!isAnyAnimating,
|
|
67
|
-
hasPendingLinkFromSource,
|
|
68
|
-
});
|
|
69
|
-
if (!intent) return;
|
|
70
|
-
|
|
71
|
-
maybeMeasureAndStore({
|
|
72
|
-
intent,
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
hasMeasuredOnLayout.set(true);
|
|
76
|
-
}, [
|
|
77
|
-
enabled,
|
|
78
|
-
sharedBoundTag,
|
|
79
|
-
hasMeasuredOnLayout,
|
|
80
|
-
isAnimating,
|
|
81
|
-
ancestorAnimations,
|
|
82
|
-
maybeMeasureAndStore,
|
|
83
|
-
expectedSourceScreenKey,
|
|
84
|
-
]);
|
|
85
|
-
|
|
86
|
-
// Try to capture destination bounds during layout phase as soon as the
|
|
87
|
-
// boundary mounts; guards in handleInitialLayout keep this idempotent.
|
|
88
|
-
useLayoutEffect(() => {
|
|
89
|
-
if (!enabled) return;
|
|
90
|
-
runOnUI(handleInitialLayout)();
|
|
91
|
-
}, [enabled, handleInitialLayout]);
|
|
92
|
-
};
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type SharedValue,
|
|
3
|
-
useAnimatedReaction,
|
|
4
|
-
useSharedValue,
|
|
5
|
-
} from "react-native-reanimated";
|
|
6
|
-
import { AnimationStore } from "../../../stores/animation.store";
|
|
7
|
-
import { BoundStore } from "../../../stores/bounds";
|
|
8
|
-
import { resolvePendingSourceKey } from "../helpers/resolve-pending-source-key";
|
|
9
|
-
import type { MaybeMeasureAndStoreParams } from "../types";
|
|
10
|
-
import { resolvePendingDestinationRetrySignal } from "./helpers/measurement-rules";
|
|
11
|
-
|
|
12
|
-
export const usePendingDestinationRetryMeasurement = (params: {
|
|
13
|
-
sharedBoundTag: string;
|
|
14
|
-
enabled: boolean;
|
|
15
|
-
currentScreenKey: string;
|
|
16
|
-
expectedSourceScreenKey?: string;
|
|
17
|
-
animating: SharedValue<number>;
|
|
18
|
-
maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
|
|
19
|
-
}) => {
|
|
20
|
-
const {
|
|
21
|
-
sharedBoundTag,
|
|
22
|
-
enabled,
|
|
23
|
-
currentScreenKey,
|
|
24
|
-
expectedSourceScreenKey,
|
|
25
|
-
animating,
|
|
26
|
-
maybeMeasureAndStore,
|
|
27
|
-
} = params;
|
|
28
|
-
|
|
29
|
-
const progress = AnimationStore.getValue(currentScreenKey, "progress");
|
|
30
|
-
|
|
31
|
-
const retryCount = useSharedValue(0);
|
|
32
|
-
const MAX_RETRIES = 4;
|
|
33
|
-
const RETRY_PROGRESS_BUCKETS = 8;
|
|
34
|
-
const RETRY_PROGRESS_MAX = 1.05;
|
|
35
|
-
|
|
36
|
-
useAnimatedReaction(
|
|
37
|
-
() => {
|
|
38
|
-
"worklet";
|
|
39
|
-
const resolvedSourceKey = resolvePendingSourceKey(
|
|
40
|
-
sharedBoundTag,
|
|
41
|
-
expectedSourceScreenKey,
|
|
42
|
-
);
|
|
43
|
-
return resolvePendingDestinationRetrySignal({
|
|
44
|
-
enabled,
|
|
45
|
-
retryCount: retryCount.get(),
|
|
46
|
-
maxRetries: MAX_RETRIES,
|
|
47
|
-
isAnimating: !!animating.get(),
|
|
48
|
-
hasDestinationLink: BoundStore.hasDestinationLink(
|
|
49
|
-
sharedBoundTag,
|
|
50
|
-
currentScreenKey,
|
|
51
|
-
),
|
|
52
|
-
progress: progress.get(),
|
|
53
|
-
retryProgressMax: RETRY_PROGRESS_MAX,
|
|
54
|
-
retryProgressBuckets: RETRY_PROGRESS_BUCKETS,
|
|
55
|
-
resolvedSourceKey,
|
|
56
|
-
hasPendingLinkFromSource: resolvedSourceKey
|
|
57
|
-
? BoundStore.hasPendingLinkFromSource(
|
|
58
|
-
sharedBoundTag,
|
|
59
|
-
resolvedSourceKey,
|
|
60
|
-
)
|
|
61
|
-
: false,
|
|
62
|
-
});
|
|
63
|
-
},
|
|
64
|
-
(captureSignal) => {
|
|
65
|
-
"worklet";
|
|
66
|
-
if (!enabled) return;
|
|
67
|
-
if (!captureSignal) {
|
|
68
|
-
retryCount.set(0);
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
if (retryCount.get() >= MAX_RETRIES) return;
|
|
73
|
-
retryCount.set(retryCount.get() + 1);
|
|
74
|
-
maybeMeasureAndStore({ intent: "complete-destination" });
|
|
75
|
-
},
|
|
76
|
-
[
|
|
77
|
-
enabled,
|
|
78
|
-
sharedBoundTag,
|
|
79
|
-
currentScreenKey,
|
|
80
|
-
expectedSourceScreenKey,
|
|
81
|
-
progress,
|
|
82
|
-
animating,
|
|
83
|
-
maybeMeasureAndStore,
|
|
84
|
-
retryCount,
|
|
85
|
-
],
|
|
86
|
-
);
|
|
87
|
-
};
|
package/src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { type SharedValue, useAnimatedReaction } from "react-native-reanimated";
|
|
2
|
-
import { useScrollSettleContext } from "../../../providers/scroll-settle.provider";
|
|
3
|
-
import type { MaybeMeasureAndStoreParams } from "../types";
|
|
4
|
-
import { shouldTriggerScrollSettledRefresh } from "./helpers/measurement-rules";
|
|
5
|
-
import { useDeferredMeasurementTrigger } from "./use-deferred-measurement-trigger";
|
|
6
|
-
|
|
7
|
-
export const useScrollSettledMeasurement = (params: {
|
|
8
|
-
enabled: boolean;
|
|
9
|
-
group: string | undefined;
|
|
10
|
-
hasNextScreen: boolean;
|
|
11
|
-
isAnimating: SharedValue<number>;
|
|
12
|
-
maybeMeasureAndStore: (options: MaybeMeasureAndStoreParams) => void;
|
|
13
|
-
}) => {
|
|
14
|
-
const { enabled, group, hasNextScreen, isAnimating, maybeMeasureAndStore } =
|
|
15
|
-
params;
|
|
16
|
-
const scrollSettle = useScrollSettleContext();
|
|
17
|
-
const settledSignal = scrollSettle?.settledSignal;
|
|
18
|
-
const { queueOrFlushMeasurement } = useDeferredMeasurementTrigger({
|
|
19
|
-
enabled,
|
|
20
|
-
isAnimating,
|
|
21
|
-
onFlush: () => {
|
|
22
|
-
"worklet";
|
|
23
|
-
maybeMeasureAndStore({ intent: "refresh-source" });
|
|
24
|
-
},
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
useAnimatedReaction(
|
|
28
|
-
() => settledSignal?.value ?? 0,
|
|
29
|
-
(signal, previousSignal) => {
|
|
30
|
-
"worklet";
|
|
31
|
-
if (
|
|
32
|
-
!shouldTriggerScrollSettledRefresh({
|
|
33
|
-
enabled,
|
|
34
|
-
group,
|
|
35
|
-
hasNextScreen,
|
|
36
|
-
hasSettledSignal: !!settledSignal,
|
|
37
|
-
signal,
|
|
38
|
-
previousSignal,
|
|
39
|
-
})
|
|
40
|
-
) {
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
// Re-measure source bounds after scroll settles while idle.
|
|
44
|
-
// This captures post-scroll positions before close transition starts.
|
|
45
|
-
queueOrFlushMeasurement();
|
|
46
|
-
},
|
|
47
|
-
[enabled, group, hasNextScreen, settledSignal, queueOrFlushMeasurement],
|
|
48
|
-
);
|
|
49
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { BoundStore } from "../../../stores/bounds";
|
|
2
|
-
import type { ScreenInterpolationProps } from "../../../types/animation.types";
|
|
3
|
-
import type { BoundId, BoundsOptions } from "../types/options";
|
|
4
|
-
import { DEFAULT_BOUNDS_OPTIONS } from "./constants";
|
|
5
|
-
import type { ResolveBoundTagParams } from "./resolve-bound-tag";
|
|
6
|
-
|
|
7
|
-
type BuildBoundsOptionsParams = {
|
|
8
|
-
props: Omit<ScreenInterpolationProps, "bounds">;
|
|
9
|
-
id?: BoundId;
|
|
10
|
-
group?: string;
|
|
11
|
-
overrides?: Partial<BoundsOptions>;
|
|
12
|
-
mode?: "style" | "navigation";
|
|
13
|
-
resolveBoundTag: (params: ResolveBoundTagParams) => string | undefined;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const buildBoundsOptions = ({
|
|
17
|
-
props,
|
|
18
|
-
id,
|
|
19
|
-
group,
|
|
20
|
-
overrides,
|
|
21
|
-
mode = "style",
|
|
22
|
-
resolveBoundTag,
|
|
23
|
-
}: BuildBoundsOptionsParams): BoundsOptions => {
|
|
24
|
-
"worklet";
|
|
25
|
-
|
|
26
|
-
const tag = resolveBoundTag({ id, group });
|
|
27
|
-
const currentScreenKey = props.current?.route.key;
|
|
28
|
-
const boundaryConfig =
|
|
29
|
-
tag && currentScreenKey
|
|
30
|
-
? BoundStore.getBoundaryConfig(tag, currentScreenKey)
|
|
31
|
-
: null;
|
|
32
|
-
|
|
33
|
-
const resolved = {
|
|
34
|
-
...DEFAULT_BOUNDS_OPTIONS,
|
|
35
|
-
...(boundaryConfig ?? {}),
|
|
36
|
-
...(overrides ?? {}),
|
|
37
|
-
id: tag ?? "",
|
|
38
|
-
group,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// Element-level bounds style composition always uses relative space.
|
|
42
|
-
// Absolute space is reserved for internal navigation helpers (masking).
|
|
43
|
-
if (mode === "style") {
|
|
44
|
-
resolved.space = "relative";
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return resolved;
|
|
48
|
-
};
|