react-native-screen-transitions 3.9.0-beta.1 → 3.9.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/shared/adapters/with-screen-transitions/index.js +20 -4
- package/lib/commonjs/shared/adapters/with-screen-transitions/index.js.map +1 -1
- package/lib/commonjs/shared/animation/transition-blocking.js +71 -0
- package/lib/commonjs/shared/animation/transition-blocking.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js +33 -28
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js +30 -95
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +75 -51
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +14 -2
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-register-target.js +32 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-register-target.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/index.js +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +41 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js +14 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +224 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js +45 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/{host.js → boundary-portal/components/host.js} +20 -18
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/{portal-boundary-host.js → boundary-portal/components/portal-boundary-host.js} +13 -12
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +51 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js +14 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.js +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +185 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.js +23 -5
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-placeholder-styles.js +3 -6
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js +31 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.js +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.js +7 -12
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/index.js +1 -8
- package/lib/commonjs/shared/components/boundary/portal/index.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/teleport.js +4 -3
- package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/naming.js +1 -15
- package/lib/commonjs/shared/components/boundary/portal/utils/naming.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js +19 -56
- package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +90 -23
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +41 -12
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/measured-bounds.js +36 -1
- package/lib/commonjs/shared/components/boundary/utils/measured-bounds.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +1 -1
- package/lib/commonjs/shared/configs/presets.js +2 -2
- package/lib/commonjs/shared/configs/presets.js.map +1 -1
- package/lib/commonjs/shared/constants.js +4 -0
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/index.js +13 -0
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +25 -3
- package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
- package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js +2 -0
- package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/values.js +2 -0
- package/lib/commonjs/shared/providers/screen/gestures/shared/values.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +13 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +5 -3
- package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js +1 -1
- package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -1
- package/lib/commonjs/shared/stores/gesture.store.js +8 -0
- package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
- package/lib/commonjs/shared/stores/system.store.js +10 -2
- package/lib/commonjs/shared/stores/system.store.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +24 -7
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +15 -9
- package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +2 -2
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +2 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +178 -315
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js +12 -18
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js +196 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +94 -108
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js +72 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js +55 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
- package/lib/module/shared/adapters/with-screen-transitions/index.js +19 -5
- package/lib/module/shared/adapters/with-screen-transitions/index.js.map +1 -1
- package/lib/module/shared/animation/transition-blocking.js +66 -0
- package/lib/module/shared/animation/transition-blocking.js.map +1 -0
- package/lib/module/shared/components/boundary/components/boundary-target.js +35 -30
- package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/module/shared/components/boundary/create-boundary-component.js +32 -97
- package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +79 -55
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +1 -0
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-measurer.js +15 -3
- package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-register-target.js +27 -0
- package/lib/module/shared/components/boundary/hooks/use-register-target.js.map +1 -0
- package/lib/module/shared/components/boundary/index.js +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +36 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js +9 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +219 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js +34 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/{host.js → boundary-portal/components/host.js} +20 -18
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/{portal-boundary-host.js → boundary-portal/components/portal-boundary-host.js} +13 -12
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +46 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js +9 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.js +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +180 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.js +23 -5
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-placeholder-styles.js +3 -6
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js +27 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.js +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.js +5 -10
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/index.js +1 -2
- package/lib/module/shared/components/boundary/portal/index.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/teleport.js +3 -2
- package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/utils/naming.js +0 -12
- package/lib/module/shared/components/boundary/portal/utils/naming.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/utils/ownership.js +16 -52
- package/lib/module/shared/components/boundary/portal/utils/ownership.js.map +1 -1
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +87 -20
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/destination-signals.js +39 -10
- package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/measured-bounds.js +34 -0
- package/lib/module/shared/components/boundary/utils/measured-bounds.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/shared/configs/presets.js +2 -2
- package/lib/module/shared/configs/presets.js.map +1 -1
- package/lib/module/shared/constants.js +4 -0
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/index.js +1 -0
- package/lib/module/shared/index.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
- package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
- package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +23 -2
- package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
- package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/snapshot.js +2 -0
- package/lib/module/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/values.js +2 -0
- package/lib/module/shared/providers/screen/gestures/shared/values.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +13 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/slot.provider.js +5 -3
- package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js +1 -1
- package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -1
- package/lib/module/shared/stores/gesture.store.js +8 -0
- package/lib/module/shared/stores/gesture.store.js.map +1 -1
- package/lib/module/shared/stores/system.store.js +10 -2
- package/lib/module/shared/stores/system.store.js.map +1 -1
- package/lib/module/shared/types/bounds.types.js +26 -0
- package/lib/module/shared/types/bounds.types.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +24 -7
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +15 -9
- package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js +2 -2
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js +2 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js +182 -319
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/config.js +11 -17
- package/lib/module/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/drag.js +184 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +91 -102
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/mask.js +67 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/targets.js +50 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
- package/lib/typescript/shared/adapters/with-screen-transitions/index.d.ts +4 -1
- package/lib/typescript/shared/adapters/with-screen-transitions/index.d.ts.map +1 -1
- package/lib/typescript/shared/animation/transition-blocking.d.ts +33 -0
- package/lib/typescript/shared/animation/transition-blocking.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +3 -1
- package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts +2 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-register-target.d.ts +10 -0
- package/lib/typescript/shared/components/boundary/hooks/use-register-target.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/index.d.ts +2 -2
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts +10 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.d.ts +2 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts +12 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts +9 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts +13 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts +3 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.d.ts +2 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.d.ts +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts +12 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.d.ts +5 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts +12 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts +12 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.d.ts +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.d.ts +3 -3
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/index.d.ts +1 -2
- package/lib/typescript/shared/components/boundary/portal/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -0
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts +0 -2
- package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts +9 -10
- package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +22 -21
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +9 -2
- package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts +8 -0
- package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +2 -1
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts +2 -0
- package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts +2 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts +2 -0
- package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/snapshot.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/values.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +5 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +1 -0
- package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/gesture.store.d.ts +4 -0
- package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +3 -3
- package/lib/typescript/shared/types/bounds.types.d.ts +122 -90
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/gesture.types.d.ts +10 -0
- 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/animation/animate-to-progress.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/navigation/reveal/math.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts +7 -17
- package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts +55 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +31 -34
- package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts +25 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts +16 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/options.d.ts +6 -2
- package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/adapters/with-screen-transitions/index.tsx +30 -9
- package/src/shared/animation/transition-blocking.ts +79 -0
- package/src/shared/components/boundary/components/boundary-target.tsx +47 -43
- package/src/shared/components/boundary/create-boundary-component.tsx +35 -150
- package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +106 -81
- package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +1 -0
- package/src/shared/components/boundary/hooks/use-measurer.ts +12 -4
- package/src/shared/components/boundary/hooks/use-register-target.ts +43 -0
- package/src/shared/components/boundary/index.tsx +2 -2
- package/src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx +52 -0
- package/src/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.ts +9 -0
- package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +317 -0
- package/src/shared/components/boundary/portal/components/boundary-content-portal/index.tsx +62 -0
- package/src/shared/components/boundary/portal/components/{host.tsx → boundary-portal/components/host.tsx} +17 -17
- package/src/shared/components/boundary/portal/components/{portal-boundary-host.tsx → boundary-portal/components/portal-boundary-host.tsx} +14 -13
- package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx +79 -0
- package/src/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.ts +1 -1
- package/src/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.ts +10 -0
- package/src/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.ts +2 -2
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +254 -0
- package/src/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.ts +38 -8
- package/src/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-placeholder-styles.ts +4 -15
- package/src/shared/components/boundary/portal/components/boundary-portal/index.tsx +35 -0
- package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.ts +2 -2
- package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.ts +10 -15
- package/src/shared/components/boundary/portal/index.ts +1 -2
- package/src/shared/components/boundary/portal/teleport.ts +3 -2
- package/src/shared/components/boundary/portal/utils/naming.ts +0 -19
- package/src/shared/components/boundary/portal/utils/ownership.ts +32 -88
- package/src/shared/components/boundary/providers/boundary-root.provider.tsx +218 -78
- package/src/shared/components/boundary/utils/destination-signals.ts +38 -14
- package/src/shared/components/boundary/utils/measured-bounds.ts +48 -0
- package/src/shared/components/screen-container/layers/content.tsx +1 -1
- package/src/shared/configs/presets.ts +2 -2
- package/src/shared/constants.ts +4 -0
- package/src/shared/index.ts +6 -0
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +8 -0
- package/src/shared/providers/screen/gestures/pan/activation/use-pan-activation.ts +16 -7
- package/src/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +18 -1
- package/src/shared/providers/screen/gestures/pan/use-build-pan-gesture.ts +1 -0
- package/src/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.ts +40 -2
- package/src/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.ts +7 -11
- package/src/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.ts +12 -15
- package/src/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.ts +6 -1
- package/src/shared/providers/screen/gestures/shared/snapshot.ts +2 -0
- package/src/shared/providers/screen/gestures/shared/values.ts +2 -0
- package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +15 -1
- package/src/shared/providers/screen/styles/slot.provider.tsx +4 -2
- package/src/shared/providers/screen/styles/stores/slot-references.store.ts +2 -1
- package/src/shared/stores/gesture.store.ts +12 -0
- package/src/shared/stores/system.store.ts +10 -4
- package/src/shared/types/animation.types.ts +3 -3
- package/src/shared/types/bounds.types.ts +128 -92
- package/src/shared/types/gesture.types.ts +10 -0
- package/src/shared/types/index.ts +2 -0
- package/src/shared/utils/animation/animate-to-progress.ts +23 -7
- package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +18 -11
- package/src/shared/utils/bounds/navigation/reveal/build.ts +2 -2
- package/src/shared/utils/bounds/navigation/reveal/math.ts +2 -1
- package/src/shared/utils/bounds/navigation/zoom/build.ts +224 -412
- package/src/shared/utils/bounds/navigation/zoom/config.ts +15 -18
- package/src/shared/utils/bounds/navigation/zoom/drag.ts +327 -0
- package/src/shared/utils/bounds/navigation/zoom/helpers.ts +122 -184
- package/src/shared/utils/bounds/navigation/zoom/mask.ts +130 -0
- package/src/shared/utils/bounds/navigation/zoom/targets.ts +74 -0
- package/src/shared/utils/bounds/navigation/zoom/types.ts +1 -1
- package/src/shared/utils/bounds/types/options.ts +9 -2
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js +0 -58
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/components/host.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/components/portal.js +0 -272
- package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/stores/host-bounds.store.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js +0 -25
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js +0 -53
- package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/components/host.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/components/portal.js +0 -267
- package/lib/module/shared/components/boundary/portal/components/portal.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/stores/host-bounds.store.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/utils/offset-style.js.map +0 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/math.js +0 -20
- package/lib/module/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts +0 -8
- package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +0 -20
- package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/hooks/use-placeholder-styles.d.ts +0 -17
- package/lib/typescript/shared/components/boundary/portal/hooks/use-placeholder-styles.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/stores/host-bounds.store.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts +0 -3
- package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts +0 -8
- package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts.map +0 -1
- package/src/shared/components/boundary/portal/components/boundary-local-portal-host.tsx +0 -66
- package/src/shared/components/boundary/portal/components/portal.tsx +0 -412
- package/src/shared/utils/bounds/navigation/zoom/math.ts +0 -25
- /package/lib/commonjs/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.js +0 -0
- /package/lib/commonjs/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.js +0 -0
- /package/lib/module/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.js +0 -0
- /package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.js +0 -0
- /package/lib/typescript/shared/components/boundary/portal/components/{host.d.ts → boundary-portal/components/host.d.ts} +0 -0
- /package/lib/typescript/shared/components/boundary/portal/components/{portal-boundary-host.d.ts → boundary-portal/components/portal-boundary-host.d.ts} +0 -0
- /package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.d.ts +0 -0
- /package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.ts +0 -0
|
@@ -26,6 +26,29 @@ export type PortalOwnershipSignal =
|
|
|
26
26
|
status: "complete";
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
export const isHandoffHostClosingComplete = ({
|
|
30
|
+
closing,
|
|
31
|
+
progressAnimating,
|
|
32
|
+
progressSettled,
|
|
33
|
+
willAnimate,
|
|
34
|
+
}: {
|
|
35
|
+
closing: number;
|
|
36
|
+
progressAnimating: number;
|
|
37
|
+
progressSettled: number;
|
|
38
|
+
willAnimate: number;
|
|
39
|
+
}) => {
|
|
40
|
+
"worklet";
|
|
41
|
+
|
|
42
|
+
// A close request marks `closing` before its animation starts. Springs can
|
|
43
|
+
// also enter their settle-distance threshold before their final frame.
|
|
44
|
+
return (
|
|
45
|
+
!!closing &&
|
|
46
|
+
willAnimate === 0 &&
|
|
47
|
+
progressSettled === 1 &&
|
|
48
|
+
progressAnimating === 0
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
29
52
|
const hasSeenScreenKey = (screenKeys: ScreenKey[], screenKey: ScreenKey) => {
|
|
30
53
|
"worklet";
|
|
31
54
|
for (let index = 0; index < screenKeys.length; index++) {
|
|
@@ -36,13 +59,6 @@ const hasSeenScreenKey = (screenKeys: ScreenKey[], screenKey: ScreenKey) => {
|
|
|
36
59
|
return false;
|
|
37
60
|
};
|
|
38
61
|
|
|
39
|
-
export const usesEscapeClippingHost = (
|
|
40
|
-
link: TagLink | null | undefined,
|
|
41
|
-
): boolean => {
|
|
42
|
-
"worklet";
|
|
43
|
-
return link?.source?.handoff === true && link.source.escapeClipping === true;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
62
|
const isReturningToPreviousSourceHost = ({
|
|
47
63
|
hostScreenKey,
|
|
48
64
|
ownerPairKey,
|
|
@@ -69,7 +85,7 @@ const isReturningToPreviousSourceHost = ({
|
|
|
69
85
|
);
|
|
70
86
|
};
|
|
71
87
|
|
|
72
|
-
export const
|
|
88
|
+
export const canSwitchHandoffHostImmediately = ({
|
|
73
89
|
hostScreenKey,
|
|
74
90
|
ownerPairKey,
|
|
75
91
|
previousOwnerPairKey,
|
|
@@ -118,7 +134,7 @@ const isActiveHandoffLink = ({
|
|
|
118
134
|
return !activeId || activeId === linkKey;
|
|
119
135
|
};
|
|
120
136
|
|
|
121
|
-
const
|
|
137
|
+
const resolveHandoffStyleOwnerScreenKey = ({
|
|
122
138
|
hostScreenKey,
|
|
123
139
|
isSettledHostReady,
|
|
124
140
|
settledHostScreenKey,
|
|
@@ -160,7 +176,6 @@ const clearSignal = (sourcePairKey: ScreenPairKey): PortalOwnershipSignal => {
|
|
|
160
176
|
export const resolveBoundaryPortalOwnership = ({
|
|
161
177
|
boundaryId,
|
|
162
178
|
currentScreenKey,
|
|
163
|
-
escapeClipping,
|
|
164
179
|
handoff,
|
|
165
180
|
isSettledHostClosingComplete = false,
|
|
166
181
|
isSettledHostReady = false,
|
|
@@ -170,7 +185,6 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
170
185
|
}: {
|
|
171
186
|
boundaryId: string;
|
|
172
187
|
currentScreenKey: ScreenKey;
|
|
173
|
-
escapeClipping: boolean;
|
|
174
188
|
handoff: boolean;
|
|
175
189
|
isSettledHostClosingComplete?: boolean;
|
|
176
190
|
isSettledHostReady?: boolean;
|
|
@@ -208,7 +222,6 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
208
222
|
|
|
209
223
|
let hostScreenKey = link.destination.screenKey;
|
|
210
224
|
let ownerPairKey = sourcePairKey;
|
|
211
|
-
let previousOwnerPairKey: ScreenPairKey | null = null;
|
|
212
225
|
const seenScreenKeys: ScreenKey[] = [
|
|
213
226
|
getSourceScreenKeyFromPairKey(sourcePairKey),
|
|
214
227
|
hostScreenKey,
|
|
@@ -254,7 +267,6 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
254
267
|
|
|
255
268
|
const nextHostScreenKey = candidate.destination.screenKey;
|
|
256
269
|
|
|
257
|
-
previousOwnerPairKey = ownerPairKey;
|
|
258
270
|
ownerPairKey = candidatePairKey;
|
|
259
271
|
hostScreenKey = nextHostScreenKey;
|
|
260
272
|
|
|
@@ -283,27 +295,16 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
283
295
|
break;
|
|
284
296
|
}
|
|
285
297
|
|
|
286
|
-
|
|
287
|
-
const ownerUsesEscapeClipping =
|
|
288
|
-
ownerLink?.source?.escapeClipping ?? escapeClipping;
|
|
289
|
-
|
|
290
|
-
if (
|
|
291
|
-
!ownerUsesEscapeClipping &&
|
|
292
|
-
isSettledHostClosingComplete &&
|
|
293
|
-
settledHostScreenKey === hostScreenKey &&
|
|
294
|
-
previousOwnerPairKey
|
|
295
|
-
) {
|
|
298
|
+
if (isSettledHostClosingComplete && settledHostScreenKey === hostScreenKey) {
|
|
296
299
|
hostScreenKey = getSourceScreenKeyFromPairKey(ownerPairKey);
|
|
297
300
|
}
|
|
298
301
|
|
|
299
|
-
const ownerScreenKey =
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
sourceScreenKey: getSourceScreenKeyFromPairKey(ownerPairKey),
|
|
306
|
-
});
|
|
302
|
+
const ownerScreenKey = resolveHandoffStyleOwnerScreenKey({
|
|
303
|
+
hostScreenKey,
|
|
304
|
+
isSettledHostReady,
|
|
305
|
+
settledHostScreenKey,
|
|
306
|
+
sourceScreenKey: getSourceScreenKeyFromPairKey(ownerPairKey),
|
|
307
|
+
});
|
|
307
308
|
|
|
308
309
|
return {
|
|
309
310
|
hostScreenKey,
|
|
@@ -312,60 +313,3 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
312
313
|
status: "complete",
|
|
313
314
|
};
|
|
314
315
|
};
|
|
315
|
-
|
|
316
|
-
export const hasHandoffEscapeContinuation = ({
|
|
317
|
-
linkKey,
|
|
318
|
-
linkState,
|
|
319
|
-
sourceScreenKey,
|
|
320
|
-
}: {
|
|
321
|
-
linkKey: string;
|
|
322
|
-
linkState: LinkPairsState;
|
|
323
|
-
sourceScreenKey: ScreenKey;
|
|
324
|
-
}) => {
|
|
325
|
-
"worklet";
|
|
326
|
-
const pairKeys = Object.keys(linkState);
|
|
327
|
-
const visitedScreenKeys: ScreenKey[] = [];
|
|
328
|
-
let cursorScreenKey = sourceScreenKey;
|
|
329
|
-
|
|
330
|
-
for (let hop = 0; hop < pairKeys.length; hop++) {
|
|
331
|
-
if (hasSeenScreenKey(visitedScreenKeys, cursorScreenKey)) {
|
|
332
|
-
return false;
|
|
333
|
-
}
|
|
334
|
-
visitedScreenKeys.push(cursorScreenKey);
|
|
335
|
-
|
|
336
|
-
let previousScreenKey: ScreenKey | null = null;
|
|
337
|
-
for (let index = 0; index < pairKeys.length; index++) {
|
|
338
|
-
const candidatePairKey = pairKeys[index];
|
|
339
|
-
const link = candidatePairKey
|
|
340
|
-
? linkState[candidatePairKey]?.links?.[linkKey]
|
|
341
|
-
: null;
|
|
342
|
-
|
|
343
|
-
if (
|
|
344
|
-
!link?.source ||
|
|
345
|
-
!link.destination ||
|
|
346
|
-
link.destination.screenKey !== cursorScreenKey
|
|
347
|
-
) {
|
|
348
|
-
continue;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
if (usesEscapeClippingHost(link)) {
|
|
352
|
-
return true;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
if (!link.source.handoff) {
|
|
356
|
-
return false;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
previousScreenKey = link.source.screenKey;
|
|
360
|
-
break;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
if (!previousScreenKey) {
|
|
364
|
-
return false;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
cursorScreenKey = previousScreenKey;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
return false;
|
|
371
|
-
};
|
|
@@ -1,13 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type ForwardedRef,
|
|
3
|
+
type ReactNode,
|
|
4
|
+
useCallback,
|
|
5
|
+
useImperativeHandle,
|
|
6
|
+
useMemo,
|
|
7
|
+
useRef,
|
|
8
|
+
useState,
|
|
9
|
+
} from "react";
|
|
2
10
|
import type { View } from "react-native";
|
|
3
11
|
import type { AnimatedRef, StyleProps } from "react-native-reanimated";
|
|
4
12
|
import { useAnimatedRef } from "react-native-reanimated";
|
|
13
|
+
import { useDescriptorsStore } from "../../../providers/screen/descriptors";
|
|
14
|
+
import {
|
|
15
|
+
useComposedSlotStyles,
|
|
16
|
+
useSlotStackingStyles,
|
|
17
|
+
} from "../../../providers/screen/styles";
|
|
18
|
+
import { createBoundTag } from "../../../stores/bounds/helpers/link-pairs.helpers";
|
|
5
19
|
import type { BoundTag } from "../../../stores/bounds/types";
|
|
6
20
|
import createProvider from "../../../utils/create-provider";
|
|
7
21
|
import { logger } from "../../../utils/logger";
|
|
8
|
-
import
|
|
22
|
+
import { useBoundaryMeasurement } from "../hooks/use-boundary-measurement";
|
|
23
|
+
import {
|
|
24
|
+
type BoundaryPortalRuntime,
|
|
25
|
+
resolveBoundaryPortal,
|
|
26
|
+
} from "../portal/utils/resolve-portal";
|
|
27
|
+
import type {
|
|
28
|
+
BoundaryConfigProps,
|
|
29
|
+
BoundaryId,
|
|
30
|
+
BoundaryOwnProps,
|
|
31
|
+
} from "../types";
|
|
9
32
|
|
|
10
|
-
interface BoundaryRootContextValue {
|
|
33
|
+
interface BoundaryRootContextValue extends BoundaryRootRenderState {
|
|
11
34
|
registerTargetRef: (
|
|
12
35
|
targetRef: AnimatedRef<View>,
|
|
13
36
|
preparedStyles: StyleProps,
|
|
@@ -33,83 +56,200 @@ const MULTIPLE_TARGETS_WARNING =
|
|
|
33
56
|
export const TARGET_OUTSIDE_ROOT_WARNING =
|
|
34
57
|
"Boundary.Target must be rendered inside Transition.Boundary or a component created by createBoundaryComponent.";
|
|
35
58
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
children: ReactNode;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const { BoundaryRootProvider, useBoundaryRootContext } = createProvider(
|
|
42
|
-
"BoundaryRoot",
|
|
43
|
-
{ guarded: false },
|
|
44
|
-
)<BoundaryRootProps, BoundaryRootContextValue>((props) => props);
|
|
45
|
-
|
|
46
|
-
export const useBoundaryRootState = (params: {
|
|
59
|
+
export type BoundaryRootRenderState = {
|
|
60
|
+
attachedStyle: unknown;
|
|
47
61
|
boundTag: BoundTag;
|
|
62
|
+
currentScreenKey: string;
|
|
63
|
+
handoffEnabled: boolean;
|
|
48
64
|
portalRuntime: BoundaryPortalRuntime;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
65
|
+
ref: AnimatedRef<View>;
|
|
66
|
+
rootEscapePlaceholderRef: AnimatedRef<View>;
|
|
67
|
+
shouldRenderBoundaryRootThroughPortal: boolean;
|
|
68
|
+
shouldRenderHandoffHost: boolean;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
type BoundaryRootProviderProps = Pick<
|
|
72
|
+
BoundaryOwnProps,
|
|
73
|
+
"enabled" | "escapeClipping" | "group" | "handoff"
|
|
74
|
+
> & {
|
|
75
|
+
children: (state: BoundaryRootRenderState) => ReactNode;
|
|
76
|
+
config: BoundaryConfigProps;
|
|
77
|
+
forwardedRef?: ForwardedRef<any>;
|
|
78
|
+
id: BoundaryId;
|
|
79
|
+
style?: unknown;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export const {
|
|
83
|
+
BoundaryRootProvider,
|
|
84
|
+
useBoundaryRootContext,
|
|
85
|
+
useBoundaryRootStore,
|
|
86
|
+
} = createProvider("BoundaryRoot", { guarded: false })<
|
|
87
|
+
BoundaryRootProviderProps,
|
|
88
|
+
BoundaryRootContextValue
|
|
89
|
+
>(
|
|
90
|
+
({
|
|
91
|
+
children,
|
|
92
|
+
config,
|
|
93
|
+
enabled = true,
|
|
94
|
+
escapeClipping,
|
|
95
|
+
forwardedRef,
|
|
96
|
+
group,
|
|
97
|
+
handoff,
|
|
98
|
+
id,
|
|
99
|
+
style,
|
|
100
|
+
}) => {
|
|
101
|
+
const requestedBoundTag = useMemo(
|
|
102
|
+
() => createBoundTag(String(id), group),
|
|
103
|
+
[id, group],
|
|
104
|
+
);
|
|
105
|
+
const portalRuntime = resolveBoundaryPortal({
|
|
106
|
+
handoff,
|
|
107
|
+
escapeClipping,
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
const currentScreenKey = useDescriptorsStore(
|
|
111
|
+
(s) => s.derivations.currentScreenKey,
|
|
112
|
+
);
|
|
113
|
+
const currentActivity = useDescriptorsStore(
|
|
114
|
+
(s) => s.descriptors.current.activity,
|
|
115
|
+
);
|
|
116
|
+
const retainedBoundTagRef = useRef(requestedBoundTag);
|
|
117
|
+
const shouldRetainClosingBoundTag =
|
|
118
|
+
portalRuntime.handoff && currentActivity === "closing";
|
|
119
|
+
|
|
120
|
+
// Navigation can update a retained closing route's params before that
|
|
121
|
+
// route leaves the stack. Keep its handoff identity stable so the payload
|
|
122
|
+
// remains attached to the closing destination instead of being orphaned.
|
|
123
|
+
if (!shouldRetainClosingBoundTag) {
|
|
124
|
+
retainedBoundTagRef.current = requestedBoundTag;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const boundTag = retainedBoundTagRef.current;
|
|
128
|
+
const hasConfiguredInterpolator = useDescriptorsStore(
|
|
129
|
+
(s) => s.derivations.hasConfiguredInterpolator,
|
|
130
|
+
);
|
|
131
|
+
const runtimeEnabled = enabled && hasConfiguredInterpolator;
|
|
132
|
+
// Associated slot styles attach whenever the boundary is enabled,
|
|
133
|
+
// independent of whether an interpolator is configured for this transition.
|
|
134
|
+
const shouldAttachAssociatedStyles = enabled;
|
|
135
|
+
const shouldEscapeBoundaryRootToScreenHost = portalRuntime.escapeClipping;
|
|
136
|
+
|
|
137
|
+
const associatedStyles = useComposedSlotStyles(boundTag.tag, style);
|
|
138
|
+
const associatedStackingStyles = useSlotStackingStyles(boundTag.tag);
|
|
139
|
+
const rootRef = useAnimatedRef<View>();
|
|
140
|
+
const rootEscapePlaceholderRef = useAnimatedRef<View>();
|
|
141
|
+
const [targetEntry, setTargetEntry] = useState<BoundaryTargetEntry | null>(
|
|
142
|
+
null,
|
|
143
|
+
);
|
|
74
144
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
145
|
+
const registerTargetRef = useCallback(
|
|
146
|
+
(
|
|
147
|
+
targetRef: AnimatedRef<View>,
|
|
148
|
+
preparedStyles: StyleProps,
|
|
149
|
+
measurementRef?: AnimatedRef<View>,
|
|
150
|
+
) => {
|
|
151
|
+
setTargetEntry((prev) => {
|
|
152
|
+
if (prev?.ref === targetRef) {
|
|
153
|
+
return prev;
|
|
80
154
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
155
|
+
|
|
156
|
+
if (__DEV__ && prev !== null) {
|
|
157
|
+
logger.warnOnce(
|
|
158
|
+
"boundary:multiple-targets",
|
|
159
|
+
MULTIPLE_TARGETS_WARNING,
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return (
|
|
164
|
+
prev ?? {
|
|
165
|
+
ref: targetRef,
|
|
166
|
+
measurementRef: measurementRef ?? targetRef,
|
|
167
|
+
preparedStyles,
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
});
|
|
171
|
+
},
|
|
172
|
+
[],
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
const unregisterTargetRef = useCallback((targetRef: AnimatedRef<View>) => {
|
|
176
|
+
setTargetEntry((prev) => (prev?.ref === targetRef ? null : prev));
|
|
177
|
+
}, []);
|
|
178
|
+
|
|
179
|
+
const rootMeasurementRef = shouldEscapeBoundaryRootToScreenHost
|
|
180
|
+
? rootEscapePlaceholderRef
|
|
181
|
+
: rootRef;
|
|
182
|
+
const measuredRef = targetEntry?.measurementRef ?? rootMeasurementRef;
|
|
183
|
+
const hasActiveTarget = targetEntry !== null;
|
|
184
|
+
const targetPreparedStyles = targetEntry?.preparedStyles;
|
|
185
|
+
|
|
186
|
+
useImperativeHandle(forwardedRef, () => rootRef.current as any, [rootRef]);
|
|
187
|
+
|
|
188
|
+
useBoundaryMeasurement({
|
|
103
189
|
boundTag,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
190
|
+
enabled,
|
|
191
|
+
runtimeEnabled,
|
|
192
|
+
currentScreenKey,
|
|
193
|
+
measuredRef,
|
|
194
|
+
style,
|
|
195
|
+
targetPreparedStyles,
|
|
196
|
+
handoff: portalRuntime.handoff,
|
|
197
|
+
escapeClipping: portalRuntime.escapeClipping,
|
|
198
|
+
config,
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
const shouldRenderBoundaryRootThroughPortal =
|
|
202
|
+
shouldEscapeBoundaryRootToScreenHost && !hasActiveTarget;
|
|
203
|
+
const handoffEnabled = enabled && portalRuntime.handoff;
|
|
204
|
+
// A nested active target takes the full associated style, so the root keeps
|
|
205
|
+
// only its stacking context. Root-owned escape-clipping moves the root
|
|
206
|
+
// through a screen host, so its associated style is applied through the
|
|
207
|
+
// host instead of inline on the escaped element.
|
|
208
|
+
// Host-only handoff receivers still need the associated style: their
|
|
209
|
+
// handoff host is absolute-filled inside this root, so the root is the
|
|
210
|
+
// visual frame that animates the received payload.
|
|
211
|
+
const attachedStyle = shouldAttachAssociatedStyles
|
|
212
|
+
? hasActiveTarget
|
|
213
|
+
? associatedStackingStyles
|
|
214
|
+
: shouldRenderBoundaryRootThroughPortal
|
|
215
|
+
? undefined
|
|
216
|
+
: associatedStyles
|
|
217
|
+
: undefined;
|
|
218
|
+
|
|
219
|
+
const value = useMemo<BoundaryRootContextValue>(
|
|
220
|
+
() => ({
|
|
221
|
+
attachedStyle,
|
|
222
|
+
activeTargetRef: targetEntry?.ref ?? null,
|
|
223
|
+
boundTag,
|
|
224
|
+
currentScreenKey,
|
|
225
|
+
handoffEnabled,
|
|
226
|
+
portalRuntime,
|
|
227
|
+
registerTargetRef,
|
|
228
|
+
ref: rootRef,
|
|
229
|
+
rootEscapePlaceholderRef,
|
|
230
|
+
shouldRenderBoundaryRootThroughPortal,
|
|
231
|
+
shouldRenderHandoffHost: handoffEnabled && !hasActiveTarget,
|
|
232
|
+
unregisterTargetRef,
|
|
233
|
+
}),
|
|
234
|
+
[
|
|
235
|
+
attachedStyle,
|
|
236
|
+
boundTag,
|
|
237
|
+
currentScreenKey,
|
|
238
|
+
handoffEnabled,
|
|
239
|
+
hasActiveTarget,
|
|
240
|
+
portalRuntime,
|
|
241
|
+
registerTargetRef,
|
|
242
|
+
rootRef,
|
|
243
|
+
rootEscapePlaceholderRef,
|
|
244
|
+
shouldRenderBoundaryRootThroughPortal,
|
|
245
|
+
targetEntry,
|
|
246
|
+
unregisterTargetRef,
|
|
247
|
+
],
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
return {
|
|
251
|
+
value,
|
|
252
|
+
children: children(value),
|
|
253
|
+
};
|
|
254
|
+
},
|
|
255
|
+
);
|
|
@@ -7,14 +7,27 @@ import type {
|
|
|
7
7
|
ScreenPairKey,
|
|
8
8
|
} from "../../../stores/bounds/types";
|
|
9
9
|
|
|
10
|
-
export
|
|
10
|
+
export type InitialDestinationMeasurementAction =
|
|
11
|
+
| "wait"
|
|
12
|
+
| "release"
|
|
13
|
+
| "measure"
|
|
14
|
+
| "complete";
|
|
15
|
+
|
|
16
|
+
export type InitialDestinationMeasurementSignal = {
|
|
17
|
+
pairKey: ScreenPairKey;
|
|
18
|
+
action: InitialDestinationMeasurementAction;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const getInitialDestinationMeasurementSignal = (params: {
|
|
11
22
|
enabled: boolean;
|
|
12
23
|
destinationPairKey?: ScreenPairKey;
|
|
13
24
|
ancestorDestinationPairKey?: ScreenPairKey;
|
|
14
25
|
linkId: string;
|
|
15
26
|
group?: string;
|
|
27
|
+
destinationPresent: boolean;
|
|
28
|
+
sourcePresent: boolean;
|
|
16
29
|
linkState?: LinkPairsState;
|
|
17
|
-
}):
|
|
30
|
+
}): InitialDestinationMeasurementSignal | null => {
|
|
18
31
|
"worklet";
|
|
19
32
|
const {
|
|
20
33
|
enabled,
|
|
@@ -22,30 +35,41 @@ export const getInitialDestinationMeasurePairKey = (params: {
|
|
|
22
35
|
ancestorDestinationPairKey,
|
|
23
36
|
linkId,
|
|
24
37
|
group,
|
|
38
|
+
destinationPresent,
|
|
39
|
+
sourcePresent,
|
|
25
40
|
linkState,
|
|
26
41
|
} = params;
|
|
27
|
-
const
|
|
42
|
+
const pairKey = destinationPairKey ?? ancestorDestinationPairKey;
|
|
28
43
|
|
|
29
|
-
if (!enabled || !
|
|
44
|
+
if (!enabled || !pairKey) {
|
|
30
45
|
return null;
|
|
31
46
|
}
|
|
32
47
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
48
|
+
if (!destinationPresent) {
|
|
49
|
+
return { pairKey, action: "wait" };
|
|
50
|
+
}
|
|
36
51
|
|
|
37
|
-
if (
|
|
38
|
-
return
|
|
52
|
+
if (!sourcePresent) {
|
|
53
|
+
return { pairKey, action: "release" };
|
|
39
54
|
}
|
|
40
55
|
|
|
56
|
+
const linkKey = getLinkKeyFromTag(linkId);
|
|
41
57
|
const activeGroupId =
|
|
42
|
-
group && linkState
|
|
43
|
-
? getActiveGroupId(linkState, measurePairKey, group)
|
|
44
|
-
: null;
|
|
58
|
+
group && linkState ? getActiveGroupId(linkState, pairKey, group) : null;
|
|
45
59
|
|
|
46
60
|
if (activeGroupId && activeGroupId !== linkKey) {
|
|
47
|
-
return
|
|
61
|
+
return { pairKey, action: "release" };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const link = linkState?.[pairKey]?.links?.[linkKey];
|
|
65
|
+
|
|
66
|
+
if (!link?.destination) {
|
|
67
|
+
return { pairKey, action: "measure" };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (!link.source) {
|
|
71
|
+
return { pairKey, action: "wait" };
|
|
48
72
|
}
|
|
49
73
|
|
|
50
|
-
return
|
|
74
|
+
return { pairKey, action: "complete" };
|
|
51
75
|
};
|
|
@@ -96,6 +96,54 @@ export const isMeasurementInViewport = (
|
|
|
96
96
|
);
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
+
export const normalizeMeasuredBoundsWithVisibilityGate = ({
|
|
100
|
+
measured,
|
|
101
|
+
origin,
|
|
102
|
+
visibilityBlocked,
|
|
103
|
+
visibilityBlockOffset,
|
|
104
|
+
viewportWidth,
|
|
105
|
+
viewportHeight,
|
|
106
|
+
}: {
|
|
107
|
+
measured: MeasuredDimensions;
|
|
108
|
+
origin: MeasuredDimensions;
|
|
109
|
+
visibilityBlocked: boolean;
|
|
110
|
+
visibilityBlockOffset: number;
|
|
111
|
+
viewportWidth: number;
|
|
112
|
+
viewportHeight: number;
|
|
113
|
+
}): MeasuredDimensions => {
|
|
114
|
+
"worklet";
|
|
115
|
+
const normalized = normalizeMeasuredBoundsToOrigin(measured, origin);
|
|
116
|
+
|
|
117
|
+
if (
|
|
118
|
+
!visibilityBlocked ||
|
|
119
|
+
visibilityBlockOffset <= 0 ||
|
|
120
|
+
isMeasurementInViewport(normalized, viewportWidth, viewportHeight)
|
|
121
|
+
) {
|
|
122
|
+
return normalized;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Fabric can expose the visibility transform to one native measurement one
|
|
126
|
+
// frame before the other. Prefer normal origin-relative coordinates, then
|
|
127
|
+
// test either side of that known frame skew while the gate is active.
|
|
128
|
+
const measuredAhead = {
|
|
129
|
+
...normalized,
|
|
130
|
+
pageY: normalized.pageY - visibilityBlockOffset,
|
|
131
|
+
};
|
|
132
|
+
if (isMeasurementInViewport(measuredAhead, viewportWidth, viewportHeight)) {
|
|
133
|
+
return measuredAhead;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const originAhead = {
|
|
137
|
+
...normalized,
|
|
138
|
+
pageY: normalized.pageY + visibilityBlockOffset,
|
|
139
|
+
};
|
|
140
|
+
if (isMeasurementInViewport(originAhead, viewportWidth, viewportHeight)) {
|
|
141
|
+
return originAhead;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return normalized;
|
|
145
|
+
};
|
|
146
|
+
|
|
99
147
|
export const measureWithOverscrollAwareness = (
|
|
100
148
|
ref: AnimatedRef<View>,
|
|
101
149
|
scrollState: ScrollGestureState | null,
|
|
@@ -8,7 +8,7 @@ import { useGestureContext } from "../../../providers/screen/gestures";
|
|
|
8
8
|
import { OriginProvider } from "../../../providers/screen/origin.provider";
|
|
9
9
|
import { useSlotProps, useSlotStyles } from "../../../providers/screen/styles";
|
|
10
10
|
import type { ScreenContentComponentProps } from "../../../types";
|
|
11
|
-
import { ScreenFallbackHost } from "../../boundary/portal/components/host";
|
|
11
|
+
import { ScreenFallbackHost } from "../../boundary/portal/components/boundary-portal/components/host";
|
|
12
12
|
import { useContentLayout } from "../hooks/use-content-layout";
|
|
13
13
|
import { MaybeMaskedNavigationContainer } from "./maybe-masked-navigation-container";
|
|
14
14
|
import { usesLayerRenderProps } from "./render-component";
|
|
@@ -434,7 +434,7 @@ export const SharedAppleMusic = ({
|
|
|
434
434
|
const dragXScale = interpolate(normX, [0, 1], xScaleOuput);
|
|
435
435
|
const dragYScale = interpolate(normY, [0, 1], yScaleOuput);
|
|
436
436
|
|
|
437
|
-
const boundValues = bounds({ id: sharedBoundTag }).
|
|
437
|
+
const boundValues = bounds({ id: sharedBoundTag }).values({
|
|
438
438
|
method: focused ? "content" : "transform",
|
|
439
439
|
anchor: "top",
|
|
440
440
|
scaleMode: "uniform",
|
|
@@ -453,7 +453,7 @@ export const SharedAppleMusic = ({
|
|
|
453
453
|
* ===============================
|
|
454
454
|
*/
|
|
455
455
|
if (focused) {
|
|
456
|
-
const maskedValues = bounds({ id: sharedBoundTag }).
|
|
456
|
+
const maskedValues = bounds({ id: sharedBoundTag }).values({
|
|
457
457
|
space: "absolute",
|
|
458
458
|
method: "size",
|
|
459
459
|
target: "fullscreen",
|
package/src/shared/constants.ts
CHANGED
|
@@ -53,12 +53,16 @@ const DEFAULT_GESTURE_VALUES = {
|
|
|
53
53
|
velocity: 0,
|
|
54
54
|
focalX: 0,
|
|
55
55
|
focalY: 0,
|
|
56
|
+
pinchOriginX: 0,
|
|
57
|
+
pinchOriginY: 0,
|
|
56
58
|
raw: DEFAULT_RAW_GESTURE_VALUES,
|
|
57
59
|
handoff: {
|
|
58
60
|
...DEFAULT_RAW_GESTURE_VALUES,
|
|
59
61
|
velocity: 0,
|
|
60
62
|
focalX: 0,
|
|
61
63
|
focalY: 0,
|
|
64
|
+
pinchOriginX: 0,
|
|
65
|
+
pinchOriginY: 0,
|
|
62
66
|
raw: DEFAULT_RAW_GESTURE_VALUES,
|
|
63
67
|
active: null,
|
|
64
68
|
direction: null,
|