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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
|
-
import { memo,
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
3
|
import type { View } from "react-native";
|
|
4
4
|
import Animated, { useAnimatedRef } from "react-native-reanimated";
|
|
5
5
|
import {
|
|
@@ -7,71 +7,62 @@ import {
|
|
|
7
7
|
useSlotLayoutStyles,
|
|
8
8
|
} from "../../../providers/screen/styles";
|
|
9
9
|
import { prepareStyleForBounds } from "../../../utils/bounds/helpers/styles/styles";
|
|
10
|
-
import {
|
|
11
|
-
import { Portal } from "../portal/components/portal";
|
|
10
|
+
import { useRegisterTarget } from "../hooks/use-register-target";
|
|
12
11
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from "../
|
|
12
|
+
BoundaryContentPortal,
|
|
13
|
+
BoundaryContentPortalHost,
|
|
14
|
+
} from "../portal/components/boundary-content-portal";
|
|
15
|
+
import { BoundaryPortal } from "../portal/components/boundary-portal";
|
|
16
|
+
import { useBoundaryRootContext } from "../providers/boundary-root.provider";
|
|
16
17
|
|
|
17
|
-
type BoundaryTargetProps =
|
|
18
|
+
type BoundaryTargetProps = Omit<
|
|
19
|
+
React.ComponentProps<typeof Animated.View>,
|
|
20
|
+
"children"
|
|
21
|
+
> & {
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
};
|
|
18
24
|
|
|
19
25
|
export const BoundaryTarget = memo(function BoundaryTarget(
|
|
20
26
|
props: BoundaryTargetProps,
|
|
21
27
|
) {
|
|
22
|
-
const { style, ...rest } = props;
|
|
28
|
+
const { children, pointerEvents, style, ...rest } = props;
|
|
23
29
|
const targetAnimatedRef = useAnimatedRef<View>();
|
|
24
|
-
const
|
|
30
|
+
const targetEscapePlaceholderRef = useAnimatedRef<View>();
|
|
25
31
|
const rootContext = useBoundaryRootContext();
|
|
26
|
-
const
|
|
27
|
-
const unregisterTargetRef = rootContext?.unregisterTargetRef;
|
|
32
|
+
const boundaryId = rootContext?.boundTag.tag;
|
|
28
33
|
const isActiveTarget = rootContext?.activeTargetRef === targetAnimatedRef;
|
|
29
34
|
const portalRuntime = rootContext?.portalRuntime;
|
|
35
|
+
const handoffEnabled = isActiveTarget && rootContext?.handoffEnabled === true;
|
|
36
|
+
const shouldEscapeTargetToScreenHost =
|
|
37
|
+
portalRuntime?.escapeClipping === true && boundaryId !== undefined;
|
|
38
|
+
|
|
30
39
|
const shouldApplyAssociatedStyleInline =
|
|
31
|
-
isActiveTarget && portalRuntime?.
|
|
40
|
+
isActiveTarget && portalRuntime?.escapeClipping !== true;
|
|
32
41
|
const shouldApplyPortalLayoutStyle =
|
|
33
|
-
isActiveTarget && portalRuntime?.
|
|
42
|
+
isActiveTarget && portalRuntime?.escapeClipping === true;
|
|
43
|
+
|
|
34
44
|
const associatedTargetStyles = useComposedSlotStyles(
|
|
35
45
|
rootContext?.boundTag.tag,
|
|
36
46
|
style,
|
|
37
47
|
);
|
|
38
48
|
const portalLayoutStyle = useSlotLayoutStyles(rootContext?.boundTag.tag);
|
|
39
49
|
const preparedStyles = useMemo(() => prepareStyleForBounds(style), [style]);
|
|
40
|
-
// Teleported content can render outside its layout slot. The placeholder is
|
|
41
|
-
// the truthful measurement surface whenever runtime portal behavior is active.
|
|
42
|
-
const measurementRef = portalRuntime?.enabled
|
|
43
|
-
? placeholderAnimatedRef
|
|
44
|
-
: targetAnimatedRef;
|
|
45
50
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
logger.warn(TARGET_OUTSIDE_ROOT_WARNING);
|
|
50
|
-
}
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
51
|
+
const measurementRef = shouldEscapeTargetToScreenHost
|
|
52
|
+
? targetEscapePlaceholderRef
|
|
53
|
+
: targetAnimatedRef;
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
return () => {
|
|
56
|
-
unregisterTargetRef(targetAnimatedRef);
|
|
57
|
-
};
|
|
58
|
-
}, [
|
|
59
|
-
registerTargetRef,
|
|
60
|
-
unregisterTargetRef,
|
|
61
|
-
targetAnimatedRef,
|
|
62
|
-
preparedStyles,
|
|
63
|
-
measurementRef,
|
|
64
|
-
]);
|
|
55
|
+
useRegisterTarget({ preparedStyles, measurementRef, targetAnimatedRef });
|
|
65
56
|
|
|
66
57
|
return (
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
placeholderRef={placeholderAnimatedRef}
|
|
58
|
+
<BoundaryPortal
|
|
59
|
+
boundaryId={boundaryId ?? ""}
|
|
60
|
+
enabled={shouldEscapeTargetToScreenHost}
|
|
61
|
+
placeholderRef={targetEscapePlaceholderRef}
|
|
72
62
|
>
|
|
73
63
|
<Animated.View
|
|
74
64
|
{...rest}
|
|
65
|
+
pointerEvents={pointerEvents}
|
|
75
66
|
ref={targetAnimatedRef}
|
|
76
67
|
style={[
|
|
77
68
|
style,
|
|
@@ -79,7 +70,20 @@ export const BoundaryTarget = memo(function BoundaryTarget(
|
|
|
79
70
|
shouldApplyPortalLayoutStyle ? portalLayoutStyle : undefined,
|
|
80
71
|
]}
|
|
81
72
|
collapsable={false}
|
|
82
|
-
|
|
83
|
-
|
|
73
|
+
>
|
|
74
|
+
<BoundaryContentPortalHost
|
|
75
|
+
boundaryId={boundaryId ?? ""}
|
|
76
|
+
enabled={handoffEnabled}
|
|
77
|
+
screenKey={rootContext?.currentScreenKey ?? ""}
|
|
78
|
+
>
|
|
79
|
+
<BoundaryContentPortal
|
|
80
|
+
boundaryId={boundaryId}
|
|
81
|
+
enabled={handoffEnabled}
|
|
82
|
+
>
|
|
83
|
+
{children}
|
|
84
|
+
</BoundaryContentPortal>
|
|
85
|
+
</BoundaryContentPortalHost>
|
|
86
|
+
</Animated.View>
|
|
87
|
+
</BoundaryPortal>
|
|
84
88
|
);
|
|
85
89
|
});
|
|
@@ -1,49 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
useImperativeHandle,
|
|
7
|
-
useMemo,
|
|
8
|
-
} from "react";
|
|
9
|
-
import type { View } from "react-native";
|
|
10
|
-
import Animated, { useAnimatedRef } from "react-native-reanimated";
|
|
11
|
-
import { useDescriptorsStore } from "../../providers/screen/descriptors";
|
|
12
|
-
import {
|
|
13
|
-
useComposedSlotStyles,
|
|
14
|
-
useSlotStackingStyles,
|
|
15
|
-
} from "../../providers/screen/styles";
|
|
16
|
-
import { createBoundTag } from "../../stores/bounds/helpers/link-pairs.helpers";
|
|
17
|
-
import { useBoundaryMeasurement } from "./hooks/use-boundary-measurement";
|
|
18
|
-
import { BoundaryLocalPortalHost } from "./portal/components/boundary-local-portal-host";
|
|
19
|
-
import { Portal } from "./portal/components/portal";
|
|
20
|
-
import { resolveBoundaryPortal } from "./portal/utils/resolve-portal";
|
|
21
|
-
import {
|
|
22
|
-
BoundaryRootProvider,
|
|
23
|
-
useBoundaryRootState,
|
|
24
|
-
} from "./providers/boundary-root.provider";
|
|
1
|
+
import { type ComponentType, forwardRef, memo } from "react";
|
|
2
|
+
import Animated from "react-native-reanimated";
|
|
3
|
+
import { BoundaryContentPortalHost } from "./portal/components/boundary-content-portal";
|
|
4
|
+
import { BoundaryPortal } from "./portal/components/boundary-portal";
|
|
5
|
+
import { BoundaryRootProvider } from "./providers/boundary-root.provider";
|
|
25
6
|
import type { BoundaryComponentProps } from "./types";
|
|
26
7
|
|
|
27
8
|
interface CreateBoundaryComponentOptions {
|
|
28
9
|
alreadyAnimated?: boolean;
|
|
29
10
|
}
|
|
30
11
|
|
|
31
|
-
const hasRenderableChildren = (children: ReactNode): boolean => {
|
|
32
|
-
if (
|
|
33
|
-
children === null ||
|
|
34
|
-
children === undefined ||
|
|
35
|
-
typeof children === "boolean"
|
|
36
|
-
) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (Array.isArray(children)) {
|
|
41
|
-
return children.some(hasRenderableChildren);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return true;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
12
|
export function createBoundaryComponent<P extends object>(
|
|
48
13
|
Wrapped: ComponentType<P>,
|
|
49
14
|
options: CreateBoundaryComponentOptions = {},
|
|
@@ -66,124 +31,44 @@ export function createBoundaryComponent<P extends object>(
|
|
|
66
31
|
target,
|
|
67
32
|
method,
|
|
68
33
|
style,
|
|
69
|
-
onPress,
|
|
70
34
|
handoff,
|
|
71
35
|
escapeClipping,
|
|
72
36
|
children,
|
|
73
37
|
...rest
|
|
74
38
|
} = props as any;
|
|
75
39
|
|
|
76
|
-
const boundTag = useMemo(
|
|
77
|
-
() => createBoundTag(String(id), group),
|
|
78
|
-
[id, group],
|
|
79
|
-
);
|
|
80
|
-
const portalRuntime = resolveBoundaryPortal({
|
|
81
|
-
handoff,
|
|
82
|
-
escapeClipping,
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
const currentScreenKey = useDescriptorsStore(
|
|
86
|
-
(s) => s.derivations.currentScreenKey,
|
|
87
|
-
);
|
|
88
|
-
const hasConfiguredInterpolator = useDescriptorsStore(
|
|
89
|
-
(s) => s.derivations.hasConfiguredInterpolator,
|
|
90
|
-
);
|
|
91
|
-
const runtimeEnabled = enabled && hasConfiguredInterpolator;
|
|
92
|
-
// Associated slot styles attach whenever the boundary is enabled,
|
|
93
|
-
// independent of whether an interpolator is configured for this transition.
|
|
94
|
-
const shouldAttachAssociatedStyles = enabled;
|
|
95
|
-
const canPortalRoot =
|
|
96
|
-
portalRuntime.enabled && hasRenderableChildren(children);
|
|
97
|
-
|
|
98
|
-
const associatedStyles = useComposedSlotStyles(boundTag.tag, style);
|
|
99
|
-
const associatedStackingStyles = useSlotStackingStyles(boundTag.tag);
|
|
100
|
-
const rootPlaceholderRef = useAnimatedRef<View>();
|
|
101
|
-
|
|
102
|
-
const {
|
|
103
|
-
ref,
|
|
104
|
-
contextValue,
|
|
105
|
-
measuredRef,
|
|
106
|
-
hasActiveTarget,
|
|
107
|
-
targetPreparedStyles,
|
|
108
|
-
} = useBoundaryRootState({
|
|
109
|
-
boundTag,
|
|
110
|
-
portalRuntime,
|
|
111
|
-
rootMeasurementRef: canPortalRoot ? rootPlaceholderRef : undefined,
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
useBoundaryMeasurement({
|
|
115
|
-
boundTag,
|
|
116
|
-
enabled,
|
|
117
|
-
runtimeEnabled,
|
|
118
|
-
currentScreenKey,
|
|
119
|
-
measuredRef,
|
|
120
|
-
style,
|
|
121
|
-
targetPreparedStyles,
|
|
122
|
-
handoff: portalRuntime.handoff,
|
|
123
|
-
escapeClipping: portalRuntime.escapeClipping,
|
|
124
|
-
config: { anchor, scaleMode, target, method },
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
useImperativeHandle(forwardedRef, () => ref.current as any, [ref]);
|
|
128
|
-
|
|
129
|
-
const shouldPortalRoot = canPortalRoot && !hasActiveTarget;
|
|
130
|
-
// A nested active target takes the full associated style, so the root keeps
|
|
131
|
-
// only its stacking context. Without a nested target, a portal'd root is the
|
|
132
|
-
// target, so its associated style is applied through the portal host instead
|
|
133
|
-
// of inline on the teleported element.
|
|
134
|
-
// Host-only handoff receivers still need the associated style: their local
|
|
135
|
-
// portal host is absolute-filled inside this root, so the root is the visual
|
|
136
|
-
// frame that animates the received payload.
|
|
137
|
-
const attachedStyle = shouldAttachAssociatedStyles
|
|
138
|
-
? hasActiveTarget
|
|
139
|
-
? associatedStackingStyles
|
|
140
|
-
: shouldPortalRoot
|
|
141
|
-
? undefined
|
|
142
|
-
: associatedStyles
|
|
143
|
-
: undefined;
|
|
144
|
-
const pressProps = typeof onPress === "function" ? { onPress } : undefined;
|
|
145
|
-
|
|
146
|
-
const localPortalHost = (
|
|
147
|
-
<BoundaryLocalPortalHost
|
|
148
|
-
boundaryId={boundTag.tag}
|
|
149
|
-
enabled={enabled && portalRuntime.handoff}
|
|
150
|
-
screenKey={currentScreenKey}
|
|
151
|
-
/>
|
|
152
|
-
);
|
|
153
|
-
const canInjectLocalPortalHost = typeof children !== "function";
|
|
154
|
-
|
|
155
|
-
const renderBoundaryRoot = (extraChildren?: ReactNode) => (
|
|
156
|
-
<AnimatedComponent
|
|
157
|
-
{...rest}
|
|
158
|
-
{...pressProps}
|
|
159
|
-
ref={ref}
|
|
160
|
-
style={[style, attachedStyle]}
|
|
161
|
-
collapsable={false}
|
|
162
|
-
>
|
|
163
|
-
{children}
|
|
164
|
-
{canInjectLocalPortalHost ? extraChildren : null}
|
|
165
|
-
</AnimatedComponent>
|
|
166
|
-
);
|
|
167
|
-
const boundaryRoot = renderBoundaryRoot(
|
|
168
|
-
shouldPortalRoot ? undefined : localPortalHost,
|
|
169
|
-
);
|
|
170
|
-
|
|
171
40
|
return (
|
|
172
|
-
<BoundaryRootProvider
|
|
173
|
-
{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
41
|
+
<BoundaryRootProvider
|
|
42
|
+
config={{ anchor, scaleMode, target, method }}
|
|
43
|
+
enabled={enabled}
|
|
44
|
+
escapeClipping={escapeClipping}
|
|
45
|
+
forwardedRef={forwardedRef}
|
|
46
|
+
group={group}
|
|
47
|
+
handoff={handoff}
|
|
48
|
+
id={id}
|
|
49
|
+
style={style}
|
|
50
|
+
>
|
|
51
|
+
{(root) => (
|
|
52
|
+
<BoundaryPortal
|
|
53
|
+
boundaryId={root.boundTag.tag}
|
|
54
|
+
enabled={root.shouldRenderBoundaryRootThroughPortal}
|
|
55
|
+
placeholderRef={root.rootEscapePlaceholderRef}
|
|
182
56
|
>
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
57
|
+
<AnimatedComponent
|
|
58
|
+
{...rest}
|
|
59
|
+
ref={root.ref}
|
|
60
|
+
style={[style, root.attachedStyle]}
|
|
61
|
+
collapsable={false}
|
|
62
|
+
>
|
|
63
|
+
<BoundaryContentPortalHost
|
|
64
|
+
boundaryId={root.boundTag.tag}
|
|
65
|
+
enabled={root.shouldRenderHandoffHost}
|
|
66
|
+
screenKey={root.currentScreenKey}
|
|
67
|
+
>
|
|
68
|
+
{children}
|
|
69
|
+
</BoundaryContentPortalHost>
|
|
70
|
+
</AnimatedComponent>
|
|
71
|
+
</BoundaryPortal>
|
|
187
72
|
)}
|
|
188
73
|
</BoundaryRootProvider>
|
|
189
74
|
);
|
package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { useCallback, useLayoutEffect } from "react";
|
|
1
2
|
import {
|
|
2
3
|
cancelAnimation,
|
|
4
|
+
runOnUI,
|
|
3
5
|
useAnimatedReaction,
|
|
4
6
|
useSharedValue,
|
|
5
7
|
withDelay,
|
|
@@ -9,41 +11,33 @@ import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
|
|
|
9
11
|
import { AnimationStore } from "../../../../stores/animation.store";
|
|
10
12
|
import { getSourceScreenKeyFromPairKey } from "../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
11
13
|
import { getEntry } from "../../../../stores/bounds/internals/entries";
|
|
12
|
-
import {
|
|
13
|
-
getDestination,
|
|
14
|
-
getLink,
|
|
15
|
-
} from "../../../../stores/bounds/internals/links";
|
|
14
|
+
import { getLink } from "../../../../stores/bounds/internals/links";
|
|
16
15
|
import { pairs } from "../../../../stores/bounds/internals/state";
|
|
17
16
|
import type { BoundTag } from "../../../../stores/bounds/types";
|
|
18
|
-
import {
|
|
19
|
-
LifecycleTransitionRequestKind,
|
|
20
|
-
SystemStore,
|
|
21
|
-
} from "../../../../stores/system.store";
|
|
17
|
+
import { SystemStore } from "../../../../stores/system.store";
|
|
22
18
|
import { logger } from "../../../../utils/logger";
|
|
23
|
-
import {
|
|
24
|
-
hasHandoffEscapeContinuation,
|
|
25
|
-
usesEscapeClippingHost,
|
|
26
|
-
} from "../../portal/utils/ownership";
|
|
27
19
|
import type { MeasureBoundary } from "../../types";
|
|
28
|
-
import {
|
|
20
|
+
import { getInitialDestinationMeasurementSignal } from "../../utils/destination-signals";
|
|
29
21
|
|
|
30
|
-
const
|
|
22
|
+
const HANDSHAKE_RETRY_DELAY_MS = 100;
|
|
31
23
|
/**
|
|
32
|
-
* A destination
|
|
33
|
-
* transition gate forever
|
|
34
|
-
*
|
|
24
|
+
* A destination whose initial handshake never completes must not hold the
|
|
25
|
+
* transition gate forever. After this budget, release the block with a warning
|
|
26
|
+
* so the open proceeds without that boundary.
|
|
35
27
|
*/
|
|
36
|
-
const
|
|
28
|
+
const MAX_HANDSHAKE_RETRIES = 20;
|
|
37
29
|
|
|
38
30
|
interface UseInitialDestinationMeasurementParams {
|
|
39
31
|
boundTag: BoundTag;
|
|
40
32
|
enabled: boolean;
|
|
33
|
+
escapeClipping: boolean;
|
|
41
34
|
measureBoundary: MeasureBoundary;
|
|
42
35
|
}
|
|
43
36
|
|
|
44
37
|
export const useInitialDestinationMeasurement = ({
|
|
45
38
|
boundTag,
|
|
46
39
|
enabled,
|
|
40
|
+
escapeClipping,
|
|
47
41
|
measureBoundary,
|
|
48
42
|
}: UseInitialDestinationMeasurementParams) => {
|
|
49
43
|
const { tag, linkKey, group } = boundTag;
|
|
@@ -58,22 +52,23 @@ export const useInitialDestinationMeasurement = ({
|
|
|
58
52
|
(s) => s.derivations.ancestorDestinationPairKey,
|
|
59
53
|
);
|
|
60
54
|
const destinationEnabled = enabled && !nextScreenKey;
|
|
55
|
+
const initialDestinationPairKey =
|
|
56
|
+
destinationPairKey ?? ancestorDestinationPairKey;
|
|
61
57
|
const progress = AnimationStore.getValue(
|
|
62
58
|
currentScreenKey,
|
|
63
59
|
"transitionProgress",
|
|
64
60
|
);
|
|
65
61
|
|
|
66
62
|
const {
|
|
67
|
-
pendingLifecycleRequestKind,
|
|
68
63
|
actions: { blockLifecycleStart, unblockLifecycleStart },
|
|
69
64
|
} = SystemStore.getBag(currentScreenKey);
|
|
70
65
|
|
|
71
66
|
const isBlockingLifecycleStart = useSharedValue(0);
|
|
72
67
|
const retryToken = useSharedValue(0);
|
|
73
|
-
const
|
|
68
|
+
const handshakeRetries = useSharedValue(0);
|
|
74
69
|
const hasGivenUp = useSharedValue(0);
|
|
75
70
|
|
|
76
|
-
const releaseLifecycleStartBlock = () => {
|
|
71
|
+
const releaseLifecycleStartBlock = useCallback(() => {
|
|
77
72
|
"worklet";
|
|
78
73
|
cancelAnimation(retryToken);
|
|
79
74
|
|
|
@@ -81,53 +76,94 @@ export const useInitialDestinationMeasurement = ({
|
|
|
81
76
|
return;
|
|
82
77
|
}
|
|
83
78
|
|
|
84
|
-
unblockLifecycleStart();
|
|
85
79
|
isBlockingLifecycleStart.set(0);
|
|
86
|
-
|
|
80
|
+
unblockLifecycleStart();
|
|
81
|
+
}, [isBlockingLifecycleStart, retryToken, unblockLifecycleStart]);
|
|
87
82
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
const claimLifecycleStartBlock = useCallback(() => {
|
|
84
|
+
"worklet";
|
|
85
|
+
|
|
86
|
+
// The progress check and block claim must share one UI-thread operation.
|
|
87
|
+
// Otherwise a JS-thread layout effect can observe zero, enqueue the block,
|
|
88
|
+
// and let the opening animation start before that block reaches the UI thread.
|
|
89
|
+
if (progress.get() > 0 || isBlockingLifecycleStart.get()) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
blockLifecycleStart();
|
|
94
|
+
isBlockingLifecycleStart.set(1);
|
|
95
|
+
}, [blockLifecycleStart, isBlockingLifecycleStart, progress]);
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
useLayoutEffect(() => {
|
|
98
|
+
if (!destinationEnabled || !initialDestinationPairKey) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
98
101
|
|
|
99
|
-
|
|
100
|
-
|
|
102
|
+
runOnUI(claimLifecycleStartBlock)();
|
|
103
|
+
|
|
104
|
+
return () => {
|
|
105
|
+
if (escapeClipping) {
|
|
106
|
+
// The portal host owns the release after this boundary hands off.
|
|
107
|
+
return;
|
|
101
108
|
}
|
|
102
109
|
|
|
103
|
-
|
|
104
|
-
|
|
110
|
+
// This is an abandonment fallback, not a second release. Run it on the UI
|
|
111
|
+
// runtime so it serializes with the handshake's guarded release.
|
|
112
|
+
runOnUI(releaseLifecycleStartBlock)();
|
|
113
|
+
};
|
|
114
|
+
}, [
|
|
115
|
+
claimLifecycleStartBlock,
|
|
116
|
+
destinationEnabled,
|
|
117
|
+
escapeClipping,
|
|
118
|
+
initialDestinationPairKey,
|
|
119
|
+
releaseLifecycleStartBlock,
|
|
120
|
+
]);
|
|
121
|
+
|
|
122
|
+
useAnimatedReaction(
|
|
123
|
+
() => {
|
|
124
|
+
"worklet";
|
|
125
|
+
const retryTick = retryToken.get();
|
|
126
|
+
const isWaitingForOpenToStart = progress.get() <= 0;
|
|
127
|
+
const sourceScreenKey = initialDestinationPairKey
|
|
128
|
+
? getSourceScreenKeyFromPairKey(initialDestinationPairKey)
|
|
129
|
+
: undefined;
|
|
130
|
+
const signal = getInitialDestinationMeasurementSignal({
|
|
131
|
+
enabled:
|
|
132
|
+
destinationEnabled &&
|
|
133
|
+
isWaitingForOpenToStart &&
|
|
134
|
+
isBlockingLifecycleStart.get() > 0,
|
|
105
135
|
destinationPairKey,
|
|
106
136
|
ancestorDestinationPairKey,
|
|
107
137
|
linkId: linkKey,
|
|
108
138
|
group,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
139
|
+
destinationPresent: getEntry(tag, currentScreenKey) !== null,
|
|
140
|
+
sourcePresent:
|
|
141
|
+
sourceScreenKey !== undefined &&
|
|
142
|
+
getEntry(tag, sourceScreenKey) !== null,
|
|
143
|
+
linkState: initialDestinationPairKey ? pairs.get() : undefined,
|
|
114
144
|
});
|
|
115
145
|
|
|
116
|
-
return [
|
|
146
|
+
return [
|
|
147
|
+
signal?.pairKey ?? null,
|
|
148
|
+
signal?.action ?? null,
|
|
149
|
+
retryTick,
|
|
150
|
+
] as const;
|
|
117
151
|
},
|
|
118
|
-
([measurePairKey, retryTick], previous) => {
|
|
152
|
+
([measurePairKey, action, retryTick], previous) => {
|
|
119
153
|
"worklet";
|
|
120
|
-
if (!measurePairKey) {
|
|
154
|
+
if (!measurePairKey || !action) {
|
|
121
155
|
return;
|
|
122
156
|
}
|
|
123
157
|
|
|
124
158
|
const previousMeasurePairKey = previous?.[0];
|
|
125
|
-
const
|
|
126
|
-
const
|
|
159
|
+
const previousAction = previous?.[1];
|
|
160
|
+
const previousRetryTick = previous?.[2];
|
|
161
|
+
const shouldHandleSignal =
|
|
127
162
|
measurePairKey !== previousMeasurePairKey ||
|
|
163
|
+
action !== previousAction ||
|
|
128
164
|
retryTick !== previousRetryTick;
|
|
129
165
|
|
|
130
|
-
if (!
|
|
166
|
+
if (!shouldHandleSignal) {
|
|
131
167
|
return;
|
|
132
168
|
}
|
|
133
169
|
|
|
@@ -135,62 +171,51 @@ export const useInitialDestinationMeasurement = ({
|
|
|
135
171
|
return;
|
|
136
172
|
}
|
|
137
173
|
|
|
138
|
-
if (
|
|
139
|
-
|
|
140
|
-
|
|
174
|
+
if (action === "release") {
|
|
175
|
+
releaseLifecycleStartBlock();
|
|
176
|
+
handshakeRetries.set(0);
|
|
177
|
+
return;
|
|
141
178
|
}
|
|
142
179
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
180
|
+
if (action === "measure") {
|
|
181
|
+
measureBoundary({
|
|
182
|
+
type: "destination",
|
|
183
|
+
pairKey: measurePairKey,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
const link = getLink(measurePairKey, linkKey);
|
|
188
|
+
const linkComplete = !!link?.source && !!link.destination;
|
|
147
189
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
const linkState = pairs.get();
|
|
153
|
-
const link = getLink(measurePairKey, linkKey);
|
|
154
|
-
const sourceScreenKey = getSourceScreenKeyFromPairKey(measurePairKey);
|
|
155
|
-
const sourceEntry = getEntry(tag, sourceScreenKey);
|
|
156
|
-
const sourceEntryUsesDestinationEscapeHost =
|
|
157
|
-
sourceEntry?.handoff === true && sourceEntry.escapeClipping === true;
|
|
158
|
-
const shouldWaitForEscapeClippingHost =
|
|
159
|
-
usesEscapeClippingHost(link) ||
|
|
160
|
-
sourceEntryUsesDestinationEscapeHost ||
|
|
161
|
-
hasHandoffEscapeContinuation({
|
|
162
|
-
linkKey,
|
|
163
|
-
linkState,
|
|
164
|
-
sourceScreenKey,
|
|
165
|
-
});
|
|
166
|
-
|
|
167
|
-
if (shouldWaitForEscapeClippingHost) {
|
|
190
|
+
if (linkComplete || action === "complete") {
|
|
191
|
+
cancelAnimation(retryToken);
|
|
192
|
+
handshakeRetries.set(0);
|
|
193
|
+
if (escapeClipping) {
|
|
168
194
|
// Screen-level escape has a second readiness phase after destination
|
|
169
|
-
//
|
|
195
|
+
// matching: the host must commit before the transition starts, or
|
|
170
196
|
// the payload can disappear for a frame.
|
|
171
197
|
return;
|
|
172
198
|
}
|
|
173
199
|
releaseLifecycleStartBlock();
|
|
174
|
-
viewportRetries.set(0);
|
|
175
200
|
return;
|
|
176
201
|
}
|
|
177
202
|
|
|
178
|
-
if (
|
|
203
|
+
if (handshakeRetries.get() >= MAX_HANDSHAKE_RETRIES) {
|
|
179
204
|
hasGivenUp.set(1);
|
|
180
205
|
releaseLifecycleStartBlock();
|
|
181
206
|
logger.warn(
|
|
182
|
-
`
|
|
207
|
+
`Boundary "${linkKey}" never formed a complete source/destination link after ${MAX_HANDSHAKE_RETRIES} attempts; releasing the transition gate without it. One side is likely off-viewport or unmounted.`,
|
|
183
208
|
);
|
|
184
209
|
return;
|
|
185
210
|
}
|
|
186
211
|
|
|
187
|
-
//
|
|
188
|
-
//
|
|
189
|
-
|
|
212
|
+
// Keep the lifecycle blocked while registration, measurement, or source
|
|
213
|
+
// attachment settles. The retry token also retries rejected destination bounds.
|
|
214
|
+
handshakeRetries.set(handshakeRetries.get() + 1);
|
|
190
215
|
cancelAnimation(retryToken);
|
|
191
216
|
retryToken.set(
|
|
192
217
|
withDelay(
|
|
193
|
-
|
|
218
|
+
HANDSHAKE_RETRY_DELAY_MS,
|
|
194
219
|
withTiming(retryToken.get() + 1, { duration: 0 }),
|
|
195
220
|
),
|
|
196
221
|
);
|