react-native-screen-transitions 3.9.0-beta.1 → 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/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/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/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/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,7 +1,7 @@
|
|
|
1
1
|
import type { MeasuredDimensions } from "react-native-reanimated";
|
|
2
2
|
import { NAVIGATION_MASK_CONTAINER_STYLE_ID, NAVIGATION_MASK_ELEMENT_STYLE_ID } from "../constants";
|
|
3
3
|
import type { BoundsLink } from "../stores/bounds/types";
|
|
4
|
-
import type { BoundsComputeOptions, BoundsIdentityInput,
|
|
4
|
+
import type { BoundsComputeOptions, BoundsIdentityInput, BoundsMotion, BoundsMotionFrame, BoundsMotionTransform, BoundsStyleResult, BoundsValuesResult } from "../utils/bounds/types/options";
|
|
5
5
|
import type { ScreenInterpolationProps, TransitionInterpolatedStyle, TransitionSlotStyle } from "./animation.types";
|
|
6
6
|
import type { GestureProgressMode } from "./gesture.types";
|
|
7
7
|
export type { BoundsLink, BoundsLinkStatus } from "../stores/bounds/types";
|
|
@@ -255,7 +255,12 @@ type BoundsBoundNavigationAccessor = {
|
|
|
255
255
|
};
|
|
256
256
|
export type BoundsScopedAccessor = BoundsBoundNavigationAccessor & {
|
|
257
257
|
styles: (options?: BoundsComputeOptions) => BoundsStyleResult;
|
|
258
|
-
|
|
258
|
+
/** Returns numeric bounds values for custom style composition. */
|
|
259
|
+
values: <T extends BoundsComputeOptions = BoundsComputeOptions>(options?: T) => BoundsValuesResult<T>;
|
|
260
|
+
/**
|
|
261
|
+
* @deprecated Use {@linkcode values}.
|
|
262
|
+
*/
|
|
263
|
+
math: <T extends BoundsComputeOptions = BoundsComputeOptions>(options?: T) => BoundsValuesResult<T>;
|
|
259
264
|
link: (id?: BoundsIdentityInput) => BoundsLink | null;
|
|
260
265
|
};
|
|
261
266
|
export type BoundsAccessor = (options: BoundsIdentityInput) => BoundsScopedAccessor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bounds.types.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/bounds.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EACN,kCAAkC,EAClC,gCAAgC,EAChC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EACX,oBAAoB,EACpB,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"bounds.types.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/bounds.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EACN,kCAAkC,EAClC,gCAAgC,EAChC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EACX,oBAAoB,EACpB,mBAAmB,EACnB,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,kBAAkB,EACl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W,GAAG,MAAM,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,yBAAyB,CAAC;AAEpE,MAAM,MAAM,wBAAwB,GAAG;IACtC,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,2BAA2B,KAAK,yBAAyB,CAAC;IAC3E,MAAM,EAAE,CACP,OAAO,CAAC,EAAE,6BAA6B,KACnC,2BAA2B,CAAC;CACjC,CAAC;AAEF,KAAK,6BAA6B,GAAG;IACpC,UAAU,EAAE,wBAAwB,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,6BAA6B,GAAG;IAClE,MAAM,EAAE,CAAC,OAAO,CAAC,EAAE,oBAAoB,KAAK,iBAAiB,CAAC;IAC9D,kEAAkE;IAClE,MAAM,EAAE,CAAC,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,EAC7D,OAAO,CAAC,EAAE,CAAC,KACP,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC3B;;OAEG;IACH,IAAI,EAAE,CAAC,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,EAC3D,OAAO,CAAC,EAAE,CAAC,KACP,kBAAkB,CAAC,CAAC,CAAC,CAAC;IAC3B,IAAI,EAAE,CAAC,EAAE,CAAC,EAAE,mBAAmB,KAAK,UAAU,GAAG,IAAI,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,CAC5B,OAAO,EAAE,mBAAmB,KACxB,oBAAoB,CAAC;AAE1B,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAC1C,wBAAwB,EACxB,QAAQ,GAAG,YAAY,CACvB,CAAC;AAEF,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-bounds-accessor-core.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,cAAc,EACd,wBAAwB,EACxB,oBAAoB,EACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAEX,cAAc,EAId,MAAM,kBAAkB,CAAC;AAK1B,KAAK,wBAAwB,GAAG;IAC/B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,wBAAwB,CAAC;IAChC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CACxB,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACrC,QAAQ,EAAE,MAAM,wBAAwB,CAAC;IACzC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,CAAC;CAC1D,CAAC;
|
|
1
|
+
{"version":3,"file":"create-bounds-accessor-core.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,cAAc,EACd,wBAAwB,EACxB,oBAAoB,EACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAEX,cAAc,EAId,MAAM,kBAAkB,CAAC;AAK1B,KAAK,wBAAwB,GAAG;IAC/B,MAAM,EAAE,oBAAoB,CAAC;IAC7B,QAAQ,EAAE,cAAc,CAAC;IACzB,KAAK,EAAE,wBAAwB,CAAC;IAChC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC;CACxB,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACrC,QAAQ,EAAE,MAAM,wBAAwB,CAAC;IACzC,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,wBAAwB,KAAK,IAAI,CAAC;CAC1D,CAAC;AAkFF,eAAO,MAAM,wBAAwB,GACpC,QAAQ,8BAA8B,KACpC,cAMF,CAAC"}
|
|
@@ -193,7 +193,7 @@ export type BoundsOptions = {
|
|
|
193
193
|
/**
|
|
194
194
|
* If true, the raw values will be returned instead of the computed values.
|
|
195
195
|
*
|
|
196
|
-
* @deprecated Use `bounds(id).
|
|
196
|
+
* @deprecated Use `bounds(id).values(options)` instead of passing `raw`.
|
|
197
197
|
* @default false
|
|
198
198
|
*/
|
|
199
199
|
raw?: boolean;
|
|
@@ -205,9 +205,13 @@ export type BoundsIdentity = {
|
|
|
205
205
|
export type BoundsIdentityInput = BoundId | BoundsIdentity;
|
|
206
206
|
export type BoundsComputeOptions = Omit<BoundsOptions, "group" | "id" | "raw">;
|
|
207
207
|
export type BoundsStyleResult = StyleProps;
|
|
208
|
-
export type
|
|
208
|
+
export type BoundsValuesResult<T extends BoundsComputeOptions = BoundsComputeOptions> = BoundsOptionsResult<T & {
|
|
209
209
|
id: BoundId;
|
|
210
210
|
raw: true;
|
|
211
211
|
}>;
|
|
212
|
+
/**
|
|
213
|
+
* @deprecated Use {@linkcode BoundsValuesResult}.
|
|
214
|
+
*/
|
|
215
|
+
export type BoundsMathResult<T extends BoundsComputeOptions = BoundsComputeOptions> = BoundsValuesResult<T>;
|
|
212
216
|
export {};
|
|
213
217
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/types/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,KAAK,EACX,wBAAwB,EACxB,YAAY,EACZ,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAE1D,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtC,MAAM,MAAM,YAAY,GACrB,YAAY,GACZ,KAAK,GACL,aAAa,GACb,SAAS,GACT,QAAQ,GACR,UAAU,GACV,eAAe,GACf,QAAQ,GACR,gBAAgB,CAAC;AAEpB,MAAM,MAA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AE,MAAM,CAAC;IAElB;;;;OAIG;IACH,QAAQ,CAAC,EAAE;QAAE,CAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAEtC;;;OAGG;IACH,SAAS,CAAC,EAAE,eAAe,CAAC;IAE5B;;;OAGG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB;;;;;OAKG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC5B,EAAE,EAAE,OAAO,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,cAAc,CAAC;AAE3D,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,IAAI,GAAG,KAAK,CAAC,CAAC;AAE/E,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAE3C,MAAM,MAAM,kBAAkB,CAC7B,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,IAClD,mBAAmB,CAAC,CAAC,GAAG;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,IAAI,CAAA;CAAE,CAAC,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAC3B,CAAC,SAAS,oBAAoB,GAAG,oBAAoB,IAClD,kBAAkB,CAAC,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -25,7 +25,6 @@ import type {
|
|
|
25
25
|
NavigatorLayoutArgs,
|
|
26
26
|
NavigatorWithScreenTransitions,
|
|
27
27
|
ScreenLayout,
|
|
28
|
-
ScreenLayoutArgs,
|
|
29
28
|
} from "./types";
|
|
30
29
|
|
|
31
30
|
export type { NativeStackAdapterOptions } from "./options";
|
|
@@ -41,7 +40,18 @@ type ScreenTransitionsNavigatorTypeBag<TBag extends NavigatorTypeBagBase> =
|
|
|
41
40
|
ScreenOptions: NativeStackAdapterOptions<TBag["ScreenOptions"]>;
|
|
42
41
|
};
|
|
43
42
|
|
|
44
|
-
function
|
|
43
|
+
export function createTransitionScreenLayout(
|
|
44
|
+
screenLayout?: ScreenLayout,
|
|
45
|
+
): ScreenLayout {
|
|
46
|
+
return (screenLayoutArgs) => (
|
|
47
|
+
<ScreenTransitionsScreenLayout
|
|
48
|
+
screenLayout={screenLayout}
|
|
49
|
+
screenLayoutArgs={screenLayoutArgs}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function adaptNavigatorChildren(children: ReactNode): ReactNode {
|
|
45
55
|
return Children.map(children, (child) => {
|
|
46
56
|
if (!isValidElement(child)) {
|
|
47
57
|
return child;
|
|
@@ -65,6 +75,22 @@ function adaptNavigatorChildren(children: ReactNode): ReactNode {
|
|
|
65
75
|
changed = true;
|
|
66
76
|
}
|
|
67
77
|
|
|
78
|
+
// Screen and group layouts replace the navigator default, so each override
|
|
79
|
+
// must carry the transition screen layout with it.
|
|
80
|
+
if (typeof props.layout === "function") {
|
|
81
|
+
nextProps.layout = createTransitionScreenLayout(
|
|
82
|
+
props.layout as ScreenLayout,
|
|
83
|
+
);
|
|
84
|
+
changed = true;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (typeof props.screenLayout === "function") {
|
|
88
|
+
nextProps.screenLayout = createTransitionScreenLayout(
|
|
89
|
+
props.screenLayout as ScreenLayout,
|
|
90
|
+
);
|
|
91
|
+
changed = true;
|
|
92
|
+
}
|
|
93
|
+
|
|
68
94
|
if (props.children !== undefined && typeof props.children !== "function") {
|
|
69
95
|
nextProps.children = adaptNavigatorChildren(props.children as ReactNode);
|
|
70
96
|
changed = true;
|
|
@@ -107,13 +133,8 @@ export function withScreenTransitions(
|
|
|
107
133
|
[layout],
|
|
108
134
|
);
|
|
109
135
|
|
|
110
|
-
const transitionScreenLayout =
|
|
111
|
-
(
|
|
112
|
-
<ScreenTransitionsScreenLayout
|
|
113
|
-
screenLayout={screenLayout}
|
|
114
|
-
screenLayoutArgs={screenLayoutArgs}
|
|
115
|
-
/>
|
|
116
|
-
),
|
|
136
|
+
const transitionScreenLayout = useMemo(
|
|
137
|
+
() => createTransitionScreenLayout(screenLayout),
|
|
117
138
|
[screenLayout],
|
|
118
139
|
);
|
|
119
140
|
const screenOptions = useMemo(
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { HistoryStore } from "../stores/history.store";
|
|
2
|
+
import { SystemStore } from "../stores/system.store";
|
|
3
|
+
import type { ScreenKey } from "../types/screen.types";
|
|
4
|
+
import { logger } from "../utils/logger";
|
|
5
|
+
|
|
6
|
+
const resolveTransitionRouteKey = (
|
|
7
|
+
routeKey: ScreenKey | undefined,
|
|
8
|
+
actionName: "blockTransition" | "unblockTransition",
|
|
9
|
+
): ScreenKey | undefined => {
|
|
10
|
+
if (routeKey !== undefined) {
|
|
11
|
+
if (routeKey.length === 0) {
|
|
12
|
+
logger.warn(`${actionName}: routeKey must not be empty`);
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return routeKey;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const entry = HistoryStore.getMostRecent();
|
|
20
|
+
if (!entry) {
|
|
21
|
+
logger.warn(`${actionName}: No screens in history`);
|
|
22
|
+
return undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return entry.descriptor.route.key;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Prevents a screen's pending lifecycle transition from starting.
|
|
30
|
+
*
|
|
31
|
+
* Calls are reference-counted. Every call must be paired with one
|
|
32
|
+
* {@linkcode unblockTransition} call for the same route. When `routeKey` is
|
|
33
|
+
* omitted, the most recently focused screen in navigation history is used.
|
|
34
|
+
*
|
|
35
|
+
* @param routeKey - Route key of the screen to block.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```tsx
|
|
39
|
+
* blockTransition(route.key);
|
|
40
|
+
* // Render or prepare the destination screen.
|
|
41
|
+
* unblockTransition(route.key);
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @see {@linkcode unblockTransition}
|
|
45
|
+
*/
|
|
46
|
+
export function blockTransition(routeKey?: ScreenKey): void {
|
|
47
|
+
const resolvedRouteKey = resolveTransitionRouteKey(
|
|
48
|
+
routeKey,
|
|
49
|
+
"blockTransition",
|
|
50
|
+
);
|
|
51
|
+
if (!resolvedRouteKey) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
SystemStore.getBag(resolvedRouteKey).actions.blockLifecycleStart();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Releases one lifecycle transition block for a screen.
|
|
60
|
+
*
|
|
61
|
+
* The pending transition can start when the screen's final block is released.
|
|
62
|
+
* Extra calls are safe and leave the block count at zero. When `routeKey` is
|
|
63
|
+
* omitted, the most recently focused screen in navigation history is used.
|
|
64
|
+
*
|
|
65
|
+
* @param routeKey - Route key of the screen to unblock.
|
|
66
|
+
*
|
|
67
|
+
* @see {@linkcode blockTransition}
|
|
68
|
+
*/
|
|
69
|
+
export function unblockTransition(routeKey?: ScreenKey): void {
|
|
70
|
+
const resolvedRouteKey = resolveTransitionRouteKey(
|
|
71
|
+
routeKey,
|
|
72
|
+
"unblockTransition",
|
|
73
|
+
);
|
|
74
|
+
if (!resolvedRouteKey) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
SystemStore.getBag(resolvedRouteKey).actions.unblockLifecycleStart();
|
|
79
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from "react";
|
|
2
|
-
import { memo,
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
3
|
import type { View } from "react-native";
|
|
4
4
|
import Animated, { useAnimatedRef } from "react-native-reanimated";
|
|
5
5
|
import {
|
|
@@ -7,79 +7,72 @@ import {
|
|
|
7
7
|
useSlotLayoutStyles,
|
|
8
8
|
} from "../../../providers/screen/styles";
|
|
9
9
|
import { prepareStyleForBounds } from "../../../utils/bounds/helpers/styles/styles";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
useBoundaryRootContext,
|
|
15
|
-
} from "../providers/boundary-root.provider";
|
|
10
|
+
import { useRegisterTarget } from "../hooks/use-register-target";
|
|
11
|
+
import { BoundaryContentPortal } from "../portal/components/boundary-content-portal";
|
|
12
|
+
import { BoundaryPortal } from "../portal/components/boundary-portal";
|
|
13
|
+
import { useBoundaryRootContext } from "../providers/boundary-root.provider";
|
|
16
14
|
|
|
17
15
|
type BoundaryTargetProps = React.ComponentProps<typeof Animated.View>;
|
|
18
16
|
|
|
19
17
|
export const BoundaryTarget = memo(function BoundaryTarget(
|
|
20
18
|
props: BoundaryTargetProps,
|
|
21
19
|
) {
|
|
22
|
-
const { style, ...rest } = props;
|
|
20
|
+
const { pointerEvents, style, ...rest } = props;
|
|
23
21
|
const targetAnimatedRef = useAnimatedRef<View>();
|
|
24
|
-
const
|
|
22
|
+
const targetEscapePlaceholderRef = useAnimatedRef<View>();
|
|
25
23
|
const rootContext = useBoundaryRootContext();
|
|
26
|
-
const
|
|
27
|
-
const unregisterTargetRef = rootContext?.unregisterTargetRef;
|
|
24
|
+
const boundaryId = rootContext?.boundTag.tag;
|
|
28
25
|
const isActiveTarget = rootContext?.activeTargetRef === targetAnimatedRef;
|
|
29
26
|
const portalRuntime = rootContext?.portalRuntime;
|
|
27
|
+
const portalPointerEvents =
|
|
28
|
+
typeof pointerEvents === "string" ? pointerEvents : undefined;
|
|
29
|
+
const shouldEscapeTargetToScreenHost =
|
|
30
|
+
portalRuntime?.escapeClipping === true && boundaryId !== undefined;
|
|
31
|
+
|
|
30
32
|
const shouldApplyAssociatedStyleInline =
|
|
31
33
|
isActiveTarget && portalRuntime?.enabled !== true;
|
|
32
34
|
const shouldApplyPortalLayoutStyle =
|
|
33
35
|
isActiveTarget && portalRuntime?.enabled === true;
|
|
36
|
+
|
|
34
37
|
const associatedTargetStyles = useComposedSlotStyles(
|
|
35
38
|
rootContext?.boundTag.tag,
|
|
36
39
|
style,
|
|
37
40
|
);
|
|
38
41
|
const portalLayoutStyle = useSlotLayoutStyles(rootContext?.boundTag.tag);
|
|
39
42
|
const preparedStyles = useMemo(() => prepareStyleForBounds(style), [style]);
|
|
40
|
-
// Teleported content can render outside its layout slot. The placeholder is
|
|
41
|
-
// the truthful measurement surface whenever runtime portal behavior is active.
|
|
42
|
-
const measurementRef = portalRuntime?.enabled
|
|
43
|
-
? placeholderAnimatedRef
|
|
44
|
-
: targetAnimatedRef;
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
logger.warn(TARGET_OUTSIDE_ROOT_WARNING);
|
|
50
|
-
}
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
44
|
+
const measurementRef = shouldEscapeTargetToScreenHost
|
|
45
|
+
? targetEscapePlaceholderRef
|
|
46
|
+
: targetAnimatedRef;
|
|
53
47
|
|
|
54
|
-
|
|
55
|
-
return () => {
|
|
56
|
-
unregisterTargetRef(targetAnimatedRef);
|
|
57
|
-
};
|
|
58
|
-
}, [
|
|
59
|
-
registerTargetRef,
|
|
60
|
-
unregisterTargetRef,
|
|
61
|
-
targetAnimatedRef,
|
|
62
|
-
preparedStyles,
|
|
63
|
-
measurementRef,
|
|
64
|
-
]);
|
|
48
|
+
useRegisterTarget({ preparedStyles, measurementRef, targetAnimatedRef });
|
|
65
49
|
|
|
66
50
|
return (
|
|
67
|
-
<
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
51
|
+
<BoundaryPortal
|
|
52
|
+
boundaryId={boundaryId ?? ""}
|
|
53
|
+
enabled={shouldEscapeTargetToScreenHost}
|
|
54
|
+
placeholderRef={targetEscapePlaceholderRef}
|
|
55
|
+
pointerEvents={portalPointerEvents}
|
|
72
56
|
>
|
|
73
|
-
<
|
|
74
|
-
{
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
57
|
+
<BoundaryContentPortal
|
|
58
|
+
boundaryId={boundaryId}
|
|
59
|
+
enabled={portalRuntime?.handoff === true}
|
|
60
|
+
pointerEvents={portalPointerEvents}
|
|
61
|
+
>
|
|
62
|
+
<Animated.View
|
|
63
|
+
{...rest}
|
|
64
|
+
pointerEvents={pointerEvents}
|
|
65
|
+
ref={targetAnimatedRef}
|
|
66
|
+
style={[
|
|
67
|
+
style,
|
|
68
|
+
shouldApplyAssociatedStyleInline
|
|
69
|
+
? associatedTargetStyles
|
|
70
|
+
: undefined,
|
|
71
|
+
shouldApplyPortalLayoutStyle ? portalLayoutStyle : undefined,
|
|
72
|
+
]}
|
|
73
|
+
collapsable={false}
|
|
74
|
+
/>
|
|
75
|
+
</BoundaryContentPortal>
|
|
76
|
+
</BoundaryPortal>
|
|
84
77
|
);
|
|
85
78
|
});
|
|
@@ -1,49 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
useImperativeHandle,
|
|
7
|
-
useMemo,
|
|
8
|
-
} from "react";
|
|
9
|
-
import type { View } from "react-native";
|
|
10
|
-
import Animated, { useAnimatedRef } from "react-native-reanimated";
|
|
11
|
-
import { useDescriptorsStore } from "../../providers/screen/descriptors";
|
|
12
|
-
import {
|
|
13
|
-
useComposedSlotStyles,
|
|
14
|
-
useSlotStackingStyles,
|
|
15
|
-
} from "../../providers/screen/styles";
|
|
16
|
-
import { createBoundTag } from "../../stores/bounds/helpers/link-pairs.helpers";
|
|
17
|
-
import { useBoundaryMeasurement } from "./hooks/use-boundary-measurement";
|
|
18
|
-
import { BoundaryLocalPortalHost } from "./portal/components/boundary-local-portal-host";
|
|
19
|
-
import { Portal } from "./portal/components/portal";
|
|
20
|
-
import { resolveBoundaryPortal } from "./portal/utils/resolve-portal";
|
|
21
|
-
import {
|
|
22
|
-
BoundaryRootProvider,
|
|
23
|
-
useBoundaryRootState,
|
|
24
|
-
} from "./providers/boundary-root.provider";
|
|
1
|
+
import { type ComponentType, forwardRef, memo } from "react";
|
|
2
|
+
import Animated from "react-native-reanimated";
|
|
3
|
+
import { BoundaryContentPortalHost } from "./portal/components/boundary-content-portal";
|
|
4
|
+
import { BoundaryPortal } from "./portal/components/boundary-portal";
|
|
5
|
+
import { BoundaryRootProvider } from "./providers/boundary-root.provider";
|
|
25
6
|
import type { BoundaryComponentProps } from "./types";
|
|
26
7
|
|
|
27
8
|
interface CreateBoundaryComponentOptions {
|
|
28
9
|
alreadyAnimated?: boolean;
|
|
29
10
|
}
|
|
30
11
|
|
|
31
|
-
const hasRenderableChildren = (children: ReactNode): boolean => {
|
|
32
|
-
if (
|
|
33
|
-
children === null ||
|
|
34
|
-
children === undefined ||
|
|
35
|
-
typeof children === "boolean"
|
|
36
|
-
) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (Array.isArray(children)) {
|
|
41
|
-
return children.some(hasRenderableChildren);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return true;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
12
|
export function createBoundaryComponent<P extends object>(
|
|
48
13
|
Wrapped: ComponentType<P>,
|
|
49
14
|
options: CreateBoundaryComponentOptions = {},
|
|
@@ -66,124 +31,44 @@ export function createBoundaryComponent<P extends object>(
|
|
|
66
31
|
target,
|
|
67
32
|
method,
|
|
68
33
|
style,
|
|
69
|
-
onPress,
|
|
70
34
|
handoff,
|
|
71
35
|
escapeClipping,
|
|
72
36
|
children,
|
|
73
37
|
...rest
|
|
74
38
|
} = props as any;
|
|
75
39
|
|
|
76
|
-
const boundTag = useMemo(
|
|
77
|
-
() => createBoundTag(String(id), group),
|
|
78
|
-
[id, group],
|
|
79
|
-
);
|
|
80
|
-
const portalRuntime = resolveBoundaryPortal({
|
|
81
|
-
handoff,
|
|
82
|
-
escapeClipping,
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
const currentScreenKey = useDescriptorsStore(
|
|
86
|
-
(s) => s.derivations.currentScreenKey,
|
|
87
|
-
);
|
|
88
|
-
const hasConfiguredInterpolator = useDescriptorsStore(
|
|
89
|
-
(s) => s.derivations.hasConfiguredInterpolator,
|
|
90
|
-
);
|
|
91
|
-
const runtimeEnabled = enabled && hasConfiguredInterpolator;
|
|
92
|
-
// Associated slot styles attach whenever the boundary is enabled,
|
|
93
|
-
// independent of whether an interpolator is configured for this transition.
|
|
94
|
-
const shouldAttachAssociatedStyles = enabled;
|
|
95
|
-
const canPortalRoot =
|
|
96
|
-
portalRuntime.enabled && hasRenderableChildren(children);
|
|
97
|
-
|
|
98
|
-
const associatedStyles = useComposedSlotStyles(boundTag.tag, style);
|
|
99
|
-
const associatedStackingStyles = useSlotStackingStyles(boundTag.tag);
|
|
100
|
-
const rootPlaceholderRef = useAnimatedRef<View>();
|
|
101
|
-
|
|
102
|
-
const {
|
|
103
|
-
ref,
|
|
104
|
-
contextValue,
|
|
105
|
-
measuredRef,
|
|
106
|
-
hasActiveTarget,
|
|
107
|
-
targetPreparedStyles,
|
|
108
|
-
} = useBoundaryRootState({
|
|
109
|
-
boundTag,
|
|
110
|
-
portalRuntime,
|
|
111
|
-
rootMeasurementRef: canPortalRoot ? rootPlaceholderRef : undefined,
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
useBoundaryMeasurement({
|
|
115
|
-
boundTag,
|
|
116
|
-
enabled,
|
|
117
|
-
runtimeEnabled,
|
|
118
|
-
currentScreenKey,
|
|
119
|
-
measuredRef,
|
|
120
|
-
style,
|
|
121
|
-
targetPreparedStyles,
|
|
122
|
-
handoff: portalRuntime.handoff,
|
|
123
|
-
escapeClipping: portalRuntime.escapeClipping,
|
|
124
|
-
config: { anchor, scaleMode, target, method },
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
useImperativeHandle(forwardedRef, () => ref.current as any, [ref]);
|
|
128
|
-
|
|
129
|
-
const shouldPortalRoot = canPortalRoot && !hasActiveTarget;
|
|
130
|
-
// A nested active target takes the full associated style, so the root keeps
|
|
131
|
-
// only its stacking context. Without a nested target, a portal'd root is the
|
|
132
|
-
// target, so its associated style is applied through the portal host instead
|
|
133
|
-
// of inline on the teleported element.
|
|
134
|
-
// Host-only handoff receivers still need the associated style: their local
|
|
135
|
-
// portal host is absolute-filled inside this root, so the root is the visual
|
|
136
|
-
// frame that animates the received payload.
|
|
137
|
-
const attachedStyle = shouldAttachAssociatedStyles
|
|
138
|
-
? hasActiveTarget
|
|
139
|
-
? associatedStackingStyles
|
|
140
|
-
: shouldPortalRoot
|
|
141
|
-
? undefined
|
|
142
|
-
: associatedStyles
|
|
143
|
-
: undefined;
|
|
144
|
-
const pressProps = typeof onPress === "function" ? { onPress } : undefined;
|
|
145
|
-
|
|
146
|
-
const localPortalHost = (
|
|
147
|
-
<BoundaryLocalPortalHost
|
|
148
|
-
boundaryId={boundTag.tag}
|
|
149
|
-
enabled={enabled && portalRuntime.handoff}
|
|
150
|
-
screenKey={currentScreenKey}
|
|
151
|
-
/>
|
|
152
|
-
);
|
|
153
|
-
const canInjectLocalPortalHost = typeof children !== "function";
|
|
154
|
-
|
|
155
|
-
const renderBoundaryRoot = (extraChildren?: ReactNode) => (
|
|
156
|
-
<AnimatedComponent
|
|
157
|
-
{...rest}
|
|
158
|
-
{...pressProps}
|
|
159
|
-
ref={ref}
|
|
160
|
-
style={[style, attachedStyle]}
|
|
161
|
-
collapsable={false}
|
|
162
|
-
>
|
|
163
|
-
{children}
|
|
164
|
-
{canInjectLocalPortalHost ? extraChildren : null}
|
|
165
|
-
</AnimatedComponent>
|
|
166
|
-
);
|
|
167
|
-
const boundaryRoot = renderBoundaryRoot(
|
|
168
|
-
shouldPortalRoot ? undefined : localPortalHost,
|
|
169
|
-
);
|
|
170
|
-
|
|
171
40
|
return (
|
|
172
|
-
<BoundaryRootProvider
|
|
173
|
-
{
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
41
|
+
<BoundaryRootProvider
|
|
42
|
+
config={{ anchor, scaleMode, target, method }}
|
|
43
|
+
enabled={enabled}
|
|
44
|
+
escapeClipping={escapeClipping}
|
|
45
|
+
forwardedRef={forwardedRef}
|
|
46
|
+
group={group}
|
|
47
|
+
handoff={handoff}
|
|
48
|
+
id={id}
|
|
49
|
+
style={style}
|
|
50
|
+
>
|
|
51
|
+
{(root) => (
|
|
52
|
+
<BoundaryPortal
|
|
53
|
+
boundaryId={root.boundTag.tag}
|
|
54
|
+
enabled={root.shouldRenderBoundaryRootThroughPortal}
|
|
55
|
+
placeholderRef={root.rootEscapePlaceholderRef}
|
|
182
56
|
>
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
57
|
+
<AnimatedComponent
|
|
58
|
+
{...rest}
|
|
59
|
+
ref={root.ref}
|
|
60
|
+
style={[style, root.attachedStyle]}
|
|
61
|
+
collapsable={false}
|
|
62
|
+
>
|
|
63
|
+
<BoundaryContentPortalHost
|
|
64
|
+
boundaryId={root.boundTag.tag}
|
|
65
|
+
enabled={root.shouldRenderHandoffHost}
|
|
66
|
+
screenKey={root.currentScreenKey}
|
|
67
|
+
>
|
|
68
|
+
{children}
|
|
69
|
+
</BoundaryContentPortalHost>
|
|
70
|
+
</AnimatedComponent>
|
|
71
|
+
</BoundaryPortal>
|
|
187
72
|
)}
|
|
188
73
|
</BoundaryRootProvider>
|
|
189
74
|
);
|