react-native-screen-transitions 3.4.0 → 3.5.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/README.md +5 -2
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js +21 -32
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +2 -2
- package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +5 -5
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement.js +27 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js +7 -2
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-capture-destination-boundary.js +110 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-capture-destination-boundary.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-capture-source-boundary.js +40 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-capture-source-boundary.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js +79 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/{use-pre-transition-measurement.js → use-refresh-boundary.js} +26 -27
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -0
- package/lib/commonjs/shared/components/create-transition-aware-component.js +4 -13
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +1 -0
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +7 -10
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +3 -3
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +4 -5
- package/lib/commonjs/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -3
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/surface-container.js +3 -3
- package/lib/commonjs/shared/components/screen-container/layers/surface-container.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/helpers/reset-stores-for-screen.js +28 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/helpers/reset-stores-for-screen.js.map +1 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/history/navigator-route-registry.js.map +1 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/{use-screen-events.js → history/use-screen-history.js} +17 -11
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/history/use-screen-history.js.map +1 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +140 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/{use-open-transition.js → use-open-transition-intent.js} +14 -24
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition-intent.js.map +1 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js +53 -0
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -0
- package/lib/commonjs/shared/components/screen-lifecycle/index.js +17 -14
- package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/commonjs/shared/constants.js +6 -17
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/providers/register-bounds.provider.js +6 -9
- package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/animation.provider.js +26 -44
- package/lib/commonjs/shared/providers/screen/animation/animation.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js +19 -35
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +64 -38
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -2
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/types.js +4 -0
- package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js +19 -5
- package/lib/commonjs/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +1 -0
- package/lib/commonjs/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/components/maybe-floating-container.js +29 -0
- package/lib/commonjs/shared/providers/screen/styles/components/maybe-floating-container.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/constants.js +36 -0
- package/lib/commonjs/shared/providers/screen/styles/constants.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/normalize-slots.js +49 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/normalize-slots.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles.js +137 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +75 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +49 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +31 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/styles.provider.js +33 -107
- package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/helpers/apply-measured-bounds-writes.js +13 -7
- package/lib/commonjs/shared/stores/bounds/helpers/apply-measured-bounds-writes.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/helpers/keys.js +10 -0
- package/lib/commonjs/shared/stores/bounds/helpers/keys.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/index.js +26 -25
- package/lib/commonjs/shared/stores/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/clear.js +13 -51
- package/lib/commonjs/shared/stores/bounds/internals/clear.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/groups.js +27 -0
- package/lib/commonjs/shared/stores/bounds/internals/groups.js.map +1 -0
- package/lib/commonjs/shared/stores/bounds/internals/registry.js +210 -185
- package/lib/commonjs/shared/stores/bounds/internals/registry.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +2 -6
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/state.js +2 -3
- package/lib/commonjs/shared/stores/bounds/internals/state.js.map +1 -1
- package/lib/commonjs/shared/stores/system.store.js +44 -11
- package/lib/commonjs/shared/stores/system.store.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-bound-tag.js +4 -0
- package/lib/commonjs/shared/utils/bounds/helpers/create-bound-tag.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-interpolators.js +6 -6
- package/lib/commonjs/shared/utils/bounds/helpers/create-interpolators.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js +9 -3
- 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 +5 -8
- package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js +2 -8
- package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/index.js +7 -5
- package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/build.js +44 -144
- package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/create-store.js +13 -4
- package/lib/commonjs/shared/utils/create-store.js.map +1 -1
- package/lib/commonjs/shared/utils/platform.js +1 -0
- package/lib/commonjs/shared/utils/platform.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js +21 -32
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +2 -2
- package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +2 -2
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement.js +21 -0
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js +7 -2
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-presence.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-capture-destination-boundary.js +105 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-capture-destination-boundary.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-capture-source-boundary.js +35 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-capture-source-boundary.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js +74 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-measurer.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/{use-pre-transition-measurement.js → use-refresh-boundary.js} +24 -25
- package/lib/module/shared/components/create-boundary-component/hooks/use-refresh-boundary.js.map +1 -0
- package/lib/module/shared/components/create-transition-aware-component.js +4 -13
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/overlay/variations/float-overlay.js +1 -0
- package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +8 -11
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/backdrop.js +3 -3
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +4 -5
- package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -3
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/surface-container.js +3 -3
- package/lib/module/shared/components/screen-container/layers/surface-container.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/helpers/reset-stores-for-screen.js +24 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/helpers/reset-stores-for-screen.js.map +1 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/history/navigator-route-registry.js.map +1 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/{use-screen-events.js → history/use-screen-history.js} +16 -10
- package/lib/module/shared/components/screen-lifecycle/hooks/history/use-screen-history.js.map +1 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js +134 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition-intent.js.map +1 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/{use-open-transition.js → use-open-transition-intent.js} +13 -24
- package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition-intent.js.map +1 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js +48 -0
- package/lib/module/shared/components/screen-lifecycle/hooks/use-transition-start-controller.js.map +1 -0
- package/lib/module/shared/components/screen-lifecycle/index.js +18 -15
- package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/module/shared/constants.js +5 -16
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/providers/register-bounds.provider.js +6 -9
- package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/animation.provider.js +22 -43
- package/lib/module/shared/providers/screen/animation/animation.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js +19 -35
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +65 -39
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/resolve-screen-animation-target.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -2
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/types.js +2 -0
- package/lib/module/shared/providers/screen/animation/use-screen-animation.js +19 -5
- package/lib/module/shared/providers/screen/animation/use-screen-animation.js.map +1 -1
- package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js +1 -0
- package/lib/module/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/components/maybe-floating-container.js +25 -0
- package/lib/module/shared/providers/screen/styles/components/maybe-floating-container.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/constants.js +31 -0
- package/lib/module/shared/providers/screen/styles/constants.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/normalize-slots.js +45 -0
- package/lib/module/shared/providers/screen/styles/helpers/normalize-slots.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles.js +132 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +70 -0
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +44 -0
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +26 -0
- package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/styles.provider.js +34 -108
- package/lib/module/shared/providers/screen/styles/styles.provider.js.map +1 -1
- package/lib/module/shared/stores/bounds/helpers/apply-measured-bounds-writes.js +13 -7
- package/lib/module/shared/stores/bounds/helpers/apply-measured-bounds-writes.js.map +1 -1
- package/lib/module/shared/stores/bounds/helpers/keys.js +8 -0
- package/lib/module/shared/stores/bounds/helpers/keys.js.map +1 -1
- package/lib/module/shared/stores/bounds/index.js +27 -26
- package/lib/module/shared/stores/bounds/index.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/clear.js +14 -52
- package/lib/module/shared/stores/bounds/internals/clear.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/groups.js +23 -0
- package/lib/module/shared/stores/bounds/internals/groups.js.map +1 -0
- package/lib/module/shared/stores/bounds/internals/registry.js +204 -178
- package/lib/module/shared/stores/bounds/internals/registry.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +2 -6
- package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/state.js +1 -2
- package/lib/module/shared/stores/bounds/internals/state.js.map +1 -1
- package/lib/module/shared/stores/system.store.js +43 -10
- package/lib/module/shared/stores/system.store.js.map +1 -1
- package/lib/module/shared/types/animation.types.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-bound-tag.js +4 -0
- package/lib/module/shared/utils/bounds/helpers/create-bound-tag.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-interpolators.js +6 -6
- package/lib/module/shared/utils/bounds/helpers/create-interpolators.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js +9 -3
- 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 +5 -8
- package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/styles/compute.js +3 -9
- package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
- package/lib/module/shared/utils/bounds/index.js +7 -5
- package/lib/module/shared/utils/bounds/index.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/build.js +46 -146
- package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/create-store.js +13 -4
- package/lib/module/shared/utils/create-store.js.map +1 -1
- package/lib/module/shared/utils/platform.js +1 -0
- package/lib/module/shared/utils/platform.js.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts +4 -4
- package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +8 -8
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement.d.ts +5 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-presence.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-capture-destination-boundary.d.ts +13 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-capture-destination-boundary.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-capture-source-boundary.d.ts +10 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-capture-source-boundary.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/{use-boundary-measure-and-store.d.ts → use-measurer.d.ts} +6 -4
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-measurer.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts +14 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-refresh-boundary.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts +2 -2
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts +6 -3
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +1 -1
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/scene-view.d.ts +1 -1
- package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts +2 -2
- package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/helpers/reset-stores-for-screen.d.ts +2 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/helpers/reset-stores-for-screen.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/history/navigator-route-registry.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/history/use-screen-history.d.ts +7 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/history/use-screen-history.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts +11 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition-intent.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition-intent.d.ts +8 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition-intent.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-transition-start-controller.d.ts +11 -0
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-transition-start-controller.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-lifecycle/index.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +1 -14
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +4 -4
- package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts +7 -8
- package/lib/typescript/shared/providers/screen/animation/animation.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts +0 -8
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts +3 -3
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/resolve-screen-animation-target.d.ts +4 -6
- package/lib/typescript/shared/providers/screen/animation/helpers/resolve-screen-animation-target.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/types.d.ts +7 -0
- package/lib/typescript/shared/providers/screen/animation/types.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/animation/use-screen-animation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts +1 -0
- package/lib/typescript/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/components/maybe-floating-container.d.ts +7 -0
- package/lib/typescript/shared/providers/screen/styles/components/maybe-floating-container.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/constants.d.ts +23 -0
- package/lib/typescript/shared/providers/screen/styles/constants.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/normalize-slots.d.ts +3 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/normalize-slots.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles.d.ts +17 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +3 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +9 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.d.ts +9 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts +2 -2
- package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +1 -1
- package/lib/typescript/shared/stores/animation.store.d.ts +1 -7
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/helpers/apply-measured-bounds-writes.d.ts +1 -1
- package/lib/typescript/shared/stores/bounds/helpers/apply-measured-bounds-writes.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/helpers/keys.d.ts +1 -0
- package/lib/typescript/shared/stores/bounds/helpers/keys.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/index.d.ts +28 -27
- package/lib/typescript/shared/stores/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/clear.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/groups.d.ts +4 -0
- package/lib/typescript/shared/stores/bounds/internals/groups.d.ts.map +1 -0
- package/lib/typescript/shared/stores/bounds/internals/registry.d.ts +12 -11
- package/lib/typescript/shared/stores/bounds/internals/registry.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 +1 -2
- package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts +21 -19
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- package/lib/typescript/shared/stores/gesture.store.d.ts +1 -7
- package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/system.store.d.ts +33 -8
- package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +5 -25
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +7 -5
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +20 -0
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-bound-tag.d.ts +6 -2
- package/lib/typescript/shared/utils/bounds/helpers/create-bound-tag.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-interpolators.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts +3 -2
- 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 +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/types.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/create-store.d.ts +13 -8
- package/lib/typescript/shared/utils/create-store.d.ts.map +1 -1
- package/lib/typescript/shared/utils/platform.d.ts +0 -3
- package/lib/typescript/shared/utils/platform.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/components/create-boundary-component/create-boundary-component.tsx +21 -39
- package/src/shared/components/create-boundary-component/helpers/resolve-pending-source-key.ts +3 -6
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +12 -12
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement.ts +43 -0
- package/src/shared/components/create-boundary-component/hooks/use-boundary-presence.ts +3 -8
- package/src/shared/components/create-boundary-component/hooks/use-capture-destination-boundary.ts +149 -0
- package/src/shared/components/create-boundary-component/hooks/use-capture-source-boundary.ts +42 -0
- package/src/shared/components/create-boundary-component/hooks/use-measurer.ts +144 -0
- package/src/shared/components/create-boundary-component/hooks/{use-pre-transition-measurement.ts → use-refresh-boundary.ts} +35 -30
- package/src/shared/components/create-boundary-component/types.ts +7 -3
- package/src/shared/components/create-transition-aware-component.tsx +4 -13
- package/src/shared/components/overlay/variations/float-overlay.tsx +1 -1
- package/src/shared/components/screen-container/hooks/use-content-layout.ts +14 -11
- package/src/shared/components/screen-container/layers/backdrop.tsx +3 -3
- package/src/shared/components/screen-container/layers/content.tsx +4 -7
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +4 -5
- package/src/shared/components/screen-container/layers/surface-container.tsx +3 -3
- package/src/shared/components/screen-lifecycle/hooks/helpers/reset-stores-for-screen.ts +29 -0
- package/src/shared/components/screen-lifecycle/hooks/{use-screen-events.ts → history/use-screen-history.ts} +25 -9
- package/src/shared/components/screen-lifecycle/hooks/use-close-transition-intent.ts +160 -0
- package/src/shared/components/screen-lifecycle/hooks/{use-open-transition.ts → use-open-transition-intent.ts} +19 -23
- package/src/shared/components/screen-lifecycle/hooks/use-transition-start-controller.ts +71 -0
- package/src/shared/components/screen-lifecycle/index.tsx +17 -17
- package/src/shared/constants.ts +3 -11
- package/src/shared/providers/register-bounds.provider.tsx +7 -12
- package/src/shared/providers/screen/animation/animation.provider.tsx +30 -68
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state.ts +20 -33
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +96 -69
- package/src/shared/providers/screen/animation/helpers/resolve-screen-animation-target.ts +5 -7
- package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +14 -2
- package/src/shared/providers/screen/animation/types.ts +9 -0
- package/src/shared/providers/screen/animation/use-screen-animation.tsx +25 -7
- package/src/shared/providers/screen/descriptors/helpers/derive-descriptor-derivations.ts +2 -0
- package/src/shared/providers/screen/styles/components/maybe-floating-container.tsx +29 -0
- package/src/shared/providers/screen/styles/constants.ts +34 -0
- package/src/shared/providers/screen/styles/helpers/normalize-slots.ts +61 -0
- package/src/shared/providers/screen/styles/helpers/resolve-slot-styles.ts +190 -0
- package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +85 -0
- package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +51 -0
- package/src/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.tsx +40 -0
- package/src/shared/providers/screen/styles/styles.provider.tsx +42 -146
- package/src/shared/stores/bounds/helpers/apply-measured-bounds-writes.ts +15 -13
- package/src/shared/stores/bounds/helpers/keys.ts +8 -0
- package/src/shared/stores/bounds/index.ts +37 -44
- package/src/shared/stores/bounds/internals/clear.ts +22 -86
- package/src/shared/stores/bounds/internals/groups.ts +20 -0
- package/src/shared/stores/bounds/internals/registry.ts +280 -234
- package/src/shared/stores/bounds/internals/resolver.ts +1 -5
- package/src/shared/stores/bounds/internals/state.ts +2 -3
- package/src/shared/stores/bounds/types.ts +23 -21
- package/src/shared/stores/system.store.ts +77 -9
- package/src/shared/types/animation.types.ts +5 -25
- package/src/shared/types/bounds.types.ts +7 -8
- package/src/shared/types/screen.types.ts +21 -0
- package/src/shared/utils/bounds/helpers/create-bound-tag.ts +6 -2
- package/src/shared/utils/bounds/helpers/create-interpolators.ts +10 -7
- package/src/shared/utils/bounds/helpers/create-link-accessor.ts +12 -5
- package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +4 -7
- package/src/shared/utils/bounds/helpers/styles/compute.ts +2 -10
- package/src/shared/utils/bounds/index.ts +7 -6
- package/src/shared/utils/bounds/zoom/build.ts +53 -162
- package/src/shared/utils/bounds/zoom/types.ts +1 -1
- package/src/shared/utils/create-store.ts +39 -13
- package/src/shared/utils/platform.ts +2 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +0 -44
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +0 -84
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +0 -149
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/navigator-route-registry.js.map +0 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js +0 -29
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js.map +0 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/use-navigator-history-registry.js +0 -47
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/use-navigator-history-registry.js.map +0 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js +0 -158
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +0 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-high-refresh-rate.js +0 -36
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-high-refresh-rate.js.map +0 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +0 -1
- package/lib/commonjs/shared/components/screen-lifecycle/hooks/use-screen-events.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/build-resolved-style-map.js +0 -144
- package/lib/commonjs/shared/providers/screen/styles/helpers/build-resolved-style-map.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js +0 -28
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/split-normalized-style-maps.js +0 -39
- package/lib/commonjs/shared/providers/screen/styles/helpers/split-normalized-style-maps.js.map +0 -1
- package/lib/commonjs/shared/stores/bounds/internals/presence.js +0 -125
- package/lib/commonjs/shared/stores/bounds/internals/presence.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +0 -39
- package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +0 -78
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +0 -145
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.js.map +0 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/navigator-route-registry.js.map +0 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js +0 -24
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.js.map +0 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/use-navigator-history-registry.js +0 -42
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/use-navigator-history-registry.js.map +0 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js +0 -153
- package/lib/module/shared/components/screen-lifecycle/hooks/use-close-transition/index.js.map +0 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-high-refresh-rate.js +0 -30
- package/lib/module/shared/components/screen-lifecycle/hooks/use-high-refresh-rate.js.map +0 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-open-transition.js.map +0 -1
- package/lib/module/shared/components/screen-lifecycle/hooks/use-screen-events.js.map +0 -1
- package/lib/module/shared/providers/screen/styles/helpers/build-resolved-style-map.js +0 -139
- package/lib/module/shared/providers/screen/styles/helpers/build-resolved-style-map.js.map +0 -1
- package/lib/module/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js +0 -23
- package/lib/module/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js.map +0 -1
- package/lib/module/shared/providers/screen/styles/helpers/split-normalized-style-maps.js +0 -34
- package/lib/module/shared/providers/screen/styles/helpers/split-normalized-style-maps.js.map +0 -1
- package/lib/module/shared/stores/bounds/internals/presence.js +0 -115
- package/lib/module/shared/stores/bounds/internals/presence.js.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts +0 -10
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts +0 -27
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.d.ts +0 -12
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/navigator-route-registry.d.ts.map +0 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.d.ts +0 -2
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.d.ts.map +0 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/use-navigator-history-registry.d.ts +0 -2
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/use-navigator-history-registry.d.ts.map +0 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts +0 -8
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-close-transition/index.d.ts.map +0 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-high-refresh-rate.d.ts +0 -13
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-high-refresh-rate.d.ts.map +0 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts +0 -12
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-open-transition.d.ts.map +0 -1
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-screen-events.d.ts +0 -7
- package/lib/typescript/shared/components/screen-lifecycle/hooks/use-screen-events.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/build-resolved-style-map.d.ts +0 -11
- package/lib/typescript/shared/providers/screen/styles/helpers/build-resolved-style-map.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.d.ts +0 -7
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/split-normalized-style-maps.d.ts +0 -6
- package/lib/typescript/shared/providers/screen/styles/helpers/split-normalized-style-maps.d.ts.map +0 -1
- package/lib/typescript/shared/stores/bounds/internals/presence.d.ts +0 -12
- package/lib/typescript/shared/stores/bounds/internals/presence.d.ts.map +0 -1
- package/src/shared/components/create-boundary-component/hooks/use-auto-source-measurement.ts +0 -56
- package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts +0 -154
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts +0 -223
- package/src/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/reset-stores-for-screen.ts +0 -29
- package/src/shared/components/screen-lifecycle/hooks/use-close-transition/helpers/use-navigator-history-registry.ts +0 -58
- package/src/shared/components/screen-lifecycle/hooks/use-close-transition/index.ts +0 -183
- package/src/shared/components/screen-lifecycle/hooks/use-high-refresh-rate.ts +0 -34
- package/src/shared/providers/screen/styles/helpers/build-resolved-style-map.ts +0 -185
- package/src/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.ts +0 -31
- package/src/shared/providers/screen/styles/helpers/split-normalized-style-maps.ts +0 -44
- package/src/shared/stores/bounds/internals/presence.ts +0 -145
- /package/lib/commonjs/shared/components/screen-lifecycle/hooks/{use-close-transition/helpers → history}/navigator-route-registry.js +0 -0
- /package/lib/module/shared/components/screen-lifecycle/hooks/{use-close-transition/helpers → history}/navigator-route-registry.js +0 -0
- /package/lib/typescript/shared/components/screen-lifecycle/hooks/{use-close-transition/helpers → history}/navigator-route-registry.d.ts +0 -0
- /package/src/shared/components/screen-lifecycle/hooks/{use-close-transition/helpers → history}/navigator-route-registry.ts +0 -0
|
@@ -1,186 +1,149 @@
|
|
|
1
1
|
import type { MeasuredDimensions, StyleProps } from "react-native-reanimated";
|
|
2
|
+
import { hasAnyKeys } from "../helpers/keys";
|
|
2
3
|
import { matchesScreenKey } from "../helpers/matching";
|
|
3
4
|
import type {
|
|
5
|
+
BoundaryConfig,
|
|
6
|
+
EntryPatch,
|
|
7
|
+
MeasuredEntry,
|
|
4
8
|
NavigatorKey,
|
|
9
|
+
ScreenEntry,
|
|
5
10
|
ScreenKey,
|
|
6
|
-
Snapshot,
|
|
7
11
|
TagID,
|
|
8
12
|
TagLink,
|
|
9
13
|
TagState,
|
|
10
14
|
} from "../types";
|
|
11
|
-
import {
|
|
15
|
+
import { type RegistryState, registry } from "./state";
|
|
12
16
|
|
|
13
17
|
const LINK_HISTORY_LIMIT = 3;
|
|
14
18
|
|
|
19
|
+
type LinkSourceWriteMode = "capture" | "refresh";
|
|
20
|
+
type LinkDestinationWriteMode = "attach" | "refresh";
|
|
21
|
+
|
|
15
22
|
const ensureTagState = (state: RegistryState, tag: TagID): TagState => {
|
|
16
23
|
"worklet";
|
|
17
24
|
if (!state[tag]) {
|
|
18
|
-
state[tag] =
|
|
25
|
+
state[tag] = {
|
|
26
|
+
screens: {},
|
|
27
|
+
linkStack: [],
|
|
28
|
+
};
|
|
19
29
|
}
|
|
20
30
|
return state[tag];
|
|
21
31
|
};
|
|
22
32
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
):
|
|
33
|
+
const ensureScreenEntry = (
|
|
34
|
+
tagState: TagState,
|
|
35
|
+
screenKey: ScreenKey,
|
|
36
|
+
): ScreenEntry => {
|
|
27
37
|
"worklet";
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
38
|
+
if (!tagState.screens[screenKey]) {
|
|
39
|
+
tagState.screens[screenKey] = {
|
|
40
|
+
bounds: null,
|
|
41
|
+
styles: {},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return tagState.screens[screenKey];
|
|
33
45
|
};
|
|
34
46
|
|
|
35
|
-
const
|
|
47
|
+
const hasMeasuredEntry = (
|
|
48
|
+
entry: ScreenEntry | undefined,
|
|
49
|
+
): entry is MeasuredEntry => {
|
|
36
50
|
"worklet";
|
|
37
|
-
|
|
38
|
-
if (overLimit <= 0) return;
|
|
39
|
-
tagState.linkStack.splice(0, overLimit);
|
|
51
|
+
return entry?.bounds !== null && entry?.bounds !== undefined;
|
|
40
52
|
};
|
|
41
53
|
|
|
42
|
-
|
|
54
|
+
const pruneTagState = (state: RegistryState, tag: TagID) => {
|
|
43
55
|
"worklet";
|
|
44
|
-
const tagState =
|
|
45
|
-
if (!tagState) return
|
|
56
|
+
const tagState = state[tag];
|
|
57
|
+
if (!tagState) return;
|
|
46
58
|
|
|
47
|
-
if (tagState.
|
|
48
|
-
|
|
49
|
-
return { bounds: snap.bounds, styles: snap.styles };
|
|
59
|
+
if (!hasAnyKeys(tagState.screens) && tagState.linkStack.length === 0) {
|
|
60
|
+
delete state[tag];
|
|
50
61
|
}
|
|
62
|
+
};
|
|
51
63
|
|
|
52
|
-
|
|
53
|
-
const snap = tagState.snapshots[screenKey];
|
|
54
|
-
if (snap.ancestorKeys?.includes(key)) {
|
|
55
|
-
return { bounds: snap.bounds, styles: snap.styles };
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function registerSnapshot(
|
|
63
|
-
tag: TagID,
|
|
64
|
-
screenKey: ScreenKey,
|
|
65
|
-
bounds: MeasuredDimensions,
|
|
66
|
-
styles: StyleProps = {},
|
|
67
|
-
ancestorKeys?: ScreenKey[],
|
|
68
|
-
navigatorKey?: NavigatorKey,
|
|
69
|
-
ancestorNavigatorKeys?: NavigatorKey[],
|
|
70
|
-
) {
|
|
64
|
+
const applyEntryPatch = (entry: ScreenEntry, patch: EntryPatch) => {
|
|
71
65
|
"worklet";
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
tagState.snapshots[screenKey] = {
|
|
76
|
-
bounds,
|
|
77
|
-
styles,
|
|
78
|
-
ancestorKeys,
|
|
79
|
-
navigatorKey,
|
|
80
|
-
ancestorNavigatorKeys,
|
|
81
|
-
};
|
|
82
|
-
return state;
|
|
83
|
-
});
|
|
84
|
-
}
|
|
66
|
+
if (patch.bounds !== undefined) {
|
|
67
|
+
entry.bounds = patch.bounds;
|
|
68
|
+
}
|
|
85
69
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
bounds: MeasuredDimensions,
|
|
90
|
-
styles: StyleProps = {},
|
|
91
|
-
ancestorKeys?: ScreenKey[],
|
|
92
|
-
navigatorKey?: NavigatorKey,
|
|
93
|
-
ancestorNavigatorKeys?: NavigatorKey[],
|
|
94
|
-
) {
|
|
95
|
-
"worklet";
|
|
96
|
-
registry.modify(<T extends RegistryState>(state: T): T => {
|
|
97
|
-
"worklet";
|
|
98
|
-
const tagState = ensureTagState(state, tag);
|
|
99
|
-
const stack = tagState.linkStack;
|
|
100
|
-
const topIndex = stack.length - 1;
|
|
101
|
-
const topLink = topIndex >= 0 ? stack[topIndex] : null;
|
|
70
|
+
if (patch.styles !== undefined) {
|
|
71
|
+
entry.styles = patch.styles ?? {};
|
|
72
|
+
}
|
|
102
73
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
};
|
|
74
|
+
if (patch.boundaryConfig !== undefined) {
|
|
75
|
+
if (patch.boundaryConfig === null) {
|
|
76
|
+
delete entry.boundaryConfig;
|
|
77
|
+
} else {
|
|
78
|
+
entry.boundaryConfig = patch.boundaryConfig;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
111
81
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
topLink.source = source;
|
|
118
|
-
return state;
|
|
82
|
+
if (patch.ancestorKeys !== undefined) {
|
|
83
|
+
if (patch.ancestorKeys === null) {
|
|
84
|
+
delete entry.ancestorKeys;
|
|
85
|
+
} else {
|
|
86
|
+
entry.ancestorKeys = patch.ancestorKeys;
|
|
119
87
|
}
|
|
88
|
+
}
|
|
120
89
|
|
|
121
|
-
|
|
122
|
-
|
|
90
|
+
if (patch.navigatorKey !== undefined) {
|
|
91
|
+
if (patch.navigatorKey === null) {
|
|
92
|
+
delete entry.navigatorKey;
|
|
93
|
+
} else {
|
|
94
|
+
entry.navigatorKey = patch.navigatorKey;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
123
97
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
98
|
+
if (patch.ancestorNavigatorKeys !== undefined) {
|
|
99
|
+
if (patch.ancestorNavigatorKeys === null) {
|
|
100
|
+
delete entry.ancestorNavigatorKeys;
|
|
101
|
+
} else {
|
|
102
|
+
entry.ancestorNavigatorKeys = patch.ancestorNavigatorKeys;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
};
|
|
127
106
|
|
|
128
|
-
|
|
129
|
-
|
|
107
|
+
const findMatchingScreenEntry = (
|
|
108
|
+
tagState: TagState | undefined,
|
|
130
109
|
screenKey: ScreenKey,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
ancestorKeys?: ScreenKey[],
|
|
134
|
-
navigatorKey?: NavigatorKey,
|
|
135
|
-
ancestorNavigatorKeys?: NavigatorKey[],
|
|
136
|
-
) {
|
|
110
|
+
shouldMatch: (entry: ScreenEntry) => boolean,
|
|
111
|
+
): ScreenEntry | null => {
|
|
137
112
|
"worklet";
|
|
138
|
-
|
|
139
|
-
"worklet";
|
|
140
|
-
const tagState = state[tag];
|
|
141
|
-
const stack = tagState?.linkStack;
|
|
142
|
-
if (!stack || stack.length === 0) return state;
|
|
143
|
-
|
|
144
|
-
let targetIndex = -1;
|
|
145
|
-
|
|
146
|
-
for (let i = stack.length - 1; i >= 0; i--) {
|
|
147
|
-
const link = stack[i];
|
|
148
|
-
if (link.destination && matchesScreenKey(link.source, screenKey)) {
|
|
149
|
-
targetIndex = i;
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
}
|
|
113
|
+
if (!tagState) return null;
|
|
153
114
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
break;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
115
|
+
const direct = tagState.screens[screenKey];
|
|
116
|
+
if (direct && shouldMatch(direct)) {
|
|
117
|
+
return direct;
|
|
118
|
+
}
|
|
162
119
|
|
|
163
|
-
|
|
164
|
-
|
|
120
|
+
for (const entryScreenKey in tagState.screens) {
|
|
121
|
+
const entry = tagState.screens[entryScreenKey];
|
|
122
|
+
if (!shouldMatch(entry)) continue;
|
|
123
|
+
if (entry.ancestorKeys?.includes(screenKey)) {
|
|
124
|
+
return entry;
|
|
165
125
|
}
|
|
126
|
+
}
|
|
166
127
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
ancestorKeys,
|
|
170
|
-
navigatorKey,
|
|
171
|
-
ancestorNavigatorKeys,
|
|
172
|
-
bounds,
|
|
173
|
-
styles,
|
|
174
|
-
};
|
|
128
|
+
return null;
|
|
129
|
+
};
|
|
175
130
|
|
|
176
|
-
|
|
177
|
-
}
|
|
178
|
-
}
|
|
131
|
+
const isSameScreenFamily = (
|
|
132
|
+
a: { screenKey: ScreenKey; ancestorKeys?: ScreenKey[] },
|
|
133
|
+
b: { screenKey: ScreenKey; ancestorKeys?: ScreenKey[] },
|
|
134
|
+
): boolean => {
|
|
135
|
+
"worklet";
|
|
136
|
+
return (
|
|
137
|
+
a.screenKey === b.screenKey ||
|
|
138
|
+
(a.ancestorKeys?.includes(b.screenKey) ?? false) ||
|
|
139
|
+
(b.ancestorKeys?.includes(a.screenKey) ?? false)
|
|
140
|
+
);
|
|
141
|
+
};
|
|
179
142
|
|
|
180
|
-
|
|
143
|
+
function findLatestPendingIndex(
|
|
181
144
|
stack: TagLink[],
|
|
182
145
|
expectedSourceScreenKey?: ScreenKey,
|
|
183
|
-
): number
|
|
146
|
+
): number {
|
|
184
147
|
"worklet";
|
|
185
148
|
for (let i = stack.length - 1; i >= 0; i--) {
|
|
186
149
|
const link = stack[i];
|
|
@@ -194,12 +157,12 @@ const findLatestPendingIndex = (
|
|
|
194
157
|
return i;
|
|
195
158
|
}
|
|
196
159
|
return -1;
|
|
197
|
-
}
|
|
160
|
+
}
|
|
198
161
|
|
|
199
|
-
|
|
162
|
+
function findLatestSourceIndex(
|
|
200
163
|
stack: TagLink[],
|
|
201
164
|
expectedSourceScreenKey?: ScreenKey,
|
|
202
|
-
): number
|
|
165
|
+
): number {
|
|
203
166
|
"worklet";
|
|
204
167
|
if (!expectedSourceScreenKey) return -1;
|
|
205
168
|
|
|
@@ -210,33 +173,136 @@ const findLatestSourceIndex = (
|
|
|
210
173
|
}
|
|
211
174
|
|
|
212
175
|
return -1;
|
|
213
|
-
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function findLatestCompletedSourceIndex(
|
|
179
|
+
stack: TagLink[],
|
|
180
|
+
screenKey?: ScreenKey,
|
|
181
|
+
): number {
|
|
182
|
+
"worklet";
|
|
183
|
+
if (!screenKey) return -1;
|
|
184
|
+
|
|
185
|
+
for (let i = stack.length - 1; i >= 0; i--) {
|
|
186
|
+
const link = stack[i];
|
|
187
|
+
if (link.destination && matchesScreenKey(link.source, screenKey)) {
|
|
188
|
+
return i;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return -1;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function findLatestCompletedDestinationIndex(
|
|
196
|
+
stack: TagLink[],
|
|
197
|
+
screenKey?: ScreenKey,
|
|
198
|
+
): number {
|
|
199
|
+
"worklet";
|
|
200
|
+
if (!screenKey) return -1;
|
|
201
|
+
|
|
202
|
+
for (let i = stack.length - 1; i >= 0; i--) {
|
|
203
|
+
const link = stack[i];
|
|
204
|
+
if (link.destination && matchesScreenKey(link.destination, screenKey)) {
|
|
205
|
+
return i;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return -1;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function selectSourceUpdateTargetIndex(
|
|
213
|
+
stack: TagLink[],
|
|
214
|
+
screenKey: ScreenKey,
|
|
215
|
+
): number {
|
|
216
|
+
"worklet";
|
|
217
|
+
const completedIndex = findLatestCompletedSourceIndex(stack, screenKey);
|
|
218
|
+
if (completedIndex !== -1) {
|
|
219
|
+
return completedIndex;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return findLatestSourceIndex(stack, screenKey);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function selectDestinationWriteTargetIndex(
|
|
226
|
+
stack: TagLink[],
|
|
227
|
+
screenKey?: ScreenKey,
|
|
228
|
+
expectedSourceScreenKey?: ScreenKey,
|
|
229
|
+
): number {
|
|
230
|
+
"worklet";
|
|
231
|
+
const completedIndex = findLatestCompletedDestinationIndex(stack, screenKey);
|
|
232
|
+
if (completedIndex !== -1) {
|
|
233
|
+
return completedIndex;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
const pendingIndex = findLatestPendingIndex(stack, expectedSourceScreenKey);
|
|
237
|
+
if (pendingIndex !== -1) {
|
|
238
|
+
return pendingIndex;
|
|
239
|
+
}
|
|
214
240
|
|
|
215
|
-
|
|
241
|
+
return findLatestSourceIndex(stack, expectedSourceScreenKey);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function getEntry(tag: TagID, key: ScreenKey): ScreenEntry | null {
|
|
245
|
+
"worklet";
|
|
246
|
+
return findMatchingScreenEntry(registry.get()[tag], key, () => true);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function getMeasuredEntry(tag: TagID, key: ScreenKey): MeasuredEntry | null {
|
|
250
|
+
"worklet";
|
|
251
|
+
const entry = findMatchingScreenEntry(registry.get()[tag], key, (candidate) =>
|
|
252
|
+
hasMeasuredEntry(candidate),
|
|
253
|
+
);
|
|
254
|
+
return (entry as MeasuredEntry | null) ?? null;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function getEntryConfig(
|
|
258
|
+
tag: TagID,
|
|
259
|
+
screenKey: ScreenKey,
|
|
260
|
+
): BoundaryConfig | null {
|
|
261
|
+
"worklet";
|
|
262
|
+
return getEntry(tag, screenKey)?.boundaryConfig ?? null;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
function setEntry(tag: TagID, screenKey: ScreenKey, patch: EntryPatch) {
|
|
266
|
+
"worklet";
|
|
267
|
+
registry.modify(<T extends RegistryState>(state: T): T => {
|
|
268
|
+
"worklet";
|
|
269
|
+
const tagState = ensureTagState(state, tag);
|
|
270
|
+
const entry = ensureScreenEntry(tagState, screenKey);
|
|
271
|
+
applyEntryPatch(entry, patch);
|
|
272
|
+
return state;
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function removeEntry(tag: TagID, screenKey: ScreenKey) {
|
|
277
|
+
"worklet";
|
|
278
|
+
registry.modify(<T extends RegistryState>(state: T): T => {
|
|
279
|
+
"worklet";
|
|
280
|
+
const tagState = state[tag];
|
|
281
|
+
if (!tagState?.screens[screenKey]) {
|
|
282
|
+
return state;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
delete tagState.screens[screenKey];
|
|
286
|
+
pruneTagState(state, tag);
|
|
287
|
+
|
|
288
|
+
return state;
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function setSource(
|
|
293
|
+
mode: LinkSourceWriteMode,
|
|
216
294
|
tag: TagID,
|
|
217
295
|
screenKey: ScreenKey,
|
|
218
296
|
bounds: MeasuredDimensions,
|
|
219
297
|
styles: StyleProps = {},
|
|
220
298
|
ancestorKeys?: ScreenKey[],
|
|
221
|
-
expectedSourceScreenKey?: ScreenKey,
|
|
222
299
|
navigatorKey?: NavigatorKey,
|
|
223
300
|
ancestorNavigatorKeys?: NavigatorKey[],
|
|
224
301
|
) {
|
|
225
302
|
"worklet";
|
|
226
303
|
registry.modify(<T extends RegistryState>(state: T): T => {
|
|
227
304
|
"worklet";
|
|
228
|
-
const
|
|
229
|
-
const stack = tagState?.linkStack;
|
|
230
|
-
if (!stack || stack.length === 0) return state;
|
|
231
|
-
|
|
232
|
-
let targetIndex = findLatestPendingIndex(stack, expectedSourceScreenKey);
|
|
233
|
-
if (targetIndex === -1) {
|
|
234
|
-
targetIndex = findLatestSourceIndex(stack, expectedSourceScreenKey);
|
|
235
|
-
}
|
|
236
|
-
if (targetIndex === -1) return state;
|
|
237
|
-
|
|
238
|
-
const targetLink = stack[targetIndex];
|
|
239
|
-
targetLink.destination = {
|
|
305
|
+
const source = {
|
|
240
306
|
screenKey,
|
|
241
307
|
ancestorKeys,
|
|
242
308
|
navigatorKey,
|
|
@@ -245,11 +311,44 @@ function setLinkDestination(
|
|
|
245
311
|
styles,
|
|
246
312
|
};
|
|
247
313
|
|
|
314
|
+
if (mode === "capture") {
|
|
315
|
+
const tagState = ensureTagState(state, tag);
|
|
316
|
+
const stack = tagState.linkStack;
|
|
317
|
+
const topIndex = stack.length - 1;
|
|
318
|
+
const topLink = topIndex >= 0 ? stack[topIndex] : null;
|
|
319
|
+
|
|
320
|
+
if (
|
|
321
|
+
topLink &&
|
|
322
|
+
topLink.destination === null &&
|
|
323
|
+
isSameScreenFamily(topLink.source, source)
|
|
324
|
+
) {
|
|
325
|
+
topLink.source = source;
|
|
326
|
+
return state;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
stack.push({ source, destination: null });
|
|
330
|
+
|
|
331
|
+
const overLimit = tagState.linkStack.length - LINK_HISTORY_LIMIT;
|
|
332
|
+
if (overLimit > 0) {
|
|
333
|
+
tagState.linkStack.splice(0, overLimit);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
return state;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
const stack = state[tag]?.linkStack;
|
|
340
|
+
if (!stack || stack.length === 0) return state;
|
|
341
|
+
const targetIndex = selectSourceUpdateTargetIndex(stack, screenKey);
|
|
342
|
+
if (targetIndex === -1) return state;
|
|
343
|
+
|
|
344
|
+
stack[targetIndex].source = source;
|
|
345
|
+
|
|
248
346
|
return state;
|
|
249
347
|
});
|
|
250
348
|
}
|
|
251
349
|
|
|
252
|
-
function
|
|
350
|
+
function setDestination(
|
|
351
|
+
mode: LinkDestinationWriteMode,
|
|
253
352
|
tag: TagID,
|
|
254
353
|
screenKey: ScreenKey,
|
|
255
354
|
bounds: MeasuredDimensions,
|
|
@@ -262,31 +361,14 @@ function updateLinkDestination(
|
|
|
262
361
|
"worklet";
|
|
263
362
|
registry.modify(<T extends RegistryState>(state: T): T => {
|
|
264
363
|
"worklet";
|
|
265
|
-
const
|
|
266
|
-
const stack = tagState?.linkStack;
|
|
364
|
+
const stack = state[tag]?.linkStack;
|
|
267
365
|
if (!stack || stack.length === 0) return state;
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
targetIndex = i;
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
if (targetIndex === -1) {
|
|
280
|
-
targetIndex = findLatestPendingIndex(stack, expectedSourceScreenKey);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
if (targetIndex === -1) {
|
|
284
|
-
targetIndex = findLatestSourceIndex(stack, expectedSourceScreenKey);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
if (targetIndex === -1) {
|
|
288
|
-
return state;
|
|
289
|
-
}
|
|
366
|
+
const targetIndex = selectDestinationWriteTargetIndex(
|
|
367
|
+
stack,
|
|
368
|
+
mode === "refresh" ? screenKey : undefined,
|
|
369
|
+
expectedSourceScreenKey,
|
|
370
|
+
);
|
|
371
|
+
if (targetIndex === -1) return state;
|
|
290
372
|
|
|
291
373
|
stack[targetIndex].destination = {
|
|
292
374
|
screenKey,
|
|
@@ -303,7 +385,7 @@ function updateLinkDestination(
|
|
|
303
385
|
|
|
304
386
|
function getActiveLink(tag: TagID, screenKey?: ScreenKey): TagLink | null {
|
|
305
387
|
"worklet";
|
|
306
|
-
const tagState = registry.
|
|
388
|
+
const tagState = registry.get()[tag];
|
|
307
389
|
const stack = tagState?.linkStack;
|
|
308
390
|
if (!stack || stack.length === 0) {
|
|
309
391
|
return null;
|
|
@@ -328,58 +410,23 @@ function getActiveLink(tag: TagID, screenKey?: ScreenKey): TagLink | null {
|
|
|
328
410
|
return null;
|
|
329
411
|
}
|
|
330
412
|
|
|
331
|
-
function
|
|
332
|
-
"worklet";
|
|
333
|
-
const tagState = registry.value[tag];
|
|
334
|
-
const stack = tagState?.linkStack;
|
|
335
|
-
if (!stack || stack.length === 0) return false;
|
|
336
|
-
|
|
337
|
-
for (let i = stack.length - 1; i >= 0; i--) {
|
|
338
|
-
if (stack[i].destination === null) {
|
|
339
|
-
return true;
|
|
340
|
-
}
|
|
341
|
-
}
|
|
342
|
-
|
|
343
|
-
return false;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
function hasPendingLinkFromSource(
|
|
413
|
+
function getPendingLink(
|
|
347
414
|
tag: TagID,
|
|
348
|
-
sourceScreenKey
|
|
349
|
-
):
|
|
350
|
-
"worklet";
|
|
351
|
-
const tagState = registry.value[tag];
|
|
352
|
-
const stack = tagState?.linkStack;
|
|
353
|
-
if (!stack || stack.length === 0) return false;
|
|
354
|
-
|
|
355
|
-
for (let i = stack.length - 1; i >= 0; i--) {
|
|
356
|
-
const link = stack[i];
|
|
357
|
-
if (link.destination !== null) continue;
|
|
358
|
-
if (matchesScreenKey(link.source, sourceScreenKey)) return true;
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
return false;
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
function getLatestPendingSourceScreenKey(tag: TagID): ScreenKey | null {
|
|
415
|
+
sourceScreenKey?: ScreenKey,
|
|
416
|
+
): TagLink | null {
|
|
365
417
|
"worklet";
|
|
366
|
-
const tagState = registry.
|
|
418
|
+
const tagState = registry.get()[tag];
|
|
367
419
|
const stack = tagState?.linkStack;
|
|
368
420
|
if (!stack || stack.length === 0) return null;
|
|
369
421
|
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
return link.source.screenKey;
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
return null;
|
|
422
|
+
const targetIndex = findLatestPendingIndex(stack, sourceScreenKey);
|
|
423
|
+
if (targetIndex === -1) return null;
|
|
424
|
+
return stack[targetIndex] ?? null;
|
|
378
425
|
}
|
|
379
426
|
|
|
380
427
|
function hasSourceLink(tag: TagID, screenKey: ScreenKey): boolean {
|
|
381
428
|
"worklet";
|
|
382
|
-
const tagState = registry.
|
|
429
|
+
const tagState = registry.get()[tag];
|
|
383
430
|
const stack = tagState?.linkStack;
|
|
384
431
|
if (!stack || stack.length === 0) return false;
|
|
385
432
|
|
|
@@ -392,7 +439,7 @@ function hasSourceLink(tag: TagID, screenKey: ScreenKey): boolean {
|
|
|
392
439
|
|
|
393
440
|
function hasDestinationLink(tag: TagID, screenKey: ScreenKey): boolean {
|
|
394
441
|
"worklet";
|
|
395
|
-
const tagState = registry.
|
|
442
|
+
const tagState = registry.get()[tag];
|
|
396
443
|
const stack = tagState?.linkStack;
|
|
397
444
|
if (!stack || stack.length === 0) return false;
|
|
398
445
|
|
|
@@ -404,16 +451,15 @@ function hasDestinationLink(tag: TagID, screenKey: ScreenKey): boolean {
|
|
|
404
451
|
}
|
|
405
452
|
|
|
406
453
|
export {
|
|
407
|
-
getSnapshot,
|
|
408
|
-
registerSnapshot,
|
|
409
|
-
setLinkSource,
|
|
410
|
-
updateLinkSource,
|
|
411
|
-
setLinkDestination,
|
|
412
|
-
updateLinkDestination,
|
|
413
454
|
getActiveLink,
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
455
|
+
getEntry,
|
|
456
|
+
getEntryConfig,
|
|
457
|
+
getMeasuredEntry,
|
|
458
|
+
getPendingLink,
|
|
418
459
|
hasDestinationLink,
|
|
460
|
+
hasSourceLink,
|
|
461
|
+
removeEntry,
|
|
462
|
+
setDestination,
|
|
463
|
+
setEntry,
|
|
464
|
+
setSource,
|
|
419
465
|
};
|
|
@@ -70,11 +70,10 @@ function resolveTransitionPair(
|
|
|
70
70
|
context: ResolveTransitionContext,
|
|
71
71
|
): ResolvedTransitionPair {
|
|
72
72
|
"worklet";
|
|
73
|
-
const tagState = registry.
|
|
73
|
+
const tagState = registry.get()[tag];
|
|
74
74
|
const stack = tagState?.linkStack;
|
|
75
75
|
|
|
76
76
|
let matchedLink: TagLink | null = null;
|
|
77
|
-
let usedPending = false;
|
|
78
77
|
|
|
79
78
|
if (tagState && stack && stack.length > 0) {
|
|
80
79
|
if (context.entering) {
|
|
@@ -88,7 +87,6 @@ function resolveTransitionPair(
|
|
|
88
87
|
tagState,
|
|
89
88
|
context.previousScreenKey,
|
|
90
89
|
);
|
|
91
|
-
usedPending = !!matchedLink;
|
|
92
90
|
}
|
|
93
91
|
|
|
94
92
|
if (!matchedLink) {
|
|
@@ -122,7 +120,6 @@ function resolveTransitionPair(
|
|
|
122
120
|
tagState,
|
|
123
121
|
context.currentScreenKey,
|
|
124
122
|
);
|
|
125
|
-
usedPending = !!matchedLink;
|
|
126
123
|
}
|
|
127
124
|
}
|
|
128
125
|
}
|
|
@@ -141,7 +138,6 @@ function resolveTransitionPair(
|
|
|
141
138
|
destinationStyles,
|
|
142
139
|
sourceScreenKey,
|
|
143
140
|
destinationScreenKey,
|
|
144
|
-
usedPending,
|
|
145
141
|
};
|
|
146
142
|
}
|
|
147
143
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { makeMutable } from "react-native-reanimated";
|
|
2
|
-
import type { GroupState,
|
|
2
|
+
import type { GroupState, TagID, TagState } from "../types";
|
|
3
3
|
|
|
4
4
|
export const createEmptyTagState = (): TagState => {
|
|
5
5
|
"worklet";
|
|
6
6
|
return {
|
|
7
|
-
|
|
7
|
+
screens: {},
|
|
8
8
|
linkStack: [],
|
|
9
9
|
};
|
|
10
10
|
};
|
|
@@ -13,5 +13,4 @@ export type RegistryState = Record<TagID, TagState>;
|
|
|
13
13
|
export type GroupsState = Record<string, GroupState>;
|
|
14
14
|
|
|
15
15
|
export const registry = makeMutable<RegistryState>({});
|
|
16
|
-
export const presence = makeMutable<PresenceState>({});
|
|
17
16
|
export const groups = makeMutable<GroupsState>({});
|