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
|
@@ -1,412 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ComponentProps,
|
|
3
|
-
type ComponentType,
|
|
4
|
-
memo,
|
|
5
|
-
type ReactNode,
|
|
6
|
-
useCallback,
|
|
7
|
-
useLayoutEffect,
|
|
8
|
-
useState,
|
|
9
|
-
} from "react";
|
|
10
|
-
import type { View } from "react-native";
|
|
11
|
-
import Animated, {
|
|
12
|
-
type AnimatedRef,
|
|
13
|
-
runOnJS,
|
|
14
|
-
runOnUI,
|
|
15
|
-
useAnimatedProps,
|
|
16
|
-
useAnimatedReaction,
|
|
17
|
-
useSharedValue,
|
|
18
|
-
} from "react-native-reanimated";
|
|
19
|
-
import { EPSILON } from "../../../../constants";
|
|
20
|
-
import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
|
|
21
|
-
import { useScreenSlots } from "../../../../providers/screen/styles";
|
|
22
|
-
import { useRegisteredScreenSlots } from "../../../../providers/screen/styles/stores/slot-references.store";
|
|
23
|
-
import { AnimationStore } from "../../../../stores/animation.store";
|
|
24
|
-
import { pairs } from "../../../../stores/bounds/internals/state";
|
|
25
|
-
import { logger } from "../../../../utils/logger";
|
|
26
|
-
import { usePlaceholderStyles } from "../hooks/use-placeholder-styles";
|
|
27
|
-
import { useActiveHostKey } from "../stores/host-registry.store";
|
|
28
|
-
import {
|
|
29
|
-
dropStalePortalBoundaryHosts,
|
|
30
|
-
mountPortalBoundaryHost,
|
|
31
|
-
unmountPortalBoundaryHost,
|
|
32
|
-
} from "../stores/portal-boundary-host.store";
|
|
33
|
-
import { isTeleportAvailable, NativePortal } from "../teleport";
|
|
34
|
-
import {
|
|
35
|
-
createBoundaryLocalPortalHostName,
|
|
36
|
-
createPortalBoundaryHostName,
|
|
37
|
-
PORTAL_HOST_NAME_RESET_VALUE,
|
|
38
|
-
} from "../utils/naming";
|
|
39
|
-
import {
|
|
40
|
-
canSwitchBoundaryLocalHandoffImmediately,
|
|
41
|
-
type PortalOwnershipSignal,
|
|
42
|
-
resolveBoundaryPortalOwnership,
|
|
43
|
-
} from "../utils/ownership";
|
|
44
|
-
import { shallowEqual } from "../utils/shallow-equal";
|
|
45
|
-
import { shouldAttachBoundaryPortal } from "../utils/teleport-control";
|
|
46
|
-
import { resolveNextVisiblePortalHostName } from "../utils/visible-host";
|
|
47
|
-
|
|
48
|
-
type NullableHostNamePortalProps = Omit<
|
|
49
|
-
ComponentProps<NonNullable<typeof NativePortal>>,
|
|
50
|
-
"hostName"
|
|
51
|
-
> & {
|
|
52
|
-
hostName?: string | null;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
const AnimatedNativePortal = NativePortal
|
|
56
|
-
? Animated.createAnimatedComponent(
|
|
57
|
-
NativePortal as ComponentType<NullableHostNamePortalProps>,
|
|
58
|
-
)
|
|
59
|
-
: null;
|
|
60
|
-
|
|
61
|
-
interface PortalProps {
|
|
62
|
-
id?: string;
|
|
63
|
-
children: ReactNode;
|
|
64
|
-
handoff?: boolean;
|
|
65
|
-
escapeClipping?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Ref to the layout-preserving placeholder wrapper. Boundaries measure
|
|
68
|
-
* this instead of teleported content — the placeholder keeps the source
|
|
69
|
-
* slot at home while the content may physically live in another screen's
|
|
70
|
-
* host.
|
|
71
|
-
*/
|
|
72
|
-
placeholderRef?: AnimatedRef<View>;
|
|
73
|
-
placeholderChildren?: ReactNode;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export const Portal = memo(function Portal({
|
|
77
|
-
id,
|
|
78
|
-
children,
|
|
79
|
-
handoff = false,
|
|
80
|
-
escapeClipping = false,
|
|
81
|
-
placeholderRef,
|
|
82
|
-
placeholderChildren,
|
|
83
|
-
}: PortalProps) {
|
|
84
|
-
// Teleporting requires the optional `react-native-teleport` peer and a stable
|
|
85
|
-
// `id` to name the boundary host. Missing either degrades to inline rendering
|
|
86
|
-
// (the `return children` path below).
|
|
87
|
-
const isPortalEnabled =
|
|
88
|
-
(handoff || escapeClipping) && isTeleportAvailable && id !== undefined;
|
|
89
|
-
|
|
90
|
-
if (__DEV__ && (handoff || escapeClipping) && id === undefined) {
|
|
91
|
-
logger.warnOnce(
|
|
92
|
-
"portal:missing-id",
|
|
93
|
-
"A handoff or escapeClipping boundary was rendered without an id; rendering inline.",
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
|
-
const boundaryId = id ?? "";
|
|
97
|
-
const ownScreenSlots = useScreenSlots();
|
|
98
|
-
const sourcePairKey = useDescriptorsStore((s) => s.derivations.sourcePairKey);
|
|
99
|
-
const currentScreenKey = useDescriptorsStore(
|
|
100
|
-
(s) => s.derivations.currentScreenKey,
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
const [ownership, setOwnership] = useState<Extract<
|
|
104
|
-
PortalOwnershipSignal,
|
|
105
|
-
{ status: "complete" }
|
|
106
|
-
> | null>(null);
|
|
107
|
-
|
|
108
|
-
const styleOwnerScreenKey = ownership?.ownerScreenKey ?? currentScreenKey;
|
|
109
|
-
const ownerScreenSlots = useRegisteredScreenSlots(styleOwnerScreenKey);
|
|
110
|
-
const activeScreenSlots = ownerScreenSlots ?? ownScreenSlots;
|
|
111
|
-
const {
|
|
112
|
-
localStylesMaps: activeLocalStylesMaps,
|
|
113
|
-
nextInterpolatorReady: activeNextInterpolatorReady,
|
|
114
|
-
slotsMap: activeSlotsMap,
|
|
115
|
-
} = activeScreenSlots;
|
|
116
|
-
const requestedPortalHostName = useSharedValue<string | null>(null);
|
|
117
|
-
const visiblePortalHostName = useSharedValue<string | null>(null);
|
|
118
|
-
const canSwitchPortalHostImmediately = useSharedValue(0);
|
|
119
|
-
|
|
120
|
-
const targetScreenKey = ownership ? ownership.hostScreenKey : null;
|
|
121
|
-
const settledHostScreenKey = ownership?.hostScreenKey ?? null;
|
|
122
|
-
const settledHostProgress = AnimationStore.getValue(
|
|
123
|
-
settledHostScreenKey ?? currentScreenKey,
|
|
124
|
-
"progressSettled",
|
|
125
|
-
);
|
|
126
|
-
const settledHostAnimating = AnimationStore.getValue(
|
|
127
|
-
settledHostScreenKey ?? currentScreenKey,
|
|
128
|
-
"progressAnimating",
|
|
129
|
-
);
|
|
130
|
-
const settledHostClosing = AnimationStore.getValue(
|
|
131
|
-
settledHostScreenKey ?? currentScreenKey,
|
|
132
|
-
"closing",
|
|
133
|
-
);
|
|
134
|
-
const settledHostVisualProgress = AnimationStore.getValue(
|
|
135
|
-
settledHostScreenKey ?? currentScreenKey,
|
|
136
|
-
"visualProgress",
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
const activeHostKey = useActiveHostKey(
|
|
140
|
-
escapeClipping ? targetScreenKey : null,
|
|
141
|
-
);
|
|
142
|
-
const boundaryLocalHostName =
|
|
143
|
-
handoff && !escapeClipping && targetScreenKey
|
|
144
|
-
? createBoundaryLocalPortalHostName(targetScreenKey, boundaryId)
|
|
145
|
-
: null;
|
|
146
|
-
|
|
147
|
-
const updatePortalOwnership = useCallback(
|
|
148
|
-
(
|
|
149
|
-
hostScreenKey: string | null,
|
|
150
|
-
ownerPairKey?: string,
|
|
151
|
-
ownerScreenKey?: string,
|
|
152
|
-
) => {
|
|
153
|
-
if (hostScreenKey && ownerPairKey && ownerScreenKey) {
|
|
154
|
-
setOwnership((current) => {
|
|
155
|
-
if (
|
|
156
|
-
current?.hostScreenKey === hostScreenKey &&
|
|
157
|
-
current.ownerPairKey === ownerPairKey &&
|
|
158
|
-
current.ownerScreenKey === ownerScreenKey
|
|
159
|
-
) {
|
|
160
|
-
return current;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
return {
|
|
164
|
-
hostScreenKey,
|
|
165
|
-
ownerPairKey,
|
|
166
|
-
ownerScreenKey,
|
|
167
|
-
status: "complete",
|
|
168
|
-
};
|
|
169
|
-
});
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
setOwnership((current) => (current ? null : current));
|
|
174
|
-
},
|
|
175
|
-
[],
|
|
176
|
-
);
|
|
177
|
-
|
|
178
|
-
useLayoutEffect(() => {
|
|
179
|
-
if (!isPortalEnabled || !ownership || !targetScreenKey) {
|
|
180
|
-
requestedPortalHostName.set(null);
|
|
181
|
-
visiblePortalHostName.set(null);
|
|
182
|
-
unmountPortalBoundaryHost(boundaryId);
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
if (boundaryLocalHostName) {
|
|
187
|
-
requestedPortalHostName.set(boundaryLocalHostName);
|
|
188
|
-
unmountPortalBoundaryHost(boundaryId);
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
if (!escapeClipping || !activeHostKey) {
|
|
193
|
-
requestedPortalHostName.set(null);
|
|
194
|
-
visiblePortalHostName.set(null);
|
|
195
|
-
unmountPortalBoundaryHost(boundaryId);
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const portalHostName = createPortalBoundaryHostName(
|
|
200
|
-
activeHostKey,
|
|
201
|
-
boundaryId,
|
|
202
|
-
ownership.ownerPairKey,
|
|
203
|
-
);
|
|
204
|
-
|
|
205
|
-
mountPortalBoundaryHost({
|
|
206
|
-
boundaryId,
|
|
207
|
-
escapeClipping,
|
|
208
|
-
hostKey: activeHostKey,
|
|
209
|
-
localStylesMaps: activeLocalStylesMaps,
|
|
210
|
-
pairKey: ownership.ownerPairKey,
|
|
211
|
-
portalHostName,
|
|
212
|
-
screenKey: targetScreenKey,
|
|
213
|
-
slotsMap: activeSlotsMap,
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
// Request the new receiver immediately, but keep the currently visible
|
|
217
|
-
// receiver until the new interpolator is ready. This avoids a no-host gap
|
|
218
|
-
// during A -> B(closing) -> C(opening) spam retargets.
|
|
219
|
-
requestedPortalHostName.set(portalHostName);
|
|
220
|
-
}, [
|
|
221
|
-
activeHostKey,
|
|
222
|
-
boundaryId,
|
|
223
|
-
escapeClipping,
|
|
224
|
-
isPortalEnabled,
|
|
225
|
-
activeLocalStylesMaps,
|
|
226
|
-
activeSlotsMap,
|
|
227
|
-
ownership,
|
|
228
|
-
boundaryLocalHostName,
|
|
229
|
-
requestedPortalHostName,
|
|
230
|
-
targetScreenKey,
|
|
231
|
-
visiblePortalHostName,
|
|
232
|
-
]);
|
|
233
|
-
|
|
234
|
-
useLayoutEffect(() => {
|
|
235
|
-
return () => {
|
|
236
|
-
requestedPortalHostName.set(null);
|
|
237
|
-
visiblePortalHostName.set(null);
|
|
238
|
-
unmountPortalBoundaryHost(boundaryId);
|
|
239
|
-
};
|
|
240
|
-
}, [boundaryId, requestedPortalHostName, visiblePortalHostName]);
|
|
241
|
-
|
|
242
|
-
useAnimatedReaction(
|
|
243
|
-
() => {
|
|
244
|
-
"worklet";
|
|
245
|
-
if (!isPortalEnabled || !sourcePairKey) {
|
|
246
|
-
return {
|
|
247
|
-
hostScreenKey: null,
|
|
248
|
-
ownerPairKey: sourcePairKey,
|
|
249
|
-
ownerScreenKey: null,
|
|
250
|
-
status: "clear",
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
return resolveBoundaryPortalOwnership({
|
|
255
|
-
boundaryId,
|
|
256
|
-
currentScreenKey,
|
|
257
|
-
escapeClipping,
|
|
258
|
-
handoff,
|
|
259
|
-
isSettledHostClosingComplete:
|
|
260
|
-
!!settledHostClosing.get() &&
|
|
261
|
-
settledHostVisualProgress.get() <= EPSILON,
|
|
262
|
-
isSettledHostReady:
|
|
263
|
-
settledHostProgress.get() === 1 && settledHostAnimating.get() === 0,
|
|
264
|
-
pairsState: pairs.get(),
|
|
265
|
-
settledHostScreenKey,
|
|
266
|
-
sourcePairKey,
|
|
267
|
-
});
|
|
268
|
-
},
|
|
269
|
-
(signal, previousSignal) => {
|
|
270
|
-
"worklet";
|
|
271
|
-
if (shallowEqual(previousSignal, signal)) {
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
if (!handoff || escapeClipping) {
|
|
276
|
-
canSwitchPortalHostImmediately.set(0);
|
|
277
|
-
} else if (signal.status === "pending") {
|
|
278
|
-
canSwitchPortalHostImmediately.set(0);
|
|
279
|
-
return;
|
|
280
|
-
} else {
|
|
281
|
-
const hostScreenKey =
|
|
282
|
-
signal.status === "complete" ? signal.hostScreenKey : null;
|
|
283
|
-
let previousOwnerPairKey: string | undefined;
|
|
284
|
-
|
|
285
|
-
if (previousSignal?.status === "complete") {
|
|
286
|
-
previousOwnerPairKey = previousSignal.ownerPairKey ?? undefined;
|
|
287
|
-
}
|
|
288
|
-
const canSwitchImmediately = canSwitchBoundaryLocalHandoffImmediately({
|
|
289
|
-
hostScreenKey,
|
|
290
|
-
ownerPairKey:
|
|
291
|
-
signal.status === "complete" ? signal.ownerPairKey : undefined,
|
|
292
|
-
previousOwnerPairKey,
|
|
293
|
-
});
|
|
294
|
-
|
|
295
|
-
canSwitchPortalHostImmediately.set(canSwitchImmediately ? 1 : 0);
|
|
296
|
-
|
|
297
|
-
if (canSwitchImmediately && hostScreenKey) {
|
|
298
|
-
const hostName = createBoundaryLocalPortalHostName(
|
|
299
|
-
hostScreenKey,
|
|
300
|
-
boundaryId,
|
|
301
|
-
);
|
|
302
|
-
requestedPortalHostName.set(hostName);
|
|
303
|
-
visiblePortalHostName.set(hostName);
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
runOnJS(updatePortalOwnership)(
|
|
308
|
-
signal.hostScreenKey,
|
|
309
|
-
signal.ownerPairKey,
|
|
310
|
-
signal.ownerScreenKey ?? undefined,
|
|
311
|
-
);
|
|
312
|
-
},
|
|
313
|
-
);
|
|
314
|
-
|
|
315
|
-
useAnimatedReaction(
|
|
316
|
-
() => {
|
|
317
|
-
"worklet";
|
|
318
|
-
const slot = activeSlotsMap.get()[boundaryId];
|
|
319
|
-
const teleport = slot?.props?.teleport;
|
|
320
|
-
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
321
|
-
enabled: isPortalEnabled,
|
|
322
|
-
teleport,
|
|
323
|
-
});
|
|
324
|
-
const requestedName = requestedPortalHostName.get();
|
|
325
|
-
const visibleName = visiblePortalHostName.get();
|
|
326
|
-
const isInterpolatorReady = activeNextInterpolatorReady.get();
|
|
327
|
-
const nextVisibleName = resolveNextVisiblePortalHostName({
|
|
328
|
-
canSwitchImmediately: canSwitchPortalHostImmediately.get() === 1,
|
|
329
|
-
isInterpolatorReady: isInterpolatorReady === 1,
|
|
330
|
-
requestedName,
|
|
331
|
-
shouldTeleport,
|
|
332
|
-
visibleName,
|
|
333
|
-
});
|
|
334
|
-
|
|
335
|
-
return {
|
|
336
|
-
isInterpolatorReady,
|
|
337
|
-
nextVisibleName,
|
|
338
|
-
requestedName,
|
|
339
|
-
shouldTeleport,
|
|
340
|
-
teleport,
|
|
341
|
-
visibleName,
|
|
342
|
-
};
|
|
343
|
-
},
|
|
344
|
-
(state, previousState) => {
|
|
345
|
-
"worklet";
|
|
346
|
-
if (shallowEqual(previousState, state)) {
|
|
347
|
-
return;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
if (state.nextVisibleName !== state.visibleName) {
|
|
351
|
-
visiblePortalHostName.set(state.nextVisibleName);
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
// Visible receiver has caught up to the request: GC the superseded hosts.
|
|
356
|
-
if (state.visibleName && state.visibleName === state.requestedName) {
|
|
357
|
-
runOnJS(dropStalePortalBoundaryHosts)({
|
|
358
|
-
boundaryId,
|
|
359
|
-
keepPortalHostName: state.visibleName,
|
|
360
|
-
});
|
|
361
|
-
}
|
|
362
|
-
},
|
|
363
|
-
);
|
|
364
|
-
|
|
365
|
-
const teleportProps = useAnimatedProps(() => {
|
|
366
|
-
"worklet";
|
|
367
|
-
|
|
368
|
-
const slot = activeSlotsMap.get()[boundaryId];
|
|
369
|
-
const { teleport, ...slotProps } = slot?.props ?? {};
|
|
370
|
-
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
371
|
-
enabled: isPortalEnabled,
|
|
372
|
-
teleport,
|
|
373
|
-
});
|
|
374
|
-
const visibleName = visiblePortalHostName.get();
|
|
375
|
-
|
|
376
|
-
return {
|
|
377
|
-
// Preserve portal slot props from the interpolator while keeping
|
|
378
|
-
// hostName owned by the attachment gate below. Handoff
|
|
379
|
-
// waits until the receiving interpolator owns styles for the same host;
|
|
380
|
-
// after that, it stays attached until teleport is disabled or retargeted.
|
|
381
|
-
...slotProps,
|
|
382
|
-
hostName:
|
|
383
|
-
shouldTeleport && visibleName
|
|
384
|
-
? visibleName
|
|
385
|
-
: PORTAL_HOST_NAME_RESET_VALUE,
|
|
386
|
-
};
|
|
387
|
-
});
|
|
388
|
-
|
|
389
|
-
const { handleOnLayout, placeholderStyle } = usePlaceholderStyles({
|
|
390
|
-
visiblePortalHostName,
|
|
391
|
-
});
|
|
392
|
-
|
|
393
|
-
if (isPortalEnabled && AnimatedNativePortal) {
|
|
394
|
-
return (
|
|
395
|
-
<Animated.View
|
|
396
|
-
ref={placeholderRef}
|
|
397
|
-
onLayout={({ nativeEvent: { layout } }) =>
|
|
398
|
-
runOnUI(handleOnLayout)(layout)
|
|
399
|
-
}
|
|
400
|
-
style={placeholderStyle}
|
|
401
|
-
collapsable={false}
|
|
402
|
-
>
|
|
403
|
-
{placeholderChildren}
|
|
404
|
-
<AnimatedNativePortal animatedProps={teleportProps} name={boundaryId}>
|
|
405
|
-
{children}
|
|
406
|
-
</AnimatedNativePortal>
|
|
407
|
-
</Animated.View>
|
|
408
|
-
);
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
return children;
|
|
412
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|