react-native-screen-transitions 3.9.0-alpha.1 → 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 -109
- 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.js +3 -3
- 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/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/providers/screen/animation/helpers/pipeline.js +142 -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/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/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 -111
- 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.js +4 -4
- 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/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/providers/screen/animation/helpers/pipeline.js +143 -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/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/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/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/pipeline.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/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 +1 -1
- package/src/shared/components/boundary/components/boundary-target.tsx +12 -12
- package/src/shared/components/boundary/create-boundary-component.tsx +59 -155
- 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.tsx +3 -3
- package/src/shared/components/boundary/portal/resolve-portal.ts +40 -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/providers/screen/animation/helpers/pipeline.ts +250 -68
- 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/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
|
@@ -2,34 +2,23 @@ import {
|
|
|
2
2
|
type ComponentType,
|
|
3
3
|
forwardRef,
|
|
4
4
|
memo,
|
|
5
|
-
useCallback,
|
|
6
5
|
useImperativeHandle,
|
|
7
6
|
useMemo,
|
|
8
|
-
useRef,
|
|
9
7
|
} from "react";
|
|
10
|
-
import
|
|
11
|
-
import Animated, {
|
|
12
|
-
runOnUI,
|
|
13
|
-
useAnimatedRef,
|
|
14
|
-
useAnimatedStyle,
|
|
15
|
-
} from "react-native-reanimated";
|
|
16
|
-
import { NO_STYLES } from "../../constants";
|
|
8
|
+
import Animated from "react-native-reanimated";
|
|
17
9
|
import { useDescriptorsStore } from "../../providers/screen/descriptors";
|
|
18
|
-
import { useScreenStyles } from "../../providers/screen/styles";
|
|
19
|
-
import { createPendingPairKey } from "../../stores/bounds/helpers/link-pairs.helpers";
|
|
20
|
-
import { prepareStyleForBounds } from "../../utils/bounds/helpers/styles/styles";
|
|
21
|
-
import { logger } from "../../utils/logger";
|
|
22
|
-
import { useBoundaryPresence } from "./hooks/use-boundary-presence";
|
|
23
|
-
import { useInitialDestinationMeasurement } from "./hooks/use-initial-destination-measurement";
|
|
24
|
-
import { useInitialSourceMeasurement } from "./hooks/use-initial-source-measurement";
|
|
25
|
-
import { useMeasurer } from "./hooks/use-measurer";
|
|
26
|
-
import { useRefreshBoundary } from "./hooks/use-refresh-boundary";
|
|
27
|
-
import { isTeleportAvailable } from "./portal/teleport";
|
|
28
10
|
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} from "
|
|
32
|
-
import
|
|
11
|
+
useSlotStackingStyles,
|
|
12
|
+
useSlotStyles,
|
|
13
|
+
} from "../../providers/screen/styles";
|
|
14
|
+
import { createBoundTag } from "../../stores/bounds/helpers/link-pairs.helpers";
|
|
15
|
+
import { useBoundaryMeasurement } from "./hooks/use-boundary-measurement";
|
|
16
|
+
import { resolveBoundaryPortal } from "./portal/resolve-portal";
|
|
17
|
+
import {
|
|
18
|
+
BoundaryRootProvider,
|
|
19
|
+
useBoundaryRootState,
|
|
20
|
+
} from "./providers/boundary-root.provider";
|
|
21
|
+
import type { BoundaryComponentProps } from "./types";
|
|
33
22
|
|
|
34
23
|
interface CreateBoundaryComponentOptions {
|
|
35
24
|
alreadyAnimated?: boolean;
|
|
@@ -49,7 +38,6 @@ export function createBoundaryComponent<P extends object>(
|
|
|
49
38
|
React.ComponentRef<typeof AnimatedComponent>,
|
|
50
39
|
BoundaryComponentProps<P>
|
|
51
40
|
>((props, forwardedRef) => {
|
|
52
|
-
const ownerRef = useAnimatedRef<View>();
|
|
53
41
|
const {
|
|
54
42
|
enabled = true,
|
|
55
43
|
group,
|
|
@@ -60,12 +48,15 @@ export function createBoundaryComponent<P extends object>(
|
|
|
60
48
|
method,
|
|
61
49
|
style,
|
|
62
50
|
onPress,
|
|
63
|
-
portal,
|
|
51
|
+
portal: portalProp,
|
|
64
52
|
...rest
|
|
65
53
|
} = props as any;
|
|
66
54
|
|
|
67
|
-
const
|
|
68
|
-
|
|
55
|
+
const boundTag = useMemo(
|
|
56
|
+
() => createBoundTag(String(id), group),
|
|
57
|
+
[id, group],
|
|
58
|
+
);
|
|
59
|
+
const portal = resolveBoundaryPortal(portalProp);
|
|
69
60
|
|
|
70
61
|
const currentScreenKey = useDescriptorsStore(
|
|
71
62
|
(s) => s.derivations.currentScreenKey,
|
|
@@ -73,154 +64,67 @@ export function createBoundaryComponent<P extends object>(
|
|
|
73
64
|
const hasConfiguredInterpolator = useDescriptorsStore(
|
|
74
65
|
(s) => s.derivations.hasConfiguredInterpolator,
|
|
75
66
|
);
|
|
76
|
-
|
|
77
67
|
const runtimeEnabled = enabled && hasConfiguredInterpolator;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
scaleMode,
|
|
82
|
-
target,
|
|
83
|
-
method,
|
|
84
|
-
};
|
|
85
|
-
}, [anchor, scaleMode, target, method]);
|
|
86
|
-
|
|
87
|
-
const ownerPreparedStyles = useMemo(
|
|
88
|
-
() => prepareStyleForBounds(style),
|
|
89
|
-
[style],
|
|
90
|
-
);
|
|
91
|
-
const { stylesMap } = useScreenStyles();
|
|
92
|
-
|
|
93
|
-
const associatedStyles = useAnimatedStyle(() => {
|
|
94
|
-
"worklet";
|
|
95
|
-
return stylesMap.get()[entryTag]?.style ?? NO_STYLES;
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
const associatedStackingStyles = useAnimatedStyle(() => {
|
|
99
|
-
"worklet";
|
|
100
|
-
const baseStyle = stylesMap.get()[entryTag]?.style;
|
|
101
|
-
const zIndex = baseStyle?.zIndex ?? 0;
|
|
102
|
-
const elevation = baseStyle?.elevation ?? 0;
|
|
68
|
+
// Associated slot styles attach whenever the boundary is enabled,
|
|
69
|
+
// independent of whether an interpolator is configured for this transition.
|
|
70
|
+
const shouldAttachAssociatedStyles = enabled;
|
|
103
71
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
72
|
+
const associatedStyles = useSlotStyles(boundTag.tag);
|
|
73
|
+
const associatedStackingStyles = useSlotStackingStyles(boundTag.tag);
|
|
107
74
|
|
|
108
|
-
|
|
75
|
+
const {
|
|
76
|
+
ref,
|
|
77
|
+
contextValue,
|
|
78
|
+
measuredRef,
|
|
79
|
+
hasActiveTarget,
|
|
80
|
+
targetPreparedStyles,
|
|
81
|
+
} = useBoundaryRootState({
|
|
82
|
+
boundTag,
|
|
83
|
+
portal,
|
|
84
|
+
associatedTargetStyles: shouldAttachAssociatedStyles
|
|
85
|
+
? associatedStyles
|
|
86
|
+
: undefined,
|
|
109
87
|
});
|
|
110
88
|
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
if (!hasWarned.current && !isTeleportAvailable && portal) {
|
|
115
|
-
logger.warn(
|
|
116
|
-
"react-native-teleport is not installed and will fallback to default behavior.",
|
|
117
|
-
);
|
|
118
|
-
hasWarned.current = true;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const { contextValue, measuredRef, hasActiveTarget, targetPreparedStyles } =
|
|
122
|
-
useBoundaryOwner({
|
|
123
|
-
ownerRef,
|
|
124
|
-
associatedTargetStyles: runtimeEnabled ? associatedStyles : undefined,
|
|
125
|
-
entryTag,
|
|
126
|
-
portal: adjustedPortal,
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
const preparedStyles = targetPreparedStyles ?? ownerPreparedStyles;
|
|
130
|
-
|
|
131
|
-
const portalHost =
|
|
132
|
-
typeof adjustedPortal === "object"
|
|
133
|
-
? (adjustedPortal.attachTo ?? "current-screen")
|
|
134
|
-
: adjustedPortal
|
|
135
|
-
? "current-screen"
|
|
136
|
-
: undefined;
|
|
137
|
-
|
|
138
|
-
const measureBoundary = useMeasurer({
|
|
89
|
+
const { onPress: resolvedOnPress } = useBoundaryMeasurement({
|
|
90
|
+
boundTag,
|
|
139
91
|
enabled,
|
|
140
|
-
|
|
141
|
-
linkId,
|
|
142
|
-
group,
|
|
92
|
+
runtimeEnabled,
|
|
143
93
|
currentScreenKey,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
useBoundaryPresence({
|
|
152
|
-
enabled: runtimeEnabled,
|
|
153
|
-
entryTag,
|
|
154
|
-
currentScreenKey,
|
|
155
|
-
boundaryConfig,
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
const shouldPassivelyMeasureSource =
|
|
159
|
-
shouldAutoMeasure && typeof onPress !== "function";
|
|
160
|
-
|
|
161
|
-
useInitialSourceMeasurement({
|
|
162
|
-
enabled: runtimeEnabled,
|
|
163
|
-
measureBoundary,
|
|
164
|
-
linkId,
|
|
165
|
-
group,
|
|
166
|
-
shouldAutoMeasure: shouldPassivelyMeasureSource,
|
|
167
|
-
});
|
|
168
|
-
|
|
169
|
-
useInitialDestinationMeasurement({
|
|
170
|
-
linkId,
|
|
171
|
-
enabled: runtimeEnabled,
|
|
172
|
-
measureBoundary,
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
useRefreshBoundary({
|
|
176
|
-
enabled: runtimeEnabled,
|
|
177
|
-
linkId,
|
|
178
|
-
group,
|
|
179
|
-
measureBoundary,
|
|
94
|
+
measuredRef,
|
|
95
|
+
style,
|
|
96
|
+
targetPreparedStyles,
|
|
97
|
+
portal,
|
|
98
|
+
shouldAutoMeasure,
|
|
99
|
+
config: { anchor, scaleMode, target, method },
|
|
100
|
+
onPress,
|
|
180
101
|
});
|
|
181
102
|
|
|
182
|
-
|
|
183
|
-
(...args: unknown[]) => {
|
|
184
|
-
// Press path has priority: capture source before user onPress/navigation.
|
|
185
|
-
runOnUI(measureBoundary)({
|
|
186
|
-
type: "source",
|
|
187
|
-
pairKey: createPendingPairKey(currentScreenKey),
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
if (typeof onPress === "function") {
|
|
191
|
-
onPress(...args);
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
|
-
[measureBoundary, onPress, currentScreenKey],
|
|
195
|
-
);
|
|
196
|
-
|
|
197
|
-
const resolvedOnPress =
|
|
198
|
-
typeof onPress === "function" ? handlePress : undefined;
|
|
103
|
+
useImperativeHandle(forwardedRef, () => ref.current as any, [ref]);
|
|
199
104
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
105
|
+
// A nested active target takes the full associated style, so the root keeps
|
|
106
|
+
// only its stacking context; otherwise the root wears the full style.
|
|
107
|
+
const attachedStyle = shouldAttachAssociatedStyles
|
|
108
|
+
? hasActiveTarget
|
|
109
|
+
? associatedStackingStyles
|
|
110
|
+
: associatedStyles
|
|
111
|
+
: undefined;
|
|
203
112
|
|
|
204
113
|
return (
|
|
205
|
-
<
|
|
114
|
+
<BoundaryRootProvider value={contextValue}>
|
|
206
115
|
<AnimatedComponent
|
|
207
116
|
{...rest}
|
|
208
|
-
ref={
|
|
209
|
-
style={[
|
|
210
|
-
style,
|
|
211
|
-
runtimeEnabled
|
|
212
|
-
? hasActiveTarget
|
|
213
|
-
? associatedStackingStyles
|
|
214
|
-
: associatedStyles
|
|
215
|
-
: undefined,
|
|
216
|
-
]}
|
|
117
|
+
ref={ref}
|
|
118
|
+
style={[style, attachedStyle]}
|
|
217
119
|
onPress={resolvedOnPress}
|
|
218
120
|
collapsable={false}
|
|
219
121
|
/>
|
|
220
|
-
</
|
|
122
|
+
</BoundaryRootProvider>
|
|
221
123
|
);
|
|
222
124
|
});
|
|
223
125
|
|
|
126
|
+
// The HOC's runtime identity (animated + memoized forwardRef) is not
|
|
127
|
+
// expressible against the public boundary props, so assert it here.
|
|
224
128
|
return memo(
|
|
225
129
|
Animated.createAnimatedComponent(Inner),
|
|
226
130
|
) as unknown as React.MemoExoticComponent<
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { useCallback, useMemo } from "react";
|
|
2
|
+
import type { View } from "react-native";
|
|
3
|
+
import type { AnimatedRef, StyleProps } from "react-native-reanimated";
|
|
4
|
+
import { runOnUI } from "react-native-reanimated";
|
|
5
|
+
import { createPendingPairKey } from "../../../stores/bounds/helpers/link-pairs.helpers";
|
|
6
|
+
import type { BoundTag } from "../../../stores/bounds/types";
|
|
7
|
+
import { prepareStyleForBounds } from "../../../utils/bounds/helpers/styles/styles";
|
|
8
|
+
import { resolvePortalHost } from "../portal/resolve-portal";
|
|
9
|
+
import type { BoundaryConfigProps, BoundaryPortal } from "../types";
|
|
10
|
+
import { useBoundaryPresence } from "./use-boundary-presence";
|
|
11
|
+
import { useInitialDestinationMeasurement } from "./use-initial-destination-measurement";
|
|
12
|
+
import { useInitialSourceMeasurement } from "./use-initial-source-measurement";
|
|
13
|
+
import { useMeasurer } from "./use-measurer";
|
|
14
|
+
import { useRefreshBoundary } from "./use-refresh-boundary";
|
|
15
|
+
|
|
16
|
+
interface UseBoundaryMeasurementParams {
|
|
17
|
+
boundTag: BoundTag;
|
|
18
|
+
/** Raw `enabled` prop — drives the measurer and the passive-source gate. */
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
/** `enabled && hasConfiguredInterpolator` — gates presence + lifecycle. */
|
|
21
|
+
runtimeEnabled: boolean;
|
|
22
|
+
currentScreenKey: string;
|
|
23
|
+
/** Surface to measure: a nested target's placeholder, else the root. */
|
|
24
|
+
measuredRef: AnimatedRef<View>;
|
|
25
|
+
/** Root's own style; ignored when a nested target supplies its own. */
|
|
26
|
+
style?: unknown;
|
|
27
|
+
targetPreparedStyles?: StyleProps;
|
|
28
|
+
portal?: BoundaryPortal;
|
|
29
|
+
shouldAutoMeasure: boolean;
|
|
30
|
+
config: BoundaryConfigProps;
|
|
31
|
+
onPress?: (...args: unknown[]) => void;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Owns the full measurement lifecycle for a boundary: builds the measurer,
|
|
36
|
+
* registers presence, runs the initial source/destination + refresh reactions,
|
|
37
|
+
* and returns the press-priority `onPress`. The component never touches the
|
|
38
|
+
* measurer itself.
|
|
39
|
+
*/
|
|
40
|
+
export const useBoundaryMeasurement = ({
|
|
41
|
+
boundTag,
|
|
42
|
+
enabled,
|
|
43
|
+
runtimeEnabled,
|
|
44
|
+
currentScreenKey,
|
|
45
|
+
measuredRef,
|
|
46
|
+
style,
|
|
47
|
+
targetPreparedStyles,
|
|
48
|
+
portal,
|
|
49
|
+
shouldAutoMeasure,
|
|
50
|
+
config,
|
|
51
|
+
onPress,
|
|
52
|
+
}: UseBoundaryMeasurementParams) => {
|
|
53
|
+
const { anchor, scaleMode, target, method } = config;
|
|
54
|
+
const boundaryConfig = useMemo<BoundaryConfigProps>(
|
|
55
|
+
() => ({ anchor, scaleMode, target, method }),
|
|
56
|
+
[anchor, scaleMode, target, method],
|
|
57
|
+
);
|
|
58
|
+
|
|
59
|
+
const rootPreparedStyles = useMemo(
|
|
60
|
+
() => prepareStyleForBounds(style),
|
|
61
|
+
[style],
|
|
62
|
+
);
|
|
63
|
+
const preparedStyles = targetPreparedStyles ?? rootPreparedStyles;
|
|
64
|
+
|
|
65
|
+
const portalHost = resolvePortalHost(portal);
|
|
66
|
+
|
|
67
|
+
const measureBoundary = useMeasurer({
|
|
68
|
+
enabled,
|
|
69
|
+
boundTag,
|
|
70
|
+
currentScreenKey,
|
|
71
|
+
preparedStyles,
|
|
72
|
+
measuredAnimatedRef: measuredRef,
|
|
73
|
+
portalHost,
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Register/unregister this boundary in the presence map so source/destination
|
|
77
|
+
// matching can resolve across concrete screen keys.
|
|
78
|
+
useBoundaryPresence({
|
|
79
|
+
enabled: runtimeEnabled,
|
|
80
|
+
boundTag,
|
|
81
|
+
currentScreenKey,
|
|
82
|
+
boundaryConfig,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// Passive auto-measurement only applies to non-pressable boundaries; pressable
|
|
86
|
+
// ones capture their source on press (see handlePress below).
|
|
87
|
+
const shouldPassivelyMeasureSource =
|
|
88
|
+
shouldAutoMeasure && typeof onPress !== "function";
|
|
89
|
+
|
|
90
|
+
useInitialSourceMeasurement({
|
|
91
|
+
enabled: runtimeEnabled,
|
|
92
|
+
measureBoundary,
|
|
93
|
+
boundTag,
|
|
94
|
+
shouldAutoMeasure: shouldPassivelyMeasureSource,
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
useInitialDestinationMeasurement({
|
|
98
|
+
boundTag,
|
|
99
|
+
enabled: runtimeEnabled,
|
|
100
|
+
measureBoundary,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
useRefreshBoundary({
|
|
104
|
+
enabled: runtimeEnabled,
|
|
105
|
+
boundTag,
|
|
106
|
+
measureBoundary,
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const handlePress = useCallback(
|
|
110
|
+
(...args: unknown[]) => {
|
|
111
|
+
// Press path has priority: capture source before user onPress/navigation.
|
|
112
|
+
runOnUI(measureBoundary)({
|
|
113
|
+
type: "source",
|
|
114
|
+
pairKey: createPendingPairKey(currentScreenKey),
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
if (typeof onPress === "function") {
|
|
118
|
+
onPress(...args);
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
[measureBoundary, onPress, currentScreenKey],
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
onPress: typeof onPress === "function" ? handlePress : undefined,
|
|
126
|
+
};
|
|
127
|
+
};
|
|
@@ -4,25 +4,27 @@ import {
|
|
|
4
4
|
removeEntry,
|
|
5
5
|
setEntry,
|
|
6
6
|
} from "../../../stores/bounds/internals/entries";
|
|
7
|
+
import type { BoundTag } from "../../../stores/bounds/types";
|
|
7
8
|
import type { BoundaryConfigProps } from "../types";
|
|
8
9
|
|
|
9
10
|
export const useBoundaryPresence = (params: {
|
|
10
11
|
enabled: boolean;
|
|
11
|
-
|
|
12
|
+
boundTag: BoundTag;
|
|
12
13
|
currentScreenKey: string;
|
|
13
14
|
boundaryConfig?: BoundaryConfigProps;
|
|
14
15
|
}) => {
|
|
15
|
-
const { enabled,
|
|
16
|
+
const { enabled, boundTag, currentScreenKey, boundaryConfig } = params;
|
|
17
|
+
const { tag } = boundTag;
|
|
16
18
|
|
|
17
19
|
useLayoutEffect(() => {
|
|
18
20
|
if (!enabled) return;
|
|
19
21
|
|
|
20
|
-
runOnUI(setEntry)(
|
|
22
|
+
runOnUI(setEntry)(tag, currentScreenKey, {
|
|
21
23
|
boundaryConfig,
|
|
22
24
|
});
|
|
23
25
|
|
|
24
26
|
return () => {
|
|
25
|
-
runOnUI(removeEntry)(
|
|
27
|
+
runOnUI(removeEntry)(tag, currentScreenKey);
|
|
26
28
|
};
|
|
27
|
-
}, [enabled,
|
|
29
|
+
}, [enabled, tag, currentScreenKey, boundaryConfig]);
|
|
28
30
|
};
|
|
@@ -9,6 +9,7 @@ import { useDescriptorsStore } from "../../../providers/screen/descriptors";
|
|
|
9
9
|
import { AnimationStore } from "../../../stores/animation.store";
|
|
10
10
|
import { getDestination } from "../../../stores/bounds/internals/links";
|
|
11
11
|
import { pairs } from "../../../stores/bounds/internals/state";
|
|
12
|
+
import type { BoundTag } from "../../../stores/bounds/types";
|
|
12
13
|
import {
|
|
13
14
|
LifecycleTransitionRequestKind,
|
|
14
15
|
SystemStore,
|
|
@@ -17,7 +18,7 @@ import { logger } from "../../../utils/logger";
|
|
|
17
18
|
import type { MeasureBoundary } from "../types";
|
|
18
19
|
import { getInitialDestinationMeasurePairKey } from "../utils/destination-signals";
|
|
19
20
|
|
|
20
|
-
const VIEWPORT_RETRY_DELAY_MS =
|
|
21
|
+
const VIEWPORT_RETRY_DELAY_MS = 100;
|
|
21
22
|
/**
|
|
22
23
|
* A destination that keeps failing its measurement guards must not hold the
|
|
23
24
|
* transition gate forever — after this budget the block is released with a
|
|
@@ -26,16 +27,17 @@ const VIEWPORT_RETRY_DELAY_MS = 16;
|
|
|
26
27
|
const MAX_VIEWPORT_RETRIES = 20;
|
|
27
28
|
|
|
28
29
|
interface UseInitialDestinationMeasurementParams {
|
|
29
|
-
|
|
30
|
+
boundTag: BoundTag;
|
|
30
31
|
enabled: boolean;
|
|
31
32
|
measureBoundary: MeasureBoundary;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
35
|
export const useInitialDestinationMeasurement = ({
|
|
35
|
-
|
|
36
|
+
boundTag,
|
|
36
37
|
enabled,
|
|
37
38
|
measureBoundary,
|
|
38
39
|
}: UseInitialDestinationMeasurementParams) => {
|
|
40
|
+
const { linkKey, group } = boundTag;
|
|
39
41
|
const currentScreenKey = useDescriptorsStore(
|
|
40
42
|
(s) => s.derivations.currentScreenKey,
|
|
41
43
|
);
|
|
@@ -51,9 +53,12 @@ export const useInitialDestinationMeasurement = ({
|
|
|
51
53
|
currentScreenKey,
|
|
52
54
|
"transitionProgress",
|
|
53
55
|
);
|
|
54
|
-
|
|
55
|
-
const {
|
|
56
|
-
|
|
56
|
+
|
|
57
|
+
const {
|
|
58
|
+
pendingLifecycleRequestKind,
|
|
59
|
+
actions: { blockLifecycleStart, unblockLifecycleStart },
|
|
60
|
+
} = SystemStore.getBag(currentScreenKey);
|
|
61
|
+
|
|
57
62
|
const isBlockingLifecycleStart = useSharedValue(0);
|
|
58
63
|
const retryToken = useSharedValue(0);
|
|
59
64
|
const viewportRetries = useSharedValue(0);
|
|
@@ -90,7 +95,8 @@ export const useInitialDestinationMeasurement = ({
|
|
|
90
95
|
enabled: destinationEnabled,
|
|
91
96
|
destinationPairKey,
|
|
92
97
|
ancestorDestinationPairKey,
|
|
93
|
-
linkId,
|
|
98
|
+
linkId: linkKey,
|
|
99
|
+
group,
|
|
94
100
|
linkState:
|
|
95
101
|
destinationEnabled &&
|
|
96
102
|
(destinationPairKey || ancestorDestinationPairKey)
|
|
@@ -100,7 +106,7 @@ export const useInitialDestinationMeasurement = ({
|
|
|
100
106
|
|
|
101
107
|
return [measurePairKey, retryTick] as const;
|
|
102
108
|
},
|
|
103
|
-
([measurePairKey]) => {
|
|
109
|
+
([measurePairKey, retryTick], previous) => {
|
|
104
110
|
"worklet";
|
|
105
111
|
if (!measurePairKey) {
|
|
106
112
|
releaseLifecycleStartBlock();
|
|
@@ -109,6 +115,16 @@ export const useInitialDestinationMeasurement = ({
|
|
|
109
115
|
return;
|
|
110
116
|
}
|
|
111
117
|
|
|
118
|
+
const previousMeasurePairKey = previous?.[0];
|
|
119
|
+
const previousRetryTick = previous?.[1];
|
|
120
|
+
const shouldAttemptMeasure =
|
|
121
|
+
measurePairKey !== previousMeasurePairKey ||
|
|
122
|
+
retryTick !== previousRetryTick;
|
|
123
|
+
|
|
124
|
+
if (!shouldAttemptMeasure) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
|
|
112
128
|
if (hasGivenUp.get()) {
|
|
113
129
|
return;
|
|
114
130
|
}
|
|
@@ -124,7 +140,7 @@ export const useInitialDestinationMeasurement = ({
|
|
|
124
140
|
});
|
|
125
141
|
|
|
126
142
|
const destinationAttached =
|
|
127
|
-
getDestination(measurePairKey,
|
|
143
|
+
getDestination(measurePairKey, linkKey) !== null;
|
|
128
144
|
|
|
129
145
|
if (destinationAttached) {
|
|
130
146
|
releaseLifecycleStartBlock();
|
|
@@ -136,13 +152,13 @@ export const useInitialDestinationMeasurement = ({
|
|
|
136
152
|
hasGivenUp.set(1);
|
|
137
153
|
releaseLifecycleStartBlock();
|
|
138
154
|
logger.warn(
|
|
139
|
-
`Destination boundary "${
|
|
155
|
+
`Destination boundary "${linkKey}" never produced a valid measurement after ${MAX_VIEWPORT_RETRIES} attempts; releasing the transition gate without it. The boundary is likely off-viewport (e.g. an inactive group member on a paged screen) or unmounted.`,
|
|
140
156
|
);
|
|
141
157
|
return;
|
|
142
158
|
}
|
|
143
159
|
|
|
144
160
|
// Destination did not attach (malformed off-screen measurement); retry
|
|
145
|
-
//
|
|
161
|
+
// after the retry token advances while the lifecycle stays blocked.
|
|
146
162
|
viewportRetries.set(viewportRetries.get() + 1);
|
|
147
163
|
cancelAnimation(retryToken);
|
|
148
164
|
retryToken.set(
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useAnimatedReaction, useSharedValue } from "react-native-reanimated";
|
|
2
2
|
import { useDescriptorsStore } from "../../../providers/screen/descriptors";
|
|
3
3
|
import { pairs } from "../../../stores/bounds/internals/state";
|
|
4
|
+
import type { BoundTag } from "../../../stores/bounds/types";
|
|
4
5
|
import type { MeasureBoundary } from "../types";
|
|
5
6
|
import { getInitialSourceCaptureSignal } from "../utils/source-signals";
|
|
6
7
|
|
|
7
8
|
export const useInitialSourceMeasurement = (params: {
|
|
8
9
|
enabled: boolean;
|
|
9
10
|
measureBoundary: MeasureBoundary;
|
|
10
|
-
|
|
11
|
-
group?: string;
|
|
11
|
+
boundTag: BoundTag;
|
|
12
12
|
shouldAutoMeasure: boolean;
|
|
13
13
|
}) => {
|
|
14
|
-
const { enabled, measureBoundary,
|
|
14
|
+
const { enabled, measureBoundary, boundTag, shouldAutoMeasure } = params;
|
|
15
15
|
const sourcePairKey = useDescriptorsStore((s) => s.derivations.sourcePairKey);
|
|
16
16
|
const lastSourceCaptureSignal = useSharedValue<string | null>(null);
|
|
17
17
|
|
|
@@ -21,8 +21,8 @@ export const useInitialSourceMeasurement = (params: {
|
|
|
21
21
|
return getInitialSourceCaptureSignal({
|
|
22
22
|
enabled,
|
|
23
23
|
sourcePairKey,
|
|
24
|
-
linkId,
|
|
25
|
-
group,
|
|
24
|
+
linkId: boundTag.linkKey,
|
|
25
|
+
group: boundTag.group,
|
|
26
26
|
shouldAutoMeasure,
|
|
27
27
|
linkState: shouldAutoMeasure && sourcePairKey ? pairs.get() : undefined,
|
|
28
28
|
});
|
|
@@ -8,7 +8,10 @@ import {
|
|
|
8
8
|
} from "react-native-reanimated";
|
|
9
9
|
import { applyMeasuredBoundsWrites } from "../../../providers/helpers/measured-bounds-writes";
|
|
10
10
|
import { useOriginContext } from "../../../providers/screen/origin.provider";
|
|
11
|
-
import type {
|
|
11
|
+
import type {
|
|
12
|
+
BoundsPortalAttachTarget,
|
|
13
|
+
BoundTag,
|
|
14
|
+
} from "../../../stores/bounds/types";
|
|
12
15
|
import { ScrollStore } from "../../../stores/scroll.store";
|
|
13
16
|
import { SystemStore } from "../../../stores/system.store";
|
|
14
17
|
import { getActiveScrollHost } from "../portal/stores/host-registry.store";
|
|
@@ -22,9 +25,7 @@ import {
|
|
|
22
25
|
|
|
23
26
|
interface UseMeasurerParams {
|
|
24
27
|
enabled: boolean;
|
|
25
|
-
|
|
26
|
-
linkId: string;
|
|
27
|
-
group?: string;
|
|
28
|
+
boundTag: BoundTag;
|
|
28
29
|
currentScreenKey: string;
|
|
29
30
|
preparedStyles: StyleProps;
|
|
30
31
|
measuredAnimatedRef: AnimatedRef<View>;
|
|
@@ -33,9 +34,7 @@ interface UseMeasurerParams {
|
|
|
33
34
|
|
|
34
35
|
export const useMeasurer = ({
|
|
35
36
|
enabled,
|
|
36
|
-
|
|
37
|
-
linkId,
|
|
38
|
-
group,
|
|
37
|
+
boundTag,
|
|
39
38
|
currentScreenKey,
|
|
40
39
|
preparedStyles,
|
|
41
40
|
measuredAnimatedRef,
|
|
@@ -78,7 +77,7 @@ export const useMeasurer = ({
|
|
|
78
77
|
* lifecycle blocked until a valid retry lands.
|
|
79
78
|
*/
|
|
80
79
|
const shouldGuardDestinationViewport =
|
|
81
|
-
pendingLifecycleStartBlockCount.get() > 0 || !!group;
|
|
80
|
+
pendingLifecycleStartBlockCount.get() > 0 || !!boundTag.group;
|
|
82
81
|
|
|
83
82
|
const viewportAllowsDestinationWrite =
|
|
84
83
|
target.type !== "destination" ||
|
|
@@ -101,9 +100,9 @@ export const useMeasurer = ({
|
|
|
101
100
|
: undefined;
|
|
102
101
|
|
|
103
102
|
applyMeasuredBoundsWrites({
|
|
104
|
-
entryTag,
|
|
105
|
-
linkId,
|
|
106
|
-
group,
|
|
103
|
+
entryTag: boundTag.tag,
|
|
104
|
+
linkId: boundTag.linkKey,
|
|
105
|
+
group: boundTag.group,
|
|
107
106
|
currentScreenKey,
|
|
108
107
|
measured: measuredWithScroll,
|
|
109
108
|
preparedStyles,
|
|
@@ -114,9 +113,7 @@ export const useMeasurer = ({
|
|
|
114
113
|
},
|
|
115
114
|
[
|
|
116
115
|
enabled,
|
|
117
|
-
|
|
118
|
-
linkId,
|
|
119
|
-
group,
|
|
116
|
+
boundTag,
|
|
120
117
|
currentScreenKey,
|
|
121
118
|
preparedStyles,
|
|
122
119
|
measuredAnimatedRef,
|
|
@@ -2,22 +2,22 @@ import { useAnimatedReaction } from "react-native-reanimated";
|
|
|
2
2
|
import { useDescriptorsStore } from "../../../providers/screen/descriptors";
|
|
3
3
|
import { AnimationStore } from "../../../stores/animation.store";
|
|
4
4
|
import { pairs } from "../../../stores/bounds/internals/state";
|
|
5
|
+
import type { BoundTag } from "../../../stores/bounds/types";
|
|
5
6
|
import type { MeasureBoundary } from "../types";
|
|
6
7
|
import { getRefreshBoundarySignal } from "../utils/refresh-signals";
|
|
7
8
|
|
|
8
9
|
interface UseRefreshBoundaryParams {
|
|
9
10
|
enabled: boolean;
|
|
10
|
-
|
|
11
|
-
group?: string;
|
|
11
|
+
boundTag: BoundTag;
|
|
12
12
|
measureBoundary: MeasureBoundary;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export const useRefreshBoundary = ({
|
|
16
16
|
enabled,
|
|
17
|
-
|
|
18
|
-
group,
|
|
17
|
+
boundTag,
|
|
19
18
|
measureBoundary,
|
|
20
19
|
}: UseRefreshBoundaryParams) => {
|
|
20
|
+
const { linkKey, group } = boundTag;
|
|
21
21
|
const currentScreenKey = useDescriptorsStore(
|
|
22
22
|
(s) => s.derivations.currentScreenKey,
|
|
23
23
|
);
|
|
@@ -57,7 +57,7 @@ export const useRefreshBoundary = ({
|
|
|
57
57
|
destinationPairKey,
|
|
58
58
|
ancestorDestinationPairKey,
|
|
59
59
|
nextScreenKey,
|
|
60
|
-
linkId,
|
|
60
|
+
linkId: linkKey,
|
|
61
61
|
group,
|
|
62
62
|
shouldRefresh: !!refreshWillAnimate.get(),
|
|
63
63
|
closing: !!refreshClosing.get(),
|