react-native-screen-transitions 3.4.0-alpha.7 → 3.4.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js +6 -4
- package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js +22 -60
- 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 +1 -1
- 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 +56 -41
- 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/use-auto-source-measurement.js +7 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +4 -23
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +111 -2
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.js +69 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/index.js +10 -5
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/commonjs/shared/components/create-transition-aware-component.js +8 -32
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +11 -9
- 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 +7 -5
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/index.js +3 -1
- package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/commonjs/shared/constants.js +17 -3
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/reanimated/use-animated-debounce.js +43 -0
- package/lib/commonjs/shared/hooks/reanimated/use-animated-debounce.js.map +1 -0
- package/lib/commonjs/shared/index.js +6 -0
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +7 -0
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/commonjs/shared/providers/register-bounds.provider.js +9 -1
- package/lib/commonjs/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js +23 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/styles.provider.js +1 -11
- package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +1 -1
- package/lib/commonjs/shared/stores/animation.store.js +9 -3
- package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/clear.js +23 -167
- package/lib/commonjs/shared/stores/bounds/internals/clear.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/presence.js +0 -3
- package/lib/commonjs/shared/stores/bounds/internals/presence.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/registry.js +18 -7
- package/lib/commonjs/shared/stores/bounds/internals/registry.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +7 -51
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/state.js +1 -83
- package/lib/commonjs/shared/stores/bounds/internals/state.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +10 -0
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/constants.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/{resolve-bound-tag.js → create-bound-tag.js} +5 -5
- package/lib/commonjs/shared/utils/bounds/helpers/create-bound-tag.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/{interpolators.js → create-interpolators.js} +6 -6
- package/lib/commonjs/shared/utils/bounds/helpers/create-interpolators.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/{link-accessor.js → create-link-accessor.js} +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js +70 -0
- package/lib/commonjs/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/{style-composers.js → styles/composers.js} +22 -22
- package/lib/commonjs/shared/utils/bounds/helpers/styles/composers.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/{compute-bounds-styles.js → styles/compute.js} +14 -20
- package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/{interpolate-style.js → styles/interpolate-link-style.js} +4 -4
- package/lib/commonjs/shared/utils/bounds/helpers/styles/interpolate-link-style.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/helpers/styles/styles.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/index.js +16 -44
- package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/build.js +234 -50
- package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/config.js +10 -1
- package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/math.js +34 -1
- package/lib/commonjs/shared/utils/bounds/zoom/math.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/components/boundary-target.js +6 -4
- package/lib/module/shared/components/create-boundary-component/components/boundary-target.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js +23 -61
- 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 +1 -1
- 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 +54 -39
- 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/use-auto-source-measurement.js +7 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +4 -23
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +114 -4
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.js +64 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/index.js +10 -5
- package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/module/shared/components/create-transition-aware-component.js +10 -34
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +11 -9
- 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 +7 -5
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/index.js +3 -1
- package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/module/shared/constants.js +16 -2
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/hooks/reanimated/use-animated-debounce.js +39 -0
- package/lib/module/shared/hooks/reanimated/use-animated-debounce.js.map +1 -0
- package/lib/module/shared/index.js +1 -1
- package/lib/module/shared/index.js.map +1 -1
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js +7 -0
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/module/shared/providers/register-bounds.provider.js +9 -1
- package/lib/module/shared/providers/register-bounds.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js +23 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -0
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/styles.provider.js +1 -11
- package/lib/module/shared/providers/screen/styles/styles.provider.js.map +1 -1
- package/lib/module/shared/stores/animation.store.js +9 -3
- package/lib/module/shared/stores/animation.store.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/clear.js +24 -168
- package/lib/module/shared/stores/bounds/internals/clear.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/presence.js +1 -4
- package/lib/module/shared/stores/bounds/internals/presence.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/registry.js +19 -8
- package/lib/module/shared/stores/bounds/internals/registry.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +8 -52
- package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/state.js +0 -78
- package/lib/module/shared/stores/bounds/internals/state.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +10 -0
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/bounds/constants.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/{resolve-bound-tag.js → create-bound-tag.js} +3 -3
- package/lib/module/shared/utils/bounds/helpers/create-bound-tag.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/{interpolators.js → create-interpolators.js} +5 -5
- package/lib/module/shared/utils/bounds/helpers/create-interpolators.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/{link-accessor.js → create-link-accessor.js} +1 -1
- package/lib/module/shared/utils/bounds/helpers/create-link-accessor.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js +64 -0
- package/lib/module/shared/utils/bounds/helpers/prepare-bound-styles.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/{style-composers.js → styles/composers.js} +22 -22
- package/lib/module/shared/utils/bounds/helpers/styles/composers.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/{compute-bounds-styles.js → styles/compute.js} +12 -18
- package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/{interpolate-style.js → styles/interpolate-link-style.js} +4 -4
- package/lib/module/shared/utils/bounds/helpers/styles/interpolate-link-style.js.map +1 -0
- package/lib/module/shared/utils/bounds/helpers/styles/styles.js.map +1 -0
- package/lib/module/shared/utils/bounds/index.js +14 -42
- package/lib/module/shared/utils/bounds/index.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/build.js +238 -54
- package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/config.js +9 -0
- package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/math.js +31 -0
- package/lib/module/shared/utils/bounds/zoom/math.js.map +1 -1
- 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 +17 -11
- 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/use-auto-source-measurement.d.ts +3 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts +1 -2
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts +20 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.d.ts +12 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts +10 -4
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts +1 -1
- 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/backdrop.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/index.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +33 -1
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/reanimated/use-animated-debounce.d.ts +13 -0
- package/lib/typescript/shared/hooks/reanimated/use-animated-debounce.d.ts.map +1 -0
- package/lib/typescript/shared/index.d.ts +3 -3
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
- package/lib/typescript/shared/providers/register-bounds.provider.d.ts +7 -0
- package/lib/typescript/shared/providers/register-bounds.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts +3 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +3 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +1 -1
- package/lib/typescript/shared/stores/animation.store.d.ts +5 -2
- package/lib/typescript/shared/stores/animation.store.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/presence.d.ts.map +1 -1
- 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 +0 -3
- package/lib/typescript/shared/stores/bounds/internals/state.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts +0 -2
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +11 -0
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +106 -1
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +1 -1
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts +2 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/constants.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/create-bound-tag.d.ts +7 -0
- package/lib/typescript/shared/utils/bounds/helpers/create-bound-tag.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/{interpolators.d.ts → create-interpolators.d.ts} +3 -3
- package/lib/typescript/shared/utils/bounds/helpers/create-interpolators.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/{link-accessor.d.ts → create-link-accessor.d.ts} +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/create-link-accessor.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts +20 -0
- package/lib/typescript/shared/utils/bounds/helpers/prepare-bound-styles.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/{style-composers.d.ts → styles/composers.d.ts} +4 -4
- package/lib/typescript/shared/utils/bounds/helpers/styles/composers.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/{compute-bounds-styles.d.ts → styles/compute.d.ts} +3 -3
- package/lib/typescript/shared/utils/bounds/helpers/styles/compute.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/{interpolate-style.d.ts → styles/interpolate-link-style.d.ts} +2 -2
- package/lib/typescript/shared/utils/bounds/helpers/styles/interpolate-link-style.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/helpers/styles/styles.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/options.d.ts +3 -2
- package/lib/typescript/shared/utils/bounds/types/options.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +9 -0
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/math.d.ts +17 -0
- package/lib/typescript/shared/utils/bounds/zoom/math.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/components/create-boundary-component/components/boundary-target.tsx +6 -4
- package/src/shared/components/create-boundary-component/create-boundary-component.tsx +28 -60
- package/src/shared/components/create-boundary-component/helpers/resolve-pending-source-key.ts +5 -1
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +72 -53
- package/src/shared/components/create-boundary-component/hooks/use-auto-source-measurement.ts +19 -3
- package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts +5 -34
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts +180 -6
- package/src/shared/components/create-boundary-component/hooks/use-pre-transition-measurement.ts +110 -0
- package/src/shared/components/create-boundary-component/index.tsx +10 -5
- package/src/shared/components/create-boundary-component/types.ts +1 -2
- package/src/shared/components/create-transition-aware-component.tsx +10 -47
- package/src/shared/components/screen-container/hooks/use-content-layout.ts +10 -17
- package/src/shared/components/screen-container/layers/backdrop.tsx +6 -9
- package/src/shared/components/screen-lifecycle/index.tsx +1 -4
- package/src/shared/constants.ts +11 -1
- package/src/shared/hooks/reanimated/use-animated-debounce.ts +56 -0
- package/src/shared/index.ts +3 -0
- package/src/shared/providers/gestures/handlers/use-handlers.ts +9 -0
- package/src/shared/providers/register-bounds.provider.tsx +8 -1
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state.ts +27 -1
- package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +6 -0
- package/src/shared/providers/screen/styles/styles.provider.tsx +1 -12
- package/src/shared/stores/animation.store.ts +11 -2
- package/src/shared/stores/bounds/internals/clear.ts +47 -220
- package/src/shared/stores/bounds/internals/presence.ts +1 -4
- package/src/shared/stores/bounds/internals/registry.ts +25 -14
- package/src/shared/stores/bounds/internals/resolver.ts +7 -84
- package/src/shared/stores/bounds/internals/state.ts +0 -98
- package/src/shared/stores/bounds/types.ts +0 -2
- package/src/shared/types/animation.types.ts +13 -0
- package/src/shared/types/bounds.types.ts +108 -1
- package/src/shared/types/index.ts +2 -0
- package/src/shared/utils/animation/animate-to-progress.ts +11 -1
- package/src/shared/utils/bounds/{helpers/constants.ts → constants.ts} +1 -1
- package/src/shared/utils/bounds/helpers/{resolve-bound-tag.ts → create-bound-tag.ts} +2 -2
- package/src/shared/utils/bounds/helpers/{interpolators.ts → create-interpolators.ts} +19 -12
- package/src/shared/utils/bounds/helpers/prepare-bound-styles.ts +100 -0
- package/src/shared/utils/bounds/helpers/{style-composers.ts → styles/composers.ts} +119 -53
- package/src/shared/utils/bounds/helpers/{compute-bounds-styles.ts → styles/compute.ts} +10 -20
- package/src/shared/utils/bounds/helpers/{interpolate-style.ts → styles/interpolate-link-style.ts} +9 -4
- package/src/shared/utils/bounds/index.ts +13 -53
- package/src/shared/utils/bounds/types/options.ts +3 -2
- package/src/shared/utils/bounds/zoom/build.ts +316 -95
- package/src/shared/utils/bounds/zoom/config.ts +11 -0
- package/src/shared/utils/bounds/zoom/math.ts +57 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +0 -54
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +0 -122
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +0 -72
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +0 -66
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +0 -58
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +0 -53
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/build-bounds-options.js +0 -41
- package/lib/commonjs/shared/utils/bounds/helpers/build-bounds-options.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/constants.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/interpolate-style.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/interpolate.js +0 -20
- package/lib/commonjs/shared/utils/bounds/helpers/interpolate.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/interpolators.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/link-accessor.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +0 -1
- package/lib/commonjs/shared/utils/bounds/helpers/styles.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +0 -49
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +0 -118
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +0 -67
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +0 -61
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +0 -53
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +0 -48
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/build-bounds-options.js +0 -36
- package/lib/module/shared/utils/bounds/helpers/build-bounds-options.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/constants.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/interpolate-style.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/interpolate.js +0 -16
- package/lib/module/shared/utils/bounds/helpers/interpolate.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/interpolators.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/link-accessor.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +0 -1
- package/lib/module/shared/utils/bounds/helpers/styles.js.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts +0 -11
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +0 -17
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts +0 -11
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts +0 -10
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts +0 -11
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts +0 -10
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts +0 -14
- package/lib/typescript/shared/utils/bounds/helpers/build-bounds-options.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/constants.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/interpolate-style.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/interpolate.d.ts +0 -2
- package/lib/typescript/shared/utils/bounds/helpers/interpolate.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/interpolators.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/link-accessor.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts +0 -7
- package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +0 -1
- package/lib/typescript/shared/utils/bounds/helpers/styles.d.ts.map +0 -1
- package/src/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.ts +0 -58
- package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +0 -162
- package/src/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.ts +0 -82
- package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +0 -92
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts +0 -87
- package/src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts +0 -49
- package/src/shared/utils/bounds/helpers/build-bounds-options.ts +0 -48
- package/src/shared/utils/bounds/helpers/interpolate.ts +0 -19
- /package/lib/commonjs/shared/utils/bounds/{helpers/constants.js → constants.js} +0 -0
- /package/lib/commonjs/shared/utils/bounds/helpers/{styles.js → styles/styles.js} +0 -0
- /package/lib/module/shared/utils/bounds/{helpers/constants.js → constants.js} +0 -0
- /package/lib/module/shared/utils/bounds/helpers/{styles.js → styles/styles.js} +0 -0
- /package/lib/typescript/shared/utils/bounds/{helpers/constants.d.ts → constants.d.ts} +0 -0
- /package/lib/typescript/shared/utils/bounds/helpers/{styles.d.ts → styles/styles.d.ts} +0 -0
- /package/src/shared/utils/bounds/helpers/{link-accessor.ts → create-link-accessor.ts} +0 -0
- /package/src/shared/utils/bounds/helpers/{styles.ts → styles/styles.ts} +0 -0
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { matchesNavigatorKey, matchesScreenKey } from "../helpers/matching";
|
|
2
2
|
import type {
|
|
3
3
|
NavigatorKey,
|
|
4
|
+
PresenceEntry,
|
|
4
5
|
PresenceState,
|
|
5
6
|
ScreenKey,
|
|
6
7
|
SnapshotEntry,
|
|
7
8
|
TagLink,
|
|
8
9
|
} from "../types";
|
|
9
|
-
import {
|
|
10
|
-
debugClearLog,
|
|
11
|
-
debugStoreSizeLog,
|
|
12
|
-
presence,
|
|
13
|
-
type RegistryState,
|
|
14
|
-
registry,
|
|
15
|
-
} from "./state";
|
|
10
|
+
import { presence, type RegistryState, registry } from "./state";
|
|
16
11
|
|
|
17
12
|
const hasAnyKeys = (record: Record<string, unknown>) => {
|
|
18
13
|
"worklet";
|
|
@@ -22,128 +17,23 @@ const hasAnyKeys = (record: Record<string, unknown>) => {
|
|
|
22
17
|
return false;
|
|
23
18
|
};
|
|
24
19
|
|
|
25
|
-
|
|
20
|
+
type SnapshotPredicate = (
|
|
26
21
|
screenKey: ScreenKey,
|
|
27
|
-
|
|
28
|
-
)
|
|
29
|
-
"worklet";
|
|
30
|
-
const currentRegistry = registry.value;
|
|
31
|
-
let snapshots = 0;
|
|
32
|
-
let links = 0;
|
|
33
|
-
|
|
34
|
-
for (const tag in currentRegistry) {
|
|
35
|
-
const tagState = currentRegistry[tag];
|
|
36
|
-
|
|
37
|
-
for (const snapshotKey in tagState.snapshots) {
|
|
38
|
-
const snapshot = tagState.snapshots[snapshotKey];
|
|
39
|
-
const matched = matchByAncestor
|
|
40
|
-
? snapshotKey === screenKey ||
|
|
41
|
-
(snapshot.ancestorKeys?.includes(screenKey) ?? false)
|
|
42
|
-
: snapshotKey === screenKey;
|
|
43
|
-
if (matched) snapshots++;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
for (let i = 0; i < tagState.linkStack.length; i++) {
|
|
47
|
-
const link = tagState.linkStack[i];
|
|
48
|
-
if (
|
|
49
|
-
matchesScreenKey(link.source, screenKey) ||
|
|
50
|
-
matchesScreenKey(link.destination, screenKey)
|
|
51
|
-
) {
|
|
52
|
-
links++;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
return { snapshots, links };
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
const countRegistryMatchesByBranch = (
|
|
61
|
-
branchNavigatorKey: NavigatorKey,
|
|
62
|
-
): { snapshots: number; links: number } => {
|
|
63
|
-
"worklet";
|
|
64
|
-
const currentRegistry = registry.value;
|
|
65
|
-
let snapshots = 0;
|
|
66
|
-
let links = 0;
|
|
67
|
-
|
|
68
|
-
for (const tag in currentRegistry) {
|
|
69
|
-
const tagState = currentRegistry[tag];
|
|
70
|
-
|
|
71
|
-
for (const snapshotKey in tagState.snapshots) {
|
|
72
|
-
const snapshot = tagState.snapshots[snapshotKey];
|
|
73
|
-
const matched =
|
|
74
|
-
snapshot.navigatorKey === branchNavigatorKey ||
|
|
75
|
-
(snapshot.ancestorNavigatorKeys?.includes(branchNavigatorKey) ?? false);
|
|
76
|
-
if (matched) snapshots++;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
for (let i = 0; i < tagState.linkStack.length; i++) {
|
|
80
|
-
const link = tagState.linkStack[i];
|
|
81
|
-
if (
|
|
82
|
-
matchesNavigatorKey(link.source, branchNavigatorKey) ||
|
|
83
|
-
matchesNavigatorKey(link.destination, branchNavigatorKey)
|
|
84
|
-
) {
|
|
85
|
-
links++;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
22
|
+
snapshot: SnapshotEntry,
|
|
23
|
+
) => boolean;
|
|
89
24
|
|
|
90
|
-
|
|
91
|
-
};
|
|
25
|
+
type LinkPredicate = (link: TagLink) => boolean;
|
|
92
26
|
|
|
93
|
-
|
|
27
|
+
type PresencePredicate = (
|
|
94
28
|
screenKey: ScreenKey,
|
|
95
|
-
|
|
96
|
-
)
|
|
97
|
-
"worklet";
|
|
98
|
-
const currentPresence = presence.value;
|
|
99
|
-
let matches = 0;
|
|
100
|
-
|
|
101
|
-
for (const tag in currentPresence) {
|
|
102
|
-
const tagEntries = currentPresence[tag];
|
|
103
|
-
for (const entryScreenKey in tagEntries) {
|
|
104
|
-
const entry = tagEntries[entryScreenKey];
|
|
105
|
-
const matched = matchByAncestor
|
|
106
|
-
? entryScreenKey === screenKey ||
|
|
107
|
-
(entry.ancestorKeys?.includes(screenKey) ?? false)
|
|
108
|
-
: entryScreenKey === screenKey;
|
|
109
|
-
if (matched) matches++;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return matches;
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
const countPresenceMatchesByBranch = (
|
|
117
|
-
branchNavigatorKey: NavigatorKey,
|
|
118
|
-
): number => {
|
|
119
|
-
"worklet";
|
|
120
|
-
const currentPresence = presence.value;
|
|
121
|
-
let matches = 0;
|
|
122
|
-
|
|
123
|
-
for (const tag in currentPresence) {
|
|
124
|
-
const tagEntries = currentPresence[tag];
|
|
125
|
-
for (const entryScreenKey in tagEntries) {
|
|
126
|
-
const entry = tagEntries[entryScreenKey];
|
|
127
|
-
const matched =
|
|
128
|
-
entry.navigatorKey === branchNavigatorKey ||
|
|
129
|
-
(entry.ancestorNavigatorKeys?.includes(branchNavigatorKey) ?? false);
|
|
130
|
-
if (matched) matches++;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return matches;
|
|
135
|
-
};
|
|
29
|
+
entry: PresenceEntry,
|
|
30
|
+
) => boolean;
|
|
136
31
|
|
|
137
|
-
const clearRegistry = (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
) => boolean;
|
|
142
|
-
shouldRemoveLink: (link: TagLink) => boolean;
|
|
143
|
-
}) => {
|
|
32
|
+
const clearRegistry = (
|
|
33
|
+
shouldClearSnapshot: SnapshotPredicate,
|
|
34
|
+
shouldClearLink: LinkPredicate,
|
|
35
|
+
) => {
|
|
144
36
|
"worklet";
|
|
145
|
-
const { shouldRemoveSnapshot, shouldRemoveLink } = params;
|
|
146
|
-
|
|
147
37
|
registry.modify(<T extends RegistryState>(state: T): T => {
|
|
148
38
|
"worklet";
|
|
149
39
|
for (const tag in state) {
|
|
@@ -151,14 +41,14 @@ const clearRegistry = (params: {
|
|
|
151
41
|
|
|
152
42
|
for (const snapshotKey in tagState.snapshots) {
|
|
153
43
|
const snapshot = tagState.snapshots[snapshotKey];
|
|
154
|
-
if (
|
|
44
|
+
if (shouldClearSnapshot(snapshotKey, snapshot)) {
|
|
155
45
|
delete tagState.snapshots[snapshotKey];
|
|
156
46
|
}
|
|
157
47
|
}
|
|
158
48
|
|
|
159
49
|
for (let i = tagState.linkStack.length - 1; i >= 0; i--) {
|
|
160
50
|
const link = tagState.linkStack[i];
|
|
161
|
-
if (
|
|
51
|
+
if (shouldClearLink(link)) {
|
|
162
52
|
tagState.linkStack.splice(i, 1);
|
|
163
53
|
}
|
|
164
54
|
}
|
|
@@ -172,25 +62,7 @@ const clearRegistry = (params: {
|
|
|
172
62
|
});
|
|
173
63
|
};
|
|
174
64
|
|
|
175
|
-
const
|
|
176
|
-
"worklet";
|
|
177
|
-
presence.modify(<T extends PresenceState>(state: T): T => {
|
|
178
|
-
"worklet";
|
|
179
|
-
for (const tag in state) {
|
|
180
|
-
const tagEntries = state[tag];
|
|
181
|
-
if (!tagEntries[screenKey]) continue;
|
|
182
|
-
|
|
183
|
-
delete tagEntries[screenKey];
|
|
184
|
-
|
|
185
|
-
if (!hasAnyKeys(tagEntries)) {
|
|
186
|
-
delete state[tag];
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
return state;
|
|
190
|
-
});
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
const clearPresenceByAncestor = (ancestorKey: ScreenKey) => {
|
|
65
|
+
const clearPresence = (shouldClearPresence: PresencePredicate) => {
|
|
194
66
|
"worklet";
|
|
195
67
|
presence.modify(<T extends PresenceState>(state: T): T => {
|
|
196
68
|
"worklet";
|
|
@@ -199,10 +71,7 @@ const clearPresenceByAncestor = (ancestorKey: ScreenKey) => {
|
|
|
199
71
|
|
|
200
72
|
for (const entryScreenKey in tagEntries) {
|
|
201
73
|
const entry = tagEntries[entryScreenKey];
|
|
202
|
-
|
|
203
|
-
entryScreenKey === ancestorKey ||
|
|
204
|
-
(entry.ancestorKeys?.includes(ancestorKey) ?? false);
|
|
205
|
-
if (shouldRemove) {
|
|
74
|
+
if (shouldClearPresence(entryScreenKey, entry)) {
|
|
206
75
|
delete tagEntries[entryScreenKey];
|
|
207
76
|
}
|
|
208
77
|
}
|
|
@@ -211,125 +80,83 @@ const clearPresenceByAncestor = (ancestorKey: ScreenKey) => {
|
|
|
211
80
|
delete state[tag];
|
|
212
81
|
}
|
|
213
82
|
}
|
|
83
|
+
|
|
214
84
|
return state;
|
|
215
85
|
});
|
|
216
86
|
};
|
|
217
87
|
|
|
218
|
-
const
|
|
88
|
+
const performClear = (
|
|
89
|
+
shouldClearSnapshot: SnapshotPredicate,
|
|
90
|
+
shouldClearLink: LinkPredicate,
|
|
91
|
+
shouldClearPresence: PresencePredicate,
|
|
92
|
+
) => {
|
|
219
93
|
"worklet";
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
for (const tag in state) {
|
|
223
|
-
const tagEntries = state[tag];
|
|
224
|
-
|
|
225
|
-
for (const entryScreenKey in tagEntries) {
|
|
226
|
-
const entry = tagEntries[entryScreenKey];
|
|
227
|
-
const shouldRemove =
|
|
228
|
-
entry.navigatorKey === branchNavigatorKey ||
|
|
229
|
-
(entry.ancestorNavigatorKeys?.includes(branchNavigatorKey) ?? false);
|
|
230
|
-
|
|
231
|
-
if (shouldRemove) {
|
|
232
|
-
delete tagEntries[entryScreenKey];
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
if (!hasAnyKeys(tagEntries)) {
|
|
237
|
-
delete state[tag];
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
return state;
|
|
241
|
-
});
|
|
94
|
+
clearRegistry(shouldClearSnapshot, shouldClearLink);
|
|
95
|
+
clearPresence(shouldClearPresence);
|
|
242
96
|
};
|
|
243
97
|
|
|
244
98
|
function clear(screenKey: ScreenKey) {
|
|
245
99
|
"worklet";
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
clearRegistry({
|
|
250
|
-
shouldRemoveSnapshot: (snapshotKey) => snapshotKey === screenKey,
|
|
251
|
-
shouldRemoveLink: (link) => {
|
|
100
|
+
performClear(
|
|
101
|
+
(snapshotKey) => snapshotKey === screenKey,
|
|
102
|
+
(link) => {
|
|
252
103
|
return (
|
|
253
104
|
matchesScreenKey(link.source, screenKey) ||
|
|
254
105
|
matchesScreenKey(link.destination, screenKey)
|
|
255
106
|
);
|
|
256
107
|
},
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
clearPresenceDirect(screenKey);
|
|
260
|
-
|
|
261
|
-
const afterMatches = countRegistryMatches(screenKey, false);
|
|
262
|
-
const afterPresenceMatches = countPresenceMatches(screenKey, false);
|
|
263
|
-
|
|
264
|
-
debugClearLog(
|
|
265
|
-
`clear(${screenKey}) snapshots=${beforeMatches.snapshots}->${afterMatches.snapshots} links=${beforeMatches.links}->${afterMatches.links} presence=${beforePresenceMatches}->${afterPresenceMatches}`,
|
|
108
|
+
(entryScreenKey) => entryScreenKey === screenKey,
|
|
266
109
|
);
|
|
267
|
-
debugStoreSizeLog(`clear(${screenKey})`);
|
|
268
110
|
}
|
|
269
111
|
|
|
270
112
|
function clearByAncestor(ancestorKey: ScreenKey) {
|
|
271
113
|
"worklet";
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
clearRegistry({
|
|
276
|
-
shouldRemoveSnapshot: (snapshotKey, snapshot) => {
|
|
114
|
+
performClear(
|
|
115
|
+
(snapshotKey, snapshot) => {
|
|
277
116
|
return (
|
|
278
117
|
snapshotKey === ancestorKey ||
|
|
279
118
|
(snapshot.ancestorKeys?.includes(ancestorKey) ?? false)
|
|
280
119
|
);
|
|
281
120
|
},
|
|
282
|
-
|
|
121
|
+
(link) => {
|
|
283
122
|
return (
|
|
284
123
|
matchesScreenKey(link.source, ancestorKey) ||
|
|
285
124
|
matchesScreenKey(link.destination, ancestorKey)
|
|
286
125
|
);
|
|
287
126
|
},
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
debugClearLog(
|
|
296
|
-
`clearByAncestor(${ancestorKey}) snapshots=${beforeMatches.snapshots}->${afterMatches.snapshots} links=${beforeMatches.links}->${afterMatches.links} presence=${beforePresenceMatches}->${afterPresenceMatches}`,
|
|
127
|
+
(entryScreenKey, entry) => {
|
|
128
|
+
return (
|
|
129
|
+
entryScreenKey === ancestorKey ||
|
|
130
|
+
(entry.ancestorKeys?.includes(ancestorKey) ?? false)
|
|
131
|
+
);
|
|
132
|
+
},
|
|
297
133
|
);
|
|
298
|
-
debugStoreSizeLog(`clearByAncestor(${ancestorKey})`);
|
|
299
134
|
}
|
|
300
135
|
|
|
301
136
|
function clearByBranch(branchNavigatorKey: NavigatorKey) {
|
|
302
137
|
"worklet";
|
|
303
138
|
if (!branchNavigatorKey) return;
|
|
304
139
|
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
countPresenceMatchesByBranch(branchNavigatorKey);
|
|
308
|
-
|
|
309
|
-
clearRegistry({
|
|
310
|
-
shouldRemoveSnapshot: (_snapshotKey, snapshot) => {
|
|
140
|
+
performClear(
|
|
141
|
+
(_snapshotKey, snapshot) => {
|
|
311
142
|
return (
|
|
312
143
|
snapshot.navigatorKey === branchNavigatorKey ||
|
|
313
144
|
(snapshot.ancestorNavigatorKeys?.includes(branchNavigatorKey) ?? false)
|
|
314
145
|
);
|
|
315
146
|
},
|
|
316
|
-
|
|
147
|
+
(link) => {
|
|
317
148
|
return (
|
|
318
149
|
matchesNavigatorKey(link.source, branchNavigatorKey) ||
|
|
319
150
|
matchesNavigatorKey(link.destination, branchNavigatorKey)
|
|
320
151
|
);
|
|
321
152
|
},
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
debugClearLog(
|
|
330
|
-
`clearByBranch(${branchNavigatorKey}) snapshots=${beforeMatches.snapshots}->${afterMatches.snapshots} links=${beforeMatches.links}->${afterMatches.links} presence=${beforePresenceMatches}->${afterPresenceMatches}`,
|
|
153
|
+
(_entryScreenKey, entry) => {
|
|
154
|
+
return (
|
|
155
|
+
entry.navigatorKey === branchNavigatorKey ||
|
|
156
|
+
(entry.ancestorNavigatorKeys?.includes(branchNavigatorKey) ?? false)
|
|
157
|
+
);
|
|
158
|
+
},
|
|
331
159
|
);
|
|
332
|
-
debugStoreSizeLog(`clearByBranch(${branchNavigatorKey})`);
|
|
333
160
|
}
|
|
334
161
|
|
|
335
162
|
export { clear, clearByAncestor, clearByBranch };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BoundaryConfig, PresenceState, ScreenKey, TagID } from "../types";
|
|
2
|
-
import {
|
|
2
|
+
import { type GroupsState, groups, presence } from "./state";
|
|
3
3
|
|
|
4
4
|
function registerBoundaryPresence(
|
|
5
5
|
tag: TagID,
|
|
@@ -31,7 +31,6 @@ function registerBoundaryPresence(
|
|
|
31
31
|
|
|
32
32
|
return state;
|
|
33
33
|
});
|
|
34
|
-
debugStoreSizeLog(`registerBoundaryPresence(${tag},${screenKey})`);
|
|
35
34
|
}
|
|
36
35
|
|
|
37
36
|
function unregisterBoundaryPresence(tag: TagID, screenKey: ScreenKey) {
|
|
@@ -63,7 +62,6 @@ function unregisterBoundaryPresence(tag: TagID, screenKey: ScreenKey) {
|
|
|
63
62
|
delete state[tag];
|
|
64
63
|
return state;
|
|
65
64
|
});
|
|
66
|
-
debugStoreSizeLog(`unregisterBoundaryPresence(${tag},${screenKey})`);
|
|
67
65
|
}
|
|
68
66
|
|
|
69
67
|
function hasBoundaryPresence(tag: TagID, screenKey: ScreenKey): boolean {
|
|
@@ -123,7 +121,6 @@ function setGroupActiveId(group: string, id: string) {
|
|
|
123
121
|
};
|
|
124
122
|
return state;
|
|
125
123
|
});
|
|
126
|
-
debugStoreSizeLog(`setGroupActiveId(${group},${id})`);
|
|
127
124
|
}
|
|
128
125
|
|
|
129
126
|
function getGroupActiveId(group: string): string | null {
|
|
@@ -8,12 +8,7 @@ import type {
|
|
|
8
8
|
TagLink,
|
|
9
9
|
TagState,
|
|
10
10
|
} from "../types";
|
|
11
|
-
import {
|
|
12
|
-
createEmptyTagState,
|
|
13
|
-
debugStoreSizeLog,
|
|
14
|
-
type RegistryState,
|
|
15
|
-
registry,
|
|
16
|
-
} from "./state";
|
|
11
|
+
import { createEmptyTagState, type RegistryState, registry } from "./state";
|
|
17
12
|
|
|
18
13
|
const LINK_HISTORY_LIMIT = 3;
|
|
19
14
|
|
|
@@ -86,7 +81,6 @@ function registerSnapshot(
|
|
|
86
81
|
};
|
|
87
82
|
return state;
|
|
88
83
|
});
|
|
89
|
-
debugStoreSizeLog(`registerSnapshot(${tag},${screenKey})`);
|
|
90
84
|
}
|
|
91
85
|
|
|
92
86
|
function setLinkSource(
|
|
@@ -129,7 +123,6 @@ function setLinkSource(
|
|
|
129
123
|
|
|
130
124
|
return state;
|
|
131
125
|
});
|
|
132
|
-
debugStoreSizeLog(`setLinkSource(${tag},${screenKey})`);
|
|
133
126
|
}
|
|
134
127
|
|
|
135
128
|
function updateLinkSource(
|
|
@@ -182,7 +175,6 @@ function updateLinkSource(
|
|
|
182
175
|
|
|
183
176
|
return state;
|
|
184
177
|
});
|
|
185
|
-
debugStoreSizeLog(`updateLinkSource(${tag},${screenKey})`);
|
|
186
178
|
}
|
|
187
179
|
|
|
188
180
|
const findLatestPendingIndex = (
|
|
@@ -204,6 +196,22 @@ const findLatestPendingIndex = (
|
|
|
204
196
|
return -1;
|
|
205
197
|
};
|
|
206
198
|
|
|
199
|
+
const findLatestSourceIndex = (
|
|
200
|
+
stack: TagLink[],
|
|
201
|
+
expectedSourceScreenKey?: ScreenKey,
|
|
202
|
+
): number => {
|
|
203
|
+
"worklet";
|
|
204
|
+
if (!expectedSourceScreenKey) return -1;
|
|
205
|
+
|
|
206
|
+
for (let i = stack.length - 1; i >= 0; i--) {
|
|
207
|
+
if (matchesScreenKey(stack[i].source, expectedSourceScreenKey)) {
|
|
208
|
+
return i;
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
return -1;
|
|
213
|
+
};
|
|
214
|
+
|
|
207
215
|
function setLinkDestination(
|
|
208
216
|
tag: TagID,
|
|
209
217
|
screenKey: ScreenKey,
|
|
@@ -221,12 +229,13 @@ function setLinkDestination(
|
|
|
221
229
|
const stack = tagState?.linkStack;
|
|
222
230
|
if (!stack || stack.length === 0) return state;
|
|
223
231
|
|
|
224
|
-
|
|
232
|
+
let targetIndex = findLatestPendingIndex(stack, expectedSourceScreenKey);
|
|
233
|
+
if (targetIndex === -1) {
|
|
234
|
+
targetIndex = findLatestSourceIndex(stack, expectedSourceScreenKey);
|
|
235
|
+
}
|
|
225
236
|
if (targetIndex === -1) return state;
|
|
226
237
|
|
|
227
238
|
const targetLink = stack[targetIndex];
|
|
228
|
-
if (targetLink.destination !== null) return state;
|
|
229
|
-
|
|
230
239
|
targetLink.destination = {
|
|
231
240
|
screenKey,
|
|
232
241
|
ancestorKeys,
|
|
@@ -238,7 +247,6 @@ function setLinkDestination(
|
|
|
238
247
|
|
|
239
248
|
return state;
|
|
240
249
|
});
|
|
241
|
-
debugStoreSizeLog(`setLinkDestination(${tag},${screenKey})`);
|
|
242
250
|
}
|
|
243
251
|
|
|
244
252
|
function updateLinkDestination(
|
|
@@ -272,6 +280,10 @@ function updateLinkDestination(
|
|
|
272
280
|
targetIndex = findLatestPendingIndex(stack, expectedSourceScreenKey);
|
|
273
281
|
}
|
|
274
282
|
|
|
283
|
+
if (targetIndex === -1) {
|
|
284
|
+
targetIndex = findLatestSourceIndex(stack, expectedSourceScreenKey);
|
|
285
|
+
}
|
|
286
|
+
|
|
275
287
|
if (targetIndex === -1) {
|
|
276
288
|
return state;
|
|
277
289
|
}
|
|
@@ -287,7 +299,6 @@ function updateLinkDestination(
|
|
|
287
299
|
|
|
288
300
|
return state;
|
|
289
301
|
});
|
|
290
|
-
debugStoreSizeLog(`updateLinkDestination(${tag},${screenKey})`);
|
|
291
302
|
}
|
|
292
303
|
|
|
293
304
|
function getActiveLink(tag: TagID, screenKey?: ScreenKey): TagLink | null {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { MeasuredDimensions, StyleProps } from "react-native-reanimated";
|
|
2
1
|
import { matchesScreenKey } from "../helpers/matching";
|
|
3
2
|
import type {
|
|
4
3
|
ResolvedTransitionPair,
|
|
@@ -8,8 +7,7 @@ import type {
|
|
|
8
7
|
TagLink,
|
|
9
8
|
TagState,
|
|
10
9
|
} from "../types";
|
|
11
|
-
import {
|
|
12
|
-
import { debugResolverLog, registry } from "./state";
|
|
10
|
+
import { registry } from "./state";
|
|
13
11
|
|
|
14
12
|
const findLatestLink = (
|
|
15
13
|
tagState: TagState,
|
|
@@ -67,30 +65,6 @@ function findPendingLinkBySource(
|
|
|
67
65
|
);
|
|
68
66
|
}
|
|
69
67
|
|
|
70
|
-
function getSnapshotBoundsByPriority(
|
|
71
|
-
tag: TagID,
|
|
72
|
-
keys: (ScreenKey | undefined)[],
|
|
73
|
-
): {
|
|
74
|
-
bounds: MeasuredDimensions;
|
|
75
|
-
styles: StyleProps;
|
|
76
|
-
screenKey: ScreenKey;
|
|
77
|
-
} | null {
|
|
78
|
-
"worklet";
|
|
79
|
-
for (let i = 0; i < keys.length; i++) {
|
|
80
|
-
const key = keys[i];
|
|
81
|
-
if (!key) continue;
|
|
82
|
-
const snapshot = getSnapshot(tag, key);
|
|
83
|
-
if (!snapshot) continue;
|
|
84
|
-
return {
|
|
85
|
-
bounds: snapshot.bounds,
|
|
86
|
-
styles: snapshot.styles,
|
|
87
|
-
screenKey: key,
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
68
|
function resolveTransitionPair(
|
|
95
69
|
tag: TagID,
|
|
96
70
|
context: ResolveTransitionContext,
|
|
@@ -153,61 +127,12 @@ function resolveTransitionPair(
|
|
|
153
127
|
}
|
|
154
128
|
}
|
|
155
129
|
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
let usedSnapshotSource = false;
|
|
163
|
-
let usedSnapshotDestination = false;
|
|
164
|
-
|
|
165
|
-
const sourceFallbackKeys = context.entering
|
|
166
|
-
? [
|
|
167
|
-
context.previousScreenKey,
|
|
168
|
-
context.currentScreenKey,
|
|
169
|
-
context.nextScreenKey,
|
|
170
|
-
]
|
|
171
|
-
: [
|
|
172
|
-
context.currentScreenKey,
|
|
173
|
-
context.previousScreenKey,
|
|
174
|
-
context.nextScreenKey,
|
|
175
|
-
];
|
|
176
|
-
|
|
177
|
-
const destinationFallbackKeys = context.entering
|
|
178
|
-
? [context.currentScreenKey, context.nextScreenKey]
|
|
179
|
-
: [context.nextScreenKey, context.currentScreenKey];
|
|
180
|
-
|
|
181
|
-
if (!sourceBounds) {
|
|
182
|
-
const sourceSnapshot = getSnapshotBoundsByPriority(tag, sourceFallbackKeys);
|
|
183
|
-
if (sourceSnapshot) {
|
|
184
|
-
sourceBounds = sourceSnapshot.bounds;
|
|
185
|
-
sourceStyles = sourceSnapshot.styles;
|
|
186
|
-
sourceScreenKey = sourceSnapshot.screenKey;
|
|
187
|
-
usedSnapshotSource = true;
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
if (!destinationBounds) {
|
|
192
|
-
const destinationSnapshot = getSnapshotBoundsByPriority(
|
|
193
|
-
tag,
|
|
194
|
-
destinationFallbackKeys,
|
|
195
|
-
);
|
|
196
|
-
if (destinationSnapshot) {
|
|
197
|
-
destinationBounds = destinationSnapshot.bounds;
|
|
198
|
-
destinationStyles = destinationSnapshot.styles;
|
|
199
|
-
destinationScreenKey = destinationSnapshot.screenKey;
|
|
200
|
-
usedSnapshotDestination = true;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
if (!sourceBounds || !destinationBounds) {
|
|
205
|
-
debugResolverLog(
|
|
206
|
-
`unresolved tag=${tag} entering=${context.entering ? 1 : 0} source=${
|
|
207
|
-
sourceBounds ? 1 : 0
|
|
208
|
-
} destination=${destinationBounds ? 1 : 0} pending=${usedPending ? 1 : 0}`,
|
|
209
|
-
);
|
|
210
|
-
}
|
|
130
|
+
const sourceBounds = matchedLink?.source?.bounds ?? null;
|
|
131
|
+
const destinationBounds = matchedLink?.destination?.bounds ?? null;
|
|
132
|
+
const sourceStyles = matchedLink?.source?.styles ?? null;
|
|
133
|
+
const destinationStyles = matchedLink?.destination?.styles ?? null;
|
|
134
|
+
const sourceScreenKey = matchedLink?.source?.screenKey ?? null;
|
|
135
|
+
const destinationScreenKey = matchedLink?.destination?.screenKey ?? null;
|
|
211
136
|
|
|
212
137
|
return {
|
|
213
138
|
sourceBounds,
|
|
@@ -217,8 +142,6 @@ function resolveTransitionPair(
|
|
|
217
142
|
sourceScreenKey,
|
|
218
143
|
destinationScreenKey,
|
|
219
144
|
usedPending,
|
|
220
|
-
usedSnapshotSource,
|
|
221
|
-
usedSnapshotDestination,
|
|
222
145
|
};
|
|
223
146
|
}
|
|
224
147
|
|