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
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useLayoutEffect, useState } from "react";
|
|
4
|
+
import { runOnJS, useAnimatedProps, useAnimatedReaction, useSharedValue } from "react-native-reanimated";
|
|
5
|
+
import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
|
|
6
|
+
import { useScreenSlots } from "../../../../../../providers/screen/styles";
|
|
7
|
+
import { useRegisteredScreenSlots } from "../../../../../../providers/screen/styles/stores/slot-references.store";
|
|
8
|
+
import { AnimationStore } from "../../../../../../stores/animation.store";
|
|
9
|
+
import { getSourceScreenKeyFromPairKey } from "../../../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
10
|
+
import { pairs } from "../../../../../../stores/bounds/internals/state";
|
|
11
|
+
import { PORTAL_HOST_NAME_RESET_VALUE } from "../../../utils/naming";
|
|
12
|
+
import { canSwitchHandoffHostImmediately, isHandoffHostClosingComplete, resolveBoundaryPortalOwnership } from "../../../utils/ownership";
|
|
13
|
+
import { shallowEqual } from "../../../utils/shallow-equal";
|
|
14
|
+
import { shouldAttachBoundaryPortal } from "../../../utils/teleport-control";
|
|
15
|
+
import { resolveNextVisiblePortalHostName } from "../../../utils/visible-host";
|
|
16
|
+
import { createBoundaryContentPortalHostName } from "../helpers/host-name";
|
|
17
|
+
export const useBoundaryContentPortalAttachment = ({
|
|
18
|
+
boundaryId,
|
|
19
|
+
enabled
|
|
20
|
+
}) => {
|
|
21
|
+
const ownScreenSlots = useScreenSlots();
|
|
22
|
+
const sourcePairKey = useDescriptorsStore(s => s.derivations.sourcePairKey);
|
|
23
|
+
const currentScreenKey = useDescriptorsStore(s => s.derivations.currentScreenKey);
|
|
24
|
+
const [ownership, setOwnership] = useState(null);
|
|
25
|
+
const styleOwnerScreenKey = ownership?.ownerScreenKey ?? currentScreenKey;
|
|
26
|
+
const ownerScreenSlots = useRegisteredScreenSlots(styleOwnerScreenKey);
|
|
27
|
+
const activeScreenSlots = ownerScreenSlots ?? ownScreenSlots;
|
|
28
|
+
const {
|
|
29
|
+
nextInterpolatorReady: activeNextInterpolatorReady,
|
|
30
|
+
slotsMap: activeSlotsMap
|
|
31
|
+
} = activeScreenSlots;
|
|
32
|
+
const requestedPortalHostName = useSharedValue(null);
|
|
33
|
+
const visiblePortalHostName = useSharedValue(null);
|
|
34
|
+
const canSwitchPortalHostImmediately = useSharedValue(0);
|
|
35
|
+
const targetScreenKey = ownership ? ownership.hostScreenKey : null;
|
|
36
|
+
const settledHostScreenKey = ownership?.hostScreenKey ?? null;
|
|
37
|
+
const settledHostProgress = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "progressSettled");
|
|
38
|
+
const settledHostAnimating = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "progressAnimating");
|
|
39
|
+
const settledHostWillAnimate = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "willAnimate");
|
|
40
|
+
const settledHostClosing = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "closing");
|
|
41
|
+
const handoffHostName = targetScreenKey !== null ? createBoundaryContentPortalHostName(targetScreenKey, boundaryId) : null;
|
|
42
|
+
const updatePortalOwnership = useCallback((hostScreenKey, ownerPairKey, ownerScreenKey) => {
|
|
43
|
+
if (hostScreenKey && ownerPairKey && ownerScreenKey) {
|
|
44
|
+
setOwnership(current => {
|
|
45
|
+
if (current?.hostScreenKey === hostScreenKey && current.ownerPairKey === ownerPairKey && current.ownerScreenKey === ownerScreenKey) {
|
|
46
|
+
return current;
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
hostScreenKey,
|
|
50
|
+
ownerPairKey,
|
|
51
|
+
ownerScreenKey,
|
|
52
|
+
status: "complete"
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
setOwnership(current => current ? null : current);
|
|
58
|
+
}, []);
|
|
59
|
+
useLayoutEffect(() => {
|
|
60
|
+
if (!enabled || !ownership || !handoffHostName) {
|
|
61
|
+
requestedPortalHostName.set(null);
|
|
62
|
+
visiblePortalHostName.set(null);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
requestedPortalHostName.set(handoffHostName);
|
|
66
|
+
}, [enabled, handoffHostName, ownership, requestedPortalHostName, visiblePortalHostName]);
|
|
67
|
+
useLayoutEffect(() => {
|
|
68
|
+
return () => {
|
|
69
|
+
requestedPortalHostName.set(null);
|
|
70
|
+
visiblePortalHostName.set(null);
|
|
71
|
+
};
|
|
72
|
+
}, [requestedPortalHostName, visiblePortalHostName]);
|
|
73
|
+
useAnimatedReaction(() => {
|
|
74
|
+
"worklet";
|
|
75
|
+
|
|
76
|
+
if (!enabled) {
|
|
77
|
+
return {
|
|
78
|
+
hostScreenKey: null,
|
|
79
|
+
ownerPairKey: sourcePairKey,
|
|
80
|
+
ownerScreenKey: null,
|
|
81
|
+
status: "clear"
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const progressAnimating = settledHostAnimating.get();
|
|
85
|
+
const progressSettled = settledHostProgress.get();
|
|
86
|
+
const willAnimate = settledHostWillAnimate.get();
|
|
87
|
+
const closing = settledHostClosing.get();
|
|
88
|
+
const isOwnedHostClosing = !!closing && !!ownership && settledHostScreenKey === ownership.hostScreenKey;
|
|
89
|
+
if (isOwnedHostClosing && ownership) {
|
|
90
|
+
const isClosingComplete = isHandoffHostClosingComplete({
|
|
91
|
+
closing,
|
|
92
|
+
progressAnimating,
|
|
93
|
+
progressSettled,
|
|
94
|
+
willAnimate
|
|
95
|
+
});
|
|
96
|
+
if (!isClosingComplete) {
|
|
97
|
+
return ownership;
|
|
98
|
+
}
|
|
99
|
+
const sourceScreenKey = getSourceScreenKeyFromPairKey(ownership.ownerPairKey);
|
|
100
|
+
return {
|
|
101
|
+
hostScreenKey: sourceScreenKey,
|
|
102
|
+
ownerPairKey: ownership.ownerPairKey,
|
|
103
|
+
ownerScreenKey: sourceScreenKey,
|
|
104
|
+
status: "complete"
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
if (!sourcePairKey) {
|
|
108
|
+
return {
|
|
109
|
+
hostScreenKey: null,
|
|
110
|
+
ownerPairKey: sourcePairKey,
|
|
111
|
+
ownerScreenKey: null,
|
|
112
|
+
status: "clear"
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
return resolveBoundaryPortalOwnership({
|
|
116
|
+
boundaryId,
|
|
117
|
+
currentScreenKey,
|
|
118
|
+
handoff: true,
|
|
119
|
+
isSettledHostClosingComplete: isHandoffHostClosingComplete({
|
|
120
|
+
closing,
|
|
121
|
+
progressAnimating,
|
|
122
|
+
progressSettled,
|
|
123
|
+
willAnimate
|
|
124
|
+
}),
|
|
125
|
+
isSettledHostReady: progressSettled === 1 && progressAnimating === 0,
|
|
126
|
+
pairsState: pairs.get(),
|
|
127
|
+
settledHostScreenKey,
|
|
128
|
+
sourcePairKey
|
|
129
|
+
});
|
|
130
|
+
}, (signal, previousSignal) => {
|
|
131
|
+
"worklet";
|
|
132
|
+
|
|
133
|
+
if (shallowEqual(previousSignal, signal)) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (signal.status === "pending") {
|
|
137
|
+
canSwitchPortalHostImmediately.set(0);
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const hostScreenKey = signal.status === "complete" ? signal.hostScreenKey : null;
|
|
141
|
+
let previousOwnerPairKey;
|
|
142
|
+
if (previousSignal?.status === "complete") {
|
|
143
|
+
previousOwnerPairKey = previousSignal.ownerPairKey ?? undefined;
|
|
144
|
+
}
|
|
145
|
+
const canSwitchImmediately = canSwitchHandoffHostImmediately({
|
|
146
|
+
hostScreenKey,
|
|
147
|
+
ownerPairKey: signal.status === "complete" ? signal.ownerPairKey : undefined,
|
|
148
|
+
previousOwnerPairKey
|
|
149
|
+
});
|
|
150
|
+
canSwitchPortalHostImmediately.set(canSwitchImmediately ? 1 : 0);
|
|
151
|
+
if (canSwitchImmediately && hostScreenKey) {
|
|
152
|
+
const hostName = createBoundaryContentPortalHostName(hostScreenKey, boundaryId);
|
|
153
|
+
requestedPortalHostName.set(hostName);
|
|
154
|
+
visiblePortalHostName.set(hostName);
|
|
155
|
+
}
|
|
156
|
+
runOnJS(updatePortalOwnership)(signal.hostScreenKey, signal.ownerPairKey, signal.ownerScreenKey ?? undefined);
|
|
157
|
+
});
|
|
158
|
+
useAnimatedReaction(() => {
|
|
159
|
+
"worklet";
|
|
160
|
+
|
|
161
|
+
const slot = activeSlotsMap.get()[boundaryId];
|
|
162
|
+
const teleport = slot?.props?.teleport;
|
|
163
|
+
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
164
|
+
enabled,
|
|
165
|
+
teleport
|
|
166
|
+
});
|
|
167
|
+
const requestedName = requestedPortalHostName.get();
|
|
168
|
+
const visibleName = visiblePortalHostName.get();
|
|
169
|
+
const isInterpolatorReady = activeNextInterpolatorReady.get();
|
|
170
|
+
const nextVisibleName = resolveNextVisiblePortalHostName({
|
|
171
|
+
canSwitchImmediately: canSwitchPortalHostImmediately.get() === 1,
|
|
172
|
+
isInterpolatorReady: isInterpolatorReady === 1,
|
|
173
|
+
requestedName,
|
|
174
|
+
shouldTeleport,
|
|
175
|
+
visibleName
|
|
176
|
+
});
|
|
177
|
+
return {
|
|
178
|
+
isInterpolatorReady,
|
|
179
|
+
nextVisibleName,
|
|
180
|
+
requestedName,
|
|
181
|
+
shouldTeleport,
|
|
182
|
+
teleport,
|
|
183
|
+
visibleName
|
|
184
|
+
};
|
|
185
|
+
}, (state, previousState) => {
|
|
186
|
+
"worklet";
|
|
187
|
+
|
|
188
|
+
if (shallowEqual(previousState, state)) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (state.nextVisibleName !== state.visibleName) {
|
|
192
|
+
visiblePortalHostName.set(state.nextVisibleName);
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
const teleportProps = useAnimatedProps(() => {
|
|
196
|
+
"worklet";
|
|
197
|
+
|
|
198
|
+
const slot = activeSlotsMap.get()[boundaryId];
|
|
199
|
+
const {
|
|
200
|
+
pointerEvents: _pointerEvents,
|
|
201
|
+
teleport,
|
|
202
|
+
...slotProps
|
|
203
|
+
} = slot?.props ?? {};
|
|
204
|
+
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
205
|
+
enabled,
|
|
206
|
+
teleport
|
|
207
|
+
});
|
|
208
|
+
const visibleName = visiblePortalHostName.get();
|
|
209
|
+
return {
|
|
210
|
+
...slotProps,
|
|
211
|
+
hostName: shouldTeleport && visibleName ? visibleName : PORTAL_HOST_NAME_RESET_VALUE
|
|
212
|
+
};
|
|
213
|
+
});
|
|
214
|
+
return {
|
|
215
|
+
teleportProps,
|
|
216
|
+
visiblePortalHostName
|
|
217
|
+
};
|
|
218
|
+
};
|
|
219
|
+
//# sourceMappingURL=use-boundary-content-portal-attachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useLayoutEffect","useState","runOnJS","useAnimatedProps","useAnimatedReaction","useSharedValue","useDescriptorsStore","useScreenSlots","useRegisteredScreenSlots","AnimationStore","getSourceScreenKeyFromPairKey","pairs","PORTAL_HOST_NAME_RESET_VALUE","canSwitchHandoffHostImmediately","isHandoffHostClosingComplete","resolveBoundaryPortalOwnership","shallowEqual","shouldAttachBoundaryPortal","resolveNextVisiblePortalHostName","createBoundaryContentPortalHostName","useBoundaryContentPortalAttachment","boundaryId","enabled","ownScreenSlots","sourcePairKey","s","derivations","currentScreenKey","ownership","setOwnership","styleOwnerScreenKey","ownerScreenKey","ownerScreenSlots","activeScreenSlots","nextInterpolatorReady","activeNextInterpolatorReady","slotsMap","activeSlotsMap","requestedPortalHostName","visiblePortalHostName","canSwitchPortalHostImmediately","targetScreenKey","hostScreenKey","settledHostScreenKey","settledHostProgress","getValue","settledHostAnimating","settledHostWillAnimate","settledHostClosing","handoffHostName","updatePortalOwnership","ownerPairKey","current","status","set","progressAnimating","get","progressSettled","willAnimate","closing","isOwnedHostClosing","isClosingComplete","sourceScreenKey","handoff","isSettledHostClosingComplete","isSettledHostReady","pairsState","signal","previousSignal","previousOwnerPairKey","undefined","canSwitchImmediately","hostName","slot","teleport","props","shouldTeleport","requestedName","visibleName","isInterpolatorReady","nextVisibleName","state","previousState","teleportProps","pointerEvents","_pointerEvents","slotProps"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,eAAe,EAAEC,QAAQ,QAAQ,OAAO;AAC9D,SACCC,OAAO,EACPC,gBAAgB,EAChBC,mBAAmB,EACnBC,cAAc,QACR,yBAAyB;AAChC,SAASC,mBAAmB,QAAQ,gDAAgD;AACpF,SAASC,cAAc,QAAQ,2CAA2C;AAC1E,SAASC,wBAAwB,QAAQ,wEAAwE;AACjH,SAASC,cAAc,QAAQ,0CAA0C;AACzE,SAASC,6BAA6B,QAAQ,4DAA4D;AAC1G,SAASC,KAAK,QAAQ,iDAAiD;AACvE,SAASC,4BAA4B,QAAQ,uBAAuB;AACpE,SACCC,+BAA+B,EAC/BC,4BAA4B,EAE5BC,8BAA8B,QACxB,0BAA0B;AACjC,SAASC,YAAY,QAAQ,8BAA8B;AAC3D,SAASC,0BAA0B,QAAQ,iCAAiC;AAC5E,SAASC,gCAAgC,QAAQ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qB,CAACe,GAAG,CAAC2B,KAAK,CAACD,eAAe,CAAC;IACjD;EACD,CACD,CAAC;EAED,MAAMG,aAAa,GAAGhF,gBAAgB,CAAC,MAAM;IAC5C,SAAS;;IAET,MAAMsE,IAAI,GAAGpC,cAAc,CAACmB,GAAG,CAAC,CAAC,CAACnC,UAAU,CAAC;IAC7C,MAAM;MACL+D,aAAa,EAAEC,cAAc;MAC7BX,QAAQ;MACR,GAAGY;IACJ,CAAC,GAAGb,IAAI,EAAEE,KAAK,IAAI,CAAC,CAAC;IACrB,MAAMC,cAAc,GAAG3D,0BAA0B,CAAC;MACjDK,OAAO;MACPoD;IACD,CAAC,CAAC;IACF,MAAMI,WAAW,GAAGvC,qBAAqB,CAACiB,GAAG,CAAC,CAAC;IAE/C,OAAO;MACN,GAAG8B,SAAS;MACZd,QAAQ,EACPI,cAAc,IAAIE,WAAW,GAC1BA,WAAW,GACXlE;IACL,CAAC;EACF,CAAC,CAAC;EAEF,OAAO;IACNuE,aAAa;IACb5C;EACD,CAAC;AACF,CAAC","ignoreList":[]}
|
package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { StyleSheet } from "react-native";
|
|
5
|
+
import Animated from "react-native-reanimated";
|
|
6
|
+
import { isTeleportAvailable, NativePortal, PORTAL_POINTER_EVENTS } from "../../teleport";
|
|
7
|
+
import { useBoundaryContentPortalAttachment } from "./hooks/use-boundary-content-portal-attachment";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
export { BoundaryContentPortalHost } from "./components/host";
|
|
10
|
+
const AnimatedNativePortal = NativePortal ? Animated.createAnimatedComponent(NativePortal) : null;
|
|
11
|
+
export const BoundaryContentPortal = /*#__PURE__*/memo(function BoundaryContentPortal({
|
|
12
|
+
boundaryId,
|
|
13
|
+
children,
|
|
14
|
+
enabled
|
|
15
|
+
}) {
|
|
16
|
+
const shouldEnablePortal = enabled && boundaryId !== undefined;
|
|
17
|
+
const {
|
|
18
|
+
teleportProps
|
|
19
|
+
} = useBoundaryContentPortalAttachment({
|
|
20
|
+
boundaryId: boundaryId ?? "",
|
|
21
|
+
enabled: shouldEnablePortal
|
|
22
|
+
});
|
|
23
|
+
if (shouldEnablePortal && isTeleportAvailable && AnimatedNativePortal) {
|
|
24
|
+
return /*#__PURE__*/_jsx(AnimatedNativePortal, {
|
|
25
|
+
animatedProps: teleportProps,
|
|
26
|
+
name: boundaryId,
|
|
27
|
+
pointerEvents: PORTAL_POINTER_EVENTS,
|
|
28
|
+
style: StyleSheet.absoluteFill,
|
|
29
|
+
children: children
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return children;
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=index.js.map
|
package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","StyleSheet","Animated","isTeleportAvailable","NativePortal","PORTAL_POINTER_EVENTS","useBoundaryContentPortalAttachment","jsx","_jsx","BoundaryContentPortalHost","AnimatedNativePortal","createAnimatedComponent","BoundaryContentPortal","boundaryId","children","enabled","shouldEnablePortal","undefined","teleportProps","animatedProps","name","pointerEvents","style","absoluteFill"],"sourceRoot":"../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-content-portal/index.tsx"],"mappings":";;AAAA,SAGCA,IAAI,QAEE,OAAO;AACd,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SACCC,mBAAmB,EACnBC,YAAY,EACZC,qBAAqB,QACf,gBAAgB;AACvB,SAASC,kCAAkC,QAAQ,gDAAgD;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAEpG,SAASC,yBAAyB,QAAQ,mBAAmB;AAe7D,MAAMC,oBAAoB,GAAGN,YAAY,GACtCF,QAAQ,CAACS,uBAAuB,CAChCP,YACD,CAAC,GACA,IAAI;AAEP,OAAO,MAAMQ,qBAAqB,gBAAGZ,IAAI,CAAC,SAASY,qBAAqBA,CAAC;EACxEC,UAAU;EACVC,QAAQ;EACRC;AAC2B,CAAC,EAAE;EAC9B,MAAMC,kBAAkB,GAAGD,OAAO,IAAIF,UAAU,KAAKI,SAAS;EAC9D,MAAM;IAAEC;EAAc,CAAC,GAAGZ,kCAAkC,CAAC;IAC5DO,UAAU,EAAEA,UAAU,IAAI,EAAE;IAC5BE,OAAO,EAAEC;EACV,CAAC,CAAC;EAEF,IAAIA,kBAAkB,IAAIb,mBAAmB,IAAIO,oBAAoB,EAAE;IACtE,oBACCF,IAAA,CAACE,oBAAoB;MACpBS,aAAa,EAAED,aAAc;MAC7BE,IAAI,EAAEP,UAAW;MACjBQ,aAAa,EAAEhB,qBAAsB;MACrCiB,KAAK,EAAErB,UAAU,CAACsB,YAAa;MAAAT,QAAA,EAE9BA;IAAQ,CACY,CAAC;EAEzB;EAEA,OAAOA,QAAQ;AAChB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
import { memo, useCallback, useLayoutEffect, useRef } from "react";
|
|
4
4
|
import { StyleSheet, useWindowDimensions, View } from "react-native";
|
|
5
5
|
import Animated from "react-native-reanimated";
|
|
6
|
-
import { useDescriptorsStore } from "
|
|
7
|
-
import {
|
|
6
|
+
import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
|
|
7
|
+
import { useScreenSlots } from "../../../../../../providers/screen/styles";
|
|
8
|
+
import { SystemStore } from "../../../../../../stores/system.store";
|
|
9
|
+
import { PORTAL_POINTER_EVENTS } from "../../../teleport";
|
|
8
10
|
import { useHostMeasurement } from "../hooks/use-host-measurement";
|
|
9
11
|
import { registerHost, unregisterHost } from "../stores/host-registry.store";
|
|
10
12
|
import { useActivePortalBoundaryHosts } from "../stores/portal-boundary-host.store";
|
|
@@ -17,7 +19,7 @@ function HostImpl({
|
|
|
17
19
|
}) {
|
|
18
20
|
const screenKey = useDescriptorsStore(s => s.derivations.currentScreenKey);
|
|
19
21
|
const {
|
|
20
|
-
|
|
22
|
+
unblockLifecycleStart
|
|
21
23
|
} = SystemStore.getBag(screenKey).actions;
|
|
22
24
|
const generatedHostKeyRef = useRef(null);
|
|
23
25
|
if (generatedHostKeyRef.current === null) {
|
|
@@ -26,6 +28,9 @@ function HostImpl({
|
|
|
26
28
|
const hostKey = fallback ? screenKey : generatedHostKeyRef.current;
|
|
27
29
|
const capturesScroll = !fallback;
|
|
28
30
|
const activeBoundaryHosts = useActivePortalBoundaryHosts(hostKey);
|
|
31
|
+
const {
|
|
32
|
+
visibilityBlocked
|
|
33
|
+
} = useScreenSlots();
|
|
29
34
|
const {
|
|
30
35
|
height: viewportHeight,
|
|
31
36
|
width: viewportWidth
|
|
@@ -34,7 +39,10 @@ function HostImpl({
|
|
|
34
39
|
capturesScroll,
|
|
35
40
|
enabled: activeBoundaryHosts.length > 0,
|
|
36
41
|
hostKey,
|
|
37
|
-
screenKey
|
|
42
|
+
screenKey,
|
|
43
|
+
visibilityBlocked,
|
|
44
|
+
viewportHeight,
|
|
45
|
+
viewportWidth
|
|
38
46
|
});
|
|
39
47
|
useLayoutEffect(() => {
|
|
40
48
|
registerHost({
|
|
@@ -48,23 +56,17 @@ function HostImpl({
|
|
|
48
56
|
};
|
|
49
57
|
}, [capturesScroll, fallback, hostKey, screenKey]);
|
|
50
58
|
const handleUnblocking = useCallback(() => {
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const boundaryHosts = measurement.canRenderHosts ? activeBoundaryHosts.map((host, idx, list) => /*#__PURE__*/_jsx(View, {
|
|
58
|
-
pointerEvents: "none",
|
|
59
|
+
// Each destination boundary contributes one lifecycle start block. Release
|
|
60
|
+
// only this host's block so unrelated boundary and user blocks stay intact.
|
|
61
|
+
unblockLifecycleStart();
|
|
62
|
+
}, [unblockLifecycleStart]);
|
|
63
|
+
const boundaryHosts = measurement.canRenderHosts ? activeBoundaryHosts.map(host => /*#__PURE__*/_jsx(View, {
|
|
64
|
+
pointerEvents: PORTAL_POINTER_EVENTS,
|
|
59
65
|
style: [styles.boundaryHostViewport, {
|
|
60
66
|
width: viewportWidth,
|
|
61
67
|
height: viewportHeight
|
|
62
68
|
}],
|
|
63
|
-
onLayout:
|
|
64
|
-
if (list.length - 1 === idx) {
|
|
65
|
-
handleUnblocking();
|
|
66
|
-
}
|
|
67
|
-
},
|
|
69
|
+
onLayout: handleUnblocking,
|
|
68
70
|
children: /*#__PURE__*/_jsx(PortalBoundaryHost, {
|
|
69
71
|
host: host,
|
|
70
72
|
style: StyleSheet.absoluteFill
|
|
@@ -72,7 +74,7 @@ function HostImpl({
|
|
|
72
74
|
}, host.portalHostName)) : null;
|
|
73
75
|
return /*#__PURE__*/_jsx(Animated.View, {
|
|
74
76
|
ref: measurement.hostRef,
|
|
75
|
-
pointerEvents:
|
|
77
|
+
pointerEvents: PORTAL_POINTER_EVENTS,
|
|
76
78
|
style: [styles.host, {
|
|
77
79
|
width: viewportWidth,
|
|
78
80
|
height: viewportHeight
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","useCallback","useLayoutEffect","useRef","StyleSheet","useWindowDimensions","View","Animated","useDescriptorsStore","useScreenSlots","SystemStore","PORTAL_POINTER_EVENTS","useHostMeasurement","registerHost","unregisterHost","useActivePortalBoundaryHosts","PortalBoundaryHost","jsx","_jsx","nextHostId","HostImpl","fallback","style","screenKey","s","derivations","currentScreenKey","unblockLifecycleStart","getBag","actions","generatedHostKeyRef","current","hostKey","capturesScroll","activeBoundaryHosts","visibilityBlocked","height","viewportHeight","width","viewportWidth","measurement","enabled","length","handleUnblocking","boundaryHosts","canRenderHosts","map","host","pointerEvents","styles","boundaryHostViewport","onLayout","children","absoluteFill","portalHostName","ref","hostRef","collapsable","Host","props","ScreenFallbackHost","create","elevation","left","overflow","position","top","zIndex"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/components/host.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,WAAW,EAAEC,eAAe,EAAEC,MAAM,QAAQ,OAAO;AAClE,SAECC,UAAU,EACVC,mBAAmB,EACnBC,IAAI,QAEE,cAAc;AACrB,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,mBAAmB,QAAQ,gDAAgD;AACpF,SAASC,cAAc,QAAQ,2CAA2C;AAC1E,SAASC,WAAW,QAAQ,uCAAuC;AACnE,SAASC,qBAAqB,QAAQ,mBAAmB;AACzD,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,YAAY,EAAEC,cAAc,QAAQ,+BAA+B;AAC5E,SAASC,4BAA4B,QAAQ,sCAAsC;AACnF,SAASC,kBAAkB,QAAQ,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5D,IAAIC,UAAU,GAAG,CAAC;AAUlB,SAASC,QAAQA,CAAC;EAAEC,QAAQ,GAAG,KAAK;EAAEC;AAAqB,CAAC,EAAE;EAC7D,MAAMC,SAAS,GAAGf,mBAAmB,CAAEgB,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACC,gBAAgB,CAAC;EAC5E,MAAM;IAAEC;EAAsB,CAAC,GAAGjB,WAAW,CAACkB,MAAM,CAACL,SAAS,CAAC,CAACM,OAAO;EACvE,MAAMC,mBAAmB,GAAG3B,MAAM,CAAgB,IAAI,CAAC;EAEvD,IAAI2B,mBAAmB,CAACC,OAAO,KAAK,IAAI,EAAE;IACzCD,mBAAmB,CAACC,OAAO,GAAG,GAAGR,SAAS,SAASJ,UAAU,EAAE,EAAE;EAClE;EAEA,MAAMa,OAAO,GAAGX,QAAQ,GAAGE,SAAS,GAAGO,mBAAmB,CAACC,OAAO;EAClE,MAAME,cAAc,GAAG,CAACZ,QAAQ;EAChC,MAAMa,mBAAmB,GAAGnB,4BA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D,IAAI;EAEP,oBACCpC,IAAA,CAACX,QAAQ,CAACD,IAAI;IACbiD,GAAG,EAAEf,WAAW,CAACgB,OAAQ;IACzBR,aAAa,EAAErC,qBAAsB;IACrCW,KAAK,EAAE,CACN2B,MAAM,CAACF,IAAI,EACX;MAAET,KAAK,EAAEC,aAAa;MAAEH,MAAM,EAAEC;IAAe,CAAC,EAChDf,KAAK,CACJ;IACFmC,WAAW,EAAE,KAAM;IAAAL,QAAA,EAElBR;EAAa,CACA,CAAC;AAElB;AAEA,OAAO,MAAMc,IAAI,gBAAG1D,IAAI,CAAC,SAAS0D,IAAIA,CAACC,KAAsB,EAAE;EAC9D,oBAAOzC,IAAA,CAACE,QAAQ;IAAA,GAAKuC;EAAK,CAAG,CAAC;AAC/B,CAAC,CAAC;AAEF,OAAO,MAAMC,kBAAkB,gBAAG5D,IAAI,CAAC,SAAS4D,kBAAkBA,CAAA,EAAG;EACpE,oBAAO1C,IAAA,CAACE,QAAQ;IAACC,QAAQ;EAAA,CAAE,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM4B,MAAM,GAAG7C,UAAU,CAACyD,MAAM,CAAC;EAChCd,IAAI,EAAE;IACLe,SAAS,EAAE,MAAM;IACjBC,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE,SAAS;IACnBC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,MAAM,EAAE;EACT,CAAC;EACDjB,oBAAoB,EAAE;IACrBa,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE,SAAS;IACnBC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE;EACN;AACD,CAAC,CAAC","ignoreList":[]}
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
import { memo } from "react";
|
|
4
4
|
import { StyleSheet } from "react-native";
|
|
5
5
|
import Animated, { useAnimatedStyle } from "react-native-reanimated";
|
|
6
|
-
import { NO_STYLES } from "
|
|
7
|
-
import { composeSlotStyleWithLocalTransform } from "
|
|
8
|
-
import { AnimationStore } from "
|
|
9
|
-
import { getSourceScreenKeyFromPairKey } from "
|
|
10
|
-
import { getLink } from "
|
|
11
|
-
import { getClampedScrollAxisDelta, ScrollStore } from "
|
|
12
|
-
import { NativePortalHost } from "
|
|
13
|
-
import { hasLocalSlot } from "../
|
|
14
|
-
import { resolvePortalOffsetStyle } from "../
|
|
6
|
+
import { NO_STYLES } from "../../../../../../constants";
|
|
7
|
+
import { composeSlotStyleWithLocalTransform } from "../../../../../../providers/screen/styles/helpers/compose-slot-style";
|
|
8
|
+
import { AnimationStore } from "../../../../../../stores/animation.store";
|
|
9
|
+
import { getSourceScreenKeyFromPairKey } from "../../../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
10
|
+
import { getLink } from "../../../../../../stores/bounds/internals/links";
|
|
11
|
+
import { getClampedScrollAxisDelta, ScrollStore } from "../../../../../../stores/scroll.store";
|
|
12
|
+
import { NativePortalHost, PORTAL_POINTER_EVENTS } from "../../../teleport";
|
|
13
|
+
import { hasLocalSlot } from "../helpers/has-local-slot";
|
|
14
|
+
import { resolvePortalOffsetStyle } from "../helpers/offset-style";
|
|
15
15
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
const AnimatedPortalBoundaryHost = NativePortalHost ? Animated.createAnimatedComponent(NativePortalHost) : null;
|
|
17
17
|
export const PortalBoundaryHost = /*#__PURE__*/memo(function PortalBoundaryHost({
|
|
@@ -28,7 +28,7 @@ export const PortalBoundaryHost = /*#__PURE__*/memo(function PortalBoundaryHost(
|
|
|
28
28
|
const hostStyle = useAnimatedStyle(() => {
|
|
29
29
|
"worklet";
|
|
30
30
|
|
|
31
|
-
// Strict per-member lookup
|
|
31
|
+
// Strict per-member lookup - a fallback member's source rect would
|
|
32
32
|
// misplace this host's teleported content.
|
|
33
33
|
const link = getLink(host.pairKey, host.boundaryId);
|
|
34
34
|
if (!link?.source || !link.destination) {
|
|
@@ -96,16 +96,17 @@ export const PortalBoundaryHost = /*#__PURE__*/memo(function PortalBoundaryHost(
|
|
|
96
96
|
});
|
|
97
97
|
|
|
98
98
|
// Without `react-native-teleport` no portal ever mounts a boundary host, so
|
|
99
|
-
// this never renders
|
|
99
|
+
// this never renders - the guard just narrows the nullable animated host.
|
|
100
100
|
if (!AnimatedPortalBoundaryHost) {
|
|
101
101
|
return null;
|
|
102
102
|
}
|
|
103
103
|
return /*#__PURE__*/_jsx(Animated.View, {
|
|
104
|
-
pointerEvents:
|
|
104
|
+
pointerEvents: PORTAL_POINTER_EVENTS,
|
|
105
105
|
style: [style, hostStyle],
|
|
106
106
|
collapsable: false,
|
|
107
107
|
children: /*#__PURE__*/_jsx(AnimatedPortalBoundaryHost, {
|
|
108
108
|
name: host.portalHostName,
|
|
109
|
+
pointerEvents: PORTAL_POINTER_EVENTS,
|
|
109
110
|
style: [styles.content, contentFrameStyle, slotStyle]
|
|
110
111
|
})
|
|
111
112
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","StyleSheet","Animated","useAnimatedStyle","NO_STYLES","composeSlotStyleWithLocalTransform","AnimationStore","getSourceScreenKeyFromPairKey","getLink","getClampedScrollAxisDelta","ScrollStore","NativePortalHost","PORTAL_POINTER_EVENTS","hasLocalSlot","resolvePortalOffsetStyle","jsx","_jsx","AnimatedPortalBoundaryHost","createAnimatedComponent","PortalBoundaryHost","host","style","sourceScrollMetadata","getValue","pairKey","hostVisualProgress","screenKey","hostStyle","link","boundaryId","source","destination","sourceBounds","bounds","isCrossScreenPortal","landingShift","landingWeight","Math","min","max","get","liveScroll","capturedScroll","scroll","x","y","hostKey","placement","contentFrameStyle","height","width","slotStyle","escapeClipping","localStylesMaps","slot","slotsMap","undefined","boundsLocalTransform","View","pointerEvents","collapsable","children","name","portalHostName","styles","content","create","left","position","top"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAAy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@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import Animated, { runOnUI } from "react-native-reanimated";
|
|
5
|
+
import { logger } from "../../../../../../utils/logger";
|
|
6
|
+
import { isTeleportAvailable, PORTAL_POINTER_EVENTS, NativePortal as TeleportPortal } from "../../../teleport";
|
|
7
|
+
import { usePlaceholderStyles } from "../hooks/use-placeholder-styles";
|
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
+
const AnimatedNativePortal = TeleportPortal ? Animated.createAnimatedComponent(TeleportPortal) : null;
|
|
10
|
+
export const BoundaryPortalSlot = /*#__PURE__*/memo(function BoundaryPortalSlot({
|
|
11
|
+
id,
|
|
12
|
+
children,
|
|
13
|
+
enabled,
|
|
14
|
+
animatedProps,
|
|
15
|
+
placeholderRef
|
|
16
|
+
}) {
|
|
17
|
+
const isPortalEnabled = enabled && isTeleportAvailable;
|
|
18
|
+
if (__DEV__ && enabled && !id) {
|
|
19
|
+
logger.warnOnce("portal:missing-id", "A boundary portal was rendered without an id; rendering inline.");
|
|
20
|
+
}
|
|
21
|
+
const {
|
|
22
|
+
handleOnLayout,
|
|
23
|
+
placeholderStyle
|
|
24
|
+
} = usePlaceholderStyles();
|
|
25
|
+
if (isPortalEnabled && AnimatedNativePortal) {
|
|
26
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
27
|
+
ref: placeholderRef,
|
|
28
|
+
onLayout: ({
|
|
29
|
+
nativeEvent: {
|
|
30
|
+
layout
|
|
31
|
+
}
|
|
32
|
+
}) => runOnUI(handleOnLayout)(layout),
|
|
33
|
+
style: placeholderStyle,
|
|
34
|
+
pointerEvents: PORTAL_POINTER_EVENTS,
|
|
35
|
+
collapsable: false,
|
|
36
|
+
children: /*#__PURE__*/_jsx(AnimatedNativePortal, {
|
|
37
|
+
animatedProps: animatedProps,
|
|
38
|
+
name: id,
|
|
39
|
+
pointerEvents: PORTAL_POINTER_EVENTS,
|
|
40
|
+
children: children
|
|
41
|
+
})
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return children;
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=portal-slot.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","Animated","runOnUI","logger","isTeleportAvailable","PORTAL_POINTER_EVENTS","NativePortal","TeleportPortal","usePlaceholderStyles","jsx","_jsx","AnimatedNativePortal","createAnimatedComponent","BoundaryPortalSlot","id","children","enabled","animatedProps","placeholderRef","isPortalEnabled","__DEV__","warnOnce","handleOnLayout","placeholderStyle","View","ref","onLayout","nativeEvent","layout","style","pointerEvents","collapsable","name"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx"],"mappings":";;AAAA,SAGCA,IAAI,QAEE,OAAO;AAEd,OAAOC,QAAQ,IAAsBC,OAAO,QAAQ,yBAAyB;AAC7E,SAASC,MAAM,QAAQ,gCAAgC;AACvD,SACCC,mBAAmB,EACnBC,qBAAqB,EACrBC,YAAY,IAAIC,cAAc,QACxB,mBAAmB;AAC1B,SAASC,oBAAoB,QAAQ,iCAAiC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AASvE,MAAMC,oBAAoB,GAAGJ,cAAc,GACxCN,QAAQ,CAACW,uBAAuB,CAChCL,cACD,CAAC,GACA,IAAI;AAUP,OAAO,MAAMM,kBAAkB,gBAAGb,IAAI,CAAC,SAASa,kBAAkBA,CAAC;EAClEC,EAAE;EACFC,QAAQ;EACRC,OAAO;EACPC,aAAa;EACbC;AACwB,CAAC,EAAE;EAC3B,MAAMC,eAAe,GAAGH,OAAO,IAAIZ,mBAAmB;EAEtD,IAAIgB,OAAO,IAAIJ,OAAO,IAAI,CAACF,EAAE,EAAE;IAC9BX,MAAM,CAACkB,QAAQ,CACd,mBAAmB,EACnB,iEACD,CAAC;EACF;EAEA,MAAM;IAAEC,cAAc;IAAEC;EAAiB,CAAC,GAAGf,oBAAoB,CAAC,CAAC;EAEnE,IAAIW,eAAe,IAAIR,oBAAoB,EAAE;IAC5C,oBACCD,IAAA,CAACT,QAAQ,CAACuB,IAAI;MACbC,GAAG,EAAEP,cAAe;MACpBQ,QAAQ,EAAEA,CAAC;QAAEC,WAAW,EAAE;UAAEC;QAAO;MAAE,CAAC,KACrC1B,OAAO,CAACoB,cAAc,CAAC,CAACM,MAAM,CAC9B;MACDC,KAAK,EAAEN,gBAAiB;MACxBO,aAAa,EAAEzB,qBAAsB;MACrC0B,WAAW,EAAE,KAAM;MAAAhB,QAAA,eAEnBL,IAAA,CAACC,oBAAoB;QACpBM,aAAa,EAAEA,aAAc;QAC7Be,IAAI,EAAElB,EAAG;QACTgB,aAAa,EAAEzB,qBAAsB;QAAAU,QAAA,EAEpCA;MAAQ,CACY;IAAC,CACT,CAAC;EAElB;EAEA,OAAOA,QAAQ;AAChB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["hasLocalSlot","localStylesMaps","slotId","index","length","undefined"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.ts"],"mappings":";;AAEA,OAAO,MAAMA,YAAY,GAAGA,CAC3BC,eAAiC,EACjCC,MAAc,KACV;EACJ,SAAS;;EAET,KAAK,IAAIC,KAAK,GAAG,CAAC,EAAEA,KAAK,GAAGF,eAAe,CAACG,MAAM,EAAED,KAAK,EAAE,EAAE;IAC5D,IAAIF,eAAe,CAACE,KAAK,CAAC,GAAGD,MAAM,CAAC,KAAKG,SAAS,EAAE;MACnD,OAAO,IAAI;IACZ;EACD;EAEA,OAAO,KAAK;AACb,CAAC","ignoreList":[]}
|
package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const BOUNDARY_PORTAL_HOST_NAME_SUFFIX = "-portal-host";
|
|
4
|
+
export const createBoundaryPortalHostName = (hostKey, boundaryId, pairKey) => {
|
|
5
|
+
"worklet";
|
|
6
|
+
|
|
7
|
+
return `${hostKey}-${pairKey ? `${pairKey}-` : ""}${boundaryId}${BOUNDARY_PORTAL_HOST_NAME_SUFFIX}`;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=host-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BOUNDARY_PORTAL_HOST_NAME_SUFFIX","createBoundaryPortalHostName","hostKey","boundaryId","pairKey"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/helpers/host-name.ts"],"mappings":";;AAAA,MAAMA,gCAAgC,GAAG,cAAc;AAEvD,OAAO,MAAMC,4BAA4B,GAAGA,CAC3CC,OAAe,EACfC,UAAkB,EAClBC,OAAuB,KACnB;EACJ,SAAS;;EACT,OAAO,GAAGF,OAAO,IAAIE,OAAO,GAAG,GAAGA,OAAO,GAAG,GAAG,EAAE,GAAGD,UAAU,GAAGH,gCAAgC,EAAE;AACpG,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getClampedScrollAxisDelta","getPortalHostBounds","resolvePortalOffsetStyle","bounds","hostKey","placement","landingShift","hostBounds","boundsScrollSnapshot","scroll","hostBoundsScrollSnapshot","alignHostToBoundsScroll","hostSnapshotDeltaX","hostSnapshotDeltaY","adjustedHostPageX","pageX","adjustedHostPageY","pageY","transform","translateY","y","translateX","x"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.ts"],"mappings":";;AACA,SAASA,yBAAyB,QAAQ,uCAAuC;AAEjF,SAASC,mBAAmB,QAAQ,6BAA6B;;AAEjE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAgBA,OAAO,MAAMC,wBAAwB,GAAGA,CAAC;EACxCC,MAAM;EACNC,OAAO;EACPC,SAAS;EACTC;AAC+B,CAAC,KAAiB;EACjD,SAAS;;EACT,MAAMC,UAAU,GAAGN,mBAAmB,CAACG,OAAO,CAAC;EAC/C,MAAMI,oBAAoB,GAAGL,MAAM,CAACM,MAAM,IAAI,IAAI;EAClD,MAAMC,wBAAwB,GAAGH,UAAU,EAAEE,MAAM,IAAI,IAAI;;EAE3D;EACA;EACA;EACA,MAAME,uBAAuB,GAAGN,SAAS,KAAK,aAAa;EAE3D,MAAMO,kBAAkB,GAAGD,uBAAuB,GAC/CX,yBAAyB,CACzBQ,oBAAoB,EACpBE,wBAAwB,EACxB,YACD,CAAC,GACA,CAAC;EACJ,MAAMG,kBAAkB,GAAGF,uBAAuB,GAC/CX,yBAAyB,CACzBQ,oBAAoB,EACpBE,wBAAwB,EACxB,UACD,CAAC,GACA,CAAC;;EAEJ;EACA;EACA,MAAMI,iBAAiB,GAAGP,UAAU,GACjCA,UAAU,CAACQ,KAAK,GAAGH,kBAAkB,GACrC,CAAC;EACJ,MAAMI,iBAAiB,GAAGT,UAAU,GACjCA,UAAU,CAACU,KAAK,GAAGJ,kBAAkB,GACrC,CAAC;EAEJ,OAAO;IACNK,SAAS,EAAE,CACV;MAAEC,UAAU,EAAEhB,MAAM,CAACc,KAAK,GAAGD,iBAAiB,IAAIV,YAAY,EAAEc,CAAC,IAAI,CAAC;IAAE,CAAC,EACzE;MAAEC,UAAU,EAAElB,MAAM,CAACY,KAAK,GAAGD,iBAAiB,IAAIR,YAAY,EAAEgB,CAAC,IAAI,CAAC;IAAE,CAAC;EAE3E,CAAC;AACF,CAAC","ignoreList":[]}
|