react-native-screen-transitions 3.9.0-alpha.0 → 3.9.0-alpha.2
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 +10 -10
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js +45 -101
- package/lib/commonjs/shared/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js +103 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js +7 -4
- package/lib/commonjs/shared/components/boundary/hooks/use-boundary-presence.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js +24 -14
- package/lib/commonjs/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js +3 -4
- package/lib/commonjs/shared/components/boundary/hooks/use-initial-source-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js +6 -8
- package/lib/commonjs/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js +6 -3
- package/lib/commonjs/shared/components/boundary/hooks/use-refresh-boundary.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/index.js +2 -2
- package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js +8 -2
- package/lib/commonjs/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/portal-provider.js +5 -2
- package/lib/commonjs/shared/components/boundary/portal/components/portal-provider.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/portal.js +10 -7
- package/lib/commonjs/shared/components/boundary/portal/components/portal.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js +36 -0
- package/lib/commonjs/shared/components/boundary/portal/resolve-portal.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/portal/teleport.js +23 -0
- package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/providers/{boundary-owner.provider.js → boundary-root.provider.js} +21 -23
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
- package/lib/commonjs/shared/components/boundary/utils/destination-signals.js +33 -2
- package/lib/commonjs/shared/components/boundary/utils/destination-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/hooks/navigation/use-stack.js +17 -2
- package/lib/commonjs/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +142 -33
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js +23 -12
- package/lib/commonjs/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.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/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 +7 -8
- 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.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/use-interpolated-style-maps.js +23 -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 +25 -7
- package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/slot.provider.js +103 -0
- package/lib/commonjs/shared/providers/screen/styles/slot.provider.js.map +1 -0
- package/lib/commonjs/shared/stores/animation.store.js +2 -0
- package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js +16 -1
- package/lib/commonjs/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
- 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 +10 -10
- package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/module/shared/components/boundary/create-boundary-component.js +47 -103
- package/lib/module/shared/components/boundary/create-boundary-component.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js +98 -0
- package/lib/module/shared/components/boundary/hooks/use-boundary-measurement.js.map +1 -0
- package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js +7 -4
- package/lib/module/shared/components/boundary/hooks/use-boundary-presence.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js +24 -14
- package/lib/module/shared/components/boundary/hooks/use-initial-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js +3 -4
- package/lib/module/shared/components/boundary/hooks/use-initial-source-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-measurer.js +6 -8
- package/lib/module/shared/components/boundary/hooks/use-measurer.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js +6 -3
- package/lib/module/shared/components/boundary/hooks/use-refresh-boundary.js.map +1 -1
- package/lib/module/shared/components/boundary/index.js +2 -2
- package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js +8 -2
- package/lib/module/shared/components/boundary/portal/components/portal-boundary-host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/portal-provider.js +4 -1
- package/lib/module/shared/components/boundary/portal/components/portal-provider.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/portal.js +11 -8
- package/lib/module/shared/components/boundary/portal/components/portal.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/resolve-portal.js +31 -0
- package/lib/module/shared/components/boundary/portal/resolve-portal.js.map +1 -0
- package/lib/module/shared/components/boundary/portal/teleport.js +19 -0
- package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -0
- package/lib/module/shared/components/boundary/providers/{boundary-owner.provider.js → boundary-root.provider.js} +18 -20
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -0
- package/lib/module/shared/components/boundary/utils/destination-signals.js +33 -2
- package/lib/module/shared/components/boundary/utils/destination-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/hooks/navigation/use-stack.js +19 -4
- package/lib/module/shared/hooks/navigation/use-stack.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +144 -35
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js +20 -10
- package/lib/module/shared/providers/screen/animation/helpers/stack-progress.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +1 -0
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.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/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 +7 -8
- 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.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/use-interpolated-style-maps.js +22 -35
- 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 +1 -1
- package/lib/module/shared/providers/screen/styles/index.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/slot.provider.js +91 -0
- package/lib/module/shared/providers/screen/styles/slot.provider.js.map +1 -0
- package/lib/module/shared/stores/animation.store.js +2 -0
- package/lib/module/shared/stores/animation.store.js.map +1 -1
- package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js +14 -0
- package/lib/module/shared/stores/bounds/helpers/link-pairs.helpers.js.map +1 -1
- 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/blank-stack/navigators/create-blank-stack-navigator.d.ts +2 -1
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/component-stack/components/component-screen.d.ts +1 -1
- package/lib/typescript/component-stack/components/component-screen.d.ts.map +1 -1
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +2 -1
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts +1 -1
- package/lib/typescript/native-stack/navigators/createNativeStackNavigator.d.ts.map +1 -1
- package/lib/typescript/native-stack/views/NativeStackView.d.ts +2 -1
- package/lib/typescript/native-stack/views/NativeStackView.d.ts.map +1 -1
- package/lib/typescript/native-stack/views/useHeaderConfigProps.d.ts +2 -2
- package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts +1 -1
- package/lib/typescript/shared/adapters/with-screen-transitions/context.d.ts.map +1 -1
- package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts +1 -1
- package/lib/typescript/shared/adapters/with-screen-transitions/stack-layout.d.ts.map +1 -1
- package/lib/typescript/shared/components/activity/variants/activity-container.d.ts +1 -1
- package/lib/typescript/shared/components/activity/variants/activity-container.d.ts.map +1 -1
- package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts +1 -1
- package/lib/typescript/shared/components/activity/variants/activity-screen.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +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.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts +32 -0
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts +2 -1
- package/lib/typescript/shared/components/boundary/hooks/use-boundary-presence.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts +3 -2
- package/lib/typescript/shared/components/boundary/hooks/use-initial-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts +2 -2
- package/lib/typescript/shared/components/boundary/hooks/use-initial-source-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts +3 -5
- package/lib/typescript/shared/components/boundary/hooks/use-measurer.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts +3 -3
- package/lib/typescript/shared/components/boundary/hooks/use-refresh-boundary.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/index.d.ts +7 -211
- package/lib/typescript/shared/components/boundary/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/host.d.ts +2 -2
- 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-provider.d.ts +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/portal-provider.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/portal.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts +14 -0
- package/lib/typescript/shared/components/boundary/portal/resolve-portal.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +6 -0
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -0
- package/lib/typescript/shared/components/boundary/providers/{boundary-owner.provider.d.ts → boundary-root.provider.d.ts} +12 -14
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -0
- 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/create-transition-aware-component.d.ts +5 -6
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/masked-view.d.ts +1 -1
- package/lib/typescript/shared/components/masked-view.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts +1 -1
- package/lib/typescript/shared/components/overlay/variations/float-overlay.d.ts.map +1 -1
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts +1 -1
- package/lib/typescript/shared/components/overlay/variations/overlay-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/scene-view.d.ts +1 -1
- package/lib/typescript/shared/components/scene-view.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/index.d.ts +1 -1
- package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts +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 +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 +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 +1 -1
- package/lib/typescript/shared/components/screen-container/layers/surface-container.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts +1 -1
- package/lib/typescript/shared/hooks/navigation/use-stack.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +663 -919
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.d.ts +1 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/types.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/animation/helpers/stack-progress.d.ts +2 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/stack-progress.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +1 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/descriptors/descriptors.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/screen-composer.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/screen-composer.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/styles/components/floating-overlay-layer.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.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/use-interpolated-style-maps.d.ts +0 -5
- 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 +2 -3
- 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 +1 -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 +23 -0
- package/lib/typescript/shared/providers/screen/styles/slot.provider.d.ts.map +1 -0
- package/lib/typescript/shared/stores/animation.store.d.ts +1 -0
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts +6 -1
- package/lib/typescript/shared/stores/bounds/helpers/link-pairs.helpers.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts +13 -0
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- 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 +6 -1
- package/src/shared/components/boundary/components/boundary-target.tsx +12 -12
- package/src/shared/components/boundary/create-boundary-component.tsx +59 -142
- package/src/shared/components/boundary/hooks/use-boundary-measurement.ts +127 -0
- package/src/shared/components/boundary/hooks/use-boundary-presence.ts +7 -5
- package/src/shared/components/boundary/hooks/use-initial-destination-measurement.ts +27 -11
- package/src/shared/components/boundary/hooks/use-initial-source-measurement.ts +5 -5
- package/src/shared/components/boundary/hooks/use-measurer.ts +11 -14
- package/src/shared/components/boundary/hooks/use-refresh-boundary.ts +5 -5
- package/src/shared/components/boundary/index.tsx +2 -2
- package/src/shared/components/boundary/portal/components/portal-boundary-host.tsx +10 -3
- package/src/shared/components/boundary/portal/components/portal-provider.tsx +5 -1
- package/src/shared/components/boundary/portal/components/portal.tsx +15 -10
- package/src/shared/components/boundary/portal/resolve-portal.ts +40 -0
- package/src/shared/components/boundary/portal/teleport.ts +21 -0
- package/src/shared/components/boundary/providers/{boundary-owner.provider.tsx → boundary-root.provider.tsx} +27 -32
- package/src/shared/components/boundary/utils/destination-signals.ts +53 -2
- 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/hooks/navigation/use-stack.tsx +32 -1
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/types.ts +1 -0
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +253 -77
- package/src/shared/providers/screen/animation/helpers/stack-progress.ts +31 -16
- package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +2 -0
- package/src/shared/providers/screen/screen-composer.tsx +3 -3
- package/src/shared/providers/screen/styles/helpers/opening-phase.ts +25 -0
- package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/index.ts +8 -10
- package/src/shared/providers/screen/styles/helpers/resolve-slot-styles/materialize-slot.ts +0 -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/use-interpolated-style-maps.tsx +29 -37
- 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 +8 -4
- package/src/shared/providers/screen/styles/slot.provider.tsx +111 -0
- package/src/shared/stores/animation.store.ts +3 -0
- package/src/shared/stores/bounds/helpers/link-pairs.helpers.ts +17 -0
- package/src/shared/stores/bounds/types.ts +14 -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/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 +0 -61
- package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +0 -1
- 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/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/providers/screen/styles/helpers/preserve-animated-props-only.ts +0 -22
- package/src/shared/providers/screen/styles/styles.provider.tsx +0 -60
|
@@ -5,10 +5,14 @@ import {
|
|
|
5
5
|
useCallback,
|
|
6
6
|
useContext,
|
|
7
7
|
useLayoutEffect,
|
|
8
|
+
useMemo,
|
|
8
9
|
useRef,
|
|
9
10
|
useSyncExternalStore,
|
|
10
11
|
} from "react";
|
|
12
|
+
import { useDerivedValue } from "react-native-reanimated";
|
|
13
|
+
import { syncStackProgressValues } from "../../providers/screen/animation/helpers/stack-progress";
|
|
11
14
|
import type { StackCoreContextValue } from "../../providers/stack/core.provider";
|
|
15
|
+
import { AnimationStore } from "../../stores/animation.store";
|
|
12
16
|
import type { OverlayProps } from "../../types/overlay.types";
|
|
13
17
|
import type {
|
|
14
18
|
BaseStackDescriptor,
|
|
@@ -87,6 +91,30 @@ const createStackStore = (
|
|
|
87
91
|
const StackContext = createContext<StackStoreApi | null>(null);
|
|
88
92
|
StackContext.displayName = "Stack";
|
|
89
93
|
|
|
94
|
+
function StackProgressOwner({ routeKeys }: { routeKeys: string[] }) {
|
|
95
|
+
const visualProgressValues = useMemo(
|
|
96
|
+
() =>
|
|
97
|
+
routeKeys.map((routeKey) =>
|
|
98
|
+
AnimationStore.getValue(routeKey, "visualProgress"),
|
|
99
|
+
),
|
|
100
|
+
[routeKeys],
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
const stackProgressValues = useMemo(
|
|
104
|
+
() =>
|
|
105
|
+
routeKeys.map((routeKey) =>
|
|
106
|
+
AnimationStore.getValue(routeKey, "stackProgress"),
|
|
107
|
+
),
|
|
108
|
+
[routeKeys],
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
useDerivedValue(() => {
|
|
112
|
+
syncStackProgressValues(visualProgressValues, stackProgressValues);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
|
|
90
118
|
export function StackProvider({
|
|
91
119
|
children,
|
|
92
120
|
value,
|
|
@@ -116,7 +144,10 @@ export function StackProvider({
|
|
|
116
144
|
});
|
|
117
145
|
|
|
118
146
|
return (
|
|
119
|
-
<StackContext.Provider value={store}>
|
|
147
|
+
<StackContext.Provider value={store}>
|
|
148
|
+
<StackProgressOwner routeKeys={value.routeKeys} />
|
|
149
|
+
{children}
|
|
150
|
+
</StackContext.Provider>
|
|
120
151
|
);
|
|
121
152
|
}
|
|
122
153
|
|
|
@@ -11,6 +11,7 @@ import type { BaseStackRoute } from "../../../../../types/stack.types";
|
|
|
11
11
|
export type BuiltState = {
|
|
12
12
|
transitionProgress: SharedValue<number>;
|
|
13
13
|
visualProgress: SharedValue<number>;
|
|
14
|
+
stackProgress: SharedValue<number>;
|
|
14
15
|
willAnimate: SharedValue<number>;
|
|
15
16
|
closing: SharedValue<number>;
|
|
16
17
|
progressAnimating: SharedValue<number>;
|
|
@@ -7,21 +7,26 @@ import {
|
|
|
7
7
|
useSharedValue,
|
|
8
8
|
} from "react-native-reanimated";
|
|
9
9
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
createScreenTransitionState,
|
|
12
|
+
DEFAULT_SCREEN_TRANSITION_STATE,
|
|
13
|
+
} from "../../../../constants";
|
|
11
14
|
import { useStack } from "../../../../hooks/navigation/use-stack";
|
|
12
|
-
import { AnimationStore } from "../../../../stores/animation.store";
|
|
13
15
|
import type {
|
|
14
16
|
ScreenInterpolationProps,
|
|
15
17
|
ScreenStyleInterpolator,
|
|
18
|
+
ScreenTransitionState,
|
|
16
19
|
} from "../../../../types/animation.types";
|
|
17
20
|
|
|
18
|
-
import { useDescriptors } from "../../descriptors";
|
|
21
|
+
import { type BaseDescriptor, useDescriptors } from "../../descriptors";
|
|
22
|
+
import { buildScreenTransitionOptions } from "./build-screen-transition-options";
|
|
19
23
|
import { updateDerivations } from "./derivations";
|
|
20
24
|
import { hasTransitionsEnabled } from "./has-transitions-enabled";
|
|
21
25
|
import { hydrateTransitionState } from "./hydrate-transition-state";
|
|
22
26
|
import type { SelectedInterpolatorOptions } from "./selected-interpolator-options";
|
|
23
|
-
import {
|
|
27
|
+
import { resolveStackProgress } from "./stack-progress";
|
|
24
28
|
import { useBuildTransitionState } from "./use-build-transition-state";
|
|
29
|
+
import { toPlainRoute, toPlainValue } from "./worklet";
|
|
25
30
|
|
|
26
31
|
export type ScreenInterpolatorFrame = Omit<
|
|
27
32
|
ScreenInterpolationProps,
|
|
@@ -36,21 +41,148 @@ interface ScreenAnimationPipeline {
|
|
|
36
41
|
currentInterpolator: ScreenStyleInterpolator | undefined;
|
|
37
42
|
}
|
|
38
43
|
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
insets: ScreenInterpolatorFrame["insets"],
|
|
42
|
-
): ScreenInterpolatorFrame => {
|
|
43
|
-
const current = {
|
|
44
|
-
...DEFAULT_SCREEN_TRANSITION_STATE,
|
|
45
|
-
layouts: { screen: dimensions },
|
|
46
|
-
};
|
|
44
|
+
const getInitialSettledProgress = (descriptor: BaseDescriptor) => {
|
|
45
|
+
const { snapPoints, initialSnapIndex = 0 } = descriptor.options;
|
|
47
46
|
|
|
48
|
-
|
|
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 = {
|
|
49
181
|
layouts: current.layouts,
|
|
50
182
|
insets,
|
|
51
|
-
previous
|
|
183
|
+
previous,
|
|
52
184
|
current,
|
|
53
|
-
next
|
|
185
|
+
next,
|
|
54
186
|
progress: 0,
|
|
55
187
|
stackProgress: 0,
|
|
56
188
|
logicallySettled: 1,
|
|
@@ -58,13 +190,94 @@ const createInitialBaseInterpolatorProps = (
|
|
|
58
190
|
active: current,
|
|
59
191
|
inactive: undefined,
|
|
60
192
|
};
|
|
193
|
+
|
|
194
|
+
updateDerivations(frame);
|
|
195
|
+
frame.stackProgress = frame.progress;
|
|
196
|
+
frame.logicallySettled = frame.active.settled;
|
|
197
|
+
|
|
198
|
+
return frame;
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
type BuiltTransitionState = NonNullable<
|
|
202
|
+
ReturnType<typeof useBuildTransitionState>
|
|
203
|
+
>;
|
|
204
|
+
|
|
205
|
+
const hydrateInterpolatorFrame = <TFrame extends ScreenInterpolatorFrame>({
|
|
206
|
+
frame,
|
|
207
|
+
dimensions,
|
|
208
|
+
insets,
|
|
209
|
+
currentAnimation,
|
|
210
|
+
nextAnimation,
|
|
211
|
+
prevAnimation,
|
|
212
|
+
nextHasTransitions,
|
|
213
|
+
interpolatorOptions,
|
|
214
|
+
}: {
|
|
215
|
+
frame: TFrame;
|
|
216
|
+
dimensions: ScreenInterpolatorFrame["layouts"]["screen"];
|
|
217
|
+
insets: ScreenInterpolatorFrame["insets"];
|
|
218
|
+
currentAnimation: BuiltTransitionState | undefined;
|
|
219
|
+
nextAnimation: BuiltTransitionState | undefined;
|
|
220
|
+
prevAnimation: BuiltTransitionState | undefined;
|
|
221
|
+
nextHasTransitions: boolean;
|
|
222
|
+
interpolatorOptions: SelectedInterpolatorOptions;
|
|
223
|
+
}): TFrame => {
|
|
224
|
+
"worklet";
|
|
225
|
+
const shouldApplyOptionsToCurrent = interpolatorOptions.owner === "current";
|
|
226
|
+
const shouldApplyOptionsToNext =
|
|
227
|
+
interpolatorOptions.owner === "next" &&
|
|
228
|
+
!!nextAnimation &&
|
|
229
|
+
nextHasTransitions;
|
|
230
|
+
const previousCurrentProgress = currentAnimation?.visualProgress.get();
|
|
231
|
+
const previousNextProgress =
|
|
232
|
+
nextAnimation && nextHasTransitions
|
|
233
|
+
? nextAnimation.visualProgress.get()
|
|
234
|
+
: undefined;
|
|
235
|
+
|
|
236
|
+
frame.previous = prevAnimation
|
|
237
|
+
? hydrateTransitionState(prevAnimation, dimensions)
|
|
238
|
+
: undefined;
|
|
239
|
+
|
|
240
|
+
frame.current = currentAnimation
|
|
241
|
+
? hydrateTransitionState(
|
|
242
|
+
currentAnimation,
|
|
243
|
+
dimensions,
|
|
244
|
+
shouldApplyOptionsToCurrent ? interpolatorOptions.options : undefined,
|
|
245
|
+
)
|
|
246
|
+
: DEFAULT_SCREEN_TRANSITION_STATE;
|
|
247
|
+
|
|
248
|
+
frame.next =
|
|
249
|
+
nextAnimation && nextHasTransitions
|
|
250
|
+
? hydrateTransitionState(
|
|
251
|
+
nextAnimation,
|
|
252
|
+
dimensions,
|
|
253
|
+
shouldApplyOptionsToNext ? interpolatorOptions.options : undefined,
|
|
254
|
+
)
|
|
255
|
+
: undefined;
|
|
256
|
+
|
|
257
|
+
frame.layouts = frame.current.layouts;
|
|
258
|
+
frame.insets = insets;
|
|
259
|
+
|
|
260
|
+
updateDerivations(frame);
|
|
261
|
+
|
|
262
|
+
frame.stackProgress = resolveStackProgress(
|
|
263
|
+
currentAnimation?.stackProgress,
|
|
264
|
+
frame.progress,
|
|
265
|
+
frame.current.progress,
|
|
266
|
+
previousCurrentProgress,
|
|
267
|
+
frame.next?.progress,
|
|
268
|
+
previousNextProgress,
|
|
269
|
+
);
|
|
270
|
+
frame.logicallySettled = frame.active.settled;
|
|
271
|
+
|
|
272
|
+
return frame;
|
|
61
273
|
};
|
|
62
274
|
|
|
63
275
|
export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
|
|
64
|
-
const
|
|
276
|
+
const transitionsAlwaysOn = useStack(
|
|
277
|
+
(stack) => stack.flags.TRANSITIONS_ALWAYS_ON,
|
|
278
|
+
);
|
|
65
279
|
const dimensions = useWindowDimensions();
|
|
66
280
|
const insets = useSafeAreaInsets();
|
|
67
|
-
const transitionsAlwaysOn = flags.TRANSITIONS_ALWAYS_ON;
|
|
68
281
|
|
|
69
282
|
const {
|
|
70
283
|
current: currDescriptor,
|
|
@@ -76,84 +289,47 @@ export function useScreenAnimationPipeline(): ScreenAnimationPipeline {
|
|
|
76
289
|
const nextAnimation = useBuildTransitionState(nextDescriptor);
|
|
77
290
|
const prevAnimation = useBuildTransitionState(prevDescriptor);
|
|
78
291
|
|
|
79
|
-
const currentRouteKey = currDescriptor?.route?.key;
|
|
80
|
-
const currentIndex = routeKeys.indexOf(currentRouteKey);
|
|
81
|
-
const visualProgressValues = useMemo(() => {
|
|
82
|
-
return routeKeys.map((routeKey) =>
|
|
83
|
-
AnimationStore.getValue(routeKey, "visualProgress"),
|
|
84
|
-
);
|
|
85
|
-
}, [routeKeys]);
|
|
86
|
-
|
|
87
292
|
const nextRouteKey = nextDescriptor?.route?.key;
|
|
88
293
|
const nextHasTransitions =
|
|
89
294
|
!!nextRouteKey &&
|
|
90
295
|
hasTransitionsEnabled(nextDescriptor?.options, transitionsAlwaysOn);
|
|
91
296
|
|
|
92
|
-
const
|
|
93
|
-
|
|
297
|
+
const initialInterpolatorProps = useMemo(
|
|
298
|
+
() =>
|
|
299
|
+
createInitialInterpolatorProps({
|
|
300
|
+
dimensions,
|
|
301
|
+
insets,
|
|
302
|
+
currentDescriptor: currDescriptor,
|
|
303
|
+
nextDescriptor,
|
|
304
|
+
prevDescriptor,
|
|
305
|
+
}),
|
|
306
|
+
[dimensions, insets, currDescriptor, nextDescriptor, prevDescriptor],
|
|
94
307
|
);
|
|
308
|
+
|
|
309
|
+
const screenInterpolatorProps = useSharedValue(initialInterpolatorProps);
|
|
95
310
|
const selectedInterpolatorOptions =
|
|
96
311
|
useSharedValue<SelectedInterpolatorOptions>({
|
|
97
312
|
owner: "current",
|
|
98
313
|
});
|
|
99
314
|
|
|
100
315
|
const propsRevisionState = useSharedValue({ value: 0 });
|
|
316
|
+
|
|
101
317
|
const screenInterpolatorPropsRevision = useDerivedValue<number>(() => {
|
|
102
318
|
"worklet";
|
|
103
319
|
|
|
104
320
|
screenInterpolatorProps.modify((frame) => {
|
|
105
321
|
"worklet";
|
|
106
322
|
const interpolatorOptions = selectedInterpolatorOptions.get();
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
frame.current = currentAnimation
|
|
119
|
-
? hydrateTransitionState(
|
|
120
|
-
currentAnimation,
|
|
121
|
-
dimensions,
|
|
122
|
-
shouldApplyOptionsToCurrent
|
|
123
|
-
? interpolatorOptions.options
|
|
124
|
-
: undefined,
|
|
125
|
-
)
|
|
126
|
-
: DEFAULT_SCREEN_TRANSITION_STATE;
|
|
127
|
-
|
|
128
|
-
frame.next =
|
|
129
|
-
nextAnimation && nextHasTransitions
|
|
130
|
-
? hydrateTransitionState(
|
|
131
|
-
nextAnimation,
|
|
132
|
-
dimensions,
|
|
133
|
-
shouldApplyOptionsToNext
|
|
134
|
-
? interpolatorOptions.options
|
|
135
|
-
: undefined,
|
|
136
|
-
)
|
|
137
|
-
: undefined;
|
|
138
|
-
|
|
139
|
-
frame.layouts = frame.current.layouts;
|
|
140
|
-
frame.insets = insets;
|
|
141
|
-
|
|
142
|
-
updateDerivations(frame);
|
|
143
|
-
|
|
144
|
-
frame.stackProgress = deriveStackProgress(
|
|
145
|
-
routeKeys,
|
|
146
|
-
visualProgressValues,
|
|
147
|
-
currentIndex,
|
|
148
|
-
frame.progress,
|
|
149
|
-
currentRouteKey,
|
|
150
|
-
frame.current.progress,
|
|
151
|
-
nextRouteKey,
|
|
152
|
-
frame.next?.progress,
|
|
153
|
-
);
|
|
154
|
-
frame.logicallySettled = frame.active.settled;
|
|
155
|
-
|
|
156
|
-
return frame;
|
|
323
|
+
return hydrateInterpolatorFrame({
|
|
324
|
+
frame,
|
|
325
|
+
dimensions,
|
|
326
|
+
insets,
|
|
327
|
+
currentAnimation,
|
|
328
|
+
nextAnimation,
|
|
329
|
+
prevAnimation,
|
|
330
|
+
nextHasTransitions,
|
|
331
|
+
interpolatorOptions,
|
|
332
|
+
});
|
|
157
333
|
}, false);
|
|
158
334
|
|
|
159
335
|
// Critical reactive dependency for `screenInterpolatorProps`.
|
|
@@ -1,28 +1,43 @@
|
|
|
1
1
|
import type { SharedValue } from "react-native-reanimated";
|
|
2
2
|
|
|
3
|
-
export const
|
|
4
|
-
routeKeys: string[],
|
|
3
|
+
export const syncStackProgressValues = (
|
|
5
4
|
visualProgressValues: SharedValue<number>[],
|
|
6
|
-
|
|
5
|
+
stackProgressValues: SharedValue<number>[],
|
|
6
|
+
) => {
|
|
7
|
+
"worklet";
|
|
8
|
+
let total = 0;
|
|
9
|
+
|
|
10
|
+
for (let i = visualProgressValues.length - 1; i >= 0; i--) {
|
|
11
|
+
total += visualProgressValues[i]?.get() ?? 0;
|
|
12
|
+
const stackProgress = stackProgressValues[i];
|
|
13
|
+
|
|
14
|
+
if (stackProgress && stackProgress.get() !== total) {
|
|
15
|
+
stackProgress.set(total);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const resolveStackProgress = (
|
|
21
|
+
stackProgress: SharedValue<number> | undefined,
|
|
7
22
|
fallbackProgress: number,
|
|
8
|
-
currentRouteKey: string | undefined,
|
|
9
23
|
currentProgress: number,
|
|
10
|
-
|
|
24
|
+
previousCurrentProgress: number | undefined,
|
|
11
25
|
nextProgress: number | undefined,
|
|
26
|
+
previousNextProgress: number | undefined,
|
|
12
27
|
) => {
|
|
13
28
|
"worklet";
|
|
14
|
-
if (
|
|
29
|
+
if (!stackProgress) {
|
|
30
|
+
return fallbackProgress;
|
|
31
|
+
}
|
|
15
32
|
|
|
16
|
-
let total =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
total += visualProgressValues[i].get();
|
|
25
|
-
}
|
|
33
|
+
let total = stackProgress.get();
|
|
34
|
+
|
|
35
|
+
if (previousCurrentProgress !== undefined) {
|
|
36
|
+
total += currentProgress - previousCurrentProgress;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (nextProgress !== undefined && previousNextProgress !== undefined) {
|
|
40
|
+
total += nextProgress - previousNextProgress;
|
|
26
41
|
}
|
|
27
42
|
|
|
28
43
|
return total;
|
|
@@ -22,6 +22,7 @@ import { toPlainRoute, toPlainValue } from "./worklet";
|
|
|
22
22
|
type BuiltState = {
|
|
23
23
|
transitionProgress: SharedValue<number>;
|
|
24
24
|
visualProgress: SharedValue<number>;
|
|
25
|
+
stackProgress: SharedValue<number>;
|
|
25
26
|
willAnimate: SharedValue<number>;
|
|
26
27
|
closing: SharedValue<number>;
|
|
27
28
|
progressAnimating: SharedValue<number>;
|
|
@@ -67,6 +68,7 @@ export const useBuildTransitionState = (
|
|
|
67
68
|
return {
|
|
68
69
|
transitionProgress: AnimationStore.getValue(key, "transitionProgress"),
|
|
69
70
|
visualProgress: AnimationStore.getValue(key, "visualProgress"),
|
|
71
|
+
stackProgress: AnimationStore.getValue(key, "stackProgress"),
|
|
70
72
|
willAnimate: AnimationStore.getValue(key, "willAnimate"),
|
|
71
73
|
closing: AnimationStore.getValue(key, "closing"),
|
|
72
74
|
entering: AnimationStore.getValue(key, "entering"),
|
|
@@ -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,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
|
+
};
|
|
@@ -35,6 +35,11 @@ const getForwardedSlot = (
|
|
|
35
35
|
return slot;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
+
const hasDefinedBucketValue = (value: unknown) => {
|
|
39
|
+
"worklet";
|
|
40
|
+
return value !== undefined && value !== null;
|
|
41
|
+
};
|
|
42
|
+
|
|
38
43
|
const hasEitherResetPatch = (
|
|
39
44
|
hasStyleResetPatch: boolean,
|
|
40
45
|
hasPropResetPatch: boolean,
|
|
@@ -43,11 +48,6 @@ const hasEitherResetPatch = (
|
|
|
43
48
|
return hasStyleResetPatch || hasPropResetPatch;
|
|
44
49
|
};
|
|
45
50
|
|
|
46
|
-
const hasDefinedBucketValue = (value: unknown) => {
|
|
47
|
-
"worklet";
|
|
48
|
-
return value !== undefined && value !== null;
|
|
49
|
-
};
|
|
50
|
-
|
|
51
51
|
const hasResettableDisappearedKeys = (
|
|
52
52
|
previousKeys: Record<string, true> | undefined,
|
|
53
53
|
previousResetValues: Record<string, unknown> | undefined,
|
|
@@ -81,7 +81,6 @@ const getResolvedSlotOutput = ({
|
|
|
81
81
|
}) => {
|
|
82
82
|
"worklet";
|
|
83
83
|
const state = getResolvedSlotState(slot);
|
|
84
|
-
|
|
85
84
|
const hasStyleResetPatch = hasResettableDisappearedKeys(
|
|
86
85
|
previousState?.styleKeys,
|
|
87
86
|
previousState?.styleResetValues,
|
|
@@ -459,10 +458,9 @@ const appendPreviousSlots = (context: ResolveSlotStylesContext) => {
|
|
|
459
458
|
};
|
|
460
459
|
|
|
461
460
|
/**
|
|
462
|
-
* Resolves slot styles for the current screen pass and
|
|
463
|
-
*
|
|
464
|
-
*
|
|
465
|
-
* concrete identity values.
|
|
461
|
+
* Resolves slot styles for the current screen pass and emits reset values for
|
|
462
|
+
* transition-owned keys that existed in the previous resolved map but no longer
|
|
463
|
+
* exist in the current one.
|
|
466
464
|
*/
|
|
467
465
|
export const resolveSlotStyles = ({
|
|
468
466
|
localStylesMaps,
|
|
@@ -2,11 +2,6 @@ import type { NormalizedTransitionSlotStyle } from "../../../../../types/animati
|
|
|
2
2
|
import { getPropResetValue, getStyleResetValue } from "./reset-values";
|
|
3
3
|
import type { ResettableStyleState } from "./types";
|
|
4
4
|
|
|
5
|
-
const hasTrackedKey = (keys: Record<string, true> | undefined, key: string) => {
|
|
6
|
-
"worklet";
|
|
7
|
-
return keys !== undefined && keys[key] === true;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
5
|
const isDefinedStyleValue = (value: unknown) => {
|
|
11
6
|
"worklet";
|
|
12
7
|
return value !== undefined && value !== null;
|
|
@@ -52,25 +47,6 @@ const collectDefinedKeys = ({
|
|
|
52
47
|
};
|
|
53
48
|
};
|
|
54
49
|
|
|
55
|
-
export const hasDisappearedKeys = (
|
|
56
|
-
previousKeys: Record<string, true> | undefined,
|
|
57
|
-
currentKeys: Record<string, true> | undefined,
|
|
58
|
-
) => {
|
|
59
|
-
"worklet";
|
|
60
|
-
|
|
61
|
-
if (!previousKeys) {
|
|
62
|
-
return false;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
for (const key in previousKeys) {
|
|
66
|
-
if (!hasTrackedKey(currentKeys, key)) {
|
|
67
|
-
return true;
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return false;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
50
|
const hasEitherKeySet = (
|
|
75
51
|
styleKeys: Record<string, true> | undefined,
|
|
76
52
|
propKeys: Record<string, true> | undefined,
|