react-native-screen-transitions 3.6.0-alpha.1 → 3.6.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/component-stack/components/component-screen.js +1 -7
- package/lib/commonjs/component-stack/components/component-screen.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js +27 -34
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js +4 -4
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +17 -19
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js +27 -7
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js +23 -51
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +33 -40
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/index.js +3 -1
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js +75 -0
- package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.js → utils/measured-bounds.js} +15 -2
- package/lib/commonjs/shared/components/create-boundary-component/utils/measured-bounds.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js +103 -0
- package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js +52 -0
- package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js.map +1 -0
- package/lib/commonjs/shared/components/native-screen.js +2 -13
- package/lib/commonjs/shared/components/native-screen.js.map +1 -1
- package/lib/commonjs/shared/constants.js +2 -7
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +35 -0
- package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -0
- package/lib/commonjs/shared/providers/register-bounds.provider.js +48 -55
- package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +1 -10
- package/lib/commonjs/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +1 -6
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation.js +2 -2
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-lifecycle.js +9 -2
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-release.js +19 -0
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-release.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-reset.js +2 -0
- package/lib/commonjs/shared/providers/screen/gestures/pan/pan-reset.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-pan-behavior.js +2 -2
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-activation.js +2 -2
- package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-lifecycle.js +1 -0
- package/lib/commonjs/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/use-pinch-behavior.js +2 -2
- package/lib/commonjs/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/physics.js +18 -2
- package/lib/commonjs/shared/providers/screen/gestures/shared/physics.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js +1 -5
- package/lib/commonjs/shared/providers/screen/gestures/shared/policy.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +1 -4
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +125 -0
- package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -0
- package/lib/commonjs/shared/stores/bounds/index.js +6 -12
- package/lib/commonjs/shared/stores/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/clear.js +13 -21
- package/lib/commonjs/shared/stores/bounds/internals/clear.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/entries.js +49 -9
- package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/links.js +143 -82
- package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +17 -43
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/state.js +26 -3
- package/lib/commonjs/shared/stores/bounds/internals/state.js.map +1 -1
- package/lib/commonjs/shared/stores/gesture.store.js +2 -0
- package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
- package/lib/commonjs/shared/types/gesture.types.js +2 -2
- package/lib/commonjs/shared/types/gesture.types.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +2 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js +6 -5
- package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +21 -8
- package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/resolve-bounds-pair-key.js +23 -0
- package/lib/commonjs/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +91 -199
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/config.js +15 -2
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/config.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +155 -14
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/commonjs/shared/utils/navigation/resolve-scene-neighbors.js +20 -19
- package/lib/commonjs/shared/utils/navigation/resolve-scene-neighbors.js.map +1 -1
- package/lib/module/component-stack/components/component-screen.js +2 -8
- package/lib/module/component-stack/components/component-screen.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js +27 -34
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js +4 -4
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +18 -20
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js +28 -8
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js +22 -50
- package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js +33 -40
- package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/index.js +3 -1
- package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js +70 -0
- package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.js → utils/measured-bounds.js} +13 -1
- package/lib/module/shared/components/create-boundary-component/utils/measured-bounds.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js +98 -0
- package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/utils/source-signals.js +47 -0
- package/lib/module/shared/components/create-boundary-component/utils/source-signals.js.map +1 -0
- package/lib/module/shared/components/native-screen.js +3 -14
- package/lib/module/shared/components/native-screen.js.map +1 -1
- package/lib/module/shared/constants.js +1 -6
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/providers/helpers/measured-bounds-writes.js +30 -0
- package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -0
- package/lib/module/shared/providers/register-bounds.provider.js +48 -55
- package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js +1 -10
- package/lib/module/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-activation.js +2 -2
- package/lib/module/shared/providers/screen/gestures/pan/pan-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-lifecycle.js +10 -3
- package/lib/module/shared/providers/screen/gestures/pan/pan-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-release.js +20 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-release.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/pan-reset.js +2 -0
- package/lib/module/shared/providers/screen/gestures/pan/pan-reset.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js +3 -3
- package/lib/module/shared/providers/screen/gestures/pan/use-pan-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/pinch-activation.js +3 -3
- package/lib/module/shared/providers/screen/gestures/pinch/pinch-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/pinch-lifecycle.js +1 -0
- package/lib/module/shared/providers/screen/gestures/pinch/pinch-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/use-pinch-behavior.js +3 -3
- package/lib/module/shared/providers/screen/gestures/pinch/use-pinch-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/physics.js +15 -0
- package/lib/module/shared/providers/screen/gestures/shared/physics.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/policy.js +3 -3
- package/lib/module/shared/providers/screen/gestures/shared/policy.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +1 -4
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +105 -0
- package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -0
- package/lib/module/shared/stores/bounds/index.js +7 -13
- package/lib/module/shared/stores/bounds/index.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/clear.js +14 -22
- package/lib/module/shared/stores/bounds/internals/clear.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/entries.js +49 -9
- package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/links.js +139 -80
- package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +17 -43
- package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/state.js +25 -2
- package/lib/module/shared/stores/bounds/internals/state.js.map +1 -1
- package/lib/module/shared/stores/gesture.store.js +2 -0
- package/lib/module/shared/stores/gesture.store.js.map +1 -1
- package/lib/module/shared/types/animation.types.js +0 -4
- package/lib/module/shared/types/animation.types.js.map +1 -1
- package/lib/module/shared/types/gesture.types.js +0 -1
- package/lib/module/shared/types/gesture.types.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +2 -1
- package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js +6 -5
- package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +21 -8
- package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/resolve-bounds-pair-key.js +18 -0
- package/lib/module/shared/utils/bounds/helpers/resolve-bounds-pair-key.js.map +1 -0
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js +90 -198
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/config.js +14 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/config.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js +144 -12
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/module/shared/utils/navigation/resolve-scene-neighbors.js +20 -19
- package/lib/module/shared/utils/navigation/resolve-scene-neighbors.js.map +1 -1
- package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts +1 -0
- package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-presence.d.ts +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-presence.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.d.ts +5 -4
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-source-measurement.d.ts +6 -2
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-source-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts +5 -4
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts +7 -7
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts.map +1 -1
- 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 +11 -7
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/utils/destination-signals.d.ts +10 -0
- package/lib/typescript/shared/components/create-boundary-component/utils/destination-signals.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.d.ts → utils/measured-bounds.d.ts} +3 -2
- package/lib/typescript/shared/components/create-boundary-component/utils/measured-bounds.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/utils/refresh-signals.d.ts +22 -0
- package/lib/typescript/shared/components/create-boundary-component/utils/refresh-signals.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/utils/source-signals.d.ts +16 -0
- package/lib/typescript/shared/components/create-boundary-component/utils/source-signals.d.ts.map +1 -0
- package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +0 -5
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +1 -1
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts +21 -0
- package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -0
- package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts +0 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-lifecycle.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-release.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-reset.d.ts +2 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/pan-reset.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/use-pan-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/pinch-lifecycle.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/use-pinch-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/physics.d.ts +7 -0
- package/lib/typescript/shared/providers/screen/gestures/shared/physics.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts +0 -10
- package/lib/typescript/shared/providers/screen/gestures/shared/policy.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/types.d.ts +2 -0
- package/lib/typescript/shared/providers/screen/gestures/types.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +18 -0
- package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -0
- package/lib/typescript/shared/stores/bounds/index.d.ts +6 -12
- package/lib/typescript/shared/stores/bounds/index.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/entries.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts +13 -10
- package/lib/typescript/shared/stores/bounds/internals/links.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 +26 -5
- package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts +14 -7
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- package/lib/typescript/shared/stores/gesture.store.d.ts +1 -0
- package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +0 -18
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/gesture.types.d.ts +8 -1
- package/lib/typescript/shared/types/gesture.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/bounds/helpers/create-bounds-accessor-core.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/resolve-bounds-pair-key.d.ts +4 -0
- package/lib/typescript/shared/utils/bounds/helpers/resolve-bounds-pair-key.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/config.d.ts +14 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/config.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts +48 -7
- package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/options.d.ts +2 -3
- package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
- package/lib/typescript/shared/utils/navigation/resolve-scene-neighbors.d.ts +3 -2
- package/lib/typescript/shared/utils/navigation/resolve-scene-neighbors.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/component-stack/components/component-screen.tsx +3 -11
- package/src/shared/components/create-boundary-component/create-boundary-component.tsx +30 -27
- package/src/shared/components/create-boundary-component/hooks/use-boundary-presence.ts +5 -5
- package/src/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.ts +25 -24
- package/src/shared/components/create-boundary-component/hooks/use-initial-source-measurement.ts +41 -11
- package/src/shared/components/create-boundary-component/hooks/use-measurer.ts +49 -64
- package/src/shared/components/create-boundary-component/hooks/use-refresh-boundary.ts +44 -83
- package/src/shared/components/create-boundary-component/index.tsx +3 -1
- package/src/shared/components/create-boundary-component/types.ts +13 -11
- package/src/shared/components/create-boundary-component/utils/destination-signals.ts +129 -0
- package/src/shared/components/create-boundary-component/{hooks/helpers/scroll-measurement.ts → utils/measured-bounds.ts} +25 -1
- package/src/shared/components/create-boundary-component/utils/refresh-signals.ts +164 -0
- package/src/shared/components/create-boundary-component/utils/source-signals.ts +72 -0
- package/src/shared/components/native-screen.tsx +3 -12
- package/src/shared/constants.ts +1 -6
- package/src/shared/index.ts +0 -3
- package/src/shared/providers/helpers/measured-bounds-writes.ts +67 -0
- package/src/shared/providers/register-bounds.provider.tsx +68 -91
- package/src/shared/providers/screen/animation/helpers/accessors/use-build-transition-accessor.ts +0 -14
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +1 -2
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +1 -4
- package/src/shared/providers/screen/gestures/pan/pan-activation.ts +4 -1
- package/src/shared/providers/screen/gestures/pan/pan-lifecycle.ts +18 -2
- package/src/shared/providers/screen/gestures/pan/pan-release.ts +33 -0
- package/src/shared/providers/screen/gestures/pan/pan-reset.ts +3 -0
- package/src/shared/providers/screen/gestures/pan/use-pan-behavior.ts +9 -6
- package/src/shared/providers/screen/gestures/pinch/pinch-activation.ts +5 -2
- package/src/shared/providers/screen/gestures/pinch/pinch-lifecycle.ts +1 -0
- package/src/shared/providers/screen/gestures/pinch/use-pinch-behavior.ts +9 -6
- package/src/shared/providers/screen/gestures/shared/physics.ts +25 -0
- package/src/shared/providers/screen/gestures/shared/policy.ts +3 -5
- package/src/shared/providers/screen/gestures/types.ts +2 -0
- package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +0 -3
- package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +161 -0
- package/src/shared/stores/bounds/index.ts +10 -20
- package/src/shared/stores/bounds/internals/clear.ts +17 -41
- package/src/shared/stores/bounds/internals/entries.ts +56 -13
- package/src/shared/stores/bounds/internals/links.ts +222 -113
- package/src/shared/stores/bounds/internals/resolver.ts +23 -87
- package/src/shared/stores/bounds/internals/state.ts +27 -5
- package/src/shared/stores/bounds/types.ts +17 -7
- package/src/shared/stores/gesture.store.ts +3 -0
- package/src/shared/types/animation.types.ts +0 -23
- package/src/shared/types/gesture.types.ts +8 -2
- package/src/shared/types/index.ts +0 -4
- package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +1 -0
- package/src/shared/utils/bounds/helpers/create-link-accessor.ts +6 -6
- package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +20 -11
- package/src/shared/utils/bounds/helpers/resolve-bounds-pair-key.ts +22 -0
- package/src/shared/utils/bounds/navigation/reveal/build.ts +153 -297
- package/src/shared/utils/bounds/navigation/reveal/config.ts +20 -1
- package/src/shared/utils/bounds/navigation/reveal/math.ts +234 -18
- package/src/shared/utils/bounds/types/options.ts +2 -3
- package/src/shared/utils/navigation/resolve-scene-neighbors.ts +36 -23
- package/lib/commonjs/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js +0 -43
- package/lib/commonjs/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +0 -17
- package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js +0 -28
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +0 -75
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement.js +0 -20
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/scroll-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js +0 -16
- package/lib/commonjs/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +0 -1
- package/lib/commonjs/shared/providers/layout-anchor.provider.js +0 -86
- package/lib/commonjs/shared/providers/layout-anchor.provider.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/helpers/entries.helpers.js +0 -49
- package/lib/commonjs/shared/stores/bounds/helpers/entries.helpers.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/helpers/find-latest.js +0 -25
- package/lib/commonjs/shared/stores/bounds/helpers/find-latest.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/helpers/groups.helpers.js +0 -30
- package/lib/commonjs/shared/stores/bounds/helpers/groups.helpers.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/helpers/link.helpers.js +0 -79
- package/lib/commonjs/shared/stores/bounds/helpers/link.helpers.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/helpers/matching.js +0 -13
- package/lib/commonjs/shared/stores/bounds/helpers/matching.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/helpers/tag-state.helpers.js +0 -30
- package/lib/commonjs/shared/stores/bounds/helpers/tag-state.helpers.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/internals/groups.js +0 -102
- package/lib/commonjs/shared/stores/bounds/internals/groups.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js +0 -38
- package/lib/module/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +0 -12
- package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js +0 -23
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +0 -68
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement.js +0 -15
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/scroll-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js +0 -12
- package/lib/module/shared/components/create-boundary-component/utils/build-boundary-match-key.js.map +0 -1
- package/lib/module/shared/providers/layout-anchor.provider.js +0 -80
- package/lib/module/shared/providers/layout-anchor.provider.js.map +0 -1
- package/lib/module/shared/stores/bounds/helpers/entries.helpers.js +0 -42
- package/lib/module/shared/stores/bounds/helpers/entries.helpers.js.map +0 -1
- package/lib/module/shared/stores/bounds/helpers/find-latest.js +0 -19
- package/lib/module/shared/stores/bounds/helpers/find-latest.js.map +0 -1
- package/lib/module/shared/stores/bounds/helpers/groups.helpers.js +0 -23
- package/lib/module/shared/stores/bounds/helpers/groups.helpers.js.map +0 -1
- package/lib/module/shared/stores/bounds/helpers/link.helpers.js +0 -69
- package/lib/module/shared/stores/bounds/helpers/link.helpers.js.map +0 -1
- package/lib/module/shared/stores/bounds/helpers/matching.js +0 -9
- package/lib/module/shared/stores/bounds/helpers/matching.js.map +0 -1
- package/lib/module/shared/stores/bounds/helpers/tag-state.helpers.js +0 -24
- package/lib/module/shared/stores/bounds/helpers/tag-state.helpers.js.map +0 -1
- package/lib/module/shared/stores/bounds/internals/groups.js +0 -95
- package/lib/module/shared/stores/bounds/internals/groups.js.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.d.ts +0 -15
- package/lib/typescript/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts +0 -2
- package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.d.ts +0 -22
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +0 -29
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement.d.ts +0 -3
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/scroll-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts +0 -8
- package/lib/typescript/shared/components/create-boundary-component/utils/build-boundary-match-key.d.ts.map +0 -1
- package/lib/typescript/shared/providers/layout-anchor.provider.d.ts +0 -39
- package/lib/typescript/shared/providers/layout-anchor.provider.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/helpers/entries.helpers.d.ts +0 -5
- package/lib/typescript/shared/stores/bounds/helpers/entries.helpers.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/helpers/find-latest.d.ts +0 -3
- package/lib/typescript/shared/stores/bounds/helpers/find-latest.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/helpers/groups.helpers.d.ts +0 -10
- package/lib/typescript/shared/stores/bounds/helpers/groups.helpers.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/helpers/link.helpers.d.ts +0 -14
- package/lib/typescript/shared/stores/bounds/helpers/link.helpers.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/helpers/matching.d.ts +0 -3
- package/lib/typescript/shared/stores/bounds/helpers/matching.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/helpers/tag-state.helpers.d.ts +0 -5
- package/lib/typescript/shared/stores/bounds/helpers/tag-state.helpers.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/internals/groups.d.ts +0 -16
- package/lib/typescript/shared/stores/bounds/internals/groups.d.ts.map +0 -1
- package/src/shared/components/create-boundary-component/helpers/apply-measured-bounds-writes.ts +0 -83
- package/src/shared/components/create-boundary-component/helpers/resolve-pending-source-key.ts +0 -20
- package/src/shared/components/create-boundary-component/hooks/helpers/boundary-link-context.ts +0 -48
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +0 -101
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement.ts +0 -25
- package/src/shared/components/create-boundary-component/utils/build-boundary-match-key.ts +0 -14
- package/src/shared/providers/layout-anchor.provider.tsx +0 -112
- package/src/shared/stores/bounds/helpers/entries.helpers.ts +0 -55
- package/src/shared/stores/bounds/helpers/find-latest.ts +0 -22
- package/src/shared/stores/bounds/helpers/groups.helpers.ts +0 -27
- package/src/shared/stores/bounds/helpers/link.helpers.ts +0 -131
- package/src/shared/stores/bounds/helpers/matching.ts +0 -11
- package/src/shared/stores/bounds/helpers/tag-state.helpers.ts +0 -24
- package/src/shared/stores/bounds/internals/groups.ts +0 -116
|
@@ -2,22 +2,24 @@ import { useCallback } from "react";
|
|
|
2
2
|
import type { View } from "react-native";
|
|
3
3
|
import { useWindowDimensions } from "react-native";
|
|
4
4
|
import type { AnimatedRef, StyleProps } from "react-native-reanimated";
|
|
5
|
+
import { setEntry } from "../../../stores/bounds/internals/entries";
|
|
6
|
+
import {
|
|
7
|
+
setDestination,
|
|
8
|
+
setSource,
|
|
9
|
+
} from "../../../stores/bounds/internals/links";
|
|
5
10
|
import { ScrollStore } from "../../../stores/scroll.store";
|
|
6
11
|
import { SystemStore } from "../../../stores/system.store";
|
|
7
|
-
import {
|
|
8
|
-
import type { MeasureParams } from "../types";
|
|
9
|
-
import { createLinkContext } from "./helpers/boundary-link-context";
|
|
10
|
-
import { isMeasurementInViewport } from "./helpers/measurement";
|
|
12
|
+
import type { MeasureBoundary } from "../types";
|
|
11
13
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
} from "
|
|
15
|
-
import { measureWithOverscrollAwareness } from "./helpers/scroll-measurement";
|
|
14
|
+
isMeasurementInViewport,
|
|
15
|
+
measureWithOverscrollAwareness,
|
|
16
|
+
} from "../utils/measured-bounds";
|
|
16
17
|
|
|
17
18
|
interface UseMeasurerParams {
|
|
18
19
|
enabled: boolean;
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
entryTag: string;
|
|
21
|
+
linkId: string;
|
|
22
|
+
group?: string;
|
|
21
23
|
currentScreenKey: string;
|
|
22
24
|
preparedStyles: StyleProps;
|
|
23
25
|
measuredAnimatedRef: AnimatedRef<View>;
|
|
@@ -25,12 +27,13 @@ interface UseMeasurerParams {
|
|
|
25
27
|
|
|
26
28
|
export const useMeasurer = ({
|
|
27
29
|
enabled,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
entryTag,
|
|
31
|
+
linkId,
|
|
32
|
+
group,
|
|
30
33
|
currentScreenKey,
|
|
31
34
|
preparedStyles,
|
|
32
35
|
measuredAnimatedRef,
|
|
33
|
-
}: UseMeasurerParams) => {
|
|
36
|
+
}: UseMeasurerParams): MeasureBoundary => {
|
|
34
37
|
const { width: viewportWidth, height: viewportHeight } =
|
|
35
38
|
useWindowDimensions();
|
|
36
39
|
|
|
@@ -41,27 +44,10 @@ export const useMeasurer = ({
|
|
|
41
44
|
);
|
|
42
45
|
|
|
43
46
|
return useCallback(
|
|
44
|
-
(
|
|
47
|
+
(target) => {
|
|
45
48
|
"worklet";
|
|
46
49
|
if (!enabled) return;
|
|
47
50
|
|
|
48
|
-
const intents = getMeasureIntentFlags(intent);
|
|
49
|
-
const currentLink = createLinkContext({
|
|
50
|
-
sharedBoundTag,
|
|
51
|
-
currentScreenKey,
|
|
52
|
-
preferredSourceScreenKey,
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
const writePlan = buildMeasurementWritePlan({
|
|
56
|
-
intents,
|
|
57
|
-
hasPendingLink: currentLink.hasPendingLink,
|
|
58
|
-
hasSourceLink: currentLink.hasSourceLink,
|
|
59
|
-
hasDestinationLink: currentLink.hasDestinationLink,
|
|
60
|
-
hasAttachableSourceLink: currentLink.hasAttachableSourceLink,
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
if (!writePlan.writesAny) return;
|
|
64
|
-
|
|
65
51
|
const measured = measureWithOverscrollAwareness(
|
|
66
52
|
measuredAnimatedRef,
|
|
67
53
|
scrollState.get(),
|
|
@@ -69,15 +55,6 @@ export const useMeasurer = ({
|
|
|
69
55
|
|
|
70
56
|
if (!measured) return;
|
|
71
57
|
|
|
72
|
-
/**
|
|
73
|
-
* Source Pass
|
|
74
|
-
* Source intents are intentionally used & kept unguarded.
|
|
75
|
-
*/
|
|
76
|
-
const sourceWrites = {
|
|
77
|
-
shouldSetSource: writePlan.captureSource,
|
|
78
|
-
shouldUpdateSource: writePlan.refreshSource,
|
|
79
|
-
};
|
|
80
|
-
|
|
81
58
|
/**
|
|
82
59
|
* - Destination Pass -
|
|
83
60
|
* Be strict while lifecycle start is blocked for destination capture.
|
|
@@ -86,40 +63,48 @@ export const useMeasurer = ({
|
|
|
86
63
|
* lifecycle blocked until a valid retry lands.
|
|
87
64
|
*/
|
|
88
65
|
const shouldGuardDestinationViewport =
|
|
89
|
-
pendingLifecycleStartBlockCount.get() > 0;
|
|
66
|
+
pendingLifecycleStartBlockCount.get() > 0 || !!group;
|
|
67
|
+
|
|
90
68
|
const viewportAllowsDestinationWrite =
|
|
69
|
+
target.type !== "destination" ||
|
|
91
70
|
!shouldGuardDestinationViewport ||
|
|
92
71
|
isMeasurementInViewport(measured, viewportWidth, viewportHeight);
|
|
93
72
|
|
|
94
|
-
|
|
95
|
-
shouldSetDestination:
|
|
96
|
-
viewportAllowsDestinationWrite && writePlan.completeDestination,
|
|
97
|
-
shouldUpdateDestination:
|
|
98
|
-
viewportAllowsDestinationWrite && writePlan.refreshDestination,
|
|
99
|
-
};
|
|
73
|
+
if (!viewportAllowsDestinationWrite) return;
|
|
100
74
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
75
|
+
// Set the bounds entry on every measure to avoid any stale measurements
|
|
76
|
+
// for the public read API.
|
|
77
|
+
setEntry(entryTag, currentScreenKey, {
|
|
78
|
+
bounds: measured,
|
|
79
|
+
});
|
|
106
80
|
|
|
107
|
-
if (
|
|
81
|
+
if (target.type === "source") {
|
|
82
|
+
setSource(
|
|
83
|
+
target.pairKey,
|
|
84
|
+
linkId,
|
|
85
|
+
currentScreenKey,
|
|
86
|
+
measured,
|
|
87
|
+
preparedStyles,
|
|
88
|
+
group,
|
|
89
|
+
);
|
|
90
|
+
}
|
|
108
91
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
92
|
+
if (target.type === "destination") {
|
|
93
|
+
setDestination(
|
|
94
|
+
target.pairKey,
|
|
95
|
+
linkId,
|
|
96
|
+
currentScreenKey,
|
|
97
|
+
measured,
|
|
98
|
+
preparedStyles,
|
|
99
|
+
group,
|
|
100
|
+
);
|
|
101
|
+
}
|
|
118
102
|
},
|
|
119
103
|
[
|
|
120
104
|
enabled,
|
|
121
|
-
|
|
122
|
-
|
|
105
|
+
entryTag,
|
|
106
|
+
linkId,
|
|
107
|
+
group,
|
|
123
108
|
currentScreenKey,
|
|
124
109
|
preparedStyles,
|
|
125
110
|
measuredAnimatedRef,
|
|
@@ -1,116 +1,77 @@
|
|
|
1
1
|
import { useAnimatedReaction } from "react-native-reanimated";
|
|
2
2
|
import { AnimationStore } from "../../../stores/animation.store";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
hasSourceLink,
|
|
7
|
-
} from "../../../stores/bounds/internals/links";
|
|
8
|
-
import type { BoundaryId, MeasureParams } from "../types";
|
|
3
|
+
import { pairs } from "../../../stores/bounds/internals/state";
|
|
4
|
+
import type { MeasureBoundary } from "../types";
|
|
5
|
+
import { getRefreshBoundarySignal } from "../utils/refresh-signals";
|
|
9
6
|
|
|
10
7
|
interface UseRefreshBoundaryParams {
|
|
11
8
|
enabled: boolean;
|
|
12
|
-
sharedBoundTag: string;
|
|
13
|
-
id: BoundaryId;
|
|
14
|
-
group?: string;
|
|
15
9
|
currentScreenKey: string;
|
|
10
|
+
preferredSourceScreenKey?: string;
|
|
16
11
|
nextScreenKey?: string;
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
linkId: string;
|
|
13
|
+
group?: string;
|
|
14
|
+
ancestorScreenKeys: string[];
|
|
15
|
+
measureBoundary: MeasureBoundary;
|
|
19
16
|
}
|
|
20
17
|
|
|
21
18
|
export const useRefreshBoundary = ({
|
|
22
19
|
enabled,
|
|
23
|
-
sharedBoundTag,
|
|
24
|
-
id,
|
|
25
|
-
group,
|
|
26
20
|
currentScreenKey,
|
|
21
|
+
preferredSourceScreenKey,
|
|
27
22
|
nextScreenKey,
|
|
28
|
-
|
|
23
|
+
linkId,
|
|
24
|
+
group,
|
|
25
|
+
ancestorScreenKeys,
|
|
29
26
|
measureBoundary,
|
|
30
27
|
}: UseRefreshBoundaryParams) => {
|
|
31
|
-
|
|
32
|
-
|
|
28
|
+
// Source-side boundaries refresh from the next screen's lifecycle pulse.
|
|
29
|
+
// Destination-side boundaries have no next screen, so they refresh from self.
|
|
30
|
+
const refreshScreenKey = nextScreenKey ?? currentScreenKey;
|
|
31
|
+
const refreshWillAnimate = AnimationStore.getValue(
|
|
32
|
+
refreshScreenKey,
|
|
33
33
|
"willAnimate",
|
|
34
34
|
);
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
35
|
+
const refreshClosing = AnimationStore.getValue(refreshScreenKey, "closing");
|
|
36
|
+
const refreshEntering = AnimationStore.getValue(refreshScreenKey, "entering");
|
|
37
|
+
const refreshAnimating = AnimationStore.getValue(
|
|
38
|
+
refreshScreenKey,
|
|
39
39
|
"progressAnimating",
|
|
40
40
|
);
|
|
41
|
-
const
|
|
42
|
-
const nextWillAnimate = nextScreenKey
|
|
43
|
-
? AnimationStore.getValue(nextScreenKey, "willAnimate")
|
|
44
|
-
: null;
|
|
45
|
-
|
|
46
|
-
const nextClosing = nextScreenKey
|
|
47
|
-
? AnimationStore.getValue(nextScreenKey, "closing")
|
|
48
|
-
: null;
|
|
49
|
-
const nextEntering = nextScreenKey
|
|
50
|
-
? AnimationStore.getValue(nextScreenKey, "entering")
|
|
51
|
-
: null;
|
|
41
|
+
const refreshProgress = AnimationStore.getValue(refreshScreenKey, "progress");
|
|
52
42
|
|
|
53
43
|
useAnimatedReaction(
|
|
54
44
|
() => {
|
|
55
45
|
"worklet";
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
!hasNextScreen &&
|
|
72
|
-
shouldRefresh &&
|
|
73
|
-
closing &&
|
|
74
|
-
!entering &&
|
|
75
|
-
!currentAnimating.get() &&
|
|
76
|
-
currentProgress.get() >= 1;
|
|
77
|
-
|
|
78
|
-
if (
|
|
79
|
-
canRefreshPreCloseDestination ||
|
|
80
|
-
(shouldRefresh && !closing && !entering)
|
|
81
|
-
) {
|
|
82
|
-
return 1;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return 0;
|
|
46
|
+
return getRefreshBoundarySignal({
|
|
47
|
+
enabled,
|
|
48
|
+
currentScreenKey,
|
|
49
|
+
preferredSourceScreenKey,
|
|
50
|
+
nextScreenKey,
|
|
51
|
+
linkId,
|
|
52
|
+
group,
|
|
53
|
+
ancestorScreenKeys,
|
|
54
|
+
shouldRefresh: !!refreshWillAnimate.get(),
|
|
55
|
+
closing: !!refreshClosing.get(),
|
|
56
|
+
entering: !!refreshEntering.get(),
|
|
57
|
+
animating: !!refreshAnimating.get(),
|
|
58
|
+
progress: refreshProgress.get(),
|
|
59
|
+
linkState: group || ancestorScreenKeys.length ? pairs.get() : undefined,
|
|
60
|
+
});
|
|
86
61
|
},
|
|
87
|
-
(
|
|
62
|
+
(refreshSignal, prevRefreshSignal) => {
|
|
88
63
|
"worklet";
|
|
89
64
|
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
if (group && currentGroupActiveId !== String(id)) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (hasNextScreen) {
|
|
100
|
-
if (
|
|
101
|
-
!nextScreenKey ||
|
|
102
|
-
!hasSourceLink(sharedBoundTag, currentScreenKey) ||
|
|
103
|
-
!hasDestinationLink(sharedBoundTag, nextScreenKey)
|
|
104
|
-
) {
|
|
105
|
-
return;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
measureBoundary({ intent: "refresh-source" });
|
|
65
|
+
if (
|
|
66
|
+
!refreshSignal ||
|
|
67
|
+
refreshSignal.signal === prevRefreshSignal?.signal
|
|
68
|
+
) {
|
|
109
69
|
return;
|
|
110
70
|
}
|
|
111
71
|
|
|
112
72
|
measureBoundary({
|
|
113
|
-
|
|
73
|
+
type: refreshSignal.type,
|
|
74
|
+
pairKey: refreshSignal.pairKey,
|
|
114
75
|
});
|
|
115
76
|
},
|
|
116
77
|
);
|
|
@@ -4,7 +4,9 @@ import { createBoundaryComponent } from "./create-boundary-component";
|
|
|
4
4
|
|
|
5
5
|
export { createBoundaryComponent };
|
|
6
6
|
|
|
7
|
-
const BoundaryView = createBoundaryComponent(View
|
|
7
|
+
const BoundaryView = createBoundaryComponent(View, {
|
|
8
|
+
shouldAutoMeasure: true,
|
|
9
|
+
});
|
|
8
10
|
const BoundaryTrigger = createBoundaryComponent(Pressable);
|
|
9
11
|
BoundaryView.displayName = "Transition.Boundary.View";
|
|
10
12
|
BoundaryTrigger.displayName = "Transition.Boundary.Trigger";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ScreenPairKey } from "../../stores/bounds/types";
|
|
1
2
|
import type { BoundsOptions } from "../../utils/bounds/types/options";
|
|
2
3
|
|
|
3
4
|
export type BoundaryId = string | number;
|
|
@@ -15,9 +16,8 @@ export type BoundaryConfigProps = Pick<
|
|
|
15
16
|
export interface BoundaryOwnProps extends BoundaryConfigProps {
|
|
16
17
|
/**
|
|
17
18
|
* Optional group name for collection/list scenarios.
|
|
18
|
-
* When provided,
|
|
19
|
-
*
|
|
20
|
-
* The internal tag becomes `group:id`.
|
|
19
|
+
* When provided, concrete boundary entries use `group:id`, while transition
|
|
20
|
+
* links stay keyed by the member `id` inside the active screen pair.
|
|
21
21
|
*/
|
|
22
22
|
group?: string;
|
|
23
23
|
/**
|
|
@@ -35,12 +35,14 @@ export interface BoundaryOwnProps extends BoundaryConfigProps {
|
|
|
35
35
|
export type BoundaryComponentProps<P extends object> = Omit<P, "id"> &
|
|
36
36
|
BoundaryOwnProps;
|
|
37
37
|
|
|
38
|
-
export type
|
|
39
|
-
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
export type MeasureTarget =
|
|
39
|
+
| {
|
|
40
|
+
type: "source";
|
|
41
|
+
pairKey: ScreenPairKey;
|
|
42
|
+
}
|
|
43
|
+
| {
|
|
44
|
+
type: "destination";
|
|
45
|
+
pairKey: ScreenPairKey;
|
|
46
|
+
};
|
|
43
47
|
|
|
44
|
-
export
|
|
45
|
-
intent?: MeasureIntent | readonly MeasureIntent[];
|
|
46
|
-
}
|
|
48
|
+
export type MeasureBoundary = (target: MeasureTarget) => void;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createPendingPairKey,
|
|
3
|
+
createScreenPairKey,
|
|
4
|
+
getDestinationScreenKeyFromPairKey,
|
|
5
|
+
getSourceScreenKeyFromPairKey,
|
|
6
|
+
} from "../../../stores/bounds/helpers/link-pairs.helpers";
|
|
7
|
+
import {
|
|
8
|
+
getDestination,
|
|
9
|
+
getSource,
|
|
10
|
+
} from "../../../stores/bounds/internals/links";
|
|
11
|
+
import type {
|
|
12
|
+
LinkPairsState,
|
|
13
|
+
ScreenPairKey,
|
|
14
|
+
} from "../../../stores/bounds/types";
|
|
15
|
+
|
|
16
|
+
const findPendingSourcePairKey = (
|
|
17
|
+
linkState: LinkPairsState | undefined,
|
|
18
|
+
linkId: string,
|
|
19
|
+
): ScreenPairKey | null => {
|
|
20
|
+
"worklet";
|
|
21
|
+
if (!linkState) return null;
|
|
22
|
+
|
|
23
|
+
for (const pairKey in linkState) {
|
|
24
|
+
const sourceScreenKey = getSourceScreenKeyFromPairKey(pairKey);
|
|
25
|
+
|
|
26
|
+
if (pairKey !== createPendingPairKey(sourceScreenKey)) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (linkState[pairKey]?.links?.[linkId]?.source) {
|
|
31
|
+
return pairKey;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return null;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// Passive Boundary.View sources in nested routes can already live in the final
|
|
39
|
+
// ancestor pair, even before the destination side has attached.
|
|
40
|
+
const findAncestorSourcePairKey = (
|
|
41
|
+
linkState: LinkPairsState | undefined,
|
|
42
|
+
linkId: string,
|
|
43
|
+
destinationScreenKey: string | undefined,
|
|
44
|
+
): ScreenPairKey | null => {
|
|
45
|
+
"worklet";
|
|
46
|
+
if (!linkState || !destinationScreenKey) return null;
|
|
47
|
+
|
|
48
|
+
for (const pairKey in linkState) {
|
|
49
|
+
if (getDestinationScreenKeyFromPairKey(pairKey) !== destinationScreenKey) {
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (linkState[pairKey]?.links?.[linkId]?.source) {
|
|
54
|
+
return pairKey;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return null;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const getInitialDestinationMeasurePairKey = (params: {
|
|
62
|
+
enabled: boolean;
|
|
63
|
+
currentScreenKey: string;
|
|
64
|
+
preferredSourceScreenKey?: string;
|
|
65
|
+
ancestorScreenKeys?: readonly string[];
|
|
66
|
+
linkId: string;
|
|
67
|
+
linkState?: LinkPairsState;
|
|
68
|
+
}): ScreenPairKey | null => {
|
|
69
|
+
"worklet";
|
|
70
|
+
const {
|
|
71
|
+
enabled,
|
|
72
|
+
currentScreenKey,
|
|
73
|
+
preferredSourceScreenKey,
|
|
74
|
+
ancestorScreenKeys,
|
|
75
|
+
linkId,
|
|
76
|
+
linkState,
|
|
77
|
+
} = params;
|
|
78
|
+
|
|
79
|
+
if (!enabled) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Initial screens inside nested navigators measure concrete child views, but
|
|
84
|
+
// the transition pair belongs to the nearest animated ancestor route.
|
|
85
|
+
const ancestorPairKey = findAncestorSourcePairKey(
|
|
86
|
+
linkState,
|
|
87
|
+
linkId,
|
|
88
|
+
ancestorScreenKeys?.[0],
|
|
89
|
+
);
|
|
90
|
+
|
|
91
|
+
// Trigger sources start as pending screen<> links. Boundary.View sources may
|
|
92
|
+
// already be in the ancestor pair, so only scan pending when needed.
|
|
93
|
+
const pendingSourcePairKey = preferredSourceScreenKey
|
|
94
|
+
? createPendingPairKey(preferredSourceScreenKey)
|
|
95
|
+
: ancestorPairKey
|
|
96
|
+
? null
|
|
97
|
+
: findPendingSourcePairKey(linkState, linkId);
|
|
98
|
+
|
|
99
|
+
const sourceScreenKey = preferredSourceScreenKey
|
|
100
|
+
? preferredSourceScreenKey
|
|
101
|
+
: getSourceScreenKeyFromPairKey(
|
|
102
|
+
ancestorPairKey ?? pendingSourcePairKey ?? "",
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
if (!sourceScreenKey) return null;
|
|
106
|
+
|
|
107
|
+
// Non-nested destinations attach to their own route. Nested initial screens
|
|
108
|
+
// attach to the animated ancestor route unless that pair already exists.
|
|
109
|
+
const destinationScreenKey =
|
|
110
|
+
ancestorPairKey || preferredSourceScreenKey || !ancestorScreenKeys?.[0]
|
|
111
|
+
? currentScreenKey
|
|
112
|
+
: ancestorScreenKeys[0];
|
|
113
|
+
|
|
114
|
+
const destinationPairKey =
|
|
115
|
+
ancestorPairKey ??
|
|
116
|
+
createScreenPairKey(sourceScreenKey, destinationScreenKey);
|
|
117
|
+
|
|
118
|
+
const hasDestinationLink =
|
|
119
|
+
getDestination(destinationPairKey, linkId) !== null;
|
|
120
|
+
|
|
121
|
+
const hasAttachableSourceLink =
|
|
122
|
+
getSource(destinationPairKey, linkId) !== null ||
|
|
123
|
+
(!!pendingSourcePairKey &&
|
|
124
|
+
getSource(pendingSourcePairKey, linkId) !== null);
|
|
125
|
+
|
|
126
|
+
return hasAttachableSourceLink && !hasDestinationLink
|
|
127
|
+
? destinationPairKey
|
|
128
|
+
: null;
|
|
129
|
+
};
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import type {
|
|
8
8
|
ScrollGestureAxisState,
|
|
9
9
|
ScrollGestureState,
|
|
10
|
-
} from "
|
|
10
|
+
} from "../../../types/gesture.types";
|
|
11
11
|
|
|
12
12
|
const SCROLL_MEASUREMENT_EPSILON = 1;
|
|
13
13
|
|
|
@@ -46,6 +46,30 @@ export const adjustedMeasuredBoundsForOverscrollDeltas = (
|
|
|
46
46
|
};
|
|
47
47
|
};
|
|
48
48
|
|
|
49
|
+
export const isMeasurementInViewport = (
|
|
50
|
+
measured: MeasuredDimensions,
|
|
51
|
+
viewportWidth: number,
|
|
52
|
+
viewportHeight: number,
|
|
53
|
+
): boolean => {
|
|
54
|
+
"worklet";
|
|
55
|
+
|
|
56
|
+
if (measured.width <= 0 || measured.height <= 0) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const toleranceX = viewportWidth * 0.15;
|
|
61
|
+
const toleranceY = viewportHeight * 0.15;
|
|
62
|
+
const centerX = measured.pageX + measured.width / 2;
|
|
63
|
+
const centerY = measured.pageY + measured.height / 2;
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
centerX >= -toleranceX &&
|
|
67
|
+
centerX <= viewportWidth + toleranceX &&
|
|
68
|
+
centerY >= -toleranceY &&
|
|
69
|
+
centerY <= viewportHeight + toleranceY
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
49
73
|
export const measureWithOverscrollAwareness = (
|
|
50
74
|
ref: AnimatedRef<View>,
|
|
51
75
|
scrollState: ScrollGestureState | null,
|