react-native-screen-transitions 3.9.0-alpha.1 → 3.9.0-alpha.3
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/boundary/components/boundary-target.js +21 -16
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js +88 -114
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/{use-boundary-presence.js → lifecycles/use-boundary-presence.js} +14 -7
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/{use-initial-destination-measurement.js → lifecycles/use-initial-destination-measurement.js} +51 -24
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/{use-initial-source-measurement.js → lifecycles/use-initial-source-measurement.js} +7 -10
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/{use-refresh-boundary.js → lifecycles/use-refresh-boundary.js} +10 -7
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +82 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +10 -13
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/index.js +27 -30
- package/lib/commonjs/shared/components/boundary/index.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js +58 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/host.js +20 -4
- package/lib/commonjs/shared/components/boundary/portal/components/host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js +53 -32
- package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/portal.js +206 -96
- package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js +14 -2
- package/lib/commonjs/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js +5 -44
- package/lib/commonjs/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js +37 -5
- package/lib/commonjs/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/teleport.js +15 -2
- package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js +18 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/has-local-slot.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/naming.js +10 -3
- package/lib/commonjs/shared/components/boundary/portal/utils/naming.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js +28 -49
- package/lib/commonjs/shared/components/boundary/portal/utils/offset-style.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js +254 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/resolve-portal.js +38 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/resolve-portal.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/shallow-equal.js +29 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/shallow-equal.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js +10 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/teleport-control.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/visible-host.js +25 -0
- package/lib/commonjs/shared/components/boundary/portal/utils/visible-host.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +65 -0
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +12 -2
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js +0 -21
- package/lib/commonjs/shared/components/boundary/utils/refresh-signals.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/utils/source-signals.js +4 -9
- package/lib/commonjs/shared/components/boundary/utils/source-signals.js.map +1 -1
- package/lib/commonjs/shared/components/create-transition-aware-component.js +2 -20
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js +1 -1
- package/lib/commonjs/shared/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +2 -14
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +4 -16
- 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 -15
- 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 +4 -16
- package/lib/commonjs/shared/components/screen-container/layers/surface-container.js.map +1 -1
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js +6 -3
- package/lib/commonjs/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js +1 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +143 -24
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/screen-composer.js +1 -1
- package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/compose-slot-style.js +95 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/compose-slot-style.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/normalize-slots.js +30 -9
- package/lib/commonjs/shared/providers/screen/styles/helpers/normalize-slots.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js +32 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/opening-phase.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +16 -11
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js +2 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js +1 -20
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js +1 -11
- package/lib/commonjs/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js +96 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +36 -36
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +1 -19
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +8 -3
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/index.js +38 -7
- package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/{styles.provider.js → slot.provider.js} +34 -21
- package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js +53 -0
- package/lib/commonjs/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -0
- package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +37 -2
- package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/entries.js +11 -4
- package/lib/commonjs/shared/stores/bounds/internals/entries.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/links.js +134 -51
- package/lib/commonjs/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +1 -3
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/stores/system.store.js +5 -0
- package/lib/commonjs/shared/stores/system.store.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js +10 -69
- package/lib/commonjs/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/styles/local-transform.js +59 -0
- package/lib/commonjs/shared/utils/bounds/helpers/styles/local-transform.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +8 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +59 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/commonjs/shared/utils/logger.js +11 -0
- package/lib/commonjs/shared/utils/logger.js.map +1 -1
- package/lib/module/shared/components/boundary/components/boundary-target.js +19 -14
- package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/module/shared/components/boundary/create-boundary-component.js +93 -119
- package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js +30 -0
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-boundary-presence.js.map +1 -0
- package/lib/module/shared/components/boundary/hooks/{use-initial-destination-measurement.js → lifecycles/use-initial-destination-measurement.js} +51 -24
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -0
- package/lib/module/shared/components/boundary/hooks/{use-initial-source-measurement.js → lifecycles/use-initial-source-measurement.js} +7 -10
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.js.map +1 -0
- package/lib/module/shared/components/boundary/hooks/{use-refresh-boundary.js → lifecycles/use-refresh-boundary.js} +10 -7
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.js.map +1 -0
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +77 -0
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -0
- package/lib/module/shared/components/boundary/hooks/use-measurer.js +10 -13
- package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/module/shared/components/boundary/index.js +27 -30
- package/lib/module/shared/components/boundary/index.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js +53 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-local-portal-host.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/components/host.js +21 -5
- package/lib/module/shared/components/boundary/portal/components/host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js +53 -32
- package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/portal.js +213 -103
- package/lib/module/shared/components/boundary/portal/components/portal.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js +15 -3
- package/lib/module/shared/components/boundary/portal/hooks/use-host-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js +4 -41
- package/lib/module/shared/components/boundary/portal/stores/host-registry.store.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js +35 -4
- package/lib/module/shared/components/boundary/portal/stores/portal-boundary-host.store.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/teleport.js +16 -2
- package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js +13 -0
- package/lib/module/shared/components/boundary/portal/utils/has-local-slot.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/utils/naming.js +8 -2
- package/lib/module/shared/components/boundary/portal/utils/naming.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/utils/offset-style.js +29 -49
- package/lib/module/shared/components/boundary/portal/utils/offset-style.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/utils/ownership.js +246 -0
- package/lib/module/shared/components/boundary/portal/utils/ownership.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/utils/resolve-portal.js +33 -0
- package/lib/module/shared/components/boundary/portal/utils/resolve-portal.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/utils/shallow-equal.js +24 -0
- package/lib/module/shared/components/boundary/portal/utils/shallow-equal.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/utils/teleport-control.js +8 -0
- package/lib/module/shared/components/boundary/portal/utils/teleport-control.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/utils/visible-host.js +20 -0
- package/lib/module/shared/components/boundary/portal/utils/visible-host.js.map +1 -0
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +57 -0
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
- package/lib/module/shared/components/boundary/utils/destination-signals.js +12 -2
- package/lib/module/shared/components/boundary/utils/destination-signals.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/refresh-signals.js +0 -21
- package/lib/module/shared/components/boundary/utils/refresh-signals.js.map +1 -1
- package/lib/module/shared/components/boundary/utils/source-signals.js +4 -9
- package/lib/module/shared/components/boundary/utils/source-signals.js.map +1 -1
- package/lib/module/shared/components/create-transition-aware-component.js +4 -22
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/overlay/variations/float-overlay.js +2 -2
- package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/backdrop.js +4 -16
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +4 -16
- 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 +5 -16
- 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 +4 -16
- package/lib/module/shared/components/screen-container/layers/surface-container.js.map +1 -1
- package/lib/module/shared/index.js.map +1 -1
- package/lib/module/shared/providers/helpers/measured-bounds-writes.js +6 -3
- package/lib/module/shared/providers/helpers/measured-bounds-writes.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/derivations.js +1 -0
- package/lib/module/shared/providers/screen/animation/helpers/derivations.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +144 -25
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/screen-composer.js +2 -2
- package/lib/module/shared/providers/screen/screen-composer.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/compose-slot-style.js +89 -0
- package/lib/module/shared/providers/screen/styles/helpers/compose-slot-style.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/normalize-slots.js +30 -9
- package/lib/module/shared/providers/screen/styles/helpers/normalize-slots.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js +26 -0
- package/lib/module/shared/providers/screen/styles/helpers/opening-phase.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js +16 -11
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/index.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js +2 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js +0 -18
- package/lib/module/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js +0 -9
- package/lib/module/shared/providers/screen/styles/helpers/visibility-gate.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js +87 -0
- package/lib/module/shared/providers/screen/styles/hooks/slot-resolvers.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js +36 -36
- package/lib/module/shared/providers/screen/styles/hooks/use-interpolated-style-maps.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +1 -19
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js +9 -4
- package/lib/module/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/index.js +2 -1
- package/lib/module/shared/providers/screen/styles/index.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/slot.provider.js +66 -0
- package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js +47 -0
- package/lib/module/shared/providers/screen/styles/stores/slot-references.store.js.map +1 -0
- package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +33 -1
- package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/entries.js +11 -4
- package/lib/module/shared/stores/bounds/internals/entries.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/links.js +135 -53
- package/lib/module/shared/stores/bounds/internals/links.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +1 -3
- package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/module/shared/stores/system.store.js +5 -0
- 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/styles/compute.js +10 -69
- package/lib/module/shared/utils/bounds/helpers/styles/compute.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/styles/local-transform.js +52 -0
- package/lib/module/shared/utils/bounds/helpers/styles/local-transform.js.map +1 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js +9 -2
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +58 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/module/shared/utils/logger.js +11 -0
- package/lib/module/shared/utils/logger.js.map +1 -1
- package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts +0 -1
- package/lib/typescript/shared/components/boundary/create-boundary-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-presence.d.ts +11 -0
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-boundary-presence.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts +10 -0
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts +8 -0
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-source-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts +10 -0
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-refresh-boundary.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +28 -0
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts +5 -6
- package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/index.d.ts +36 -229
- package/lib/typescript/shared/components/boundary/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts +8 -0
- package/lib/typescript/shared/components/boundary/portal/components/boundary-local-portal-host.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/components/host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/portal-boundary-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +4 -3
- package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/hooks/use-host-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts +0 -7
- package/lib/typescript/shared/components/boundary/portal/stores/host-registry.store.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts +16 -1
- package/lib/typescript/shared/components/boundary/portal/stores/portal-boundary-host.store.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -1
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts +3 -0
- package/lib/typescript/shared/components/boundary/portal/utils/has-local-slot.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts +2 -1
- package/lib/typescript/shared/components/boundary/portal/utils/naming.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts +16 -32
- package/lib/typescript/shared/components/boundary/portal/utils/offset-style.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts +35 -0
- package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/utils/resolve-portal.d.ts +12 -0
- package/lib/typescript/shared/components/boundary/portal/utils/resolve-portal.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/utils/shallow-equal.d.ts +8 -0
- package/lib/typescript/shared/components/boundary/portal/utils/shallow-equal.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts +4 -0
- package/lib/typescript/shared/components/boundary/portal/utils/teleport-control.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/visible-host.d.ts +8 -0
- package/lib/typescript/shared/components/boundary/portal/utils/visible-host.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +37 -0
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/types.d.ts +9 -36
- package/lib/typescript/shared/components/boundary/types.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts +1 -0
- package/lib/typescript/shared/components/boundary/utils/destination-signals.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/refresh-signals.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/utils/source-signals.d.ts +0 -1
- package/lib/typescript/shared/components/boundary/utils/source-signals.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/layers/backdrop.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +3 -215
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts +3 -3
- package/lib/typescript/shared/providers/helpers/measured-bounds-writes.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts +1 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/derivations.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/pipeline.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/compose-slot-style.d.ts +4 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/compose-slot-style.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/normalize-slots.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts +16 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/opening-phase.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts +3 -4
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts +2 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.d.ts +0 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts +0 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/visibility-gate.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts +11 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/slot-resolvers.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts +4 -6
- package/lib/typescript/shared/providers/screen/styles/hooks/use-interpolated-style-maps.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +0 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/index.d.ts +2 -1
- package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts +18 -0
- package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts +6 -0
- package/lib/typescript/shared/providers/screen/styles/stores/slot-references.store.d.ts.map +1 -0
- package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +8 -1
- package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/entries.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts +4 -3
- package/lib/typescript/shared/stores/bounds/internals/links.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts +22 -20
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- package/lib/typescript/shared/stores/system.store.d.ts +1 -0
- package/lib/typescript/shared/stores/system.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +7 -1
- package/lib/typescript/shared/types/animation.types.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/helpers/styles/local-transform.d.ts +6 -0
- package/lib/typescript/shared/utils/bounds/helpers/styles/local-transform.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +9 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
- package/lib/typescript/shared/utils/logger.d.ts +6 -0
- package/lib/typescript/shared/utils/logger.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/components/boundary/components/boundary-target.tsx +30 -16
- package/src/shared/components/boundary/create-boundary-component.tsx +132 -164
- package/src/shared/components/boundary/hooks/lifecycles/use-boundary-presence.ts +41 -0
- package/src/shared/components/boundary/hooks/{use-initial-destination-measurement.ts → lifecycles/use-initial-destination-measurement.ts} +65 -22
- package/src/shared/components/boundary/hooks/{use-initial-source-measurement.ts → lifecycles/use-initial-source-measurement.ts} +10 -12
- package/src/shared/components/boundary/hooks/{use-refresh-boundary.ts → lifecycles/use-refresh-boundary.ts} +10 -10
- package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +97 -0
- package/src/shared/components/boundary/hooks/use-measurer.ts +16 -24
- package/src/shared/components/boundary/index.tsx +56 -30
- package/src/shared/components/boundary/portal/components/boundary-local-portal-host.tsx +66 -0
- package/src/shared/components/boundary/portal/components/host.tsx +20 -5
- package/src/shared/components/boundary/portal/components/portal-boundary-host.tsx +67 -52
- package/src/shared/components/boundary/portal/components/portal.tsx +281 -120
- package/src/shared/components/boundary/portal/hooks/use-host-measurement.ts +23 -2
- package/src/shared/components/boundary/portal/stores/host-registry.store.ts +4 -51
- package/src/shared/components/boundary/portal/stores/portal-boundary-host.store.ts +59 -6
- package/src/shared/components/boundary/portal/teleport.ts +28 -3
- package/src/shared/components/boundary/portal/utils/has-local-slot.ts +16 -0
- package/src/shared/components/boundary/portal/utils/naming.ts +11 -1
- package/src/shared/components/boundary/portal/utils/offset-style.ts +37 -139
- package/src/shared/components/boundary/portal/utils/ownership.ts +371 -0
- package/src/shared/components/boundary/portal/utils/resolve-portal.ts +50 -0
- package/src/shared/components/boundary/portal/utils/shallow-equal.ts +25 -0
- package/src/shared/components/boundary/portal/utils/teleport-control.ts +12 -0
- package/src/shared/components/boundary/portal/utils/visible-host.ts +24 -0
- package/src/shared/components/boundary/providers/{boundary-owner.provider.tsx → boundary-root.provider.tsx} +33 -47
- package/src/shared/components/boundary/types.ts +9 -39
- package/src/shared/components/boundary/utils/destination-signals.ts +22 -2
- package/src/shared/components/boundary/utils/refresh-signals.ts +0 -41
- package/src/shared/components/boundary/utils/source-signals.ts +5 -17
- package/src/shared/components/create-transition-aware-component.tsx +3 -25
- package/src/shared/components/overlay/variations/float-overlay.tsx +3 -3
- package/src/shared/components/screen-container/layers/backdrop.tsx +4 -17
- package/src/shared/components/screen-container/layers/content.tsx +4 -16
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +8 -18
- package/src/shared/components/screen-container/layers/surface-container.tsx +4 -17
- package/src/shared/index.ts +0 -5
- package/src/shared/providers/helpers/measured-bounds-writes.ts +6 -11
- package/src/shared/providers/screen/animation/helpers/derivations.ts +3 -0
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +251 -68
- package/src/shared/providers/screen/screen-composer.tsx +3 -3
- package/src/shared/providers/screen/styles/helpers/compose-slot-style.ts +129 -0
- package/src/shared/providers/screen/styles/helpers/normalize-slots.ts +45 -8
- package/src/shared/providers/screen/styles/helpers/opening-phase.ts +25 -0
- package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +22 -12
- package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.ts +3 -1
- package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/slot-state.ts +0 -24
- package/src/shared/providers/screen/styles/helpers/visibility-gate.ts +0 -12
- package/src/shared/providers/screen/styles/hooks/slot-resolvers.tsx +111 -0
- package/src/shared/providers/screen/styles/hooks/use-interpolated-style-maps.tsx +48 -38
- package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +0 -18
- package/src/shared/providers/screen/styles/hooks/use-resolved-slot-style-map.tsx +17 -4
- package/src/shared/providers/screen/styles/index.tsx +13 -4
- package/src/shared/providers/screen/styles/slot.provider.tsx +93 -0
- package/src/shared/providers/screen/styles/stores/slot-references.store.ts +71 -0
- package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +41 -1
- package/src/shared/stores/bounds/internals/entries.ts +13 -5
- package/src/shared/stores/bounds/internals/links.ts +167 -85
- package/src/shared/stores/bounds/internals/resolver.ts +0 -2
- package/src/shared/stores/bounds/types.ts +24 -22
- package/src/shared/stores/system.store.ts +6 -0
- package/src/shared/types/animation.types.ts +8 -1
- package/src/shared/utils/bounds/helpers/styles/compute.ts +22 -124
- package/src/shared/utils/bounds/helpers/styles/local-transform.ts +86 -0
- package/src/shared/utils/bounds/navigation/zoom/build.ts +9 -1
- package/src/shared/utils/bounds/navigation/zoom/helpers.ts +96 -0
- package/src/shared/utils/logger.ts +12 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js +0 -40
- package/lib/commonjs/shared/components/boundary/portal/utils/attachment.js.map +0 -1
- package/lib/commonjs/shared/components/boundary/providers/boundary-owner.provider.js +0 -68
- package/lib/commonjs/shared/components/boundary/providers/boundary-owner.provider.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/preserve-animated-props-only.js +0 -26
- package/lib/commonjs/shared/providers/screen/styles/helpers/preserve-animated-props-only.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +0 -1
- package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js +0 -23
- package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js.map +0 -1
- package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +0 -1
- package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js.map +0 -1
- package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js.map +0 -1
- package/lib/module/shared/components/boundary/portal/utils/attachment.js +0 -35
- package/lib/module/shared/components/boundary/portal/utils/attachment.js.map +0 -1
- package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js +0 -60
- package/lib/module/shared/components/boundary/providers/boundary-owner.provider.js.map +0 -1
- package/lib/module/shared/providers/screen/styles/helpers/preserve-animated-props-only.js +0 -21
- package/lib/module/shared/providers/screen/styles/helpers/preserve-animated-props-only.js.map +0 -1
- package/lib/module/shared/providers/screen/styles/styles.provider.js +0 -53
- package/lib/module/shared/providers/screen/styles/styles.provider.js.map +0 -1
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts +0 -8
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts +0 -9
- package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts +0 -9
- package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts +0 -10
- package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts +0 -21
- package/lib/typescript/shared/components/boundary/portal/utils/attachment.d.ts.map +0 -1
- package/lib/typescript/shared/components/boundary/providers/boundary-owner.provider.d.ts +0 -44
- package/lib/typescript/shared/components/boundary/providers/boundary-owner.provider.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/preserve-animated-props-only.d.ts +0 -3
- package/lib/typescript/shared/providers/screen/styles/helpers/preserve-animated-props-only.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts +0 -14
- package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +0 -1
- package/src/shared/components/boundary/hooks/use-boundary-presence.ts +0 -28
- package/src/shared/components/boundary/portal/utils/attachment.ts +0 -48
- package/src/shared/providers/screen/styles/helpers/preserve-animated-props-only.ts +0 -22
- package/src/shared/providers/screen/styles/styles.provider.tsx +0 -60
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
1
2
|
import { useWindowDimensions } from "react-native";
|
|
2
3
|
import {
|
|
3
4
|
type DerivedValue,
|
|
@@ -6,20 +7,26 @@ import {
|
|
|
6
7
|
useSharedValue,
|
|
7
8
|
} from "react-native-reanimated";
|
|
8
9
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
9
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
createScreenTransitionState,
|
|
12
|
+
DEFAULT_SCREEN_TRANSITION_STATE,
|
|
13
|
+
} from "../../../../constants";
|
|
10
14
|
import { useStack } from "../../../../hooks/navigation/use-stack";
|
|
11
15
|
import type {
|
|
12
16
|
ScreenInterpolationProps,
|
|
13
17
|
ScreenStyleInterpolator,
|
|
18
|
+
ScreenTransitionState,
|
|
14
19
|
} from "../../../../types/animation.types";
|
|
15
20
|
|
|
16
|
-
import { useDescriptors } from "../../descriptors";
|
|
21
|
+
import { type BaseDescriptor, useDescriptors } from "../../descriptors";
|
|
22
|
+
import { buildScreenTransitionOptions } from "./build-screen-transition-options";
|
|
17
23
|
import { updateDerivations } from "./derivations";
|
|
18
24
|
import { hasTransitionsEnabled } from "./has-transitions-enabled";
|
|
19
25
|
import { hydrateTransitionState } from "./hydrate-transition-state";
|
|
20
26
|
import type { SelectedInterpolatorOptions } from "./selected-interpolator-options";
|
|
21
27
|
import { resolveStackProgress } from "./stack-progress";
|
|
22
28
|
import { useBuildTransitionState } from "./use-build-transition-state";
|
|
29
|
+
import { toPlainRoute, toPlainValue } from "./worklet";
|
|
23
30
|
|
|
24
31
|
export type ScreenInterpolatorFrame = Omit<
|
|
25
32
|
ScreenInterpolationProps,
|
|
@@ -34,28 +41,236 @@ interface ScreenAnimationPipeline {
|
|
|
34
41
|
currentInterpolator: ScreenStyleInterpolator | undefined;
|
|
35
42
|
}
|
|
36
43
|
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
insets: ScreenInterpolatorFrame["insets"],
|
|
40
|
-
): ScreenInterpolatorFrame => {
|
|
41
|
-
const current = {
|
|
42
|
-
...DEFAULT_SCREEN_TRANSITION_STATE,
|
|
43
|
-
layouts: { screen: dimensions },
|
|
44
|
-
};
|
|
44
|
+
const getInitialSettledProgress = (descriptor: BaseDescriptor) => {
|
|
45
|
+
const { snapPoints, initialSnapIndex = 0 } = descriptor.options;
|
|
45
46
|
|
|
46
|
-
|
|
47
|
+
if (!snapPoints?.length) {
|
|
48
|
+
return 1;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const clampedIndex = Math.min(
|
|
52
|
+
Math.max(0, initialSnapIndex),
|
|
53
|
+
snapPoints.length - 1,
|
|
54
|
+
);
|
|
55
|
+
const snapPoint = snapPoints[clampedIndex];
|
|
56
|
+
|
|
57
|
+
return typeof snapPoint === "number" ? snapPoint : 0;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const applyInitialProgress = ({
|
|
61
|
+
state,
|
|
62
|
+
dimensions,
|
|
63
|
+
progress,
|
|
64
|
+
entering = 0,
|
|
65
|
+
closing = 0,
|
|
66
|
+
animating = 0,
|
|
67
|
+
willAnimate = 0,
|
|
68
|
+
settled = entering || closing || animating ? 0 : 1,
|
|
69
|
+
}: {
|
|
70
|
+
state: ScreenTransitionState;
|
|
71
|
+
dimensions: ScreenInterpolatorFrame["layouts"]["screen"];
|
|
72
|
+
progress: number;
|
|
73
|
+
entering?: number;
|
|
74
|
+
closing?: number;
|
|
75
|
+
animating?: number;
|
|
76
|
+
willAnimate?: number;
|
|
77
|
+
settled?: number;
|
|
78
|
+
}) => {
|
|
79
|
+
state.progress = progress;
|
|
80
|
+
state.transitionProgress = progress;
|
|
81
|
+
state.entering = entering;
|
|
82
|
+
state.closing = closing;
|
|
83
|
+
state.animating = animating;
|
|
84
|
+
state.willAnimate = willAnimate;
|
|
85
|
+
state.settled = settled;
|
|
86
|
+
state.logicallySettled = settled;
|
|
87
|
+
state.layouts.screen = dimensions;
|
|
88
|
+
|
|
89
|
+
return state;
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const createInitialTransitionState = ({
|
|
93
|
+
descriptor,
|
|
94
|
+
dimensions,
|
|
95
|
+
progress,
|
|
96
|
+
entering,
|
|
97
|
+
animating,
|
|
98
|
+
willAnimate,
|
|
99
|
+
settled,
|
|
100
|
+
}: {
|
|
101
|
+
descriptor: BaseDescriptor;
|
|
102
|
+
dimensions: ScreenInterpolatorFrame["layouts"]["screen"];
|
|
103
|
+
progress: number;
|
|
104
|
+
entering?: number;
|
|
105
|
+
animating?: number;
|
|
106
|
+
willAnimate?: number;
|
|
107
|
+
settled?: number;
|
|
108
|
+
}) => {
|
|
109
|
+
const meta = descriptor.options.meta
|
|
110
|
+
? (toPlainValue(descriptor.options.meta) as Record<string, unknown>)
|
|
111
|
+
: undefined;
|
|
112
|
+
const state = createScreenTransitionState(
|
|
113
|
+
toPlainRoute(descriptor.route),
|
|
114
|
+
meta,
|
|
115
|
+
buildScreenTransitionOptions(descriptor.options),
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
return applyInitialProgress({
|
|
119
|
+
state,
|
|
120
|
+
dimensions,
|
|
121
|
+
progress,
|
|
122
|
+
entering,
|
|
123
|
+
animating,
|
|
124
|
+
willAnimate,
|
|
125
|
+
settled,
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const createInitialInterpolatorProps = ({
|
|
130
|
+
dimensions,
|
|
131
|
+
insets,
|
|
132
|
+
currentDescriptor,
|
|
133
|
+
nextDescriptor,
|
|
134
|
+
prevDescriptor,
|
|
135
|
+
}: {
|
|
136
|
+
dimensions: ScreenInterpolatorFrame["layouts"]["screen"];
|
|
137
|
+
insets: ScreenInterpolatorFrame["insets"];
|
|
138
|
+
currentDescriptor: BaseDescriptor;
|
|
139
|
+
nextDescriptor?: BaseDescriptor;
|
|
140
|
+
prevDescriptor?: BaseDescriptor;
|
|
141
|
+
}): ScreenInterpolatorFrame => {
|
|
142
|
+
const hasIncomingNext = !!nextDescriptor;
|
|
143
|
+
const isFocusedEntering = !!prevDescriptor && !nextDescriptor;
|
|
144
|
+
const shouldAnimateInitialMount =
|
|
145
|
+
!prevDescriptor &&
|
|
146
|
+
!nextDescriptor &&
|
|
147
|
+
!!currentDescriptor.options.experimental_animateOnInitialMount;
|
|
148
|
+
const currentProgress =
|
|
149
|
+
hasIncomingNext || (!isFocusedEntering && !shouldAnimateInitialMount)
|
|
150
|
+
? getInitialSettledProgress(currentDescriptor)
|
|
151
|
+
: 0;
|
|
152
|
+
const currentEntering =
|
|
153
|
+
isFocusedEntering || shouldAnimateInitialMount ? 1 : 0;
|
|
154
|
+
const current = createInitialTransitionState({
|
|
155
|
+
descriptor: currentDescriptor,
|
|
156
|
+
dimensions,
|
|
157
|
+
progress: currentProgress,
|
|
158
|
+
entering: currentEntering,
|
|
159
|
+
animating: currentEntering,
|
|
160
|
+
willAnimate: currentEntering,
|
|
161
|
+
});
|
|
162
|
+
const previous = prevDescriptor
|
|
163
|
+
? createInitialTransitionState({
|
|
164
|
+
descriptor: prevDescriptor,
|
|
165
|
+
dimensions,
|
|
166
|
+
progress: getInitialSettledProgress(prevDescriptor),
|
|
167
|
+
})
|
|
168
|
+
: undefined;
|
|
169
|
+
const next = nextDescriptor
|
|
170
|
+
? createInitialTransitionState({
|
|
171
|
+
descriptor: nextDescriptor,
|
|
172
|
+
dimensions,
|
|
173
|
+
progress: 0,
|
|
174
|
+
entering: 1,
|
|
175
|
+
animating: 1,
|
|
176
|
+
willAnimate: 1,
|
|
177
|
+
settled: 0,
|
|
178
|
+
})
|
|
179
|
+
: undefined;
|
|
180
|
+
const frame: ScreenInterpolatorFrame = {
|
|
47
181
|
layouts: current.layouts,
|
|
48
182
|
insets,
|
|
49
|
-
previous
|
|
183
|
+
previous,
|
|
50
184
|
current,
|
|
51
|
-
next
|
|
185
|
+
next,
|
|
52
186
|
progress: 0,
|
|
187
|
+
transitionProgress: 0,
|
|
53
188
|
stackProgress: 0,
|
|
54
189
|
logicallySettled: 1,
|
|
55
190
|
focused: true,
|
|
56
191
|
active: current,
|
|
57
192
|
inactive: undefined,
|
|
58
193
|
};
|
|
194
|
+
|
|
195
|
+
updateDerivations(frame);
|
|
196
|
+
frame.stackProgress = frame.progress;
|
|
197
|
+
frame.logicallySettled = frame.active.settled;
|
|
198
|
+
|
|
199
|
+
return frame;
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
type BuiltTransitionState = NonNullable<
|
|
203
|
+
ReturnType<typeof useBuildTransitionState>
|
|
204
|
+
>;
|
|
205
|
+
|
|
206
|
+
const hydrateInterpolatorFrame = <TFrame extends ScreenInterpolatorFrame>({
|
|
207
|
+
frame,
|
|
208
|
+
dimensions,
|
|
209
|
+
insets,
|
|
210
|
+
currentAnimation,
|
|
211
|
+
nextAnimation,
|
|
212
|
+
prevAnimation,
|
|
213
|
+
nextHasTransitions,
|
|
214
|
+
interpolatorOptions,
|
|
215
|
+
}: {
|
|
216
|
+
frame: TFrame;
|
|
217
|
+
dimensions: ScreenInterpolatorFrame["layouts"]["screen"];
|
|
218
|
+
insets: ScreenInterpolatorFrame["insets"];
|
|
219
|
+
currentAnimation: BuiltTransitionState | undefined;
|
|
220
|
+
nextAnimation: BuiltTransitionState | undefined;
|
|
221
|
+
prevAnimation: BuiltTransitionState | undefined;
|
|
222
|
+
nextHasTransitions: boolean;
|
|
223
|
+
interpolatorOptions: SelectedInterpolatorOptions;
|
|
224
|
+
}): TFrame => {
|
|
225
|
+
"worklet";
|
|
226
|
+
const shouldApplyOptionsToCurrent = interpolatorOptions.owner === "current";
|
|
227
|
+
const shouldApplyOptionsToNext =
|
|
228
|
+
interpolatorOptions.owner === "next" &&
|
|
229
|
+
!!nextAnimation &&
|
|
230
|
+
nextHasTransitions;
|
|
231
|
+
const previousCurrentProgress = currentAnimation?.visualProgress.get();
|
|
232
|
+
const previousNextProgress =
|
|
233
|
+
nextAnimation && nextHasTransitions
|
|
234
|
+
? nextAnimation.visualProgress.get()
|
|
235
|
+
: undefined;
|
|
236
|
+
|
|
237
|
+
frame.previous = prevAnimation
|
|
238
|
+
? hydrateTransitionState(prevAnimation, dimensions)
|
|
239
|
+
: undefined;
|
|
240
|
+
|
|
241
|
+
frame.current = currentAnimation
|
|
242
|
+
? hydrateTransitionState(
|
|
243
|
+
currentAnimation,
|
|
244
|
+
dimensions,
|
|
245
|
+
shouldApplyOptionsToCurrent ? interpolatorOptions.options : undefined,
|
|
246
|
+
)
|
|
247
|
+
: DEFAULT_SCREEN_TRANSITION_STATE;
|
|
248
|
+
|
|
249
|
+
frame.next =
|
|
250
|
+
nextAnimation && nextHasTransitions
|
|
251
|
+
? hydrateTransitionState(
|
|
252
|
+
nextAnimation,
|
|
253
|
+
dimensions,
|
|
254
|
+
shouldApplyOptionsToNext ? interpolatorOptions.options : undefined,
|
|
255
|
+
)
|
|
256
|
+
: undefined;
|
|
257
|
+
|
|
258
|
+
frame.layouts = frame.current.layouts;
|
|
259
|
+
frame.insets = insets;
|
|
260
|
+
|
|
261
|
+
updateDerivations(frame);
|
|
262
|
+
|
|
263
|
+
frame.stackProgress = resolveStackProgress(
|
|
264
|
+
currentAnimation?.stackProgress,
|
|
265
|
+
frame.progress,
|
|
266
|
+
frame.current.progress,
|
|
267
|
+
previousCurrentProgress,
|
|
268
|
+
frame.next?.progress,
|
|
269
|
+
previousNextProgress,
|
|
270
|
+
);
|
|
271
|
+
frame.logicallySettled = frame.active.settled;
|
|
272
|
+
|
|
273
|
+
return frame;
|
|
59
274
|
};
|
|
60
275
|
|
|
61
276
|
export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
|
|
@@ -80,74 +295,42 @@ export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
|
|
|
80
295
|
!!nextRouteKey &&
|
|
81
296
|
hasTransitionsEnabled(nextDescriptor?.options, transitionsAlwaysOn);
|
|
82
297
|
|
|
83
|
-
const
|
|
84
|
-
|
|
298
|
+
const initialInterpolatorProps = useMemo(
|
|
299
|
+
() =>
|
|
300
|
+
createInitialInterpolatorProps({
|
|
301
|
+
dimensions,
|
|
302
|
+
insets,
|
|
303
|
+
currentDescriptor: currDescriptor,
|
|
304
|
+
nextDescriptor,
|
|
305
|
+
prevDescriptor,
|
|
306
|
+
}),
|
|
307
|
+
[dimensions, insets, currDescriptor, nextDescriptor, prevDescriptor],
|
|
85
308
|
);
|
|
309
|
+
|
|
310
|
+
const screenInterpolatorProps = useSharedValue(initialInterpolatorProps);
|
|
86
311
|
const selectedInterpolatorOptions =
|
|
87
312
|
useSharedValue<SelectedInterpolatorOptions>({
|
|
88
313
|
owner: "current",
|
|
89
314
|
});
|
|
90
315
|
|
|
91
316
|
const propsRevisionState = useSharedValue({ value: 0 });
|
|
317
|
+
|
|
92
318
|
const screenInterpolatorPropsRevision = useDerivedValue<number>(() => {
|
|
93
319
|
"worklet";
|
|
94
320
|
|
|
95
321
|
screenInterpolatorProps.modify((frame) => {
|
|
96
322
|
"worklet";
|
|
97
323
|
const interpolatorOptions = selectedInterpolatorOptions.get();
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
: undefined;
|
|
109
|
-
|
|
110
|
-
frame.previous = prevAnimation
|
|
111
|
-
? hydrateTransitionState(prevAnimation, dimensions)
|
|
112
|
-
: undefined;
|
|
113
|
-
|
|
114
|
-
frame.current = currentAnimation
|
|
115
|
-
? hydrateTransitionState(
|
|
116
|
-
currentAnimation,
|
|
117
|
-
dimensions,
|
|
118
|
-
shouldApplyOptionsToCurrent
|
|
119
|
-
? interpolatorOptions.options
|
|
120
|
-
: undefined,
|
|
121
|
-
)
|
|
122
|
-
: DEFAULT_SCREEN_TRANSITION_STATE;
|
|
123
|
-
|
|
124
|
-
frame.next =
|
|
125
|
-
nextAnimation && nextHasTransitions
|
|
126
|
-
? hydrateTransitionState(
|
|
127
|
-
nextAnimation,
|
|
128
|
-
dimensions,
|
|
129
|
-
shouldApplyOptionsToNext
|
|
130
|
-
? interpolatorOptions.options
|
|
131
|
-
: undefined,
|
|
132
|
-
)
|
|
133
|
-
: undefined;
|
|
134
|
-
|
|
135
|
-
frame.layouts = frame.current.layouts;
|
|
136
|
-
frame.insets = insets;
|
|
137
|
-
|
|
138
|
-
updateDerivations(frame);
|
|
139
|
-
|
|
140
|
-
frame.stackProgress = resolveStackProgress(
|
|
141
|
-
currentAnimation?.stackProgress,
|
|
142
|
-
frame.progress,
|
|
143
|
-
frame.current.progress,
|
|
144
|
-
previousCurrentProgress,
|
|
145
|
-
frame.next?.progress,
|
|
146
|
-
previousNextProgress,
|
|
147
|
-
);
|
|
148
|
-
frame.logicallySettled = frame.active.settled;
|
|
149
|
-
|
|
150
|
-
return frame;
|
|
324
|
+
return hydrateInterpolatorFrame({
|
|
325
|
+
frame,
|
|
326
|
+
dimensions,
|
|
327
|
+
insets,
|
|
328
|
+
currentAnimation,
|
|
329
|
+
nextAnimation,
|
|
330
|
+
prevAnimation,
|
|
331
|
+
nextHasTransitions,
|
|
332
|
+
interpolatorOptions,
|
|
333
|
+
});
|
|
151
334
|
}, false);
|
|
152
335
|
|
|
153
336
|
// Critical reactive dependency for `screenInterpolatorProps`.
|
|
@@ -5,7 +5,7 @@ import { ScreenAnimationProvider } from "./animation";
|
|
|
5
5
|
import { type BaseDescriptor, DescriptorsProvider } from "./descriptors";
|
|
6
6
|
import { ScreenGestureProvider } from "./gestures";
|
|
7
7
|
import { ScreenOptionsProvider } from "./options";
|
|
8
|
-
import {
|
|
8
|
+
import { ScreenSlotProvider } from "./styles";
|
|
9
9
|
|
|
10
10
|
type Props<TDescriptor extends BaseDescriptor> = {
|
|
11
11
|
previous?: TDescriptor;
|
|
@@ -26,9 +26,9 @@ export function ScreenComposer<TDescriptor extends BaseDescriptor>({
|
|
|
26
26
|
<ScreenOptionsProvider>
|
|
27
27
|
<ScreenGestureProvider>
|
|
28
28
|
<ScreenAnimationProvider>
|
|
29
|
-
<
|
|
29
|
+
<ScreenSlotProvider>
|
|
30
30
|
<ScreenContainer>{children}</ScreenContainer>
|
|
31
|
-
</
|
|
31
|
+
</ScreenSlotProvider>
|
|
32
32
|
</ScreenAnimationProvider>
|
|
33
33
|
</ScreenGestureProvider>
|
|
34
34
|
</ScreenOptionsProvider>
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { StyleProps, TransformArrayItem } from "react-native-reanimated";
|
|
2
|
+
import { NO_STYLES } from "../../../../constants";
|
|
3
|
+
|
|
4
|
+
type SharedValueLike = {
|
|
5
|
+
_isReanimatedSharedValue: true;
|
|
6
|
+
get?: () => unknown;
|
|
7
|
+
value?: unknown;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const isSharedValueLike = (value: unknown): value is SharedValueLike => {
|
|
11
|
+
"worklet";
|
|
12
|
+
return (
|
|
13
|
+
(value as Partial<SharedValueLike> | null)?._isReanimatedSharedValue ===
|
|
14
|
+
true
|
|
15
|
+
);
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const resolveTransformValue = <T>(value: T): T | unknown => {
|
|
19
|
+
"worklet";
|
|
20
|
+
if (isSharedValueLike(value)) {
|
|
21
|
+
return value.value;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (Array.isArray(value)) {
|
|
25
|
+
const resolved = [];
|
|
26
|
+
for (let index = 0; index < value.length; index++) {
|
|
27
|
+
const item = value[index];
|
|
28
|
+
resolved.push(isSharedValueLike(item) ? item.value : item);
|
|
29
|
+
}
|
|
30
|
+
return resolved;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return value;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const resolveTransformItem = (
|
|
37
|
+
value: TransformArrayItem,
|
|
38
|
+
): TransformArrayItem => {
|
|
39
|
+
"worklet";
|
|
40
|
+
if (typeof value === "object" && value !== null) {
|
|
41
|
+
const resolved: Record<string, unknown> = {};
|
|
42
|
+
const source = value as Record<string, unknown>;
|
|
43
|
+
for (const key in source) {
|
|
44
|
+
resolved[key] = resolveTransformValue(source[key]);
|
|
45
|
+
}
|
|
46
|
+
return resolved as TransformArrayItem;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return value;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const resolveLocalTransform = (
|
|
53
|
+
transform: TransformArrayItem[],
|
|
54
|
+
): TransformArrayItem[] => {
|
|
55
|
+
"worklet";
|
|
56
|
+
const resolved: TransformArrayItem[] = [];
|
|
57
|
+
|
|
58
|
+
for (let index = 0; index < transform.length; index++) {
|
|
59
|
+
resolved.push(resolveTransformItem(transform[index]));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
return resolved;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const flattenStyleObject = (
|
|
66
|
+
style: unknown,
|
|
67
|
+
): Record<string, unknown> | undefined => {
|
|
68
|
+
if (style === null || style === undefined || typeof style !== "object") {
|
|
69
|
+
return undefined;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (!Array.isArray(style)) {
|
|
73
|
+
return style as Record<string, unknown>;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
let flattened: Record<string, unknown> | undefined;
|
|
77
|
+
for (let index = 0; index < style.length; index++) {
|
|
78
|
+
const child = flattenStyleObject(style[index]);
|
|
79
|
+
|
|
80
|
+
if (!child) {
|
|
81
|
+
continue;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
flattened = flattened ?? {};
|
|
85
|
+
Object.assign(flattened, child);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return flattened;
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const getLocalTransformForSlotComposition = (
|
|
92
|
+
style: unknown,
|
|
93
|
+
): TransformArrayItem[] | undefined => {
|
|
94
|
+
const flattened = flattenStyleObject(style);
|
|
95
|
+
const transform = flattened?.transform;
|
|
96
|
+
|
|
97
|
+
return Array.isArray(transform)
|
|
98
|
+
? (transform as TransformArrayItem[])
|
|
99
|
+
: undefined;
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const composeSlotStyleWithLocalTransform = (
|
|
103
|
+
slotStyle: StyleProps | undefined,
|
|
104
|
+
localTransform: TransformArrayItem[] | undefined,
|
|
105
|
+
boundsLocalTransform?: TransformArrayItem[],
|
|
106
|
+
): StyleProps => {
|
|
107
|
+
"worklet";
|
|
108
|
+
const resolvedSlotStyle = (slotStyle ?? NO_STYLES) as StyleProps;
|
|
109
|
+
// The measured bounds snapshot supersedes the live local transform so bounds
|
|
110
|
+
// geometry and payload scale are composed from the same measurement frame.
|
|
111
|
+
const transformToCompose = boundsLocalTransform ?? localTransform;
|
|
112
|
+
|
|
113
|
+
if (!transformToCompose?.length) {
|
|
114
|
+
return resolvedSlotStyle;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const slotTransform = resolvedSlotStyle.transform;
|
|
118
|
+
if (!Array.isArray(slotTransform)) {
|
|
119
|
+
return resolvedSlotStyle;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
...resolvedSlotStyle,
|
|
124
|
+
transform: [
|
|
125
|
+
...(slotTransform as TransformArrayItem[]),
|
|
126
|
+
...resolveLocalTransform(transformToCompose),
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
};
|
|
@@ -2,6 +2,10 @@ import type {
|
|
|
2
2
|
NormalizedTransitionInterpolatedStyle,
|
|
3
3
|
NormalizedTransitionSlotStyle,
|
|
4
4
|
} from "../../../../types/animation.types";
|
|
5
|
+
import {
|
|
6
|
+
getBoundsLocalTransform,
|
|
7
|
+
stripBoundsLocalTransform,
|
|
8
|
+
} from "../../../../utils/bounds/helpers/styles/local-transform";
|
|
5
9
|
|
|
6
10
|
const isExplicitTransitionSlot = (value: unknown) => {
|
|
7
11
|
"worklet";
|
|
@@ -12,7 +16,14 @@ const isExplicitTransitionSlot = (value: unknown) => {
|
|
|
12
16
|
);
|
|
13
17
|
};
|
|
14
18
|
|
|
15
|
-
const
|
|
19
|
+
const hasBoundsLocalTransformMarker = (style: unknown) => {
|
|
20
|
+
"worklet";
|
|
21
|
+
return !!getBoundsLocalTransform(style as any)?.length;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const isAlreadyNormalizedStyleMapWithoutBoundsMetadata = (
|
|
25
|
+
raw: Record<string, any>,
|
|
26
|
+
) => {
|
|
16
27
|
"worklet";
|
|
17
28
|
|
|
18
29
|
for (const key in raw) {
|
|
@@ -25,6 +36,14 @@ const isAlreadyNormalizedStyleMap = (raw: Record<string, any>) => {
|
|
|
25
36
|
if (!isExplicitTransitionSlot(value)) {
|
|
26
37
|
return false;
|
|
27
38
|
}
|
|
39
|
+
|
|
40
|
+
if (
|
|
41
|
+
hasBoundsLocalTransformMarker(
|
|
42
|
+
(value as NormalizedTransitionSlotStyle).style,
|
|
43
|
+
)
|
|
44
|
+
) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
28
47
|
}
|
|
29
48
|
|
|
30
49
|
return true;
|
|
@@ -42,10 +61,7 @@ export function normalizeSlots(
|
|
|
42
61
|
): NormalizedTransitionInterpolatedStyle {
|
|
43
62
|
"worklet";
|
|
44
63
|
|
|
45
|
-
|
|
46
|
-
// slot shape. In that common case, we can forward the raw object directly and
|
|
47
|
-
// avoid building a second map just to copy the same slot references over.
|
|
48
|
-
if (isAlreadyNormalizedStyleMap(raw)) {
|
|
64
|
+
if (isAlreadyNormalizedStyleMapWithoutBoundsMetadata(raw)) {
|
|
49
65
|
return raw as NormalizedTransitionInterpolatedStyle;
|
|
50
66
|
}
|
|
51
67
|
|
|
@@ -62,11 +78,32 @@ export function normalizeSlots(
|
|
|
62
78
|
}
|
|
63
79
|
|
|
64
80
|
if (isExplicitTransitionSlot(value)) {
|
|
65
|
-
|
|
66
|
-
|
|
81
|
+
const explicitSlot = value as NormalizedTransitionSlotStyle;
|
|
82
|
+
const boundsLocalTransform = getBoundsLocalTransform(explicitSlot.style);
|
|
83
|
+
|
|
84
|
+
if (!boundsLocalTransform?.length) {
|
|
85
|
+
normalized[key] = explicitSlot;
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
normalized[key] = {
|
|
90
|
+
style: explicitSlot.style
|
|
91
|
+
? stripBoundsLocalTransform(explicitSlot.style)
|
|
92
|
+
: undefined,
|
|
93
|
+
props: explicitSlot.props,
|
|
94
|
+
boundsLocalTransform,
|
|
95
|
+
};
|
|
67
96
|
} else {
|
|
97
|
+
const boundsLocalTransform = getBoundsLocalTransform(value);
|
|
98
|
+
const style =
|
|
99
|
+
boundsLocalTransform?.length && value
|
|
100
|
+
? stripBoundsLocalTransform(value)
|
|
101
|
+
: value;
|
|
102
|
+
|
|
68
103
|
// Shorthand: plain StyleProps — wrap it
|
|
69
|
-
normalized[key] =
|
|
104
|
+
normalized[key] = boundsLocalTransform?.length
|
|
105
|
+
? { style, boundsLocalTransform }
|
|
106
|
+
: { style };
|
|
70
107
|
}
|
|
71
108
|
}
|
|
72
109
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The "pre-start" window of an opening transition: the screen has committed to
|
|
3
|
+
* opening (`entering`) but `transitionProgress` has not yet moved past 0, so no
|
|
4
|
+
* transformed frame has been produced yet.
|
|
5
|
+
*
|
|
6
|
+
* This window is a quarantine, and two source-level guards key off it:
|
|
7
|
+
* - the visibility gate keeps the entering screen hidden (it must not be SEEN), and
|
|
8
|
+
* - interpolator ownership stays on "current" so the entering screen does not
|
|
9
|
+
* DRIVE other screens' styles until its transition is actually live.
|
|
10
|
+
*
|
|
11
|
+
* Both must agree on when the open transition has started, so the threshold
|
|
12
|
+
* lives here in one place rather than being re-derived at each site.
|
|
13
|
+
*/
|
|
14
|
+
export const hasOpenTransitionStarted = (transitionProgress: number) => {
|
|
15
|
+
"worklet";
|
|
16
|
+
return transitionProgress > 0;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const isOpeningBeforeStart = (
|
|
20
|
+
entering: number,
|
|
21
|
+
transitionProgress: number,
|
|
22
|
+
) => {
|
|
23
|
+
"worklet";
|
|
24
|
+
return !!entering && !hasOpenTransitionStarted(transitionProgress);
|
|
25
|
+
};
|