react-native-screen-transitions 3.8.0 → 3.9.0-alpha.1
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/blank-stack/components/stack-view.js +2 -1
- package/lib/commonjs/blank-stack/components/stack-view.js.map +1 -1
- package/lib/commonjs/shared/components/{create-boundary-component → boundary}/components/boundary-target.js +21 -8
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -0
- package/lib/commonjs/shared/components/{create-boundary-component → boundary}/create-boundary-component.js +18 -24
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js +115 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/{create-boundary-component → boundary}/hooks/use-initial-source-measurement.js +4 -5
- package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/{create-boundary-component → boundary}/hooks/use-measurer.js +26 -22
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -0
- package/lib/commonjs/shared/components/{create-boundary-component → boundary}/hooks/use-refresh-boundary.js +10 -7
- package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js.map +1 -0
- package/lib/commonjs/shared/components/{create-boundary-component → boundary}/index.js +8 -1
- package/lib/commonjs/shared/components/boundary/index.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/host.js +99 -0
- package/lib/commonjs/shared/components/boundary/portal/components/host.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js +74 -0
- package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/portal-provider.js +20 -0
- package/lib/commonjs/shared/components/boundary/portal/components/portal-provider.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/portal.js +198 -0
- package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js +74 -0
- package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/index.js +27 -0
- package/lib/commonjs/shared/components/boundary/portal/index.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/stores/host-bounds.store.js +47 -0
- package/lib/commonjs/shared/components/boundary/portal/stores/host-bounds.store.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js +137 -0
- package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js +60 -0
- package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/teleport.js +23 -0
- package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js +40 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/naming.js +15 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/naming.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js +71 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js +16 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js.map +1 -0
- package/lib/commonjs/shared/components/{create-boundary-component → boundary}/providers/boundary-owner.provider.js +26 -25
- package/lib/commonjs/shared/components/boundary/providers/boundary-owner.provider.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/types.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +25 -0
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -0
- package/lib/commonjs/shared/components/{create-boundary-component → boundary}/utils/measured-bounds.js +19 -9
- package/lib/commonjs/shared/components/boundary/utils/measured-bounds.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +105 -0
- package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/utils/source-signals.js +48 -0
- package/lib/commonjs/shared/components/boundary/utils/source-signals.js.map +1 -0
- package/lib/commonjs/shared/components/create-transition-aware-component.js +8 -3
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/{integrations/masked-view.js → masked-view.js} +2 -2
- package/lib/commonjs/shared/components/masked-view.js.map +1 -0
- package/lib/commonjs/shared/components/screen-container/layers/content.js +9 -5
- package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/commonjs/shared/configs/presets.js +6 -6
- package/lib/commonjs/shared/configs/presets.js.map +1 -1
- package/lib/commonjs/shared/hooks/navigation/use-stack.js +17 -2
- package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/commonjs/shared/index.js +4 -4
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +4 -2
- package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +4 -13
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js +23 -12
- package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js +7 -3
- package/lib/commonjs/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +8 -1
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +21 -6
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/origin.provider.js +41 -0
- package/lib/commonjs/shared/providers/screen/origin.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/constants.js +2 -0
- package/lib/commonjs/shared/providers/screen/styles/constants.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.js +58 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +7 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/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/styles.provider.js +7 -5
- package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +1 -1
- package/lib/commonjs/shared/stores/animation.store.js +2 -0
- package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +1 -10
- package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/links.js +36 -19
- package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +6 -4
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/state.js.map +1 -1
- package/lib/commonjs/shared/stores/scroll.store.js +54 -1
- package/lib/commonjs/shared/stores/scroll.store.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-bound-tag.js +38 -4
- package/lib/commonjs/shared/utils/bounds/helpers/create-bound-tag.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js +40 -87
- package/lib/commonjs/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js +6 -67
- package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +8 -12
- package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/styles/composers.js +235 -68
- package/lib/commonjs/shared/utils/bounds/helpers/styles/composers.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js +74 -4
- package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js +5 -9
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +5 -10
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/module/blank-stack/components/stack-view.js +3 -2
- package/lib/module/blank-stack/components/stack-view.js.map +1 -1
- package/lib/module/shared/components/{create-boundary-component → boundary}/components/boundary-target.js +21 -8
- package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -0
- package/lib/module/shared/components/{create-boundary-component → boundary}/create-boundary-component.js +20 -26
- package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -0
- package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js.map +1 -0
- package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js +110 -0
- package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +1 -0
- package/lib/module/shared/components/{create-boundary-component → boundary}/hooks/use-initial-source-measurement.js +4 -5
- package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js.map +1 -0
- package/lib/module/shared/components/{create-boundary-component → boundary}/hooks/use-measurer.js +27 -23
- package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -0
- package/lib/module/shared/components/{create-boundary-component → boundary}/hooks/use-refresh-boundary.js +10 -7
- package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js.map +1 -0
- package/lib/module/shared/components/{create-boundary-component → boundary}/index.js +8 -1
- package/lib/module/shared/components/boundary/index.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/host.js +94 -0
- package/lib/module/shared/components/boundary/portal/components/host.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js +69 -0
- package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/portal-provider.js +16 -0
- package/lib/module/shared/components/boundary/portal/components/portal-provider.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/portal.js +193 -0
- package/lib/module/shared/components/boundary/portal/components/portal.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js +69 -0
- package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/index.js +6 -0
- package/lib/module/shared/components/boundary/portal/index.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/stores/host-bounds.store.js +40 -0
- package/lib/module/shared/components/boundary/portal/stores/host-bounds.store.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js +126 -0
- package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js +53 -0
- package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/teleport.js +19 -0
- package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/utils/attachment.js +35 -0
- package/lib/module/shared/components/boundary/portal/utils/attachment.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/utils/naming.js +10 -0
- package/lib/module/shared/components/boundary/portal/utils/naming.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/utils/offset-style.js +66 -0
- package/lib/module/shared/components/boundary/portal/utils/offset-style.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/utils/teleport-control.js +11 -0
- package/lib/module/shared/components/boundary/portal/utils/teleport-control.js.map +1 -0
- package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js +60 -0
- package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js.map +1 -0
- package/lib/module/shared/components/boundary/types.js.map +1 -0
- package/lib/module/shared/components/boundary/utils/destination-signals.js +20 -0
- package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -0
- package/lib/module/shared/components/{create-boundary-component → boundary}/utils/measured-bounds.js +16 -7
- package/lib/module/shared/components/boundary/utils/measured-bounds.js.map +1 -0
- package/lib/module/shared/components/boundary/utils/refresh-signals.js +100 -0
- package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +1 -0
- package/lib/module/shared/components/boundary/utils/source-signals.js +43 -0
- package/lib/module/shared/components/boundary/utils/source-signals.js.map +1 -0
- package/lib/module/shared/components/create-transition-aware-component.js +8 -3
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/{integrations/masked-view.js → masked-view.js} +2 -2
- package/lib/module/shared/components/masked-view.js.map +1 -0
- package/lib/module/shared/components/screen-container/layers/content.js +10 -6
- package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/shared/configs/presets.js +6 -6
- package/lib/module/shared/configs/presets.js.map +1 -1
- package/lib/module/shared/hooks/navigation/use-stack.js +19 -4
- package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/module/shared/index.js +2 -2
- package/lib/module/shared/index.js.map +1 -1
- package/lib/module/shared/providers/helpers/measured-bounds-writes.js +4 -2
- package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +5 -14
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js +20 -10
- package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -0
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js +8 -4
- package/lib/module/shared/providers/screen/descriptors/descriptors.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +8 -1
- package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
- package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js +20 -6
- package/lib/module/shared/providers/screen/descriptors/helpers/get-ancestor-keys.js.map +1 -1
- package/lib/module/shared/providers/screen/origin.provider.js +33 -0
- package/lib/module/shared/providers/screen/origin.provider.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/constants.js +2 -0
- package/lib/module/shared/providers/screen/styles/constants.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.js +53 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/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/styles.provider.js +7 -5
- package/lib/module/shared/providers/screen/styles/styles.provider.js.map +1 -1
- package/lib/module/shared/stores/animation.store.js +2 -0
- package/lib/module/shared/stores/animation.store.js.map +1 -1
- package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +1 -8
- package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
- package/lib/module/shared/stores/bounds/index.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/links.js +36 -19
- package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +6 -4
- package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/state.js.map +1 -1
- package/lib/module/shared/stores/scroll.store.js +50 -0
- package/lib/module/shared/stores/scroll.store.js.map +1 -1
- package/lib/module/shared/types/animation.types.js.map +1 -1
- package/lib/module/shared/types/bounds.types.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-bound-tag.js +36 -3
- package/lib/module/shared/utils/bounds/helpers/create-bound-tag.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js +42 -89
- package/lib/module/shared/utils/bounds/helpers/create-bounds-accessor-core.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js +6 -67
- package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +8 -13
- package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/styles/composers.js +236 -69
- package/lib/module/shared/utils/bounds/helpers/styles/composers.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/styles/compute.js +74 -4
- package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js +5 -9
- package/lib/module/shared/utils/bounds/navigation/reveal/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js +5 -10
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/typescript/blank-stack/components/stack-view.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts.map +1 -0
- package/lib/typescript/shared/components/{create-boundary-component → boundary}/hooks/use-initial-destination-measurement.d.ts +1 -4
- package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/{create-boundary-component → boundary}/hooks/use-initial-source-measurement.d.ts +0 -2
- package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/{create-boundary-component → boundary}/hooks/use-measurer.d.ts +4 -2
- package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts +10 -0
- package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts.map +1 -0
- package/lib/typescript/shared/components/{create-boundary-component → boundary}/index.d.ts +8 -2
- package/lib/typescript/shared/components/boundary/index.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/host.d.ts +7 -0
- package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts +9 -0
- package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts +4 -0
- package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +19 -0
- package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts +13 -0
- package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/index.d.ts +4 -0
- package/lib/typescript/shared/components/boundary/portal/index.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/stores/host-bounds.store.d.ts +9 -0
- package/lib/typescript/shared/components/boundary/portal/stores/host-bounds.store.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts +19 -0
- package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts +11 -0
- package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +6 -0
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts +21 -0
- package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts +3 -0
- package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts +37 -0
- package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts +3 -0
- package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts.map +1 -0
- package/lib/typescript/shared/components/{create-boundary-component → boundary}/providers/boundary-owner.provider.d.ts +14 -6
- package/lib/typescript/shared/components/boundary/providers/boundary-owner.provider.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/types.d.ts +78 -0
- package/lib/typescript/shared/components/boundary/types.d.ts.map +1 -0
- package/lib/typescript/shared/components/{create-boundary-component → boundary}/utils/destination-signals.d.ts +2 -3
- package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts +12 -0
- package/lib/typescript/shared/components/boundary/utils/measured-bounds.d.ts.map +1 -0
- package/lib/typescript/shared/components/{create-boundary-component → boundary}/utils/refresh-signals.d.ts +4 -3
- package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +1 -0
- package/lib/typescript/shared/components/{create-boundary-component → boundary}/utils/source-signals.d.ts +1 -2
- package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/masked-view.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
- package/lib/typescript/shared/configs/presets.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +19 -17
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts +3 -1
- package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts +1 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts +2 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +1 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts +6 -1
- package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts +9 -3
- package/lib/typescript/shared/providers/screen/descriptors/helpers/get-ancestor-keys.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/origin.provider.d.ts +11 -0
- package/lib/typescript/shared/providers/screen/origin.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/constants.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.d.ts +3 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/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/styles.provider.d.ts +1 -0
- package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +1 -1
- package/lib/typescript/shared/stores/animation.store.d.ts +1 -0
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +1 -3
- package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/index.d.ts +1 -1
- package/lib/typescript/shared/stores/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/entries.d.ts +2 -2
- package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts +2 -2
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/state.d.ts +4 -2
- package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts +47 -12
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- package/lib/typescript/shared/stores/scroll.store.d.ts +12 -1
- package/lib/typescript/shared/stores/scroll.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +13 -2
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +10 -40
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +2 -2
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-bound-tag.d.ts +2 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-bound-tag.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts +7 -11
- package/lib/typescript/shared/utils/bounds/helpers/create-bounds-accessor-core.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts +0 -3
- package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts +7 -3
- package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/styles/composers.d.ts +3 -0
- package/lib/typescript/shared/utils/bounds/helpers/styles/composers.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/options.d.ts +93 -6
- package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
- package/package.json +8 -2
- package/src/blank-stack/components/stack-view.tsx +4 -3
- package/src/shared/components/{create-boundary-component → boundary}/components/boundary-target.tsx +28 -11
- package/src/shared/components/{create-boundary-component → boundary}/create-boundary-component.tsx +33 -31
- package/src/shared/components/boundary/hooks/use-initial-destination-measurement.ts +156 -0
- package/src/shared/components/{create-boundary-component → boundary}/hooks/use-initial-source-measurement.ts +5 -14
- package/src/shared/components/{create-boundary-component → boundary}/hooks/use-measurer.ts +42 -46
- package/src/shared/components/{create-boundary-component → boundary}/hooks/use-refresh-boundary.ts +16 -11
- package/src/shared/components/{create-boundary-component → boundary}/index.tsx +12 -0
- package/src/shared/components/boundary/portal/components/host.tsx +114 -0
- package/src/shared/components/boundary/portal/components/portal-boundary-host.tsx +97 -0
- package/src/shared/components/boundary/portal/components/portal-provider.tsx +14 -0
- package/src/shared/components/boundary/portal/components/portal.tsx +283 -0
- package/src/shared/components/boundary/portal/hooks/use-host-measurement.ts +102 -0
- package/src/shared/components/boundary/portal/index.ts +3 -0
- package/src/shared/components/boundary/portal/stores/host-bounds.store.ts +45 -0
- package/src/shared/components/boundary/portal/stores/host-registry.store.ts +182 -0
- package/src/shared/components/boundary/portal/stores/portal-boundary-host.store.ts +91 -0
- package/src/shared/components/boundary/portal/teleport.ts +21 -0
- package/src/shared/components/boundary/portal/utils/attachment.ts +48 -0
- package/src/shared/components/boundary/portal/utils/naming.ts +10 -0
- package/src/shared/components/boundary/portal/utils/offset-style.ts +171 -0
- package/src/shared/components/boundary/portal/utils/teleport-control.ts +13 -0
- package/src/shared/components/{create-boundary-component → boundary}/providers/boundary-owner.provider.tsx +41 -33
- package/src/shared/components/boundary/types.ts +92 -0
- package/src/shared/components/boundary/utils/destination-signals.ts +31 -0
- package/src/shared/components/{create-boundary-component → boundary}/utils/measured-bounds.ts +34 -11
- package/src/shared/components/boundary/utils/refresh-signals.ts +175 -0
- package/src/shared/components/boundary/utils/source-signals.ts +63 -0
- package/src/shared/components/create-transition-aware-component.tsx +8 -3
- package/src/shared/components/{integrations/masked-view.tsx → masked-view.tsx} +2 -2
- package/src/shared/components/screen-container/layers/content.tsx +12 -7
- package/src/shared/configs/presets.ts +2 -6
- package/src/shared/hooks/navigation/use-stack.tsx +32 -1
- package/src/shared/index.ts +13 -5
- package/src/shared/providers/helpers/measured-bounds-writes.ts +11 -1
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/types.ts +1 -0
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +13 -19
- package/src/shared/providers/screen/animation/helpers/stack-progress.ts +31 -16
- package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +2 -0
- package/src/shared/providers/screen/descriptors/descriptors.provider.tsx +7 -3
- package/src/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.ts +16 -0
- package/src/shared/providers/screen/descriptors/helpers/get-ancestor-keys.ts +31 -6
- package/src/shared/providers/screen/origin.provider.tsx +38 -0
- package/src/shared/providers/screen/styles/constants.ts +2 -0
- package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/are-resettable-states-equal.ts +74 -0
- package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +1 -0
- package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +1 -0
- package/src/shared/providers/screen/styles/styles.provider.tsx +5 -3
- package/src/shared/stores/animation.store.ts +3 -0
- package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +1 -10
- package/src/shared/stores/bounds/index.ts +2 -4
- package/src/shared/stores/bounds/internals/entries.ts +4 -4
- package/src/shared/stores/bounds/internals/links.ts +52 -18
- package/src/shared/stores/bounds/internals/resolver.ts +5 -3
- package/src/shared/stores/bounds/internals/state.ts +5 -2
- package/src/shared/stores/bounds/types.ts +59 -15
- package/src/shared/stores/scroll.store.ts +68 -0
- package/src/shared/types/animation.types.ts +17 -2
- package/src/shared/types/bounds.types.ts +22 -60
- package/src/shared/types/index.ts +5 -0
- package/src/shared/utils/bounds/helpers/create-bound-tag.ts +46 -4
- package/src/shared/utils/bounds/helpers/create-bounds-accessor-core.ts +65 -116
- package/src/shared/utils/bounds/helpers/create-link-accessor.ts +10 -80
- package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +10 -13
- package/src/shared/utils/bounds/helpers/styles/composers.ts +269 -46
- package/src/shared/utils/bounds/helpers/styles/compute.ts +134 -2
- package/src/shared/utils/bounds/navigation/reveal/build.ts +5 -7
- package/src/shared/utils/bounds/navigation/zoom/build.ts +5 -8
- package/src/shared/utils/bounds/types/options.ts +105 -6
- package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +0 -99
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/providers/boundary-owner.provider.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/types.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js +0 -75
- package/lib/commonjs/shared/components/create-boundary-component/utils/destination-signals.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/utils/measured-bounds.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js +0 -103
- package/lib/commonjs/shared/components/create-boundary-component/utils/refresh-signals.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js +0 -52
- package/lib/commonjs/shared/components/create-boundary-component/utils/source-signals.js.map +0 -1
- package/lib/commonjs/shared/components/integrations/masked-view.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-interpolators.js +0 -68
- package/lib/commonjs/shared/utils/bounds/helpers/create-interpolators.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/styles/interpolate-link-style.js +0 -30
- package/lib/commonjs/shared/utils/bounds/helpers/styles/interpolate-link-style.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/components/boundary-target.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js +0 -94
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-source-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/index.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/providers/boundary-owner.provider.js +0 -60
- package/lib/module/shared/components/create-boundary-component/providers/boundary-owner.provider.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/types.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js +0 -70
- package/lib/module/shared/components/create-boundary-component/utils/destination-signals.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/utils/measured-bounds.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js +0 -98
- package/lib/module/shared/components/create-boundary-component/utils/refresh-signals.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/utils/source-signals.js +0 -47
- package/lib/module/shared/components/create-boundary-component/utils/source-signals.js.map +0 -1
- package/lib/module/shared/components/integrations/masked-view.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/create-interpolators.js +0 -63
- package/lib/module/shared/utils/bounds/helpers/create-interpolators.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/styles/interpolate-link-style.js +0 -26
- package/lib/module/shared/utils/bounds/helpers/styles/interpolate-link-style.js.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-presence.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-source-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts +0 -14
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/providers/boundary-owner.provider.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts +0 -37
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/utils/destination-signals.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/utils/measured-bounds.d.ts +0 -8
- package/lib/typescript/shared/components/create-boundary-component/utils/measured-bounds.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/utils/refresh-signals.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/utils/source-signals.d.ts.map +0 -1
- package/lib/typescript/shared/components/integrations/masked-view.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-interpolators.d.ts +0 -14
- package/lib/typescript/shared/utils/bounds/helpers/create-interpolators.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/styles/interpolate-link-style.d.ts +0 -17
- package/lib/typescript/shared/utils/bounds/helpers/styles/interpolate-link-style.d.ts.map +0 -1
- package/src/shared/components/create-boundary-component/hooks/use-initial-destination-measurement.ts +0 -130
- package/src/shared/components/create-boundary-component/types.ts +0 -48
- package/src/shared/components/create-boundary-component/utils/destination-signals.ts +0 -129
- package/src/shared/components/create-boundary-component/utils/refresh-signals.ts +0 -164
- package/src/shared/components/create-boundary-component/utils/source-signals.ts +0 -72
- package/src/shared/utils/bounds/helpers/create-interpolators.ts +0 -117
- package/src/shared/utils/bounds/helpers/styles/interpolate-link-style.ts +0 -43
- /package/lib/commonjs/shared/components/{create-boundary-component → boundary}/hooks/use-boundary-presence.js +0 -0
- /package/lib/commonjs/shared/components/{create-boundary-component → boundary}/types.js +0 -0
- /package/lib/module/shared/components/{create-boundary-component → boundary}/hooks/use-boundary-presence.js +0 -0
- /package/lib/module/shared/components/{create-boundary-component → boundary}/types.js +0 -0
- /package/lib/typescript/shared/components/{create-boundary-component → boundary}/components/boundary-target.d.ts +0 -0
- /package/lib/typescript/shared/components/{create-boundary-component → boundary}/create-boundary-component.d.ts +0 -0
- /package/lib/typescript/shared/components/{create-boundary-component → boundary}/hooks/use-boundary-presence.d.ts +0 -0
- /package/lib/typescript/shared/components/{integrations/masked-view.d.ts → masked-view.d.ts} +0 -0
- /package/src/shared/components/{create-boundary-component → boundary}/hooks/use-boundary-presence.ts +0 -0
package/src/shared/components/{create-boundary-component → boundary}/hooks/use-refresh-boundary.ts
RENAMED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useAnimatedReaction } from "react-native-reanimated";
|
|
2
|
+
import { useDescriptorsStore } from "../../../providers/screen/descriptors";
|
|
2
3
|
import { AnimationStore } from "../../../stores/animation.store";
|
|
3
4
|
import { pairs } from "../../../stores/bounds/internals/state";
|
|
4
5
|
import type { MeasureBoundary } from "../types";
|
|
@@ -6,25 +7,28 @@ import { getRefreshBoundarySignal } from "../utils/refresh-signals";
|
|
|
6
7
|
|
|
7
8
|
interface UseRefreshBoundaryParams {
|
|
8
9
|
enabled: boolean;
|
|
9
|
-
currentScreenKey: string;
|
|
10
|
-
preferredSourceScreenKey?: string;
|
|
11
|
-
nextScreenKey?: string;
|
|
12
10
|
linkId: string;
|
|
13
11
|
group?: string;
|
|
14
|
-
ancestorScreenKeys: string[];
|
|
15
12
|
measureBoundary: MeasureBoundary;
|
|
16
13
|
}
|
|
17
14
|
|
|
18
15
|
export const useRefreshBoundary = ({
|
|
19
16
|
enabled,
|
|
20
|
-
currentScreenKey,
|
|
21
|
-
preferredSourceScreenKey,
|
|
22
|
-
nextScreenKey,
|
|
23
17
|
linkId,
|
|
24
18
|
group,
|
|
25
|
-
ancestorScreenKeys,
|
|
26
19
|
measureBoundary,
|
|
27
20
|
}: UseRefreshBoundaryParams) => {
|
|
21
|
+
const currentScreenKey = useDescriptorsStore(
|
|
22
|
+
(s) => s.derivations.currentScreenKey,
|
|
23
|
+
);
|
|
24
|
+
const nextScreenKey = useDescriptorsStore((s) => s.derivations.nextScreenKey);
|
|
25
|
+
const sourcePairKey = useDescriptorsStore((s) => s.derivations.sourcePairKey);
|
|
26
|
+
const destinationPairKey = useDescriptorsStore(
|
|
27
|
+
(s) => s.derivations.destinationPairKey,
|
|
28
|
+
);
|
|
29
|
+
const ancestorDestinationPairKey = useDescriptorsStore(
|
|
30
|
+
(s) => s.derivations.ancestorDestinationPairKey,
|
|
31
|
+
);
|
|
28
32
|
// Source-side boundaries refresh from the next screen's lifecycle pulse.
|
|
29
33
|
// Destination-side boundaries have no next screen, so they refresh from self.
|
|
30
34
|
const refreshScreenKey = nextScreenKey ?? currentScreenKey;
|
|
@@ -49,17 +53,18 @@ export const useRefreshBoundary = ({
|
|
|
49
53
|
return getRefreshBoundarySignal({
|
|
50
54
|
enabled,
|
|
51
55
|
currentScreenKey,
|
|
52
|
-
|
|
56
|
+
sourcePairKey,
|
|
57
|
+
destinationPairKey,
|
|
58
|
+
ancestorDestinationPairKey,
|
|
53
59
|
nextScreenKey,
|
|
54
60
|
linkId,
|
|
55
61
|
group,
|
|
56
|
-
ancestorScreenKeys,
|
|
57
62
|
shouldRefresh: !!refreshWillAnimate.get(),
|
|
58
63
|
closing: !!refreshClosing.get(),
|
|
59
64
|
entering: !!refreshEntering.get(),
|
|
60
65
|
animating: !!refreshAnimating.get(),
|
|
61
66
|
progress: refreshProgress.get(),
|
|
62
|
-
linkState:
|
|
67
|
+
linkState: pairs.get(),
|
|
63
68
|
});
|
|
64
69
|
},
|
|
65
70
|
(refreshSignal, prevRefreshSignal) => {
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { Pressable, View } from "react-native";
|
|
2
2
|
import { BoundaryTarget } from "./components/boundary-target";
|
|
3
3
|
import { createBoundaryComponent } from "./create-boundary-component";
|
|
4
|
+
import { Host } from "./portal";
|
|
4
5
|
|
|
6
|
+
export type {
|
|
7
|
+
BoundaryPortal,
|
|
8
|
+
BoundaryPortalAttachTarget,
|
|
9
|
+
BoundaryPortalOptions,
|
|
10
|
+
} from "./types";
|
|
5
11
|
export { createBoundaryComponent };
|
|
6
12
|
|
|
7
13
|
const BoundaryView = createBoundaryComponent(View, {
|
|
@@ -11,6 +17,7 @@ const BoundaryTrigger = createBoundaryComponent(Pressable);
|
|
|
11
17
|
BoundaryView.displayName = "Transition.Boundary.View";
|
|
12
18
|
BoundaryTrigger.displayName = "Transition.Boundary.Trigger";
|
|
13
19
|
BoundaryTarget.displayName = "Transition.Boundary.Target";
|
|
20
|
+
Host.displayName = "Transition.Boundary.Host";
|
|
14
21
|
|
|
15
22
|
/**
|
|
16
23
|
* Shared-boundary components.
|
|
@@ -29,6 +36,7 @@ BoundaryTarget.displayName = "Transition.Boundary.Target";
|
|
|
29
36
|
* - `Boundary.View` for passive/shared elements.
|
|
30
37
|
* - `Boundary.Trigger` for tappable elements that start navigation.
|
|
31
38
|
* - `Boundary.Target` to measure a nested descendant instead of the owner.
|
|
39
|
+
* - `Boundary.Host` to make nested portal placement explicit.
|
|
32
40
|
*/
|
|
33
41
|
export const Boundary = {
|
|
34
42
|
/**
|
|
@@ -43,4 +51,8 @@ export const Boundary = {
|
|
|
43
51
|
* Optional nested measurement override inside a boundary owner.
|
|
44
52
|
*/
|
|
45
53
|
Target: BoundaryTarget,
|
|
54
|
+
/**
|
|
55
|
+
* Explicit portal host for scrollable or otherwise clipped coordinate spaces.
|
|
56
|
+
*/
|
|
57
|
+
Host: Host,
|
|
46
58
|
};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { memo, useLayoutEffect, useRef } from "react";
|
|
2
|
+
import {
|
|
3
|
+
type StyleProp,
|
|
4
|
+
StyleSheet,
|
|
5
|
+
useWindowDimensions,
|
|
6
|
+
View,
|
|
7
|
+
type ViewStyle,
|
|
8
|
+
} from "react-native";
|
|
9
|
+
import Animated from "react-native-reanimated";
|
|
10
|
+
import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
|
|
11
|
+
import { useHostMeasurement } from "../hooks/use-host-measurement";
|
|
12
|
+
import { registerHost, unregisterHost } from "../stores/host-registry.store";
|
|
13
|
+
import { useActivePortalBoundaryHosts } from "../stores/portal-boundary-host.store";
|
|
14
|
+
import { PortalBoundaryHost } from "./portal-boundary-host";
|
|
15
|
+
|
|
16
|
+
let nextHostId = 0;
|
|
17
|
+
|
|
18
|
+
export type PublicHostProps = {
|
|
19
|
+
style?: StyleProp<ViewStyle>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
type HostImplProps = PublicHostProps & {
|
|
23
|
+
fallback?: boolean;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
function HostImpl({ fallback = false, style }: HostImplProps) {
|
|
27
|
+
const screenKey = useDescriptorsStore((s) => s.derivations.currentScreenKey);
|
|
28
|
+
const generatedHostKeyRef = useRef<string | null>(null);
|
|
29
|
+
|
|
30
|
+
if (generatedHostKeyRef.current === null) {
|
|
31
|
+
generatedHostKeyRef.current = `${screenKey}-host-${nextHostId++}`;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const hostKey = fallback ? screenKey : generatedHostKeyRef.current;
|
|
35
|
+
const capturesScroll = !fallback;
|
|
36
|
+
const activeBoundaryHosts = useActivePortalBoundaryHosts(hostKey);
|
|
37
|
+
const { height: viewportHeight, width: viewportWidth } =
|
|
38
|
+
useWindowDimensions();
|
|
39
|
+
|
|
40
|
+
const measurement = useHostMeasurement({
|
|
41
|
+
capturesScroll,
|
|
42
|
+
enabled: activeBoundaryHosts.length > 0,
|
|
43
|
+
hostKey,
|
|
44
|
+
screenKey,
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
useLayoutEffect(() => {
|
|
48
|
+
registerHost({
|
|
49
|
+
capturesScroll,
|
|
50
|
+
fallback,
|
|
51
|
+
hostKey,
|
|
52
|
+
screenKey,
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
return () => {
|
|
56
|
+
unregisterHost(screenKey, hostKey);
|
|
57
|
+
};
|
|
58
|
+
}, [capturesScroll, fallback, hostKey, screenKey]);
|
|
59
|
+
|
|
60
|
+
const boundaryHosts = measurement.canRenderHosts
|
|
61
|
+
? activeBoundaryHosts.map((host) => (
|
|
62
|
+
<View
|
|
63
|
+
key={host.boundaryId}
|
|
64
|
+
pointerEvents="box-none"
|
|
65
|
+
style={[
|
|
66
|
+
styles.boundaryHostViewport,
|
|
67
|
+
{ width: viewportWidth, height: viewportHeight },
|
|
68
|
+
]}
|
|
69
|
+
>
|
|
70
|
+
<PortalBoundaryHost host={host} style={StyleSheet.absoluteFill} />
|
|
71
|
+
</View>
|
|
72
|
+
))
|
|
73
|
+
: null;
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
<Animated.View
|
|
77
|
+
ref={measurement.hostRef}
|
|
78
|
+
pointerEvents="box-none"
|
|
79
|
+
style={[
|
|
80
|
+
styles.host,
|
|
81
|
+
{ width: viewportWidth, height: viewportHeight },
|
|
82
|
+
style,
|
|
83
|
+
]}
|
|
84
|
+
collapsable={false}
|
|
85
|
+
>
|
|
86
|
+
{boundaryHosts}
|
|
87
|
+
</Animated.View>
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export const Host = memo(function Host(props: PublicHostProps) {
|
|
92
|
+
return <HostImpl {...props} />;
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
export const ScreenFallbackHost = memo(function ScreenFallbackHost() {
|
|
96
|
+
return <HostImpl fallback />;
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const styles = StyleSheet.create({
|
|
100
|
+
host: {
|
|
101
|
+
elevation: 999999,
|
|
102
|
+
left: 0,
|
|
103
|
+
overflow: "visible",
|
|
104
|
+
position: "absolute",
|
|
105
|
+
top: 0,
|
|
106
|
+
zIndex: 999999,
|
|
107
|
+
},
|
|
108
|
+
boundaryHostViewport: {
|
|
109
|
+
left: 0,
|
|
110
|
+
overflow: "visible",
|
|
111
|
+
position: "absolute",
|
|
112
|
+
top: 0,
|
|
113
|
+
},
|
|
114
|
+
});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { memo } from "react";
|
|
2
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
3
|
+
import Animated, { useAnimatedStyle } from "react-native-reanimated";
|
|
4
|
+
import { NO_STYLES } from "../../../../constants";
|
|
5
|
+
import { AnimationStore } from "../../../../stores/animation.store";
|
|
6
|
+
import { getSourceScreenKeyFromPairKey } from "../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
7
|
+
import { getLink } from "../../../../stores/bounds/internals/links";
|
|
8
|
+
import { GestureStore } from "../../../../stores/gesture.store";
|
|
9
|
+
import { ScrollStore } from "../../../../stores/scroll.store";
|
|
10
|
+
import type { ActivePortalBoundaryHost } from "../stores/portal-boundary-host.store";
|
|
11
|
+
import { NativePortalHost } from "../teleport";
|
|
12
|
+
import { createPortalBoundaryHostName } from "../utils/naming";
|
|
13
|
+
import {
|
|
14
|
+
type PortalOffsetPlacement,
|
|
15
|
+
resolvePortalOffsetStyle,
|
|
16
|
+
} from "../utils/offset-style";
|
|
17
|
+
|
|
18
|
+
const AnimatedPortalBoundaryHost = NativePortalHost
|
|
19
|
+
? Animated.createAnimatedComponent(NativePortalHost)
|
|
20
|
+
: null;
|
|
21
|
+
|
|
22
|
+
type PortalBoundaryHostProps = {
|
|
23
|
+
host: ActivePortalBoundaryHost;
|
|
24
|
+
style?: StyleProp<ViewStyle>;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const PortalBoundaryHost = memo(function PortalBoundaryHost({
|
|
28
|
+
host,
|
|
29
|
+
style,
|
|
30
|
+
}: PortalBoundaryHostProps) {
|
|
31
|
+
const hostName = createPortalBoundaryHostName(host.hostKey, host.boundaryId);
|
|
32
|
+
const hostClosing = AnimationStore.getValue(host.screenKey, "closing");
|
|
33
|
+
const hostProgress = AnimationStore.getValue(
|
|
34
|
+
host.screenKey,
|
|
35
|
+
"transitionProgress",
|
|
36
|
+
);
|
|
37
|
+
const hostGestureDismissing = GestureStore.getValue(
|
|
38
|
+
host.screenKey,
|
|
39
|
+
"dismissing",
|
|
40
|
+
);
|
|
41
|
+
const hostScrollMetadata = ScrollStore.getValue(host.screenKey, "metadata");
|
|
42
|
+
const sourceScrollMetadata = ScrollStore.getValue(
|
|
43
|
+
getSourceScreenKeyFromPairKey(host.pairKey),
|
|
44
|
+
"metadata",
|
|
45
|
+
);
|
|
46
|
+
const hostStyle = useAnimatedStyle(() => {
|
|
47
|
+
"worklet";
|
|
48
|
+
// Strict per-member lookup — a fallback member's source rect would
|
|
49
|
+
// misplace this host's teleported content.
|
|
50
|
+
const link = getLink(host.pairKey, host.boundaryId);
|
|
51
|
+
if (!link?.source || !link.destination) {
|
|
52
|
+
return NO_STYLES;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Make the coordinate case explicit before resolving the host offset.
|
|
56
|
+
// The resolver owns the math; this component decides which screen/scroll
|
|
57
|
+
// relationship the active portal is in.
|
|
58
|
+
const isCrossScreenPortal = link.source.screenKey !== host.screenKey;
|
|
59
|
+
const isHostClosing =
|
|
60
|
+
hostClosing.get() === 1 || hostGestureDismissing.get() === 1;
|
|
61
|
+
const placement: PortalOffsetPlacement = !isCrossScreenPortal
|
|
62
|
+
? "same-screen"
|
|
63
|
+
: isHostClosing
|
|
64
|
+
? "cross-screen-close"
|
|
65
|
+
: "cross-screen-open";
|
|
66
|
+
|
|
67
|
+
// A source that originated inside its own scroll host moves with that
|
|
68
|
+
// ScrollView while this portal stays attached over here. Shifting the
|
|
69
|
+
// source rect by the clamped source scroll travel keeps the return
|
|
70
|
+
// landing point on the live placeholder, so the close detach is seamless.
|
|
71
|
+
const trackSourceScroll =
|
|
72
|
+
isCrossScreenPortal && link.source.sourceHost?.capturesScroll === true;
|
|
73
|
+
|
|
74
|
+
return resolvePortalOffsetStyle({
|
|
75
|
+
bounds: link.source.bounds,
|
|
76
|
+
hostCurrentScroll:
|
|
77
|
+
placement === "cross-screen-close" ? hostScrollMetadata.get() : null,
|
|
78
|
+
hostKey: host.hostKey,
|
|
79
|
+
placement,
|
|
80
|
+
sourceCurrentScroll: trackSourceScroll
|
|
81
|
+
? sourceScrollMetadata.get()
|
|
82
|
+
: null,
|
|
83
|
+
hostProgress: hostProgress.get(),
|
|
84
|
+
trackSourceScroll,
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// Without `react-native-teleport` no portal ever mounts a boundary host, so
|
|
89
|
+
// this never renders — the guard just narrows the nullable animated host.
|
|
90
|
+
if (!AnimatedPortalBoundaryHost) {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return (
|
|
95
|
+
<AnimatedPortalBoundaryHost name={hostName} style={[style, hostStyle]} />
|
|
96
|
+
);
|
|
97
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { memo } from "react";
|
|
2
|
+
import { NativePortalProvider } from "../teleport";
|
|
3
|
+
|
|
4
|
+
export const PortalProvider = memo(function PortalProvider({
|
|
5
|
+
children,
|
|
6
|
+
}: {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}) {
|
|
9
|
+
if (!NativePortalProvider) {
|
|
10
|
+
return children;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
return <NativePortalProvider>{children}</NativePortalProvider>;
|
|
14
|
+
});
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ComponentProps,
|
|
3
|
+
type ComponentType,
|
|
4
|
+
memo,
|
|
5
|
+
type ReactNode,
|
|
6
|
+
useCallback,
|
|
7
|
+
useLayoutEffect,
|
|
8
|
+
useState,
|
|
9
|
+
} from "react";
|
|
10
|
+
import type { View } from "react-native";
|
|
11
|
+
import Animated, {
|
|
12
|
+
type AnimatedRef,
|
|
13
|
+
runOnJS,
|
|
14
|
+
useAnimatedProps,
|
|
15
|
+
useAnimatedReaction,
|
|
16
|
+
useAnimatedStyle,
|
|
17
|
+
useSharedValue,
|
|
18
|
+
} from "react-native-reanimated";
|
|
19
|
+
import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
|
|
20
|
+
import { useScreenStyles } from "../../../../providers/screen/styles";
|
|
21
|
+
import { AnimationStore } from "../../../../stores/animation.store";
|
|
22
|
+
import { getLinkKeyFromTag } from "../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
23
|
+
import { getLink } from "../../../../stores/bounds/internals/links";
|
|
24
|
+
import { pairs } from "../../../../stores/bounds/internals/state";
|
|
25
|
+
import { createTransitionAwareComponent } from "../../../create-transition-aware-component";
|
|
26
|
+
import type { BoundaryPortal, BoundaryPortalAttachTarget } from "../../types";
|
|
27
|
+
import {
|
|
28
|
+
getHostCapturesScroll,
|
|
29
|
+
useActiveHostKey,
|
|
30
|
+
} from "../stores/host-registry.store";
|
|
31
|
+
import {
|
|
32
|
+
mountPortalBoundaryHost,
|
|
33
|
+
unmountPortalBoundaryHost,
|
|
34
|
+
} from "../stores/portal-boundary-host.store";
|
|
35
|
+
import { isTeleportAvailable, NativePortal } from "../teleport";
|
|
36
|
+
import {
|
|
37
|
+
type PortalAttachment,
|
|
38
|
+
resolvePortalAttachmentTargets,
|
|
39
|
+
} from "../utils/attachment";
|
|
40
|
+
import {
|
|
41
|
+
createPortalBoundaryHostName,
|
|
42
|
+
PORTAL_HOST_NAME_RESET_VALUE,
|
|
43
|
+
} from "../utils/naming";
|
|
44
|
+
import { isTeleportEnabled } from "../utils/teleport-control";
|
|
45
|
+
|
|
46
|
+
type NullableHostNamePortalProps = Omit<
|
|
47
|
+
ComponentProps<NonNullable<typeof NativePortal>>,
|
|
48
|
+
"hostName"
|
|
49
|
+
> & {
|
|
50
|
+
hostName?: string | null;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const TransitionAwareTeleport = NativePortal
|
|
54
|
+
? createTransitionAwareComponent(
|
|
55
|
+
NativePortal as ComponentType<NullableHostNamePortalProps>,
|
|
56
|
+
)
|
|
57
|
+
: null;
|
|
58
|
+
|
|
59
|
+
interface PortalProps {
|
|
60
|
+
id?: string;
|
|
61
|
+
children: ReactNode;
|
|
62
|
+
mode?: BoundaryPortal;
|
|
63
|
+
/**
|
|
64
|
+
* Ref to the layout-preserving placeholder wrapper. Boundaries measure
|
|
65
|
+
* this instead of teleported content — the placeholder keeps the source
|
|
66
|
+
* slot at home while the content may physically live in another screen's
|
|
67
|
+
* host.
|
|
68
|
+
*/
|
|
69
|
+
placeholderRef?: AnimatedRef<View>;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export const Portal = memo(function Portal({
|
|
73
|
+
id = "my-id",
|
|
74
|
+
children,
|
|
75
|
+
mode = false,
|
|
76
|
+
placeholderRef,
|
|
77
|
+
}: PortalProps) {
|
|
78
|
+
// Teleporting requires the optional `react-native-teleport` peer. Without it,
|
|
79
|
+
// a portal-enabled boundary degrades to inline rendering (the `return
|
|
80
|
+
// children` path below).
|
|
81
|
+
const isPortalEnabled = !!mode && isTeleportAvailable;
|
|
82
|
+
const portalAttachTarget: BoundaryPortalAttachTarget =
|
|
83
|
+
!mode || mode === true
|
|
84
|
+
? "current-screen"
|
|
85
|
+
: (mode.attachTo ?? "current-screen");
|
|
86
|
+
const { stylesMap } = useScreenStyles();
|
|
87
|
+
const sourcePairKey = useDescriptorsStore((s) => s.derivations.sourcePairKey);
|
|
88
|
+
const currentScreenKey = useDescriptorsStore(
|
|
89
|
+
(s) => s.derivations.currentScreenKey,
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
const nextScreenKey = useDescriptorsStore((s) => s.derivations.nextScreenKey);
|
|
93
|
+
|
|
94
|
+
const [attachment, setAttachment] = useState<PortalAttachment | null>(
|
|
95
|
+
PORTAL_HOST_NAME_RESET_VALUE,
|
|
96
|
+
);
|
|
97
|
+
const attachedHostName = useSharedValue<string | null>(
|
|
98
|
+
PORTAL_HOST_NAME_RESET_VALUE,
|
|
99
|
+
);
|
|
100
|
+
const placeholderWidth = useSharedValue(0);
|
|
101
|
+
const placeholderHeight = useSharedValue(0);
|
|
102
|
+
|
|
103
|
+
const { progressScreenKey, targetScreenKey } = resolvePortalAttachmentTargets(
|
|
104
|
+
{
|
|
105
|
+
attachment,
|
|
106
|
+
currentScreenKey,
|
|
107
|
+
nextScreenKey,
|
|
108
|
+
portalAttachTarget,
|
|
109
|
+
sourcePairKey,
|
|
110
|
+
},
|
|
111
|
+
);
|
|
112
|
+
const activeHostKey = useActiveHostKey(targetScreenKey);
|
|
113
|
+
const activeHostCapturesScroll = activeHostKey
|
|
114
|
+
? getHostCapturesScroll(activeHostKey)
|
|
115
|
+
: false;
|
|
116
|
+
const progress = AnimationStore.getValue(
|
|
117
|
+
progressScreenKey ?? "",
|
|
118
|
+
"transitionProgress",
|
|
119
|
+
);
|
|
120
|
+
const closing = AnimationStore.getValue(progressScreenKey ?? "", "closing");
|
|
121
|
+
|
|
122
|
+
const updatePortalAttachment = useCallback(
|
|
123
|
+
(matchedScreenKey: string | null, pairKey?: string) => {
|
|
124
|
+
if (matchedScreenKey && pairKey) {
|
|
125
|
+
setAttachment((current) => {
|
|
126
|
+
if (
|
|
127
|
+
current?.matchedScreenKey === matchedScreenKey &&
|
|
128
|
+
current.pairKey === pairKey
|
|
129
|
+
) {
|
|
130
|
+
return current;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
matchedScreenKey,
|
|
135
|
+
pairKey,
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
setAttachment((current) => (current ? null : current));
|
|
142
|
+
},
|
|
143
|
+
[],
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
useLayoutEffect(() => {
|
|
147
|
+
if (!isPortalEnabled || !attachment || !activeHostKey || !targetScreenKey) {
|
|
148
|
+
attachedHostName.set(PORTAL_HOST_NAME_RESET_VALUE);
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
mountPortalBoundaryHost({
|
|
153
|
+
boundaryId: id,
|
|
154
|
+
capturesScroll: activeHostCapturesScroll,
|
|
155
|
+
hostKey: activeHostKey,
|
|
156
|
+
pairKey: attachment.pairKey,
|
|
157
|
+
screenKey: targetScreenKey,
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// The native registry parks portals whose host has not registered yet and
|
|
161
|
+
// re-parents the moment it does, so the host name can be handed over
|
|
162
|
+
// immediately — ordering belongs to the registry, not to frame counting.
|
|
163
|
+
// hostName rides animated props, so the handover needs no React commit.
|
|
164
|
+
attachedHostName.set(createPortalBoundaryHostName(activeHostKey, id));
|
|
165
|
+
}, [
|
|
166
|
+
activeHostKey,
|
|
167
|
+
activeHostCapturesScroll,
|
|
168
|
+
attachedHostName,
|
|
169
|
+
attachment,
|
|
170
|
+
id,
|
|
171
|
+
isPortalEnabled,
|
|
172
|
+
targetScreenKey,
|
|
173
|
+
]);
|
|
174
|
+
|
|
175
|
+
useLayoutEffect(() => {
|
|
176
|
+
return () => {
|
|
177
|
+
attachedHostName.set(PORTAL_HOST_NAME_RESET_VALUE);
|
|
178
|
+
unmountPortalBoundaryHost(id);
|
|
179
|
+
};
|
|
180
|
+
}, [attachedHostName, id]);
|
|
181
|
+
|
|
182
|
+
useAnimatedReaction(
|
|
183
|
+
() => {
|
|
184
|
+
"worklet";
|
|
185
|
+
if (!isPortalEnabled || !sourcePairKey) {
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
pairs.get();
|
|
190
|
+
// Strict per-member lookup: getResolvedLink's group fallback borrows
|
|
191
|
+
// the initial member's link for style resolution, which would make
|
|
192
|
+
// every inactive group member's portal see a "complete" link and
|
|
193
|
+
// attach. A portal may only teleport on its OWN member's link.
|
|
194
|
+
const link = getLink(sourcePairKey, id);
|
|
195
|
+
|
|
196
|
+
if (link?.status !== "complete") {
|
|
197
|
+
return null;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
// Grouped portals teleport only while their member is the group's
|
|
201
|
+
// active id — retargeting detaches the previous member (its content
|
|
202
|
+
// returns home) and attaches the new one. Exactly one grouped member
|
|
203
|
+
// is teleported at a time.
|
|
204
|
+
if (link.group) {
|
|
205
|
+
const activeId =
|
|
206
|
+
pairs.get()[sourcePairKey]?.groups?.[link.group]?.activeId;
|
|
207
|
+
|
|
208
|
+
if (activeId && activeId !== getLinkKeyFromTag(id)) {
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return link.destination.screenKey;
|
|
214
|
+
},
|
|
215
|
+
(matchedScreenKey, previousMatchedScreenKey) => {
|
|
216
|
+
"worklet";
|
|
217
|
+
if (matchedScreenKey === previousMatchedScreenKey) {
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
runOnJS(updatePortalAttachment)(matchedScreenKey, sourcePairKey);
|
|
222
|
+
},
|
|
223
|
+
);
|
|
224
|
+
|
|
225
|
+
const teleportProps = useAnimatedProps(() => {
|
|
226
|
+
"worklet";
|
|
227
|
+
|
|
228
|
+
// Opening waits for the destination transition to start so content is not
|
|
229
|
+
// re-parented before the host is visually ready. Closing stays attached
|
|
230
|
+
// through progress 0 so the final frame can land in the matched host.
|
|
231
|
+
const attachThreshold = closing.get() === 1 ? 0 : 0.001;
|
|
232
|
+
const { teleport, ...slotProps } = stylesMap.get()[id]?.props ?? {};
|
|
233
|
+
const shouldTeleport = isTeleportEnabled(teleport);
|
|
234
|
+
|
|
235
|
+
return {
|
|
236
|
+
// Preserve portal slot props from the interpolator while keeping
|
|
237
|
+
// hostName owned by the attachment gate below.
|
|
238
|
+
...slotProps,
|
|
239
|
+
hostName:
|
|
240
|
+
shouldTeleport && progress.get() >= attachThreshold
|
|
241
|
+
? attachedHostName.get()
|
|
242
|
+
: PORTAL_HOST_NAME_RESET_VALUE,
|
|
243
|
+
};
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
// Pin the placeholder to its measured size while content lives in the host,
|
|
247
|
+
// in the same UI frame the host name flips — no commit in between. Until the
|
|
248
|
+
// first layout lands (dims 0) sizing stays natural so an instant attach
|
|
249
|
+
// cannot collapse the slot.
|
|
250
|
+
const placeholderStyle = useAnimatedStyle(() => {
|
|
251
|
+
"worklet";
|
|
252
|
+
const hostName = attachedHostName.get();
|
|
253
|
+
const isAttached = hostName !== null;
|
|
254
|
+
const width = placeholderWidth.get();
|
|
255
|
+
const height = placeholderHeight.get();
|
|
256
|
+
|
|
257
|
+
if (!isAttached || width === 0) {
|
|
258
|
+
return { width: "auto", height: "auto" } as const;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
return { width, height };
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
if (isPortalEnabled && TransitionAwareTeleport) {
|
|
265
|
+
return (
|
|
266
|
+
<Animated.View
|
|
267
|
+
ref={placeholderRef}
|
|
268
|
+
onLayout={(event) => {
|
|
269
|
+
placeholderWidth.set(event.nativeEvent.layout.width);
|
|
270
|
+
placeholderHeight.set(event.nativeEvent.layout.height);
|
|
271
|
+
}}
|
|
272
|
+
style={placeholderStyle}
|
|
273
|
+
collapsable={false}
|
|
274
|
+
>
|
|
275
|
+
<TransitionAwareTeleport animatedProps={teleportProps} name={id}>
|
|
276
|
+
<Animated.View style={placeholderStyle}>{children}</Animated.View>
|
|
277
|
+
</TransitionAwareTeleport>
|
|
278
|
+
</Animated.View>
|
|
279
|
+
);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return children;
|
|
283
|
+
});
|