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,8 +1,8 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { useWindowDimensions } from "react-native";
|
|
3
3
|
import {
|
|
4
|
-
type
|
|
5
|
-
|
|
4
|
+
type SharedValue,
|
|
5
|
+
useAnimatedReaction,
|
|
6
6
|
useSharedValue,
|
|
7
7
|
} from "react-native-reanimated";
|
|
8
8
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
@@ -12,28 +12,42 @@ import type {
|
|
|
12
12
|
ScreenInterpolationProps,
|
|
13
13
|
ScreenStyleInterpolator,
|
|
14
14
|
} from "../../../../types/animation.types";
|
|
15
|
-
import type {
|
|
16
|
-
BoundsAccessor,
|
|
17
|
-
BoundsInterpolationProps,
|
|
18
|
-
} from "../../../../types/bounds.types";
|
|
15
|
+
import type { BoundsAccessor } from "../../../../types/bounds.types";
|
|
19
16
|
|
|
20
17
|
import { createBoundsAccessor } from "../../../../utils/bounds";
|
|
21
|
-
import { resolveNavigationMaskEnabled } from "../../../../utils/resolve-screen-transition-options";
|
|
22
18
|
import { useDescriptors } from "../../descriptors";
|
|
23
19
|
import { derivations } from "./derivations";
|
|
24
20
|
import { hasTransitionsEnabled } from "./has-transitions-enabled";
|
|
25
21
|
import { hydrateTransitionState } from "./hydrate-transition-state";
|
|
26
22
|
import { useBuildTransitionState } from "./use-build-transition-state";
|
|
27
23
|
|
|
28
|
-
type
|
|
24
|
+
export type ScreenInterpolatorFrame = Omit<ScreenInterpolationProps, "bounds">;
|
|
29
25
|
|
|
30
26
|
interface ScreenAnimationPipeline {
|
|
31
|
-
screenInterpolatorProps:
|
|
27
|
+
screenInterpolatorProps: SharedValue<ScreenInterpolatorFrame>;
|
|
32
28
|
nextInterpolator: ScreenStyleInterpolator | undefined;
|
|
33
29
|
currentInterpolator: ScreenStyleInterpolator | undefined;
|
|
34
30
|
boundsAccessor: BoundsAccessor;
|
|
35
31
|
}
|
|
36
32
|
|
|
33
|
+
const createInitialBaseInterpolatorProps = (
|
|
34
|
+
dimensions: ScreenInterpolatorFrame["layouts"]["screen"],
|
|
35
|
+
insets: ScreenInterpolatorFrame["insets"],
|
|
36
|
+
): ScreenInterpolatorFrame => ({
|
|
37
|
+
layouts: { screen: dimensions, navigationMaskEnabled: false },
|
|
38
|
+
insets,
|
|
39
|
+
previous: undefined,
|
|
40
|
+
current: DEFAULT_SCREEN_TRANSITION_STATE,
|
|
41
|
+
next: undefined,
|
|
42
|
+
progress: 0,
|
|
43
|
+
stackProgress: 0,
|
|
44
|
+
snapIndex: -1,
|
|
45
|
+
logicallySettled: 1,
|
|
46
|
+
focused: true,
|
|
47
|
+
active: DEFAULT_SCREEN_TRANSITION_STATE,
|
|
48
|
+
inactive: undefined,
|
|
49
|
+
});
|
|
50
|
+
|
|
37
51
|
export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
|
|
38
52
|
const { flags, stackProgress: rootStackProgress, routeKeys } = useStack();
|
|
39
53
|
const dimensions = useWindowDimensions();
|
|
@@ -58,81 +72,94 @@ export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
|
|
|
58
72
|
!!nextRouteKey &&
|
|
59
73
|
hasTransitionsEnabled(nextDescriptor?.options, transitionsAlwaysOn);
|
|
60
74
|
|
|
61
|
-
const
|
|
62
|
-
|
|
75
|
+
const screenInterpolatorProps = useSharedValue<ScreenInterpolatorFrame>(
|
|
76
|
+
createInitialBaseInterpolatorProps(dimensions, insets),
|
|
63
77
|
);
|
|
64
78
|
|
|
65
|
-
const boundsFrameProps = useSharedValue<BoundsInterpolationProps>({
|
|
66
|
-
layouts: { screen: dimensions },
|
|
67
|
-
insets,
|
|
68
|
-
previous: undefined,
|
|
69
|
-
current: DEFAULT_SCREEN_TRANSITION_STATE,
|
|
70
|
-
next: undefined,
|
|
71
|
-
progress: 0,
|
|
72
|
-
stackProgress: 0,
|
|
73
|
-
snapIndex: -1,
|
|
74
|
-
logicallySettled: 1,
|
|
75
|
-
focused: true,
|
|
76
|
-
active: DEFAULT_SCREEN_TRANSITION_STATE,
|
|
77
|
-
navigationMaskEnabled: currentNavigationMaskEnabled,
|
|
78
|
-
inactive: undefined,
|
|
79
|
-
});
|
|
80
|
-
|
|
81
79
|
const boundsAccessor = useMemo(() => {
|
|
82
80
|
return createBoundsAccessor(() => {
|
|
83
81
|
"worklet";
|
|
84
|
-
return
|
|
82
|
+
return screenInterpolatorProps.get();
|
|
85
83
|
});
|
|
86
|
-
}, [
|
|
87
|
-
|
|
88
|
-
const screenInterpolatorProps = useDerivedValue<BaseInterpolatorProps>(() => {
|
|
89
|
-
"worklet";
|
|
84
|
+
}, [screenInterpolatorProps]);
|
|
90
85
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
useAnimatedReaction(
|
|
87
|
+
() => {
|
|
88
|
+
"worklet";
|
|
94
89
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
? hydrateTransitionState(nextAnimation, dimensions)
|
|
90
|
+
const previous = prevAnimation
|
|
91
|
+
? hydrateTransitionState(prevAnimation, dimensions)
|
|
98
92
|
: undefined;
|
|
99
93
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
94
|
+
const next =
|
|
95
|
+
nextAnimation && nextHasTransitions
|
|
96
|
+
? hydrateTransitionState(nextAnimation, dimensions)
|
|
97
|
+
: undefined;
|
|
98
|
+
|
|
99
|
+
const current = currentAnimation
|
|
100
|
+
? hydrateTransitionState(currentAnimation, dimensions)
|
|
101
|
+
: DEFAULT_SCREEN_TRANSITION_STATE;
|
|
102
|
+
|
|
103
|
+
const { progress, ...helpers } = derivations({
|
|
104
|
+
previous,
|
|
105
|
+
current,
|
|
106
|
+
next,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const stackProgress =
|
|
110
|
+
currentIndex >= 0 ? rootStackProgress.get() - currentIndex : progress;
|
|
111
|
+
|
|
112
|
+
const focused = helpers.focused;
|
|
113
|
+
const active = helpers.active;
|
|
114
|
+
const inactive = helpers.inactive;
|
|
115
|
+
const snapIndex = current.snapIndex;
|
|
116
|
+
const logicallySettled = active.logicallySettled;
|
|
117
|
+
|
|
118
|
+
return {
|
|
119
|
+
previous,
|
|
120
|
+
current,
|
|
121
|
+
next,
|
|
122
|
+
progress,
|
|
123
|
+
stackProgress,
|
|
124
|
+
snapIndex,
|
|
125
|
+
logicallySettled,
|
|
126
|
+
focused,
|
|
127
|
+
active,
|
|
128
|
+
inactive,
|
|
129
|
+
};
|
|
130
|
+
},
|
|
131
|
+
({
|
|
119
132
|
previous,
|
|
120
133
|
current,
|
|
121
134
|
next,
|
|
122
135
|
progress,
|
|
123
136
|
stackProgress,
|
|
124
|
-
snapIndex
|
|
125
|
-
logicallySettled
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
137
|
+
snapIndex,
|
|
138
|
+
logicallySettled,
|
|
139
|
+
focused,
|
|
140
|
+
active,
|
|
141
|
+
inactive,
|
|
142
|
+
}) => {
|
|
143
|
+
"worklet";
|
|
144
|
+
|
|
145
|
+
screenInterpolatorProps.modify((frame) => {
|
|
146
|
+
"worklet";
|
|
147
|
+
frame.layouts = current.layouts;
|
|
148
|
+
frame.insets = insets;
|
|
149
|
+
frame.previous = previous;
|
|
150
|
+
frame.current = current;
|
|
151
|
+
frame.next = next;
|
|
152
|
+
frame.progress = progress;
|
|
153
|
+
frame.stackProgress = stackProgress;
|
|
154
|
+
frame.snapIndex = snapIndex;
|
|
155
|
+
frame.logicallySettled = logicallySettled;
|
|
156
|
+
frame.focused = focused;
|
|
157
|
+
frame.active = active;
|
|
158
|
+
frame.inactive = inactive;
|
|
159
|
+
return frame;
|
|
160
|
+
});
|
|
161
|
+
},
|
|
162
|
+
);
|
|
136
163
|
|
|
137
164
|
const nextInterpolator = nextDescriptor?.options.screenStyleInterpolator;
|
|
138
165
|
const currentInterpolator = currDescriptor?.options.screenStyleInterpolator;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type { DerivedValue } from "react-native-reanimated";
|
|
2
|
-
import type { ScreenInterpolationProps } from "../../../../types/animation.types";
|
|
3
1
|
import type { ScreenAnimationTarget } from "../types";
|
|
4
2
|
|
|
5
|
-
type Params = {
|
|
3
|
+
type Params<T> = {
|
|
6
4
|
target: ScreenAnimationTarget | undefined;
|
|
7
|
-
self:
|
|
8
|
-
ancestors:
|
|
5
|
+
self: T;
|
|
6
|
+
ancestors: T[];
|
|
9
7
|
};
|
|
10
8
|
|
|
11
9
|
const isAncestorTarget = (
|
|
@@ -14,11 +12,11 @@ const isAncestorTarget = (
|
|
|
14
12
|
return typeof target === "object" && target !== null && "ancestor" in target;
|
|
15
13
|
};
|
|
16
14
|
|
|
17
|
-
export function resolveScreenAnimationTarget({
|
|
15
|
+
export function resolveScreenAnimationTarget<T>({
|
|
18
16
|
target,
|
|
19
17
|
self,
|
|
20
18
|
ancestors,
|
|
21
|
-
}: Params):
|
|
19
|
+
}: Params<T>): T {
|
|
22
20
|
if (!target || target === "self") {
|
|
23
21
|
return self;
|
|
24
22
|
}
|
|
@@ -42,6 +42,7 @@ export const useBuildTransitionState = (
|
|
|
42
42
|
const meta = descriptor?.options?.meta;
|
|
43
43
|
const route = descriptor?.route;
|
|
44
44
|
const gestureEnabled = descriptor?.options?.gestureEnabled;
|
|
45
|
+
const navigationMaskEnabled = !!descriptor?.options?.navigationMaskEnabled;
|
|
45
46
|
const snapPoints = descriptor?.options?.snapPoints;
|
|
46
47
|
|
|
47
48
|
const shouldUseNeutralNextGestures =
|
|
@@ -79,7 +80,18 @@ export const useBuildTransitionState = (
|
|
|
79
80
|
: GestureStore.getBag(key),
|
|
80
81
|
route: plainRoute,
|
|
81
82
|
meta: plainMeta,
|
|
82
|
-
unwrapped: createScreenTransitionState(
|
|
83
|
+
unwrapped: createScreenTransitionState(
|
|
84
|
+
plainRoute,
|
|
85
|
+
plainMeta,
|
|
86
|
+
navigationMaskEnabled,
|
|
87
|
+
),
|
|
83
88
|
};
|
|
84
|
-
}, [
|
|
89
|
+
}, [
|
|
90
|
+
key,
|
|
91
|
+
meta,
|
|
92
|
+
route,
|
|
93
|
+
shouldUseNeutralNextGestures,
|
|
94
|
+
snapPoints,
|
|
95
|
+
navigationMaskEnabled,
|
|
96
|
+
]);
|
|
85
97
|
};
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
import type { SharedValue } from "react-native-reanimated";
|
|
2
|
+
import type { BoundsAccessor } from "../../../types/bounds.types";
|
|
3
|
+
import type { ScreenInterpolatorFrame } from "./helpers/pipeline";
|
|
4
|
+
|
|
1
5
|
export type ScreenAnimationTarget =
|
|
2
6
|
| "self"
|
|
3
7
|
| "parent"
|
|
4
8
|
| "root"
|
|
5
9
|
| { ancestor: number };
|
|
10
|
+
|
|
11
|
+
export type ScreenAnimationSource = {
|
|
12
|
+
screenInterpolatorProps: SharedValue<ScreenInterpolatorFrame>;
|
|
13
|
+
boundsAccessor: BoundsAccessor;
|
|
14
|
+
};
|
|
@@ -1,19 +1,37 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type DerivedValue, useDerivedValue } from "react-native-reanimated";
|
|
2
2
|
import type { ScreenInterpolationProps } from "../../../types/animation.types";
|
|
3
3
|
import { useScreenAnimationContext } from "./animation.provider";
|
|
4
4
|
import { resolveScreenAnimationTarget } from "./helpers/resolve-screen-animation-target";
|
|
5
|
-
import type { ScreenAnimationTarget } from "./types";
|
|
5
|
+
import type { ScreenAnimationSource, ScreenAnimationTarget } from "./types";
|
|
6
6
|
|
|
7
7
|
export type { ScreenAnimationTarget } from "./types";
|
|
8
8
|
|
|
9
9
|
export function useScreenAnimation(
|
|
10
10
|
target?: ScreenAnimationTarget,
|
|
11
11
|
): DerivedValue<ScreenInterpolationProps> {
|
|
12
|
-
const {
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const {
|
|
13
|
+
screenInterpolatorProps,
|
|
14
|
+
boundsAccessor,
|
|
15
|
+
ancestorScreenAnimationSources,
|
|
16
|
+
} = useScreenAnimationContext();
|
|
17
|
+
|
|
18
|
+
const source = resolveScreenAnimationTarget<ScreenAnimationSource>({
|
|
15
19
|
target,
|
|
16
|
-
self:
|
|
17
|
-
|
|
20
|
+
self: {
|
|
21
|
+
screenInterpolatorProps,
|
|
22
|
+
boundsAccessor,
|
|
23
|
+
},
|
|
24
|
+
ancestors: ancestorScreenAnimationSources,
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
return useDerivedValue<ScreenInterpolationProps>(() => {
|
|
28
|
+
"worklet";
|
|
29
|
+
|
|
30
|
+
const props = source.screenInterpolatorProps.get();
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
...props,
|
|
34
|
+
bounds: source.boundsAccessor,
|
|
35
|
+
};
|
|
18
36
|
});
|
|
19
37
|
}
|
|
@@ -4,6 +4,7 @@ export interface DescriptorDerivations {
|
|
|
4
4
|
previousScreenKey?: string;
|
|
5
5
|
currentScreenKey: string;
|
|
6
6
|
nextScreenKey?: string;
|
|
7
|
+
parentScreenKey?: string;
|
|
7
8
|
isFirstKey: boolean;
|
|
8
9
|
isTopMostScreen: boolean;
|
|
9
10
|
ancestorKeys: string[];
|
|
@@ -55,6 +56,7 @@ export function deriveDescriptorDerivations({
|
|
|
55
56
|
previousScreenKey,
|
|
56
57
|
currentScreenKey,
|
|
57
58
|
nextScreenKey,
|
|
59
|
+
parentScreenKey: ancestorKeys[0],
|
|
58
60
|
isFirstKey,
|
|
59
61
|
isTopMostScreen,
|
|
60
62
|
ancestorKeys,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { memo } from "react";
|
|
2
|
+
import { StyleSheet, View } from "react-native";
|
|
3
|
+
|
|
4
|
+
interface MaybeFloatingContainerProps {
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
isFloatingOverlay?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const MaybeFloatingContainer = memo(function MaybeFloatingContainer({
|
|
10
|
+
children,
|
|
11
|
+
isFloatingOverlay,
|
|
12
|
+
}: MaybeFloatingContainerProps) {
|
|
13
|
+
if (!isFloatingOverlay) {
|
|
14
|
+
return children;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<View style={styles.float} pointerEvents="box-none">
|
|
19
|
+
{children}
|
|
20
|
+
</View>
|
|
21
|
+
);
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const styles = StyleSheet.create({
|
|
25
|
+
float: {
|
|
26
|
+
...StyleSheet.absoluteFill,
|
|
27
|
+
zIndex: 999,
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NAVIGATION_MASK_CONTAINER_STYLE_ID,
|
|
3
|
+
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
4
|
+
} from "../../../constants";
|
|
5
|
+
|
|
6
|
+
export const IDENTITY_TRANSFORM = [
|
|
7
|
+
{ translateX: 0 },
|
|
8
|
+
{ translateY: 0 },
|
|
9
|
+
{ scaleX: 1 },
|
|
10
|
+
{ scaleY: 1 },
|
|
11
|
+
] as const;
|
|
12
|
+
|
|
13
|
+
export const ALWAYS_RESET_STYLE_VALUES = {
|
|
14
|
+
opacity: 1,
|
|
15
|
+
zIndex: 0,
|
|
16
|
+
elevation: 0,
|
|
17
|
+
} as const;
|
|
18
|
+
|
|
19
|
+
export const LOCAL_ONLY_STYLE_SLOT_IDS = {
|
|
20
|
+
content: true,
|
|
21
|
+
backdrop: true,
|
|
22
|
+
surface: true,
|
|
23
|
+
[NAVIGATION_MASK_ELEMENT_STYLE_ID]: true,
|
|
24
|
+
[NAVIGATION_MASK_CONTAINER_STYLE_ID]: true,
|
|
25
|
+
} as const;
|
|
26
|
+
|
|
27
|
+
export const shouldSlotInherit = (slotId: string) => {
|
|
28
|
+
"worklet";
|
|
29
|
+
// biome-ignore lint/suspicious/noPrototypeBuiltins: <proj issue>
|
|
30
|
+
return !Object.prototype.hasOwnProperty.call(
|
|
31
|
+
LOCAL_ONLY_STYLE_SLOT_IDS,
|
|
32
|
+
slotId,
|
|
33
|
+
);
|
|
34
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
NormalizedTransitionInterpolatedStyle,
|
|
3
|
+
NormalizedTransitionSlotStyle,
|
|
4
|
+
} from "../../../../types/animation.types";
|
|
5
|
+
|
|
6
|
+
const isExplicitTransitionSlot = (value: unknown) => {
|
|
7
|
+
"worklet";
|
|
8
|
+
return (
|
|
9
|
+
typeof value === "object" &&
|
|
10
|
+
value != null &&
|
|
11
|
+
("style" in value || "props" in value)
|
|
12
|
+
);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const isAlreadyNormalizedStyleMap = (raw: Record<string, any>) => {
|
|
16
|
+
"worklet";
|
|
17
|
+
|
|
18
|
+
for (const key in raw) {
|
|
19
|
+
const value = raw[key];
|
|
20
|
+
|
|
21
|
+
if (value === undefined) {
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
if (!isExplicitTransitionSlot(value)) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return true;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export function normalizeSlots(
|
|
34
|
+
raw: Record<string, any>,
|
|
35
|
+
): NormalizedTransitionInterpolatedStyle {
|
|
36
|
+
"worklet";
|
|
37
|
+
|
|
38
|
+
if (isAlreadyNormalizedStyleMap(raw)) {
|
|
39
|
+
return raw as NormalizedTransitionInterpolatedStyle;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const normalized: Record<string, NormalizedTransitionSlotStyle | undefined> =
|
|
43
|
+
{};
|
|
44
|
+
|
|
45
|
+
for (const key in raw) {
|
|
46
|
+
const value = raw[key];
|
|
47
|
+
|
|
48
|
+
if (value === undefined) {
|
|
49
|
+
normalized[key] = undefined;
|
|
50
|
+
continue;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (isExplicitTransitionSlot(value)) {
|
|
54
|
+
normalized[key] = value as NormalizedTransitionSlotStyle;
|
|
55
|
+
} else {
|
|
56
|
+
normalized[key] = { style: value };
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return normalized as NormalizedTransitionInterpolatedStyle;
|
|
61
|
+
}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
NormalizedTransitionInterpolatedStyle,
|
|
3
|
+
NormalizedTransitionSlotStyle,
|
|
4
|
+
} from "../../../../types/animation.types";
|
|
5
|
+
import {
|
|
6
|
+
ALWAYS_RESET_STYLE_VALUES,
|
|
7
|
+
IDENTITY_TRANSFORM,
|
|
8
|
+
shouldSlotInherit,
|
|
9
|
+
} from "../constants";
|
|
10
|
+
|
|
11
|
+
export type ResettableStyleState = {
|
|
12
|
+
hasTransform: boolean;
|
|
13
|
+
hasOpacity: boolean;
|
|
14
|
+
hasZIndex: boolean;
|
|
15
|
+
hasElevation: boolean;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export type ResettableStyleStatesBySlot = Record<string, ResettableStyleState>;
|
|
19
|
+
|
|
20
|
+
const EMPTY_RESETTABLE_STYLE_STATE = Object.freeze({
|
|
21
|
+
hasTransform: false,
|
|
22
|
+
hasOpacity: false,
|
|
23
|
+
hasZIndex: false,
|
|
24
|
+
hasElevation: false,
|
|
25
|
+
}) as ResettableStyleState;
|
|
26
|
+
|
|
27
|
+
export const resolveSlotStyles = ({
|
|
28
|
+
currentStylesMap,
|
|
29
|
+
ancestorStylesMap,
|
|
30
|
+
previousStyleStatesBySlot,
|
|
31
|
+
}: {
|
|
32
|
+
currentStylesMap: NormalizedTransitionInterpolatedStyle;
|
|
33
|
+
ancestorStylesMap: NormalizedTransitionInterpolatedStyle;
|
|
34
|
+
previousStyleStatesBySlot: ResettableStyleStatesBySlot;
|
|
35
|
+
}) => {
|
|
36
|
+
"worklet";
|
|
37
|
+
const resolvedStylesMap: NormalizedTransitionInterpolatedStyle = {};
|
|
38
|
+
const nextPreviousStyleStatesBySlot: ResettableStyleStatesBySlot = {};
|
|
39
|
+
|
|
40
|
+
const appendResolvedSlot = (slotId: string) => {
|
|
41
|
+
"worklet";
|
|
42
|
+
|
|
43
|
+
const slot =
|
|
44
|
+
currentStylesMap[slotId] ??
|
|
45
|
+
(shouldSlotInherit(slotId) ? ancestorStylesMap[slotId] : undefined);
|
|
46
|
+
|
|
47
|
+
const baseStyle = slot?.style as Record<string, unknown> | undefined;
|
|
48
|
+
|
|
49
|
+
let hasAnyStyleKeys = false;
|
|
50
|
+
let hasTransform = false;
|
|
51
|
+
let hasOpacity = false;
|
|
52
|
+
let hasZIndex = false;
|
|
53
|
+
let hasElevation = false;
|
|
54
|
+
|
|
55
|
+
if (baseStyle) {
|
|
56
|
+
for (const key in baseStyle) {
|
|
57
|
+
hasAnyStyleKeys = true;
|
|
58
|
+
|
|
59
|
+
if (key === "transform") {
|
|
60
|
+
hasTransform = true;
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
if (key === "opacity") {
|
|
65
|
+
hasOpacity = true;
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (key === "zIndex") {
|
|
70
|
+
hasZIndex = true;
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (key === "elevation") {
|
|
75
|
+
hasElevation = true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const previousState =
|
|
81
|
+
previousStyleStatesBySlot[slotId] ?? EMPTY_RESETTABLE_STYLE_STATE;
|
|
82
|
+
const shouldResetTransform = previousState.hasTransform && !hasTransform;
|
|
83
|
+
const shouldResetOpacity = previousState.hasOpacity && !hasOpacity;
|
|
84
|
+
const shouldResetZIndex = previousState.hasZIndex && !hasZIndex;
|
|
85
|
+
const shouldResetElevation = previousState.hasElevation && !hasElevation;
|
|
86
|
+
const hasResetPatch =
|
|
87
|
+
shouldResetTransform ||
|
|
88
|
+
shouldResetOpacity ||
|
|
89
|
+
shouldResetZIndex ||
|
|
90
|
+
shouldResetElevation;
|
|
91
|
+
const hasProps = slot?.props !== undefined;
|
|
92
|
+
|
|
93
|
+
if (hasTransform || hasOpacity || hasZIndex || hasElevation) {
|
|
94
|
+
nextPreviousStyleStatesBySlot[slotId] = {
|
|
95
|
+
hasTransform,
|
|
96
|
+
hasOpacity,
|
|
97
|
+
hasZIndex,
|
|
98
|
+
hasElevation,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (!slot && !hasResetPatch) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (!hasResetPatch && slot) {
|
|
107
|
+
if (hasAnyStyleKeys || hasProps) {
|
|
108
|
+
resolvedStylesMap[slotId] = slot;
|
|
109
|
+
}
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
if (!hasAnyStyleKeys && !hasResetPatch && !hasProps) {
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const resolvedSlot = {} as NormalizedTransitionSlotStyle;
|
|
118
|
+
|
|
119
|
+
if (hasAnyStyleKeys || hasResetPatch) {
|
|
120
|
+
const resolvedStyle: Record<string, any> = {};
|
|
121
|
+
|
|
122
|
+
if (shouldResetTransform) {
|
|
123
|
+
resolvedStyle.transform = IDENTITY_TRANSFORM;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (shouldResetOpacity) {
|
|
127
|
+
resolvedStyle.opacity = ALWAYS_RESET_STYLE_VALUES.opacity;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (shouldResetZIndex) {
|
|
131
|
+
resolvedStyle.zIndex = ALWAYS_RESET_STYLE_VALUES.zIndex;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (shouldResetElevation) {
|
|
135
|
+
resolvedStyle.elevation = ALWAYS_RESET_STYLE_VALUES.elevation;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
if (baseStyle) {
|
|
139
|
+
for (const key in baseStyle) {
|
|
140
|
+
resolvedStyle[key] = baseStyle[key];
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
resolvedSlot.style = resolvedStyle;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (hasProps) {
|
|
148
|
+
resolvedSlot.props = slot?.props;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
if (!resolvedSlot.style && !resolvedSlot.props) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
resolvedStylesMap[slotId] = resolvedSlot;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
for (const slotId in currentStylesMap) {
|
|
159
|
+
appendResolvedSlot(slotId);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
for (const slotId in ancestorStylesMap) {
|
|
163
|
+
if (!shouldSlotInherit(slotId)) {
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
if (currentStylesMap[slotId] !== undefined) {
|
|
168
|
+
continue;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
appendResolvedSlot(slotId);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
for (const slotId in previousStyleStatesBySlot) {
|
|
175
|
+
if (currentStylesMap[slotId] !== undefined) {
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if (shouldSlotInherit(slotId) && ancestorStylesMap[slotId] !== undefined) {
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
appendResolvedSlot(slotId);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return {
|
|
187
|
+
resolvedStylesMap,
|
|
188
|
+
nextPreviousStyleStatesBySlot,
|
|
189
|
+
};
|
|
190
|
+
};
|