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
|
@@ -1,12 +1,71 @@
|
|
|
1
1
|
import type { MeasuredDimensions, StyleProps } from "react-native-reanimated";
|
|
2
2
|
import type { ScreenTransitionState } from "../../../types/animation.types";
|
|
3
|
-
import type { BoundsMethod } from "../../../types/bounds.types";
|
|
3
|
+
import type { BoundsInterpolationProps, BoundsMethod } from "../../../types/bounds.types";
|
|
4
4
|
import type { Layout } from "../../../types/screen.types";
|
|
5
5
|
export type BoundId = string | number;
|
|
6
6
|
export type BoundsAnchor = "topLeading" | "top" | "topTrailing" | "leading" | "center" | "trailing" | "bottomLeading" | "bottom" | "bottomTrailing";
|
|
7
7
|
export type BoundsScaleMode = "match" | "none" | "uniform";
|
|
8
8
|
type BoundsTarget = "bound" | "fullscreen" | MeasuredDimensions;
|
|
9
9
|
type BoundsSpace = "relative" | "absolute";
|
|
10
|
+
/**
|
|
11
|
+
* Transform values exposed to a bounds motion resolver.
|
|
12
|
+
*
|
|
13
|
+
* `x` and `y` map to the generated translate values. `scale` is a uniform scale
|
|
14
|
+
* view of the generated transform; non-uniform bounds transforms keep their
|
|
15
|
+
* existing `scaleX`/`scaleY` ratio and apply returned `scale` as a multiplier.
|
|
16
|
+
*
|
|
17
|
+
* `rotateX`/`rotateY` are optional 3D tilts in degrees around the element
|
|
18
|
+
* center. When either is set, a `perspective` entry is prepended to the
|
|
19
|
+
* transform so the tilt projects in 3D.
|
|
20
|
+
*/
|
|
21
|
+
export type BoundsMotionTransform = {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
scale: number;
|
|
25
|
+
/** Z-axis spin in degrees. */
|
|
26
|
+
rotate?: number;
|
|
27
|
+
rotateX?: number;
|
|
28
|
+
rotateY?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Perspective distance, prepended to the transform when any rotation is
|
|
31
|
+
* present or when set explicitly.
|
|
32
|
+
* @default 1000
|
|
33
|
+
*/
|
|
34
|
+
perspective?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Pivot for the ENTIRE transform stack, including the generated
|
|
37
|
+
* translate/scale. Bounds geometry computes its translations assuming the
|
|
38
|
+
* default center origin, so non-center origins offset the path — best for
|
|
39
|
+
* rotation-dominant motion.
|
|
40
|
+
*/
|
|
41
|
+
transformOrigin?: string | Array<string | number>;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Frame data passed to a bounds motion resolver: the generated transform
|
|
45
|
+
* (`current`), the resolved rects it travels between (`start`/`end` — these
|
|
46
|
+
* include target overrides and are not derivable from `props`), the phase
|
|
47
|
+
* (`progress`, normalized 0→1 regardless of enter/exit range), and the
|
|
48
|
+
* invoking interpolator's full `props`.
|
|
49
|
+
*
|
|
50
|
+
* `props` is screen-relative: the same motion can run under both the focused
|
|
51
|
+
* and unfocused screen's interpolators, and values like `props.active.gesture`
|
|
52
|
+
* differ per invocation. Direction is recoverable as `!props.next`; the raw
|
|
53
|
+
* un-normalized progress as `props.progress`.
|
|
54
|
+
*/
|
|
55
|
+
export type BoundsMotionFrame = {
|
|
56
|
+
progress: number;
|
|
57
|
+
current: BoundsMotionTransform;
|
|
58
|
+
start: MeasuredDimensions;
|
|
59
|
+
end: MeasuredDimensions;
|
|
60
|
+
props: BoundsInterpolationProps;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Worklet-safe function that can replace the generated bounds transform.
|
|
64
|
+
*
|
|
65
|
+
* Use this from `bounds({ motion })` to bend, delay, overshoot, or otherwise
|
|
66
|
+
* reshape a bounds transform without reimplementing the measurement logic.
|
|
67
|
+
*/
|
|
68
|
+
export type BoundsMotion = (frame: BoundsMotionFrame) => BoundsMotionTransform;
|
|
10
69
|
export type BoundsComputeParams = {
|
|
11
70
|
id?: BoundId;
|
|
12
71
|
previous?: ScreenTransitionState;
|
|
@@ -14,32 +73,41 @@ export type BoundsComputeParams = {
|
|
|
14
73
|
next?: ScreenTransitionState;
|
|
15
74
|
progress: number;
|
|
16
75
|
dimensions: Layout;
|
|
76
|
+
/** Invoking interpolator's props, surfaced to motion resolvers. */
|
|
77
|
+
interpolationProps: BoundsInterpolationProps;
|
|
17
78
|
};
|
|
18
|
-
type
|
|
79
|
+
type RawMotionRotation = {
|
|
80
|
+
/** Degrees; non-zero only when a motion resolver returned a rotation. */
|
|
81
|
+
rotate: number;
|
|
82
|
+
rotateX: number;
|
|
83
|
+
rotateY: number;
|
|
84
|
+
transformOrigin?: string | Array<string | number>;
|
|
85
|
+
};
|
|
86
|
+
type RawSizeAbsoluteReturn = RawMotionRotation & {
|
|
19
87
|
width: number;
|
|
20
88
|
height: number;
|
|
21
89
|
translateX: number;
|
|
22
90
|
translateY: number;
|
|
23
91
|
};
|
|
24
|
-
type RawSizeRelativeReturn = {
|
|
92
|
+
type RawSizeRelativeReturn = RawMotionRotation & {
|
|
25
93
|
translateX: number;
|
|
26
94
|
translateY: number;
|
|
27
95
|
width: number;
|
|
28
96
|
height: number;
|
|
29
97
|
};
|
|
30
|
-
type RawTransformAbsoluteReturn = {
|
|
98
|
+
type RawTransformAbsoluteReturn = RawMotionRotation & {
|
|
31
99
|
translateX: number;
|
|
32
100
|
translateY: number;
|
|
33
101
|
scaleX: number;
|
|
34
102
|
scaleY: number;
|
|
35
103
|
};
|
|
36
|
-
type RawTransformRelativeReturn = {
|
|
104
|
+
type RawTransformRelativeReturn = RawMotionRotation & {
|
|
37
105
|
translateX: number;
|
|
38
106
|
translateY: number;
|
|
39
107
|
scaleX: number;
|
|
40
108
|
scaleY: number;
|
|
41
109
|
};
|
|
42
|
-
type RawContentReturn = {
|
|
110
|
+
type RawContentReturn = RawMotionRotation & {
|
|
43
111
|
translateX: number;
|
|
44
112
|
translateY: number;
|
|
45
113
|
scale: number;
|
|
@@ -114,11 +182,30 @@ export type BoundsOptions = {
|
|
|
114
182
|
* @default "center"
|
|
115
183
|
*/
|
|
116
184
|
anchor?: BoundsAnchor;
|
|
185
|
+
/**
|
|
186
|
+
* Worklet-safe transform resolver for bounds output.
|
|
187
|
+
*
|
|
188
|
+
* `motion` receives the generated transform and returns the transform that
|
|
189
|
+
* should be rendered or returned from raw bounds. For `"size"` methods,
|
|
190
|
+
* returned `scale` is applied to the generated width and height.
|
|
191
|
+
*/
|
|
192
|
+
motion?: BoundsMotion;
|
|
117
193
|
/**
|
|
118
194
|
* If true, the raw values will be returned instead of the computed values.
|
|
119
195
|
* @default false
|
|
120
196
|
*/
|
|
121
197
|
raw?: boolean;
|
|
122
198
|
};
|
|
199
|
+
export type BoundsIdentity = {
|
|
200
|
+
id: BoundId;
|
|
201
|
+
group?: string;
|
|
202
|
+
};
|
|
203
|
+
export type BoundsIdentityInput = BoundId | BoundsIdentity;
|
|
204
|
+
export type BoundsComputeOptions = Omit<BoundsOptions, "group" | "id" | "raw">;
|
|
205
|
+
export type BoundsStyleResult = StyleProps;
|
|
206
|
+
export type BoundsMathResult<T extends BoundsComputeOptions = BoundsComputeOptions> = BoundsOptionsResult<T & {
|
|
207
|
+
id: BoundId;
|
|
208
|
+
raw: true;
|
|
209
|
+
}>;
|
|
123
210
|
export {};
|
|
124
211
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/types/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/types/options.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-screen-transitions",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.9.0-alpha.0",
|
|
4
4
|
"description": "Easy screen transitions for React Native and Expo",
|
|
5
5
|
"author": "Ed",
|
|
6
6
|
"license": "MIT",
|
|
@@ -84,7 +84,8 @@
|
|
|
84
84
|
"react-native-gesture-handler": ">=2.16.1",
|
|
85
85
|
"react-native-reanimated": ">=3.16.0 || >=4.0.0-",
|
|
86
86
|
"react-native-safe-area-context": "*",
|
|
87
|
-
"react-native-screens": ">=4.4.0"
|
|
87
|
+
"react-native-screens": ">=4.4.0",
|
|
88
|
+
"react-native-teleport": ">=1.1.0 <2.0.0"
|
|
88
89
|
},
|
|
89
90
|
"devDependencies": {
|
|
90
91
|
"@testing-library/react-native": "13.3.3",
|
|
@@ -2,11 +2,12 @@ import {
|
|
|
2
2
|
NavigationContext,
|
|
3
3
|
NavigationRouteContext,
|
|
4
4
|
} from "@react-navigation/native";
|
|
5
|
-
import {
|
|
5
|
+
import { memo } from "react";
|
|
6
6
|
import {
|
|
7
7
|
ActivityContainer,
|
|
8
8
|
ActivityScreen,
|
|
9
9
|
} from "../../shared/components/activity";
|
|
10
|
+
import { PortalProvider } from "../../shared/components/boundary/portal";
|
|
10
11
|
import { Overlay } from "../../shared/components/overlay";
|
|
11
12
|
import { ScreenComposer } from "../../shared/providers/screen/screen-composer";
|
|
12
13
|
import { withBlankStack } from "../../shared/providers/stack/blank-stack.provider";
|
|
@@ -56,7 +57,7 @@ export const StackView = withStackCore(
|
|
|
56
57
|
withBlankStack<BlankStackDescriptor, BlankStackNavigationHelpers>(
|
|
57
58
|
({ scenes, shouldShowFloatOverlay }) => {
|
|
58
59
|
return (
|
|
59
|
-
<
|
|
60
|
+
<PortalProvider>
|
|
60
61
|
{shouldShowFloatOverlay ? <Overlay.Float /> : null}
|
|
61
62
|
|
|
62
63
|
<ActivityContainer>
|
|
@@ -73,7 +74,7 @@ export const StackView = withStackCore(
|
|
|
73
74
|
);
|
|
74
75
|
})}
|
|
75
76
|
</ActivityContainer>
|
|
76
|
-
</
|
|
77
|
+
</PortalProvider>
|
|
77
78
|
);
|
|
78
79
|
},
|
|
79
80
|
),
|
package/src/shared/components/{create-boundary-component → boundary}/components/boundary-target.tsx
RENAMED
|
@@ -3,6 +3,8 @@ import { memo, useLayoutEffect, useMemo } from "react";
|
|
|
3
3
|
import type { View } from "react-native";
|
|
4
4
|
import Animated, { useAnimatedRef } from "react-native-reanimated";
|
|
5
5
|
import { prepareStyleForBounds } from "../../../utils/bounds/helpers/styles/styles";
|
|
6
|
+
import { logger } from "../../../utils/logger";
|
|
7
|
+
import { Portal } from "../portal/components/portal";
|
|
6
8
|
import {
|
|
7
9
|
TARGET_OUTSIDE_OWNER_WARNING,
|
|
8
10
|
useBoundaryOwnerContext,
|
|
@@ -15,21 +17,29 @@ export const BoundaryTarget = memo(function BoundaryTarget(
|
|
|
15
17
|
) {
|
|
16
18
|
const { style, ...rest } = props;
|
|
17
19
|
const targetAnimatedRef = useAnimatedRef<View>();
|
|
20
|
+
const placeholderAnimatedRef = useAnimatedRef<View>();
|
|
18
21
|
const ownerContext = useBoundaryOwnerContext();
|
|
19
22
|
const registerTargetRef = ownerContext?.registerTargetRef;
|
|
20
23
|
const unregisterTargetRef = ownerContext?.unregisterTargetRef;
|
|
21
24
|
const isActiveTarget = ownerContext?.activeTargetRef === targetAnimatedRef;
|
|
22
25
|
const preparedStyles = useMemo(() => prepareStyleForBounds(style), [style]);
|
|
26
|
+
// Portal'd content can be teleported into another screen's host; measuring
|
|
27
|
+
// it there would capture its CURRENT (destination) position as the source
|
|
28
|
+
// bounds. The portal placeholder keeps the layout slot at home, so it is
|
|
29
|
+
// the truthful measurement surface whenever a portal is configured.
|
|
30
|
+
const measurementRef = ownerContext?.portal
|
|
31
|
+
? placeholderAnimatedRef
|
|
32
|
+
: targetAnimatedRef;
|
|
23
33
|
|
|
24
34
|
useLayoutEffect(() => {
|
|
25
35
|
if (!registerTargetRef || !unregisterTargetRef) {
|
|
26
36
|
if (__DEV__) {
|
|
27
|
-
|
|
37
|
+
logger.warn(TARGET_OUTSIDE_OWNER_WARNING);
|
|
28
38
|
}
|
|
29
39
|
return;
|
|
30
40
|
}
|
|
31
41
|
|
|
32
|
-
registerTargetRef(targetAnimatedRef, preparedStyles);
|
|
42
|
+
registerTargetRef(targetAnimatedRef, preparedStyles, measurementRef);
|
|
33
43
|
return () => {
|
|
34
44
|
unregisterTargetRef(targetAnimatedRef);
|
|
35
45
|
};
|
|
@@ -38,17 +48,24 @@ export const BoundaryTarget = memo(function BoundaryTarget(
|
|
|
38
48
|
unregisterTargetRef,
|
|
39
49
|
targetAnimatedRef,
|
|
40
50
|
preparedStyles,
|
|
51
|
+
measurementRef,
|
|
41
52
|
]);
|
|
42
53
|
|
|
43
54
|
return (
|
|
44
|
-
<
|
|
45
|
-
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
<Portal
|
|
56
|
+
id={ownerContext?.entryTag}
|
|
57
|
+
mode={ownerContext?.portal}
|
|
58
|
+
placeholderRef={placeholderAnimatedRef}
|
|
59
|
+
>
|
|
60
|
+
<Animated.View
|
|
61
|
+
{...rest}
|
|
62
|
+
ref={targetAnimatedRef}
|
|
63
|
+
style={[
|
|
64
|
+
style,
|
|
65
|
+
isActiveTarget ? ownerContext.associatedTargetStyles : undefined,
|
|
66
|
+
]}
|
|
67
|
+
collapsable={false}
|
|
68
|
+
/>
|
|
69
|
+
</Portal>
|
|
53
70
|
);
|
|
54
71
|
});
|
package/src/shared/components/{create-boundary-component → boundary}/create-boundary-component.tsx
RENAMED
|
@@ -13,7 +13,7 @@ import Animated, {
|
|
|
13
13
|
useAnimatedStyle,
|
|
14
14
|
} from "react-native-reanimated";
|
|
15
15
|
import { NO_STYLES } from "../../constants";
|
|
16
|
-
import {
|
|
16
|
+
import { useDescriptorsStore } from "../../providers/screen/descriptors";
|
|
17
17
|
import { useScreenStyles } from "../../providers/screen/styles";
|
|
18
18
|
import { createPendingPairKey } from "../../stores/bounds/helpers/link-pairs.helpers";
|
|
19
19
|
import { prepareStyleForBounds } from "../../utils/bounds/helpers/styles/styles";
|
|
@@ -57,32 +57,22 @@ export function createBoundaryComponent<P extends object>(
|
|
|
57
57
|
method,
|
|
58
58
|
style,
|
|
59
59
|
onPress,
|
|
60
|
+
portal,
|
|
60
61
|
...rest
|
|
61
62
|
} = props as any;
|
|
62
63
|
|
|
63
64
|
const linkId = String(id);
|
|
64
65
|
const entryTag = group ? `${group}:${linkId}` : linkId;
|
|
65
66
|
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
} = useDescriptorDerivations();
|
|
67
|
+
const currentScreenKey = useDescriptorsStore(
|
|
68
|
+
(s) => s.derivations.currentScreenKey,
|
|
69
|
+
);
|
|
70
|
+
const hasConfiguredInterpolator = useDescriptorsStore(
|
|
71
|
+
(s) => s.derivations.hasConfiguredInterpolator,
|
|
72
|
+
);
|
|
73
73
|
|
|
74
74
|
const runtimeEnabled = enabled && hasConfiguredInterpolator;
|
|
75
|
-
const
|
|
76
|
-
const boundaryConfig = useMemo<BoundaryConfigProps | undefined>(() => {
|
|
77
|
-
if (
|
|
78
|
-
anchor === undefined &&
|
|
79
|
-
scaleMode === undefined &&
|
|
80
|
-
target === undefined &&
|
|
81
|
-
method === undefined
|
|
82
|
-
) {
|
|
83
|
-
return undefined;
|
|
84
|
-
}
|
|
85
|
-
|
|
75
|
+
const boundaryConfig = useMemo<BoundaryConfigProps>(() => {
|
|
86
76
|
return {
|
|
87
77
|
anchor,
|
|
88
78
|
scaleMode,
|
|
@@ -119,10 +109,19 @@ export function createBoundaryComponent<P extends object>(
|
|
|
119
109
|
useBoundaryOwner({
|
|
120
110
|
ownerRef,
|
|
121
111
|
associatedTargetStyles: runtimeEnabled ? associatedStyles : undefined,
|
|
112
|
+
entryTag,
|
|
113
|
+
portal,
|
|
122
114
|
});
|
|
123
115
|
|
|
124
116
|
const preparedStyles = targetPreparedStyles ?? ownerPreparedStyles;
|
|
125
117
|
|
|
118
|
+
const portalHost =
|
|
119
|
+
typeof portal === "object"
|
|
120
|
+
? (portal.attachTo ?? "current-screen")
|
|
121
|
+
: portal
|
|
122
|
+
? "current-screen"
|
|
123
|
+
: undefined;
|
|
124
|
+
|
|
126
125
|
const measureBoundary = useMeasurer({
|
|
127
126
|
enabled,
|
|
128
127
|
entryTag,
|
|
@@ -131,10 +130,9 @@ export function createBoundaryComponent<P extends object>(
|
|
|
131
130
|
currentScreenKey,
|
|
132
131
|
preparedStyles,
|
|
133
132
|
measuredAnimatedRef: measuredRef,
|
|
133
|
+
portalHost,
|
|
134
134
|
});
|
|
135
135
|
|
|
136
|
-
const shouldRunDestinationEffects = runtimeEnabled && !hasNextScreen;
|
|
137
|
-
|
|
138
136
|
// Register/unregister this boundary in the presence map so source/destination
|
|
139
137
|
// matching can resolve across concrete screen keys.
|
|
140
138
|
useBoundaryPresence({
|
|
@@ -149,9 +147,7 @@ export function createBoundaryComponent<P extends object>(
|
|
|
149
147
|
|
|
150
148
|
useInitialSourceMeasurement({
|
|
151
149
|
enabled: runtimeEnabled,
|
|
152
|
-
nextScreenKey,
|
|
153
150
|
measureBoundary,
|
|
154
|
-
currentScreenKey,
|
|
155
151
|
linkId,
|
|
156
152
|
group,
|
|
157
153
|
shouldAutoMeasure: shouldPassivelyMeasureSource,
|
|
@@ -159,21 +155,14 @@ export function createBoundaryComponent<P extends object>(
|
|
|
159
155
|
|
|
160
156
|
useInitialDestinationMeasurement({
|
|
161
157
|
linkId,
|
|
162
|
-
enabled:
|
|
163
|
-
currentScreenKey,
|
|
164
|
-
preferredSourceScreenKey,
|
|
165
|
-
ancestorScreenKeys: ancestorKeys,
|
|
158
|
+
enabled: runtimeEnabled,
|
|
166
159
|
measureBoundary,
|
|
167
160
|
});
|
|
168
161
|
|
|
169
162
|
useRefreshBoundary({
|
|
170
163
|
enabled: runtimeEnabled,
|
|
171
|
-
currentScreenKey,
|
|
172
|
-
preferredSourceScreenKey,
|
|
173
|
-
nextScreenKey,
|
|
174
164
|
linkId,
|
|
175
165
|
group,
|
|
176
|
-
ancestorScreenKeys: ancestorKeys,
|
|
177
166
|
measureBoundary,
|
|
178
167
|
});
|
|
179
168
|
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cancelAnimation,
|
|
3
|
+
useAnimatedReaction,
|
|
4
|
+
useSharedValue,
|
|
5
|
+
withDelay,
|
|
6
|
+
withTiming,
|
|
7
|
+
} from "react-native-reanimated";
|
|
8
|
+
import { useDescriptorsStore } from "../../../providers/screen/descriptors";
|
|
9
|
+
import { AnimationStore } from "../../../stores/animation.store";
|
|
10
|
+
import { getDestination } from "../../../stores/bounds/internals/links";
|
|
11
|
+
import { pairs } from "../../../stores/bounds/internals/state";
|
|
12
|
+
import {
|
|
13
|
+
LifecycleTransitionRequestKind,
|
|
14
|
+
SystemStore,
|
|
15
|
+
} from "../../../stores/system.store";
|
|
16
|
+
import { logger } from "../../../utils/logger";
|
|
17
|
+
import type { MeasureBoundary } from "../types";
|
|
18
|
+
import { getInitialDestinationMeasurePairKey } from "../utils/destination-signals";
|
|
19
|
+
|
|
20
|
+
const VIEWPORT_RETRY_DELAY_MS = 16;
|
|
21
|
+
/**
|
|
22
|
+
* A destination that keeps failing its measurement guards must not hold the
|
|
23
|
+
* transition gate forever — after this budget the block is released with a
|
|
24
|
+
* warning so the open proceeds without that boundary.
|
|
25
|
+
*/
|
|
26
|
+
const MAX_VIEWPORT_RETRIES = 20;
|
|
27
|
+
|
|
28
|
+
interface UseInitialDestinationMeasurementParams {
|
|
29
|
+
linkId: string;
|
|
30
|
+
enabled: boolean;
|
|
31
|
+
measureBoundary: MeasureBoundary;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const useInitialDestinationMeasurement = ({
|
|
35
|
+
linkId,
|
|
36
|
+
enabled,
|
|
37
|
+
measureBoundary,
|
|
38
|
+
}: UseInitialDestinationMeasurementParams) => {
|
|
39
|
+
const currentScreenKey = useDescriptorsStore(
|
|
40
|
+
(s) => s.derivations.currentScreenKey,
|
|
41
|
+
);
|
|
42
|
+
const nextScreenKey = useDescriptorsStore((s) => s.derivations.nextScreenKey);
|
|
43
|
+
const destinationPairKey = useDescriptorsStore(
|
|
44
|
+
(s) => s.derivations.destinationPairKey,
|
|
45
|
+
);
|
|
46
|
+
const ancestorDestinationPairKey = useDescriptorsStore(
|
|
47
|
+
(s) => s.derivations.ancestorDestinationPairKey,
|
|
48
|
+
);
|
|
49
|
+
const destinationEnabled = enabled && !nextScreenKey;
|
|
50
|
+
const progress = AnimationStore.getValue(
|
|
51
|
+
currentScreenKey,
|
|
52
|
+
"transitionProgress",
|
|
53
|
+
);
|
|
54
|
+
const system = SystemStore.getBag(currentScreenKey);
|
|
55
|
+
const { pendingLifecycleRequestKind } = system;
|
|
56
|
+
const { blockLifecycleStart, unblockLifecycleStart } = system.actions;
|
|
57
|
+
const isBlockingLifecycleStart = useSharedValue(0);
|
|
58
|
+
const retryToken = useSharedValue(0);
|
|
59
|
+
const viewportRetries = useSharedValue(0);
|
|
60
|
+
const hasGivenUp = useSharedValue(0);
|
|
61
|
+
|
|
62
|
+
const releaseLifecycleStartBlock = () => {
|
|
63
|
+
"worklet";
|
|
64
|
+
cancelAnimation(retryToken);
|
|
65
|
+
|
|
66
|
+
if (!isBlockingLifecycleStart.get()) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
unblockLifecycleStart();
|
|
71
|
+
isBlockingLifecycleStart.set(0);
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
useAnimatedReaction(
|
|
75
|
+
() => {
|
|
76
|
+
"worklet";
|
|
77
|
+
const retryTick = retryToken.get();
|
|
78
|
+
|
|
79
|
+
const hasPendingOpenRequest =
|
|
80
|
+
pendingLifecycleRequestKind.get() ===
|
|
81
|
+
LifecycleTransitionRequestKind.Open;
|
|
82
|
+
|
|
83
|
+
const isWaitingForOpenToStart = progress.get() <= 0;
|
|
84
|
+
|
|
85
|
+
if (!hasPendingOpenRequest || !isWaitingForOpenToStart) {
|
|
86
|
+
return [0, retryTick] as const;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const measurePairKey = getInitialDestinationMeasurePairKey({
|
|
90
|
+
enabled: destinationEnabled,
|
|
91
|
+
destinationPairKey,
|
|
92
|
+
ancestorDestinationPairKey,
|
|
93
|
+
linkId,
|
|
94
|
+
linkState:
|
|
95
|
+
destinationEnabled &&
|
|
96
|
+
(destinationPairKey || ancestorDestinationPairKey)
|
|
97
|
+
? pairs.get()
|
|
98
|
+
: undefined,
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
return [measurePairKey, retryTick] as const;
|
|
102
|
+
},
|
|
103
|
+
([measurePairKey]) => {
|
|
104
|
+
"worklet";
|
|
105
|
+
if (!measurePairKey) {
|
|
106
|
+
releaseLifecycleStartBlock();
|
|
107
|
+
viewportRetries.set(0);
|
|
108
|
+
hasGivenUp.set(0);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
if (hasGivenUp.get()) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (!isBlockingLifecycleStart.get()) {
|
|
117
|
+
blockLifecycleStart();
|
|
118
|
+
isBlockingLifecycleStart.set(1);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
measureBoundary({
|
|
122
|
+
type: "destination",
|
|
123
|
+
pairKey: measurePairKey,
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
const destinationAttached =
|
|
127
|
+
getDestination(measurePairKey, linkId) !== null;
|
|
128
|
+
|
|
129
|
+
if (destinationAttached) {
|
|
130
|
+
releaseLifecycleStartBlock();
|
|
131
|
+
viewportRetries.set(0);
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (viewportRetries.get() >= MAX_VIEWPORT_RETRIES) {
|
|
136
|
+
hasGivenUp.set(1);
|
|
137
|
+
releaseLifecycleStartBlock();
|
|
138
|
+
logger.warn(
|
|
139
|
+
`Destination boundary "${linkId}" never produced a valid measurement after ${MAX_VIEWPORT_RETRIES} attempts; releasing the transition gate without it. The boundary is likely off-viewport (e.g. an inactive group member on a paged screen) or unmounted.`,
|
|
140
|
+
);
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
// Destination did not attach (malformed off-screen measurement); retry
|
|
145
|
+
// on the next tick while the lifecycle stays blocked.
|
|
146
|
+
viewportRetries.set(viewportRetries.get() + 1);
|
|
147
|
+
cancelAnimation(retryToken);
|
|
148
|
+
retryToken.set(
|
|
149
|
+
withDelay(
|
|
150
|
+
VIEWPORT_RETRY_DELAY_MS,
|
|
151
|
+
withTiming(retryToken.get() + 1, { duration: 0 }),
|
|
152
|
+
),
|
|
153
|
+
);
|
|
154
|
+
},
|
|
155
|
+
);
|
|
156
|
+
};
|
|
@@ -1,26 +1,18 @@
|
|
|
1
1
|
import { useAnimatedReaction, useSharedValue } from "react-native-reanimated";
|
|
2
|
+
import { useDescriptorsStore } from "../../../providers/screen/descriptors";
|
|
2
3
|
import { pairs } from "../../../stores/bounds/internals/state";
|
|
3
4
|
import type { MeasureBoundary } from "../types";
|
|
4
5
|
import { getInitialSourceCaptureSignal } from "../utils/source-signals";
|
|
5
6
|
|
|
6
7
|
export const useInitialSourceMeasurement = (params: {
|
|
7
8
|
enabled: boolean;
|
|
8
|
-
nextScreenKey?: string;
|
|
9
|
-
currentScreenKey?: string;
|
|
10
9
|
measureBoundary: MeasureBoundary;
|
|
11
10
|
linkId: string;
|
|
12
11
|
group?: string;
|
|
13
12
|
shouldAutoMeasure: boolean;
|
|
14
13
|
}) => {
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
nextScreenKey,
|
|
18
|
-
measureBoundary,
|
|
19
|
-
linkId,
|
|
20
|
-
currentScreenKey,
|
|
21
|
-
group,
|
|
22
|
-
shouldAutoMeasure,
|
|
23
|
-
} = params;
|
|
14
|
+
const { enabled, measureBoundary, linkId, group, shouldAutoMeasure } = params;
|
|
15
|
+
const sourcePairKey = useDescriptorsStore((s) => s.derivations.sourcePairKey);
|
|
24
16
|
const lastSourceCaptureSignal = useSharedValue<string | null>(null);
|
|
25
17
|
|
|
26
18
|
useAnimatedReaction(
|
|
@@ -28,12 +20,11 @@ export const useInitialSourceMeasurement = (params: {
|
|
|
28
20
|
"worklet";
|
|
29
21
|
return getInitialSourceCaptureSignal({
|
|
30
22
|
enabled,
|
|
31
|
-
|
|
32
|
-
currentScreenKey,
|
|
23
|
+
sourcePairKey,
|
|
33
24
|
linkId,
|
|
34
25
|
group,
|
|
35
26
|
shouldAutoMeasure,
|
|
36
|
-
linkState:
|
|
27
|
+
linkState: shouldAutoMeasure && sourcePairKey ? pairs.get() : undefined,
|
|
37
28
|
});
|
|
38
29
|
},
|
|
39
30
|
(captureSignal) => {
|