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,274 @@
|
|
|
1
|
+
import { useCallback, useLayoutEffect, useState } from "react";
|
|
2
|
+
import {
|
|
3
|
+
runOnJS,
|
|
4
|
+
useAnimatedProps,
|
|
5
|
+
useAnimatedReaction,
|
|
6
|
+
useSharedValue,
|
|
7
|
+
} from "react-native-reanimated";
|
|
8
|
+
import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
|
|
9
|
+
import { useScreenSlots } from "../../../../../../providers/screen/styles";
|
|
10
|
+
import { useRegisteredScreenSlots } from "../../../../../../providers/screen/styles/stores/slot-references.store";
|
|
11
|
+
import { AnimationStore } from "../../../../../../stores/animation.store";
|
|
12
|
+
import { pairs } from "../../../../../../stores/bounds/internals/state";
|
|
13
|
+
import { PORTAL_HOST_NAME_RESET_VALUE } from "../../../utils/naming";
|
|
14
|
+
import {
|
|
15
|
+
canSwitchHandoffHostImmediately,
|
|
16
|
+
isHandoffHostClosingComplete,
|
|
17
|
+
type PortalOwnershipSignal,
|
|
18
|
+
resolveBoundaryPortalOwnership,
|
|
19
|
+
} from "../../../utils/ownership";
|
|
20
|
+
import { shallowEqual } from "../../../utils/shallow-equal";
|
|
21
|
+
import { shouldAttachBoundaryPortal } from "../../../utils/teleport-control";
|
|
22
|
+
import { resolveNextVisiblePortalHostName } from "../../../utils/visible-host";
|
|
23
|
+
import { createBoundaryContentPortalHostName } from "../helpers/host-name";
|
|
24
|
+
|
|
25
|
+
interface UseBoundaryContentPortalAttachmentParams {
|
|
26
|
+
boundaryId: string;
|
|
27
|
+
enabled: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const useBoundaryContentPortalAttachment = ({
|
|
31
|
+
boundaryId,
|
|
32
|
+
enabled,
|
|
33
|
+
}: UseBoundaryContentPortalAttachmentParams) => {
|
|
34
|
+
const ownScreenSlots = useScreenSlots();
|
|
35
|
+
const sourcePairKey = useDescriptorsStore((s) => s.derivations.sourcePairKey);
|
|
36
|
+
const currentScreenKey = useDescriptorsStore(
|
|
37
|
+
(s) => s.derivations.currentScreenKey,
|
|
38
|
+
);
|
|
39
|
+
const [ownership, setOwnership] = useState<Extract<
|
|
40
|
+
PortalOwnershipSignal,
|
|
41
|
+
{ status: "complete" }
|
|
42
|
+
> | null>(null);
|
|
43
|
+
|
|
44
|
+
const styleOwnerScreenKey = ownership?.ownerScreenKey ?? currentScreenKey;
|
|
45
|
+
const ownerScreenSlots = useRegisteredScreenSlots(styleOwnerScreenKey);
|
|
46
|
+
const activeScreenSlots = ownerScreenSlots ?? ownScreenSlots;
|
|
47
|
+
const {
|
|
48
|
+
nextInterpolatorReady: activeNextInterpolatorReady,
|
|
49
|
+
slotsMap: activeSlotsMap,
|
|
50
|
+
} = activeScreenSlots;
|
|
51
|
+
const requestedPortalHostName = useSharedValue<string | null>(null);
|
|
52
|
+
const visiblePortalHostName = useSharedValue<string | null>(null);
|
|
53
|
+
const canSwitchPortalHostImmediately = useSharedValue(0);
|
|
54
|
+
|
|
55
|
+
const targetScreenKey = ownership ? ownership.hostScreenKey : null;
|
|
56
|
+
const settledHostScreenKey = ownership?.hostScreenKey ?? null;
|
|
57
|
+
const settledHostProgress = AnimationStore.getValue(
|
|
58
|
+
settledHostScreenKey ?? currentScreenKey,
|
|
59
|
+
"progressSettled",
|
|
60
|
+
);
|
|
61
|
+
const settledHostAnimating = AnimationStore.getValue(
|
|
62
|
+
settledHostScreenKey ?? currentScreenKey,
|
|
63
|
+
"progressAnimating",
|
|
64
|
+
);
|
|
65
|
+
const settledHostWillAnimate = AnimationStore.getValue(
|
|
66
|
+
settledHostScreenKey ?? currentScreenKey,
|
|
67
|
+
"willAnimate",
|
|
68
|
+
);
|
|
69
|
+
const settledHostClosing = AnimationStore.getValue(
|
|
70
|
+
settledHostScreenKey ?? currentScreenKey,
|
|
71
|
+
"closing",
|
|
72
|
+
);
|
|
73
|
+
const handoffHostName =
|
|
74
|
+
targetScreenKey !== null
|
|
75
|
+
? createBoundaryContentPortalHostName(targetScreenKey, boundaryId)
|
|
76
|
+
: null;
|
|
77
|
+
|
|
78
|
+
const updatePortalOwnership = useCallback(
|
|
79
|
+
(
|
|
80
|
+
hostScreenKey: string | null,
|
|
81
|
+
ownerPairKey?: string,
|
|
82
|
+
ownerScreenKey?: string,
|
|
83
|
+
) => {
|
|
84
|
+
if (hostScreenKey && ownerPairKey && ownerScreenKey) {
|
|
85
|
+
setOwnership((current) => {
|
|
86
|
+
if (
|
|
87
|
+
current?.hostScreenKey === hostScreenKey &&
|
|
88
|
+
current.ownerPairKey === ownerPairKey &&
|
|
89
|
+
current.ownerScreenKey === ownerScreenKey
|
|
90
|
+
) {
|
|
91
|
+
return current;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return {
|
|
95
|
+
hostScreenKey,
|
|
96
|
+
ownerPairKey,
|
|
97
|
+
ownerScreenKey,
|
|
98
|
+
status: "complete",
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
setOwnership((current) => (current ? null : current));
|
|
105
|
+
},
|
|
106
|
+
[],
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
useLayoutEffect(() => {
|
|
110
|
+
if (!enabled || !ownership || !handoffHostName) {
|
|
111
|
+
requestedPortalHostName.set(null);
|
|
112
|
+
visiblePortalHostName.set(null);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
requestedPortalHostName.set(handoffHostName);
|
|
117
|
+
}, [
|
|
118
|
+
enabled,
|
|
119
|
+
handoffHostName,
|
|
120
|
+
ownership,
|
|
121
|
+
requestedPortalHostName,
|
|
122
|
+
visiblePortalHostName,
|
|
123
|
+
]);
|
|
124
|
+
|
|
125
|
+
useLayoutEffect(() => {
|
|
126
|
+
return () => {
|
|
127
|
+
requestedPortalHostName.set(null);
|
|
128
|
+
visiblePortalHostName.set(null);
|
|
129
|
+
};
|
|
130
|
+
}, [requestedPortalHostName, visiblePortalHostName]);
|
|
131
|
+
|
|
132
|
+
useAnimatedReaction(
|
|
133
|
+
() => {
|
|
134
|
+
"worklet";
|
|
135
|
+
if (!enabled || !sourcePairKey) {
|
|
136
|
+
return {
|
|
137
|
+
hostScreenKey: null,
|
|
138
|
+
ownerPairKey: sourcePairKey,
|
|
139
|
+
ownerScreenKey: null,
|
|
140
|
+
status: "clear",
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const progressAnimating = settledHostAnimating.get();
|
|
145
|
+
const progressSettled = settledHostProgress.get();
|
|
146
|
+
const willAnimate = settledHostWillAnimate.get();
|
|
147
|
+
|
|
148
|
+
return resolveBoundaryPortalOwnership({
|
|
149
|
+
boundaryId,
|
|
150
|
+
currentScreenKey,
|
|
151
|
+
handoff: true,
|
|
152
|
+
isSettledHostClosingComplete: isHandoffHostClosingComplete({
|
|
153
|
+
closing: settledHostClosing.get(),
|
|
154
|
+
progressAnimating,
|
|
155
|
+
progressSettled,
|
|
156
|
+
willAnimate,
|
|
157
|
+
}),
|
|
158
|
+
isSettledHostReady: progressSettled === 1 && progressAnimating === 0,
|
|
159
|
+
pairsState: pairs.get(),
|
|
160
|
+
settledHostScreenKey,
|
|
161
|
+
sourcePairKey,
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
(signal, previousSignal) => {
|
|
165
|
+
"worklet";
|
|
166
|
+
if (shallowEqual(previousSignal, signal)) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if (signal.status === "pending") {
|
|
171
|
+
canSwitchPortalHostImmediately.set(0);
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
const hostScreenKey =
|
|
176
|
+
signal.status === "complete" ? signal.hostScreenKey : null;
|
|
177
|
+
let previousOwnerPairKey: string | undefined;
|
|
178
|
+
|
|
179
|
+
if (previousSignal?.status === "complete") {
|
|
180
|
+
previousOwnerPairKey = previousSignal.ownerPairKey ?? undefined;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
const canSwitchImmediately = canSwitchHandoffHostImmediately({
|
|
184
|
+
hostScreenKey,
|
|
185
|
+
ownerPairKey:
|
|
186
|
+
signal.status === "complete" ? signal.ownerPairKey : undefined,
|
|
187
|
+
previousOwnerPairKey,
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
canSwitchPortalHostImmediately.set(canSwitchImmediately ? 1 : 0);
|
|
191
|
+
|
|
192
|
+
if (canSwitchImmediately && hostScreenKey) {
|
|
193
|
+
const hostName = createBoundaryContentPortalHostName(
|
|
194
|
+
hostScreenKey,
|
|
195
|
+
boundaryId,
|
|
196
|
+
);
|
|
197
|
+
requestedPortalHostName.set(hostName);
|
|
198
|
+
visiblePortalHostName.set(hostName);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
runOnJS(updatePortalOwnership)(
|
|
202
|
+
signal.hostScreenKey,
|
|
203
|
+
signal.ownerPairKey,
|
|
204
|
+
signal.ownerScreenKey ?? undefined,
|
|
205
|
+
);
|
|
206
|
+
},
|
|
207
|
+
);
|
|
208
|
+
|
|
209
|
+
useAnimatedReaction(
|
|
210
|
+
() => {
|
|
211
|
+
"worklet";
|
|
212
|
+
const slot = activeSlotsMap.get()[boundaryId];
|
|
213
|
+
const teleport = slot?.props?.teleport;
|
|
214
|
+
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
215
|
+
enabled,
|
|
216
|
+
teleport,
|
|
217
|
+
});
|
|
218
|
+
const requestedName = requestedPortalHostName.get();
|
|
219
|
+
const visibleName = visiblePortalHostName.get();
|
|
220
|
+
const isInterpolatorReady = activeNextInterpolatorReady.get();
|
|
221
|
+
const nextVisibleName = resolveNextVisiblePortalHostName({
|
|
222
|
+
canSwitchImmediately: canSwitchPortalHostImmediately.get() === 1,
|
|
223
|
+
isInterpolatorReady: isInterpolatorReady === 1,
|
|
224
|
+
requestedName,
|
|
225
|
+
shouldTeleport,
|
|
226
|
+
visibleName,
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
return {
|
|
230
|
+
isInterpolatorReady,
|
|
231
|
+
nextVisibleName,
|
|
232
|
+
requestedName,
|
|
233
|
+
shouldTeleport,
|
|
234
|
+
teleport,
|
|
235
|
+
visibleName,
|
|
236
|
+
};
|
|
237
|
+
},
|
|
238
|
+
(state, previousState) => {
|
|
239
|
+
"worklet";
|
|
240
|
+
if (shallowEqual(previousState, state)) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
if (state.nextVisibleName !== state.visibleName) {
|
|
245
|
+
visiblePortalHostName.set(state.nextVisibleName);
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
);
|
|
249
|
+
|
|
250
|
+
const teleportProps = useAnimatedProps(() => {
|
|
251
|
+
"worklet";
|
|
252
|
+
|
|
253
|
+
const slot = activeSlotsMap.get()[boundaryId];
|
|
254
|
+
const { teleport, ...slotProps } = slot?.props ?? {};
|
|
255
|
+
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
256
|
+
enabled,
|
|
257
|
+
teleport,
|
|
258
|
+
});
|
|
259
|
+
const visibleName = visiblePortalHostName.get();
|
|
260
|
+
|
|
261
|
+
return {
|
|
262
|
+
...slotProps,
|
|
263
|
+
hostName:
|
|
264
|
+
shouldTeleport && visibleName
|
|
265
|
+
? visibleName
|
|
266
|
+
: PORTAL_HOST_NAME_RESET_VALUE,
|
|
267
|
+
};
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
return {
|
|
271
|
+
teleportProps,
|
|
272
|
+
visiblePortalHostName,
|
|
273
|
+
};
|
|
274
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ComponentProps,
|
|
3
|
+
type ComponentType,
|
|
4
|
+
memo,
|
|
5
|
+
type ReactNode,
|
|
6
|
+
} from "react";
|
|
7
|
+
import type { ViewProps } from "react-native";
|
|
8
|
+
import Animated from "react-native-reanimated";
|
|
9
|
+
import { isTeleportAvailable, NativePortal } from "../../teleport";
|
|
10
|
+
import { useBoundaryContentPortalAttachment } from "./hooks/use-boundary-content-portal-attachment";
|
|
11
|
+
|
|
12
|
+
export { BoundaryContentPortalHost } from "./components/host";
|
|
13
|
+
|
|
14
|
+
type BoundaryContentPortalProps = {
|
|
15
|
+
boundaryId?: string;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
pointerEvents?: ViewProps["pointerEvents"];
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
type NullableHostNamePortalProps = Omit<
|
|
22
|
+
ComponentProps<NonNullable<typeof NativePortal>>,
|
|
23
|
+
"hostName"
|
|
24
|
+
> & {
|
|
25
|
+
hostName?: string | null;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const AnimatedNativePortal = NativePortal
|
|
29
|
+
? Animated.createAnimatedComponent(
|
|
30
|
+
NativePortal as ComponentType<NullableHostNamePortalProps>,
|
|
31
|
+
)
|
|
32
|
+
: null;
|
|
33
|
+
|
|
34
|
+
export const BoundaryContentPortal = memo(function BoundaryContentPortal({
|
|
35
|
+
boundaryId,
|
|
36
|
+
children,
|
|
37
|
+
enabled,
|
|
38
|
+
pointerEvents,
|
|
39
|
+
}: BoundaryContentPortalProps) {
|
|
40
|
+
const shouldEnablePortal = enabled && boundaryId !== undefined;
|
|
41
|
+
const { teleportProps } = useBoundaryContentPortalAttachment({
|
|
42
|
+
boundaryId: boundaryId ?? "",
|
|
43
|
+
enabled: shouldEnablePortal,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
if (shouldEnablePortal && isTeleportAvailable && AnimatedNativePortal) {
|
|
47
|
+
return (
|
|
48
|
+
<AnimatedNativePortal
|
|
49
|
+
animatedProps={teleportProps}
|
|
50
|
+
name={boundaryId}
|
|
51
|
+
pointerEvents={pointerEvents}
|
|
52
|
+
>
|
|
53
|
+
{children}
|
|
54
|
+
</AnimatedNativePortal>
|
|
55
|
+
);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return children;
|
|
59
|
+
});
|
|
@@ -7,8 +7,9 @@ import {
|
|
|
7
7
|
type ViewStyle,
|
|
8
8
|
} from "react-native";
|
|
9
9
|
import Animated from "react-native-reanimated";
|
|
10
|
-
import { useDescriptorsStore } from "
|
|
11
|
-
import {
|
|
10
|
+
import { useDescriptorsStore } from "../../../../../../providers/screen/descriptors";
|
|
11
|
+
import { useScreenSlots } from "../../../../../../providers/screen/styles";
|
|
12
|
+
import { SystemStore } from "../../../../../../stores/system.store";
|
|
12
13
|
import { useHostMeasurement } from "../hooks/use-host-measurement";
|
|
13
14
|
import { registerHost, unregisterHost } from "../stores/host-registry.store";
|
|
14
15
|
import { useActivePortalBoundaryHosts } from "../stores/portal-boundary-host.store";
|
|
@@ -26,7 +27,7 @@ type HostImplProps = PublicHostProps & {
|
|
|
26
27
|
|
|
27
28
|
function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
28
29
|
const screenKey = useDescriptorsStore((s) => s.derivations.currentScreenKey);
|
|
29
|
-
const {
|
|
30
|
+
const { unblockLifecycleStart } = SystemStore.getBag(screenKey).actions;
|
|
30
31
|
const generatedHostKeyRef = useRef<string | null>(null);
|
|
31
32
|
|
|
32
33
|
if (generatedHostKeyRef.current === null) {
|
|
@@ -36,6 +37,7 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
|
36
37
|
const hostKey = fallback ? screenKey : generatedHostKeyRef.current;
|
|
37
38
|
const capturesScroll = !fallback;
|
|
38
39
|
const activeBoundaryHosts = useActivePortalBoundaryHosts(hostKey);
|
|
40
|
+
const { visibilityBlocked } = useScreenSlots();
|
|
39
41
|
const { height: viewportHeight, width: viewportWidth } =
|
|
40
42
|
useWindowDimensions();
|
|
41
43
|
|
|
@@ -44,6 +46,9 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
|
44
46
|
enabled: activeBoundaryHosts.length > 0,
|
|
45
47
|
hostKey,
|
|
46
48
|
screenKey,
|
|
49
|
+
visibilityBlocked,
|
|
50
|
+
viewportHeight,
|
|
51
|
+
viewportWidth,
|
|
47
52
|
});
|
|
48
53
|
|
|
49
54
|
useLayoutEffect(() => {
|
|
@@ -60,15 +65,13 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
|
60
65
|
}, [capturesScroll, fallback, hostKey, screenKey]);
|
|
61
66
|
|
|
62
67
|
const handleUnblocking = useCallback(() => {
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
drainLifecycleStartBlocks();
|
|
68
|
-
}, [drainLifecycleStartBlocks]);
|
|
68
|
+
// Each destination boundary contributes one lifecycle start block. Release
|
|
69
|
+
// only this host's block so unrelated boundary and user blocks stay intact.
|
|
70
|
+
unblockLifecycleStart();
|
|
71
|
+
}, [unblockLifecycleStart]);
|
|
69
72
|
|
|
70
73
|
const boundaryHosts = measurement.canRenderHosts
|
|
71
|
-
? activeBoundaryHosts.map((host
|
|
74
|
+
? activeBoundaryHosts.map((host) => (
|
|
72
75
|
<View
|
|
73
76
|
key={host.portalHostName}
|
|
74
77
|
pointerEvents="none"
|
|
@@ -76,11 +79,7 @@ function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
|
76
79
|
styles.boundaryHostViewport,
|
|
77
80
|
{ width: viewportWidth, height: viewportHeight },
|
|
78
81
|
]}
|
|
79
|
-
onLayout={
|
|
80
|
-
if (list.length - 1 === idx) {
|
|
81
|
-
handleUnblocking();
|
|
82
|
-
}
|
|
83
|
-
}}
|
|
82
|
+
onLayout={handleUnblocking}
|
|
84
83
|
>
|
|
85
84
|
<PortalBoundaryHost host={host} style={StyleSheet.absoluteFill} />
|
|
86
85
|
</View>
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { memo } from "react";
|
|
2
2
|
import { type StyleProp, StyleSheet, type ViewStyle } from "react-native";
|
|
3
3
|
import Animated, { useAnimatedStyle } from "react-native-reanimated";
|
|
4
|
-
import { NO_STYLES } from "
|
|
5
|
-
import { composeSlotStyleWithLocalTransform } from "
|
|
6
|
-
import { AnimationStore } from "
|
|
7
|
-
import { getSourceScreenKeyFromPairKey } from "
|
|
8
|
-
import { getLink } from "
|
|
4
|
+
import { NO_STYLES } from "../../../../../../constants";
|
|
5
|
+
import { composeSlotStyleWithLocalTransform } from "../../../../../../providers/screen/styles/helpers/compose-slot-style";
|
|
6
|
+
import { AnimationStore } from "../../../../../../stores/animation.store";
|
|
7
|
+
import { getSourceScreenKeyFromPairKey } from "../../../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
8
|
+
import { getLink } from "../../../../../../stores/bounds/internals/links";
|
|
9
9
|
import {
|
|
10
10
|
getClampedScrollAxisDelta,
|
|
11
11
|
ScrollStore,
|
|
12
|
-
} from "
|
|
13
|
-
import type { ScrollMeasuredDimensions } from "
|
|
12
|
+
} from "../../../../../../stores/scroll.store";
|
|
13
|
+
import type { ScrollMeasuredDimensions } from "../../../../utils/measured-bounds";
|
|
14
|
+
import { NativePortalHost } from "../../../teleport";
|
|
15
|
+
import { hasLocalSlot } from "../helpers/has-local-slot";
|
|
16
|
+
import { resolvePortalOffsetStyle } from "../helpers/offset-style";
|
|
14
17
|
import type { ActivePortalBoundaryHost } from "../stores/portal-boundary-host.store";
|
|
15
|
-
import { NativePortalHost } from "../teleport";
|
|
16
|
-
import { hasLocalSlot } from "../utils/has-local-slot";
|
|
17
|
-
import { resolvePortalOffsetStyle } from "../utils/offset-style";
|
|
18
18
|
|
|
19
19
|
const AnimatedPortalBoundaryHost = NativePortalHost
|
|
20
20
|
? Animated.createAnimatedComponent(NativePortalHost)
|
|
@@ -45,7 +45,7 @@ export const PortalBoundaryHost = memo(function PortalBoundaryHost({
|
|
|
45
45
|
|
|
46
46
|
const hostStyle = useAnimatedStyle(() => {
|
|
47
47
|
"worklet";
|
|
48
|
-
// Strict per-member lookup
|
|
48
|
+
// Strict per-member lookup - a fallback member's source rect would
|
|
49
49
|
// misplace this host's teleported content.
|
|
50
50
|
const link = getLink(host.pairKey, host.boundaryId);
|
|
51
51
|
if (!link?.source || !link.destination) {
|
|
@@ -135,7 +135,7 @@ export const PortalBoundaryHost = memo(function PortalBoundaryHost({
|
|
|
135
135
|
});
|
|
136
136
|
|
|
137
137
|
// Without `react-native-teleport` no portal ever mounts a boundary host, so
|
|
138
|
-
// this never renders
|
|
138
|
+
// this never renders - the guard just narrows the nullable animated host.
|
|
139
139
|
if (!AnimatedPortalBoundaryHost) {
|
|
140
140
|
return null;
|
|
141
141
|
}
|
package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ComponentProps,
|
|
3
|
+
type ComponentType,
|
|
4
|
+
memo,
|
|
5
|
+
type ReactNode,
|
|
6
|
+
} from "react";
|
|
7
|
+
import type { View, ViewProps } from "react-native";
|
|
8
|
+
import Animated, { type AnimatedRef, runOnUI } from "react-native-reanimated";
|
|
9
|
+
import { logger } from "../../../../../../utils/logger";
|
|
10
|
+
import {
|
|
11
|
+
isTeleportAvailable,
|
|
12
|
+
NativePortal as TeleportPortal,
|
|
13
|
+
} from "../../../teleport";
|
|
14
|
+
import { usePlaceholderStyles } from "../hooks/use-placeholder-styles";
|
|
15
|
+
|
|
16
|
+
type NullableHostNamePortalProps = Omit<
|
|
17
|
+
ComponentProps<NonNullable<typeof TeleportPortal>>,
|
|
18
|
+
"hostName"
|
|
19
|
+
> & {
|
|
20
|
+
hostName?: string | null;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const AnimatedNativePortal = TeleportPortal
|
|
24
|
+
? Animated.createAnimatedComponent(
|
|
25
|
+
TeleportPortal as ComponentType<NullableHostNamePortalProps>,
|
|
26
|
+
)
|
|
27
|
+
: null;
|
|
28
|
+
|
|
29
|
+
type BoundaryPortalSlotProps = {
|
|
30
|
+
id: string;
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
animatedProps: any;
|
|
34
|
+
pointerEvents?: ViewProps["pointerEvents"];
|
|
35
|
+
placeholderRef?: AnimatedRef<View>;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const BoundaryPortalSlot = memo(function BoundaryPortalSlot({
|
|
39
|
+
id,
|
|
40
|
+
children,
|
|
41
|
+
enabled,
|
|
42
|
+
animatedProps,
|
|
43
|
+
pointerEvents,
|
|
44
|
+
placeholderRef,
|
|
45
|
+
}: BoundaryPortalSlotProps) {
|
|
46
|
+
const isPortalEnabled = enabled && isTeleportAvailable;
|
|
47
|
+
|
|
48
|
+
if (__DEV__ && enabled && !id) {
|
|
49
|
+
logger.warnOnce(
|
|
50
|
+
"portal:missing-id",
|
|
51
|
+
"A boundary portal was rendered without an id; rendering inline.",
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const { handleOnLayout, placeholderStyle } = usePlaceholderStyles();
|
|
56
|
+
|
|
57
|
+
if (isPortalEnabled && AnimatedNativePortal) {
|
|
58
|
+
return (
|
|
59
|
+
<Animated.View
|
|
60
|
+
ref={placeholderRef}
|
|
61
|
+
onLayout={({ nativeEvent: { layout } }) =>
|
|
62
|
+
runOnUI(handleOnLayout)(layout)
|
|
63
|
+
}
|
|
64
|
+
style={placeholderStyle}
|
|
65
|
+
pointerEvents={pointerEvents}
|
|
66
|
+
collapsable={false}
|
|
67
|
+
>
|
|
68
|
+
<AnimatedNativePortal
|
|
69
|
+
animatedProps={animatedProps}
|
|
70
|
+
name={id}
|
|
71
|
+
pointerEvents={pointerEvents}
|
|
72
|
+
>
|
|
73
|
+
{children}
|
|
74
|
+
</AnimatedNativePortal>
|
|
75
|
+
</Animated.View>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return children;
|
|
80
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LocalStyleLayers } from "
|
|
1
|
+
import type { LocalStyleLayers } from "../../../../../../providers/screen/styles/helpers/resolve-slot-styles";
|
|
2
2
|
|
|
3
3
|
export const hasLocalSlot = (
|
|
4
4
|
localStylesMaps: LocalStyleLayers,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const BOUNDARY_PORTAL_HOST_NAME_SUFFIX = "-portal-host";
|
|
2
|
+
|
|
3
|
+
export const createBoundaryPortalHostName = (
|
|
4
|
+
hostKey: string,
|
|
5
|
+
boundaryId: string,
|
|
6
|
+
pairKey?: string | null,
|
|
7
|
+
) => {
|
|
8
|
+
"worklet";
|
|
9
|
+
return `${hostKey}-${pairKey ? `${pairKey}-` : ""}${boundaryId}${BOUNDARY_PORTAL_HOST_NAME_SUFFIX}`;
|
|
10
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { StyleProps } from "react-native-reanimated";
|
|
2
|
-
import { getClampedScrollAxisDelta } from "
|
|
3
|
-
import type { ScrollMeasuredDimensions } from "
|
|
2
|
+
import { getClampedScrollAxisDelta } from "../../../../../../stores/scroll.store";
|
|
3
|
+
import type { ScrollMeasuredDimensions } from "../../../../utils/measured-bounds";
|
|
4
4
|
import { getPortalHostBounds } from "../stores/host-bounds.store";
|
|
5
5
|
|
|
6
6
|
/**
|