react-native-screen-transitions 3.9.0-beta.0 → 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/animation/helpers/read-screen-animation-revisions.js +6 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js +50 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +7 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.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/animation/helpers/read-screen-animation-revisions.js +6 -1
- package/lib/module/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js +45 -0
- package/lib/module/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +7 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.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/animation/helpers/read-screen-animation-revisions.d.ts +4 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/read-screen-animation-revisions.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.d.ts +4 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.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/animation/helpers/read-screen-animation-revisions.ts +14 -0
- package/src/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.ts +75 -0
- package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +11 -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
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useLayoutEffect, useRef, 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 { pairs } from "../../../../../../stores/bounds/internals/state";
|
|
8
|
+
import { PORTAL_HOST_NAME_RESET_VALUE } from "../../../utils/naming";
|
|
9
|
+
import { resolveBoundaryPortalOwnership } from "../../../utils/ownership";
|
|
10
|
+
import { shallowEqual } from "../../../utils/shallow-equal";
|
|
11
|
+
import { shouldAttachBoundaryPortal } from "../../../utils/teleport-control";
|
|
12
|
+
import { resolveNextVisiblePortalHostName } from "../../../utils/visible-host";
|
|
13
|
+
import { createBoundaryPortalHostName } from "../helpers/host-name";
|
|
14
|
+
import { useActiveHostKey } from "../stores/host-registry.store";
|
|
15
|
+
import { dropStalePortalBoundaryHosts, mountPortalBoundaryHost, unmountPortalBoundaryHostByName } from "../stores/portal-boundary-host.store";
|
|
16
|
+
export const useBoundaryPortalAttachment = ({
|
|
17
|
+
boundaryId,
|
|
18
|
+
enabled
|
|
19
|
+
}) => {
|
|
20
|
+
const sourcePairKey = useDescriptorsStore(s => s.derivations.sourcePairKey);
|
|
21
|
+
const currentScreenKey = useDescriptorsStore(s => s.derivations.currentScreenKey);
|
|
22
|
+
const {
|
|
23
|
+
localStylesMaps,
|
|
24
|
+
nextInterpolatorReady,
|
|
25
|
+
slotsMap
|
|
26
|
+
} = useScreenSlots();
|
|
27
|
+
const [ownership, setOwnership] = useState(null);
|
|
28
|
+
const requestedPortalHostName = useSharedValue(null);
|
|
29
|
+
const visiblePortalHostName = useSharedValue(null);
|
|
30
|
+
const mountedPortalBoundaryHostNamesRef = useRef(new Set());
|
|
31
|
+
const escapeHostKey = useActiveHostKey(enabled ? currentScreenKey : null);
|
|
32
|
+
const updatePortalOwnership = useCallback((hostScreenKey, ownerPairKey, ownerScreenKey) => {
|
|
33
|
+
if (hostScreenKey && ownerPairKey && ownerScreenKey) {
|
|
34
|
+
setOwnership(current => {
|
|
35
|
+
if (current?.hostScreenKey === hostScreenKey && current.ownerPairKey === ownerPairKey && current.ownerScreenKey === ownerScreenKey) {
|
|
36
|
+
return current;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
hostScreenKey,
|
|
40
|
+
ownerPairKey,
|
|
41
|
+
ownerScreenKey,
|
|
42
|
+
status: "complete"
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
setOwnership(current => current ? null : current);
|
|
48
|
+
}, []);
|
|
49
|
+
const unmountOwnedPortalBoundaryHosts = useCallback(() => {
|
|
50
|
+
for (const portalHostName of mountedPortalBoundaryHostNamesRef.current) {
|
|
51
|
+
unmountPortalBoundaryHostByName(portalHostName);
|
|
52
|
+
}
|
|
53
|
+
mountedPortalBoundaryHostNamesRef.current.clear();
|
|
54
|
+
}, []);
|
|
55
|
+
useLayoutEffect(() => {
|
|
56
|
+
if (!enabled || !ownership || !escapeHostKey) {
|
|
57
|
+
requestedPortalHostName.set(null);
|
|
58
|
+
visiblePortalHostName.set(null);
|
|
59
|
+
unmountOwnedPortalBoundaryHosts();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const portalHostName = createBoundaryPortalHostName(escapeHostKey, boundaryId, ownership.ownerPairKey);
|
|
63
|
+
mountPortalBoundaryHost({
|
|
64
|
+
boundaryId,
|
|
65
|
+
escapeClipping: true,
|
|
66
|
+
hostKey: escapeHostKey,
|
|
67
|
+
localStylesMaps,
|
|
68
|
+
pairKey: ownership.ownerPairKey,
|
|
69
|
+
portalHostName,
|
|
70
|
+
screenKey: currentScreenKey,
|
|
71
|
+
slotsMap
|
|
72
|
+
});
|
|
73
|
+
mountedPortalBoundaryHostNamesRef.current.add(portalHostName);
|
|
74
|
+
|
|
75
|
+
// Request the new receiver immediately, but keep the currently visible
|
|
76
|
+
// receiver until the new interpolator is ready. This avoids a no-host gap
|
|
77
|
+
// during rapid close/open retargets.
|
|
78
|
+
requestedPortalHostName.set(portalHostName);
|
|
79
|
+
}, [boundaryId, currentScreenKey, enabled, escapeHostKey, localStylesMaps, ownership, requestedPortalHostName, slotsMap, unmountOwnedPortalBoundaryHosts, visiblePortalHostName]);
|
|
80
|
+
useLayoutEffect(() => {
|
|
81
|
+
return () => {
|
|
82
|
+
requestedPortalHostName.set(null);
|
|
83
|
+
visiblePortalHostName.set(null);
|
|
84
|
+
unmountOwnedPortalBoundaryHosts();
|
|
85
|
+
};
|
|
86
|
+
}, [requestedPortalHostName, unmountOwnedPortalBoundaryHosts, visiblePortalHostName]);
|
|
87
|
+
useAnimatedReaction(() => {
|
|
88
|
+
"worklet";
|
|
89
|
+
|
|
90
|
+
if (!enabled || !sourcePairKey) {
|
|
91
|
+
return {
|
|
92
|
+
hostScreenKey: null,
|
|
93
|
+
ownerPairKey: sourcePairKey,
|
|
94
|
+
ownerScreenKey: null,
|
|
95
|
+
status: "clear"
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
return resolveBoundaryPortalOwnership({
|
|
99
|
+
boundaryId,
|
|
100
|
+
currentScreenKey,
|
|
101
|
+
handoff: false,
|
|
102
|
+
pairsState: pairs.get(),
|
|
103
|
+
sourcePairKey
|
|
104
|
+
});
|
|
105
|
+
}, (signal, previousSignal) => {
|
|
106
|
+
"worklet";
|
|
107
|
+
|
|
108
|
+
if (shallowEqual(previousSignal, signal)) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
runOnJS(updatePortalOwnership)(signal.hostScreenKey, signal.ownerPairKey, signal.ownerScreenKey ?? undefined);
|
|
112
|
+
});
|
|
113
|
+
useAnimatedReaction(() => {
|
|
114
|
+
"worklet";
|
|
115
|
+
|
|
116
|
+
const slot = slotsMap.get()[boundaryId];
|
|
117
|
+
const teleport = slot?.props?.teleport;
|
|
118
|
+
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
119
|
+
enabled,
|
|
120
|
+
teleport
|
|
121
|
+
});
|
|
122
|
+
const requestedName = requestedPortalHostName.get();
|
|
123
|
+
const visibleName = visiblePortalHostName.get();
|
|
124
|
+
const isInterpolatorReady = nextInterpolatorReady.get();
|
|
125
|
+
const nextVisibleName = resolveNextVisiblePortalHostName({
|
|
126
|
+
isInterpolatorReady: isInterpolatorReady === 1,
|
|
127
|
+
requestedName,
|
|
128
|
+
shouldTeleport,
|
|
129
|
+
visibleName
|
|
130
|
+
});
|
|
131
|
+
return {
|
|
132
|
+
isInterpolatorReady,
|
|
133
|
+
nextVisibleName,
|
|
134
|
+
requestedName,
|
|
135
|
+
shouldTeleport,
|
|
136
|
+
teleport,
|
|
137
|
+
visibleName
|
|
138
|
+
};
|
|
139
|
+
}, (state, previousState) => {
|
|
140
|
+
"worklet";
|
|
141
|
+
|
|
142
|
+
if (shallowEqual(previousState, state)) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (state.nextVisibleName !== state.visibleName) {
|
|
146
|
+
visiblePortalHostName.set(state.nextVisibleName);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (state.visibleName && state.visibleName === state.requestedName) {
|
|
150
|
+
runOnJS(dropStalePortalBoundaryHosts)({
|
|
151
|
+
boundaryId,
|
|
152
|
+
keepPortalHostName: state.visibleName
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
const teleportProps = useAnimatedProps(() => {
|
|
157
|
+
"worklet";
|
|
158
|
+
|
|
159
|
+
const slot = slotsMap.get()[boundaryId];
|
|
160
|
+
const {
|
|
161
|
+
teleport,
|
|
162
|
+
...slotProps
|
|
163
|
+
} = slot?.props ?? {};
|
|
164
|
+
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
165
|
+
enabled,
|
|
166
|
+
teleport
|
|
167
|
+
});
|
|
168
|
+
const visibleName = visiblePortalHostName.get();
|
|
169
|
+
return {
|
|
170
|
+
...slotProps,
|
|
171
|
+
hostName: shouldTeleport && visibleName ? visibleName : PORTAL_HOST_NAME_RESET_VALUE
|
|
172
|
+
};
|
|
173
|
+
});
|
|
174
|
+
return {
|
|
175
|
+
teleportProps,
|
|
176
|
+
visiblePortalHostName
|
|
177
|
+
};
|
|
178
|
+
};
|
|
179
|
+
//# sourceMappingURL=use-boundary-portal-attachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useLayoutEffect","useRef","useState","runOnJS","useAnimatedProps","useAnimatedReaction","useSharedValue","useDescriptorsStore","useScreenSlots","pairs","PORTAL_HOST_NAME_RESET_VALUE","resolveBoundaryPortalOwnership","shallowEqual","shouldAttachBoundaryPortal","resolveNextVisiblePortalHostName","createBoundaryPortalHostName","useActiveHostKey","dropStalePortalBoundaryHosts","mountPortalBoundaryHost","unmountPortalBoundaryHostByName","useBoundaryPortalAttachment","boundaryId","enabled","sourcePairKey","s","derivations","currentScreenKey","localStylesMaps","nextInterpolatorReady","slotsMap","ownership","setOwnership","requestedPortalHostName","visiblePortalHostName","mountedPortalBoundaryHostNamesRef","Set","escapeHostKey","updatePortalOwnership","hostScreenKey","ownerPairKey","ownerScreenKey","current","status","unmountOwnedPortalBoundaryHosts","portalHostName","clear","set","escapeClipping","hostKey","pairKey","screenKey","add","handoff","pairsState","get","signal","previousSignal","undefined","slot","teleport","props","shouldTeleport","requestedName","visibleName","isInterpolatorReady","nextVisibleName","state","previousState","keepPortalHostName","teleportProps","slotProps","hostName"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts"],"mappings":";;AAAA,SAASA,WAAW,EAAEC,eAAe,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AACtE,SACCC,OAAO,EACPC,gBAAgB,EAChBC,mBAAmB,EACnBC,cAAc,QACR,yBAAyB;AAChC,SAASC,mBAAmB,QAAQ,gDAAgD;AACpF,SAASC,cAAc,QAAQ,2CAA2C;AAC1E,SAASC,KAAK,QAAQ,iDAAiD;AACvE,SAASC,4BAA4B,QAAQ,uBAAuB;AACpE,SAECC,8BAA8B,QACxB,0BAA0B;AACjC,SAASC,YAAY,QAAQ,8BAA8B;AAC3D,SAASC,0BAA0B,QAAQ,iCAAiC;AAC5E,SAASC,gCAAgC,QAAQ,6BAA6B;AAC9E,SAASC,4BAA4B,QAAQ,sBAAsB;AACnE,SAASC,gBAAgB,QAAQ,+BAA+B;AAChE,SACCC,4BAA4B,EAC5BC,uBAAuB,EACvBC,+BAA+B,QACzB,sCAAsC;AAO7C,OAAO,MAAMC,2BAA2B,GAAGA,CAAC;EAC3CC,UAAU;EACVC;AACkC,CAAC,KAAK;EACxC,MAAMC,aAAa,GAAGhB,mBAAmB,CAAEiB,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACF,aAAa,CAAC;EAC7E,MAAMG,gBAAgB,GAAGnB,mBAAmB,CAC1CiB,CAAC,IAAKA,CA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B,SAAS;;IACT,IAAIvD,YAAY,CAACuD,aAAa,EAAED,KAAK,CAAC,EAAE;MACvC;IACD;IAEA,IAAIA,KAAK,CAACD,eAAe,KAAKC,KAAK,CAACH,WAAW,EAAE;MAChD9B,qBAAqB,CAACa,GAAG,CAACoB,KAAK,CAACD,eAAe,CAAC;MAChD;IACD;IAEA,IAAIC,KAAK,CAACH,WAAW,IAAIG,KAAK,CAACH,WAAW,KAAKG,KAAK,CAACJ,aAAa,EAAE;MACnE3D,OAAO,CAACc,4BAA4B,CAAC,CAAC;QACrCI,UAAU;QACV+C,kBAAkB,EAAEF,KAAK,CAACH;MAC3B,CAAC,CAAC;IACH;EACD,CACD,CAAC;EAED,MAAMM,aAAa,GAAGjE,gBAAgB,CAAC,MAAM;IAC5C,SAAS;;IAET,MAAMsD,IAAI,GAAG7B,QAAQ,CAACyB,GAAG,CAAC,CAAC,CAACjC,UAAU,CAAC;IACvC,MAAM;MAAEsC,QAAQ;MAAE,GAAGW;IAAU,CAAC,GAAGZ,IAAI,EAAEE,KAAK,IAAI,CAAC,CAAC;IACpD,MAAMC,cAAc,GAAGhD,0BAA0B,CAAC;MACjDS,OAAO;MACPqC;IACD,CAAC,CAAC;IACF,MAAMI,WAAW,GAAG9B,qBAAqB,CAACqB,GAAG,CAAC,CAAC;IAE/C,OAAO;MACN,GAAGgB,SAAS;MACZC,QAAQ,EACPV,cAAc,IAAIE,WAAW,GAC1BA,WAAW,GACXrD;IACL,CAAC;EACF,CAAC,CAAC;EAEF,OAAO;IACN2D,aAAa;IACbpC;EACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -2,16 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
import { useLayoutEffect, useState } from "react";
|
|
4
4
|
import { cancelAnimation, measure, runOnJS, runOnUI, useAnimatedReaction, useAnimatedRef, useSharedValue, withDelay, withTiming } from "react-native-reanimated";
|
|
5
|
-
import { useOriginContext } from "
|
|
6
|
-
import { ScrollStore } from "
|
|
7
|
-
import {
|
|
5
|
+
import { useOriginContext } from "../../../../../../providers/screen/origin.provider";
|
|
6
|
+
import { ScrollStore } from "../../../../../../stores/scroll.store";
|
|
7
|
+
import { getVisibilityBlockOffset } from "../../../../../../utils/visibility-block-offset";
|
|
8
|
+
import { adjustedMeasuredBoundsForOverscrollDeltas, isMeasurementInViewport, normalizeMeasuredBoundsWithVisibilityGate } from "../../../../utils/measured-bounds";
|
|
8
9
|
import { clearPortalHostBounds, setPortalHostBounds } from "../stores/host-bounds.store";
|
|
9
10
|
const HOST_MEASUREMENT_RETRY_DELAY_MS = 16;
|
|
10
11
|
export const useHostMeasurement = ({
|
|
11
12
|
capturesScroll,
|
|
12
13
|
enabled,
|
|
13
14
|
hostKey,
|
|
14
|
-
screenKey
|
|
15
|
+
screenKey,
|
|
16
|
+
visibilityBlocked,
|
|
17
|
+
viewportHeight,
|
|
18
|
+
viewportWidth
|
|
15
19
|
}) => {
|
|
16
20
|
const hostRef = useAnimatedRef();
|
|
17
21
|
const scrollMetadata = ScrollStore.getValue(screenKey, "metadata");
|
|
@@ -56,7 +60,21 @@ export const useHostMeasurement = ({
|
|
|
56
60
|
// position instead; clamped scroll deltas share that basis.
|
|
57
61
|
const currentScroll = scrollMetadata.get();
|
|
58
62
|
const overscrollNormalized = capturesScroll ? adjustedMeasuredBoundsForOverscrollDeltas(measured, currentScroll) : measured;
|
|
59
|
-
const normalizedMeasured =
|
|
63
|
+
const normalizedMeasured = normalizeMeasuredBoundsWithVisibilityGate({
|
|
64
|
+
measured: overscrollNormalized,
|
|
65
|
+
origin: measuredOrigin,
|
|
66
|
+
visibilityBlocked: visibilityBlocked.get(),
|
|
67
|
+
visibilityBlockOffset: getVisibilityBlockOffset(viewportHeight),
|
|
68
|
+
viewportWidth,
|
|
69
|
+
viewportHeight
|
|
70
|
+
});
|
|
71
|
+
if (!isMeasurementInViewport(normalizedMeasured, viewportWidth, viewportHeight)) {
|
|
72
|
+
cancelAnimation(retryToken);
|
|
73
|
+
retryToken.set(withDelay(HOST_MEASUREMENT_RETRY_DELAY_MS, withTiming(retryToken.get() + 1, {
|
|
74
|
+
duration: 0
|
|
75
|
+
})));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
60
78
|
setPortalHostBounds(hostKey, {
|
|
61
79
|
x: normalizedMeasured.x,
|
|
62
80
|
y: normalizedMeasured.y,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useLayoutEffect","useState","cancelAnimation","measure","runOnJS","runOnUI","useAnimatedReaction","useAnimatedRef","useSharedValue","withDelay","withTiming","useOriginContext","ScrollStore","getVisibilityBlockOffset","adjustedMeasuredBoundsForOverscrollDeltas","isMeasurementInViewport","normalizeMeasuredBoundsWithVisibilityGate","clearPortalHostBounds","setPortalHostBounds","HOST_MEASUREMENT_RETRY_DELAY_MS","useHostMeasurement","capturesScroll","enabled","hostKey","screenKey","visibilityBlocked","viewportHeight","viewportWidth","hostRef","scrollMetadata","getValue","canRenderHosts","setCanRenderHosts","originRef","hasMeasuredHost","retryToken","get","state","hasAlreadyMeasured","measured","measuredOrigin","set","duration","currentScroll","overscrollNormalized","normalizedMeasured","origin","visibilityBlockOffset","x","y","width","height","pageX","pageY","scroll"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.ts"],"mappings":";;AAAA,SAASA,eAAe,EAAEC,QAAQ,QAAQ,OAAO;AAEjD,SACCC,eAAe,EACfC,OAAO,EACPC,OAAO,EACPC,OAAO,EAEPC,mBAAmB,EACnBC,cAAc,EACdC,cAAc,EACdC,SAAS,EACTC,UAAU,QACJ,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,oDAAoD;AACrF,SAASC,WAAW,QAAQ,uCAAuC;AACnE,SAASC,wBAAwB,QAAQ,iDAAiD;AAC1F,SACCC,yCAAyC,EACzCC,uBAAuB,EACvBC,yCAAyC,QACnC,mCAAmC;AAC1C,SACCC,qBAAqB,EACrBC,mBAAmB,QACb,6BAA6B;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1C,CAAC,CAAC;IAEFvC,OAAO,CAAC4B,iBAAiB,CAAC,CAAC,IAAI,CAAC;EACjC,CACD,CAAC;EAEDhC,eAAe,CAAC,MAAM;IACrB,OAAO,MAAM;MACZK,OAAO,CAACY,qBAAqB,CAAC,CAACM,OAAO,CAAC;IACxC,CAAC;EACF,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EAEb,OAAO;IACNQ,cAAc;IACdH;EACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -2,22 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
import { useCallback } from "react";
|
|
4
4
|
import { useAnimatedStyle, useSharedValue } from "react-native-reanimated";
|
|
5
|
-
export const usePlaceholderStyles = ({
|
|
6
|
-
visiblePortalHostName
|
|
7
|
-
}) => {
|
|
5
|
+
export const usePlaceholderStyles = () => {
|
|
8
6
|
const placeholderWidth = useSharedValue(0);
|
|
9
7
|
const placeholderHeight = useSharedValue(0);
|
|
10
8
|
// Pin the placeholder to its measured size while content lives in the host,
|
|
11
|
-
// in the same UI frame the host name flips
|
|
9
|
+
// in the same UI frame the host name flips - no commit in between. Until the
|
|
12
10
|
// first layout lands (dims 0) sizing stays natural so an instant attach
|
|
13
11
|
// cannot collapse the slot.
|
|
14
12
|
const placeholderStyle = useAnimatedStyle(() => {
|
|
15
13
|
"worklet";
|
|
16
14
|
|
|
17
|
-
const isAttached = visiblePortalHostName.get() !== null;
|
|
18
15
|
const width = placeholderWidth.get();
|
|
19
16
|
const height = placeholderHeight.get();
|
|
20
|
-
if (
|
|
17
|
+
if (width === 0) {
|
|
21
18
|
return {
|
|
22
19
|
width: "auto",
|
|
23
20
|
height: "auto"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useAnimatedStyle","useSharedValue","usePlaceholderStyles","placeholderWidth","placeholderHeight","placeholderStyle","width","get","height","handleOnLayout","layout","hasValidDimensions","set"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/bo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oreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import { BoundaryPortalSlot } from "./components/portal-slot";
|
|
5
|
+
import { useBoundaryPortalAttachment } from "./hooks/use-boundary-portal-attachment";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export const BoundaryPortal = /*#__PURE__*/memo(function BoundaryPortal({
|
|
8
|
+
boundaryId,
|
|
9
|
+
children,
|
|
10
|
+
enabled,
|
|
11
|
+
placeholderRef,
|
|
12
|
+
pointerEvents
|
|
13
|
+
}) {
|
|
14
|
+
const {
|
|
15
|
+
teleportProps
|
|
16
|
+
} = useBoundaryPortalAttachment({
|
|
17
|
+
boundaryId,
|
|
18
|
+
enabled
|
|
19
|
+
});
|
|
20
|
+
return /*#__PURE__*/_jsx(BoundaryPortalSlot, {
|
|
21
|
+
id: boundaryId,
|
|
22
|
+
enabled: enabled,
|
|
23
|
+
animatedProps: teleportProps,
|
|
24
|
+
placeholderRef: placeholderRef,
|
|
25
|
+
pointerEvents: pointerEvents,
|
|
26
|
+
children: children
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","BoundaryPortalSlot","useBoundaryPortalAttachment","jsx","_jsx","BoundaryPortal","boundaryId","children","enabled","placeholderRef","pointerEvents","teleportProps","id","animatedProps"],"sourceRoot":"../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/index.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAwB,OAAO;AAG5C,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,2BAA2B,QAAQ,wCAAwC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAUrF,OAAO,MAAMC,cAAc,gBAAGL,IAAI,CAAC,SAASK,cAAcA,CAAC;EAC1DC,UAAU;EACVC,QAAQ;EACRC,OAAO;EACPC,cAAc;EACdC;AACoB,CAAC,EAAE;EACvB,MAAM;IAAEC;EAAc,CAAC,GAAGT,2BAA2B,CAAC;IACrDI,UAAU;IACVE;EACD,CAAC,CAAC;EAEF,oBACCJ,IAAA,CAACH,kBAAkB;IAClBW,EAAE,EAAEN,UAAW;IACfE,OAAO,EAAEA,OAAQ;IACjBK,aAAa,EAAEF,aAAc;IAC7BF,cAAc,EAAEA,cAAe;IAC/BC,aAAa,EAAEA,aAAc;IAAAH,QAAA,EAE5BA;EAAQ,CACU,CAAC;AAEvB,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { makeMutable } from "react-native-reanimated";
|
|
4
|
-
import { cloneScrollMetadataState } from "
|
|
4
|
+
import { cloneScrollMetadataState } from "../../../../../../stores/scroll.store";
|
|
5
5
|
const portalHostBounds = makeMutable({});
|
|
6
6
|
export const getPortalHostBounds = hostKey => {
|
|
7
7
|
"worklet";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["makeMutable","cloneScrollMetadataState","portalHostBounds","getPortalHostBounds","hostKey","get","setPortalHostBounds","bounds","nextBounds","scroll","set","state","clearPortalHostBounds","nextState"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.ts"],"mappings":";;AAAA,SAAkCA,WAAW,QAAQ,yBAAyB;AAC9E,SAASC,wBAAwB,QAAQ,uCAAuC;AAShF,MAAMC,gBAAgB,GAAGF,WAAW,CAAwB,CAAC,CAAC,CAAC;AAE/D,OAAO,MAAMG,mBAAmB,GAAIC,OAAe,IAAK;EACvD,SAAS;;EACT,OAAOF,gBAAgB,CAACG,GAAG,CAAC,CAAC,CAACD,OAAO,CAAC,IAAI,IAAI;AAC/C,CAAC;AAED,OAAO,MAAME,mBAAmB,GAAGA,CAClCF,OAAe,EACfG,MAAwB,KACpB;EACJ,SAAS;;EACT,MAAMC,UAA4B,GAAG;IACpC,GAAGD,MAAM;IACTE,MAAM,EAAER,wBAAwB,CAACM,MAAM,CAACE,MAAM;EAC/C,CAAC;EAEDP,gBAAgB,CAACQ,GAAG,CAAEC,KAAK,IAAK;IAC/B,SAAS;;IACT,OAAO;MACN,GAAGA,KAAK;MACR,CAACP,OAAO,GAAGI;IACZ,CAAC;EACF,CAAC,CAAC;AACH,CAAC;AAED,OAAO,MAAMI,qBAAqB,GAAIR,OAAe,IAAK;EACzD,SAAS;;EACTF,gBAAgB,CAACQ,GAAG,CAAEC,KAAK,IAAK;IAC/B,SAAS;;IACT,MAAME,SAAgC,GAAG;MAAE,GAAGF;IAAM,CAAC;IACrD,OAAOE,SAAS,CAACT,OAAO,CAAC;IACzB,OAAOS,SAAS;EACjB,CAAC,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useSyncExternalStore","EMPTY_SNAPSHOT","listeners","Set","hostStacks","Map","snapshot","getActiveHostFromStack","screenKey","stack","length","index","host","fallback","hostKey","buildSnapshot","nextSnapshot","emit","listener","subscribe","add","delete","registerHost","registration","get","previousActiveHostKey","nextStack","filter","unshift","push","set","unregisterHost","getActiveHostKey","useActiveHostKey","undefined","resetHostRegistry","clear"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,OAAO;AAW5C,MAAMC,cAAoC,GAAG,CAAC,CAAC;AAE/C,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;AACvC,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAA6B,CAAC;AAExD,IAAIC,QAA8B,GAAGL,cAAc;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,sBAAsB,GAAGA,CAC9BC,SAAiB,EACjBC,KAAqC,KACjC;EACJ,IAAI,CAACA,KAAK,IAAIA,K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MAAMyB,gBAAgB,GAAIzB,SAAyB,IAAK;EAC9D,OAAOR,oBAAoB,CAC1BmB,SAAS,EACT,MAAOX,SAAS,GAAGwB,gBAAgB,CAACxB,SAAS,CAAC,GAAG0B,SAAU,EAC3D,MAAMA,SACP,CAAC;AACF,CAAC;AAED,OAAO,MAAMC,iBAAiB,GAAGA,CAAA,KAAM;EACtC/B,UAAU,CAACgC,KAAK,CAAC,CAAC;EAClB9B,QAAQ,GAAGL,cAAc;EACzBgB,IAAI,CAAC,CAAC;AACP,CAAC","ignoreList":[]}
|
|
@@ -35,16 +35,8 @@ export const mountPortalBoundaryHost = host => {
|
|
|
35
35
|
activeBoundaryHosts.set(host.portalHostName, host);
|
|
36
36
|
emit();
|
|
37
37
|
};
|
|
38
|
-
export const
|
|
39
|
-
|
|
40
|
-
for (const [hostEntryKey, host] of activeBoundaryHosts) {
|
|
41
|
-
if (host.boundaryId !== boundaryId) {
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
activeBoundaryHosts.delete(hostEntryKey);
|
|
45
|
-
didDelete = true;
|
|
46
|
-
}
|
|
47
|
-
if (!didDelete) {
|
|
38
|
+
export const unmountPortalBoundaryHostByName = portalHostName => {
|
|
39
|
+
if (!portalHostName || !activeBoundaryHosts.delete(portalHostName)) {
|
|
48
40
|
return;
|
|
49
41
|
}
|
|
50
42
|
emit();
|
|
@@ -59,6 +51,9 @@ export const dropStalePortalBoundaryHosts = ({
|
|
|
59
51
|
boundaryId,
|
|
60
52
|
keepPortalHostName
|
|
61
53
|
}) => {
|
|
54
|
+
if (!activeBoundaryHosts.has(keepPortalHostName)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
62
57
|
let didDelete = false;
|
|
63
58
|
for (const [hostEntryKey, host] of activeBoundaryHosts) {
|
|
64
59
|
if (host.boundaryId !== boundaryId || host.portalHostName === keepPortalHostName) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useSyncExternalStore","EMPTY_HOSTS","listeners","Set","activeBoundaryHosts","Map","snapshot","hostsByScope","buildSnapshot","host","values","hosts","hostKey","push","emit","listener","isSameHost","a","b","boundaryId","escapeClipping","localStylesMaps","pairKey","portalHostName","screenKey","slotsMap","mountPortalBoundaryHost","previous","get","set","unmountPortalBoundaryHostByName","delete","dropStalePortalBoundaryHosts","keepPortalHostName","has","didDelete","hostEntryKey","subscribe","add","useActivePortalBoundaryHosts"],"sourceRoot":"../../../../../../../../../src","sources":["shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,OAAO;AAoB5C,MAAMC,WAAuC,GAAG,EAAE;AAElD,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;AACvC,MAAMC,mBAAmB,GAAG,IAAIC,GAAG,CAAmC,CAAC;AAEvE,IAAIC,QAAwB,GAAG;EAC9BC,YAAY,EAAE,CAAC;AAChB,CAAC;AAED,MAAMC,aAAa,GAAGA,CAAA,KAAsB;EAC3C,MAAMD,YAAwD,GAAG,CAAC,CAAC;EAEnE,KAAK,MAAME,IAAI,IAAIL,mBAAmB,CAACM,MAAM,CAAC,CAAC,EAAE;IAChD,MAAMC,KAAK,GAAGJ,YAAY,CAACE,IAAI,CAACG,OAAO,CAAC,IAAI,EAAE;IAC9CD,KAAK,CAACE,IAAI,CAACJ,IAAI,CAAC;IAChBF,YAAY,CAACE,IAAI,CAACG,OAAO,CAAC,GAAGD,KAAK;EACnC;EAEA,OAAO;IACNJ;EACD,CAAC;AACF,CAAC;AAED,MAAMO,IAAI,GAAGA,CAAA,KAAM;EAClBR,QAAQ,GAAGE,aAAa,CAAC,CAAC;EAE1B,KAAK,MAAMO,QAAQ,IAAIb,SAAS,EAAE;IACjCa,QAAQ,CAAC,CAAC;EACX;AACD,CAAC;AAED,MAAMC,UAAU,GAAGA,CAClBC,CAA2B,EAC3BC,CAA2B,KACvB;EACJ,OACCD,CAAC,CAACE,UAAU,KAAKD,CAAC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V,IAAI,CAACc,cAAc,KAAKU,kBAAkB,EACzC;MACD;IACD;IAEA7B,mBAAmB,CAAC2B,MAAM,CAACK,YAAY,CAAC;IACxCD,SAAS,GAAG,IAAI;EACjB;EAEA,IAAI,CAACA,SAAS,EAAE;IACf;EACD;EAEArB,IAAI,CAAC,CAAC;AACP,CAAC;AAED,MAAMuB,SAAS,GAAItB,QAAoB,IAAK;EAC3Cb,SAAS,CAACoC,GAAG,CAACvB,QAAQ,CAAC;EAEvB,OAAO,MAAM;IACZb,SAAS,CAAC6B,MAAM,CAAChB,QAAQ,CAAC;EAC3B,CAAC;AACF,CAAC;AAED,OAAO,MAAMwB,4BAA4B,GAAI3B,OAAe,IAAK;EAChE,OAAOZ,oBAAoB,CAC1BqC,SAAS,EACT,MAAM/B,QAAQ,CAACC,YAAY,CAACK,OAAO,CAAC,IAAIX,WAAW,EACnD,MAAMA,WACP,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
export { Host } from "./components/host";
|
|
4
|
-
export { Portal } from "./components/portal";
|
|
3
|
+
export { Host } from "./components/boundary-portal/components/host";
|
|
5
4
|
export { PortalProvider } from "./components/portal-provider";
|
|
6
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Host","
|
|
1
|
+
{"version":3,"names":["Host","PortalProvider"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/portal/index.ts"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,8CAA8C;AACnE,SAASC,cAAc,QAAQ,8BAA8B","ignoreList":[]}
|
|
@@ -7,8 +7,8 @@ import { createElement } from "react";
|
|
|
7
7
|
* try/catch so Metro treats it as an optional dependency — an absent module no
|
|
8
8
|
* longer fails the bundle, it throws at runtime and the catch swallows it.
|
|
9
9
|
*
|
|
10
|
-
* When teleport is missing,
|
|
11
|
-
* rendering; everything else keeps working.
|
|
10
|
+
* When teleport is missing, handoff and escapeClipping boundaries degrade to
|
|
11
|
+
* inline rendering; everything else keeps working.
|
|
12
12
|
*/
|
|
13
13
|
let mod = null;
|
|
14
14
|
let managerMod = null;
|
|
@@ -1,16 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
export const PORTAL_HOST_NAME_RESET_VALUE = null;
|
|
4
|
-
const PORTAL_HOST_NAME_SUFFIX = "-portal-host";
|
|
5
|
-
const BOUNDARY_LOCAL_PORTAL_HOST_NAME_SUFFIX = "-boundary-local-portal-host";
|
|
6
|
-
export const createPortalBoundaryHostName = (hostKey, boundaryId, pairKey) => {
|
|
7
|
-
"worklet";
|
|
8
|
-
|
|
9
|
-
return `${hostKey}-${pairKey ? `${pairKey}-` : ""}${boundaryId}${PORTAL_HOST_NAME_SUFFIX}`;
|
|
10
|
-
};
|
|
11
|
-
export const createBoundaryLocalPortalHostName = (screenKey, boundaryId) => {
|
|
12
|
-
"worklet";
|
|
13
|
-
|
|
14
|
-
return `${screenKey}-${boundaryId}${BOUNDARY_LOCAL_PORTAL_HOST_NAME_SUFFIX}`;
|
|
15
|
-
};
|
|
16
4
|
//# sourceMappingURL=naming.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["PORTAL_HOST_NAME_RESET_VALUE"
|
|
1
|
+
{"version":3,"names":["PORTAL_HOST_NAME_RESET_VALUE"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/utils/naming.ts"],"mappings":";;AAAA,OAAO,MAAMA,4BAA4B,GAAG,IAAI","ignoreList":[]}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { getDestinationScreenKeyFromPairKey, getLinkKeyFromTag, getLink as getPairLink, getSourceScreenKeyFromPairKey } from "../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
4
|
+
export const isHandoffHostClosingComplete = ({
|
|
5
|
+
closing,
|
|
6
|
+
progressAnimating,
|
|
7
|
+
progressSettled,
|
|
8
|
+
willAnimate
|
|
9
|
+
}) => {
|
|
10
|
+
"worklet";
|
|
11
|
+
|
|
12
|
+
// A close request marks `closing` before its animation starts. Springs can
|
|
13
|
+
// also enter their settle-distance threshold before their final frame.
|
|
14
|
+
return !!closing && willAnimate === 0 && progressSettled === 1 && progressAnimating === 0;
|
|
15
|
+
};
|
|
4
16
|
const hasSeenScreenKey = (screenKeys, screenKey) => {
|
|
5
17
|
"worklet";
|
|
6
18
|
|
|
@@ -11,11 +23,6 @@ const hasSeenScreenKey = (screenKeys, screenKey) => {
|
|
|
11
23
|
}
|
|
12
24
|
return false;
|
|
13
25
|
};
|
|
14
|
-
export const usesEscapeClippingHost = link => {
|
|
15
|
-
"worklet";
|
|
16
|
-
|
|
17
|
-
return link?.source?.handoff === true && link.source.escapeClipping === true;
|
|
18
|
-
};
|
|
19
26
|
const isReturningToPreviousSourceHost = ({
|
|
20
27
|
hostScreenKey,
|
|
21
28
|
ownerPairKey,
|
|
@@ -28,7 +35,7 @@ const isReturningToPreviousSourceHost = ({
|
|
|
28
35
|
const ownerDestinationScreenKey = getDestinationScreenKeyFromPairKey(ownerPairKey);
|
|
29
36
|
return previousDestinationScreenKey !== "" && ownerDestinationScreenKey !== "" && previousDestinationScreenKey !== previousSourceScreenKey && ownerDestinationScreenKey === previousSourceScreenKey && hostScreenKey === previousSourceScreenKey;
|
|
30
37
|
};
|
|
31
|
-
export const
|
|
38
|
+
export const canSwitchHandoffHostImmediately = ({
|
|
32
39
|
hostScreenKey,
|
|
33
40
|
ownerPairKey,
|
|
34
41
|
previousOwnerPairKey
|
|
@@ -64,7 +71,7 @@ const isActiveHandoffLink = ({
|
|
|
64
71
|
const activeId = pairsState[pairKey]?.groups?.[link.group]?.activeId;
|
|
65
72
|
return !activeId || activeId === linkKey;
|
|
66
73
|
};
|
|
67
|
-
const
|
|
74
|
+
const resolveHandoffStyleOwnerScreenKey = ({
|
|
68
75
|
hostScreenKey,
|
|
69
76
|
isSettledHostReady,
|
|
70
77
|
settledHostScreenKey,
|
|
@@ -100,7 +107,6 @@ const clearSignal = sourcePairKey => {
|
|
|
100
107
|
export const resolveBoundaryPortalOwnership = ({
|
|
101
108
|
boundaryId,
|
|
102
109
|
currentScreenKey,
|
|
103
|
-
escapeClipping,
|
|
104
110
|
handoff,
|
|
105
111
|
isSettledHostClosingComplete = false,
|
|
106
112
|
isSettledHostReady = false,
|
|
@@ -133,7 +139,6 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
133
139
|
}
|
|
134
140
|
let hostScreenKey = link.destination.screenKey;
|
|
135
141
|
let ownerPairKey = sourcePairKey;
|
|
136
|
-
let previousOwnerPairKey = null;
|
|
137
142
|
const seenScreenKeys = [getSourceScreenKeyFromPairKey(sourcePairKey), hostScreenKey];
|
|
138
143
|
const pairKeys = Object.keys(pairsState);
|
|
139
144
|
for (let hop = 0; hop < pairKeys.length; hop++) {
|
|
@@ -165,7 +170,6 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
165
170
|
continue;
|
|
166
171
|
}
|
|
167
172
|
const nextHostScreenKey = candidate.destination.screenKey;
|
|
168
|
-
previousOwnerPairKey = ownerPairKey;
|
|
169
173
|
ownerPairKey = candidatePairKey;
|
|
170
174
|
hostScreenKey = nextHostScreenKey;
|
|
171
175
|
if (hasSeenScreenKey(seenScreenKeys, nextHostScreenKey)) {
|
|
@@ -187,12 +191,10 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
187
191
|
}
|
|
188
192
|
break;
|
|
189
193
|
}
|
|
190
|
-
|
|
191
|
-
const ownerUsesEscapeClipping = ownerLink?.source?.escapeClipping ?? escapeClipping;
|
|
192
|
-
if (!ownerUsesEscapeClipping && isSettledHostClosingComplete && settledHostScreenKey === hostScreenKey && previousOwnerPairKey) {
|
|
194
|
+
if (isSettledHostClosingComplete && settledHostScreenKey === hostScreenKey) {
|
|
193
195
|
hostScreenKey = getSourceScreenKeyFromPairKey(ownerPairKey);
|
|
194
196
|
}
|
|
195
|
-
const ownerScreenKey =
|
|
197
|
+
const ownerScreenKey = resolveHandoffStyleOwnerScreenKey({
|
|
196
198
|
hostScreenKey,
|
|
197
199
|
isSettledHostReady,
|
|
198
200
|
settledHostScreenKey,
|
|
@@ -205,42 +207,4 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
205
207
|
status: "complete"
|
|
206
208
|
};
|
|
207
209
|
};
|
|
208
|
-
export const hasHandoffEscapeContinuation = ({
|
|
209
|
-
linkKey,
|
|
210
|
-
linkState,
|
|
211
|
-
sourceScreenKey
|
|
212
|
-
}) => {
|
|
213
|
-
"worklet";
|
|
214
|
-
|
|
215
|
-
const pairKeys = Object.keys(linkState);
|
|
216
|
-
const visitedScreenKeys = [];
|
|
217
|
-
let cursorScreenKey = sourceScreenKey;
|
|
218
|
-
for (let hop = 0; hop < pairKeys.length; hop++) {
|
|
219
|
-
if (hasSeenScreenKey(visitedScreenKeys, cursorScreenKey)) {
|
|
220
|
-
return false;
|
|
221
|
-
}
|
|
222
|
-
visitedScreenKeys.push(cursorScreenKey);
|
|
223
|
-
let previousScreenKey = null;
|
|
224
|
-
for (let index = 0; index < pairKeys.length; index++) {
|
|
225
|
-
const candidatePairKey = pairKeys[index];
|
|
226
|
-
const link = candidatePairKey ? linkState[candidatePairKey]?.links?.[linkKey] : null;
|
|
227
|
-
if (!link?.source || !link.destination || link.destination.screenKey !== cursorScreenKey) {
|
|
228
|
-
continue;
|
|
229
|
-
}
|
|
230
|
-
if (usesEscapeClippingHost(link)) {
|
|
231
|
-
return true;
|
|
232
|
-
}
|
|
233
|
-
if (!link.source.handoff) {
|
|
234
|
-
return false;
|
|
235
|
-
}
|
|
236
|
-
previousScreenKey = link.source.screenKey;
|
|
237
|
-
break;
|
|
238
|
-
}
|
|
239
|
-
if (!previousScreenKey) {
|
|
240
|
-
return false;
|
|
241
|
-
}
|
|
242
|
-
cursorScreenKey = previousScreenKey;
|
|
243
|
-
}
|
|
244
|
-
return false;
|
|
245
|
-
};
|
|
246
210
|
//# sourceMappingURL=ownership.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getDestinationScreenKeyFromPairKey","getLinkKeyFromTag","getLink","getPairLink","getSourceScreenKeyFromPairKey","
|
|
1
|
+
{"version":3,"names":["getDestinationScreenKeyFromPairKey","getLinkKeyFromTag","getLink","getPairLink","getSourceScreenKeyFromPairKey","isHandoffHostClosingComplete","closing","progressAnimating","progressSettled","willAnimate","hasSeenScreenKey","screenKeys","screenKey","index","length","isReturningToPreviousSourceHost","hostScreenKey","ownerPairKey","previousOwnerPairKey","previousSourceScreenKey","previousDestinationScreenKey","ownerDestinationScreenKey","canSwitchHandoffHostImmediately","isActiveHandoffLink","link","linkKey","pairKey","pairsState","group","activeId","groups","resolveHandoffStyleOwnerScreenKey","isSettledHostReady","settledHostScreenKey","sourceScreenKey","pendingSignal","sourcePairKey","ownerScreenKey","status","clearSignal","resolveBoundaryPortalOwnership","boundaryId","currentScreenKey","handoff","isSettledHostClosingComplete","destination","seenScreenKeys","pairKeys","Object","keys","hop","didAdvance","hasPendingNextHop","didHitVisitedScreen","candidatePairKey","candidate","source","nextHostScreenKey","push"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/utils/ownership.ts"],"mappings":";;AAAA,SACCA,kCAAkC,EAClCC,iBAAiB,EACjBC,OAAO,IAAIC,WAAW,EACtBC,6BAA6B,QACvB,sDAAsD;AAuB7D,OAAO,MAAMC,4BAA4B,GAAGA,CAAC;EAC5CC,OAAO;EACPC,iBAAiB;EACjBC,eAAe;EACfC;AAMD,CAAC,KAAK;EACL,SAAS;;EAET;EACA;EACA,OACC,CAAC,CAACH,OAAO,IACTG,WAAW,KAAK,CAAC,IACjBD,eAAe,KAAK,CAAC,IACrBD,iBAAiB,KAAK,CAAC;AAEzB,CAAC;AAED,MAAMG,gBAAgB,GAAGA,CAACC,UAAuB,EAAEC,SAAoB,KAAK;EAC3E,SAAS;;EACT,KAAK,IAAIC,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