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
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { useLayoutEffect, useState } from "react";
|
|
2
|
+
import type { View } from "react-native";
|
|
3
|
+
import {
|
|
4
|
+
measure,
|
|
5
|
+
runOnJS,
|
|
6
|
+
runOnUI,
|
|
7
|
+
useAnimatedReaction,
|
|
8
|
+
useAnimatedRef,
|
|
9
|
+
useSharedValue,
|
|
10
|
+
} from "react-native-reanimated";
|
|
11
|
+
import { useOriginContext } from "../../../../providers/screen/origin.provider";
|
|
12
|
+
import { ScrollStore } from "../../../../stores/scroll.store";
|
|
13
|
+
import {
|
|
14
|
+
adjustedMeasuredBoundsForOverscrollDeltas,
|
|
15
|
+
normalizeMeasuredBoundsToOrigin,
|
|
16
|
+
} from "../../utils/measured-bounds";
|
|
17
|
+
import {
|
|
18
|
+
clearPortalHostBounds,
|
|
19
|
+
setPortalHostBounds,
|
|
20
|
+
} from "../stores/host-bounds.store";
|
|
21
|
+
|
|
22
|
+
type UseHostMeasurementParams = {
|
|
23
|
+
capturesScroll: boolean;
|
|
24
|
+
enabled: boolean;
|
|
25
|
+
hostKey: string;
|
|
26
|
+
screenKey: string;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const useHostMeasurement = ({
|
|
30
|
+
capturesScroll,
|
|
31
|
+
enabled,
|
|
32
|
+
hostKey,
|
|
33
|
+
screenKey,
|
|
34
|
+
}: UseHostMeasurementParams) => {
|
|
35
|
+
const hostRef = useAnimatedRef<View>();
|
|
36
|
+
const scrollMetadata = ScrollStore.getValue(screenKey, "metadata");
|
|
37
|
+
const [canRenderHosts, setCanRenderHosts] = useState<boolean>(false);
|
|
38
|
+
const { originRef } = useOriginContext();
|
|
39
|
+
const hasMeasuredHost = useSharedValue(false);
|
|
40
|
+
|
|
41
|
+
useAnimatedReaction(
|
|
42
|
+
() => {
|
|
43
|
+
"worklet";
|
|
44
|
+
if (!enabled) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return hasMeasuredHost.get();
|
|
49
|
+
},
|
|
50
|
+
(hasAlreadyMeasured) => {
|
|
51
|
+
"worklet";
|
|
52
|
+
if (!enabled || hasAlreadyMeasured) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const measured = measure(hostRef);
|
|
57
|
+
const measuredOrigin = measure(originRef);
|
|
58
|
+
|
|
59
|
+
if (!measured || !measuredOrigin) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
hasMeasuredHost.set(true);
|
|
64
|
+
|
|
65
|
+
// A measurement taken mid rubber-band would bake the transient
|
|
66
|
+
// overscroll displacement into the host frame. Store the at-rest
|
|
67
|
+
// position instead; clamped scroll deltas share that basis.
|
|
68
|
+
const currentScroll = scrollMetadata.get();
|
|
69
|
+
const overscrollNormalized = capturesScroll
|
|
70
|
+
? adjustedMeasuredBoundsForOverscrollDeltas(measured, currentScroll)
|
|
71
|
+
: measured;
|
|
72
|
+
|
|
73
|
+
const normalizedMeasured = normalizeMeasuredBoundsToOrigin(
|
|
74
|
+
overscrollNormalized,
|
|
75
|
+
measuredOrigin,
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
setPortalHostBounds(hostKey, {
|
|
79
|
+
x: normalizedMeasured.x,
|
|
80
|
+
y: normalizedMeasured.y,
|
|
81
|
+
width: normalizedMeasured.width,
|
|
82
|
+
height: normalizedMeasured.height,
|
|
83
|
+
pageX: normalizedMeasured.pageX,
|
|
84
|
+
pageY: normalizedMeasured.pageY,
|
|
85
|
+
scroll: capturesScroll ? currentScroll : null,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
runOnJS(setCanRenderHosts)(true);
|
|
89
|
+
},
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
useLayoutEffect(() => {
|
|
93
|
+
return () => {
|
|
94
|
+
runOnUI(clearPortalHostBounds)(hostKey);
|
|
95
|
+
};
|
|
96
|
+
}, [hostKey]);
|
|
97
|
+
|
|
98
|
+
return {
|
|
99
|
+
canRenderHosts,
|
|
100
|
+
hostRef,
|
|
101
|
+
};
|
|
102
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { type MeasuredDimensions, makeMutable } from "react-native-reanimated";
|
|
2
|
+
import { cloneScrollMetadataState } from "../../../../stores/scroll.store";
|
|
3
|
+
import type { ScrollMetadataState } from "../../../../types/gesture.types";
|
|
4
|
+
|
|
5
|
+
export type PortalHostBounds = MeasuredDimensions & {
|
|
6
|
+
scroll?: ScrollMetadataState | null;
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
type PortalHostBoundsState = Record<string, PortalHostBounds | null>;
|
|
10
|
+
|
|
11
|
+
const portalHostBounds = makeMutable<PortalHostBoundsState>({});
|
|
12
|
+
|
|
13
|
+
export const getPortalHostBounds = (hostKey: string) => {
|
|
14
|
+
"worklet";
|
|
15
|
+
return portalHostBounds.get()[hostKey] ?? null;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const setPortalHostBounds = (
|
|
19
|
+
hostKey: string,
|
|
20
|
+
bounds: PortalHostBounds,
|
|
21
|
+
) => {
|
|
22
|
+
"worklet";
|
|
23
|
+
const nextBounds: PortalHostBounds = {
|
|
24
|
+
...bounds,
|
|
25
|
+
scroll: cloneScrollMetadataState(bounds.scroll),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
portalHostBounds.set((state) => {
|
|
29
|
+
"worklet";
|
|
30
|
+
return {
|
|
31
|
+
...state,
|
|
32
|
+
[hostKey]: nextBounds,
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const clearPortalHostBounds = (hostKey: string) => {
|
|
38
|
+
"worklet";
|
|
39
|
+
portalHostBounds.set((state) => {
|
|
40
|
+
"worklet";
|
|
41
|
+
const nextState: PortalHostBoundsState = { ...state };
|
|
42
|
+
delete nextState[hostKey];
|
|
43
|
+
return nextState;
|
|
44
|
+
});
|
|
45
|
+
};
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
import { makeMutable } from "react-native-reanimated";
|
|
3
|
+
import type { SourceHostRef } from "../../../../stores/bounds/types";
|
|
4
|
+
|
|
5
|
+
export type HostRegistration = {
|
|
6
|
+
hostKey: string;
|
|
7
|
+
screenKey: string;
|
|
8
|
+
fallback: boolean;
|
|
9
|
+
capturesScroll: boolean;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type HostRegistrySnapshot = Record<string, string>;
|
|
13
|
+
|
|
14
|
+
const EMPTY_SNAPSHOT: HostRegistrySnapshot = {};
|
|
15
|
+
|
|
16
|
+
const listeners = new Set<() => void>();
|
|
17
|
+
const hostStacks = new Map<string, HostRegistration[]>();
|
|
18
|
+
|
|
19
|
+
let snapshot: HostRegistrySnapshot = EMPTY_SNAPSHOT;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* UI-readable mirror of each screen's active host, kept only for hosts that
|
|
23
|
+
* capture scroll. Measurement worklets read it to record which scroll-scoped
|
|
24
|
+
* host a source boundary originated from — at measure time, without any React
|
|
25
|
+
* subscription on the boundary itself.
|
|
26
|
+
*/
|
|
27
|
+
const activeScrollHosts = makeMutable<Record<string, SourceHostRef>>({});
|
|
28
|
+
|
|
29
|
+
const getActiveHostFromStack = (
|
|
30
|
+
screenKey: string,
|
|
31
|
+
stack: HostRegistration[] | undefined,
|
|
32
|
+
) => {
|
|
33
|
+
if (!stack || stack.length === 0) {
|
|
34
|
+
return screenKey;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
for (let index = stack.length - 1; index >= 0; index--) {
|
|
38
|
+
const host = stack[index];
|
|
39
|
+
if (!host.fallback) {
|
|
40
|
+
return host.hostKey;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return stack[0]?.hostKey ?? screenKey;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const buildSnapshot = (): HostRegistrySnapshot => {
|
|
48
|
+
const nextSnapshot: HostRegistrySnapshot = {};
|
|
49
|
+
|
|
50
|
+
for (const [screenKey, stack] of hostStacks) {
|
|
51
|
+
nextSnapshot[screenKey] = getActiveHostFromStack(screenKey, stack);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return nextSnapshot;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
const buildScrollHostSnapshot = (): Record<string, SourceHostRef> => {
|
|
58
|
+
const nextSnapshot: Record<string, SourceHostRef> = {};
|
|
59
|
+
|
|
60
|
+
for (const [screenKey, stack] of hostStacks) {
|
|
61
|
+
const activeHostKey = getActiveHostFromStack(screenKey, stack);
|
|
62
|
+
const activeHost = stack.find((host) => host.hostKey === activeHostKey);
|
|
63
|
+
|
|
64
|
+
if (activeHost?.capturesScroll) {
|
|
65
|
+
nextSnapshot[screenKey] = {
|
|
66
|
+
hostKey: activeHost.hostKey,
|
|
67
|
+
capturesScroll: true,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return nextSnapshot;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const emit = () => {
|
|
76
|
+
snapshot = buildSnapshot();
|
|
77
|
+
activeScrollHosts.set(buildScrollHostSnapshot());
|
|
78
|
+
|
|
79
|
+
for (const listener of listeners) {
|
|
80
|
+
listener();
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const subscribe = (listener: () => void) => {
|
|
85
|
+
listeners.add(listener);
|
|
86
|
+
|
|
87
|
+
return () => {
|
|
88
|
+
listeners.delete(listener);
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const registerHost = (registration: HostRegistration) => {
|
|
93
|
+
const stack = hostStacks.get(registration.screenKey) ?? [];
|
|
94
|
+
const previousActiveHostKey = getActiveHostFromStack(
|
|
95
|
+
registration.screenKey,
|
|
96
|
+
stack,
|
|
97
|
+
);
|
|
98
|
+
const nextStack = stack.filter(
|
|
99
|
+
(host) => host.hostKey !== registration.hostKey,
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
if (registration.fallback) {
|
|
103
|
+
nextStack.unshift(registration);
|
|
104
|
+
} else {
|
|
105
|
+
nextStack.push(registration);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
hostStacks.set(registration.screenKey, nextStack);
|
|
109
|
+
|
|
110
|
+
if (
|
|
111
|
+
previousActiveHostKey ===
|
|
112
|
+
getActiveHostFromStack(registration.screenKey, nextStack)
|
|
113
|
+
) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
emit();
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const unregisterHost = (screenKey: string, hostKey: string) => {
|
|
121
|
+
const stack = hostStacks.get(screenKey);
|
|
122
|
+
if (!stack) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const previousActiveHostKey = getActiveHostFromStack(screenKey, stack);
|
|
127
|
+
const nextStack = stack.filter((host) => host.hostKey !== hostKey);
|
|
128
|
+
|
|
129
|
+
if (nextStack.length === 0) {
|
|
130
|
+
hostStacks.delete(screenKey);
|
|
131
|
+
} else {
|
|
132
|
+
hostStacks.set(screenKey, nextStack);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (previousActiveHostKey === getActiveHostFromStack(screenKey, nextStack)) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
emit();
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export const getActiveHostKey = (screenKey: string) => {
|
|
143
|
+
return snapshot[screenKey] ?? screenKey;
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* The screen's active host, if it captures scroll. Worklet-safe: measurement
|
|
148
|
+
* code calls this on the UI thread while writing source bounds.
|
|
149
|
+
*/
|
|
150
|
+
export const getActiveScrollHost = (
|
|
151
|
+
screenKey: string,
|
|
152
|
+
): SourceHostRef | null => {
|
|
153
|
+
"worklet";
|
|
154
|
+
return activeScrollHosts.get()[screenKey] ?? null;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export const getHostCapturesScroll = (hostKey: string) => {
|
|
158
|
+
for (const stack of hostStacks.values()) {
|
|
159
|
+
const host = stack.find((registration) => registration.hostKey === hostKey);
|
|
160
|
+
|
|
161
|
+
if (host) {
|
|
162
|
+
return host.capturesScroll;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return false;
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
export const useActiveHostKey = (screenKey?: string | null) => {
|
|
170
|
+
return useSyncExternalStore(
|
|
171
|
+
subscribe,
|
|
172
|
+
() => (screenKey ? getActiveHostKey(screenKey) : undefined),
|
|
173
|
+
() => undefined,
|
|
174
|
+
);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
export const resetHostRegistry = () => {
|
|
178
|
+
hostStacks.clear();
|
|
179
|
+
snapshot = EMPTY_SNAPSHOT;
|
|
180
|
+
activeScrollHosts.set({});
|
|
181
|
+
emit();
|
|
182
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { useSyncExternalStore } from "react";
|
|
2
|
+
|
|
3
|
+
export type ActivePortalBoundaryHost = {
|
|
4
|
+
boundaryId: string;
|
|
5
|
+
capturesScroll: boolean;
|
|
6
|
+
hostKey: string;
|
|
7
|
+
pairKey: string;
|
|
8
|
+
screenKey: string;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type PortalSnapshot = {
|
|
12
|
+
hostsByScope: Record<string, ActivePortalBoundaryHost[]>;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const EMPTY_HOSTS: ActivePortalBoundaryHost[] = [];
|
|
16
|
+
|
|
17
|
+
const listeners = new Set<() => void>();
|
|
18
|
+
const activeBoundaryHosts = new Map<string, ActivePortalBoundaryHost>();
|
|
19
|
+
|
|
20
|
+
let snapshot: PortalSnapshot = {
|
|
21
|
+
hostsByScope: {},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const buildSnapshot = (): PortalSnapshot => {
|
|
25
|
+
const hostsByScope: Record<string, ActivePortalBoundaryHost[]> = {};
|
|
26
|
+
|
|
27
|
+
for (const host of activeBoundaryHosts.values()) {
|
|
28
|
+
const hosts = hostsByScope[host.hostKey] ?? [];
|
|
29
|
+
hosts.push(host);
|
|
30
|
+
hostsByScope[host.hostKey] = hosts;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
hostsByScope,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const emit = () => {
|
|
39
|
+
snapshot = buildSnapshot();
|
|
40
|
+
|
|
41
|
+
for (const listener of listeners) {
|
|
42
|
+
listener();
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
const isSameHost = (
|
|
47
|
+
a: ActivePortalBoundaryHost,
|
|
48
|
+
b: ActivePortalBoundaryHost,
|
|
49
|
+
) => {
|
|
50
|
+
return (
|
|
51
|
+
a.boundaryId === b.boundaryId &&
|
|
52
|
+
a.capturesScroll === b.capturesScroll &&
|
|
53
|
+
a.hostKey === b.hostKey &&
|
|
54
|
+
a.pairKey === b.pairKey &&
|
|
55
|
+
a.screenKey === b.screenKey
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
export const mountPortalBoundaryHost = (host: ActivePortalBoundaryHost) => {
|
|
60
|
+
const previous = activeBoundaryHosts.get(host.boundaryId);
|
|
61
|
+
if (previous && isSameHost(previous, host)) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
activeBoundaryHosts.set(host.boundaryId, host);
|
|
66
|
+
emit();
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const unmountPortalBoundaryHost = (boundaryId: string) => {
|
|
70
|
+
if (!activeBoundaryHosts.delete(boundaryId)) {
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
emit();
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
const subscribe = (listener: () => void) => {
|
|
78
|
+
listeners.add(listener);
|
|
79
|
+
|
|
80
|
+
return () => {
|
|
81
|
+
listeners.delete(listener);
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const useActivePortalBoundaryHosts = (hostKey: string) => {
|
|
86
|
+
return useSyncExternalStore(
|
|
87
|
+
subscribe,
|
|
88
|
+
() => snapshot.hostsByScope[hostKey] ?? EMPTY_HOSTS,
|
|
89
|
+
() => EMPTY_HOSTS,
|
|
90
|
+
);
|
|
91
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `react-native-teleport` is an optional peer dependency. The require sits in a
|
|
5
|
+
* try/catch so Metro treats it as an optional dependency — an absent module no
|
|
6
|
+
* longer fails the bundle, it throws at runtime and the catch swallows it.
|
|
7
|
+
*
|
|
8
|
+
* When teleport is missing, `portal`-enabled boundaries degrade to inline
|
|
9
|
+
* rendering; everything else keeps working.
|
|
10
|
+
*/
|
|
11
|
+
let mod: any = null;
|
|
12
|
+
try {
|
|
13
|
+
mod = require("react-native-teleport");
|
|
14
|
+
} catch {}
|
|
15
|
+
|
|
16
|
+
export const isTeleportAvailable = mod !== null;
|
|
17
|
+
export const NativePortal: ComponentType<any> | null = mod?.Portal ?? null;
|
|
18
|
+
export const NativePortalProvider: ComponentType<any> | null =
|
|
19
|
+
mod?.PortalProvider ?? null;
|
|
20
|
+
export const NativePortalHost: ComponentType<any> | null =
|
|
21
|
+
mod?.PortalHost ?? null;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { BoundaryPortalAttachTarget } from "../../types";
|
|
2
|
+
|
|
3
|
+
export type PortalAttachment = {
|
|
4
|
+
matchedScreenKey: string;
|
|
5
|
+
pairKey: string;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
type ResolvePortalAttachmentTargetsParams = {
|
|
9
|
+
attachment: PortalAttachment | null;
|
|
10
|
+
currentScreenKey: string;
|
|
11
|
+
nextScreenKey?: string;
|
|
12
|
+
portalAttachTarget: BoundaryPortalAttachTarget;
|
|
13
|
+
sourcePairKey?: string;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export const resolvePortalAttachmentTargets = ({
|
|
17
|
+
attachment,
|
|
18
|
+
currentScreenKey,
|
|
19
|
+
nextScreenKey,
|
|
20
|
+
portalAttachTarget,
|
|
21
|
+
sourcePairKey,
|
|
22
|
+
}: ResolvePortalAttachmentTargetsParams) => {
|
|
23
|
+
const hasCurrentAttachment = attachment?.pairKey === sourcePairKey;
|
|
24
|
+
|
|
25
|
+
if (!hasCurrentAttachment || !attachment) {
|
|
26
|
+
return {
|
|
27
|
+
progressScreenKey: null,
|
|
28
|
+
targetScreenKey: null,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// Matched-screen portals physically live in the matched destination host. If a
|
|
33
|
+
// closing destination is skipped by descriptor resolution, its own progress
|
|
34
|
+
// still owns the attach gate until this attachment is replaced or cleared.
|
|
35
|
+
if (portalAttachTarget === "matched-screen") {
|
|
36
|
+
return {
|
|
37
|
+
progressScreenKey: attachment.matchedScreenKey,
|
|
38
|
+
targetScreenKey: attachment.matchedScreenKey,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Current-screen portals stay mounted in this screen's host, but the visual
|
|
43
|
+
// handoff is still paced by the adjacent destination transition.
|
|
44
|
+
return {
|
|
45
|
+
progressScreenKey: nextScreenKey ?? null,
|
|
46
|
+
targetScreenKey: currentScreenKey,
|
|
47
|
+
};
|
|
48
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const PORTAL_HOST_NAME_RESET_VALUE = null;
|
|
2
|
+
const PORTAL_HOST_NAME_SUFFIX = "-portal-host";
|
|
3
|
+
|
|
4
|
+
export const createPortalBoundaryHostName = (
|
|
5
|
+
hostKey: string,
|
|
6
|
+
boundaryId: string,
|
|
7
|
+
) => {
|
|
8
|
+
"worklet";
|
|
9
|
+
return `${hostKey}-${boundaryId}${PORTAL_HOST_NAME_SUFFIX}`;
|
|
10
|
+
};
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import {
|
|
2
|
+
interpolate,
|
|
3
|
+
type MeasuredDimensions,
|
|
4
|
+
type StyleProps,
|
|
5
|
+
} from "react-native-reanimated";
|
|
6
|
+
import { getClampedScrollAxisDelta } from "../../../../stores/scroll.store";
|
|
7
|
+
import type { ScrollMetadataState } from "../../../../types/gesture.types";
|
|
8
|
+
import { getPortalHostBounds } from "../stores/host-bounds.store";
|
|
9
|
+
|
|
10
|
+
export type PortalOffsetPlacement =
|
|
11
|
+
| "same-screen"
|
|
12
|
+
| "cross-screen-open"
|
|
13
|
+
| "cross-screen-close";
|
|
14
|
+
|
|
15
|
+
type ResolvePortalOffsetStyleParams = {
|
|
16
|
+
alignHostToBoundsScroll?: boolean;
|
|
17
|
+
bounds: MeasuredDimensions;
|
|
18
|
+
boundsCurrentScroll?: ScrollMetadataState | null;
|
|
19
|
+
/**
|
|
20
|
+
* Express the source rect in its scroll host's live frame: the rect is
|
|
21
|
+
* shifted by the clamped travel of `sourceCurrentScroll` since the scroll
|
|
22
|
+
* snapshot stored on `bounds`. Independent of the host scroll fallback
|
|
23
|
+
* chain below — that chain compensates the attached host's own scrolling.
|
|
24
|
+
*/
|
|
25
|
+
compensateSourceScroll?: boolean;
|
|
26
|
+
currentScroll?: ScrollMetadataState | null;
|
|
27
|
+
hostCurrentScroll?: ScrollMetadataState | null;
|
|
28
|
+
hostKey: string;
|
|
29
|
+
hostProgress?: number;
|
|
30
|
+
includeScrollOffsets?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The three portal coordinate cases we support:
|
|
33
|
+
*
|
|
34
|
+
* - same-screen: source and host are on the same screen; align the stored
|
|
35
|
+
* host frame to the source measurement's scroll snapshot once.
|
|
36
|
+
* - cross-screen-open: source and host are on different screens; host
|
|
37
|
+
* placement is static during the open/idle portion.
|
|
38
|
+
* - cross-screen-close: source and host are on different screens; the
|
|
39
|
+
* dismissal needs the host's live scroll frame until the portal detaches.
|
|
40
|
+
*/
|
|
41
|
+
placement?: PortalOffsetPlacement;
|
|
42
|
+
position?: "absolute" | "relative";
|
|
43
|
+
sourceCurrentScroll?: ScrollMetadataState | null;
|
|
44
|
+
trackSourceScroll?: boolean;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export const resolvePortalOffsetStyle = ({
|
|
48
|
+
alignHostToBoundsScroll = false,
|
|
49
|
+
bounds,
|
|
50
|
+
boundsCurrentScroll,
|
|
51
|
+
compensateSourceScroll = false,
|
|
52
|
+
currentScroll,
|
|
53
|
+
hostCurrentScroll,
|
|
54
|
+
hostKey,
|
|
55
|
+
hostProgress = 0,
|
|
56
|
+
includeScrollOffsets = true,
|
|
57
|
+
placement,
|
|
58
|
+
position = "relative",
|
|
59
|
+
sourceCurrentScroll,
|
|
60
|
+
trackSourceScroll = false,
|
|
61
|
+
}: ResolvePortalOffsetStyleParams): StyleProps => {
|
|
62
|
+
"worklet";
|
|
63
|
+
const hostBounds = getPortalHostBounds(hostKey);
|
|
64
|
+
const shouldAlignHostToBoundsScroll = placement
|
|
65
|
+
? placement === "same-screen"
|
|
66
|
+
: alignHostToBoundsScroll;
|
|
67
|
+
const shouldCompensateSourceScroll =
|
|
68
|
+
trackSourceScroll || compensateSourceScroll;
|
|
69
|
+
const shouldIncludeHostScrollOffsets = placement
|
|
70
|
+
? placement === "cross-screen-close"
|
|
71
|
+
: includeScrollOffsets;
|
|
72
|
+
const boundsScrollSnapshot =
|
|
73
|
+
(bounds as { scroll?: ScrollMetadataState | null }).scroll ?? null;
|
|
74
|
+
const sourceScrollSnapshot = shouldCompensateSourceScroll
|
|
75
|
+
? boundsScrollSnapshot
|
|
76
|
+
: null;
|
|
77
|
+
const sourceScrollDeltaX = shouldCompensateSourceScroll
|
|
78
|
+
? getClampedScrollAxisDelta(
|
|
79
|
+
sourceCurrentScroll ?? null,
|
|
80
|
+
sourceScrollSnapshot,
|
|
81
|
+
"horizontal",
|
|
82
|
+
)
|
|
83
|
+
: 0;
|
|
84
|
+
const sourceScrollDeltaY = shouldCompensateSourceScroll
|
|
85
|
+
? getClampedScrollAxisDelta(
|
|
86
|
+
sourceCurrentScroll ?? null,
|
|
87
|
+
sourceScrollSnapshot,
|
|
88
|
+
"vertical",
|
|
89
|
+
)
|
|
90
|
+
: 0;
|
|
91
|
+
const sourcePageX = bounds.pageX - sourceScrollDeltaX;
|
|
92
|
+
const sourcePageY = bounds.pageY - sourceScrollDeltaY;
|
|
93
|
+
const boundsScroll = shouldIncludeHostScrollOffsets
|
|
94
|
+
? (boundsScrollSnapshot ?? boundsCurrentScroll ?? currentScroll ?? null)
|
|
95
|
+
: null;
|
|
96
|
+
const hostBoundsScrollSnapshot = hostBounds?.scroll ?? null;
|
|
97
|
+
const hostBoundsScroll = shouldIncludeHostScrollOffsets
|
|
98
|
+
? hostBoundsScrollSnapshot
|
|
99
|
+
: null;
|
|
100
|
+
const resolvedHostCurrentScroll =
|
|
101
|
+
hostCurrentScroll ?? boundsScroll ?? hostBoundsScroll ?? null;
|
|
102
|
+
const hostSnapshotDeltaX =
|
|
103
|
+
shouldAlignHostToBoundsScroll && !shouldIncludeHostScrollOffsets
|
|
104
|
+
? getClampedScrollAxisDelta(
|
|
105
|
+
boundsScrollSnapshot,
|
|
106
|
+
hostBoundsScrollSnapshot,
|
|
107
|
+
"horizontal",
|
|
108
|
+
)
|
|
109
|
+
: 0;
|
|
110
|
+
const hostSnapshotDeltaY =
|
|
111
|
+
shouldAlignHostToBoundsScroll && !shouldIncludeHostScrollOffsets
|
|
112
|
+
? getClampedScrollAxisDelta(
|
|
113
|
+
boundsScrollSnapshot,
|
|
114
|
+
hostBoundsScrollSnapshot,
|
|
115
|
+
"vertical",
|
|
116
|
+
)
|
|
117
|
+
: 0;
|
|
118
|
+
// Deltas are clamped to the layout range: iOS rubber-band offsets are
|
|
119
|
+
// outside the real scroll range and must not become coordinate-space deltas.
|
|
120
|
+
const hostScrollDeltaX = getClampedScrollAxisDelta(
|
|
121
|
+
resolvedHostCurrentScroll,
|
|
122
|
+
hostBoundsScroll,
|
|
123
|
+
"horizontal",
|
|
124
|
+
);
|
|
125
|
+
const hostScrollDeltaY = getClampedScrollAxisDelta(
|
|
126
|
+
resolvedHostCurrentScroll,
|
|
127
|
+
hostBoundsScroll,
|
|
128
|
+
"vertical",
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
const adjustedHostPageX = hostBounds
|
|
132
|
+
? hostBounds.pageX -
|
|
133
|
+
hostSnapshotDeltaX -
|
|
134
|
+
interpolate(hostProgress, [0, 1], [hostScrollDeltaX, 0])
|
|
135
|
+
: 0;
|
|
136
|
+
const adjustedHostPageY = hostBounds
|
|
137
|
+
? hostBounds.pageY -
|
|
138
|
+
hostSnapshotDeltaY -
|
|
139
|
+
interpolate(hostProgress, [0, 1], [hostScrollDeltaY, 0])
|
|
140
|
+
: 0;
|
|
141
|
+
const boundsScrollDeltaX = shouldIncludeHostScrollOffsets
|
|
142
|
+
? getClampedScrollAxisDelta(
|
|
143
|
+
currentScroll ?? null,
|
|
144
|
+
boundsScroll,
|
|
145
|
+
"horizontal",
|
|
146
|
+
)
|
|
147
|
+
: 0;
|
|
148
|
+
const boundsScrollDeltaY = shouldIncludeHostScrollOffsets
|
|
149
|
+
? getClampedScrollAxisDelta(currentScroll ?? null, boundsScroll, "vertical")
|
|
150
|
+
: 0;
|
|
151
|
+
const offsetX = hostBounds
|
|
152
|
+
? sourcePageX - adjustedHostPageX
|
|
153
|
+
: sourcePageX - boundsScrollDeltaX;
|
|
154
|
+
const offsetY = hostBounds
|
|
155
|
+
? sourcePageY - adjustedHostPageY
|
|
156
|
+
: sourcePageY - boundsScrollDeltaY;
|
|
157
|
+
const transform = [{ translateY: offsetY }, { translateX: offsetX }];
|
|
158
|
+
|
|
159
|
+
if (position === "absolute") {
|
|
160
|
+
return {
|
|
161
|
+
left: 0,
|
|
162
|
+
position: "absolute",
|
|
163
|
+
top: 0,
|
|
164
|
+
transform,
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return {
|
|
169
|
+
transform,
|
|
170
|
+
};
|
|
171
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BoundaryTeleportControl } from "../../../../types/animation.types";
|
|
2
|
+
|
|
3
|
+
export const isTeleportEnabled = (
|
|
4
|
+
teleport: BoundaryTeleportControl | undefined,
|
|
5
|
+
) => {
|
|
6
|
+
"worklet";
|
|
7
|
+
|
|
8
|
+
if (typeof teleport === "boolean") {
|
|
9
|
+
return teleport;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return teleport?.enabled !== false;
|
|
13
|
+
};
|