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
|
@@ -8,15 +8,17 @@ import {
|
|
|
8
8
|
} from "react-native-reanimated";
|
|
9
9
|
import { applyMeasuredBoundsWrites } from "../../../providers/helpers/measured-bounds-writes";
|
|
10
10
|
import { useOriginContext } from "../../../providers/screen/origin.provider";
|
|
11
|
+
import { useScreenSlots } from "../../../providers/screen/styles";
|
|
11
12
|
import type { BoundTag } from "../../../stores/bounds/types";
|
|
12
13
|
import { ScrollStore } from "../../../stores/scroll.store";
|
|
13
14
|
import { SystemStore } from "../../../stores/system.store";
|
|
15
|
+
import { getVisibilityBlockOffset } from "../../../utils/visibility-block-offset";
|
|
14
16
|
import type { MeasureBoundary } from "../types";
|
|
15
17
|
import {
|
|
16
18
|
attachScrollSnapshotToMeasuredBounds,
|
|
17
19
|
isMeasurementInViewport,
|
|
18
20
|
measureWithOverscrollAwareness,
|
|
19
|
-
|
|
21
|
+
normalizeMeasuredBoundsWithVisibilityGate,
|
|
20
22
|
} from "../utils/measured-bounds";
|
|
21
23
|
|
|
22
24
|
interface UseMeasurerParams {
|
|
@@ -48,6 +50,7 @@ export const useMeasurer = ({
|
|
|
48
50
|
"pendingLifecycleStartBlockCount",
|
|
49
51
|
);
|
|
50
52
|
const { originRef } = useOriginContext();
|
|
53
|
+
const { visibilityBlocked } = useScreenSlots();
|
|
51
54
|
|
|
52
55
|
return useCallback(
|
|
53
56
|
(target) => {
|
|
@@ -62,10 +65,14 @@ export const useMeasurer = ({
|
|
|
62
65
|
|
|
63
66
|
if (!measured || !measuredOrigin) return;
|
|
64
67
|
|
|
65
|
-
const normalizedMeasured =
|
|
68
|
+
const normalizedMeasured = normalizeMeasuredBoundsWithVisibilityGate({
|
|
66
69
|
measured,
|
|
67
|
-
measuredOrigin,
|
|
68
|
-
|
|
70
|
+
origin: measuredOrigin,
|
|
71
|
+
visibilityBlocked: escapeClipping && visibilityBlocked.get(),
|
|
72
|
+
visibilityBlockOffset: getVisibilityBlockOffset(viewportHeight),
|
|
73
|
+
viewportWidth,
|
|
74
|
+
viewportHeight,
|
|
75
|
+
});
|
|
69
76
|
|
|
70
77
|
/**
|
|
71
78
|
* - Destination Pass -
|
|
@@ -119,6 +126,7 @@ export const useMeasurer = ({
|
|
|
119
126
|
scrollMetadata,
|
|
120
127
|
pendingLifecycleStartBlockCount,
|
|
121
128
|
originRef,
|
|
129
|
+
visibilityBlocked,
|
|
122
130
|
],
|
|
123
131
|
);
|
|
124
132
|
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useLayoutEffect } from "react";
|
|
2
|
+
import type { View } from "react-native";
|
|
3
|
+
import type { AnimatedRef } from "react-native-reanimated";
|
|
4
|
+
import { logger } from "../../../utils/logger";
|
|
5
|
+
import {
|
|
6
|
+
TARGET_OUTSIDE_ROOT_WARNING,
|
|
7
|
+
useBoundaryRootContext,
|
|
8
|
+
} from "../providers/boundary-root.provider";
|
|
9
|
+
|
|
10
|
+
interface RegisterTargetProps {
|
|
11
|
+
targetAnimatedRef: AnimatedRef<View>;
|
|
12
|
+
preparedStyles: Record<string, any>;
|
|
13
|
+
measurementRef: AnimatedRef<View>;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const useRegisterTarget = ({
|
|
17
|
+
targetAnimatedRef,
|
|
18
|
+
preparedStyles,
|
|
19
|
+
measurementRef,
|
|
20
|
+
}: RegisterTargetProps) => {
|
|
21
|
+
const rootContext = useBoundaryRootContext();
|
|
22
|
+
const registerTargetRef = rootContext?.registerTargetRef;
|
|
23
|
+
const unregisterTargetRef = rootContext?.unregisterTargetRef;
|
|
24
|
+
useLayoutEffect(() => {
|
|
25
|
+
if (!registerTargetRef || !unregisterTargetRef) {
|
|
26
|
+
if (__DEV__) {
|
|
27
|
+
logger.warn(TARGET_OUTSIDE_ROOT_WARNING);
|
|
28
|
+
}
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
registerTargetRef(targetAnimatedRef, preparedStyles, measurementRef);
|
|
33
|
+
return () => {
|
|
34
|
+
unregisterTargetRef(targetAnimatedRef);
|
|
35
|
+
};
|
|
36
|
+
}, [
|
|
37
|
+
registerTargetRef,
|
|
38
|
+
unregisterTargetRef,
|
|
39
|
+
targetAnimatedRef,
|
|
40
|
+
preparedStyles,
|
|
41
|
+
measurementRef,
|
|
42
|
+
]);
|
|
43
|
+
};
|
|
@@ -53,7 +53,7 @@ type BoundaryRootComponent = typeof BoundaryRoot;
|
|
|
53
53
|
* Use:
|
|
54
54
|
* - `Boundary` for passive and pressable shared elements.
|
|
55
55
|
* - `Boundary.Target` to measure a nested descendant instead of the root.
|
|
56
|
-
* - `Boundary.Host` to make
|
|
56
|
+
* - `Boundary.Host` to make clipping-escape host placement explicit.
|
|
57
57
|
*/
|
|
58
58
|
export interface BoundaryComponent extends BoundaryRootComponent {
|
|
59
59
|
/**
|
|
@@ -61,7 +61,7 @@ export interface BoundaryComponent extends BoundaryRootComponent {
|
|
|
61
61
|
*/
|
|
62
62
|
Target: typeof BoundaryTarget;
|
|
63
63
|
/**
|
|
64
|
-
* Explicit
|
|
64
|
+
* Explicit host for clipping-escape placement.
|
|
65
65
|
*/
|
|
66
66
|
Host: typeof Host;
|
|
67
67
|
/**
|
package/src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { memo, type ReactNode } from "react";
|
|
2
|
+
import { StyleSheet } from "react-native";
|
|
3
|
+
import Animated from "react-native-reanimated";
|
|
4
|
+
import { NativePortalHost, PORTAL_POINTER_EVENTS } from "../../../teleport";
|
|
5
|
+
import { createBoundaryContentPortalHostName } from "../helpers/host-name";
|
|
6
|
+
|
|
7
|
+
const AnimatedPortalHost = NativePortalHost
|
|
8
|
+
? Animated.createAnimatedComponent(NativePortalHost)
|
|
9
|
+
: null;
|
|
10
|
+
|
|
11
|
+
type BoundaryContentPortalHostProps = {
|
|
12
|
+
boundaryId: string;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
screenKey: string;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const BoundaryContentPortalHost = memo(
|
|
19
|
+
function BoundaryContentPortalHost({
|
|
20
|
+
boundaryId,
|
|
21
|
+
children,
|
|
22
|
+
enabled,
|
|
23
|
+
screenKey,
|
|
24
|
+
}: BoundaryContentPortalHostProps) {
|
|
25
|
+
if (!enabled || !AnimatedPortalHost) {
|
|
26
|
+
return <>{children}</>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const portalHostName = createBoundaryContentPortalHostName(
|
|
30
|
+
screenKey,
|
|
31
|
+
boundaryId,
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return (
|
|
35
|
+
<>
|
|
36
|
+
{children}
|
|
37
|
+
<AnimatedPortalHost
|
|
38
|
+
name={portalHostName}
|
|
39
|
+
pointerEvents={PORTAL_POINTER_EVENTS}
|
|
40
|
+
style={styles.host}
|
|
41
|
+
/>
|
|
42
|
+
</>
|
|
43
|
+
);
|
|
44
|
+
},
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
const styles = StyleSheet.create({
|
|
48
|
+
host: {
|
|
49
|
+
...StyleSheet.absoluteFillObject,
|
|
50
|
+
overflow: "visible",
|
|
51
|
+
},
|
|
52
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const BOUNDARY_CONTENT_PORTAL_HOST_NAME_SUFFIX = "-content-portal-host";
|
|
2
|
+
|
|
3
|
+
export const createBoundaryContentPortalHostName = (
|
|
4
|
+
screenKey: string,
|
|
5
|
+
boundaryId: string,
|
|
6
|
+
) => {
|
|
7
|
+
"worklet";
|
|
8
|
+
return `${screenKey}-${boundaryId}${BOUNDARY_CONTENT_PORTAL_HOST_NAME_SUFFIX}`;
|
|
9
|
+
};
|
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
import { useCallback, useLayoutEffect, useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
runOnJS,
|
|
4
|
+
useAnimatedProps,
|
|
5
|
+
useAnimatedReaction,
|
|
6
|
+
useSharedValue,
|
|
7
|
+
} from "react-native-reanimated";
|
|
8
|
+
import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
|
|
9
|
+
import { useScreenSlots } from "../../../../../../providers/screen/styles";
|
|
10
|
+
import { useRegisteredScreenSlots } from "../../../../../../providers/screen/styles/stores/slot-references.store";
|
|
11
|
+
import { AnimationStore } from "../../../../../../stores/animation.store";
|
|
12
|
+
import { getSourceScreenKeyFromPairKey } from "../../../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
13
|
+
import { pairs } from "../../../../../../stores/bounds/internals/state";
|
|
14
|
+
import { PORTAL_HOST_NAME_RESET_VALUE } from "../../../utils/naming";
|
|
15
|
+
import {
|
|
16
|
+
canSwitchHandoffHostImmediately,
|
|
17
|
+
isHandoffHostClosingComplete,
|
|
18
|
+
type PortalOwnershipSignal,
|
|
19
|
+
resolveBoundaryPortalOwnership,
|
|
20
|
+
} from "../../../utils/ownership";
|
|
21
|
+
import { shallowEqual } from "../../../utils/shallow-equal";
|
|
22
|
+
import { shouldAttachBoundaryPortal } from "../../../utils/teleport-control";
|
|
23
|
+
import { resolveNextVisiblePortalHostName } from "../../../utils/visible-host";
|
|
24
|
+
import { createBoundaryContentPortalHostName } from "../helpers/host-name";
|
|
25
|
+
|
|
26
|
+
interface UseBoundaryContentPortalAttachmentParams {
|
|
27
|
+
boundaryId: string;
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export const useBoundaryContentPortalAttachment = ({
|
|
32
|
+
boundaryId,
|
|
33
|
+
enabled,
|
|
34
|
+
}: UseBoundaryContentPortalAttachmentParams) => {
|
|
35
|
+
const ownScreenSlots = useScreenSlots();
|
|
36
|
+
const sourcePairKey = useDescriptorsStore((s) => s.derivations.sourcePairKey);
|
|
37
|
+
const currentScreenKey = useDescriptorsStore(
|
|
38
|
+
(s) => s.derivations.currentScreenKey,
|
|
39
|
+
);
|
|
40
|
+
const [ownership, setOwnership] = useState<Extract<
|
|
41
|
+
PortalOwnershipSignal,
|
|
42
|
+
{ status: "complete" }
|
|
43
|
+
> | null>(null);
|
|
44
|
+
|
|
45
|
+
const styleOwnerScreenKey = ownership?.ownerScreenKey ?? currentScreenKey;
|
|
46
|
+
const ownerScreenSlots = useRegisteredScreenSlots(styleOwnerScreenKey);
|
|
47
|
+
const activeScreenSlots = ownerScreenSlots ?? ownScreenSlots;
|
|
48
|
+
const {
|
|
49
|
+
nextInterpolatorReady: activeNextInterpolatorReady,
|
|
50
|
+
slotsMap: activeSlotsMap,
|
|
51
|
+
} = activeScreenSlots;
|
|
52
|
+
const requestedPortalHostName = useSharedValue<string | null>(null);
|
|
53
|
+
const visiblePortalHostName = useSharedValue<string | null>(null);
|
|
54
|
+
const canSwitchPortalHostImmediately = useSharedValue(0);
|
|
55
|
+
|
|
56
|
+
const targetScreenKey = ownership ? ownership.hostScreenKey : null;
|
|
57
|
+
const settledHostScreenKey = ownership?.hostScreenKey ?? null;
|
|
58
|
+
const settledHostProgress = AnimationStore.getValue(
|
|
59
|
+
settledHostScreenKey ?? currentScreenKey,
|
|
60
|
+
"progressSettled",
|
|
61
|
+
);
|
|
62
|
+
const settledHostAnimating = AnimationStore.getValue(
|
|
63
|
+
settledHostScreenKey ?? currentScreenKey,
|
|
64
|
+
"progressAnimating",
|
|
65
|
+
);
|
|
66
|
+
const settledHostWillAnimate = AnimationStore.getValue(
|
|
67
|
+
settledHostScreenKey ?? currentScreenKey,
|
|
68
|
+
"willAnimate",
|
|
69
|
+
);
|
|
70
|
+
const settledHostClosing = AnimationStore.getValue(
|
|
71
|
+
settledHostScreenKey ?? currentScreenKey,
|
|
72
|
+
"closing",
|
|
73
|
+
);
|
|
74
|
+
const handoffHostName =
|
|
75
|
+
targetScreenKey !== null
|
|
76
|
+
? createBoundaryContentPortalHostName(targetScreenKey, boundaryId)
|
|
77
|
+
: null;
|
|
78
|
+
|
|
79
|
+
const updatePortalOwnership = useCallback(
|
|
80
|
+
(
|
|
81
|
+
hostScreenKey: string | null,
|
|
82
|
+
ownerPairKey?: string,
|
|
83
|
+
ownerScreenKey?: string,
|
|
84
|
+
) => {
|
|
85
|
+
if (hostScreenKey && ownerPairKey && ownerScreenKey) {
|
|
86
|
+
setOwnership((current) => {
|
|
87
|
+
if (
|
|
88
|
+
current?.hostScreenKey === hostScreenKey &&
|
|
89
|
+
current.ownerPairKey === ownerPairKey &&
|
|
90
|
+
current.ownerScreenKey === ownerScreenKey
|
|
91
|
+
) {
|
|
92
|
+
return current;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return {
|
|
96
|
+
hostScreenKey,
|
|
97
|
+
ownerPairKey,
|
|
98
|
+
ownerScreenKey,
|
|
99
|
+
status: "complete",
|
|
100
|
+
};
|
|
101
|
+
});
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
setOwnership((current) => (current ? null : current));
|
|
106
|
+
},
|
|
107
|
+
[],
|
|
108
|
+
);
|
|
109
|
+
|
|
110
|
+
useLayoutEffect(() => {
|
|
111
|
+
if (!enabled || !ownership || !handoffHostName) {
|
|
112
|
+
requestedPortalHostName.set(null);
|
|
113
|
+
visiblePortalHostName.set(null);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
requestedPortalHostName.set(handoffHostName);
|
|
118
|
+
}, [
|
|
119
|
+
enabled,
|
|
120
|
+
handoffHostName,
|
|
121
|
+
ownership,
|
|
122
|
+
requestedPortalHostName,
|
|
123
|
+
visiblePortalHostName,
|
|
124
|
+
]);
|
|
125
|
+
|
|
126
|
+
useLayoutEffect(() => {
|
|
127
|
+
return () => {
|
|
128
|
+
requestedPortalHostName.set(null);
|
|
129
|
+
visiblePortalHostName.set(null);
|
|
130
|
+
};
|
|
131
|
+
}, [requestedPortalHostName, visiblePortalHostName]);
|
|
132
|
+
|
|
133
|
+
useAnimatedReaction(
|
|
134
|
+
() => {
|
|
135
|
+
"worklet";
|
|
136
|
+
if (!enabled) {
|
|
137
|
+
return {
|
|
138
|
+
hostScreenKey: null,
|
|
139
|
+
ownerPairKey: sourcePairKey,
|
|
140
|
+
ownerScreenKey: null,
|
|
141
|
+
status: "clear",
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const progressAnimating = settledHostAnimating.get();
|
|
146
|
+
const progressSettled = settledHostProgress.get();
|
|
147
|
+
const willAnimate = settledHostWillAnimate.get();
|
|
148
|
+
const closing = settledHostClosing.get();
|
|
149
|
+
const isOwnedHostClosing =
|
|
150
|
+
!!closing &&
|
|
151
|
+
!!ownership &&
|
|
152
|
+
settledHostScreenKey === ownership.hostScreenKey;
|
|
153
|
+
|
|
154
|
+
if (isOwnedHostClosing && ownership) {
|
|
155
|
+
const isClosingComplete = isHandoffHostClosingComplete({
|
|
156
|
+
closing,
|
|
157
|
+
progressAnimating,
|
|
158
|
+
progressSettled,
|
|
159
|
+
willAnimate,
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
if (!isClosingComplete) {
|
|
163
|
+
return ownership;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const sourceScreenKey = getSourceScreenKeyFromPairKey(
|
|
167
|
+
ownership.ownerPairKey,
|
|
168
|
+
);
|
|
169
|
+
|
|
170
|
+
return {
|
|
171
|
+
hostScreenKey: sourceScreenKey,
|
|
172
|
+
ownerPairKey: ownership.ownerPairKey,
|
|
173
|
+
ownerScreenKey: sourceScreenKey,
|
|
174
|
+
status: "complete",
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if (!sourcePairKey) {
|
|
179
|
+
return {
|
|
180
|
+
hostScreenKey: null,
|
|
181
|
+
ownerPairKey: sourcePairKey,
|
|
182
|
+
ownerScreenKey: null,
|
|
183
|
+
status: "clear",
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return resolveBoundaryPortalOwnership({
|
|
188
|
+
boundaryId,
|
|
189
|
+
currentScreenKey,
|
|
190
|
+
handoff: true,
|
|
191
|
+
isSettledHostClosingComplete: isHandoffHostClosingComplete({
|
|
192
|
+
closing,
|
|
193
|
+
progressAnimating,
|
|
194
|
+
progressSettled,
|
|
195
|
+
willAnimate,
|
|
196
|
+
}),
|
|
197
|
+
isSettledHostReady: progressSettled === 1 && progressAnimating === 0,
|
|
198
|
+
pairsState: pairs.get(),
|
|
199
|
+
settledHostScreenKey,
|
|
200
|
+
sourcePairKey,
|
|
201
|
+
});
|
|
202
|
+
},
|
|
203
|
+
(signal, previousSignal) => {
|
|
204
|
+
"worklet";
|
|
205
|
+
if (shallowEqual(previousSignal, signal)) {
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (signal.status === "pending") {
|
|
210
|
+
canSwitchPortalHostImmediately.set(0);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const hostScreenKey =
|
|
215
|
+
signal.status === "complete" ? signal.hostScreenKey : null;
|
|
216
|
+
let previousOwnerPairKey: string | undefined;
|
|
217
|
+
|
|
218
|
+
if (previousSignal?.status === "complete") {
|
|
219
|
+
previousOwnerPairKey = previousSignal.ownerPairKey ?? undefined;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
const canSwitchImmediately = canSwitchHandoffHostImmediately({
|
|
223
|
+
hostScreenKey,
|
|
224
|
+
ownerPairKey:
|
|
225
|
+
signal.status === "complete" ? signal.ownerPairKey : undefined,
|
|
226
|
+
previousOwnerPairKey,
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
canSwitchPortalHostImmediately.set(canSwitchImmediately ? 1 : 0);
|
|
230
|
+
|
|
231
|
+
if (canSwitchImmediately && hostScreenKey) {
|
|
232
|
+
const hostName = createBoundaryContentPortalHostName(
|
|
233
|
+
hostScreenKey,
|
|
234
|
+
boundaryId,
|
|
235
|
+
);
|
|
236
|
+
requestedPortalHostName.set(hostName);
|
|
237
|
+
visiblePortalHostName.set(hostName);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
runOnJS(updatePortalOwnership)(
|
|
241
|
+
signal.hostScreenKey,
|
|
242
|
+
signal.ownerPairKey,
|
|
243
|
+
signal.ownerScreenKey ?? undefined,
|
|
244
|
+
);
|
|
245
|
+
},
|
|
246
|
+
);
|
|
247
|
+
|
|
248
|
+
useAnimatedReaction(
|
|
249
|
+
() => {
|
|
250
|
+
"worklet";
|
|
251
|
+
const slot = activeSlotsMap.get()[boundaryId];
|
|
252
|
+
const teleport = slot?.props?.teleport;
|
|
253
|
+
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
254
|
+
enabled,
|
|
255
|
+
teleport,
|
|
256
|
+
});
|
|
257
|
+
const requestedName = requestedPortalHostName.get();
|
|
258
|
+
const visibleName = visiblePortalHostName.get();
|
|
259
|
+
const isInterpolatorReady = activeNextInterpolatorReady.get();
|
|
260
|
+
const nextVisibleName = resolveNextVisiblePortalHostName({
|
|
261
|
+
canSwitchImmediately: canSwitchPortalHostImmediately.get() === 1,
|
|
262
|
+
isInterpolatorReady: isInterpolatorReady === 1,
|
|
263
|
+
requestedName,
|
|
264
|
+
shouldTeleport,
|
|
265
|
+
visibleName,
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
return {
|
|
269
|
+
isInterpolatorReady,
|
|
270
|
+
nextVisibleName,
|
|
271
|
+
requestedName,
|
|
272
|
+
shouldTeleport,
|
|
273
|
+
teleport,
|
|
274
|
+
visibleName,
|
|
275
|
+
};
|
|
276
|
+
},
|
|
277
|
+
(state, previousState) => {
|
|
278
|
+
"worklet";
|
|
279
|
+
if (shallowEqual(previousState, state)) {
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if (state.nextVisibleName !== state.visibleName) {
|
|
284
|
+
visiblePortalHostName.set(state.nextVisibleName);
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
);
|
|
288
|
+
|
|
289
|
+
const teleportProps = useAnimatedProps(() => {
|
|
290
|
+
"worklet";
|
|
291
|
+
|
|
292
|
+
const slot = activeSlotsMap.get()[boundaryId];
|
|
293
|
+
const {
|
|
294
|
+
pointerEvents: _pointerEvents,
|
|
295
|
+
teleport,
|
|
296
|
+
...slotProps
|
|
297
|
+
} = slot?.props ?? {};
|
|
298
|
+
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
299
|
+
enabled,
|
|
300
|
+
teleport,
|
|
301
|
+
});
|
|
302
|
+
const visibleName = visiblePortalHostName.get();
|
|
303
|
+
|
|
304
|
+
return {
|
|
305
|
+
...slotProps,
|
|
306
|
+
hostName:
|
|
307
|
+
shouldTeleport && visibleName
|
|
308
|
+
? visibleName
|
|
309
|
+
: PORTAL_HOST_NAME_RESET_VALUE,
|
|
310
|
+
};
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
return {
|
|
314
|
+
teleportProps,
|
|
315
|
+
visiblePortalHostName,
|
|
316
|
+
};
|
|
317
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ComponentProps,
|
|
3
|
+
type ComponentType,
|
|
4
|
+
memo,
|
|
5
|
+
type ReactNode,
|
|
6
|
+
} from "react";
|
|
7
|
+
import { StyleSheet } from "react-native";
|
|
8
|
+
import Animated from "react-native-reanimated";
|
|
9
|
+
import {
|
|
10
|
+
isTeleportAvailable,
|
|
11
|
+
NativePortal,
|
|
12
|
+
PORTAL_POINTER_EVENTS,
|
|
13
|
+
} from "../../teleport";
|
|
14
|
+
import { useBoundaryContentPortalAttachment } from "./hooks/use-boundary-content-portal-attachment";
|
|
15
|
+
|
|
16
|
+
export { BoundaryContentPortalHost } from "./components/host";
|
|
17
|
+
|
|
18
|
+
type BoundaryContentPortalProps = {
|
|
19
|
+
boundaryId?: string;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
enabled: boolean;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
type NullableHostNamePortalProps = Omit<
|
|
25
|
+
ComponentProps<NonNullable<typeof NativePortal>>,
|
|
26
|
+
"hostName"
|
|
27
|
+
> & {
|
|
28
|
+
hostName?: string | null;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const AnimatedNativePortal = NativePortal
|
|
32
|
+
? Animated.createAnimatedComponent(
|
|
33
|
+
NativePortal as ComponentType<NullableHostNamePortalProps>,
|
|
34
|
+
)
|
|
35
|
+
: null;
|
|
36
|
+
|
|
37
|
+
export const BoundaryContentPortal = memo(function BoundaryContentPortal({
|
|
38
|
+
boundaryId,
|
|
39
|
+
children,
|
|
40
|
+
enabled,
|
|
41
|
+
}: BoundaryContentPortalProps) {
|
|
42
|
+
const shouldEnablePortal = enabled && boundaryId !== undefined;
|
|
43
|
+
const { teleportProps } = useBoundaryContentPortalAttachment({
|
|
44
|
+
boundaryId: boundaryId ?? "",
|
|
45
|
+
enabled: shouldEnablePortal,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
if (shouldEnablePortal && isTeleportAvailable && AnimatedNativePortal) {
|
|
49
|
+
return (
|
|
50
|
+
<AnimatedNativePortal
|
|
51
|
+
animatedProps={teleportProps}
|
|
52
|
+
name={boundaryId}
|
|
53
|
+
pointerEvents={PORTAL_POINTER_EVENTS}
|
|
54
|
+
style={StyleSheet.absoluteFill}
|
|
55
|
+
>
|
|
56
|
+
{children}
|
|
57
|
+
</AnimatedNativePortal>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return children;
|
|
62
|
+
});
|
|
@@ -7,8 +7,10 @@ import {
|
|
|
7
7
|
type ViewStyle,
|
|
8
8
|
} from "react-native";
|
|
9
9
|
import Animated from "react-native-reanimated";
|
|
10
|
-
import { useDescriptorsStore } from "
|
|
11
|
-
import {
|
|
10
|
+
import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
|
|
11
|
+
import { useScreenSlots } from "../../../../../../providers/screen/styles";
|
|
12
|
+
import { SystemStore } from "../../../../../../stores/system.store";
|
|
13
|
+
import { PORTAL_POINTER_EVENTS } from "../../../teleport";
|
|
12
14
|
import { useHostMeasurement } from "../hooks/use-host-measurement";
|
|
13
15
|
import { registerHost, unregisterHost } from "../stores/host-registry.store";
|
|
14
16
|
import { useActivePortalBoundaryHosts } from "../stores/portal-boundary-host.store";
|
|
@@ -26,7 +28,7 @@ type HostImplProps = PublicHostProps & {
|
|
|
26
28
|
|
|
27
29
|
function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
28
30
|
const screenKey = useDescriptorsStore((s) => s.derivations.currentScreenKey);
|
|
29
|
-
const {
|
|
31
|
+
const { unblockLifecycleStart } = SystemStore.getBag(screenKey).actions;
|
|
30
32
|
const generatedHostKeyRef = useRef<string | null>(null);
|
|
31
33
|
|
|
32
34
|
if (generatedHostKeyRef.current === null) {
|
|
@@ -36,6 +38,7 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
|
36
38
|
const hostKey = fallback ? screenKey : generatedHostKeyRef.current;
|
|
37
39
|
const capturesScroll = !fallback;
|
|
38
40
|
const activeBoundaryHosts = useActivePortalBoundaryHosts(hostKey);
|
|
41
|
+
const { visibilityBlocked } = useScreenSlots();
|
|
39
42
|
const { height: viewportHeight, width: viewportWidth } =
|
|
40
43
|
useWindowDimensions();
|
|
41
44
|
|
|
@@ -44,6 +47,9 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
|
44
47
|
enabled: activeBoundaryHosts.length > 0,
|
|
45
48
|
hostKey,
|
|
46
49
|
screenKey,
|
|
50
|
+
visibilityBlocked,
|
|
51
|
+
viewportHeight,
|
|
52
|
+
viewportWidth,
|
|
47
53
|
});
|
|
48
54
|
|
|
49
55
|
useLayoutEffect(() => {
|
|
@@ -60,27 +66,21 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
|
60
66
|
}, [capturesScroll, fallback, hostKey, screenKey]);
|
|
61
67
|
|
|
62
68
|
const handleUnblocking = useCallback(() => {
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
drainLifecycleStartBlocks();
|
|
68
|
-
}, [drainLifecycleStartBlocks]);
|
|
69
|
+
// Each destination boundary contributes one lifecycle start block. Release
|
|
70
|
+
// only this host's block so unrelated boundary and user blocks stay intact.
|
|
71
|
+
unblockLifecycleStart();
|
|
72
|
+
}, [unblockLifecycleStart]);
|
|
69
73
|
|
|
70
74
|
const boundaryHosts = measurement.canRenderHosts
|
|
71
|
-
? activeBoundaryHosts.map((host
|
|
75
|
+
? activeBoundaryHosts.map((host) => (
|
|
72
76
|
<View
|
|
73
77
|
key={host.portalHostName}
|
|
74
|
-
pointerEvents=
|
|
78
|
+
pointerEvents={PORTAL_POINTER_EVENTS}
|
|
75
79
|
style={[
|
|
76
80
|
styles.boundaryHostViewport,
|
|
77
81
|
{ width: viewportWidth, height: viewportHeight },
|
|
78
82
|
]}
|
|
79
|
-
onLayout={
|
|
80
|
-
if (list.length - 1 === idx) {
|
|
81
|
-
handleUnblocking();
|
|
82
|
-
}
|
|
83
|
-
}}
|
|
83
|
+
onLayout={handleUnblocking}
|
|
84
84
|
>
|
|
85
85
|
<PortalBoundaryHost host={host} style={StyleSheet.absoluteFill} />
|
|
86
86
|
</View>
|
|
@@ -90,7 +90,7 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
|
90
90
|
return (
|
|
91
91
|
<Animated.View
|
|
92
92
|
ref={measurement.hostRef}
|
|
93
|
-
pointerEvents=
|
|
93
|
+
pointerEvents={PORTAL_POINTER_EVENTS}
|
|
94
94
|
style={[
|
|
95
95
|
styles.host,
|
|
96
96
|
{ width: viewportWidth, height: viewportHeight },
|