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,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useLayoutEffect, useState } from "react";
|
|
4
|
+
import { measure, runOnJS, runOnUI, useAnimatedReaction, useAnimatedRef, useSharedValue } from "react-native-reanimated";
|
|
5
|
+
import { useOriginContext } from "../../../../providers/screen/origin.provider";
|
|
6
|
+
import { ScrollStore } from "../../../../stores/scroll.store";
|
|
7
|
+
import { adjustedMeasuredBoundsForOverscrollDeltas, normalizeMeasuredBoundsToOrigin } from "../../utils/measured-bounds";
|
|
8
|
+
import { clearPortalHostBounds, setPortalHostBounds } from "../stores/host-bounds.store";
|
|
9
|
+
export const useHostMeasurement = ({
|
|
10
|
+
capturesScroll,
|
|
11
|
+
enabled,
|
|
12
|
+
hostKey,
|
|
13
|
+
screenKey
|
|
14
|
+
}) => {
|
|
15
|
+
const hostRef = useAnimatedRef();
|
|
16
|
+
const scrollMetadata = ScrollStore.getValue(screenKey, "metadata");
|
|
17
|
+
const [canRenderHosts, setCanRenderHosts] = useState(false);
|
|
18
|
+
const {
|
|
19
|
+
originRef
|
|
20
|
+
} = useOriginContext();
|
|
21
|
+
const hasMeasuredHost = useSharedValue(false);
|
|
22
|
+
useAnimatedReaction(() => {
|
|
23
|
+
"worklet";
|
|
24
|
+
|
|
25
|
+
if (!enabled) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return hasMeasuredHost.get();
|
|
29
|
+
}, hasAlreadyMeasured => {
|
|
30
|
+
"worklet";
|
|
31
|
+
|
|
32
|
+
if (!enabled || hasAlreadyMeasured) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const measured = measure(hostRef);
|
|
36
|
+
const measuredOrigin = measure(originRef);
|
|
37
|
+
if (!measured || !measuredOrigin) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
hasMeasuredHost.set(true);
|
|
41
|
+
|
|
42
|
+
// A measurement taken mid rubber-band would bake the transient
|
|
43
|
+
// overscroll displacement into the host frame. Store the at-rest
|
|
44
|
+
// position instead; clamped scroll deltas share that basis.
|
|
45
|
+
const currentScroll = scrollMetadata.get();
|
|
46
|
+
const overscrollNormalized = capturesScroll ? adjustedMeasuredBoundsForOverscrollDeltas(measured, currentScroll) : measured;
|
|
47
|
+
const normalizedMeasured = normalizeMeasuredBoundsToOrigin(overscrollNormalized, measuredOrigin);
|
|
48
|
+
setPortalHostBounds(hostKey, {
|
|
49
|
+
x: normalizedMeasured.x,
|
|
50
|
+
y: normalizedMeasured.y,
|
|
51
|
+
width: normalizedMeasured.width,
|
|
52
|
+
height: normalizedMeasured.height,
|
|
53
|
+
pageX: normalizedMeasured.pageX,
|
|
54
|
+
pageY: normalizedMeasured.pageY,
|
|
55
|
+
scroll: capturesScroll ? currentScroll : null
|
|
56
|
+
});
|
|
57
|
+
runOnJS(setCanRenderHosts)(true);
|
|
58
|
+
});
|
|
59
|
+
useLayoutEffect(() => {
|
|
60
|
+
return () => {
|
|
61
|
+
runOnUI(clearPortalHostBounds)(hostKey);
|
|
62
|
+
};
|
|
63
|
+
}, [hostKey]);
|
|
64
|
+
return {
|
|
65
|
+
canRenderHosts,
|
|
66
|
+
hostRef
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=use-host-measurement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useLayoutEffect","useState","measure","runOnJS","runOnUI","useAnimatedReaction","useAnimatedRef","useSharedValue","useOriginContext","ScrollStore","adjustedMeasuredBoundsForOverscrollDeltas","normalizeMeasuredBoundsToOrigin","clearPortalHostBounds","setPortalHostBounds","useHostMeasurement","capturesScroll","enabled","hostKey","screenKey","hostRef","scrollMetadata","getValue","canRenderHosts","setCanRenderHosts","originRef","hasMeasuredHost","get","hasAlreadyMeasured","measured","measuredOrigin","set","currentScroll","overscrollNormalized","normalizedMeasured","x","y","width","height","pageX","pageY","scroll"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/hooks/use-host-measurement.ts"],"mappings":";;AAAA,SAASA,eAAe,EAAEC,QAAQ,QAAQ,OAAO;AAEjD,SACCC,OAAO,EACPC,OAAO,EACPC,OAAO,EACPC,m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G,aAAa,CAAC,GAClEH,QAAQ;IAEX,MAAMK,kBAAkB,GAAGtB,+BAA+B,CACzDqB,oBAAoB,EACpBH,cACD,CAAC;IAEDhB,mBAAmB,CAACI,OAAO,EAAE;MAC5BiB,CAAC,EAAED,kBAAkB,CAACC,CAAC;MACvBC,CAAC,EAAEF,kBAAkB,CAACE,CAAC;MACvBC,KAAK,EAAEH,kBAAkB,CAACG,KAAK;MAC/BC,MAAM,EAAEJ,kBAAkB,CAACI,MAAM;MACjCC,KAAK,EAAEL,kBAAkB,CAACK,KAAK;MAC/BC,KAAK,EAAEN,kBAAkB,CAACM,KAAK;MAC/BC,MAAM,EAAEzB,cAAc,GAAGgB,aAAa,GAAG;IAC1C,CAAC,CAAC;IAEF5B,OAAO,CAACoB,iBAAiB,CAAC,CAAC,IAAI,CAAC;EACjC,CACD,CAAC;EAEDvB,eAAe,CAAC,MAAM;IACrB,OAAO,MAAM;MACZI,OAAO,CAACQ,qBAAqB,CAAC,CAACK,OAAO,CAAC;IACxC,CAAC;EACF,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;EAEb,OAAO;IACNK,cAAc;IACdH;EACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Host","Portal","PortalProvider"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/portal/index.ts"],"mappings":";;AAAA,SAASA,IAAI,QAAQ,mBAAmB;AACxC,SAASC,MAAM,QAAQ,qBAAqB;AAC5C,SAASC,cAAc,QAAQ,8BAA8B","ignoreList":[]}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { makeMutable } from "react-native-reanimated";
|
|
4
|
+
import { cloneScrollMetadataState } from "../../../../stores/scroll.store";
|
|
5
|
+
const portalHostBounds = makeMutable({});
|
|
6
|
+
export const getPortalHostBounds = hostKey => {
|
|
7
|
+
"worklet";
|
|
8
|
+
|
|
9
|
+
return portalHostBounds.get()[hostKey] ?? null;
|
|
10
|
+
};
|
|
11
|
+
export const setPortalHostBounds = (hostKey, bounds) => {
|
|
12
|
+
"worklet";
|
|
13
|
+
|
|
14
|
+
const nextBounds = {
|
|
15
|
+
...bounds,
|
|
16
|
+
scroll: cloneScrollMetadataState(bounds.scroll)
|
|
17
|
+
};
|
|
18
|
+
portalHostBounds.set(state => {
|
|
19
|
+
"worklet";
|
|
20
|
+
|
|
21
|
+
return {
|
|
22
|
+
...state,
|
|
23
|
+
[hostKey]: nextBounds
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
export const clearPortalHostBounds = hostKey => {
|
|
28
|
+
"worklet";
|
|
29
|
+
|
|
30
|
+
portalHostBounds.set(state => {
|
|
31
|
+
"worklet";
|
|
32
|
+
|
|
33
|
+
const nextState = {
|
|
34
|
+
...state
|
|
35
|
+
};
|
|
36
|
+
delete nextState[hostKey];
|
|
37
|
+
return nextState;
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
//# sourceMappingURL=host-bounds.store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["makeMutable","cloneScrollMetadataState","portalHostBounds","getPortalHostBounds","hostKey","get","setPortalHostBounds","bounds","nextBounds","scroll","set","state","clearPortalHostBounds","nextState"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/stores/host-bounds.store.ts"],"mappings":";;AAAA,SAAkCA,WAAW,QAAQ,yBAAyB;AAC9E,SAASC,wBAAwB,QAAQ,iCAAiC;AAS1E,MAAMC,gBAAgB,GAAGF,WAAW,CAAwB,CAAC,CAAC,CAAC;AAE/D,OAAO,MAAMG,mBAAmB,GAAIC,OAAe,IAAK;EACvD,SAAS;;EACT,OAAOF,gBAAgB,CAACG,GAAG,CAAC,CAAC,CAACD,OAAO,CAAC,IAAI,IAAI;AAC/C,CAAC;AAED,OAAO,MAAME,mBAAmB,GAAGA,CAClCF,OAAe,EACfG,MAAwB,KACpB;EACJ,SAAS;;EACT,MAAMC,UAA4B,GAAG;IACpC,GAAGD,MAAM;IACTE,MAAM,EAAER,wBAAwB,CAACM,MAAM,CAACE,MAAM;EAC/C,CAAC;EAEDP,gBAAgB,CAACQ,GAAG,CAAEC,KAAK,IAAK;IAC/B,SAAS;;IACT,OAAO;MACN,GAAGA,KAAK;MACR,CAACP,OAAO,GAAGI;IACZ,CAAC;EACF,CAAC,CAAC;AACH,CAAC;AAED,OAAO,MAAMI,qBAAqB,GAAIR,OAAe,IAAK;EACzD,SAAS;;EACTF,gBAAgB,CAACQ,GAAG,CAAEC,KAAK,IAAK;IAC/B,SAAS;;IACT,MAAME,SAAgC,GAAG;MAAE,GAAGF;IAAM,CAAC;IACrD,OAAOE,SAAS,CAACT,OAAO,CAAC;IACzB,OAAOS,SAAS;EACjB,CAAC,CAAC;AACH,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useSyncExternalStore } from "react";
|
|
4
|
+
import { makeMutable } from "react-native-reanimated";
|
|
5
|
+
const EMPTY_SNAPSHOT = {};
|
|
6
|
+
const listeners = new Set();
|
|
7
|
+
const hostStacks = new Map();
|
|
8
|
+
let snapshot = EMPTY_SNAPSHOT;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* UI-readable mirror of each screen's active host, kept only for hosts that
|
|
12
|
+
* capture scroll. Measurement worklets read it to record which scroll-scoped
|
|
13
|
+
* host a source boundary originated from — at measure time, without any React
|
|
14
|
+
* subscription on the boundary itself.
|
|
15
|
+
*/
|
|
16
|
+
const activeScrollHosts = makeMutable({});
|
|
17
|
+
const getActiveHostFromStack = (screenKey, stack) => {
|
|
18
|
+
if (!stack || stack.length === 0) {
|
|
19
|
+
return screenKey;
|
|
20
|
+
}
|
|
21
|
+
for (let index = stack.length - 1; index >= 0; index--) {
|
|
22
|
+
const host = stack[index];
|
|
23
|
+
if (!host.fallback) {
|
|
24
|
+
return host.hostKey;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return stack[0]?.hostKey ?? screenKey;
|
|
28
|
+
};
|
|
29
|
+
const buildSnapshot = () => {
|
|
30
|
+
const nextSnapshot = {};
|
|
31
|
+
for (const [screenKey, stack] of hostStacks) {
|
|
32
|
+
nextSnapshot[screenKey] = getActiveHostFromStack(screenKey, stack);
|
|
33
|
+
}
|
|
34
|
+
return nextSnapshot;
|
|
35
|
+
};
|
|
36
|
+
const buildScrollHostSnapshot = () => {
|
|
37
|
+
const nextSnapshot = {};
|
|
38
|
+
for (const [screenKey, stack] of hostStacks) {
|
|
39
|
+
const activeHostKey = getActiveHostFromStack(screenKey, stack);
|
|
40
|
+
const activeHost = stack.find(host => host.hostKey === activeHostKey);
|
|
41
|
+
if (activeHost?.capturesScroll) {
|
|
42
|
+
nextSnapshot[screenKey] = {
|
|
43
|
+
hostKey: activeHost.hostKey,
|
|
44
|
+
capturesScroll: true
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return nextSnapshot;
|
|
49
|
+
};
|
|
50
|
+
const emit = () => {
|
|
51
|
+
snapshot = buildSnapshot();
|
|
52
|
+
activeScrollHosts.set(buildScrollHostSnapshot());
|
|
53
|
+
for (const listener of listeners) {
|
|
54
|
+
listener();
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const subscribe = listener => {
|
|
58
|
+
listeners.add(listener);
|
|
59
|
+
return () => {
|
|
60
|
+
listeners.delete(listener);
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
export const registerHost = registration => {
|
|
64
|
+
const stack = hostStacks.get(registration.screenKey) ?? [];
|
|
65
|
+
const previousActiveHostKey = getActiveHostFromStack(registration.screenKey, stack);
|
|
66
|
+
const nextStack = stack.filter(host => host.hostKey !== registration.hostKey);
|
|
67
|
+
if (registration.fallback) {
|
|
68
|
+
nextStack.unshift(registration);
|
|
69
|
+
} else {
|
|
70
|
+
nextStack.push(registration);
|
|
71
|
+
}
|
|
72
|
+
hostStacks.set(registration.screenKey, nextStack);
|
|
73
|
+
if (previousActiveHostKey === getActiveHostFromStack(registration.screenKey, nextStack)) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
emit();
|
|
77
|
+
};
|
|
78
|
+
export const unregisterHost = (screenKey, hostKey) => {
|
|
79
|
+
const stack = hostStacks.get(screenKey);
|
|
80
|
+
if (!stack) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const previousActiveHostKey = getActiveHostFromStack(screenKey, stack);
|
|
84
|
+
const nextStack = stack.filter(host => host.hostKey !== hostKey);
|
|
85
|
+
if (nextStack.length === 0) {
|
|
86
|
+
hostStacks.delete(screenKey);
|
|
87
|
+
} else {
|
|
88
|
+
hostStacks.set(screenKey, nextStack);
|
|
89
|
+
}
|
|
90
|
+
if (previousActiveHostKey === getActiveHostFromStack(screenKey, nextStack)) {
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
emit();
|
|
94
|
+
};
|
|
95
|
+
export const getActiveHostKey = screenKey => {
|
|
96
|
+
return snapshot[screenKey] ?? screenKey;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The screen's active host, if it captures scroll. Worklet-safe: measurement
|
|
101
|
+
* code calls this on the UI thread while writing source bounds.
|
|
102
|
+
*/
|
|
103
|
+
export const getActiveScrollHost = screenKey => {
|
|
104
|
+
"worklet";
|
|
105
|
+
|
|
106
|
+
return activeScrollHosts.get()[screenKey] ?? null;
|
|
107
|
+
};
|
|
108
|
+
export const getHostCapturesScroll = hostKey => {
|
|
109
|
+
for (const stack of hostStacks.values()) {
|
|
110
|
+
const host = stack.find(registration => registration.hostKey === hostKey);
|
|
111
|
+
if (host) {
|
|
112
|
+
return host.capturesScroll;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return false;
|
|
116
|
+
};
|
|
117
|
+
export const useActiveHostKey = screenKey => {
|
|
118
|
+
return useSyncExternalStore(subscribe, () => screenKey ? getActiveHostKey(screenKey) : undefined, () => undefined);
|
|
119
|
+
};
|
|
120
|
+
export const resetHostRegistry = () => {
|
|
121
|
+
hostStacks.clear();
|
|
122
|
+
snapshot = EMPTY_SNAPSHOT;
|
|
123
|
+
activeScrollHosts.set({});
|
|
124
|
+
emit();
|
|
125
|
+
};
|
|
126
|
+
//# sourceMappingURL=host-registry.store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useSyncExternalStore","makeMutable","EMPTY_SNAPSHOT","listeners","Set","hostStacks","Map","snapshot","activeScrollHosts","getActiveHostFromStack","screenKey","stack","length","index","host","fallback","hostKey","buildSnapshot","nextSnapshot","buildScrollHostSnapshot","activeHostKey","activeHost","find","capturesScroll","emit","set","listener","subscribe","add","delete","registerHost","registration","get","previousActiveHostKey","nextStack","filter","unshift","push","unregisterHost","getActiveHostKey","getActiveScrollHost","getHostCapturesScroll","values","useActiveHostKey","undefined","resetHostRegistry","clear"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/stores/host-registry.store.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,OAAO;AAC5C,SAASC,WAAW,QAAQ,yBAAyB;AAYrD,MAAMC,cAAoC,GAAG,CAAC,CAAC;AAE/C,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;AACvC,MAAMC,UAAU,GAAG,IAAIC,GAAG,CAA6B,CAAC;AAExD,IAAIC,QAA8B,GAAGL,cAAc;;AAEnD;AACA;AACA;AACA;AACA;AACA;AACA,MAAMM,iBAAiB,GAAGP,WAAW,CAAgC,CAAC,CAAC,CAAC;AAExE,MAAMQ,sBAAsB,GAAGA,CAC9BC,SAAiB,EACjBC,KAAqC,KACjC;EACJ,IAAI,CAACA,KAAK,IAAIA,KAAK,CAACC,MAAM,KAAK,CAAC,EAAE;IACjC,OAAOF,SAAS;EACjB;EAEA,KAAK,IAAIG,KAAK,GAAGF,KAAK,CAACC,MA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AC;EAClBvC,QAAQ,GAAGL,cAAc;EACzBM,iBAAiB,CAACiB,GAAG,CAAC,CAAC,CAAC,CAAC;EACzBD,IAAI,CAAC,CAAC;AACP,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useSyncExternalStore } from "react";
|
|
4
|
+
const EMPTY_HOSTS = [];
|
|
5
|
+
const listeners = new Set();
|
|
6
|
+
const activeBoundaryHosts = new Map();
|
|
7
|
+
let snapshot = {
|
|
8
|
+
hostsByScope: {}
|
|
9
|
+
};
|
|
10
|
+
const buildSnapshot = () => {
|
|
11
|
+
const hostsByScope = {};
|
|
12
|
+
for (const host of activeBoundaryHosts.values()) {
|
|
13
|
+
const hosts = hostsByScope[host.hostKey] ?? [];
|
|
14
|
+
hosts.push(host);
|
|
15
|
+
hostsByScope[host.hostKey] = hosts;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
hostsByScope
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
const emit = () => {
|
|
22
|
+
snapshot = buildSnapshot();
|
|
23
|
+
for (const listener of listeners) {
|
|
24
|
+
listener();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const isSameHost = (a, b) => {
|
|
28
|
+
return a.boundaryId === b.boundaryId && a.capturesScroll === b.capturesScroll && a.hostKey === b.hostKey && a.pairKey === b.pairKey && a.screenKey === b.screenKey;
|
|
29
|
+
};
|
|
30
|
+
export const mountPortalBoundaryHost = host => {
|
|
31
|
+
const previous = activeBoundaryHosts.get(host.boundaryId);
|
|
32
|
+
if (previous && isSameHost(previous, host)) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
activeBoundaryHosts.set(host.boundaryId, host);
|
|
36
|
+
emit();
|
|
37
|
+
};
|
|
38
|
+
export const unmountPortalBoundaryHost = boundaryId => {
|
|
39
|
+
if (!activeBoundaryHosts.delete(boundaryId)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
emit();
|
|
43
|
+
};
|
|
44
|
+
const subscribe = listener => {
|
|
45
|
+
listeners.add(listener);
|
|
46
|
+
return () => {
|
|
47
|
+
listeners.delete(listener);
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export const useActivePortalBoundaryHosts = hostKey => {
|
|
51
|
+
return useSyncExternalStore(subscribe, () => snapshot.hostsByScope[hostKey] ?? EMPTY_HOSTS, () => EMPTY_HOSTS);
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=portal-boundary-host.store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useSyncExternalStore","EMPTY_HOSTS","listeners","Set","activeBoundaryHosts","Map","snapshot","hostsByScope","buildSnapshot","host","values","hosts","hostKey","push","emit","listener","isSameHost","a","b","boundaryId","capturesScroll","pairKey","screenKey","mountPortalBoundaryHost","previous","get","set","unmountPortalBoundaryHost","delete","subscribe","add","useActivePortalBoundaryHosts"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/stores/portal-boundary-host.store.ts"],"mappings":";;AAAA,SAASA,oBAAoB,QAAQ,OAAO;AAc5C,MAAMC,WAAuC,GAAG,EAAE;AAElD,MAAMC,SAAS,GAAG,IAAIC,GAAG,CAAa,CAAC;AACvC,MAAMC,mBAAmB,GAAG,IAAIC,GAAG,CAAmC,CAAC;AAEvE,IAAIC,QAAwB,GAAG;EAC9BC,YAAY,EAAE,CAAC;AAChB,CAAC;AAED,MAAMC,aAAa,GAAGA,CAAA,KAAsB;EAC3C,MAAMD,YAAwD,GAAG,CAAC,CAAC;EAEnE,KAAK,MAAME,IAAI,IAAIL,mBAAmB,CAACM,MAAM,CAAC,CAAC,EAAE;IAChD,MAAMC,KAAK,GAAGJ,YAAY,CAACE,IAAI,CAACG,OAAO,CAAC,IAAI,EAAE;IAC9CD,KAAK,CAACE,IAAI,CAACJ,IAAI,CAAC;IAChBF,YAAY,CAACE,IAAI,CAACG,OAAO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,OAAO,MAAMgB,4BAA4B,GAAInB,OAAe,IAAK;EAChE,OAAOZ,oBAAoB,CAC1B6B,SAAS,EACT,MAAMvB,QAAQ,CAACC,YAAY,CAACK,OAAO,CAAC,IAAIX,WAAW,EACnD,MAAMA,WACP,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
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 = null;
|
|
12
|
+
try {
|
|
13
|
+
mod = require("react-native-teleport");
|
|
14
|
+
} catch {}
|
|
15
|
+
export const isTeleportAvailable = mod !== null;
|
|
16
|
+
export const NativePortal = mod?.Portal ?? null;
|
|
17
|
+
export const NativePortalProvider = mod?.PortalProvider ?? null;
|
|
18
|
+
export const NativePortalHost = mod?.PortalHost ?? null;
|
|
19
|
+
//# sourceMappingURL=teleport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["mod","require","isTeleportAvailable","NativePortal","Portal","NativePortalProvider","PortalProvider","NativePortalHost","PortalHost"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/portal/teleport.ts"],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAIA,GAAQ,GAAG,IAAI;AACnB,IAAI;EACHA,GAAG,GAAGC,OAAO,CAAC,uBAAuB,CAAC;AACvC,CAAC,CAAC,MAAM,CAAC;AAET,OAAO,MAAMC,mBAAmB,GAAGF,GAAG,KAAK,IAAI;AAC/C,OAAO,MAAMG,YAAuC,GAAGH,GAAG,EAAEI,MAAM,IAAI,IAAI;AAC1E,OAAO,MAAMC,oBAA+C,GAC3DL,GAAG,EAAEM,cAAc,IAAI,IAAI;AAC5B,OAAO,MAAMC,gBAA2C,GACvDP,GAAG,EAAEQ,UAAU,IAAI,IAAI","ignoreList":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const resolvePortalAttachmentTargets = ({
|
|
4
|
+
attachment,
|
|
5
|
+
currentScreenKey,
|
|
6
|
+
nextScreenKey,
|
|
7
|
+
portalAttachTarget,
|
|
8
|
+
sourcePairKey
|
|
9
|
+
}) => {
|
|
10
|
+
const hasCurrentAttachment = attachment?.pairKey === sourcePairKey;
|
|
11
|
+
if (!hasCurrentAttachment || !attachment) {
|
|
12
|
+
return {
|
|
13
|
+
progressScreenKey: null,
|
|
14
|
+
targetScreenKey: null
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// Matched-screen portals physically live in the matched destination host. If a
|
|
19
|
+
// closing destination is skipped by descriptor resolution, its own progress
|
|
20
|
+
// still owns the attach gate until this attachment is replaced or cleared.
|
|
21
|
+
if (portalAttachTarget === "matched-screen") {
|
|
22
|
+
return {
|
|
23
|
+
progressScreenKey: attachment.matchedScreenKey,
|
|
24
|
+
targetScreenKey: attachment.matchedScreenKey
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Current-screen portals stay mounted in this screen's host, but the visual
|
|
29
|
+
// handoff is still paced by the adjacent destination transition.
|
|
30
|
+
return {
|
|
31
|
+
progressScreenKey: nextScreenKey ?? null,
|
|
32
|
+
targetScreenKey: currentScreenKey
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=attachment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["resolvePortalAttachmentTargets","attachment","currentScreenKey","nextScreenKey","portalAttachTarget","sourcePairKey","hasCurrentAttachment","pairKey","progressScreenKey","targetScreenKey","matchedScreenKey"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/utils/attachment.ts"],"mappings":";;AAeA,OAAO,MAAMA,8BAA8B,GAAGA,CAAC;EAC9CC,UAAU;EACVC,gBAAgB;EAChBC,aAAa;EACbC,kBAAkB;EAClBC;AACqC,CAAC,KAAK;EAC3C,MAAMC,oBAAoB,GAAGL,UAAU,EAAEM,OAAO,KAAKF,aAAa;EAElE,IAAI,CAACC,oBAAoB,IAAI,CAACL,UAAU,EAAE;IACzC,OAAO;MACNO,iBAAiB,EAAE,IAAI;MACvBC,eAAe,EAAE;IAClB,CAAC;EACF;;EAEA;EACA;EACA;EACA,IAAIL,kBAAkB,KAAK,gBAAgB,EAAE;IAC5C,OAAO;MACNI,iBAAiB,EAAEP,UAAU,CAACS,gBAAgB;MAC9CD,eAAe,EAAER,UAAU,CAACS;IAC7B,CAAC;EACF;;EAEA;EACA;EACA,OAAO;IACNF,iBAAiB,EAAEL,aAAa,IAAI,IAAI;IACxCM,eAAe,EAAEP;EAClB,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const PORTAL_HOST_NAME_RESET_VALUE = null;
|
|
4
|
+
const PORTAL_HOST_NAME_SUFFIX = "-portal-host";
|
|
5
|
+
export const createPortalBoundaryHostName = (hostKey, boundaryId) => {
|
|
6
|
+
"worklet";
|
|
7
|
+
|
|
8
|
+
return `${hostKey}-${boundaryId}${PORTAL_HOST_NAME_SUFFIX}`;
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=naming.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["PORTAL_HOST_NAME_RESET_VALUE","PORTAL_HOST_NAME_SUFFIX","createPortalBoundaryHostName","hostKey","boundaryId"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/utils/naming.ts"],"mappings":";;AAAA,OAAO,MAAMA,4BAA4B,GAAG,IAAI;AAChD,MAAMC,uBAAuB,GAAG,cAAc;AAE9C,OAAO,MAAMC,4BAA4B,GAAGA,CAC3CC,OAAe,EACfC,UAAkB,KACd;EACJ,SAAS;;EACT,OAAO,GAAGD,OAAO,IAAIC,UAAU,GAAGH,uBAAuB,EAAE;AAC5D,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { interpolate } from "react-native-reanimated";
|
|
4
|
+
import { getClampedScrollAxisDelta } from "../../../../stores/scroll.store";
|
|
5
|
+
import { getPortalHostBounds } from "../stores/host-bounds.store";
|
|
6
|
+
export const resolvePortalOffsetStyle = ({
|
|
7
|
+
alignHostToBoundsScroll = false,
|
|
8
|
+
bounds,
|
|
9
|
+
boundsCurrentScroll,
|
|
10
|
+
compensateSourceScroll = false,
|
|
11
|
+
currentScroll,
|
|
12
|
+
hostCurrentScroll,
|
|
13
|
+
hostKey,
|
|
14
|
+
hostProgress = 0,
|
|
15
|
+
includeScrollOffsets = true,
|
|
16
|
+
placement,
|
|
17
|
+
position = "relative",
|
|
18
|
+
sourceCurrentScroll,
|
|
19
|
+
trackSourceScroll = false
|
|
20
|
+
}) => {
|
|
21
|
+
"worklet";
|
|
22
|
+
|
|
23
|
+
const hostBounds = getPortalHostBounds(hostKey);
|
|
24
|
+
const shouldAlignHostToBoundsScroll = placement ? placement === "same-screen" : alignHostToBoundsScroll;
|
|
25
|
+
const shouldCompensateSourceScroll = trackSourceScroll || compensateSourceScroll;
|
|
26
|
+
const shouldIncludeHostScrollOffsets = placement ? placement === "cross-screen-close" : includeScrollOffsets;
|
|
27
|
+
const boundsScrollSnapshot = bounds.scroll ?? null;
|
|
28
|
+
const sourceScrollSnapshot = shouldCompensateSourceScroll ? boundsScrollSnapshot : null;
|
|
29
|
+
const sourceScrollDeltaX = shouldCompensateSourceScroll ? getClampedScrollAxisDelta(sourceCurrentScroll ?? null, sourceScrollSnapshot, "horizontal") : 0;
|
|
30
|
+
const sourceScrollDeltaY = shouldCompensateSourceScroll ? getClampedScrollAxisDelta(sourceCurrentScroll ?? null, sourceScrollSnapshot, "vertical") : 0;
|
|
31
|
+
const sourcePageX = bounds.pageX - sourceScrollDeltaX;
|
|
32
|
+
const sourcePageY = bounds.pageY - sourceScrollDeltaY;
|
|
33
|
+
const boundsScroll = shouldIncludeHostScrollOffsets ? boundsScrollSnapshot ?? boundsCurrentScroll ?? currentScroll ?? null : null;
|
|
34
|
+
const hostBoundsScrollSnapshot = hostBounds?.scroll ?? null;
|
|
35
|
+
const hostBoundsScroll = shouldIncludeHostScrollOffsets ? hostBoundsScrollSnapshot : null;
|
|
36
|
+
const resolvedHostCurrentScroll = hostCurrentScroll ?? boundsScroll ?? hostBoundsScroll ?? null;
|
|
37
|
+
const hostSnapshotDeltaX = shouldAlignHostToBoundsScroll && !shouldIncludeHostScrollOffsets ? getClampedScrollAxisDelta(boundsScrollSnapshot, hostBoundsScrollSnapshot, "horizontal") : 0;
|
|
38
|
+
const hostSnapshotDeltaY = shouldAlignHostToBoundsScroll && !shouldIncludeHostScrollOffsets ? getClampedScrollAxisDelta(boundsScrollSnapshot, hostBoundsScrollSnapshot, "vertical") : 0;
|
|
39
|
+
// Deltas are clamped to the layout range: iOS rubber-band offsets are
|
|
40
|
+
// outside the real scroll range and must not become coordinate-space deltas.
|
|
41
|
+
const hostScrollDeltaX = getClampedScrollAxisDelta(resolvedHostCurrentScroll, hostBoundsScroll, "horizontal");
|
|
42
|
+
const hostScrollDeltaY = getClampedScrollAxisDelta(resolvedHostCurrentScroll, hostBoundsScroll, "vertical");
|
|
43
|
+
const adjustedHostPageX = hostBounds ? hostBounds.pageX - hostSnapshotDeltaX - interpolate(hostProgress, [0, 1], [hostScrollDeltaX, 0]) : 0;
|
|
44
|
+
const adjustedHostPageY = hostBounds ? hostBounds.pageY - hostSnapshotDeltaY - interpolate(hostProgress, [0, 1], [hostScrollDeltaY, 0]) : 0;
|
|
45
|
+
const boundsScrollDeltaX = shouldIncludeHostScrollOffsets ? getClampedScrollAxisDelta(currentScroll ?? null, boundsScroll, "horizontal") : 0;
|
|
46
|
+
const boundsScrollDeltaY = shouldIncludeHostScrollOffsets ? getClampedScrollAxisDelta(currentScroll ?? null, boundsScroll, "vertical") : 0;
|
|
47
|
+
const offsetX = hostBounds ? sourcePageX - adjustedHostPageX : sourcePageX - boundsScrollDeltaX;
|
|
48
|
+
const offsetY = hostBounds ? sourcePageY - adjustedHostPageY : sourcePageY - boundsScrollDeltaY;
|
|
49
|
+
const transform = [{
|
|
50
|
+
translateY: offsetY
|
|
51
|
+
}, {
|
|
52
|
+
translateX: offsetX
|
|
53
|
+
}];
|
|
54
|
+
if (position === "absolute") {
|
|
55
|
+
return {
|
|
56
|
+
left: 0,
|
|
57
|
+
position: "absolute",
|
|
58
|
+
top: 0,
|
|
59
|
+
transform
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
return {
|
|
63
|
+
transform
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=offset-style.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["interpolate","getClampedScrollAxisDelta","getPortalHostBounds","resolvePortalOffsetStyle","alignHostToBoundsScroll","bounds","boundsCurrentScroll","compensateSourceScroll","currentScroll","hostCurrentScroll","hostKey","hostProgress","includeScrollOffsets","placement","position","sourceCurrentScroll","trackSourceScroll","hostBounds","shouldAlignHostToBoundsScroll","shouldCompensateSourceScroll","shouldIncludeHostScrollOffsets","boundsScrollSnapshot","scroll","sourceScrollSnapshot","sourceScrollDeltaX","sourceScrollDeltaY","sourcePageX","pageX","sourcePageY","pageY","boundsScroll","hostBoundsScrollSnapshot","hostBoundsScroll","resolvedHostCurrentScroll","hostSnapshotDeltaX","hostSnapshotDeltaY","hostScrollDeltaX","hostScrollDeltaY","adjustedHostPageX","adjustedHostPageY","boundsScrollDeltaX","boundsScrollDeltaY","offsetX","offsetY","transform","translateY","translateX","left","top"],"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pB,8BAA8B,GACtDnB,yBAAyB,CACzBO,aAAa,IAAI,IAAI,EACrBsB,YAAY,EACZ,YACD,CAAC,GACA,CAAC;EACJ,MAAMW,kBAAkB,GAAGrB,8BAA8B,GACtDnB,yBAAyB,CAACO,aAAa,IAAI,IAAI,EAAEsB,YAAY,EAAE,UAAU,CAAC,GAC1E,CAAC;EACJ,MAAMY,OAAO,GAAGzB,UAAU,GACvBS,WAAW,GAAGY,iBAAiB,GAC/BZ,WAAW,GAAGc,kBAAkB;EACnC,MAAMG,OAAO,GAAG1B,UAAU,GACvBW,WAAW,GAAGW,iBAAiB,GAC/BX,WAAW,GAAGa,kBAAkB;EACnC,MAAMG,SAAS,GAAG,CAAC;IAAEC,UAAU,EAAEF;EAAQ,CAAC,EAAE;IAAEG,UAAU,EAAEJ;EAAQ,CAAC,CAAC;EAEpE,IAAI5B,QAAQ,KAAK,UAAU,EAAE;IAC5B,OAAO;MACNiC,IAAI,EAAE,CAAC;MACPjC,QAAQ,EAAE,UAAU;MACpBkC,GAAG,EAAE,CAAC;MACNJ;IACD,CAAC;EACF;EAEA,OAAO;IACNA;EACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["isTeleportEnabled","teleport","enabled"],"sourceRoot":"../../../../../../../src","sources":["shared/components/boundary/portal/utils/teleport-control.ts"],"mappings":";;AAEA,OAAO,MAAMA,iBAAiB,GAC7BC,QAA6C,IACzC;EACJ,SAAS;;EAET,IAAI,OAAOA,QAAQ,KAAK,SAAS,EAAE;IAClC,OAAOA,QAAQ;EAChB;EAEA,OAAOA,QAAQ,EAAEC,OAAO,KAAK,KAAK;AACnC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useCallback, useMemo, useRef, useState } from "react";
|
|
4
|
+
import createProvider from "../../../utils/create-provider";
|
|
5
|
+
import { logger } from "../../../utils/logger";
|
|
6
|
+
// logger.warn prepends the library prefix.
|
|
7
|
+
const MULTIPLE_TARGETS_WARNING = "Multiple Boundary.Target elements were rendered under the same boundary owner. The first registered target will be measured.";
|
|
8
|
+
export const TARGET_OUTSIDE_OWNER_WARNING = "Boundary.Target must be rendered inside a Boundary owner (Boundary.View, Boundary.Trigger, or a component created by createBoundaryComponent).";
|
|
9
|
+
export const {
|
|
10
|
+
BoundaryOwnerProvider,
|
|
11
|
+
useBoundaryOwnerContext
|
|
12
|
+
} = createProvider("BoundaryOwner", {
|
|
13
|
+
guarded: false
|
|
14
|
+
})(props => props);
|
|
15
|
+
export const useBoundaryOwner = params => {
|
|
16
|
+
const {
|
|
17
|
+
ownerRef,
|
|
18
|
+
associatedTargetStyles,
|
|
19
|
+
entryTag,
|
|
20
|
+
portal
|
|
21
|
+
} = params;
|
|
22
|
+
const warnedAboutMultipleTargetsRef = useRef(false);
|
|
23
|
+
const [targetEntry, setTargetEntry] = useState(null);
|
|
24
|
+
const registerTargetRef = useCallback((targetRef, preparedStyles, measurementRef) => {
|
|
25
|
+
setTargetEntry(prev => {
|
|
26
|
+
if (prev?.ref === targetRef) {
|
|
27
|
+
return prev;
|
|
28
|
+
}
|
|
29
|
+
if (__DEV__ && prev !== null && !warnedAboutMultipleTargetsRef.current) {
|
|
30
|
+
warnedAboutMultipleTargetsRef.current = true;
|
|
31
|
+
logger.warn(MULTIPLE_TARGETS_WARNING);
|
|
32
|
+
}
|
|
33
|
+
return prev ?? {
|
|
34
|
+
ref: targetRef,
|
|
35
|
+
measurementRef: measurementRef ?? targetRef,
|
|
36
|
+
preparedStyles
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
}, []);
|
|
40
|
+
const unregisterTargetRef = useCallback(targetRef => {
|
|
41
|
+
setTargetEntry(prev => prev?.ref === targetRef ? null : prev);
|
|
42
|
+
}, []);
|
|
43
|
+
const contextValue = useMemo(() => ({
|
|
44
|
+
ownerRef,
|
|
45
|
+
registerTargetRef,
|
|
46
|
+
unregisterTargetRef,
|
|
47
|
+
activeTargetRef: targetEntry?.ref ?? null,
|
|
48
|
+
associatedTargetStyles,
|
|
49
|
+
entryTag,
|
|
50
|
+
portal
|
|
51
|
+
}), [ownerRef, registerTargetRef, unregisterTargetRef, targetEntry, associatedTargetStyles, entryTag, portal]);
|
|
52
|
+
return {
|
|
53
|
+
contextValue,
|
|
54
|
+
hasActiveTarget: targetEntry !== null,
|
|
55
|
+
measuredRef: targetEntry?.measurementRef ?? ownerRef,
|
|
56
|
+
targetPreparedStyles: targetEntry?.preparedStyles,
|
|
57
|
+
portal
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=boundary-owner.provider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useCallback","useMemo","useRef","useState","createProvider","logger","MULTIPLE_TARGETS_WARNING","TARGET_OUTSIDE_OWNER_WARNING","BoundaryOwnerProvider","useBoundaryOwnerContext","guarded","props","useBoundaryOwner","params","ownerRef","associatedTargetStyles","entryTag","portal","warnedAboutMultipleTargetsRef","targetEntry","setTargetEntry","registerTargetRef","targetRef","preparedStyles","measurementRef","prev","ref","__DEV__","current","warn","unregisterTargetRef","contextValue","activeTargetRef","hasActiveTarget","measuredRef","targetPreparedStyles"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/providers/boundary-owner.provider.tsx"],"mappings":";;AACA,SAAyBA,WAAW,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAI9E,OAAOC,cAAc,MAAM,gCAAgC;AAC3D,SAASC,MAAM,QAAQ,uBAAuB;AA4B9C;AACA,MAAMC,wBAAwB,GAC7B,8HAA8H;AAE/H,OAAO,MAAMC,4BAA4B,GACxC,gJAAgJ;AAOjJ,OAAO,MAAM;EAAEC,qBAAqB;EAAEC;AAAwB,CAAC,GAC9DL,cAAc,CAAC,eAAe,EAAE;EAAEM,OAAO,EAAE;AAAM,CAAC,CAAC,CAGhDC,KA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,iBAAiB,EACjBS,mBAAmB,EACnBX,WAAW,EACXJ,sBAAsB,EACtBC,QAAQ,EACRC,MAAM,CAER,CAAC;EAED,OAAO;IACNc,YAAY;IACZE,eAAe,EAAEd,WAAW,KAAK,IAAI;IACrCe,WAAW,EAAEf,WAAW,EAAEK,cAAc,IAAIV,QAAQ;IACpDqB,oBAAoB,EAAEhB,WAAW,EAAEI,cAAc;IACjDN;EACD,CAAC;AACF,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../../src","sources":["shared/components/boundary/types.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const getInitialDestinationMeasurePairKey = params => {
|
|
4
|
+
"worklet";
|
|
5
|
+
|
|
6
|
+
const {
|
|
7
|
+
enabled,
|
|
8
|
+
destinationPairKey,
|
|
9
|
+
ancestorDestinationPairKey,
|
|
10
|
+
linkId,
|
|
11
|
+
linkState
|
|
12
|
+
} = params;
|
|
13
|
+
const measurePairKey = destinationPairKey ?? ancestorDestinationPairKey;
|
|
14
|
+
if (!enabled || !measurePairKey) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
const hasDestination = linkState?.[measurePairKey]?.links?.[linkId]?.destination;
|
|
18
|
+
return hasDestination ? null : measurePairKey;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=destination-signals.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["getInitialDestinationMeasurePairKey","params","enabled","destinationPairKey","ancestorDestinationPairKey","linkId","linkState","measurePairKey","hasDestination","links","destination"],"sourceRoot":"../../../../../../src","sources":["shared/components/boundary/utils/destination-signals.ts"],"mappings":";;AAKA,OAAO,MAAMA,mCAAmC,GAAIC,MAMnD,IAA2B;EAC3B,SAAS;;EACT,MAAM;IACLC,OAAO;IACPC,kBAAkB;IAClBC,0BAA0B;IAC1BC,MAAM;IACNC;EACD,CAAC,GAAGL,MAAM;EACV,MAAMM,cAAc,GAAGJ,kBAAkB,IAAIC,0BAA0B;EAEvE,IAAI,CAACF,OAAO,IAAI,CAACK,cAAc,EAAE;IAChC,OAAO,IAAI;EACZ;EAEA,MAAMC,cAAc,GACnBF,SAAS,GAAGC,cAAc,CAAC,EAAEE,KAAK,GAAGJ,MAAM,CAAC,EAAEK,WAAW;EAE1D,OAAOF,cAAc,GAAG,IAAI,GAAGD,cAAc;AAC9C,CAAC","ignoreList":[]}
|