react-native-screen-transitions 3.9.0-beta.0 → 3.9.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/shared/adapters/with-screen-transitions/index.js +20 -4
- package/lib/commonjs/shared/adapters/with-screen-transitions/index.js.map +1 -1
- package/lib/commonjs/shared/animation/transition-blocking.js +71 -0
- package/lib/commonjs/shared/animation/transition-blocking.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js +30 -30
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js +30 -95
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +68 -51
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +14 -2
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-register-target.js +32 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-register-target.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/index.js +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +40 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js +14 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +194 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js +44 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/{host.js → boundary-portal/components/host.js} +17 -16
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/{portal-boundary-host.js → boundary-portal/components/portal-boundary-host.js} +11 -11
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +52 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js +14 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.js +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +184 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.js +23 -5
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-placeholder-styles.js +3 -6
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js +33 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.js +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.js +7 -12
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/index.js +1 -8
- package/lib/commonjs/shared/components/boundary/portal/index.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/teleport.js +2 -2
- package/lib/commonjs/shared/components/boundary/portal/utils/naming.js +1 -15
- package/lib/commonjs/shared/components/boundary/portal/utils/naming.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js +19 -56
- package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +77 -23
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +41 -12
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/measured-bounds.js +36 -1
- package/lib/commonjs/shared/components/boundary/utils/measured-bounds.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +1 -1
- package/lib/commonjs/shared/configs/presets.js +2 -2
- package/lib/commonjs/shared/configs/presets.js.map +1 -1
- package/lib/commonjs/shared/index.js +13 -0
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js +6 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js +50 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +7 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +5 -3
- package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js +1 -1
- package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -1
- package/lib/commonjs/shared/stores/system.store.js +10 -2
- package/lib/commonjs/shared/stores/system.store.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +15 -9
- package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +2 -2
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +3 -3
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/module/shared/adapters/with-screen-transitions/index.js +19 -5
- package/lib/module/shared/adapters/with-screen-transitions/index.js.map +1 -1
- package/lib/module/shared/animation/transition-blocking.js +66 -0
- package/lib/module/shared/animation/transition-blocking.js.map +1 -0
- package/lib/module/shared/components/boundary/components/boundary-target.js +32 -32
- package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/module/shared/components/boundary/create-boundary-component.js +32 -97
- package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +72 -55
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +1 -0
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-measurer.js +15 -3
- package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-register-target.js +27 -0
- package/lib/module/shared/components/boundary/hooks/use-register-target.js.map +1 -0
- package/lib/module/shared/components/boundary/index.js +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +35 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js +9 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +189 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js +33 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/{host.js → boundary-portal/components/host.js} +17 -16
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/{portal-boundary-host.js → boundary-portal/components/portal-boundary-host.js} +11 -11
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +47 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js +9 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.js +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +179 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.js +23 -5
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-placeholder-styles.js +3 -6
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js +29 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.js +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.js +5 -10
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/index.js +1 -2
- package/lib/module/shared/components/boundary/portal/index.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/teleport.js +2 -2
- package/lib/module/shared/components/boundary/portal/utils/naming.js +0 -12
- package/lib/module/shared/components/boundary/portal/utils/naming.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/utils/ownership.js +16 -52
- package/lib/module/shared/components/boundary/portal/utils/ownership.js.map +1 -1
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +74 -20
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/destination-signals.js +39 -10
- package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/measured-bounds.js +34 -0
- package/lib/module/shared/components/boundary/utils/measured-bounds.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/shared/configs/presets.js +2 -2
- package/lib/module/shared/configs/presets.js.map +1 -1
- package/lib/module/shared/index.js +1 -0
- package/lib/module/shared/index.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js +6 -1
- package/lib/module/shared/providers/screen/animation/helpers/read-screen-animation-revisions.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js +45 -0
- package/lib/module/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +7 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +2 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/slot.provider.js +5 -3
- package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js +1 -1
- package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -1
- package/lib/module/shared/stores/system.store.js +10 -2
- package/lib/module/shared/stores/system.store.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +15 -9
- package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js +2 -2
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js +3 -3
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/typescript/shared/adapters/with-screen-transitions/index.d.ts +4 -1
- package/lib/typescript/shared/adapters/with-screen-transitions/index.d.ts.map +1 -1
- package/lib/typescript/shared/animation/transition-blocking.d.ts +33 -0
- package/lib/typescript/shared/animation/transition-blocking.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts +2 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-register-target.d.ts +10 -0
- package/lib/typescript/shared/components/boundary/hooks/use-register-target.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/index.d.ts +2 -2
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts +10 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.d.ts +2 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts +12 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts +11 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts +14 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts +3 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/has-local-slot.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.d.ts +2 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.d.ts +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/helpers/offset-style.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts +12 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.d.ts +5 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-host-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts +12 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-placeholder-styles.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts +13 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.d.ts +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-bounds.store.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/host-registry.store.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.d.ts +3 -3
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/stores/portal-boundary-host.store.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/index.d.ts +1 -2
- package/lib/typescript/shared/components/boundary/portal/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts +0 -2
- package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts +9 -10
- package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +21 -21
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +9 -2
- package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts +8 -0
- package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +1 -0
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/read-screen-animation-revisions.d.ts +4 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/read-screen-animation-revisions.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.d.ts +4 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +1 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +1 -0
- package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +3 -3
- package/lib/typescript/shared/types/bounds.types.d.ts +7 -2
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/options.d.ts +6 -2
- package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/adapters/with-screen-transitions/index.tsx +30 -9
- package/src/shared/animation/transition-blocking.ts +79 -0
- package/src/shared/components/boundary/components/boundary-target.tsx +43 -50
- package/src/shared/components/boundary/create-boundary-component.tsx +35 -150
- package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +103 -81
- package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +1 -0
- package/src/shared/components/boundary/hooks/use-measurer.ts +12 -4
- package/src/shared/components/boundary/hooks/use-register-target.ts +43 -0
- package/src/shared/components/boundary/index.tsx +2 -2
- package/src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx +48 -0
- package/src/shared/components/boundary/portal/components/boundary-content-portal/helpers/host-name.ts +9 -0
- package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +274 -0
- package/src/shared/components/boundary/portal/components/boundary-content-portal/index.tsx +59 -0
- package/src/shared/components/boundary/portal/components/{host.tsx → boundary-portal/components/host.tsx} +14 -15
- package/src/shared/components/boundary/portal/components/{portal-boundary-host.tsx → boundary-portal/components/portal-boundary-host.tsx} +12 -12
- package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx +80 -0
- package/src/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.ts +1 -1
- package/src/shared/components/boundary/portal/components/boundary-portal/helpers/host-name.ts +10 -0
- package/src/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/offset-style.ts +2 -2
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +250 -0
- package/src/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-host-measurement.ts +38 -8
- package/src/shared/components/boundary/portal/{hooks → components/boundary-portal/hooks}/use-placeholder-styles.ts +4 -15
- package/src/shared/components/boundary/portal/components/boundary-portal/index.tsx +38 -0
- package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-bounds.store.ts +2 -2
- package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/portal-boundary-host.store.ts +10 -15
- package/src/shared/components/boundary/portal/index.ts +1 -2
- package/src/shared/components/boundary/portal/teleport.ts +2 -2
- package/src/shared/components/boundary/portal/utils/naming.ts +0 -19
- package/src/shared/components/boundary/portal/utils/ownership.ts +32 -88
- package/src/shared/components/boundary/providers/boundary-root.provider.tsx +198 -78
- package/src/shared/components/boundary/utils/destination-signals.ts +38 -14
- package/src/shared/components/boundary/utils/measured-bounds.ts +48 -0
- package/src/shared/components/screen-container/layers/content.tsx +1 -1
- package/src/shared/configs/presets.ts +2 -2
- package/src/shared/index.ts +4 -0
- package/src/shared/providers/screen/animation/helpers/read-screen-animation-revisions.ts +14 -0
- package/src/shared/providers/screen/styles/helpers/collect-interpolator-shared-values.ts +75 -0
- package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +11 -0
- package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +1 -0
- package/src/shared/providers/screen/styles/slot.provider.tsx +4 -2
- package/src/shared/providers/screen/styles/stores/slot-references.store.ts +2 -1
- package/src/shared/stores/system.store.ts +10 -4
- package/src/shared/types/animation.types.ts +3 -3
- package/src/shared/types/bounds.types.ts +9 -2
- package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +18 -11
- package/src/shared/utils/bounds/navigation/reveal/build.ts +2 -2
- package/src/shared/utils/bounds/navigation/zoom/build.ts +3 -3
- package/src/shared/utils/bounds/types/options.ts +9 -2
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js +0 -58
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/components/host.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/components/portal.js +0 -272
- package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/stores/host-bounds.store.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js +0 -53
- package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/components/host.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/components/portal.js +0 -267
- package/lib/module/shared/components/boundary/portal/components/portal.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/hooks/use-placeholder-styles.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/stores/host-bounds.store.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/utils/offset-style.js.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts +0 -8
- package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +0 -20
- package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/hooks/use-placeholder-styles.d.ts +0 -17
- package/lib/typescript/shared/components/boundary/portal/hooks/use-placeholder-styles.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/stores/host-bounds.store.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts +0 -3
- package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts.map +0 -1
- package/src/shared/components/boundary/portal/components/boundary-local-portal-host.tsx +0 -66
- package/src/shared/components/boundary/portal/components/portal.tsx +0 -412
- /package/lib/commonjs/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.js +0 -0
- /package/lib/commonjs/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.js +0 -0
- /package/lib/module/shared/components/boundary/portal/{utils → components/boundary-portal/helpers}/has-local-slot.js +0 -0
- /package/lib/module/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.js +0 -0
- /package/lib/typescript/shared/components/boundary/portal/components/{host.d.ts → boundary-portal/components/host.d.ts} +0 -0
- /package/lib/typescript/shared/components/boundary/portal/components/{portal-boundary-host.d.ts → boundary-portal/components/portal-boundary-host.d.ts} +0 -0
- /package/lib/typescript/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.d.ts +0 -0
- /package/src/shared/components/boundary/portal/{stores → components/boundary-portal/stores}/host-registry.store.ts +0 -0
|
@@ -1,13 +1,35 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type ForwardedRef,
|
|
3
|
+
type ReactNode,
|
|
4
|
+
useCallback,
|
|
5
|
+
useImperativeHandle,
|
|
6
|
+
useMemo,
|
|
7
|
+
useState,
|
|
8
|
+
} from "react";
|
|
2
9
|
import type { View } from "react-native";
|
|
3
10
|
import type { AnimatedRef, StyleProps } from "react-native-reanimated";
|
|
4
11
|
import { useAnimatedRef } from "react-native-reanimated";
|
|
12
|
+
import { useDescriptorsStore } from "../../../providers/screen/descriptors";
|
|
13
|
+
import {
|
|
14
|
+
useComposedSlotStyles,
|
|
15
|
+
useSlotStackingStyles,
|
|
16
|
+
} from "../../../providers/screen/styles";
|
|
17
|
+
import { createBoundTag } from "../../../stores/bounds/helpers/link-pairs.helpers";
|
|
5
18
|
import type { BoundTag } from "../../../stores/bounds/types";
|
|
6
19
|
import createProvider from "../../../utils/create-provider";
|
|
7
20
|
import { logger } from "../../../utils/logger";
|
|
8
|
-
import
|
|
21
|
+
import { useBoundaryMeasurement } from "../hooks/use-boundary-measurement";
|
|
22
|
+
import {
|
|
23
|
+
type BoundaryPortalRuntime,
|
|
24
|
+
resolveBoundaryPortal,
|
|
25
|
+
} from "../portal/utils/resolve-portal";
|
|
26
|
+
import type {
|
|
27
|
+
BoundaryConfigProps,
|
|
28
|
+
BoundaryId,
|
|
29
|
+
BoundaryOwnProps,
|
|
30
|
+
} from "../types";
|
|
9
31
|
|
|
10
|
-
interface BoundaryRootContextValue {
|
|
32
|
+
interface BoundaryRootContextValue extends BoundaryRootRenderState {
|
|
11
33
|
registerTargetRef: (
|
|
12
34
|
targetRef: AnimatedRef<View>,
|
|
13
35
|
preparedStyles: StyleProps,
|
|
@@ -33,83 +55,181 @@ const MULTIPLE_TARGETS_WARNING =
|
|
|
33
55
|
export const TARGET_OUTSIDE_ROOT_WARNING =
|
|
34
56
|
"Boundary.Target must be rendered inside Transition.Boundary or a component created by createBoundaryComponent.";
|
|
35
57
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
children: ReactNode;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const { BoundaryRootProvider, useBoundaryRootContext } = createProvider(
|
|
42
|
-
"BoundaryRoot",
|
|
43
|
-
{ guarded: false },
|
|
44
|
-
)<BoundaryRootProps, BoundaryRootContextValue>((props) => props);
|
|
45
|
-
|
|
46
|
-
export const useBoundaryRootState = (params: {
|
|
58
|
+
export type BoundaryRootRenderState = {
|
|
59
|
+
attachedStyle: unknown;
|
|
47
60
|
boundTag: BoundTag;
|
|
61
|
+
currentScreenKey: string;
|
|
48
62
|
portalRuntime: BoundaryPortalRuntime;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
null,
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
const registerTargetRef = useCallback(
|
|
58
|
-
(
|
|
59
|
-
targetRef: AnimatedRef<View>,
|
|
60
|
-
preparedStyles: StyleProps,
|
|
61
|
-
measurementRef?: AnimatedRef<View>,
|
|
62
|
-
) => {
|
|
63
|
-
setTargetEntry((prev) => {
|
|
64
|
-
if (prev?.ref === targetRef) {
|
|
65
|
-
return prev;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (__DEV__ && prev !== null) {
|
|
69
|
-
logger.warnOnce(
|
|
70
|
-
"boundary:multiple-targets",
|
|
71
|
-
MULTIPLE_TARGETS_WARNING,
|
|
72
|
-
);
|
|
73
|
-
}
|
|
63
|
+
ref: AnimatedRef<View>;
|
|
64
|
+
rootEscapePlaceholderRef: AnimatedRef<View>;
|
|
65
|
+
shouldRenderBoundaryRootThroughPortal: boolean;
|
|
66
|
+
shouldRenderHandoffHost: boolean;
|
|
67
|
+
};
|
|
74
68
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
69
|
+
type BoundaryRootProviderProps = Pick<
|
|
70
|
+
BoundaryOwnProps,
|
|
71
|
+
"enabled" | "escapeClipping" | "group" | "handoff"
|
|
72
|
+
> & {
|
|
73
|
+
children: (state: BoundaryRootRenderState) => ReactNode;
|
|
74
|
+
config: BoundaryConfigProps;
|
|
75
|
+
forwardedRef?: ForwardedRef<any>;
|
|
76
|
+
id: BoundaryId;
|
|
77
|
+
style?: unknown;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const {
|
|
81
|
+
BoundaryRootProvider,
|
|
82
|
+
useBoundaryRootContext,
|
|
83
|
+
useBoundaryRootStore,
|
|
84
|
+
} = createProvider("BoundaryRoot", { guarded: false })<
|
|
85
|
+
BoundaryRootProviderProps,
|
|
86
|
+
BoundaryRootContextValue
|
|
87
|
+
>(
|
|
88
|
+
({
|
|
89
|
+
children,
|
|
90
|
+
config,
|
|
91
|
+
enabled = true,
|
|
92
|
+
escapeClipping,
|
|
93
|
+
forwardedRef,
|
|
94
|
+
group,
|
|
95
|
+
handoff,
|
|
96
|
+
id,
|
|
97
|
+
style,
|
|
98
|
+
}) => {
|
|
99
|
+
const boundTag = useMemo(
|
|
100
|
+
() => createBoundTag(String(id), group),
|
|
101
|
+
[id, group],
|
|
102
|
+
);
|
|
103
|
+
const portalRuntime = resolveBoundaryPortal({
|
|
104
|
+
handoff,
|
|
105
|
+
escapeClipping,
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const currentScreenKey = useDescriptorsStore(
|
|
109
|
+
(s) => s.derivations.currentScreenKey,
|
|
110
|
+
);
|
|
111
|
+
const hasConfiguredInterpolator = useDescriptorsStore(
|
|
112
|
+
(s) => s.derivations.hasConfiguredInterpolator,
|
|
113
|
+
);
|
|
114
|
+
const runtimeEnabled = enabled && hasConfiguredInterpolator;
|
|
115
|
+
// Associated slot styles attach whenever the boundary is enabled,
|
|
116
|
+
// independent of whether an interpolator is configured for this transition.
|
|
117
|
+
const shouldAttachAssociatedStyles = enabled;
|
|
118
|
+
const shouldEscapeBoundaryRootToScreenHost = portalRuntime.escapeClipping;
|
|
119
|
+
|
|
120
|
+
const associatedStyles = useComposedSlotStyles(boundTag.tag, style);
|
|
121
|
+
const associatedStackingStyles = useSlotStackingStyles(boundTag.tag);
|
|
122
|
+
const rootRef = useAnimatedRef<View>();
|
|
123
|
+
const rootEscapePlaceholderRef = useAnimatedRef<View>();
|
|
124
|
+
const [targetEntry, setTargetEntry] = useState<BoundaryTargetEntry | null>(
|
|
125
|
+
null,
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
const registerTargetRef = useCallback(
|
|
129
|
+
(
|
|
130
|
+
targetRef: AnimatedRef<View>,
|
|
131
|
+
preparedStyles: StyleProps,
|
|
132
|
+
measurementRef?: AnimatedRef<View>,
|
|
133
|
+
) => {
|
|
134
|
+
setTargetEntry((prev) => {
|
|
135
|
+
if (prev?.ref === targetRef) {
|
|
136
|
+
return prev;
|
|
80
137
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
138
|
+
|
|
139
|
+
if (__DEV__ && prev !== null) {
|
|
140
|
+
logger.warnOnce(
|
|
141
|
+
"boundary:multiple-targets",
|
|
142
|
+
MULTIPLE_TARGETS_WARNING,
|
|
143
|
+
);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
return (
|
|
147
|
+
prev ?? {
|
|
148
|
+
ref: targetRef,
|
|
149
|
+
measurementRef: measurementRef ?? targetRef,
|
|
150
|
+
preparedStyles,
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
[],
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
const unregisterTargetRef = useCallback((targetRef: AnimatedRef<View>) => {
|
|
159
|
+
setTargetEntry((prev) => (prev?.ref === targetRef ? null : prev));
|
|
160
|
+
}, []);
|
|
161
|
+
|
|
162
|
+
const rootMeasurementRef = shouldEscapeBoundaryRootToScreenHost
|
|
163
|
+
? rootEscapePlaceholderRef
|
|
164
|
+
: rootRef;
|
|
165
|
+
const measuredRef = targetEntry?.measurementRef ?? rootMeasurementRef;
|
|
166
|
+
const hasActiveTarget = targetEntry !== null;
|
|
167
|
+
const targetPreparedStyles = targetEntry?.preparedStyles;
|
|
168
|
+
|
|
169
|
+
useImperativeHandle(forwardedRef, () => rootRef.current as any, [rootRef]);
|
|
170
|
+
|
|
171
|
+
useBoundaryMeasurement({
|
|
103
172
|
boundTag,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
173
|
+
enabled,
|
|
174
|
+
runtimeEnabled,
|
|
175
|
+
currentScreenKey,
|
|
176
|
+
measuredRef,
|
|
177
|
+
style,
|
|
178
|
+
targetPreparedStyles,
|
|
179
|
+
handoff: portalRuntime.handoff,
|
|
180
|
+
escapeClipping: portalRuntime.escapeClipping,
|
|
181
|
+
config,
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
const shouldRenderBoundaryRootThroughPortal =
|
|
185
|
+
shouldEscapeBoundaryRootToScreenHost && !hasActiveTarget;
|
|
186
|
+
// A nested active target takes the full associated style, so the root keeps
|
|
187
|
+
// only its stacking context. Root-owned escape-clipping moves the root
|
|
188
|
+
// through a screen host, so its associated style is applied through the
|
|
189
|
+
// host instead of inline on the escaped element.
|
|
190
|
+
// Host-only handoff receivers still need the associated style: their
|
|
191
|
+
// handoff host is absolute-filled inside this root, so the root is the
|
|
192
|
+
// visual frame that animates the received payload.
|
|
193
|
+
const attachedStyle = shouldAttachAssociatedStyles
|
|
194
|
+
? hasActiveTarget
|
|
195
|
+
? associatedStackingStyles
|
|
196
|
+
: shouldRenderBoundaryRootThroughPortal
|
|
197
|
+
? undefined
|
|
198
|
+
: associatedStyles
|
|
199
|
+
: undefined;
|
|
200
|
+
|
|
201
|
+
const value = useMemo<BoundaryRootContextValue>(
|
|
202
|
+
() => ({
|
|
203
|
+
attachedStyle,
|
|
204
|
+
activeTargetRef: targetEntry?.ref ?? null,
|
|
205
|
+
boundTag,
|
|
206
|
+
currentScreenKey,
|
|
207
|
+
portalRuntime,
|
|
208
|
+
registerTargetRef,
|
|
209
|
+
ref: rootRef,
|
|
210
|
+
rootEscapePlaceholderRef,
|
|
211
|
+
shouldRenderBoundaryRootThroughPortal,
|
|
212
|
+
shouldRenderHandoffHost: enabled && portalRuntime.handoff,
|
|
213
|
+
unregisterTargetRef,
|
|
214
|
+
}),
|
|
215
|
+
[
|
|
216
|
+
attachedStyle,
|
|
217
|
+
boundTag,
|
|
218
|
+
currentScreenKey,
|
|
219
|
+
enabled,
|
|
220
|
+
portalRuntime,
|
|
221
|
+
registerTargetRef,
|
|
222
|
+
rootRef,
|
|
223
|
+
rootEscapePlaceholderRef,
|
|
224
|
+
shouldRenderBoundaryRootThroughPortal,
|
|
225
|
+
targetEntry,
|
|
226
|
+
unregisterTargetRef,
|
|
227
|
+
],
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
return {
|
|
231
|
+
value,
|
|
232
|
+
children: children(value),
|
|
233
|
+
};
|
|
234
|
+
},
|
|
235
|
+
);
|
|
@@ -7,14 +7,27 @@ import type {
|
|
|
7
7
|
ScreenPairKey,
|
|
8
8
|
} from "../../../stores/bounds/types";
|
|
9
9
|
|
|
10
|
-
export
|
|
10
|
+
export type InitialDestinationMeasurementAction =
|
|
11
|
+
| "wait"
|
|
12
|
+
| "release"
|
|
13
|
+
| "measure"
|
|
14
|
+
| "complete";
|
|
15
|
+
|
|
16
|
+
export type InitialDestinationMeasurementSignal = {
|
|
17
|
+
pairKey: ScreenPairKey;
|
|
18
|
+
action: InitialDestinationMeasurementAction;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const getInitialDestinationMeasurementSignal = (params: {
|
|
11
22
|
enabled: boolean;
|
|
12
23
|
destinationPairKey?: ScreenPairKey;
|
|
13
24
|
ancestorDestinationPairKey?: ScreenPairKey;
|
|
14
25
|
linkId: string;
|
|
15
26
|
group?: string;
|
|
27
|
+
destinationPresent: boolean;
|
|
28
|
+
sourcePresent: boolean;
|
|
16
29
|
linkState?: LinkPairsState;
|
|
17
|
-
}):
|
|
30
|
+
}): InitialDestinationMeasurementSignal | null => {
|
|
18
31
|
"worklet";
|
|
19
32
|
const {
|
|
20
33
|
enabled,
|
|
@@ -22,30 +35,41 @@ export const getInitialDestinationMeasurePairKey = (params: {
|
|
|
22
35
|
ancestorDestinationPairKey,
|
|
23
36
|
linkId,
|
|
24
37
|
group,
|
|
38
|
+
destinationPresent,
|
|
39
|
+
sourcePresent,
|
|
25
40
|
linkState,
|
|
26
41
|
} = params;
|
|
27
|
-
const
|
|
42
|
+
const pairKey = destinationPairKey ?? ancestorDestinationPairKey;
|
|
28
43
|
|
|
29
|
-
if (!enabled || !
|
|
44
|
+
if (!enabled || !pairKey) {
|
|
30
45
|
return null;
|
|
31
46
|
}
|
|
32
47
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
48
|
+
if (!destinationPresent) {
|
|
49
|
+
return { pairKey, action: "wait" };
|
|
50
|
+
}
|
|
36
51
|
|
|
37
|
-
if (
|
|
38
|
-
return
|
|
52
|
+
if (!sourcePresent) {
|
|
53
|
+
return { pairKey, action: "release" };
|
|
39
54
|
}
|
|
40
55
|
|
|
56
|
+
const linkKey = getLinkKeyFromTag(linkId);
|
|
41
57
|
const activeGroupId =
|
|
42
|
-
group && linkState
|
|
43
|
-
? getActiveGroupId(linkState, measurePairKey, group)
|
|
44
|
-
: null;
|
|
58
|
+
group && linkState ? getActiveGroupId(linkState, pairKey, group) : null;
|
|
45
59
|
|
|
46
60
|
if (activeGroupId && activeGroupId !== linkKey) {
|
|
47
|
-
return
|
|
61
|
+
return { pairKey, action: "release" };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
const link = linkState?.[pairKey]?.links?.[linkKey];
|
|
65
|
+
|
|
66
|
+
if (!link?.destination) {
|
|
67
|
+
return { pairKey, action: "measure" };
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (!link.source) {
|
|
71
|
+
return { pairKey, action: "wait" };
|
|
48
72
|
}
|
|
49
73
|
|
|
50
|
-
return
|
|
74
|
+
return { pairKey, action: "complete" };
|
|
51
75
|
};
|
|
@@ -96,6 +96,54 @@ export const isMeasurementInViewport = (
|
|
|
96
96
|
);
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
+
export const normalizeMeasuredBoundsWithVisibilityGate = ({
|
|
100
|
+
measured,
|
|
101
|
+
origin,
|
|
102
|
+
visibilityBlocked,
|
|
103
|
+
visibilityBlockOffset,
|
|
104
|
+
viewportWidth,
|
|
105
|
+
viewportHeight,
|
|
106
|
+
}: {
|
|
107
|
+
measured: MeasuredDimensions;
|
|
108
|
+
origin: MeasuredDimensions;
|
|
109
|
+
visibilityBlocked: boolean;
|
|
110
|
+
visibilityBlockOffset: number;
|
|
111
|
+
viewportWidth: number;
|
|
112
|
+
viewportHeight: number;
|
|
113
|
+
}): MeasuredDimensions => {
|
|
114
|
+
"worklet";
|
|
115
|
+
const normalized = normalizeMeasuredBoundsToOrigin(measured, origin);
|
|
116
|
+
|
|
117
|
+
if (
|
|
118
|
+
!visibilityBlocked ||
|
|
119
|
+
visibilityBlockOffset <= 0 ||
|
|
120
|
+
isMeasurementInViewport(normalized, viewportWidth, viewportHeight)
|
|
121
|
+
) {
|
|
122
|
+
return normalized;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Fabric can expose the visibility transform to one native measurement one
|
|
126
|
+
// frame before the other. Prefer normal origin-relative coordinates, then
|
|
127
|
+
// test either side of that known frame skew while the gate is active.
|
|
128
|
+
const measuredAhead = {
|
|
129
|
+
...normalized,
|
|
130
|
+
pageY: normalized.pageY - visibilityBlockOffset,
|
|
131
|
+
};
|
|
132
|
+
if (isMeasurementInViewport(measuredAhead, viewportWidth, viewportHeight)) {
|
|
133
|
+
return measuredAhead;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const originAhead = {
|
|
137
|
+
...normalized,
|
|
138
|
+
pageY: normalized.pageY + visibilityBlockOffset,
|
|
139
|
+
};
|
|
140
|
+
if (isMeasurementInViewport(originAhead, viewportWidth, viewportHeight)) {
|
|
141
|
+
return originAhead;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
return normalized;
|
|
145
|
+
};
|
|
146
|
+
|
|
99
147
|
export const measureWithOverscrollAwareness = (
|
|
100
148
|
ref: AnimatedRef<View>,
|
|
101
149
|
scrollState: ScrollGestureState | null,
|
|
@@ -8,7 +8,7 @@ import { useGestureContext } from "../../../providers/screen/gestures";
|
|
|
8
8
|
import { OriginProvider } from "../../../providers/screen/origin.provider";
|
|
9
9
|
import { useSlotProps, useSlotStyles } from "../../../providers/screen/styles";
|
|
10
10
|
import type { ScreenContentComponentProps } from "../../../types";
|
|
11
|
-
import { ScreenFallbackHost } from "../../boundary/portal/components/host";
|
|
11
|
+
import { ScreenFallbackHost } from "../../boundary/portal/components/boundary-portal/components/host";
|
|
12
12
|
import { useContentLayout } from "../hooks/use-content-layout";
|
|
13
13
|
import { MaybeMaskedNavigationContainer } from "./maybe-masked-navigation-container";
|
|
14
14
|
import { usesLayerRenderProps } from "./render-component";
|
|
@@ -434,7 +434,7 @@ export const SharedAppleMusic = ({
|
|
|
434
434
|
const dragXScale = interpolate(normX, [0, 1], xScaleOuput);
|
|
435
435
|
const dragYScale = interpolate(normY, [0, 1], yScaleOuput);
|
|
436
436
|
|
|
437
|
-
const boundValues = bounds({ id: sharedBoundTag }).
|
|
437
|
+
const boundValues = bounds({ id: sharedBoundTag }).values({
|
|
438
438
|
method: focused ? "content" : "transform",
|
|
439
439
|
anchor: "top",
|
|
440
440
|
scaleMode: "uniform",
|
|
@@ -453,7 +453,7 @@ export const SharedAppleMusic = ({
|
|
|
453
453
|
* ===============================
|
|
454
454
|
*/
|
|
455
455
|
if (focused) {
|
|
456
|
-
const maskedValues = bounds({ id: sharedBoundTag }).
|
|
456
|
+
const maskedValues = bounds({ id: sharedBoundTag }).values({
|
|
457
457
|
space: "absolute",
|
|
458
458
|
method: "size",
|
|
459
459
|
target: "fullscreen",
|
package/src/shared/index.ts
CHANGED
|
@@ -30,6 +30,10 @@ export default {
|
|
|
30
30
|
export type { NativeStackAdapterOptions } from "./adapters/with-screen-transitions";
|
|
31
31
|
export { withScreenTransitions } from "./adapters/with-screen-transitions";
|
|
32
32
|
export { snapTo } from "./animation/snap-to";
|
|
33
|
+
export {
|
|
34
|
+
blockTransition,
|
|
35
|
+
unblockTransition,
|
|
36
|
+
} from "./animation/transition-blocking";
|
|
33
37
|
export {
|
|
34
38
|
NAVIGATION_MASK_CONTAINER_STYLE_ID,
|
|
35
39
|
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import type { SharedValue } from "react-native-reanimated";
|
|
1
2
|
import type {
|
|
2
3
|
ScreenAnimationDescendantSources,
|
|
3
4
|
ScreenAnimationSource,
|
|
4
5
|
ScreenInterpolatorPropsRevision,
|
|
5
6
|
} from "../types";
|
|
6
7
|
|
|
8
|
+
type ScreenInterpolatorExternalDeps = Pick<SharedValue<unknown>, "get">[];
|
|
9
|
+
|
|
7
10
|
export const readScreenAnimationRevisions = (
|
|
8
11
|
screenInterpolatorPropsRevision: ScreenInterpolatorPropsRevision,
|
|
9
12
|
ancestorScreenAnimationSources: ScreenAnimationSource[],
|
|
10
13
|
descendantScreenAnimationSources: ScreenAnimationDescendantSources,
|
|
14
|
+
screenInterpolatorExternalDeps?: ScreenInterpolatorExternalDeps,
|
|
11
15
|
) => {
|
|
12
16
|
"worklet";
|
|
13
17
|
screenInterpolatorPropsRevision.get();
|
|
@@ -22,4 +26,14 @@ export const readScreenAnimationRevisions = (
|
|
|
22
26
|
for (let index = 0; index < descendantSources.length; index++) {
|
|
23
27
|
descendantSources[index]?.source.screenInterpolatorPropsRevision.get();
|
|
24
28
|
}
|
|
29
|
+
|
|
30
|
+
if (screenInterpolatorExternalDeps) {
|
|
31
|
+
for (
|
|
32
|
+
let index = 0;
|
|
33
|
+
index < screenInterpolatorExternalDeps.length;
|
|
34
|
+
index++
|
|
35
|
+
) {
|
|
36
|
+
screenInterpolatorExternalDeps[index]?.get();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
25
39
|
};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { ScreenStyleInterpolator } from "../../../../types/animation.types";
|
|
3
|
+
|
|
4
|
+
type WorkletClosure = Record<string, unknown>;
|
|
5
|
+
|
|
6
|
+
type ClosureCarrier = {
|
|
7
|
+
__closure?: WorkletClosure;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
type SharedValueLike = SharedValue<unknown> & {
|
|
11
|
+
_isReanimatedSharedValue: true;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
const isSharedValueLike = (value: unknown): value is SharedValueLike =>
|
|
15
|
+
(value as Partial<SharedValueLike> | null)?._isReanimatedSharedValue === true;
|
|
16
|
+
|
|
17
|
+
const getWorkletClosure = (value: unknown): WorkletClosure | undefined => {
|
|
18
|
+
if (
|
|
19
|
+
value === null ||
|
|
20
|
+
(typeof value !== "object" && typeof value !== "function")
|
|
21
|
+
) {
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const closure = (value as Partial<ClosureCarrier>).__closure;
|
|
26
|
+
return closure && typeof closure === "object" ? closure : undefined;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const isPlainObject = (value: unknown): value is Record<string, unknown> =>
|
|
30
|
+
value !== null &&
|
|
31
|
+
typeof value === "object" &&
|
|
32
|
+
Object.getPrototypeOf(value) === Object.prototype;
|
|
33
|
+
|
|
34
|
+
export const collectInterpolatorSharedValues = (
|
|
35
|
+
interpolators: Array<ScreenStyleInterpolator | undefined>,
|
|
36
|
+
): SharedValue<unknown>[] => {
|
|
37
|
+
const sharedValues: SharedValue<unknown>[] = [];
|
|
38
|
+
const seen = new Set<unknown>();
|
|
39
|
+
|
|
40
|
+
const visit = (value: unknown) => {
|
|
41
|
+
if (value === null || value === undefined || seen.has(value)) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
seen.add(value);
|
|
45
|
+
|
|
46
|
+
if (isSharedValueLike(value)) {
|
|
47
|
+
sharedValues.push(value);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (typeof value === "function") {
|
|
52
|
+
visit(getWorkletClosure(value));
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (Array.isArray(value)) {
|
|
57
|
+
for (let index = 0; index < value.length; index++) {
|
|
58
|
+
visit(value[index]);
|
|
59
|
+
}
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (isPlainObject(value)) {
|
|
64
|
+
for (const item of Object.values(value)) {
|
|
65
|
+
visit(item);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
for (let index = 0; index < interpolators.length; index++) {
|
|
71
|
+
visit(getWorkletClosure(interpolators[index]));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return sharedValues;
|
|
75
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
1
2
|
import { useDerivedValue, useSharedValue } from "react-native-reanimated";
|
|
2
3
|
import { NO_STYLES } from "../../../../constants";
|
|
3
4
|
import { AnimationStore } from "../../../../stores/animation.store";
|
|
@@ -22,6 +23,7 @@ import {
|
|
|
22
23
|
syncScreenOptionsOverrides,
|
|
23
24
|
useScreenOptionsContext,
|
|
24
25
|
} from "../../options";
|
|
26
|
+
import { collectInterpolatorSharedValues } from "../helpers/collect-interpolator-shared-values";
|
|
25
27
|
import { normalizeSlots } from "../helpers/normalize-slots";
|
|
26
28
|
import { isOpeningBeforeStart } from "../helpers/opening-phase";
|
|
27
29
|
import type { LocalStyleLayers } from "../helpers/resolve-slot-styles";
|
|
@@ -146,6 +148,14 @@ export const useInterpolatedStylesMap = () => {
|
|
|
146
148
|
const transition = useBuildTransitionAccessor();
|
|
147
149
|
const nextInterpolatorReady = useSharedValue(0);
|
|
148
150
|
|
|
151
|
+
// In some cases, a user may want to use external shared values to drive animations in the interpoaltor.
|
|
152
|
+
// We can now support this by collecting those shared values and reading them here to trigger an update.
|
|
153
|
+
const interpolatorSharedValues = useMemo(
|
|
154
|
+
() =>
|
|
155
|
+
collectInterpolatorSharedValues([currentInterpolator, nextInterpolator]),
|
|
156
|
+
[currentInterpolator, nextInterpolator],
|
|
157
|
+
);
|
|
158
|
+
|
|
149
159
|
const activeScreenKey = nextScreenKey ?? currentScreenKey;
|
|
150
160
|
const {
|
|
151
161
|
entering: activeEntering,
|
|
@@ -162,6 +172,7 @@ export const useInterpolatedStylesMap = () => {
|
|
|
162
172
|
screenInterpolatorPropsRevision,
|
|
163
173
|
ancestorScreenAnimationSources,
|
|
164
174
|
descendantScreenAnimationSources,
|
|
175
|
+
interpolatorSharedValues,
|
|
165
176
|
);
|
|
166
177
|
const props = screenInterpolatorProps.get();
|
|
167
178
|
|
|
@@ -34,6 +34,7 @@ export type ScreenSlotContextValue = {
|
|
|
34
34
|
localStylesMaps: SharedValue<LocalStyleLayers>;
|
|
35
35
|
nextInterpolatorReady: SharedValue<number>;
|
|
36
36
|
slotsMap: SharedValue<NormalizedTransitionInterpolatedStyle>;
|
|
37
|
+
visibilityBlocked: SharedValue<boolean>;
|
|
37
38
|
};
|
|
38
39
|
|
|
39
40
|
export const {
|
|
@@ -54,15 +55,16 @@ export const {
|
|
|
54
55
|
localStylesMaps,
|
|
55
56
|
ancestorStylesMap: parentContext?.slotsMap,
|
|
56
57
|
});
|
|
57
|
-
const { animatedStyle, animatedProps } =
|
|
58
|
+
const { animatedStyle, animatedProps, shouldBlockVisibility } =
|
|
58
59
|
useMaybeBlockVisibility(isFloatingOverlay);
|
|
59
60
|
const value = useMemo(
|
|
60
61
|
() => ({
|
|
61
62
|
localStylesMaps,
|
|
62
63
|
nextInterpolatorReady,
|
|
63
64
|
slotsMap,
|
|
65
|
+
visibilityBlocked: shouldBlockVisibility,
|
|
64
66
|
}),
|
|
65
|
-
[localStylesMaps, nextInterpolatorReady, slotsMap],
|
|
67
|
+
[localStylesMaps, nextInterpolatorReady, shouldBlockVisibility, slotsMap],
|
|
66
68
|
);
|
|
67
69
|
|
|
68
70
|
useLayoutEffect(() => {
|
|
@@ -33,7 +33,8 @@ export const registerScreenSlots = (
|
|
|
33
33
|
if (
|
|
34
34
|
previous?.localStylesMaps === slots.localStylesMaps &&
|
|
35
35
|
previous.nextInterpolatorReady === slots.nextInterpolatorReady &&
|
|
36
|
-
previous.slotsMap === slots.slotsMap
|
|
36
|
+
previous.slotsMap === slots.slotsMap &&
|
|
37
|
+
previous.visibilityBlocked === slots.visibilityBlocked
|
|
37
38
|
) {
|
|
38
39
|
return;
|
|
39
40
|
}
|