react-native-screen-transitions 3.4.0 → 3.5.0-beta.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/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/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/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/screen-container/hooks/use-content-layout.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/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/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/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,183 +0,0 @@
|
|
|
1
|
-
import { useLayoutEffect } from "react";
|
|
2
|
-
import {
|
|
3
|
-
runOnJS,
|
|
4
|
-
type SharedValue,
|
|
5
|
-
useAnimatedReaction,
|
|
6
|
-
useDerivedValue,
|
|
7
|
-
} from "react-native-reanimated";
|
|
8
|
-
import { useStack } from "../../../../hooks/navigation/use-stack";
|
|
9
|
-
import { useSharedValueState } from "../../../../hooks/reanimated/use-shared-value-state";
|
|
10
|
-
import useStableCallback from "../../../../hooks/use-stable-callback";
|
|
11
|
-
import { useGestureContext } from "../../../../providers/gestures";
|
|
12
|
-
import {
|
|
13
|
-
type BaseDescriptor,
|
|
14
|
-
useDescriptorDerivations,
|
|
15
|
-
} from "../../../../providers/screen/descriptors";
|
|
16
|
-
import { useStackCoreContext } from "../../../../providers/stack/core.provider";
|
|
17
|
-
import { useManagedStackContext } from "../../../../providers/stack/managed.provider";
|
|
18
|
-
import type { AnimationStoreMap } from "../../../../stores/animation.store";
|
|
19
|
-
import { StackType } from "../../../../types/stack.types";
|
|
20
|
-
import { animateToProgress } from "../../../../utils/animation/animate-to-progress";
|
|
21
|
-
import { resetStoresForScreen } from "./helpers/reset-stores-for-screen";
|
|
22
|
-
import { useNavigatorHistoryRegistry } from "./helpers/use-navigator-history-registry";
|
|
23
|
-
|
|
24
|
-
interface CloseHookParams {
|
|
25
|
-
current: BaseDescriptor;
|
|
26
|
-
animations: AnimationStoreMap;
|
|
27
|
-
targetProgress: SharedValue<number>;
|
|
28
|
-
activate: () => void;
|
|
29
|
-
deactivate: () => void;
|
|
30
|
-
resetStores: () => void;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Managed close - reacts to closingRouteKeysShared from ManagedStackContext.
|
|
35
|
-
* Used by blank-stack and component-stack.
|
|
36
|
-
*/
|
|
37
|
-
const useManagedClose = ({
|
|
38
|
-
current,
|
|
39
|
-
animations,
|
|
40
|
-
targetProgress,
|
|
41
|
-
activate,
|
|
42
|
-
deactivate,
|
|
43
|
-
resetStores,
|
|
44
|
-
}: CloseHookParams) => {
|
|
45
|
-
const { handleCloseRoute, closingRouteKeysShared } = useManagedStackContext();
|
|
46
|
-
const routeKey = current.route.key;
|
|
47
|
-
|
|
48
|
-
const handleCloseEnd = useStableCallback((finished: boolean) => {
|
|
49
|
-
if (!finished) return;
|
|
50
|
-
handleCloseRoute({ route: current.route });
|
|
51
|
-
requestAnimationFrame(() => {
|
|
52
|
-
deactivate();
|
|
53
|
-
resetStores();
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
const transitionSpec = current.options.transitionSpec;
|
|
58
|
-
|
|
59
|
-
useAnimatedReaction(
|
|
60
|
-
() => {
|
|
61
|
-
const keys = closingRouteKeysShared.value;
|
|
62
|
-
return keys?.includes(routeKey) ?? false;
|
|
63
|
-
},
|
|
64
|
-
(isClosing, wasClosing) => {
|
|
65
|
-
if (!isClosing || wasClosing) return;
|
|
66
|
-
|
|
67
|
-
runOnJS(activate)();
|
|
68
|
-
animateToProgress({
|
|
69
|
-
target: "close",
|
|
70
|
-
spec: transitionSpec,
|
|
71
|
-
animations,
|
|
72
|
-
targetProgress,
|
|
73
|
-
onAnimationFinish: handleCloseEnd,
|
|
74
|
-
});
|
|
75
|
-
},
|
|
76
|
-
);
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
/**
|
|
80
|
-
* Native stack close - listens to beforeRemove navigation event.
|
|
81
|
-
*/
|
|
82
|
-
const useNativeStackClose = ({
|
|
83
|
-
current,
|
|
84
|
-
animations,
|
|
85
|
-
targetProgress,
|
|
86
|
-
activate,
|
|
87
|
-
deactivate,
|
|
88
|
-
resetStores,
|
|
89
|
-
}: CloseHookParams) => {
|
|
90
|
-
const gestureCtx = useGestureContext();
|
|
91
|
-
|
|
92
|
-
const isAncestorDismissingViaGesture = useSharedValueState(
|
|
93
|
-
useDerivedValue(() => {
|
|
94
|
-
"worklet";
|
|
95
|
-
return (
|
|
96
|
-
gestureCtx?.ancestorContext?.gestureAnimationValues.dismissing?.value ??
|
|
97
|
-
false
|
|
98
|
-
);
|
|
99
|
-
}),
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
const handleBeforeRemove = useStableCallback((e: any) => {
|
|
103
|
-
const options = current.options as { enableTransitions?: boolean };
|
|
104
|
-
const isEnabled = options.enableTransitions;
|
|
105
|
-
const navigation = current.navigation;
|
|
106
|
-
const routeKey = current.route.key;
|
|
107
|
-
const state = navigation.getState();
|
|
108
|
-
const routeIndex = state.routes.findIndex(
|
|
109
|
-
(route) => route.key === routeKey,
|
|
110
|
-
);
|
|
111
|
-
const isFirstScreen = routeIndex <= 0;
|
|
112
|
-
|
|
113
|
-
// If transitions are disabled, ancestor is dismissing, or first screen - let native handle it
|
|
114
|
-
if (!isEnabled || isAncestorDismissingViaGesture || isFirstScreen) {
|
|
115
|
-
animations.closing.set(1);
|
|
116
|
-
resetStores();
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
e.preventDefault();
|
|
121
|
-
activate();
|
|
122
|
-
|
|
123
|
-
animateToProgress({
|
|
124
|
-
target: "close",
|
|
125
|
-
spec: current.options.transitionSpec,
|
|
126
|
-
animations,
|
|
127
|
-
targetProgress,
|
|
128
|
-
onAnimationFinish: (finished: boolean) => {
|
|
129
|
-
deactivate();
|
|
130
|
-
if (finished) {
|
|
131
|
-
navigation.dispatch(e.data.action);
|
|
132
|
-
requestAnimationFrame(() => {
|
|
133
|
-
resetStores();
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
// biome-ignore lint/correctness/useExhaustiveDependencies: Only re-subscribe when navigation changes
|
|
141
|
-
useLayoutEffect(() => {
|
|
142
|
-
return current.navigation.addListener?.("beforeRemove", handleBeforeRemove);
|
|
143
|
-
}, [current.navigation]);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Unified close handler that branches on stack type.
|
|
148
|
-
*/
|
|
149
|
-
export function useCloseTransition(
|
|
150
|
-
current: BaseDescriptor,
|
|
151
|
-
animations: AnimationStoreMap,
|
|
152
|
-
targetProgress: SharedValue<number>,
|
|
153
|
-
activate: () => void,
|
|
154
|
-
deactivate: () => void,
|
|
155
|
-
) {
|
|
156
|
-
const routeKey = current.route.key;
|
|
157
|
-
const { navigatorKey } = useStack();
|
|
158
|
-
const { flags } = useStackCoreContext();
|
|
159
|
-
const { isBranchScreen, branchNavigatorKey } = useDescriptorDerivations();
|
|
160
|
-
const isNativeStack = flags.STACK_TYPE === StackType.NATIVE;
|
|
161
|
-
|
|
162
|
-
const resetStores = useStableCallback(() => {
|
|
163
|
-
resetStoresForScreen(routeKey, isBranchScreen, branchNavigatorKey);
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
const closeParams: CloseHookParams = {
|
|
167
|
-
current,
|
|
168
|
-
animations,
|
|
169
|
-
targetProgress,
|
|
170
|
-
activate,
|
|
171
|
-
deactivate,
|
|
172
|
-
resetStores,
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
useNavigatorHistoryRegistry(navigatorKey, routeKey);
|
|
176
|
-
if (isNativeStack) {
|
|
177
|
-
// biome-ignore lint/correctness/useHookAtTopLevel: STACK_TYPE is stable per screen instance
|
|
178
|
-
useNativeStackClose(closeParams);
|
|
179
|
-
} else {
|
|
180
|
-
// biome-ignore lint/correctness/useHookAtTopLevel: STACK_TYPE is stable per screen instance
|
|
181
|
-
useManagedClose(closeParams);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { useFrameCallback } from "react-native-reanimated";
|
|
2
|
-
import useStableCallback from "../../../hooks/use-stable-callback";
|
|
3
|
-
import type { BaseDescriptor } from "../../../providers/screen/descriptors";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Maintainer Notes:
|
|
7
|
-
* Marking as experimental for now since, I'll be honest, I'm not sure if this does much. This was taken
|
|
8
|
-
* right from this https://github.com/software-mansion/react-native-reanimated/issues/4738
|
|
9
|
-
*
|
|
10
|
-
* Not noticing much of a difference in prod.
|
|
11
|
-
*/
|
|
12
|
-
export const useHighRefreshRate = (current: BaseDescriptor) => {
|
|
13
|
-
const enableHighRefreshRate =
|
|
14
|
-
current.options.experimental_enableHighRefreshRate ?? false;
|
|
15
|
-
|
|
16
|
-
const frameCallback = useFrameCallback(() => {}, false);
|
|
17
|
-
|
|
18
|
-
const activateHighRefreshRate = useStableCallback(() => {
|
|
19
|
-
if (enableHighRefreshRate) {
|
|
20
|
-
frameCallback.setActive(true);
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const deactivateHighRefreshRate = useStableCallback(() => {
|
|
25
|
-
if (enableHighRefreshRate) {
|
|
26
|
-
frameCallback.setActive(false);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
activateHighRefreshRate,
|
|
32
|
-
deactivateHighRefreshRate,
|
|
33
|
-
};
|
|
34
|
-
};
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { NO_STYLES } from "../../../../constants";
|
|
2
|
-
import type {
|
|
3
|
-
NormalizedTransitionInterpolatedStyle,
|
|
4
|
-
NormalizedTransitionSlotStyle,
|
|
5
|
-
} from "../../../../types/animation.types";
|
|
6
|
-
|
|
7
|
-
export type StyleKeySet = Record<string, true>;
|
|
8
|
-
|
|
9
|
-
type StyleKeyMeta = {
|
|
10
|
-
keys: StyleKeySet;
|
|
11
|
-
hasAny: boolean;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const IDENTITY_TRANSFORM = [
|
|
15
|
-
{ translateX: 0 },
|
|
16
|
-
{ translateY: 0 },
|
|
17
|
-
{ scaleX: 1 },
|
|
18
|
-
{ scaleY: 1 },
|
|
19
|
-
] as const;
|
|
20
|
-
|
|
21
|
-
const ALWAYS_RESET_STYLE_VALUES = {
|
|
22
|
-
zIndex: 0,
|
|
23
|
-
elevation: 0,
|
|
24
|
-
} as const;
|
|
25
|
-
|
|
26
|
-
const hasAnyKeys = (record: Record<string, unknown>) => {
|
|
27
|
-
"worklet";
|
|
28
|
-
for (const _key in record) {
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
return false;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const collectStyleKeyMeta = (
|
|
35
|
-
record?: Record<string, unknown>,
|
|
36
|
-
): StyleKeyMeta => {
|
|
37
|
-
"worklet";
|
|
38
|
-
const keys: StyleKeySet = {};
|
|
39
|
-
let hasAny = false;
|
|
40
|
-
|
|
41
|
-
if (!record) {
|
|
42
|
-
return { keys, hasAny };
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
for (const key in record) {
|
|
46
|
-
keys[key] = true;
|
|
47
|
-
hasAny = true;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return { keys, hasAny };
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const collectRelevantSlotIds = ({
|
|
54
|
-
currentStylesMap,
|
|
55
|
-
fallbackStylesMap,
|
|
56
|
-
previousStyleKeysBySlot,
|
|
57
|
-
}: {
|
|
58
|
-
currentStylesMap: NormalizedTransitionInterpolatedStyle;
|
|
59
|
-
fallbackStylesMap: NormalizedTransitionInterpolatedStyle;
|
|
60
|
-
previousStyleKeysBySlot: Record<string, StyleKeySet>;
|
|
61
|
-
}) => {
|
|
62
|
-
"worklet";
|
|
63
|
-
const slotIds: Record<string, true> = {};
|
|
64
|
-
|
|
65
|
-
for (const slotId in currentStylesMap) {
|
|
66
|
-
slotIds[slotId] = true;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
for (const slotId in fallbackStylesMap) {
|
|
70
|
-
slotIds[slotId] = true;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
for (const slotId in previousStyleKeysBySlot) {
|
|
74
|
-
slotIds[slotId] = true;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
return slotIds;
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
const buildUnsetPatch = ({
|
|
81
|
-
previousKeys,
|
|
82
|
-
currentKeys,
|
|
83
|
-
}: {
|
|
84
|
-
previousKeys: StyleKeySet;
|
|
85
|
-
currentKeys: StyleKeySet;
|
|
86
|
-
}) => {
|
|
87
|
-
"worklet";
|
|
88
|
-
const unsetPatch: Record<string, any> = {};
|
|
89
|
-
|
|
90
|
-
for (const key in previousKeys) {
|
|
91
|
-
if (currentKeys[key]) continue;
|
|
92
|
-
|
|
93
|
-
if (key === "transform") {
|
|
94
|
-
unsetPatch.transform = IDENTITY_TRANSFORM;
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
if (key in ALWAYS_RESET_STYLE_VALUES) {
|
|
99
|
-
unsetPatch[key] =
|
|
100
|
-
ALWAYS_RESET_STYLE_VALUES[
|
|
101
|
-
key as keyof typeof ALWAYS_RESET_STYLE_VALUES
|
|
102
|
-
];
|
|
103
|
-
continue;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
unsetPatch[key] = undefined;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
return unsetPatch;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export const buildResolvedStyleMap = ({
|
|
113
|
-
currentStylesMap,
|
|
114
|
-
fallbackStylesMap,
|
|
115
|
-
previousStyleKeysBySlot,
|
|
116
|
-
}: {
|
|
117
|
-
currentStylesMap: NormalizedTransitionInterpolatedStyle;
|
|
118
|
-
fallbackStylesMap: NormalizedTransitionInterpolatedStyle;
|
|
119
|
-
previousStyleKeysBySlot: Record<string, StyleKeySet>;
|
|
120
|
-
}): {
|
|
121
|
-
resolvedStylesMap: NormalizedTransitionInterpolatedStyle;
|
|
122
|
-
nextPreviousStyleKeysBySlot: Record<string, StyleKeySet>;
|
|
123
|
-
} => {
|
|
124
|
-
"worklet";
|
|
125
|
-
const resolvedStylesMap: NormalizedTransitionInterpolatedStyle = {};
|
|
126
|
-
const nextPreviousStyleKeysBySlot: Record<string, StyleKeySet> = {};
|
|
127
|
-
|
|
128
|
-
const slotIds = collectRelevantSlotIds({
|
|
129
|
-
currentStylesMap,
|
|
130
|
-
fallbackStylesMap,
|
|
131
|
-
previousStyleKeysBySlot,
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
for (const slotId in slotIds) {
|
|
135
|
-
const slot = currentStylesMap[slotId] ?? fallbackStylesMap[slotId];
|
|
136
|
-
const baseStyle = slot?.style as Record<string, unknown> | undefined;
|
|
137
|
-
const { keys: currentKeys, hasAny: hasCurrentStyleKeys } =
|
|
138
|
-
collectStyleKeyMeta(baseStyle);
|
|
139
|
-
|
|
140
|
-
const unsetPatch = buildUnsetPatch({
|
|
141
|
-
previousKeys: previousStyleKeysBySlot[slotId] ?? {},
|
|
142
|
-
currentKeys,
|
|
143
|
-
});
|
|
144
|
-
|
|
145
|
-
const hasUnsetPatch = hasAnyKeys(unsetPatch);
|
|
146
|
-
const hasProps = slot?.props !== undefined;
|
|
147
|
-
|
|
148
|
-
if (!slot && !hasUnsetPatch) {
|
|
149
|
-
continue;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const resolvedStyle =
|
|
153
|
-
hasCurrentStyleKeys || hasUnsetPatch
|
|
154
|
-
? {
|
|
155
|
-
...unsetPatch,
|
|
156
|
-
...(slot?.style ?? NO_STYLES),
|
|
157
|
-
}
|
|
158
|
-
: undefined;
|
|
159
|
-
|
|
160
|
-
if (resolvedStyle === undefined && !hasProps) {
|
|
161
|
-
continue;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
const resolvedSlot = {} as NormalizedTransitionSlotStyle;
|
|
165
|
-
|
|
166
|
-
if (resolvedStyle !== undefined) {
|
|
167
|
-
resolvedSlot.style = resolvedStyle;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
if (hasProps) {
|
|
171
|
-
resolvedSlot.props = slot?.props;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
resolvedStylesMap[slotId] = resolvedSlot;
|
|
175
|
-
|
|
176
|
-
if (hasCurrentStyleKeys) {
|
|
177
|
-
nextPreviousStyleKeysBySlot[slotId] = currentKeys;
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
return {
|
|
182
|
-
resolvedStylesMap,
|
|
183
|
-
nextPreviousStyleKeysBySlot,
|
|
184
|
-
};
|
|
185
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { NO_STYLES } from "../../../../constants";
|
|
2
|
-
import type {
|
|
3
|
-
NormalizedTransitionInterpolatedStyle,
|
|
4
|
-
TransitionInterpolatedStyle,
|
|
5
|
-
} from "../../../../types/animation.types";
|
|
6
|
-
import { normalizeInterpolatedStyle } from "../../../../utils/normalize-interpolated-style";
|
|
7
|
-
|
|
8
|
-
export type ResolvedInterpolatedStyleOutput = {
|
|
9
|
-
stylesMap: NormalizedTransitionInterpolatedStyle;
|
|
10
|
-
wasLegacy: boolean;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const resolveInterpolatedStyleOutput = (
|
|
14
|
-
raw: TransitionInterpolatedStyle | null | undefined,
|
|
15
|
-
): ResolvedInterpolatedStyleOutput => {
|
|
16
|
-
"worklet";
|
|
17
|
-
|
|
18
|
-
if (raw == null || typeof raw !== "object") {
|
|
19
|
-
return {
|
|
20
|
-
stylesMap: NO_STYLES,
|
|
21
|
-
wasLegacy: false,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const { result, wasLegacy } = normalizeInterpolatedStyle(raw);
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
stylesMap: result,
|
|
29
|
-
wasLegacy,
|
|
30
|
-
};
|
|
31
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
NAVIGATION_MASK_CONTAINER_STYLE_ID,
|
|
3
|
-
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
4
|
-
} from "../../../../constants";
|
|
5
|
-
import type { NormalizedTransitionInterpolatedStyle } from "../../../../types/animation.types";
|
|
6
|
-
|
|
7
|
-
const LAYER_STYLE_SLOT_IDS = {
|
|
8
|
-
content: true,
|
|
9
|
-
backdrop: true,
|
|
10
|
-
surface: true,
|
|
11
|
-
[NAVIGATION_MASK_ELEMENT_STYLE_ID]: true,
|
|
12
|
-
[NAVIGATION_MASK_CONTAINER_STYLE_ID]: true,
|
|
13
|
-
} as const;
|
|
14
|
-
|
|
15
|
-
const isLayerStyleSlotId = (slotId: string) => {
|
|
16
|
-
"worklet";
|
|
17
|
-
// biome-ignore lint/suspicious/noPrototypeBuiltins: <Typescript lib target is ES2020>
|
|
18
|
-
return Object.prototype.hasOwnProperty.call(LAYER_STYLE_SLOT_IDS, slotId);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const splitNormalizedStyleMaps = (
|
|
22
|
-
stylesMap: NormalizedTransitionInterpolatedStyle,
|
|
23
|
-
): {
|
|
24
|
-
layerStylesMap: NormalizedTransitionInterpolatedStyle;
|
|
25
|
-
elementStylesMap: NormalizedTransitionInterpolatedStyle;
|
|
26
|
-
} => {
|
|
27
|
-
"worklet";
|
|
28
|
-
const layerStylesMap: NormalizedTransitionInterpolatedStyle = {};
|
|
29
|
-
const elementStylesMap: NormalizedTransitionInterpolatedStyle = {};
|
|
30
|
-
|
|
31
|
-
for (const slotId in stylesMap) {
|
|
32
|
-
if (isLayerStyleSlotId(slotId)) {
|
|
33
|
-
layerStylesMap[slotId] = stylesMap[slotId];
|
|
34
|
-
continue;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
elementStylesMap[slotId] = stylesMap[slotId];
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
return {
|
|
41
|
-
layerStylesMap,
|
|
42
|
-
elementStylesMap,
|
|
43
|
-
};
|
|
44
|
-
};
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import type { BoundaryConfig, PresenceState, ScreenKey, TagID } from "../types";
|
|
2
|
-
import { type GroupsState, groups, presence } from "./state";
|
|
3
|
-
|
|
4
|
-
function registerBoundaryPresence(
|
|
5
|
-
tag: TagID,
|
|
6
|
-
screenKey: ScreenKey,
|
|
7
|
-
ancestorKeys?: ScreenKey[],
|
|
8
|
-
boundaryConfig?: BoundaryConfig,
|
|
9
|
-
navigatorKey?: string,
|
|
10
|
-
ancestorNavigatorKeys?: string[],
|
|
11
|
-
) {
|
|
12
|
-
"worklet";
|
|
13
|
-
presence.modify(<T extends PresenceState>(state: T): T => {
|
|
14
|
-
"worklet";
|
|
15
|
-
const mutableState = state as PresenceState;
|
|
16
|
-
let tagEntries = mutableState[tag];
|
|
17
|
-
if (!tagEntries) {
|
|
18
|
-
tagEntries = {};
|
|
19
|
-
mutableState[tag] = tagEntries;
|
|
20
|
-
}
|
|
21
|
-
const currentEntry = tagEntries[screenKey];
|
|
22
|
-
|
|
23
|
-
tagEntries[screenKey] = {
|
|
24
|
-
count: (currentEntry?.count ?? 0) + 1,
|
|
25
|
-
ancestorKeys: ancestorKeys ?? currentEntry?.ancestorKeys,
|
|
26
|
-
boundaryConfig: boundaryConfig ?? currentEntry?.boundaryConfig,
|
|
27
|
-
navigatorKey: navigatorKey ?? currentEntry?.navigatorKey,
|
|
28
|
-
ancestorNavigatorKeys:
|
|
29
|
-
ancestorNavigatorKeys ?? currentEntry?.ancestorNavigatorKeys,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
return state;
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
function unregisterBoundaryPresence(tag: TagID, screenKey: ScreenKey) {
|
|
37
|
-
"worklet";
|
|
38
|
-
const tagEntries = presence.value[tag];
|
|
39
|
-
if (!tagEntries) return;
|
|
40
|
-
|
|
41
|
-
const currentEntry = tagEntries[screenKey];
|
|
42
|
-
if (!currentEntry) return;
|
|
43
|
-
|
|
44
|
-
presence.modify(<T extends PresenceState>(state: T): T => {
|
|
45
|
-
"worklet";
|
|
46
|
-
const mutableTagEntries = state[tag];
|
|
47
|
-
const mutableEntry = mutableTagEntries?.[screenKey];
|
|
48
|
-
if (!mutableTagEntries || !mutableEntry) return state;
|
|
49
|
-
const nextCount = mutableEntry.count - 1;
|
|
50
|
-
|
|
51
|
-
if (nextCount > 0) {
|
|
52
|
-
mutableEntry.count = nextCount;
|
|
53
|
-
return state;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
delete mutableTagEntries[screenKey];
|
|
57
|
-
|
|
58
|
-
for (const _remainingKey in mutableTagEntries) {
|
|
59
|
-
return state;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
delete state[tag];
|
|
63
|
-
return state;
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function hasBoundaryPresence(tag: TagID, screenKey: ScreenKey): boolean {
|
|
68
|
-
"worklet";
|
|
69
|
-
const tagEntries = presence.value[tag];
|
|
70
|
-
if (!tagEntries) return false;
|
|
71
|
-
|
|
72
|
-
const direct = tagEntries[screenKey];
|
|
73
|
-
if (direct && direct.count > 0) return true;
|
|
74
|
-
|
|
75
|
-
for (const entryScreenKey in tagEntries) {
|
|
76
|
-
const entry = tagEntries[entryScreenKey];
|
|
77
|
-
if (entry.ancestorKeys?.includes(screenKey)) {
|
|
78
|
-
return true;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
function getBoundaryPresence() {
|
|
86
|
-
"worklet";
|
|
87
|
-
return presence;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function getBoundaryConfig(
|
|
91
|
-
tag: TagID,
|
|
92
|
-
screenKey: ScreenKey,
|
|
93
|
-
): BoundaryConfig | null {
|
|
94
|
-
"worklet";
|
|
95
|
-
const tagEntries = presence.value[tag];
|
|
96
|
-
if (!tagEntries) return null;
|
|
97
|
-
|
|
98
|
-
const direct = tagEntries[screenKey];
|
|
99
|
-
if (direct && direct.count > 0) {
|
|
100
|
-
return direct.boundaryConfig ?? null;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
for (const entryScreenKey in tagEntries) {
|
|
104
|
-
const entry = tagEntries[entryScreenKey];
|
|
105
|
-
if (entry.count <= 0) continue;
|
|
106
|
-
if (entry.ancestorKeys?.includes(screenKey)) {
|
|
107
|
-
return entry.boundaryConfig ?? null;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return null;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
function setGroupActiveId(group: string, id: string) {
|
|
115
|
-
"worklet";
|
|
116
|
-
groups.modify(<T extends GroupsState>(state: T): T => {
|
|
117
|
-
"worklet";
|
|
118
|
-
const mutableState = state as GroupsState;
|
|
119
|
-
mutableState[group] = {
|
|
120
|
-
activeId: id,
|
|
121
|
-
};
|
|
122
|
-
return state;
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function getGroupActiveId(group: string): string | null {
|
|
127
|
-
"worklet";
|
|
128
|
-
return groups.value[group]?.activeId ?? null;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function getGroups() {
|
|
132
|
-
"worklet";
|
|
133
|
-
return groups;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export {
|
|
137
|
-
registerBoundaryPresence,
|
|
138
|
-
unregisterBoundaryPresence,
|
|
139
|
-
hasBoundaryPresence,
|
|
140
|
-
getBoundaryPresence,
|
|
141
|
-
getBoundaryConfig,
|
|
142
|
-
setGroupActiveId,
|
|
143
|
-
getGroupActiveId,
|
|
144
|
-
getGroups,
|
|
145
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|