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,250 @@
|
|
|
1
|
+
import { useCallback, useLayoutEffect, useRef, 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 { pairs } from "../../../../../../stores/bounds/internals/state";
|
|
11
|
+
import { PORTAL_HOST_NAME_RESET_VALUE } from "../../../utils/naming";
|
|
12
|
+
import {
|
|
13
|
+
type PortalOwnershipSignal,
|
|
14
|
+
resolveBoundaryPortalOwnership,
|
|
15
|
+
} from "../../../utils/ownership";
|
|
16
|
+
import { shallowEqual } from "../../../utils/shallow-equal";
|
|
17
|
+
import { shouldAttachBoundaryPortal } from "../../../utils/teleport-control";
|
|
18
|
+
import { resolveNextVisiblePortalHostName } from "../../../utils/visible-host";
|
|
19
|
+
import { createBoundaryPortalHostName } from "../helpers/host-name";
|
|
20
|
+
import { useActiveHostKey } from "../stores/host-registry.store";
|
|
21
|
+
import {
|
|
22
|
+
dropStalePortalBoundaryHosts,
|
|
23
|
+
mountPortalBoundaryHost,
|
|
24
|
+
unmountPortalBoundaryHostByName,
|
|
25
|
+
} from "../stores/portal-boundary-host.store";
|
|
26
|
+
|
|
27
|
+
interface UseBoundaryPortalAttachmentParams {
|
|
28
|
+
boundaryId: string;
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const useBoundaryPortalAttachment = ({
|
|
33
|
+
boundaryId,
|
|
34
|
+
enabled,
|
|
35
|
+
}: UseBoundaryPortalAttachmentParams) => {
|
|
36
|
+
const sourcePairKey = useDescriptorsStore((s) => s.derivations.sourcePairKey);
|
|
37
|
+
const currentScreenKey = useDescriptorsStore(
|
|
38
|
+
(s) => s.derivations.currentScreenKey,
|
|
39
|
+
);
|
|
40
|
+
const { localStylesMaps, nextInterpolatorReady, slotsMap } = useScreenSlots();
|
|
41
|
+
const [ownership, setOwnership] = useState<Extract<
|
|
42
|
+
PortalOwnershipSignal,
|
|
43
|
+
{ status: "complete" }
|
|
44
|
+
> | null>(null);
|
|
45
|
+
const requestedPortalHostName = useSharedValue<string | null>(null);
|
|
46
|
+
const visiblePortalHostName = useSharedValue<string | null>(null);
|
|
47
|
+
const mountedPortalBoundaryHostNamesRef = useRef(new Set<string>());
|
|
48
|
+
const escapeHostKey = useActiveHostKey(enabled ? currentScreenKey : null);
|
|
49
|
+
|
|
50
|
+
const updatePortalOwnership = useCallback(
|
|
51
|
+
(
|
|
52
|
+
hostScreenKey: string | null,
|
|
53
|
+
ownerPairKey?: string,
|
|
54
|
+
ownerScreenKey?: string,
|
|
55
|
+
) => {
|
|
56
|
+
if (hostScreenKey && ownerPairKey && ownerScreenKey) {
|
|
57
|
+
setOwnership((current) => {
|
|
58
|
+
if (
|
|
59
|
+
current?.hostScreenKey === hostScreenKey &&
|
|
60
|
+
current.ownerPairKey === ownerPairKey &&
|
|
61
|
+
current.ownerScreenKey === ownerScreenKey
|
|
62
|
+
) {
|
|
63
|
+
return current;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
hostScreenKey,
|
|
68
|
+
ownerPairKey,
|
|
69
|
+
ownerScreenKey,
|
|
70
|
+
status: "complete",
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
setOwnership((current) => (current ? null : current));
|
|
77
|
+
},
|
|
78
|
+
[],
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
const unmountOwnedPortalBoundaryHosts = useCallback(() => {
|
|
82
|
+
for (const portalHostName of mountedPortalBoundaryHostNamesRef.current) {
|
|
83
|
+
unmountPortalBoundaryHostByName(portalHostName);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
mountedPortalBoundaryHostNamesRef.current.clear();
|
|
87
|
+
}, []);
|
|
88
|
+
|
|
89
|
+
useLayoutEffect(() => {
|
|
90
|
+
if (!enabled || !ownership || !escapeHostKey) {
|
|
91
|
+
requestedPortalHostName.set(null);
|
|
92
|
+
visiblePortalHostName.set(null);
|
|
93
|
+
unmountOwnedPortalBoundaryHosts();
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const portalHostName = createBoundaryPortalHostName(
|
|
98
|
+
escapeHostKey,
|
|
99
|
+
boundaryId,
|
|
100
|
+
ownership.ownerPairKey,
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
mountPortalBoundaryHost({
|
|
104
|
+
boundaryId,
|
|
105
|
+
escapeClipping: true,
|
|
106
|
+
hostKey: escapeHostKey,
|
|
107
|
+
localStylesMaps,
|
|
108
|
+
pairKey: ownership.ownerPairKey,
|
|
109
|
+
portalHostName,
|
|
110
|
+
screenKey: currentScreenKey,
|
|
111
|
+
slotsMap,
|
|
112
|
+
});
|
|
113
|
+
mountedPortalBoundaryHostNamesRef.current.add(portalHostName);
|
|
114
|
+
|
|
115
|
+
// Request the new receiver immediately, but keep the currently visible
|
|
116
|
+
// receiver until the new interpolator is ready. This avoids a no-host gap
|
|
117
|
+
// during rapid close/open retargets.
|
|
118
|
+
requestedPortalHostName.set(portalHostName);
|
|
119
|
+
}, [
|
|
120
|
+
boundaryId,
|
|
121
|
+
currentScreenKey,
|
|
122
|
+
enabled,
|
|
123
|
+
escapeHostKey,
|
|
124
|
+
localStylesMaps,
|
|
125
|
+
ownership,
|
|
126
|
+
requestedPortalHostName,
|
|
127
|
+
slotsMap,
|
|
128
|
+
unmountOwnedPortalBoundaryHosts,
|
|
129
|
+
visiblePortalHostName,
|
|
130
|
+
]);
|
|
131
|
+
|
|
132
|
+
useLayoutEffect(() => {
|
|
133
|
+
return () => {
|
|
134
|
+
requestedPortalHostName.set(null);
|
|
135
|
+
visiblePortalHostName.set(null);
|
|
136
|
+
unmountOwnedPortalBoundaryHosts();
|
|
137
|
+
};
|
|
138
|
+
}, [
|
|
139
|
+
requestedPortalHostName,
|
|
140
|
+
unmountOwnedPortalBoundaryHosts,
|
|
141
|
+
visiblePortalHostName,
|
|
142
|
+
]);
|
|
143
|
+
|
|
144
|
+
useAnimatedReaction(
|
|
145
|
+
() => {
|
|
146
|
+
"worklet";
|
|
147
|
+
if (!enabled || !sourcePairKey) {
|
|
148
|
+
return {
|
|
149
|
+
hostScreenKey: null,
|
|
150
|
+
ownerPairKey: sourcePairKey,
|
|
151
|
+
ownerScreenKey: null,
|
|
152
|
+
status: "clear",
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return resolveBoundaryPortalOwnership({
|
|
157
|
+
boundaryId,
|
|
158
|
+
currentScreenKey,
|
|
159
|
+
handoff: false,
|
|
160
|
+
pairsState: pairs.get(),
|
|
161
|
+
sourcePairKey,
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
(signal, previousSignal) => {
|
|
165
|
+
"worklet";
|
|
166
|
+
if (shallowEqual(previousSignal, signal)) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
runOnJS(updatePortalOwnership)(
|
|
171
|
+
signal.hostScreenKey,
|
|
172
|
+
signal.ownerPairKey,
|
|
173
|
+
signal.ownerScreenKey ?? undefined,
|
|
174
|
+
);
|
|
175
|
+
},
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
useAnimatedReaction(
|
|
179
|
+
() => {
|
|
180
|
+
"worklet";
|
|
181
|
+
const slot = slotsMap.get()[boundaryId];
|
|
182
|
+
const teleport = slot?.props?.teleport;
|
|
183
|
+
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
184
|
+
enabled,
|
|
185
|
+
teleport,
|
|
186
|
+
});
|
|
187
|
+
const requestedName = requestedPortalHostName.get();
|
|
188
|
+
const visibleName = visiblePortalHostName.get();
|
|
189
|
+
const isInterpolatorReady = nextInterpolatorReady.get();
|
|
190
|
+
const nextVisibleName = resolveNextVisiblePortalHostName({
|
|
191
|
+
isInterpolatorReady: isInterpolatorReady === 1,
|
|
192
|
+
requestedName,
|
|
193
|
+
shouldTeleport,
|
|
194
|
+
visibleName,
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
return {
|
|
198
|
+
isInterpolatorReady,
|
|
199
|
+
nextVisibleName,
|
|
200
|
+
requestedName,
|
|
201
|
+
shouldTeleport,
|
|
202
|
+
teleport,
|
|
203
|
+
visibleName,
|
|
204
|
+
};
|
|
205
|
+
},
|
|
206
|
+
(state, previousState) => {
|
|
207
|
+
"worklet";
|
|
208
|
+
if (shallowEqual(previousState, state)) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if (state.nextVisibleName !== state.visibleName) {
|
|
213
|
+
visiblePortalHostName.set(state.nextVisibleName);
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
if (state.visibleName && state.visibleName === state.requestedName) {
|
|
218
|
+
runOnJS(dropStalePortalBoundaryHosts)({
|
|
219
|
+
boundaryId,
|
|
220
|
+
keepPortalHostName: state.visibleName,
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
);
|
|
225
|
+
|
|
226
|
+
const teleportProps = useAnimatedProps(() => {
|
|
227
|
+
"worklet";
|
|
228
|
+
|
|
229
|
+
const slot = slotsMap.get()[boundaryId];
|
|
230
|
+
const { teleport, ...slotProps } = slot?.props ?? {};
|
|
231
|
+
const shouldTeleport = shouldAttachBoundaryPortal({
|
|
232
|
+
enabled,
|
|
233
|
+
teleport,
|
|
234
|
+
});
|
|
235
|
+
const visibleName = visiblePortalHostName.get();
|
|
236
|
+
|
|
237
|
+
return {
|
|
238
|
+
...slotProps,
|
|
239
|
+
hostName:
|
|
240
|
+
shouldTeleport && visibleName
|
|
241
|
+
? visibleName
|
|
242
|
+
: PORTAL_HOST_NAME_RESET_VALUE,
|
|
243
|
+
};
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
return {
|
|
247
|
+
teleportProps,
|
|
248
|
+
visiblePortalHostName,
|
|
249
|
+
};
|
|
250
|
+
};
|
|
@@ -5,18 +5,21 @@ import {
|
|
|
5
5
|
measure,
|
|
6
6
|
runOnJS,
|
|
7
7
|
runOnUI,
|
|
8
|
+
type SharedValue,
|
|
8
9
|
useAnimatedReaction,
|
|
9
10
|
useAnimatedRef,
|
|
10
11
|
useSharedValue,
|
|
11
12
|
withDelay,
|
|
12
13
|
withTiming,
|
|
13
14
|
} from "react-native-reanimated";
|
|
14
|
-
import { useOriginContext } from "
|
|
15
|
-
import { ScrollStore } from "
|
|
15
|
+
import { useOriginContext } from "../../../../../../providers/screen/origin.provider";
|
|
16
|
+
import { ScrollStore } from "../../../../../../stores/scroll.store";
|
|
17
|
+
import { getVisibilityBlockOffset } from "../../../../../../utils/visibility-block-offset";
|
|
16
18
|
import {
|
|
17
19
|
adjustedMeasuredBoundsForOverscrollDeltas,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
isMeasurementInViewport,
|
|
21
|
+
normalizeMeasuredBoundsWithVisibilityGate,
|
|
22
|
+
} from "../../../../utils/measured-bounds";
|
|
20
23
|
import {
|
|
21
24
|
clearPortalHostBounds,
|
|
22
25
|
setPortalHostBounds,
|
|
@@ -29,6 +32,9 @@ type UseHostMeasurementParams = {
|
|
|
29
32
|
enabled: boolean;
|
|
30
33
|
hostKey: string;
|
|
31
34
|
screenKey: string;
|
|
35
|
+
visibilityBlocked: SharedValue<boolean>;
|
|
36
|
+
viewportHeight: number;
|
|
37
|
+
viewportWidth: number;
|
|
32
38
|
};
|
|
33
39
|
|
|
34
40
|
export const useHostMeasurement = ({
|
|
@@ -36,6 +42,9 @@ export const useHostMeasurement = ({
|
|
|
36
42
|
enabled,
|
|
37
43
|
hostKey,
|
|
38
44
|
screenKey,
|
|
45
|
+
visibilityBlocked,
|
|
46
|
+
viewportHeight,
|
|
47
|
+
viewportWidth,
|
|
39
48
|
}: UseHostMeasurementParams) => {
|
|
40
49
|
const hostRef = useAnimatedRef<View>();
|
|
41
50
|
const scrollMetadata = ScrollStore.getValue(screenKey, "metadata");
|
|
@@ -91,10 +100,31 @@ export const useHostMeasurement = ({
|
|
|
91
100
|
? adjustedMeasuredBoundsForOverscrollDeltas(measured, currentScroll)
|
|
92
101
|
: measured;
|
|
93
102
|
|
|
94
|
-
const normalizedMeasured =
|
|
95
|
-
overscrollNormalized,
|
|
96
|
-
measuredOrigin,
|
|
97
|
-
|
|
103
|
+
const normalizedMeasured = normalizeMeasuredBoundsWithVisibilityGate({
|
|
104
|
+
measured: overscrollNormalized,
|
|
105
|
+
origin: measuredOrigin,
|
|
106
|
+
visibilityBlocked: visibilityBlocked.get(),
|
|
107
|
+
visibilityBlockOffset: getVisibilityBlockOffset(viewportHeight),
|
|
108
|
+
viewportWidth,
|
|
109
|
+
viewportHeight,
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
if (
|
|
113
|
+
!isMeasurementInViewport(
|
|
114
|
+
normalizedMeasured,
|
|
115
|
+
viewportWidth,
|
|
116
|
+
viewportHeight,
|
|
117
|
+
)
|
|
118
|
+
) {
|
|
119
|
+
cancelAnimation(retryToken);
|
|
120
|
+
retryToken.set(
|
|
121
|
+
withDelay(
|
|
122
|
+
HOST_MEASUREMENT_RETRY_DELAY_MS,
|
|
123
|
+
withTiming(retryToken.get() + 1, { duration: 0 }),
|
|
124
|
+
),
|
|
125
|
+
);
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
98
128
|
|
|
99
129
|
setPortalHostBounds(hostKey, {
|
|
100
130
|
x: normalizedMeasured.x,
|
|
@@ -1,31 +1,20 @@
|
|
|
1
1
|
import { useCallback } from "react";
|
|
2
2
|
import type { LayoutRectangle } from "react-native";
|
|
3
|
-
import {
|
|
4
|
-
type SharedValue,
|
|
5
|
-
useAnimatedStyle,
|
|
6
|
-
useSharedValue,
|
|
7
|
-
} from "react-native-reanimated";
|
|
3
|
+
import { useAnimatedStyle, useSharedValue } from "react-native-reanimated";
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
visiblePortalHostName: SharedValue<string | null>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export const usePlaceholderStyles = ({
|
|
14
|
-
visiblePortalHostName,
|
|
15
|
-
}: UsePlaceholderProps) => {
|
|
5
|
+
export const usePlaceholderStyles = () => {
|
|
16
6
|
const placeholderWidth = useSharedValue(0);
|
|
17
7
|
const placeholderHeight = useSharedValue(0);
|
|
18
8
|
// Pin the placeholder to its measured size while content lives in the host,
|
|
19
|
-
// in the same UI frame the host name flips
|
|
9
|
+
// in the same UI frame the host name flips - no commit in between. Until the
|
|
20
10
|
// first layout lands (dims 0) sizing stays natural so an instant attach
|
|
21
11
|
// cannot collapse the slot.
|
|
22
12
|
const placeholderStyle = useAnimatedStyle(() => {
|
|
23
13
|
"worklet";
|
|
24
|
-
const isAttached = visiblePortalHostName.get() !== null;
|
|
25
14
|
const width = placeholderWidth.get();
|
|
26
15
|
const height = placeholderHeight.get();
|
|
27
16
|
|
|
28
|
-
if (
|
|
17
|
+
if (width === 0) {
|
|
29
18
|
return { width: "auto", height: "auto" } as const;
|
|
30
19
|
}
|
|
31
20
|
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { memo, type ReactNode } from "react";
|
|
2
|
+
import type { View, ViewProps } from "react-native";
|
|
3
|
+
import type { AnimatedRef } from "react-native-reanimated";
|
|
4
|
+
import { BoundaryPortalSlot } from "./components/portal-slot";
|
|
5
|
+
import { useBoundaryPortalAttachment } from "./hooks/use-boundary-portal-attachment";
|
|
6
|
+
|
|
7
|
+
type BoundaryPortalProps = {
|
|
8
|
+
boundaryId: string;
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
placeholderRef?: AnimatedRef<View>;
|
|
12
|
+
pointerEvents?: ViewProps["pointerEvents"];
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const BoundaryPortal = memo(function BoundaryPortal({
|
|
16
|
+
boundaryId,
|
|
17
|
+
children,
|
|
18
|
+
enabled,
|
|
19
|
+
placeholderRef,
|
|
20
|
+
pointerEvents,
|
|
21
|
+
}: BoundaryPortalProps) {
|
|
22
|
+
const { teleportProps } = useBoundaryPortalAttachment({
|
|
23
|
+
boundaryId,
|
|
24
|
+
enabled,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<BoundaryPortalSlot
|
|
29
|
+
id={boundaryId}
|
|
30
|
+
enabled={enabled}
|
|
31
|
+
animatedProps={teleportProps}
|
|
32
|
+
placeholderRef={placeholderRef}
|
|
33
|
+
pointerEvents={pointerEvents}
|
|
34
|
+
>
|
|
35
|
+
{children}
|
|
36
|
+
</BoundaryPortalSlot>
|
|
37
|
+
);
|
|
38
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type MeasuredDimensions, makeMutable } from "react-native-reanimated";
|
|
2
|
-
import { cloneScrollMetadataState } from "
|
|
3
|
-
import type { ScrollMetadataState } from "
|
|
2
|
+
import { cloneScrollMetadataState } from "../../../../../../stores/scroll.store";
|
|
3
|
+
import type { ScrollMetadataState } from "../../../../../../types/gesture.types";
|
|
4
4
|
|
|
5
5
|
export type PortalHostBounds = MeasuredDimensions & {
|
|
6
6
|
scroll?: ScrollMetadataState | null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useSyncExternalStore } from "react";
|
|
2
2
|
import type { SharedValue } from "react-native-reanimated";
|
|
3
|
-
import type { LocalStyleLayers } from "
|
|
4
|
-
import type { NormalizedTransitionInterpolatedStyle } from "
|
|
3
|
+
import type { LocalStyleLayers } from "../../../../../../providers/screen/styles/helpers/resolve-slot-styles";
|
|
4
|
+
import type { NormalizedTransitionInterpolatedStyle } from "../../../../../../types/animation.types";
|
|
5
5
|
|
|
6
6
|
export type ActivePortalBoundaryHost = {
|
|
7
7
|
boundaryId: string;
|
|
@@ -75,19 +75,10 @@ export const mountPortalBoundaryHost = (host: ActivePortalBoundaryHost) => {
|
|
|
75
75
|
emit();
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
export const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
if (host.boundaryId !== boundaryId) {
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
activeBoundaryHosts.delete(hostEntryKey);
|
|
87
|
-
didDelete = true;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
if (!didDelete) {
|
|
78
|
+
export const unmountPortalBoundaryHostByName = (
|
|
79
|
+
portalHostName: string | null | undefined,
|
|
80
|
+
) => {
|
|
81
|
+
if (!portalHostName || !activeBoundaryHosts.delete(portalHostName)) {
|
|
91
82
|
return;
|
|
92
83
|
}
|
|
93
84
|
|
|
@@ -106,6 +97,10 @@ export const dropStalePortalBoundaryHosts = ({
|
|
|
106
97
|
boundaryId: string;
|
|
107
98
|
keepPortalHostName: string;
|
|
108
99
|
}) => {
|
|
100
|
+
if (!activeBoundaryHosts.has(keepPortalHostName)) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
|
|
109
104
|
let didDelete = false;
|
|
110
105
|
|
|
111
106
|
for (const [hostEntryKey, host] of activeBoundaryHosts) {
|
|
@@ -5,8 +5,8 @@ import { type ComponentType, createElement, type ReactNode } from "react";
|
|
|
5
5
|
* try/catch so Metro treats it as an optional dependency — an absent module no
|
|
6
6
|
* longer fails the bundle, it throws at runtime and the catch swallows it.
|
|
7
7
|
*
|
|
8
|
-
* When teleport is missing,
|
|
9
|
-
* rendering; everything else keeps working.
|
|
8
|
+
* When teleport is missing, handoff and escapeClipping boundaries degrade to
|
|
9
|
+
* inline rendering; everything else keeps working.
|
|
10
10
|
*/
|
|
11
11
|
let mod: any = null;
|
|
12
12
|
let managerMod: any = null;
|
|
@@ -1,20 +1 @@
|
|
|
1
1
|
export const PORTAL_HOST_NAME_RESET_VALUE = null;
|
|
2
|
-
const PORTAL_HOST_NAME_SUFFIX = "-portal-host";
|
|
3
|
-
const BOUNDARY_LOCAL_PORTAL_HOST_NAME_SUFFIX = "-boundary-local-portal-host";
|
|
4
|
-
|
|
5
|
-
export const createPortalBoundaryHostName = (
|
|
6
|
-
hostKey: string,
|
|
7
|
-
boundaryId: string,
|
|
8
|
-
pairKey?: string | null,
|
|
9
|
-
) => {
|
|
10
|
-
"worklet";
|
|
11
|
-
return `${hostKey}-${pairKey ? `${pairKey}-` : ""}${boundaryId}${PORTAL_HOST_NAME_SUFFIX}`;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export const createBoundaryLocalPortalHostName = (
|
|
15
|
-
screenKey: string,
|
|
16
|
-
boundaryId: string,
|
|
17
|
-
) => {
|
|
18
|
-
"worklet";
|
|
19
|
-
return `${screenKey}-${boundaryId}${BOUNDARY_LOCAL_PORTAL_HOST_NAME_SUFFIX}`;
|
|
20
|
-
};
|
|
@@ -26,6 +26,29 @@ export type PortalOwnershipSignal =
|
|
|
26
26
|
status: "complete";
|
|
27
27
|
};
|
|
28
28
|
|
|
29
|
+
export const isHandoffHostClosingComplete = ({
|
|
30
|
+
closing,
|
|
31
|
+
progressAnimating,
|
|
32
|
+
progressSettled,
|
|
33
|
+
willAnimate,
|
|
34
|
+
}: {
|
|
35
|
+
closing: number;
|
|
36
|
+
progressAnimating: number;
|
|
37
|
+
progressSettled: number;
|
|
38
|
+
willAnimate: number;
|
|
39
|
+
}) => {
|
|
40
|
+
"worklet";
|
|
41
|
+
|
|
42
|
+
// A close request marks `closing` before its animation starts. Springs can
|
|
43
|
+
// also enter their settle-distance threshold before their final frame.
|
|
44
|
+
return (
|
|
45
|
+
!!closing &&
|
|
46
|
+
willAnimate === 0 &&
|
|
47
|
+
progressSettled === 1 &&
|
|
48
|
+
progressAnimating === 0
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
29
52
|
const hasSeenScreenKey = (screenKeys: ScreenKey[], screenKey: ScreenKey) => {
|
|
30
53
|
"worklet";
|
|
31
54
|
for (let index = 0; index < screenKeys.length; index++) {
|
|
@@ -36,13 +59,6 @@ const hasSeenScreenKey = (screenKeys: ScreenKey[], screenKey: ScreenKey) => {
|
|
|
36
59
|
return false;
|
|
37
60
|
};
|
|
38
61
|
|
|
39
|
-
export const usesEscapeClippingHost = (
|
|
40
|
-
link: TagLink | null | undefined,
|
|
41
|
-
): boolean => {
|
|
42
|
-
"worklet";
|
|
43
|
-
return link?.source?.handoff === true && link.source.escapeClipping === true;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
62
|
const isReturningToPreviousSourceHost = ({
|
|
47
63
|
hostScreenKey,
|
|
48
64
|
ownerPairKey,
|
|
@@ -69,7 +85,7 @@ const isReturningToPreviousSourceHost = ({
|
|
|
69
85
|
);
|
|
70
86
|
};
|
|
71
87
|
|
|
72
|
-
export const
|
|
88
|
+
export const canSwitchHandoffHostImmediately = ({
|
|
73
89
|
hostScreenKey,
|
|
74
90
|
ownerPairKey,
|
|
75
91
|
previousOwnerPairKey,
|
|
@@ -118,7 +134,7 @@ const isActiveHandoffLink = ({
|
|
|
118
134
|
return !activeId || activeId === linkKey;
|
|
119
135
|
};
|
|
120
136
|
|
|
121
|
-
const
|
|
137
|
+
const resolveHandoffStyleOwnerScreenKey = ({
|
|
122
138
|
hostScreenKey,
|
|
123
139
|
isSettledHostReady,
|
|
124
140
|
settledHostScreenKey,
|
|
@@ -160,7 +176,6 @@ const clearSignal = (sourcePairKey: ScreenPairKey): PortalOwnershipSignal => {
|
|
|
160
176
|
export const resolveBoundaryPortalOwnership = ({
|
|
161
177
|
boundaryId,
|
|
162
178
|
currentScreenKey,
|
|
163
|
-
escapeClipping,
|
|
164
179
|
handoff,
|
|
165
180
|
isSettledHostClosingComplete = false,
|
|
166
181
|
isSettledHostReady = false,
|
|
@@ -170,7 +185,6 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
170
185
|
}: {
|
|
171
186
|
boundaryId: string;
|
|
172
187
|
currentScreenKey: ScreenKey;
|
|
173
|
-
escapeClipping: boolean;
|
|
174
188
|
handoff: boolean;
|
|
175
189
|
isSettledHostClosingComplete?: boolean;
|
|
176
190
|
isSettledHostReady?: boolean;
|
|
@@ -208,7 +222,6 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
208
222
|
|
|
209
223
|
let hostScreenKey = link.destination.screenKey;
|
|
210
224
|
let ownerPairKey = sourcePairKey;
|
|
211
|
-
let previousOwnerPairKey: ScreenPairKey | null = null;
|
|
212
225
|
const seenScreenKeys: ScreenKey[] = [
|
|
213
226
|
getSourceScreenKeyFromPairKey(sourcePairKey),
|
|
214
227
|
hostScreenKey,
|
|
@@ -254,7 +267,6 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
254
267
|
|
|
255
268
|
const nextHostScreenKey = candidate.destination.screenKey;
|
|
256
269
|
|
|
257
|
-
previousOwnerPairKey = ownerPairKey;
|
|
258
270
|
ownerPairKey = candidatePairKey;
|
|
259
271
|
hostScreenKey = nextHostScreenKey;
|
|
260
272
|
|
|
@@ -283,27 +295,16 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
283
295
|
break;
|
|
284
296
|
}
|
|
285
297
|
|
|
286
|
-
|
|
287
|
-
const ownerUsesEscapeClipping =
|
|
288
|
-
ownerLink?.source?.escapeClipping ?? escapeClipping;
|
|
289
|
-
|
|
290
|
-
if (
|
|
291
|
-
!ownerUsesEscapeClipping &&
|
|
292
|
-
isSettledHostClosingComplete &&
|
|
293
|
-
settledHostScreenKey === hostScreenKey &&
|
|
294
|
-
previousOwnerPairKey
|
|
295
|
-
) {
|
|
298
|
+
if (isSettledHostClosingComplete && settledHostScreenKey === hostScreenKey) {
|
|
296
299
|
hostScreenKey = getSourceScreenKeyFromPairKey(ownerPairKey);
|
|
297
300
|
}
|
|
298
301
|
|
|
299
|
-
const ownerScreenKey =
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
sourceScreenKey: getSourceScreenKeyFromPairKey(ownerPairKey),
|
|
306
|
-
});
|
|
302
|
+
const ownerScreenKey = resolveHandoffStyleOwnerScreenKey({
|
|
303
|
+
hostScreenKey,
|
|
304
|
+
isSettledHostReady,
|
|
305
|
+
settledHostScreenKey,
|
|
306
|
+
sourceScreenKey: getSourceScreenKeyFromPairKey(ownerPairKey),
|
|
307
|
+
});
|
|
307
308
|
|
|
308
309
|
return {
|
|
309
310
|
hostScreenKey,
|
|
@@ -312,60 +313,3 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
312
313
|
status: "complete",
|
|
313
314
|
};
|
|
314
315
|
};
|
|
315
|
-
|
|
316
|
-
export const hasHandoffEscapeContinuation = ({
|
|
317
|
-
linkKey,
|
|
318
|
-
linkState,
|
|
319
|
-
sourceScreenKey,
|
|
320
|
-
}: {
|
|
321
|
-
linkKey: string;
|
|
322
|
-
linkState: LinkPairsState;
|
|
323
|
-
sourceScreenKey: ScreenKey;
|
|
324
|
-
}) => {
|
|
325
|
-
"worklet";
|
|
326
|
-
const pairKeys = Object.keys(linkState);
|
|
327
|
-
const visitedScreenKeys: ScreenKey[] = [];
|
|
328
|
-
let cursorScreenKey = sourceScreenKey;
|
|
329
|
-
|
|
330
|
-
for (let hop = 0; hop < pairKeys.length; hop++) {
|
|
331
|
-
if (hasSeenScreenKey(visitedScreenKeys, cursorScreenKey)) {
|
|
332
|
-
return false;
|
|
333
|
-
}
|
|
334
|
-
visitedScreenKeys.push(cursorScreenKey);
|
|
335
|
-
|
|
336
|
-
let previousScreenKey: ScreenKey | null = null;
|
|
337
|
-
for (let index = 0; index < pairKeys.length; index++) {
|
|
338
|
-
const candidatePairKey = pairKeys[index];
|
|
339
|
-
const link = candidatePairKey
|
|
340
|
-
? linkState[candidatePairKey]?.links?.[linkKey]
|
|
341
|
-
: null;
|
|
342
|
-
|
|
343
|
-
if (
|
|
344
|
-
!link?.source ||
|
|
345
|
-
!link.destination ||
|
|
346
|
-
link.destination.screenKey !== cursorScreenKey
|
|
347
|
-
) {
|
|
348
|
-
continue;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
if (usesEscapeClippingHost(link)) {
|
|
352
|
-
return true;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
if (!link.source.handoff) {
|
|
356
|
-
return false;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
previousScreenKey = link.source.screenKey;
|
|
360
|
-
break;
|
|
361
|
-
}
|
|
362
|
-
|
|
363
|
-
if (!previousScreenKey) {
|
|
364
|
-
return false;
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
cursorScreenKey = previousScreenKey;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
return false;
|
|
371
|
-
};
|