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
|
@@ -1,23 +1,64 @@
|
|
|
1
|
-
import {
|
|
2
|
-
applyEntryPatch,
|
|
3
|
-
ensureScreenEntry,
|
|
4
|
-
findMatchingScreenEntry,
|
|
5
|
-
} from "../helpers/entries.helpers";
|
|
6
|
-
import { ensureTagState, pruneTagState } from "../helpers/tag-state.helpers";
|
|
1
|
+
import { hasAnyKeys } from "../helpers/keys";
|
|
7
2
|
import type { EntryPatch, ScreenEntry, ScreenKey, TagID } from "../types";
|
|
8
|
-
import { type
|
|
3
|
+
import { type BoundaryEntriesState, boundaryRegistry } from "./state";
|
|
4
|
+
|
|
5
|
+
const ensureBoundaryState = (state: BoundaryEntriesState, tag: TagID) => {
|
|
6
|
+
"worklet";
|
|
7
|
+
if (!state[tag]) {
|
|
8
|
+
state[tag] = {
|
|
9
|
+
screens: {},
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
return state[tag];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const ensureScreenEntry = (
|
|
16
|
+
state: BoundaryEntriesState,
|
|
17
|
+
tag: TagID,
|
|
18
|
+
screenKey: ScreenKey,
|
|
19
|
+
): ScreenEntry => {
|
|
20
|
+
"worklet";
|
|
21
|
+
const tagState = ensureBoundaryState(state, tag);
|
|
22
|
+
if (!tagState.screens[screenKey]) {
|
|
23
|
+
tagState.screens[screenKey] = {
|
|
24
|
+
bounds: null,
|
|
25
|
+
styles: {},
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return tagState.screens[screenKey];
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const applyEntryPatch = (entry: ScreenEntry, patch: EntryPatch) => {
|
|
32
|
+
"worklet";
|
|
33
|
+
if (patch.bounds !== undefined) {
|
|
34
|
+
entry.bounds = patch.bounds;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (patch.styles !== undefined) {
|
|
38
|
+
entry.styles = patch.styles ?? {};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (patch.boundaryConfig === undefined) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (patch.boundaryConfig === null) {
|
|
46
|
+
delete entry.boundaryConfig;
|
|
47
|
+
} else {
|
|
48
|
+
entry.boundaryConfig = patch.boundaryConfig;
|
|
49
|
+
}
|
|
50
|
+
};
|
|
9
51
|
|
|
10
52
|
function getEntry(tag: TagID, key: ScreenKey): ScreenEntry | null {
|
|
11
53
|
"worklet";
|
|
12
|
-
return
|
|
54
|
+
return boundaryRegistry.get()[tag]?.screens[key] ?? null;
|
|
13
55
|
}
|
|
14
56
|
|
|
15
57
|
function setEntry(tag: TagID, screenKey: ScreenKey, patch: EntryPatch) {
|
|
16
58
|
"worklet";
|
|
17
|
-
|
|
59
|
+
boundaryRegistry.modify(<T extends BoundaryEntriesState>(state: T): T => {
|
|
18
60
|
"worklet";
|
|
19
|
-
const
|
|
20
|
-
const entry = ensureScreenEntry(tagState, screenKey);
|
|
61
|
+
const entry = ensureScreenEntry(state, tag, screenKey);
|
|
21
62
|
applyEntryPatch(entry, patch);
|
|
22
63
|
return state;
|
|
23
64
|
});
|
|
@@ -25,7 +66,7 @@ function setEntry(tag: TagID, screenKey: ScreenKey, patch: EntryPatch) {
|
|
|
25
66
|
|
|
26
67
|
function removeEntry(tag: TagID, screenKey: ScreenKey) {
|
|
27
68
|
"worklet";
|
|
28
|
-
|
|
69
|
+
boundaryRegistry.modify(<T extends BoundaryEntriesState>(state: T): T => {
|
|
29
70
|
"worklet";
|
|
30
71
|
const tagState = state[tag];
|
|
31
72
|
if (!tagState?.screens[screenKey]) {
|
|
@@ -33,7 +74,9 @@ function removeEntry(tag: TagID, screenKey: ScreenKey) {
|
|
|
33
74
|
}
|
|
34
75
|
|
|
35
76
|
delete tagState.screens[screenKey];
|
|
36
|
-
|
|
77
|
+
if (!hasAnyKeys(tagState.screens)) {
|
|
78
|
+
delete state[tag];
|
|
79
|
+
}
|
|
37
80
|
|
|
38
81
|
return state;
|
|
39
82
|
});
|
|
@@ -1,72 +1,169 @@
|
|
|
1
1
|
import type { MeasuredDimensions, StyleProps } from "react-native-reanimated";
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
3
|
+
createGroupTag,
|
|
4
|
+
createPendingPairKey,
|
|
5
|
+
ensurePairGroups,
|
|
6
|
+
ensurePairLinks,
|
|
7
|
+
getGroupKeyFromTag,
|
|
8
|
+
getLinkKeyFromTag,
|
|
9
|
+
getActiveGroupId as getPairActiveGroupId,
|
|
10
|
+
getDestination as getPairDestination,
|
|
11
|
+
getLink as getPairLink,
|
|
12
|
+
getSource as getPairSource,
|
|
13
|
+
getSourceScreenKeyFromPairKey,
|
|
14
|
+
removePairLink,
|
|
15
|
+
} from "../helpers/link-pairs.helpers";
|
|
16
|
+
import type {
|
|
17
|
+
GroupKey,
|
|
18
|
+
LinkKey,
|
|
19
|
+
LinkPairsState,
|
|
20
|
+
ScreenKey,
|
|
21
|
+
ScreenPairKey,
|
|
22
|
+
TagID,
|
|
23
|
+
TagLink,
|
|
24
|
+
} from "../types";
|
|
25
|
+
import { pairs } from "./state";
|
|
26
|
+
|
|
27
|
+
const toLinkKey = (tag: TagID): LinkKey => {
|
|
28
|
+
"worklet";
|
|
29
|
+
return getLinkKeyFromTag(tag);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const createLinkSide = (
|
|
33
|
+
screenKey: ScreenKey,
|
|
34
|
+
bounds: MeasuredDimensions,
|
|
35
|
+
styles: StyleProps,
|
|
36
|
+
) => {
|
|
37
|
+
"worklet";
|
|
38
|
+
return {
|
|
39
|
+
screenKey,
|
|
40
|
+
bounds,
|
|
41
|
+
styles,
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const writePairLink = (
|
|
46
|
+
state: LinkPairsState,
|
|
47
|
+
pairKey: ScreenPairKey,
|
|
48
|
+
linkKey: LinkKey,
|
|
49
|
+
link: TagLink,
|
|
50
|
+
) => {
|
|
51
|
+
"worklet";
|
|
52
|
+
ensurePairLinks(state, pairKey)[linkKey] = link;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const writeGroup = (
|
|
56
|
+
state: LinkPairsState,
|
|
57
|
+
pairKey: ScreenPairKey,
|
|
58
|
+
group: GroupKey,
|
|
59
|
+
activeId: LinkKey,
|
|
60
|
+
initialId?: LinkKey,
|
|
61
|
+
) => {
|
|
62
|
+
"worklet";
|
|
63
|
+
const previousInitialId = state[pairKey]?.groups?.[group]?.initialId;
|
|
64
|
+
|
|
65
|
+
ensurePairGroups(state, pairKey)[group] = {
|
|
66
|
+
activeId,
|
|
67
|
+
initialId: previousInitialId ?? initialId ?? activeId,
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
const writeDestination = (
|
|
72
|
+
state: LinkPairsState,
|
|
73
|
+
pairKey: ScreenPairKey,
|
|
74
|
+
linkKey: LinkKey,
|
|
75
|
+
screenKey: ScreenKey,
|
|
76
|
+
bounds: MeasuredDimensions,
|
|
77
|
+
styles: StyleProps,
|
|
78
|
+
group?: GroupKey,
|
|
79
|
+
) => {
|
|
80
|
+
"worklet";
|
|
81
|
+
const link = getPairLink(state, pairKey, linkKey);
|
|
82
|
+
if (!link) return;
|
|
83
|
+
|
|
84
|
+
const destination = createLinkSide(screenKey, bounds, styles);
|
|
85
|
+
|
|
86
|
+
link.group = group ?? link.group;
|
|
87
|
+
link.destination = destination;
|
|
88
|
+
link.initialDestination ??= destination;
|
|
89
|
+
|
|
90
|
+
writePairLink(state, pairKey, linkKey, link);
|
|
91
|
+
|
|
92
|
+
if (link.group) {
|
|
93
|
+
writeGroup(state, pairKey, link.group, linkKey);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const promotePendingSource = (
|
|
98
|
+
state: LinkPairsState,
|
|
99
|
+
pairKey: ScreenPairKey,
|
|
100
|
+
linkKey: LinkKey,
|
|
101
|
+
) => {
|
|
102
|
+
"worklet";
|
|
103
|
+
if (getPairLink(state, pairKey, linkKey)) return;
|
|
104
|
+
|
|
105
|
+
const sourceScreenKey = getSourceScreenKeyFromPairKey(pairKey);
|
|
106
|
+
const pendingPairKey = createPendingPairKey(sourceScreenKey);
|
|
107
|
+
if (pendingPairKey === pairKey) return;
|
|
108
|
+
|
|
109
|
+
const pendingLink = getPairLink(state, pendingPairKey, linkKey);
|
|
110
|
+
if (!pendingLink) return;
|
|
111
|
+
|
|
112
|
+
writePairLink(state, pairKey, linkKey, pendingLink);
|
|
113
|
+
|
|
114
|
+
if (pendingLink.group) {
|
|
115
|
+
const pendingGroupState =
|
|
116
|
+
state[pendingPairKey]?.groups?.[pendingLink.group];
|
|
117
|
+
|
|
118
|
+
if (pendingGroupState) {
|
|
119
|
+
writeGroup(
|
|
120
|
+
state,
|
|
121
|
+
pairKey,
|
|
122
|
+
pendingLink.group,
|
|
123
|
+
pendingGroupState.activeId,
|
|
124
|
+
pendingGroupState.initialId,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
removePairLink(state, pendingPairKey, linkKey);
|
|
130
|
+
};
|
|
16
131
|
|
|
17
132
|
function setSource(
|
|
18
|
-
|
|
133
|
+
pairKey: ScreenPairKey,
|
|
19
134
|
tag: TagID,
|
|
20
135
|
screenKey: ScreenKey,
|
|
21
136
|
bounds: MeasuredDimensions,
|
|
22
137
|
styles: StyleProps = {},
|
|
138
|
+
group?: GroupKey,
|
|
23
139
|
) {
|
|
24
140
|
"worklet";
|
|
25
|
-
|
|
141
|
+
pairs.modify(<T extends LinkPairsState>(state: T): T => {
|
|
26
142
|
"worklet";
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
bounds,
|
|
30
|
-
styles,
|
|
31
|
-
};
|
|
143
|
+
const linkKey = toLinkKey(tag);
|
|
144
|
+
const source = createLinkSide(screenKey, bounds, styles);
|
|
32
145
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
topLink &&
|
|
41
|
-
topLink.destination === null &&
|
|
42
|
-
isSameScreenFamily(topLink.source, source)
|
|
43
|
-
) {
|
|
44
|
-
topLink.source = source;
|
|
45
|
-
if (!topLink.initialSource) {
|
|
46
|
-
topLink.initialSource = source;
|
|
47
|
-
}
|
|
48
|
-
return state;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
stack.push({
|
|
146
|
+
const pairLinks = ensurePairLinks(state, pairKey);
|
|
147
|
+
|
|
148
|
+
const existingLink = pairLinks[linkKey];
|
|
149
|
+
const link =
|
|
150
|
+
existingLink ??
|
|
151
|
+
({
|
|
152
|
+
group,
|
|
52
153
|
source,
|
|
53
154
|
destination: null,
|
|
54
155
|
initialSource: source,
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
return state;
|
|
58
|
-
}
|
|
156
|
+
} satisfies TagLink);
|
|
59
157
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
if (targetIndex === -1) return state;
|
|
158
|
+
link.group = group ?? link.group;
|
|
159
|
+
link.source = source;
|
|
160
|
+
link.initialSource ??= source;
|
|
64
161
|
|
|
65
|
-
|
|
162
|
+
pairLinks[linkKey] = link;
|
|
66
163
|
|
|
67
|
-
|
|
68
|
-
if (
|
|
69
|
-
|
|
164
|
+
const pendingPairKey = createPendingPairKey(screenKey);
|
|
165
|
+
if (pendingPairKey !== pairKey) {
|
|
166
|
+
removePairLink(state, pendingPairKey, linkKey);
|
|
70
167
|
}
|
|
71
168
|
|
|
72
169
|
return state;
|
|
@@ -74,98 +171,110 @@ function setSource(
|
|
|
74
171
|
}
|
|
75
172
|
|
|
76
173
|
function setDestination(
|
|
77
|
-
|
|
174
|
+
pairKey: ScreenPairKey,
|
|
78
175
|
tag: TagID,
|
|
79
176
|
screenKey: ScreenKey,
|
|
80
177
|
bounds: MeasuredDimensions,
|
|
81
178
|
styles: StyleProps = {},
|
|
82
|
-
|
|
179
|
+
group?: GroupKey,
|
|
83
180
|
) {
|
|
84
181
|
"worklet";
|
|
85
|
-
|
|
182
|
+
pairs.modify(<T extends LinkPairsState>(state: T): T => {
|
|
86
183
|
"worklet";
|
|
87
|
-
const
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
const targetIndex = findLinkIndexForDestinationWrite(
|
|
91
|
-
stack,
|
|
92
|
-
mode === "refresh" ? screenKey : undefined,
|
|
93
|
-
expectedSourceScreenKey,
|
|
94
|
-
);
|
|
95
|
-
|
|
96
|
-
if (targetIndex === -1) return state;
|
|
97
|
-
|
|
98
|
-
const link = stack[targetIndex];
|
|
99
|
-
const destination = {
|
|
100
|
-
screenKey,
|
|
101
|
-
bounds,
|
|
102
|
-
styles,
|
|
103
|
-
};
|
|
184
|
+
const linkKey = toLinkKey(tag);
|
|
185
|
+
promotePendingSource(state, pairKey, linkKey);
|
|
186
|
+
writeDestination(state, pairKey, linkKey, screenKey, bounds, styles, group);
|
|
104
187
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
188
|
+
return state;
|
|
189
|
+
});
|
|
190
|
+
}
|
|
109
191
|
|
|
192
|
+
function setActiveGroupId(pairKey: ScreenPairKey, group: GroupKey, tag: TagID) {
|
|
193
|
+
"worklet";
|
|
194
|
+
pairs.modify(<T extends LinkPairsState>(state: T): T => {
|
|
195
|
+
"worklet";
|
|
196
|
+
writeGroup(state, pairKey, group, toLinkKey(tag));
|
|
110
197
|
return state;
|
|
111
198
|
});
|
|
112
199
|
}
|
|
113
200
|
|
|
114
|
-
function
|
|
201
|
+
function getActiveGroupId(
|
|
202
|
+
pairKey: ScreenPairKey,
|
|
203
|
+
group: GroupKey,
|
|
204
|
+
): LinkKey | null {
|
|
115
205
|
"worklet";
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
206
|
+
return getPairActiveGroupId(pairs.get(), pairKey, group);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function getLink(pairKey: ScreenPairKey, tag: TagID): TagLink | null {
|
|
210
|
+
"worklet";
|
|
211
|
+
return getPairLink(pairs.get(), pairKey, toLinkKey(tag));
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const isCompletedLink = (link: TagLink | null): link is TagLink => {
|
|
215
|
+
"worklet";
|
|
216
|
+
return !!link?.destination;
|
|
217
|
+
};
|
|
121
218
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
219
|
+
function getResolvedLink(
|
|
220
|
+
pairKey: ScreenPairKey,
|
|
221
|
+
tag: TagID,
|
|
222
|
+
): { tag: TagID; link: TagLink | null } {
|
|
223
|
+
"worklet";
|
|
224
|
+
const state = pairs.get();
|
|
225
|
+
const linkKey = toLinkKey(tag);
|
|
226
|
+
const group = getGroupKeyFromTag(tag);
|
|
227
|
+
const requestedLink = getPairLink(state, pairKey, linkKey);
|
|
228
|
+
|
|
229
|
+
// Group active ids can update before the new member has a full source/destination
|
|
230
|
+
// link, so unresolved grouped links fall back to the initial id's measurements.
|
|
231
|
+
if (!group || isCompletedLink(requestedLink)) {
|
|
232
|
+
return {
|
|
233
|
+
tag,
|
|
234
|
+
link: requestedLink,
|
|
235
|
+
};
|
|
125
236
|
}
|
|
126
237
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
238
|
+
const initialId = state[pairKey]?.groups?.[group]?.initialId;
|
|
239
|
+
if (initialId) {
|
|
240
|
+
const initialLink = getPairLink(state, pairKey, initialId);
|
|
241
|
+
if (isCompletedLink(initialLink)) {
|
|
242
|
+
return {
|
|
243
|
+
tag: createGroupTag(group, initialId),
|
|
244
|
+
link: initialLink,
|
|
245
|
+
};
|
|
131
246
|
}
|
|
132
247
|
}
|
|
133
248
|
|
|
134
|
-
return
|
|
249
|
+
return {
|
|
250
|
+
tag,
|
|
251
|
+
link: requestedLink,
|
|
252
|
+
};
|
|
135
253
|
}
|
|
136
254
|
|
|
137
|
-
function
|
|
255
|
+
function getSource(
|
|
256
|
+
pairKey: ScreenPairKey,
|
|
138
257
|
tag: TagID,
|
|
139
|
-
|
|
140
|
-
): TagLink | null {
|
|
258
|
+
): TagLink["source"] | null {
|
|
141
259
|
"worklet";
|
|
142
|
-
|
|
143
|
-
const stack = tagState?.linkStack;
|
|
144
|
-
if (!stack || stack.length === 0) return null;
|
|
145
|
-
|
|
146
|
-
const pendingSourceLinkIndex = findLatestPendingSourceLinkIndex(
|
|
147
|
-
stack,
|
|
148
|
-
sourceScreenKey,
|
|
149
|
-
);
|
|
150
|
-
if (pendingSourceLinkIndex === -1) return null;
|
|
151
|
-
return stack[pendingSourceLinkIndex] ?? null;
|
|
260
|
+
return getPairSource(pairs.get(), pairKey, toLinkKey(tag));
|
|
152
261
|
}
|
|
153
262
|
|
|
154
|
-
function
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
function hasDestinationLink(tag: TagID, screenKey: ScreenKey): boolean {
|
|
263
|
+
function getDestination(
|
|
264
|
+
pairKey: ScreenPairKey,
|
|
265
|
+
tag: TagID,
|
|
266
|
+
): TagLink["destination"] | null {
|
|
160
267
|
"worklet";
|
|
161
|
-
return
|
|
268
|
+
return getPairDestination(pairs.get(), pairKey, toLinkKey(tag));
|
|
162
269
|
}
|
|
163
270
|
|
|
164
271
|
export {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
272
|
+
getActiveGroupId,
|
|
273
|
+
getDestination,
|
|
274
|
+
getLink,
|
|
275
|
+
getResolvedLink,
|
|
276
|
+
getSource,
|
|
277
|
+
setActiveGroupId,
|
|
169
278
|
setDestination,
|
|
170
279
|
setSource,
|
|
171
280
|
};
|
|
@@ -1,77 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { matchesScreenKey } from "../helpers/matching";
|
|
1
|
+
import { createScreenPairKey } from "../helpers/link-pairs.helpers";
|
|
3
2
|
import type {
|
|
4
3
|
ResolvedTransitionPair,
|
|
5
4
|
ResolveTransitionContext,
|
|
6
|
-
|
|
5
|
+
ScreenPairKey,
|
|
7
6
|
TagID,
|
|
8
|
-
TagLink,
|
|
9
7
|
} from "../types";
|
|
10
|
-
import {
|
|
8
|
+
import { getResolvedLink } from "./links";
|
|
11
9
|
|
|
12
|
-
function
|
|
13
|
-
stack: TagLink[],
|
|
14
|
-
screenKey?: ScreenKey,
|
|
15
|
-
): TagLink | null {
|
|
16
|
-
"worklet";
|
|
17
|
-
if (!screenKey) return null;
|
|
18
|
-
|
|
19
|
-
return findLatest(
|
|
20
|
-
stack,
|
|
21
|
-
(link) =>
|
|
22
|
-
!!link.destination && matchesScreenKey(link.destination, screenKey),
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function findCompletedLinkBySource(
|
|
27
|
-
stack: TagLink[],
|
|
28
|
-
screenKey?: ScreenKey,
|
|
29
|
-
): TagLink | null {
|
|
30
|
-
"worklet";
|
|
31
|
-
if (!screenKey) return null;
|
|
32
|
-
|
|
33
|
-
return findLatest(
|
|
34
|
-
stack,
|
|
35
|
-
(link) => !!link.destination && matchesScreenKey(link.source, screenKey),
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function findPendingLinkBySource(
|
|
40
|
-
stack: TagLink[],
|
|
41
|
-
screenKey?: ScreenKey,
|
|
42
|
-
): TagLink | null {
|
|
43
|
-
"worklet";
|
|
44
|
-
if (!screenKey) return null;
|
|
45
|
-
|
|
46
|
-
return findLatest(
|
|
47
|
-
stack,
|
|
48
|
-
(link) =>
|
|
49
|
-
link.destination === null && matchesScreenKey(link.source, screenKey),
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function findEnteringTransitionLink(
|
|
54
|
-
stack: TagLink[],
|
|
10
|
+
function resolvePairKey(
|
|
55
11
|
context: ResolveTransitionContext,
|
|
56
|
-
):
|
|
12
|
+
): ScreenPairKey | null {
|
|
57
13
|
"worklet";
|
|
58
|
-
return (
|
|
59
|
-
findCompletedLinkByDestination(stack, context.currentScreenKey) ??
|
|
60
|
-
findPendingLinkBySource(stack, context.previousScreenKey) ??
|
|
61
|
-
findCompletedLinkBySource(stack, context.previousScreenKey)
|
|
62
|
-
);
|
|
63
|
-
}
|
|
64
14
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
);
|
|
15
|
+
if (context.entering) {
|
|
16
|
+
if (!context.previousScreenKey || !context.currentScreenKey) return null;
|
|
17
|
+
return createScreenPairKey(
|
|
18
|
+
context.previousScreenKey,
|
|
19
|
+
context.currentScreenKey,
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
if (!context.currentScreenKey || !context.nextScreenKey) return null;
|
|
24
|
+
return createScreenPairKey(context.currentScreenKey, context.nextScreenKey);
|
|
75
25
|
}
|
|
76
26
|
|
|
77
27
|
function resolveTransitionPair(
|
|
@@ -79,30 +29,16 @@ function resolveTransitionPair(
|
|
|
79
29
|
context: ResolveTransitionContext,
|
|
80
30
|
): ResolvedTransitionPair {
|
|
81
31
|
"worklet";
|
|
82
|
-
const
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
const matchedLink =
|
|
86
|
-
stack && stack.length > 0
|
|
87
|
-
? context.entering
|
|
88
|
-
? findEnteringTransitionLink(stack, context)
|
|
89
|
-
: findExitingTransitionLink(stack, context)
|
|
90
|
-
: null;
|
|
91
|
-
|
|
92
|
-
const sourceBounds = matchedLink?.source?.bounds ?? null;
|
|
93
|
-
const destinationBounds = matchedLink?.destination?.bounds ?? null;
|
|
94
|
-
const sourceStyles = matchedLink?.source?.styles ?? null;
|
|
95
|
-
const destinationStyles = matchedLink?.destination?.styles ?? null;
|
|
96
|
-
const sourceScreenKey = matchedLink?.source?.screenKey ?? null;
|
|
97
|
-
const destinationScreenKey = matchedLink?.destination?.screenKey ?? null;
|
|
32
|
+
const pairKey = resolvePairKey(context);
|
|
33
|
+
const matchedLink = pairKey ? getResolvedLink(pairKey, tag).link : null;
|
|
98
34
|
|
|
99
35
|
return {
|
|
100
|
-
sourceBounds,
|
|
101
|
-
destinationBounds,
|
|
102
|
-
sourceStyles,
|
|
103
|
-
destinationStyles,
|
|
104
|
-
sourceScreenKey,
|
|
105
|
-
destinationScreenKey,
|
|
36
|
+
sourceBounds: matchedLink?.source.bounds ?? null,
|
|
37
|
+
destinationBounds: matchedLink?.destination?.bounds ?? null,
|
|
38
|
+
sourceStyles: matchedLink?.source.styles ?? null,
|
|
39
|
+
destinationStyles: matchedLink?.destination?.styles ?? null,
|
|
40
|
+
sourceScreenKey: matchedLink?.source.screenKey ?? null,
|
|
41
|
+
destinationScreenKey: matchedLink?.destination?.screenKey ?? null,
|
|
106
42
|
};
|
|
107
43
|
}
|
|
108
44
|
|
|
@@ -1,8 +1,30 @@
|
|
|
1
1
|
import { makeMutable } from "react-native-reanimated";
|
|
2
|
-
import type {
|
|
2
|
+
import type { LinkPairsState, TagID, TagState } from "../types";
|
|
3
3
|
|
|
4
|
-
export type
|
|
5
|
-
export type GroupsState = Record<string, GroupState>;
|
|
4
|
+
export type BoundaryEntriesState = Record<TagID, TagState>;
|
|
6
5
|
|
|
7
|
-
export const
|
|
8
|
-
|
|
6
|
+
export const boundaryRegistry = makeMutable<BoundaryEntriesState>({});
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Transition links scoped per screen pair.
|
|
10
|
+
*
|
|
11
|
+
* Links used to live in a flat array that acted like a global history. To find
|
|
12
|
+
* the right link, we had to scan for the latest pending or completed entry that
|
|
13
|
+
* matched a screen, which made refreshes and rapid triggers tricky to handle.
|
|
14
|
+
*
|
|
15
|
+
* Keying by screen pair fixes that: each transition lives under its pair, and
|
|
16
|
+
* every shared boundary id maps to a single link in that pair. Refreshing the
|
|
17
|
+
* source or destination just overwrites the same slot instead of pushing a new
|
|
18
|
+
* history entry.
|
|
19
|
+
*
|
|
20
|
+
* Example:
|
|
21
|
+
*
|
|
22
|
+
* {
|
|
23
|
+
* "a<>b": {
|
|
24
|
+
* links: {
|
|
25
|
+
* "unique-tag-1": { source: ..., destination: ... },
|
|
26
|
+
* },
|
|
27
|
+
* },
|
|
28
|
+
* }
|
|
29
|
+
*/
|
|
30
|
+
export const pairs = makeMutable<LinkPairsState>({});
|