react-native-screen-transitions 3.8.0-beta.1 → 3.9.0-alpha.0
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 +10 -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 +68 -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 +17 -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 +195 -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/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/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/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/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 +11 -25
- 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 +63 -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 +13 -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 +190 -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/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/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/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/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/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/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/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/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 +3 -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 +20 -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 +90 -0
- package/src/shared/components/boundary/portal/components/portal-provider.tsx +10 -0
- package/src/shared/components/boundary/portal/components/portal.tsx +278 -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/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/index.ts +13 -5
- package/src/shared/providers/helpers/measured-bounds-writes.ts +11 -1
- 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/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/lib/module/shared/components/{create-boundary-component → boundary}/hooks/use-measurer.js
RENAMED
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import { useCallback } from "react";
|
|
4
4
|
import { useWindowDimensions } from "react-native";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { measure } from "react-native-reanimated";
|
|
6
|
+
import { applyMeasuredBoundsWrites } from "../../../providers/helpers/measured-bounds-writes";
|
|
7
|
+
import { useOriginContext } from "../../../providers/screen/origin.provider";
|
|
7
8
|
import { ScrollStore } from "../../../stores/scroll.store";
|
|
8
9
|
import { SystemStore } from "../../../stores/system.store";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
10
|
+
import { getActiveScrollHost } from "../portal/stores/host-registry.store";
|
|
11
|
+
import { attachScrollSnapshotToMeasuredBounds, isMeasurementInViewport, measureWithOverscrollAwareness, normalizeMeasuredBoundsToOrigin } from "../utils/measured-bounds";
|
|
11
12
|
export const useMeasurer = ({
|
|
12
13
|
enabled,
|
|
13
14
|
entryTag,
|
|
@@ -15,25 +16,27 @@ export const useMeasurer = ({
|
|
|
15
16
|
group,
|
|
16
17
|
currentScreenKey,
|
|
17
18
|
preparedStyles,
|
|
18
|
-
measuredAnimatedRef
|
|
19
|
+
measuredAnimatedRef,
|
|
20
|
+
portalHost
|
|
19
21
|
}) => {
|
|
20
22
|
const {
|
|
21
23
|
width: viewportWidth,
|
|
22
24
|
height: viewportHeight
|
|
23
25
|
} = useWindowDimensions();
|
|
24
26
|
const scrollState = ScrollStore.getValue(currentScreenKey, "coordination");
|
|
27
|
+
const scrollMetadata = ScrollStore.getValue(currentScreenKey, "metadata");
|
|
25
28
|
const pendingLifecycleStartBlockCount = SystemStore.getValue(currentScreenKey, "pendingLifecycleStartBlockCount");
|
|
29
|
+
const {
|
|
30
|
+
originRef
|
|
31
|
+
} = useOriginContext();
|
|
26
32
|
return useCallback(target => {
|
|
27
33
|
"worklet";
|
|
28
34
|
|
|
29
35
|
if (!enabled) return;
|
|
30
36
|
const measured = measureWithOverscrollAwareness(measuredAnimatedRef, scrollState.get());
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
// captures can measure while the visibility gate is still blocked.
|
|
35
|
-
const shouldAdjustBlockedDestination = target.type === "destination" && pendingLifecycleStartBlockCount.get() > 0;
|
|
36
|
-
const normalizedMeasured = shouldAdjustBlockedDestination ? applyVisibilityBlockOffset(measured, getVisibilityBlockOffset(viewportHeight)) : measured;
|
|
37
|
+
const measuredOrigin = measure(originRef);
|
|
38
|
+
if (!measured || !measuredOrigin) return;
|
|
39
|
+
const normalizedMeasured = normalizeMeasuredBoundsToOrigin(measured, measuredOrigin);
|
|
37
40
|
|
|
38
41
|
/**
|
|
39
42
|
* - Destination Pass -
|
|
@@ -45,18 +48,19 @@ export const useMeasurer = ({
|
|
|
45
48
|
const shouldGuardDestinationViewport = pendingLifecycleStartBlockCount.get() > 0 || !!group;
|
|
46
49
|
const viewportAllowsDestinationWrite = target.type !== "destination" || !shouldGuardDestinationViewport || isMeasurementInViewport(normalizedMeasured, viewportWidth, viewportHeight);
|
|
47
50
|
if (!viewportAllowsDestinationWrite) return;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
const measuredWithScroll = attachScrollSnapshotToMeasuredBounds(normalizedMeasured, scrollMetadata.get());
|
|
52
|
+
const sourceHost = target.type === "source" ? getActiveScrollHost(currentScreenKey) ?? undefined : undefined;
|
|
53
|
+
applyMeasuredBoundsWrites({
|
|
54
|
+
entryTag,
|
|
55
|
+
linkId,
|
|
56
|
+
group,
|
|
57
|
+
currentScreenKey,
|
|
58
|
+
measured: measuredWithScroll,
|
|
59
|
+
preparedStyles,
|
|
60
|
+
linkWrite: target,
|
|
61
|
+
portalHost,
|
|
62
|
+
sourceHost
|
|
53
63
|
});
|
|
54
|
-
|
|
55
|
-
setSource(target.pairKey, linkId, currentScreenKey, normalizedMeasured, preparedStyles, group);
|
|
56
|
-
}
|
|
57
|
-
if (target.type === "destination") {
|
|
58
|
-
setDestination(target.pairKey, linkId, currentScreenKey, normalizedMeasured, preparedStyles, group);
|
|
59
|
-
}
|
|
60
|
-
}, [enabled, entryTag, linkId, group, currentScreenKey, preparedStyles, measuredAnimatedRef, viewportWidth, viewportHeight, scrollState, pendingLifecycleStartBlockCount]);
|
|
64
|
+
}, [enabled, entryTag, linkId, group, currentScreenKey, preparedStyles, measuredAnimatedRef, portalHost, viewportWidth, viewportHeight, scrollState, scrollMetadata, pendingLifecycleStartBlockCount, originRef]);
|
|
61
65
|
};
|
|
62
66
|
//# sourceMappingURL=use-measurer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useWindowDimensions","measure","applyMeasuredBoundsWrites","useOriginContext","ScrollStore","SystemStore","getActiveScrollHost","attachScrollSnapshotToMeasuredBounds","isMeasurementInViewport","measureWithOverscrollAwareness","normalizeMeasuredBoundsToOrigin","useMeasurer","enabled","entryTag","linkId","group","currentScreenKey","preparedStyles","measuredAnimatedRef","portalHost","width","viewportWidth","height","viewportHeight","scrollState","getValue","scrollMetadata","pendingLifecycleStartBlockCount","originRef","target","measured","get","measuredOrigin","normalizedMeasured","shouldGuardDestinationViewport","viewportAllowsDestinationWrite","type","measuredWithScroll","sourceHost","undefined","linkWrite"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/hooks/use-measurer.ts"],"mappings":";;AAAA,SAASA,WAAW,QAAQ,OAAO;AAEnC,SAASC,mBAAmB,QAAQ,cAAc;AAClD,SAECC,OAAO,QAED,yBAAyB;AAChC,SAASC,yBAAyB,QAAQ,mDAAmD;AAC7F,SAASC,gBAAgB,QAAQ,2CAA2C;AAE5E,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,WAAW,QAAQ,8BAA8B;AAC1D,SAASC,mBAAmB,QAAQ,sCAAsC;AAE1E,SACCC,oCAAoC,EACpCC,uBAAuB,EACvBC,8BAA8B,EAC9BC,+BAA+B,QACzB,0BAA0B;AAajC,OAAO,MAAMC,WAAW,GAAGA,CAAC;EAC3BC,OAAO;EACPC,QAAQ;EACRC,MAAM;EACNC,KAAK;EACLC,gBAAgB;EAChBC,cAAc;EACdC,mBAAmB;EACnBC;AACkB,CAAC,KAAsB;EACzC,MAAM;IAAEC,KAAK,EAAEC,aAAa;IAAEC,MAAM,EAAEC;EAAe,CAAC,GACrDvB,mBAAmB,CAAC,CAAC;EAEtB,MAAMwB,WAAW,GAAGpB,WAAW,CAACqB,QAAQ,CAACT,gBAAgB,EAAE,cAAc,CAAC;EAC1E,MAAMU,cAAc,GAAGtB,WAAW,CAACqB,QAAQ,CAACT,gBAAgB,EAAE,UAAU,CAAC;EACzE,MAAMW,+BAA+B,GAAGtB,WAAW,CAACoB,QAAQ,CAC3DT,gBAAgB,EAChB,iCACD,CAAC;EACD,MAAM;IAAEY;EAAU,CAAC,GAAGzB,gBAAgB,CAAC,CAAC;EAExC,OAAOJ,WAAW,CAChB8B,MAAM,IAAK;IACX,SAAS;;IACT,IAAI,CAACjB,OAAO,EAAE;IAEd,MAAMkB,QAAQ,GAAGrB,8BAA8B,CAC9CS,mBAAmB,EACnBM,WAAW,CAACO,GAAG,CAAC,CACjB,CAAC;IACD,MAAMC,cAAc,GAAG/B,OAAO,CAAC2B,SAAS,CAAC;IAEzC,IAAI,CAACE,QAAQ,IAAI,CAACE,cAAc,EAAE;IAElC,MAAMC,kBAAkB,GAAGvB,+BAA+B,CACzDoB,QAAQ,EACRE,cACD,CAAC;;IAED;AACH;AACA;AACA;AACA;AACA;AACA;IACG,MAAME,8BAA8B,GACnCP,+BAA+B,CAACI,GAAG,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAChB,KAAK;IAErD,MAAMoB,8BAA8B,GACnCN,MAAM,CAACO,IAAI,KAAK,aAAa,IAC7B,CAACF,8BAA8B,IAC/B1B,uBAAuB,CACtByB,kBAAkB,EAClBZ,aAAa,EACbE,cACD,CAAC;IAEF,IAAI,CAACY,8BAA8B,EAAE;IAErC,MAAME,kBAAkB,GAAG9B,oCAAoC,CAC9D0B,kBAAkB,EAClBP,cAAc,CAACK,GAAG,CAAC,CACpB,CAAC;IACD,MAAMO,UAAU,GACfT,MAAM,CAACO,IAAI,KAAK,QAAQ,GACpB9B,mBAAmB,CAACU,gBAAgB,CAAC,IAAIuB,SAAS,GACnDA,SAAS;IAEbrC,yBAAyB,CAAC;MACzBW,QAAQ;MACRC,MAAM;MACNC,KAAK;MACLC,gBAAgB;MAChBc,QAAQ,EAAEO,kBAAkB;MAC5BpB,cAAc;MACduB,SAAS,EAAEX,MAAM;MACjBV,UAAU;MACVmB;IACD,CAAC,CAAC;EACH,CAAC,EACD,CACC1B,OAAO,EACPC,QAAQ,EACRC,MAAM,EACNC,KAAK,EACLC,gBAAgB,EAChBC,cAAc,EACdC,mBAAmB,EACnBC,UAAU,EACVE,aAAa,EACbE,cAAc,EACdC,WAAW,EACXE,cAAc,EACdC,+BAA+B,EAC/BC,SAAS,CAEX,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { useAnimatedReaction } from "react-native-reanimated";
|
|
4
|
+
import { useDescriptorsStore } from "../../../providers/screen/descriptors";
|
|
4
5
|
import { AnimationStore } from "../../../stores/animation.store";
|
|
5
6
|
import { pairs } from "../../../stores/bounds/internals/state";
|
|
6
7
|
import { getRefreshBoundarySignal } from "../utils/refresh-signals";
|
|
7
8
|
export const useRefreshBoundary = ({
|
|
8
9
|
enabled,
|
|
9
|
-
currentScreenKey,
|
|
10
|
-
preferredSourceScreenKey,
|
|
11
|
-
nextScreenKey,
|
|
12
10
|
linkId,
|
|
13
11
|
group,
|
|
14
|
-
ancestorScreenKeys,
|
|
15
12
|
measureBoundary
|
|
16
13
|
}) => {
|
|
14
|
+
const currentScreenKey = useDescriptorsStore(s => s.derivations.currentScreenKey);
|
|
15
|
+
const nextScreenKey = useDescriptorsStore(s => s.derivations.nextScreenKey);
|
|
16
|
+
const sourcePairKey = useDescriptorsStore(s => s.derivations.sourcePairKey);
|
|
17
|
+
const destinationPairKey = useDescriptorsStore(s => s.derivations.destinationPairKey);
|
|
18
|
+
const ancestorDestinationPairKey = useDescriptorsStore(s => s.derivations.ancestorDestinationPairKey);
|
|
17
19
|
// Source-side boundaries refresh from the next screen's lifecycle pulse.
|
|
18
20
|
// Destination-side boundaries have no next screen, so they refresh from self.
|
|
19
21
|
const refreshScreenKey = nextScreenKey ?? currentScreenKey;
|
|
@@ -28,17 +30,18 @@ export const useRefreshBoundary = ({
|
|
|
28
30
|
return getRefreshBoundarySignal({
|
|
29
31
|
enabled,
|
|
30
32
|
currentScreenKey,
|
|
31
|
-
|
|
33
|
+
sourcePairKey,
|
|
34
|
+
destinationPairKey,
|
|
35
|
+
ancestorDestinationPairKey,
|
|
32
36
|
nextScreenKey,
|
|
33
37
|
linkId,
|
|
34
38
|
group,
|
|
35
|
-
ancestorScreenKeys,
|
|
36
39
|
shouldRefresh: !!refreshWillAnimate.get(),
|
|
37
40
|
closing: !!refreshClosing.get(),
|
|
38
41
|
entering: !!refreshEntering.get(),
|
|
39
42
|
animating: !!refreshAnimating.get(),
|
|
40
43
|
progress: refreshProgress.get(),
|
|
41
|
-
linkState:
|
|
44
|
+
linkState: pairs.get()
|
|
42
45
|
});
|
|
43
46
|
}, (refreshSignal, prevRefreshSignal) => {
|
|
44
47
|
"worklet";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useAnimatedReaction","useDescriptorsStore","AnimationStore","pairs","getRefreshBoundarySignal","useRefreshBoundary","enabled","linkId","group","measureBoundary","currentScreenKey","s","derivations","nextScreenKey","sourcePairKey","destinationPairKey","ancestorDestinationPairKey","refreshScreenKey","refreshWillAnimate","getValue","refreshClosing","refreshEntering","refreshAnimating","refreshProgress","shouldRefresh","get","closing","entering","animating","progress","linkState","refreshSignal","prevRefreshSignal","signal","type","pairKey"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/hooks/use-refresh-boundary.ts"],"mappings":";;AAAA,SAASA,mBAAmB,QAAQ,yBAAyB;AAC7D,SAASC,mBAAmB,QAAQ,uCAAuC;AAC3E,SAASC,cAAc,QAAQ,iCAAiC;AAChE,SAASC,KAAK,QAAQ,wCAAwC;AAE9D,SAASC,wBAAwB,QAAQ,0BAA0B;AASnE,OAAO,MAAMC,kBAAkB,GAAGA,CAAC;EAClCC,OAAO;EACPC,MAAM;EACNC,KAAK;EACLC;AACyB,CAAC,KAAK;EAC/B,MAAMC,gBAAgB,GAAGT,mBAAmB,CAC1CU,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACF,gBACtB,CAAC;EACD,MAAMG,aAAa,GAAGZ,mBAAmB,CAAEU,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACC,aAAa,CAAC;EAC7E,MAAMC,aAAa,GAAGb,mBAAmB,CAAEU,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACE,aAAa,CAAC;EAC7E,MAAMC,kBAAkB,GAAGd,mBAAmB,CAC5CU,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACG,kBACtB,CAAC;EACD,MAAMC,0BAA0B,GAAGf,mBAAmB,CACpDU,CAAC,IAAKA,CAAC,CAACC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AAI,EAAEH,aAAa,CAACG,IAAI;MACxBC,OAAO,EAAEJ,aAAa,CAACI;IACxB,CAAC,CAAC;EACH,CACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { Pressable, View } from "react-native";
|
|
4
4
|
import { BoundaryTarget } from "./components/boundary-target";
|
|
5
5
|
import { createBoundaryComponent } from "./create-boundary-component";
|
|
6
|
+
import { Host } from "./portal";
|
|
6
7
|
export { createBoundaryComponent };
|
|
7
8
|
const BoundaryView = createBoundaryComponent(View, {
|
|
8
9
|
shouldAutoMeasure: true
|
|
@@ -11,6 +12,7 @@ const BoundaryTrigger = createBoundaryComponent(Pressable);
|
|
|
11
12
|
BoundaryView.displayName = "Transition.Boundary.View";
|
|
12
13
|
BoundaryTrigger.displayName = "Transition.Boundary.Trigger";
|
|
13
14
|
BoundaryTarget.displayName = "Transition.Boundary.Target";
|
|
15
|
+
Host.displayName = "Transition.Boundary.Host";
|
|
14
16
|
|
|
15
17
|
/**
|
|
16
18
|
* Shared-boundary components.
|
|
@@ -29,6 +31,7 @@ BoundaryTarget.displayName = "Transition.Boundary.Target";
|
|
|
29
31
|
* - `Boundary.View` for passive/shared elements.
|
|
30
32
|
* - `Boundary.Trigger` for tappable elements that start navigation.
|
|
31
33
|
* - `Boundary.Target` to measure a nested descendant instead of the owner.
|
|
34
|
+
* - `Boundary.Host` to make nested portal placement explicit.
|
|
32
35
|
*/
|
|
33
36
|
export const Boundary = {
|
|
34
37
|
/**
|
|
@@ -42,6 +45,10 @@ export const Boundary = {
|
|
|
42
45
|
/**
|
|
43
46
|
* Optional nested measurement override inside a boundary owner.
|
|
44
47
|
*/
|
|
45
|
-
Target: BoundaryTarget
|
|
48
|
+
Target: BoundaryTarget,
|
|
49
|
+
/**
|
|
50
|
+
* Explicit portal host for scrollable or otherwise clipped coordinate spaces.
|
|
51
|
+
*/
|
|
52
|
+
Host: Host
|
|
46
53
|
};
|
|
47
54
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Pressable","View","BoundaryTarget","createBoundaryComponent","Host","BoundaryView","shouldAutoMeasure","BoundaryTrigger","displayName","Boundary","Trigger","Target"],"sourceRoot":"../../../../../src","sources":["shared/components/boundary/index.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,IAAI,QAAQ,cAAc;AAC9C,SAASC,cAAc,QAAQ,8BAA8B;AAC7D,SAASC,uBAAuB,QAAQ,6BAA6B;AACrE,SAASC,IAAI,QAAQ,UAAU;AAO/B,SAASD,uBAAuB;AAEhC,MAAME,YAAY,GAAGF,uBAAuB,CAACF,IAAI,EAAE;EAClDK,iBAAiB,EAAE;AACpB,CAAC,CAAC;AACF,MAAMC,eAAe,GAAGJ,uBAAuB,CAACH,SAAS,CAAC;AAC1DK,YAAY,CAACG,WAAW,GAAG,0BAA0B;AACrDD,eAAe,CAACC,WAAW,GAAG,6BAA6B;AAC3DN,cAAc,CAACM,WAAW,GAAG,4BAA4B;AACzDJ,IAAI,CAACI,WAAW,GAAG,0BAA0B;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAG;EACvB;AACD;AACA;EACCR,IAAI,EAAEI,YAAY;EAClB;AACD;AACA;EACCK,OAAO,EAAEH,eAAe;EACxB;AACD;AACA;EACCI,MAAM,EAAET,cAAc;EACtB;AACD;AACA;EACCE,IAAI,EAAEA;AACP,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { memo, useLayoutEffect, useRef } from "react";
|
|
4
|
+
import { StyleSheet, useWindowDimensions, View } from "react-native";
|
|
5
|
+
import Animated from "react-native-reanimated";
|
|
6
|
+
import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
|
|
7
|
+
import { useHostMeasurement } from "../hooks/use-host-measurement";
|
|
8
|
+
import { registerHost, unregisterHost } from "../stores/host-registry.store";
|
|
9
|
+
import { useActivePortalBoundaryHosts } from "../stores/portal-boundary-host.store";
|
|
10
|
+
import { PortalBoundaryHost } from "./portal-boundary-host";
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
+
let nextHostId = 0;
|
|
13
|
+
function HostImpl({
|
|
14
|
+
fallback = false,
|
|
15
|
+
style
|
|
16
|
+
}) {
|
|
17
|
+
const screenKey = useDescriptorsStore(s => s.derivations.currentScreenKey);
|
|
18
|
+
const generatedHostKeyRef = useRef(null);
|
|
19
|
+
if (generatedHostKeyRef.current === null) {
|
|
20
|
+
generatedHostKeyRef.current = `${screenKey}-host-${nextHostId++}`;
|
|
21
|
+
}
|
|
22
|
+
const hostKey = fallback ? screenKey : generatedHostKeyRef.current;
|
|
23
|
+
const capturesScroll = !fallback;
|
|
24
|
+
const activeBoundaryHosts = useActivePortalBoundaryHosts(hostKey);
|
|
25
|
+
const {
|
|
26
|
+
height: viewportHeight,
|
|
27
|
+
width: viewportWidth
|
|
28
|
+
} = useWindowDimensions();
|
|
29
|
+
const measurement = useHostMeasurement({
|
|
30
|
+
capturesScroll,
|
|
31
|
+
enabled: activeBoundaryHosts.length > 0,
|
|
32
|
+
hostKey,
|
|
33
|
+
screenKey
|
|
34
|
+
});
|
|
35
|
+
useLayoutEffect(() => {
|
|
36
|
+
registerHost({
|
|
37
|
+
capturesScroll,
|
|
38
|
+
fallback,
|
|
39
|
+
hostKey,
|
|
40
|
+
screenKey
|
|
41
|
+
});
|
|
42
|
+
return () => {
|
|
43
|
+
unregisterHost(screenKey, hostKey);
|
|
44
|
+
};
|
|
45
|
+
}, [capturesScroll, fallback, hostKey, screenKey]);
|
|
46
|
+
const boundaryHosts = measurement.canRenderHosts ? activeBoundaryHosts.map(host => /*#__PURE__*/_jsx(View, {
|
|
47
|
+
pointerEvents: "box-none",
|
|
48
|
+
style: [styles.boundaryHostViewport, {
|
|
49
|
+
width: viewportWidth,
|
|
50
|
+
height: viewportHeight
|
|
51
|
+
}],
|
|
52
|
+
children: /*#__PURE__*/_jsx(PortalBoundaryHost, {
|
|
53
|
+
host: host,
|
|
54
|
+
style: StyleSheet.absoluteFill
|
|
55
|
+
})
|
|
56
|
+
}, host.boundaryId)) : null;
|
|
57
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
58
|
+
ref: measurement.hostRef,
|
|
59
|
+
pointerEvents: "box-none",
|
|
60
|
+
style: [styles.host, {
|
|
61
|
+
width: viewportWidth,
|
|
62
|
+
height: viewportHeight
|
|
63
|
+
}, style],
|
|
64
|
+
collapsable: false,
|
|
65
|
+
children: boundaryHosts
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
export const Host = /*#__PURE__*/memo(function Host(props) {
|
|
69
|
+
return /*#__PURE__*/_jsx(HostImpl, {
|
|
70
|
+
...props
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
export const ScreenFallbackHost = /*#__PURE__*/memo(function ScreenFallbackHost() {
|
|
74
|
+
return /*#__PURE__*/_jsx(HostImpl, {
|
|
75
|
+
fallback: true
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
const styles = StyleSheet.create({
|
|
79
|
+
host: {
|
|
80
|
+
elevation: 999999,
|
|
81
|
+
left: 0,
|
|
82
|
+
overflow: "visible",
|
|
83
|
+
position: "absolute",
|
|
84
|
+
top: 0,
|
|
85
|
+
zIndex: 999999
|
|
86
|
+
},
|
|
87
|
+
boundaryHostViewport: {
|
|
88
|
+
left: 0,
|
|
89
|
+
overflow: "visible",
|
|
90
|
+
position: "absolute",
|
|
91
|
+
top: 0
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
//# sourceMappingURL=host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","useLayoutEffect","useRef","StyleSheet","useWindowDimensions","View","Animated","useDescriptorsStore","useHostMeasurement","registerHost","unregisterHost","useActivePortalBoundaryHosts","PortalBoundaryHost","jsx","_jsx","nextHostId","HostImpl","fallback","style","screenKey","s","derivations","currentScreenKey","generatedHostKeyRef","current","hostKey","capturesScroll","activeBoundaryHosts","height","viewportHeight","width","viewportWidth","measurement","enabled","length","boundaryHosts","canRenderHosts","map","host","pointerEvents","styles","boundaryHostViewport","children","absoluteFill","boundaryId","ref","hostRef","collapsable","Host","props","ScreenFallbackHost","create","elevation","left","overflow","position","top","zIndex"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/components/host.tsx"],"mappings":";;AAAA,SAASA,IAAI,EAAEC,eAAe,EAAEC,MAAM,QAAQ,OAAO;AACrD,SAECC,UAAU,EACVC,mBAAmB,EACnBC,IAAI,QAEE,cAAc;AACrB,OAAOC,QAAQ,MAAM,yBAAyB;AAC9C,SAASC,mBAAmB,QAAQ,0CAA0C;AAC9E,SAASC,kBAAkB,QAAQ,+BAA+B;AAClE,SAASC,YAAY,EAAEC,cAAc,QAAQ,+BAA+B;AAC5E,SAASC,4BAA4B,QAAQ,sCAAsC;AACnF,SAASC,kBAAkB,QAAQ,wBAAwB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE5D,IAAIC,UAAU,GAAG,CAAC;AAUlB,SAASC,QAAQA,CAAC;EAAEC,QAAQ,GAAG,KAAK;EAAEC;AAAqB,CAAC,EAAE;EAC7D,MAAMC,SAAS,GAAGZ,mBAAmB,CAAEa,CAAC,IAAKA,CAAC,CAACC,WAAW,CAACC,gBAAgB,CAAC;EAC5E,MAAMC,mBAAmB,GAAGrB,MAAM,CAAgB,IAAI,CAAC;EAEvD,IAAIqB,mBAAmB,CAACC,OAAO,KAAK,IAAI,EAAE;IACzCD,mBAAmB,CAACC,OAAO,GAAG,GAAGL,SAAS,SAASJ,UAAU,EAAE,EAAE;EAClE;EAEA,MAAMU,OAAO,GAAGR,QAAQ,GAAGE,SAAS,GAAGI,mBAAmB,CAACC,OAAO;EAClE,MAAME,cAAc,GAAG,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C,EAChDX,KAAK,CACJ;IACF6B,WAAW,EAAE,KAAM;IAAAL,QAAA,EAElBP;EAAa,CACA,CAAC;AAElB;AAEA,OAAO,MAAMa,IAAI,gBAAGhD,IAAI,CAAC,SAASgD,IAAIA,CAACC,KAAsB,EAAE;EAC9D,oBAAOnC,IAAA,CAACE,QAAQ;IAAA,GAAKiC;EAAK,CAAG,CAAC;AAC/B,CAAC,CAAC;AAEF,OAAO,MAAMC,kBAAkB,gBAAGlD,IAAI,CAAC,SAASkD,kBAAkBA,CAAA,EAAG;EACpE,oBAAOpC,IAAA,CAACE,QAAQ;IAACC,QAAQ;EAAA,CAAE,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAMuB,MAAM,GAAGrC,UAAU,CAACgD,MAAM,CAAC;EAChCb,IAAI,EAAE;IACLc,SAAS,EAAE,MAAM;IACjBC,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE,SAAS;IACnBC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE,CAAC;IACNC,MAAM,EAAE;EACT,CAAC;EACDhB,oBAAoB,EAAE;IACrBY,IAAI,EAAE,CAAC;IACPC,QAAQ,EAAE,SAAS;IACnBC,QAAQ,EAAE,UAAU;IACpBC,GAAG,EAAE;EACN;AACD,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { memo } from "react";
|
|
4
|
+
import Animated, { useAnimatedStyle } from "react-native-reanimated";
|
|
5
|
+
import { PortalHost as NativePortalHost } from "react-native-teleport";
|
|
6
|
+
import { NO_STYLES } from "../../../../constants";
|
|
7
|
+
import { AnimationStore } from "../../../../stores/animation.store";
|
|
8
|
+
import { getSourceScreenKeyFromPairKey } from "../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
9
|
+
import { getLink } from "../../../../stores/bounds/internals/links";
|
|
10
|
+
import { GestureStore } from "../../../../stores/gesture.store";
|
|
11
|
+
import { ScrollStore } from "../../../../stores/scroll.store";
|
|
12
|
+
import { createPortalBoundaryHostName } from "../utils/naming";
|
|
13
|
+
import { resolvePortalOffsetStyle } from "../utils/offset-style";
|
|
14
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
+
const AnimatedPortalBoundaryHost = Animated.createAnimatedComponent(NativePortalHost);
|
|
16
|
+
export const PortalBoundaryHost = /*#__PURE__*/memo(function PortalBoundaryHost({
|
|
17
|
+
host,
|
|
18
|
+
style
|
|
19
|
+
}) {
|
|
20
|
+
const hostName = createPortalBoundaryHostName(host.hostKey, host.boundaryId);
|
|
21
|
+
const hostClosing = AnimationStore.getValue(host.screenKey, "closing");
|
|
22
|
+
const hostProgress = AnimationStore.getValue(host.screenKey, "transitionProgress");
|
|
23
|
+
const hostGestureDismissing = GestureStore.getValue(host.screenKey, "dismissing");
|
|
24
|
+
const hostScrollMetadata = ScrollStore.getValue(host.screenKey, "metadata");
|
|
25
|
+
const sourceScrollMetadata = ScrollStore.getValue(getSourceScreenKeyFromPairKey(host.pairKey), "metadata");
|
|
26
|
+
const hostStyle = useAnimatedStyle(() => {
|
|
27
|
+
"worklet";
|
|
28
|
+
|
|
29
|
+
// Strict per-member lookup — a fallback member's source rect would
|
|
30
|
+
// misplace this host's teleported content.
|
|
31
|
+
const link = getLink(host.pairKey, host.boundaryId);
|
|
32
|
+
if (!link?.source || !link.destination) {
|
|
33
|
+
return NO_STYLES;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Make the coordinate case explicit before resolving the host offset.
|
|
37
|
+
// The resolver owns the math; this component decides which screen/scroll
|
|
38
|
+
// relationship the active portal is in.
|
|
39
|
+
const isCrossScreenPortal = link.source.screenKey !== host.screenKey;
|
|
40
|
+
const isHostClosing = hostClosing.get() === 1 || hostGestureDismissing.get() === 1;
|
|
41
|
+
const placement = !isCrossScreenPortal ? "same-screen" : isHostClosing ? "cross-screen-close" : "cross-screen-open";
|
|
42
|
+
|
|
43
|
+
// A source that originated inside its own scroll host moves with that
|
|
44
|
+
// ScrollView while this portal stays attached over here. Shifting the
|
|
45
|
+
// source rect by the clamped source scroll travel keeps the return
|
|
46
|
+
// landing point on the live placeholder, so the close detach is seamless.
|
|
47
|
+
const trackSourceScroll = isCrossScreenPortal && link.source.sourceHost?.capturesScroll === true;
|
|
48
|
+
return resolvePortalOffsetStyle({
|
|
49
|
+
bounds: link.source.bounds,
|
|
50
|
+
hostCurrentScroll: placement === "cross-screen-close" ? hostScrollMetadata.get() : null,
|
|
51
|
+
hostKey: host.hostKey,
|
|
52
|
+
placement,
|
|
53
|
+
sourceCurrentScroll: trackSourceScroll ? sourceScrollMetadata.get() : null,
|
|
54
|
+
hostProgress: hostProgress.get(),
|
|
55
|
+
trackSourceScroll
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
return /*#__PURE__*/_jsx(AnimatedPortalBoundaryHost, {
|
|
59
|
+
name: hostName,
|
|
60
|
+
style: [style, hostStyle]
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=portal-boundary-host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","Animated","useAnimatedStyle","PortalHost","NativePortalHost","NO_STYLES","AnimationStore","getSourceScreenKeyFromPairKey","getLink","GestureStore","ScrollStore","createPortalBoundaryHostName","resolvePortalOffsetStyle","jsx","_jsx","AnimatedPortalBoundaryHost","createAnimatedComponent","PortalBoundaryHost","host","style","hostName","hostKey","boundaryId","hostClosing","getValue","screenKey","hostProgress","hostGestureDismissing","hostScrollMetadata","sourceScrollMetadata","pairKey","hostStyle","link","source","destination","isCrossScreenPortal","isHostClosing","get","placement","trackSourceScroll","sourceHost","capturesScroll","bounds","hostCurrentScroll","sourceCurrentScroll","name"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/components/portal-boundary-host.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,OAAO;AAE5B,OAAOC,QAAQ,IAAIC,gBAAgB,QAAQ,yBAAy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
|
|
4
|
+
import { PortalProvider as NativePortalProvider } from "react-native-teleport";
|
|
5
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
|
+
export const PortalProvider = /*#__PURE__*/memo(function PortalProvider({
|
|
7
|
+
children
|
|
8
|
+
}) {
|
|
9
|
+
return /*#__PURE__*/_jsx(NativePortalProvider, {
|
|
10
|
+
children: children
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=portal-provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","PortalProvider","NativePortalProvider","jsx","_jsx","children"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/components/portal-provider.tsx"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,OAAO;AAC5B,SAASC,cAAc,IAAIC,oBAAoB,QAAQ,uBAAuB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE/E,OAAO,MAAMH,cAAc,gBAAGD,IAAI,CAAC,SAASC,cAAcA,CAAC;EAC1DI;AAGD,CAAC,EAAE;EACF,oBAAOD,IAAA,CAACF,oBAAoB;IAAAG,QAAA,EAAEA;EAAQ,CAAuB,CAAC;AAC/D,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { memo, useCallback, useLayoutEffect, useState } from "react";
|
|
4
|
+
import Animated, { runOnJS, useAnimatedProps, useAnimatedReaction, useAnimatedStyle, useSharedValue } from "react-native-reanimated";
|
|
5
|
+
import { Portal as NativePortal } from "react-native-teleport";
|
|
6
|
+
import { useDescriptorsStore } from "../../../../providers/screen/descriptors";
|
|
7
|
+
import { useScreenStyles } from "../../../../providers/screen/styles";
|
|
8
|
+
import { AnimationStore } from "../../../../stores/animation.store";
|
|
9
|
+
import { getLinkKeyFromTag } from "../../../../stores/bounds/helpers/link-pairs.helpers";
|
|
10
|
+
import { getLink } from "../../../../stores/bounds/internals/links";
|
|
11
|
+
import { pairs } from "../../../../stores/bounds/internals/state";
|
|
12
|
+
import { createTransitionAwareComponent } from "../../../create-transition-aware-component";
|
|
13
|
+
import { getHostCapturesScroll, useActiveHostKey } from "../stores/host-registry.store";
|
|
14
|
+
import { mountPortalBoundaryHost, unmountPortalBoundaryHost } from "../stores/portal-boundary-host.store";
|
|
15
|
+
import { resolvePortalAttachmentTargets } from "../utils/attachment";
|
|
16
|
+
import { createPortalBoundaryHostName, PORTAL_HOST_NAME_RESET_VALUE } from "../utils/naming";
|
|
17
|
+
import { isTeleportEnabled } from "../utils/teleport-control";
|
|
18
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
19
|
+
const TransitionAwareTeleport = createTransitionAwareComponent(NativePortal);
|
|
20
|
+
export const Portal = /*#__PURE__*/memo(function Portal({
|
|
21
|
+
id = "my-id",
|
|
22
|
+
children,
|
|
23
|
+
mode = false,
|
|
24
|
+
placeholderRef
|
|
25
|
+
}) {
|
|
26
|
+
const isPortalEnabled = !!mode;
|
|
27
|
+
const portalAttachTarget = !mode || mode === true ? "current-screen" : mode.attachTo ?? "current-screen";
|
|
28
|
+
const {
|
|
29
|
+
stylesMap
|
|
30
|
+
} = useScreenStyles();
|
|
31
|
+
const sourcePairKey = useDescriptorsStore(s => s.derivations.sourcePairKey);
|
|
32
|
+
const currentScreenKey = useDescriptorsStore(s => s.derivations.currentScreenKey);
|
|
33
|
+
const nextScreenKey = useDescriptorsStore(s => s.derivations.nextScreenKey);
|
|
34
|
+
const [attachment, setAttachment] = useState(PORTAL_HOST_NAME_RESET_VALUE);
|
|
35
|
+
const attachedHostName = useSharedValue(PORTAL_HOST_NAME_RESET_VALUE);
|
|
36
|
+
const placeholderWidth = useSharedValue(0);
|
|
37
|
+
const placeholderHeight = useSharedValue(0);
|
|
38
|
+
const {
|
|
39
|
+
progressScreenKey,
|
|
40
|
+
targetScreenKey
|
|
41
|
+
} = resolvePortalAttachmentTargets({
|
|
42
|
+
attachment,
|
|
43
|
+
currentScreenKey,
|
|
44
|
+
nextScreenKey,
|
|
45
|
+
portalAttachTarget,
|
|
46
|
+
sourcePairKey
|
|
47
|
+
});
|
|
48
|
+
const activeHostKey = useActiveHostKey(targetScreenKey);
|
|
49
|
+
const activeHostCapturesScroll = activeHostKey ? getHostCapturesScroll(activeHostKey) : false;
|
|
50
|
+
const progress = AnimationStore.getValue(progressScreenKey ?? "", "transitionProgress");
|
|
51
|
+
const closing = AnimationStore.getValue(progressScreenKey ?? "", "closing");
|
|
52
|
+
const updatePortalAttachment = useCallback((matchedScreenKey, pairKey) => {
|
|
53
|
+
if (matchedScreenKey && pairKey) {
|
|
54
|
+
setAttachment(current => {
|
|
55
|
+
if (current?.matchedScreenKey === matchedScreenKey && current.pairKey === pairKey) {
|
|
56
|
+
return current;
|
|
57
|
+
}
|
|
58
|
+
return {
|
|
59
|
+
matchedScreenKey,
|
|
60
|
+
pairKey
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
setAttachment(current => current ? null : current);
|
|
66
|
+
}, []);
|
|
67
|
+
useLayoutEffect(() => {
|
|
68
|
+
if (!isPortalEnabled || !attachment || !activeHostKey || !targetScreenKey) {
|
|
69
|
+
attachedHostName.set(PORTAL_HOST_NAME_RESET_VALUE);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
mountPortalBoundaryHost({
|
|
73
|
+
boundaryId: id,
|
|
74
|
+
capturesScroll: activeHostCapturesScroll,
|
|
75
|
+
hostKey: activeHostKey,
|
|
76
|
+
pairKey: attachment.pairKey,
|
|
77
|
+
screenKey: targetScreenKey
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// The native registry parks portals whose host has not registered yet and
|
|
81
|
+
// re-parents the moment it does, so the host name can be handed over
|
|
82
|
+
// immediately — ordering belongs to the registry, not to frame counting.
|
|
83
|
+
// hostName rides animated props, so the handover needs no React commit.
|
|
84
|
+
attachedHostName.set(createPortalBoundaryHostName(activeHostKey, id));
|
|
85
|
+
}, [activeHostKey, activeHostCapturesScroll, attachedHostName, attachment, id, isPortalEnabled, targetScreenKey]);
|
|
86
|
+
useLayoutEffect(() => {
|
|
87
|
+
return () => {
|
|
88
|
+
attachedHostName.set(PORTAL_HOST_NAME_RESET_VALUE);
|
|
89
|
+
unmountPortalBoundaryHost(id);
|
|
90
|
+
};
|
|
91
|
+
}, [attachedHostName, id]);
|
|
92
|
+
useAnimatedReaction(() => {
|
|
93
|
+
"worklet";
|
|
94
|
+
|
|
95
|
+
if (!isPortalEnabled || !sourcePairKey) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
pairs.get();
|
|
99
|
+
// Strict per-member lookup: getResolvedLink's group fallback borrows
|
|
100
|
+
// the initial member's link for style resolution, which would make
|
|
101
|
+
// every inactive group member's portal see a "complete" link and
|
|
102
|
+
// attach. A portal may only teleport on its OWN member's link.
|
|
103
|
+
const link = getLink(sourcePairKey, id);
|
|
104
|
+
if (link?.status !== "complete") {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Grouped portals teleport only while their member is the group's
|
|
109
|
+
// active id — retargeting detaches the previous member (its content
|
|
110
|
+
// returns home) and attaches the new one. Exactly one grouped member
|
|
111
|
+
// is teleported at a time.
|
|
112
|
+
if (link.group) {
|
|
113
|
+
const activeId = pairs.get()[sourcePairKey]?.groups?.[link.group]?.activeId;
|
|
114
|
+
if (activeId && activeId !== getLinkKeyFromTag(id)) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return link.destination.screenKey;
|
|
119
|
+
}, (matchedScreenKey, previousMatchedScreenKey) => {
|
|
120
|
+
"worklet";
|
|
121
|
+
|
|
122
|
+
if (matchedScreenKey === previousMatchedScreenKey) {
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
runOnJS(updatePortalAttachment)(matchedScreenKey, sourcePairKey);
|
|
126
|
+
});
|
|
127
|
+
const teleportProps = useAnimatedProps(() => {
|
|
128
|
+
"worklet";
|
|
129
|
+
|
|
130
|
+
// Opening waits for the destination transition to start so content is not
|
|
131
|
+
// re-parented before the host is visually ready. Closing stays attached
|
|
132
|
+
// through progress 0 so the final frame can land in the matched host.
|
|
133
|
+
const attachThreshold = closing.get() === 1 ? 0 : 0.001;
|
|
134
|
+
const {
|
|
135
|
+
teleport,
|
|
136
|
+
...slotProps
|
|
137
|
+
} = stylesMap.get()[id]?.props ?? {};
|
|
138
|
+
const shouldTeleport = isTeleportEnabled(teleport);
|
|
139
|
+
return {
|
|
140
|
+
// Preserve portal slot props from the interpolator while keeping
|
|
141
|
+
// hostName owned by the attachment gate below.
|
|
142
|
+
...slotProps,
|
|
143
|
+
hostName: shouldTeleport && progress.get() >= attachThreshold ? attachedHostName.get() : PORTAL_HOST_NAME_RESET_VALUE
|
|
144
|
+
};
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// Pin the placeholder to its measured size while content lives in the host,
|
|
148
|
+
// in the same UI frame the host name flips — no commit in between. Until the
|
|
149
|
+
// first layout lands (dims 0) sizing stays natural so an instant attach
|
|
150
|
+
// cannot collapse the slot.
|
|
151
|
+
const placeholderStyle = useAnimatedStyle(() => {
|
|
152
|
+
"worklet";
|
|
153
|
+
|
|
154
|
+
const hostName = attachedHostName.get();
|
|
155
|
+
const isAttached = hostName !== null;
|
|
156
|
+
const width = placeholderWidth.get();
|
|
157
|
+
const height = placeholderHeight.get();
|
|
158
|
+
if (!isAttached || width === 0) {
|
|
159
|
+
return {
|
|
160
|
+
width: "auto",
|
|
161
|
+
height: "auto"
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
return {
|
|
165
|
+
width,
|
|
166
|
+
height
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
if (isPortalEnabled) {
|
|
170
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
171
|
+
ref: placeholderRef,
|
|
172
|
+
onLayout: event => {
|
|
173
|
+
placeholderWidth.set(event.nativeEvent.layout.width);
|
|
174
|
+
placeholderHeight.set(event.nativeEvent.layout.height);
|
|
175
|
+
},
|
|
176
|
+
style: placeholderStyle,
|
|
177
|
+
collapsable: false,
|
|
178
|
+
children: /*#__PURE__*/_jsx(TransitionAwareTeleport, {
|
|
179
|
+
animatedProps: teleportProps,
|
|
180
|
+
name: id,
|
|
181
|
+
children: /*#__PURE__*/_jsx(Animated.View, {
|
|
182
|
+
style: placeholderStyle,
|
|
183
|
+
children: children
|
|
184
|
+
})
|
|
185
|
+
})
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
return children;
|
|
189
|
+
});
|
|
190
|
+
//# sourceMappingURL=portal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["memo","useCallback","useLayoutEffect","useState","Animated","runOnJS","useAnimatedProps","useAnimatedReaction","useAnimatedStyle","useSharedValue","Portal","NativePortal","useDescriptorsStore","useScreenStyles","AnimationStore","getLinkKeyFromTag","getLink","pairs","createTransitionAwareComponent","getHostCapturesScroll","useActiveHostKey","mountPortalBoundaryHost","unmountPortalBoundaryHost","resolvePortalAttachmentTargets","createPortalBoundaryHostName","PORTAL_HOST_NAME_RESET_VALUE","isTeleportEnabled","jsx","_jsx","TransitionAwareTeleport","id","children","mode","placeholderRef","isPortalEnabled","portalAttachTarget","attachTo","stylesMap","sourcePairKey","s","derivations","currentScreenKey","nextScreenKey","attachment","setAttachment","attachedHostName","placeholderWidth","placeholderHeight","progressScreenKey","targetScreenKey","activeHostKey","activeHostCapturesScroll","progress","getValue","closing","updatePortalAttachment","matchedScreenKey","pairKey","current","set","boundaryId","capturesScroll","hostKey","screenKey","get","link","status","group","activeId","groups","destination","previousMatchedScreenKey","teleportProps","attachThreshold","teleport","slotProps","props","shouldTeleport","hostName","placeholderStyle","isAttached","width","height","View","ref","onLayout","event","nativeEvent","layout","style","collapsable","animatedProps","name"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/components/portal.tsx"],"mappings":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