react-native-screen-transitions 3.9.0-beta.1 → 3.9.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/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 +30 -30
- 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 +68 -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 +40 -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 +194 -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 +44 -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} +17 -16
- 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} +11 -11
- 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 +52 -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 +184 -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 +33 -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 +2 -2
- 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 +77 -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/index.js +13 -0
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -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/system.store.js +10 -2
- package/lib/commonjs/shared/stores/system.store.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/zoom/build.js +3 -3
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- 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 +32 -32
- 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 +72 -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 +35 -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 +189 -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 +33 -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} +17 -16
- 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} +11 -11
- 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 +47 -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 +179 -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 +29 -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 +2 -2
- 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 +74 -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/index.js +1 -0
- package/lib/module/shared/index.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -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/system.store.js +10 -2
- package/lib/module/shared/stores/system.store.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/zoom/build.js +3 -3
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- 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.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 +11 -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 +14 -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 +13 -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/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 +21 -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/index.d.ts +1 -0
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +1 -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/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 +7 -2
- package/lib/typescript/shared/types/bounds.types.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/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 +43 -50
- package/src/shared/components/boundary/create-boundary-component.tsx +35 -150
- package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +103 -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 +48 -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 +274 -0
- package/src/shared/components/boundary/portal/components/boundary-content-portal/index.tsx +59 -0
- package/src/shared/components/boundary/portal/components/{host.tsx → boundary-portal/components/host.tsx} +14 -15
- package/src/shared/components/boundary/portal/components/{portal-boundary-host.tsx → boundary-portal/components/portal-boundary-host.tsx} +12 -12
- package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx +80 -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 +250 -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 +38 -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 +2 -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 +198 -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/index.ts +4 -0
- package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +1 -0
- 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/system.store.ts +10 -4
- package/src/shared/types/animation.types.ts +3 -3
- package/src/shared/types/bounds.types.ts +9 -2
- 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/zoom/build.ts +3 -3
- 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/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/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/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/lib/commonjs/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.js +0 -0
- /package/lib/commonjs/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.js +0 -0
- /package/lib/module/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.js +0 -0
- /package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.js +0 -0
- /package/lib/typescript/shared/components/boundary/portal/components/{host.d.ts → boundary-portal/components/host.d.ts} +0 -0
- /package/lib/typescript/shared/components/boundary/portal/components/{portal-boundary-host.d.ts → boundary-portal/components/portal-boundary-host.d.ts} +0 -0
- /package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.d.ts +0 -0
- /package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.ts +0 -0
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { useCallback, useLayoutEffect } from "react";
|
|
4
|
+
import { cancelAnimation, runOnUI, useAnimatedReaction, useSharedValue, withDelay, withTiming } from "react-native-reanimated";
|
|
4
5
|
import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
|
|
5
6
|
import { AnimationStore } from "../../../../stores/animation.store";
|
|
6
7
|
import { getSourceScreenKeyFromPairKey } from "../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
7
8
|
import { getEntry } from "../../../../stores/bounds/internals/entries";
|
|
8
|
-
import {
|
|
9
|
+
import { getLink } from "../../../../stores/bounds/internals/links";
|
|
9
10
|
import { pairs } from "../../../../stores/bounds/internals/state";
|
|
10
|
-
import {
|
|
11
|
+
import { SystemStore } from "../../../../stores/system.store";
|
|
11
12
|
import { logger } from "../../../../utils/logger";
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
const VIEWPORT_RETRY_DELAY_MS = 100;
|
|
13
|
+
import { getInitialDestinationMeasurementSignal } from "../../utils/destination-signals";
|
|
14
|
+
const HANDSHAKE_RETRY_DELAY_MS = 100;
|
|
15
15
|
/**
|
|
16
|
-
* A destination
|
|
17
|
-
* transition gate forever
|
|
18
|
-
*
|
|
16
|
+
* A destination whose initial handshake never completes must not hold the
|
|
17
|
+
* transition gate forever. After this budget, release the block with a warning
|
|
18
|
+
* so the open proceeds without that boundary.
|
|
19
19
|
*/
|
|
20
|
-
const
|
|
20
|
+
const MAX_HANDSHAKE_RETRIES = 20;
|
|
21
21
|
export const useInitialDestinationMeasurement = ({
|
|
22
22
|
boundTag,
|
|
23
23
|
enabled,
|
|
24
|
+
escapeClipping,
|
|
24
25
|
measureBoundary
|
|
25
26
|
}) => {
|
|
26
27
|
const {
|
|
@@ -33,9 +34,9 @@ export const useInitialDestinationMeasurement = ({
|
|
|
33
34
|
const destinationPairKey = useDescriptorsStore(s => s.derivations.destinationPairKey);
|
|
34
35
|
const ancestorDestinationPairKey = useDescriptorsStore(s => s.derivations.ancestorDestinationPairKey);
|
|
35
36
|
const destinationEnabled = enabled && !nextScreenKey;
|
|
37
|
+
const initialDestinationPairKey = destinationPairKey ?? ancestorDestinationPairKey;
|
|
36
38
|
const progress = AnimationStore.getValue(currentScreenKey, "transitionProgress");
|
|
37
39
|
const {
|
|
38
|
-
pendingLifecycleRequestKind,
|
|
39
40
|
actions: {
|
|
40
41
|
blockLifecycleStart,
|
|
41
42
|
unblockLifecycleStart
|
|
@@ -43,93 +44,109 @@ export const useInitialDestinationMeasurement = ({
|
|
|
43
44
|
} = SystemStore.getBag(currentScreenKey);
|
|
44
45
|
const isBlockingLifecycleStart = useSharedValue(0);
|
|
45
46
|
const retryToken = useSharedValue(0);
|
|
46
|
-
const
|
|
47
|
+
const handshakeRetries = useSharedValue(0);
|
|
47
48
|
const hasGivenUp = useSharedValue(0);
|
|
48
|
-
const releaseLifecycleStartBlock = () => {
|
|
49
|
+
const releaseLifecycleStartBlock = useCallback(() => {
|
|
49
50
|
"worklet";
|
|
50
51
|
|
|
51
52
|
cancelAnimation(retryToken);
|
|
52
53
|
if (!isBlockingLifecycleStart.get()) {
|
|
53
54
|
return;
|
|
54
55
|
}
|
|
55
|
-
unblockLifecycleStart();
|
|
56
56
|
isBlockingLifecycleStart.set(0);
|
|
57
|
-
|
|
57
|
+
unblockLifecycleStart();
|
|
58
|
+
}, [isBlockingLifecycleStart, retryToken, unblockLifecycleStart]);
|
|
59
|
+
useLayoutEffect(() => {
|
|
60
|
+
if (!destinationEnabled || !initialDestinationPairKey || progress.get() > 0 || isBlockingLifecycleStart.get()) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Boundary layout effects run before the parent screen's open intent. Claim
|
|
65
|
+
// this boundary's startup block before the transition controller can consume
|
|
66
|
+
// the request; the UI-thread handshake below releases it once matching is done.
|
|
67
|
+
blockLifecycleStart();
|
|
68
|
+
isBlockingLifecycleStart.set(1);
|
|
69
|
+
return () => {
|
|
70
|
+
if (escapeClipping) {
|
|
71
|
+
// The portal host owns the release after this boundary hands off.
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// This is an abandonment fallback, not a second release. Run it on the UI
|
|
76
|
+
// runtime so it serializes with the handshake's guarded release.
|
|
77
|
+
runOnUI(releaseLifecycleStartBlock)();
|
|
78
|
+
};
|
|
79
|
+
}, [blockLifecycleStart, destinationEnabled, escapeClipping, initialDestinationPairKey, isBlockingLifecycleStart, progress, releaseLifecycleStartBlock]);
|
|
58
80
|
useAnimatedReaction(() => {
|
|
59
81
|
"worklet";
|
|
60
82
|
|
|
61
83
|
const retryTick = retryToken.get();
|
|
62
|
-
const hasPendingOpenRequest = pendingLifecycleRequestKind.get() === LifecycleTransitionRequestKind.Open;
|
|
63
84
|
const isWaitingForOpenToStart = progress.get() <= 0;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const measurePairKey = getInitialDestinationMeasurePairKey({
|
|
68
|
-
enabled: destinationEnabled,
|
|
85
|
+
const sourceScreenKey = initialDestinationPairKey ? getSourceScreenKeyFromPairKey(initialDestinationPairKey) : undefined;
|
|
86
|
+
const signal = getInitialDestinationMeasurementSignal({
|
|
87
|
+
enabled: destinationEnabled && isWaitingForOpenToStart && isBlockingLifecycleStart.get() > 0,
|
|
69
88
|
destinationPairKey,
|
|
70
89
|
ancestorDestinationPairKey,
|
|
71
90
|
linkId: linkKey,
|
|
72
91
|
group,
|
|
73
|
-
|
|
92
|
+
destinationPresent: getEntry(tag, currentScreenKey) !== null,
|
|
93
|
+
sourcePresent: sourceScreenKey !== undefined && getEntry(tag, sourceScreenKey) !== null,
|
|
94
|
+
linkState: initialDestinationPairKey ? pairs.get() : undefined
|
|
74
95
|
});
|
|
75
|
-
return [
|
|
76
|
-
}, ([measurePairKey, retryTick], previous) => {
|
|
96
|
+
return [signal?.pairKey ?? null, signal?.action ?? null, retryTick];
|
|
97
|
+
}, ([measurePairKey, action, retryTick], previous) => {
|
|
77
98
|
"worklet";
|
|
78
99
|
|
|
79
|
-
if (!measurePairKey) {
|
|
100
|
+
if (!measurePairKey || !action) {
|
|
80
101
|
return;
|
|
81
102
|
}
|
|
82
103
|
const previousMeasurePairKey = previous?.[0];
|
|
83
|
-
const
|
|
84
|
-
const
|
|
85
|
-
|
|
104
|
+
const previousAction = previous?.[1];
|
|
105
|
+
const previousRetryTick = previous?.[2];
|
|
106
|
+
const shouldHandleSignal = measurePairKey !== previousMeasurePairKey || action !== previousAction || retryTick !== previousRetryTick;
|
|
107
|
+
if (!shouldHandleSignal) {
|
|
86
108
|
return;
|
|
87
109
|
}
|
|
88
110
|
if (hasGivenUp.get()) {
|
|
89
111
|
return;
|
|
90
112
|
}
|
|
91
|
-
if (
|
|
92
|
-
|
|
93
|
-
|
|
113
|
+
if (action === "release") {
|
|
114
|
+
releaseLifecycleStartBlock();
|
|
115
|
+
handshakeRetries.set(0);
|
|
116
|
+
return;
|
|
94
117
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
const destinationAttached = getDestination(measurePairKey, linkKey) !== null;
|
|
100
|
-
if (destinationAttached) {
|
|
101
|
-
const linkState = pairs.get();
|
|
102
|
-
const link = getLink(measurePairKey, linkKey);
|
|
103
|
-
const sourceScreenKey = getSourceScreenKeyFromPairKey(measurePairKey);
|
|
104
|
-
const sourceEntry = getEntry(tag, sourceScreenKey);
|
|
105
|
-
const sourceEntryUsesDestinationEscapeHost = sourceEntry?.handoff === true && sourceEntry.escapeClipping === true;
|
|
106
|
-
const shouldWaitForEscapeClippingHost = usesEscapeClippingHost(link) || sourceEntryUsesDestinationEscapeHost || hasHandoffEscapeContinuation({
|
|
107
|
-
linkKey,
|
|
108
|
-
linkState,
|
|
109
|
-
sourceScreenKey
|
|
118
|
+
if (action === "measure") {
|
|
119
|
+
measureBoundary({
|
|
120
|
+
type: "destination",
|
|
121
|
+
pairKey: measurePairKey
|
|
110
122
|
});
|
|
111
|
-
|
|
123
|
+
}
|
|
124
|
+
const link = getLink(measurePairKey, linkKey);
|
|
125
|
+
const linkComplete = !!link?.source && !!link.destination;
|
|
126
|
+
if (linkComplete || action === "complete") {
|
|
127
|
+
cancelAnimation(retryToken);
|
|
128
|
+
handshakeRetries.set(0);
|
|
129
|
+
if (escapeClipping) {
|
|
112
130
|
// Screen-level escape has a second readiness phase after destination
|
|
113
|
-
//
|
|
131
|
+
// matching: the host must commit before the transition starts, or
|
|
114
132
|
// the payload can disappear for a frame.
|
|
115
133
|
return;
|
|
116
134
|
}
|
|
117
135
|
releaseLifecycleStartBlock();
|
|
118
|
-
viewportRetries.set(0);
|
|
119
136
|
return;
|
|
120
137
|
}
|
|
121
|
-
if (
|
|
138
|
+
if (handshakeRetries.get() >= MAX_HANDSHAKE_RETRIES) {
|
|
122
139
|
hasGivenUp.set(1);
|
|
123
140
|
releaseLifecycleStartBlock();
|
|
124
|
-
logger.warn(`
|
|
141
|
+
logger.warn(`Boundary "${linkKey}" never formed a complete source/destination link after ${MAX_HANDSHAKE_RETRIES} attempts; releasing the transition gate without it. One side is likely off-viewport or unmounted.`);
|
|
125
142
|
return;
|
|
126
143
|
}
|
|
127
144
|
|
|
128
|
-
//
|
|
129
|
-
//
|
|
130
|
-
|
|
145
|
+
// Keep the lifecycle blocked while registration, measurement, or source
|
|
146
|
+
// attachment settles. The retry token also retries rejected destination bounds.
|
|
147
|
+
handshakeRetries.set(handshakeRetries.get() + 1);
|
|
131
148
|
cancelAnimation(retryToken);
|
|
132
|
-
retryToken.set(withDelay(
|
|
149
|
+
retryToken.set(withDelay(HANDSHAKE_RETRY_DELAY_MS, withTiming(retryToken.get() + 1, {
|
|
133
150
|
duration: 0
|
|
134
151
|
})));
|
|
135
152
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["cancelAnimation","useAnimatedReaction","useSharedValue","withDelay","withTiming","useDescriptorsStore","AnimationStore","getSourceScreenKeyFromPairKey","getEntry","
|
|
1
|
+
{"version":3,"names":["useCallback","useLayoutEffect","cancelAnimation","runOnUI","useAnimatedReaction","useSharedValue","withDelay","withTiming","useDescriptorsStore","AnimationStore","getSourceScreenKeyFromPairKey","getEntry","getLink","pairs","SystemStore","logger","getInitialDestinationMeasurementSignal","HANDSHAKE_RETRY_DELAY_MS","MAX_HANDSHAKE_RETRIES","useInitialDestinationMeasurement","boundTag","enabled","escapeClipping","measureBoundary","tag","linkKey","group","currentScreenKey","s","derivations","nextScreenKey","destinationPairKey","ancestorDestinationPairKey","destinationEnabled","initialDestinationPairKey","progress","getValue","actions","blockLifecycleStart","unblockLifecycleStart","getBag","isBlockingLifecycleStart","retryToken","handshakeRetries","hasGivenUp","releaseLifecycleStartBlock","get","set","retryTick","isWaitingForOpenToStart","sourceScreenKey","undefined","signal","linkId","destinationPresent","sourcePresent","linkState","pairKey","action","measurePairKey","previous","previousMeasurePairKey","previousAction","previousRetryTick","shouldHandleSignal","type","link","linkComplete","source","destination","warn","duration"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,eAAe,QAAQ,OAAO;AACpD,SACCC,eAAe,EACfC,OAAO,EACPC,mBAAmB,EACnBC,cAAc,EACdC,SAAS,EACTC,UAAU,QACJ,yBAAyB;AAChC,SAASC,mBAAmB,QAAQ,0CAA0C;AAC9E,SAASC,cAAc,QAAQ,oCAAoC;AACnE,SAASC,6BAA6B,QAAQ,sDAAsD;AACpG,SAASC,QAAQ,QAAQ,6CAA6C;AACtE,SAASC,OAAO,QAAQ,2CAA2C;AACnE,SAASC,KAAK,QAAQ,2CAA2C;AAEjE,SAASC,WAAW,QAAQ,iCAAiC;AAC7D,SAASC,MAAM,QAAQ,0BAA0B;AAEjD,SAASC,sCAAsC,QAAQ,iCAAiC;AAExF,MAAMC,wBAAwB,GAAG,GAAG;AACpC;AACA;AACA;AACA;AACA;AACA,MAAMC,qBAAqB,GAAG,EAAE;AAShC,OAAO,MAAMC,gCAAgC,GAAGA,CAAC;EAChDC,QAAQ;EACRC,OAAO;EACPC,cAAc;EACdC;AACuC,CAAC,KAAK;EAC7C,MAAM;IAAEC,GAAG;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGN,QAAQ;EACxC,MAAMO,gBAAgB,GAAGnB,mBAAmB,CAC1CoB,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACF,gBACtB,CAAC;EACD,MAAMG,aAAa,GAAGtB,mBAAmB,CAAEoB,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACC,aAAa,CAAC;EAC7E,MAAMC,kBAAkB,GAAGvB,mBAAmB,CAC5CoB,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACE,kBACtB,CAAC;EACD,MAAMC,0BAA0B,GAAGxB,mBAAmB,CACpD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,gBAAgB,CAACI,GAAG,CAACJ,gBAAgB,CAACG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;IAChD5C,eAAe,CAACwC,UAAU,CAAC;IAC3BA,UAAU,CAACK,GAAG,CACbzC,SAAS,CACRW,wBAAwB,EACxBV,UAAU,CAACmC,UAAU,CAACI,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE;MAAEyB,QAAQ,EAAE;IAAE,CAAC,CACjD,CACD,CAAC;EACF,CACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useMemo","prepareStyleForBounds","useBoundaryPresence","useInitialDestinationMeasurement","useInitialSourceMeasurement","useRefreshBoundary","useMeasurer","useBoundaryMeasurement","boundTag","enabled","runtimeEnabled","currentScreenKey","measuredRef","style","targetPreparedStyles","handoff","escapeClipping","config","anchor","scaleMode","target","method","boundaryConfig","rootPreparedStyles","preparedStyles","measureBoundary","measuredAnimatedRef"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/hooks/use-boundary-measurement.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,OAAO;AAI/B,SAASC,qBAAqB,QAAQ,6CAA6C;AAEnF,SAASC,mBAAmB,QAAQ,oCAAoC;AACxE,SAASC,gCAAgC,QAAQ,kDAAkD;AACnG,SAASC,2BAA2B,QAAQ,6CAA6C;AACzF,SAASC,kBAAkB,QAAQ,mCAAmC;AACtE,SAASC,WAAW,QAAQ,gBAAgB;AAmB5C;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAGA,CAAC;EACtCC,QAAQ;EACRC,OAAO;EACPC,cAAc;EACdC,gBAAgB;EAChBC,WAAW;EACXC,KAAK;EACLC,oBAAoB;EACpBC,OAAO;EACPC,cAAc;EACdC;AAC6B,CAAC,KAAK;EACnC,MAAM;IAAEC,MAAM;IAAEC,SAAS;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGJ,MAAM;EACpD,MAAMK,cAAc,GAAGtB,OAAO,CAC7B,OAAO;IAAEkB,MAAM;IAAEC,SAAS;IAAEC,MAAM;IAAEC;EAAO,CAAC,CAAC,EAC7C,CAACH,MAAM,EAAEC,SAAS,EAAEC,MAAM,EAAEC,MAAM,CACnC,CAAC;EAED,MAAME,kBAAkB,GAAGvB,OAAO,CACjC,MAAMC,qBAAqB,CAACY,KAAK,CAAC,EAClC,CAACA,KAAK,CACP,CAAC;EACD,MAAMW,cAAc,GAAGV,oBAAoB,IAAIS,kBAAkB;EAEjE,MAAME,eAAe,GAAGnB,WAAW,CAAC;IACnCG,OAAO;IACPD,QAAQ;IACRG,gBAAgB;IAChBa,cAAc;IACdE,mBAAmB,EAAEd,WAAW;IAChCG,OAAO;IACPC;EACD,CAAC,CAAC;;EAEF;EACA;EACAd,mBAAmB,CAAC;IACnBO,OAAO,EAAEC,cAAc;IACvBF,QAAQ;IACRG,gBAAgB;IAChBW,cAAc;IACdP,OAAO;IACPC;EACD,CAAC,CAAC;EAEFZ,2BAA2B,CAAC;IAC3BK,OAAO,EAAEC,cAAc;IACvBe,eAAe;IACfjB;EACD,CAAC,CAAC;EAEFL,gCAAgC,CAAC;IAChCK,QAAQ;IACRC,OAAO,EAAEC,cAAc;
|
|
1
|
+
{"version":3,"names":["useMemo","prepareStyleForBounds","useBoundaryPresence","useInitialDestinationMeasurement","useInitialSourceMeasurement","useRefreshBoundary","useMeasurer","useBoundaryMeasurement","boundTag","enabled","runtimeEnabled","currentScreenKey","measuredRef","style","targetPreparedStyles","handoff","escapeClipping","config","anchor","scaleMode","target","method","boundaryConfig","rootPreparedStyles","preparedStyles","measureBoundary","measuredAnimatedRef"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/hooks/use-boundary-measurement.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,OAAO;AAI/B,SAASC,qBAAqB,QAAQ,6CAA6C;AAEnF,SAASC,mBAAmB,QAAQ,oCAAoC;AACxE,SAASC,gCAAgC,QAAQ,kDAAk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kB,CAAC;IAClBI,OAAO,EAAEC,cAAc;IACvBF,QAAQ;IACRiB;EACD,CAAC,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -5,9 +5,11 @@ import { useWindowDimensions } from "react-native";
|
|
|
5
5
|
import { measure } from "react-native-reanimated";
|
|
6
6
|
import { applyMeasuredBoundsWrites } from "../../../providers/helpers/measured-bounds-writes";
|
|
7
7
|
import { useOriginContext } from "../../../providers/screen/origin.provider";
|
|
8
|
+
import { useScreenSlots } from "../../../providers/screen/styles";
|
|
8
9
|
import { ScrollStore } from "../../../stores/scroll.store";
|
|
9
10
|
import { SystemStore } from "../../../stores/system.store";
|
|
10
|
-
import {
|
|
11
|
+
import { getVisibilityBlockOffset } from "../../../utils/visibility-block-offset";
|
|
12
|
+
import { attachScrollSnapshotToMeasuredBounds, isMeasurementInViewport, measureWithOverscrollAwareness, normalizeMeasuredBoundsWithVisibilityGate } from "../utils/measured-bounds";
|
|
11
13
|
export const useMeasurer = ({
|
|
12
14
|
enabled,
|
|
13
15
|
boundTag,
|
|
@@ -27,6 +29,9 @@ export const useMeasurer = ({
|
|
|
27
29
|
const {
|
|
28
30
|
originRef
|
|
29
31
|
} = useOriginContext();
|
|
32
|
+
const {
|
|
33
|
+
visibilityBlocked
|
|
34
|
+
} = useScreenSlots();
|
|
30
35
|
return useCallback(target => {
|
|
31
36
|
"worklet";
|
|
32
37
|
|
|
@@ -34,7 +39,14 @@ export const useMeasurer = ({
|
|
|
34
39
|
const measured = measureWithOverscrollAwareness(measuredAnimatedRef, scrollState.get());
|
|
35
40
|
const measuredOrigin = measure(originRef);
|
|
36
41
|
if (!measured || !measuredOrigin) return;
|
|
37
|
-
const normalizedMeasured =
|
|
42
|
+
const normalizedMeasured = normalizeMeasuredBoundsWithVisibilityGate({
|
|
43
|
+
measured,
|
|
44
|
+
origin: measuredOrigin,
|
|
45
|
+
visibilityBlocked: escapeClipping && visibilityBlocked.get(),
|
|
46
|
+
visibilityBlockOffset: getVisibilityBlockOffset(viewportHeight),
|
|
47
|
+
viewportWidth,
|
|
48
|
+
viewportHeight
|
|
49
|
+
});
|
|
38
50
|
|
|
39
51
|
/**
|
|
40
52
|
* - Destination Pass -
|
|
@@ -58,6 +70,6 @@ export const useMeasurer = ({
|
|
|
58
70
|
handoff,
|
|
59
71
|
escapeClipping
|
|
60
72
|
});
|
|
61
|
-
}, [enabled, boundTag, currentScreenKey, preparedStyles, measuredAnimatedRef, handoff, escapeClipping, viewportWidth, viewportHeight, scrollState, scrollMetadata, pendingLifecycleStartBlockCount, originRef]);
|
|
73
|
+
}, [enabled, boundTag, currentScreenKey, preparedStyles, measuredAnimatedRef, handoff, escapeClipping, viewportWidth, viewportHeight, scrollState, scrollMetadata, pendingLifecycleStartBlockCount, originRef, visibilityBlocked]);
|
|
62
74
|
};
|
|
63
75
|
//# sourceMappingURL=use-measurer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useCallback","useWindowDimensions","measure","applyMeasuredBoundsWrites","useOriginContext","ScrollStore","SystemStore","attachScrollSnapshotToMeasuredBounds","isMeasurementInViewport","measureWithOverscrollAwareness","
|
|
1
|
+
{"version":3,"names":["useCallback","useWindowDimensions","measure","applyMeasuredBoundsWrites","useOriginContext","useScreenSlots","ScrollStore","SystemStore","getVisibilityBlockOffset","attachScrollSnapshotToMeasuredBounds","isMeasurementInViewport","measureWithOverscrollAwareness","normalizeMeasuredBoundsWithVisibilityGate","useMeasurer","enabled","boundTag","currentScreenKey","preparedStyles","measuredAnimatedRef","handoff","escapeClipping","width","viewportWidth","height","viewportHeight","scrollState","getValue","scrollMetadata","pendingLifecycleStartBlockCount","originRef","visibilityBlocked","target","measured","get","measuredOrigin","normalizedMeasured","origin","visibilityBlockOffset","shouldGuardDestinationViewport","group","viewportAllowsDestinationWrite","type","measuredWithScroll","entryTag","tag","linkId","linkKey","linkWrite"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/hooks/use-measurer.ts"],"mappings":";;AAAA,SA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AC","ignoreList":[]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useLayoutEffect } from "react";
|
|
4
|
+
import { logger } from "../../../utils/logger";
|
|
5
|
+
import { TARGET_OUTSIDE_ROOT_WARNING, useBoundaryRootContext } from "../providers/boundary-root.provider";
|
|
6
|
+
export const useRegisterTarget = ({
|
|
7
|
+
targetAnimatedRef,
|
|
8
|
+
preparedStyles,
|
|
9
|
+
measurementRef
|
|
10
|
+
}) => {
|
|
11
|
+
const rootContext = useBoundaryRootContext();
|
|
12
|
+
const registerTargetRef = rootContext?.registerTargetRef;
|
|
13
|
+
const unregisterTargetRef = rootContext?.unregisterTargetRef;
|
|
14
|
+
useLayoutEffect(() => {
|
|
15
|
+
if (!registerTargetRef || !unregisterTargetRef) {
|
|
16
|
+
if (__DEV__) {
|
|
17
|
+
logger.warn(TARGET_OUTSIDE_ROOT_WARNING);
|
|
18
|
+
}
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
registerTargetRef(targetAnimatedRef, preparedStyles, measurementRef);
|
|
22
|
+
return () => {
|
|
23
|
+
unregisterTargetRef(targetAnimatedRef);
|
|
24
|
+
};
|
|
25
|
+
}, [registerTargetRef, unregisterTargetRef, targetAnimatedRef, preparedStyles, measurementRef]);
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=use-register-target.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useLayoutEffect","logger","TARGET_OUTSIDE_ROOT_WARNING","useBoundaryRootContext","useRegisterTarget","targetAnimatedRef","preparedStyles","measurementRef","rootContext","registerTargetRef","unregisterTargetRef","__DEV__","warn"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/hooks/use-register-target.ts"],"mappings":";;AAAA,SAASA,eAAe,QAAQ,OAAO;AAGvC,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SACCC,2BAA2B,EAC3BC,sBAAsB,QAChB,qCAAqC;AAQ5C,OAAO,MAAMC,iBAAiB,GAAGA,CAAC;EACjCC,iBAAiB;EACjBC,cAAc;EACdC;AACoB,CAAC,KAAK;EAC1B,MAAMC,WAAW,GAAGL,sBAAsB,CAAC,CAAC;EAC5C,MAAMM,iBAAiB,GAAGD,WAAW,EAAEC,iBAAiB;EACxD,MAAMC,mBAAmB,GAAGF,WAAW,EAAEE,mBAAmB;EAC5DV,eAAe,CAAC,MAAM;IACrB,IAAI,CAACS,iBAAiB,IAAI,CAACC,mBAAmB,EAAE;MAC/C,IAAIC,OAAO,EAAE;QACZV,MAAM,CAACW,IAAI,CAACV,2BAA2B,CAAC;MACzC;MACA;IACD;IAEAO,iBAAiB,CAACJ,iBAAiB,EAAEC,cAAc,EAAEC,cAAc,CAAC;IACpE,OAAO,MAAM;MACZG,mBAAmB,CAACL,iBAAiB,CAAC;IACvC,CAAC;EACF,CAAC,EAAE,CACFI,iBAAiB,EACjBC,mBAAmB,EACnBL,iBAAiB,EACjBC,cAAc,EACdC,cAAc,CACd,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -39,7 +39,7 @@ Host.displayName = "Transition.Boundary.Host";
|
|
|
39
39
|
* Use:
|
|
40
40
|
* - `Boundary` for passive and pressable shared elements.
|
|
41
41
|
* - `Boundary.Target` to measure a nested descendant instead of the root.
|
|
42
|
-
* - `Boundary.Host` to make
|
|
42
|
+
* - `Boundary.Host` to make clipping-escape host placement explicit.
|
|
43
43
|
*/
|
|
44
44
|
|
|
45
45
|
export const Boundary = Object.assign(BoundaryRoot, {
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { StyleSheet } from "react-native";
|
|
5
|
+
import Animated from "react-native-reanimated";
|
|
6
|
+
import { NativePortalHost } from "../../../teleport";
|
|
7
|
+
import { createBoundaryContentPortalHostName } from "../helpers/host-name";
|
|
8
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
const AnimatedPortalHost = NativePortalHost ? Animated.createAnimatedComponent(NativePortalHost) : null;
|
|
10
|
+
export const BoundaryContentPortalHost = /*#__PURE__*/memo(function BoundaryContentPortalHost({
|
|
11
|
+
boundaryId,
|
|
12
|
+
children,
|
|
13
|
+
enabled,
|
|
14
|
+
screenKey
|
|
15
|
+
}) {
|
|
16
|
+
if (!enabled || !AnimatedPortalHost) {
|
|
17
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
18
|
+
children: children
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
const portalHostName = createBoundaryContentPortalHostName(screenKey, boundaryId);
|
|
22
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
23
|
+
children: [children, /*#__PURE__*/_jsx(AnimatedPortalHost, {
|
|
24
|
+
name: portalHostName,
|
|
25
|
+
style: styles.host
|
|
26
|
+
})]
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
const styles = StyleSheet.create({
|
|
30
|
+
host: {
|
|
31
|
+
...StyleSheet.absoluteFillObject,
|
|
32
|
+
overflow: "visible"
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","StyleSheet","Animated","NativePortalHost","createBoundaryContentPortalHostName","Fragment","_Fragment","jsx","_jsx","jsxs","_jsxs","AnimatedPortalHost","createAnimatedComponent","BoundaryContentPortalHost","boundaryId","children","enabled","screenKey","portalHostName","name","style","styles","host","create","absoluteFillObject","overflow"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAwB,OAAO;AAC5C,SAASC,UAAU,QAAQ,cAAc;AACzC,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,gBAAgB,QAAQ,mBAAmB;AACpD,SAASC,mCAAmC,QAAQ,sBAAsB;AAAC,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAE3E,MAAMC,kBAAkB,GAAGR,gBAAgB,GACxCD,QAAQ,CAACU,uBAAuB,CAACT,gBAAgB,CAAC,GAClD,IAAI;AASP,OAAO,MAAMU,yBAAyB,gBAAGb,IAAI,CAC5C,SAASa,yBAAyBA,CAAC;EAClCC,UAAU;EACVC,QAAQ;EACRC,OAAO;EACPC;AAC+B,CAAC,EAAE;EAClC,IAAI,CAACD,OAAO,IAAI,CAACL,kBAAkB,EAAE;IACpC,oBAAOH,IAAA,CAAAF,SAAA;MAAAS,QAAA,EAAGA;IAAQ,CAAG,CAAC;EACvB;EAEA,MAAMG,cAAc,GAAGd,mCAAmC,CACzDa,SAAS,EACTH,UACD,CAAC;EAED,oBACCJ,KAAA,CAAAJ,SAAA;IAAAS,QAAA,GACEA,QAAQ,eACTP,IAAA,CAACG,kBAAkB;MAACQ,IAAI,EAAED,cAAe;MAACE,KAAK,EAAEC,MAAM,CAACC;IAAK,CAAE,CAAC;EAAA,CAC/D,CAAC;AAEL,CACD,CAAC;AAED,MAAMD,MAAM,GAAGpB,UAAU,CAACsB,MAAM,CAAC;EAChCD,IAAI,EAAE;IACL,GAAGrB,UAAU,CAACuB,kBAAkB;IAChCC,QAAQ,EAAE;EACX;AACD,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const BOUNDARY_CONTENT_PORTAL_HOST_NAME_SUFFIX = "-content-portal-host";
|
|
4
|
+
export const createBoundaryContentPortalHostName = (screenKey, boundaryId) => {
|
|
5
|
+
"worklet";
|
|
6
|
+
|
|
7
|
+
return `${screenKey}-${boundaryId}${BOUNDARY_CONTENT_PORTAL_HOST_NAME_SUFFIX}`;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=host-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["BOUNDARY_CONTENT_PORTAL_HOST_NAME_SUFFIX","createBoundaryContentPortalHostName","screenKey","boundaryId"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.ts"],"mappings":";;AAAA,MAAMA,wCAAwC,GAAG,sBAAsB;AAEvE,OAAO,MAAMC,mCAAmC,GAAGA,CAClDC,SAAiB,EACjBC,UAAkB,KACd;EACJ,SAAS;;EACT,OAAO,GAAGD,SAAS,IAAIC,UAAU,GAAGH,wCAAwC,EAAE;AAC/E,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,189 @@
|
|
|
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 { pairs } from "../../../../../../stores/bounds/internals/state";
|
|
10
|
+
import { PORTAL_HOST_NAME_RESET_VALUE } from "../../../utils/naming";
|
|
11
|
+
import { canSwitchHandoffHostImmediately, isHandoffHostClosingComplete, resolveBoundaryPortalOwnership } from "../../../utils/ownership";
|
|
12
|
+
import { shallowEqual } from "../../../utils/shallow-equal";
|
|
13
|
+
import { shouldAttachBoundaryPortal } from "../../../utils/teleport-control";
|
|
14
|
+
import { resolveNextVisiblePortalHostName } from "../../../utils/visible-host";
|
|
15
|
+
import { createBoundaryContentPortalHostName } from "../helpers/host-name";
|
|
16
|
+
export const useBoundaryContentPortalAttachment = ({
|
|
17
|
+
boundaryId,
|
|
18
|
+
enabled
|
|
19
|
+
}) => {
|
|
20
|
+
const ownScreenSlots = useScreenSlots();
|
|
21
|
+
const sourcePairKey = useDescriptorsStore(s => s.derivations.sourcePairKey);
|
|
22
|
+
const currentScreenKey = useDescriptorsStore(s => s.derivations.currentScreenKey);
|
|
23
|
+
const [ownership, setOwnership] = useState(null);
|
|
24
|
+
const styleOwnerScreenKey = ownership?.ownerScreenKey ?? currentScreenKey;
|
|
25
|
+
const ownerScreenSlots = useRegisteredScreenSlots(styleOwnerScreenKey);
|
|
26
|
+
const activeScreenSlots = ownerScreenSlots ?? ownScreenSlots;
|
|
27
|
+
const {
|
|
28
|
+
nextInterpolatorReady: activeNextInterpolatorReady,
|
|
29
|
+
slotsMap: activeSlotsMap
|
|
30
|
+
} = activeScreenSlots;
|
|
31
|
+
const requestedPortalHostName = useSharedValue(null);
|
|
32
|
+
const visiblePortalHostName = useSharedValue(null);
|
|
33
|
+
const canSwitchPortalHostImmediately = useSharedValue(0);
|
|
34
|
+
const targetScreenKey = ownership ? ownership.hostScreenKey : null;
|
|
35
|
+
const settledHostScreenKey = ownership?.hostScreenKey ?? null;
|
|
36
|
+
const settledHostProgress = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "progressSettled");
|
|
37
|
+
const settledHostAnimating = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "progressAnimating");
|
|
38
|
+
const settledHostWillAnimate = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "willAnimate");
|
|
39
|
+
const settledHostClosing = AnimationStore.getValue(settledHostScreenKey ?? currentScreenKey, "closing");
|
|
40
|
+
const handoffHostName = targetScreenKey !== null ? createBoundaryContentPortalHostName(targetScreenKey, boundaryId) : null;
|
|
41
|
+
const updatePortalOwnership = useCallback((hostScreenKey, ownerPairKey, ownerScreenKey) => {
|
|
42
|
+
if (hostScreenKey && ownerPairKey && ownerScreenKey) {
|
|
43
|
+
setOwnership(current => {
|
|
44
|
+
if (current?.hostScreenKey === hostScreenKey && current.ownerPairKey === ownerPairKey && current.ownerScreenKey === ownerScreenKey) {
|
|
45
|
+
return current;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
hostScreenKey,
|
|
49
|
+
ownerPairKey,
|
|
50
|
+
ownerScreenKey,
|
|
51
|
+
status: "complete"
|
|
52
|
+
};
|
|
53
|
+
});
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
setOwnership(current => current ? null : current);
|
|
57
|
+
}, []);
|
|
58
|
+
useLayoutEffect(() => {
|
|
59
|
+
if (!enabled || !ownership || !handoffHostName) {
|
|
60
|
+
requestedPortalHostName.set(null);
|
|
61
|
+
visiblePortalHostName.set(null);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
requestedPortalHostName.set(handoffHostName);
|
|
65
|
+
}, [enabled, handoffHostName, ownership, requestedPortalHostName, visiblePortalHostName]);
|
|
66
|
+
useLayoutEffect(() => {
|
|
67
|
+
return () => {
|
|
68
|
+
requestedPortalHostName.set(null);
|
|
69
|
+
visiblePortalHostName.set(null);
|
|
70
|
+
};
|
|
71
|
+
}, [requestedPortalHostName, visiblePortalHostName]);
|
|
72
|
+
useAnimatedReaction(() => {
|
|
73
|
+
"worklet";
|
|
74
|
+
|
|
75
|
+
if (!enabled || !sourcePairKey) {
|
|
76
|
+
return {
|
|
77
|
+
hostScreenKey: null,
|
|
78
|
+
ownerPairKey: sourcePairKey,
|
|
79
|
+
ownerScreenKey: null,
|
|
80
|
+
status: "clear"
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
const progressAnimating = settledHostAnimating.get();
|
|
84
|
+
const progressSettled = settledHostProgress.get();
|
|
85
|
+
const willAnimate = settledHostWillAnimate.get();
|
|
86
|
+
return resolveBoundaryPortalOwnership({
|
|
87
|
+
boundaryId,
|
|
88
|
+
currentScreenKey,
|
|
89
|
+
handoff: true,
|
|
90
|
+
isSettledHostClosingComplete: isHandoffHostClosingComplete({
|
|
91
|
+
closing: settledHostClosing.get(),
|
|
92
|
+
progressAnimating,
|
|
93
|
+
progressSettled,
|
|
94
|
+
willAnimate
|
|
95
|
+
}),
|
|
96
|
+
isSettledHostReady: progressSettled === 1 && progressAnimating === 0,
|
|
97
|
+
pairsState: pairs.get(),
|
|
98
|
+
settledHostScreenKey,
|
|
99
|
+
sourcePairKey
|
|
100
|
+
});
|
|
101
|
+
}, (signal, previousSignal) => {
|
|
102
|
+
"worklet";
|
|
103
|
+
|
|
104
|
+
if (shallowEqual(previousSignal, signal)) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (signal.status === "pending") {
|
|
108
|
+
canSwitchPortalHostImmediately.set(0);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const hostScreenKey = signal.status === "complete" ? signal.hostScreenKey : null;
|
|
112
|
+
let previousOwnerPairKey;
|
|
113
|
+
if (previousSignal?.status === "complete") {
|
|
114
|
+
previousOwnerPairKey = previousSignal.ownerPairKey ?? undefined;
|
|
115
|
+
}
|
|
116
|
+
const canSwitchImmediately = canSwitchHandoffHostImmediately({
|
|
117
|
+
hostScreenKey,
|
|
118
|
+
ownerPairKey: signal.status === "complete" ? signal.ownerPairKey : undefined,
|
|
119
|
+
previousOwnerPairKey
|
|
120
|
+
});
|
|
121
|
+
canSwitchPortalHostImmediately.set(canSwitchImmediately ? 1 : 0);
|
|
122
|
+
if (canSwitchImmediately && hostScreenKey) {
|
|
123
|
+
const hostName = createBoundaryContentPortalHostName(hostScreenKey, boundaryId);
|
|
124
|
+
requestedPortalHostName.set(hostName);
|
|
125
|
+
visiblePortalHostName.set(hostName);
|
|
126
|
+
}
|
|
127
|
+
runOnJS(updatePortalOwnership)(signal.hostScreenKey, signal.ownerPairKey, signal.ownerScreenKey ?? undefined);
|
|
128
|
+
});
|
|
129
|
+
useAnimatedReaction(() => {
|
|
130
|
+
"worklet";
|
|
131
|
+
|
|
132
|
+
const slot = activeSlotsMap.get()[boundaryId];
|
|
133
|
+
const teleport = slot?.props?.teleport;
|
|
134
|
+
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
135
|
+
enabled,
|
|
136
|
+
teleport
|
|
137
|
+
});
|
|
138
|
+
const requestedName = requestedPortalHostName.get();
|
|
139
|
+
const visibleName = visiblePortalHostName.get();
|
|
140
|
+
const isInterpolatorReady = activeNextInterpolatorReady.get();
|
|
141
|
+
const nextVisibleName = resolveNextVisiblePortalHostName({
|
|
142
|
+
canSwitchImmediately: canSwitchPortalHostImmediately.get() === 1,
|
|
143
|
+
isInterpolatorReady: isInterpolatorReady === 1,
|
|
144
|
+
requestedName,
|
|
145
|
+
shouldTeleport,
|
|
146
|
+
visibleName
|
|
147
|
+
});
|
|
148
|
+
return {
|
|
149
|
+
isInterpolatorReady,
|
|
150
|
+
nextVisibleName,
|
|
151
|
+
requestedName,
|
|
152
|
+
shouldTeleport,
|
|
153
|
+
teleport,
|
|
154
|
+
visibleName
|
|
155
|
+
};
|
|
156
|
+
}, (state, previousState) => {
|
|
157
|
+
"worklet";
|
|
158
|
+
|
|
159
|
+
if (shallowEqual(previousState, state)) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (state.nextVisibleName !== state.visibleName) {
|
|
163
|
+
visiblePortalHostName.set(state.nextVisibleName);
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
const teleportProps = useAnimatedProps(() => {
|
|
167
|
+
"worklet";
|
|
168
|
+
|
|
169
|
+
const slot = activeSlotsMap.get()[boundaryId];
|
|
170
|
+
const {
|
|
171
|
+
teleport,
|
|
172
|
+
...slotProps
|
|
173
|
+
} = slot?.props ?? {};
|
|
174
|
+
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
175
|
+
enabled,
|
|
176
|
+
teleport
|
|
177
|
+
});
|
|
178
|
+
const visibleName = visiblePortalHostName.get();
|
|
179
|
+
return {
|
|
180
|
+
...slotProps,
|
|
181
|
+
hostName: shouldTeleport && visibleName ? visibleName : PORTAL_HOST_NAME_RESET_VALUE
|
|
182
|
+
};
|
|
183
|
+
});
|
|
184
|
+
return {
|
|
185
|
+
teleportProps,
|
|
186
|
+
visiblePortalHostName
|
|
187
|
+
};
|
|
188
|
+
};
|
|
189
|
+
//# sourceMappingURL=use-boundary-content-portal-attachment.js.map
|