react-native-screen-transitions 3.4.0-alpha.1 → 3.4.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1109
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js +69 -2
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js +9 -0
- package/lib/commonjs/component-stack/navigators/create-component-stack-navigator.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +195 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -14
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +19 -18
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +54 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +40 -8
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +72 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +16 -7
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +7 -4
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +14 -15
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +27 -9
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/index.js +23 -10
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/commonjs/shared/components/create-transition-aware-component.js +4 -4
- package/lib/commonjs/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/commonjs/shared/components/native-screen-container.js +12 -6
- package/lib/commonjs/shared/components/native-screen-container.js.map +1 -1
- package/lib/commonjs/shared/components/native-screen.js +35 -8
- package/lib/commonjs/shared/components/native-screen.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js +43 -0
- package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js.map +1 -0
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js +60 -0
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -0
- package/lib/commonjs/shared/components/screen-container/index.js +7 -4
- package/lib/commonjs/shared/components/screen-container/index.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +32 -48
- 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 +9 -20
- package/lib/commonjs/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/commonjs/shared/configs/presets.js +6 -6
- package/lib/commonjs/shared/configs/presets.js.map +1 -1
- package/lib/commonjs/shared/constants.js +10 -4
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js +9 -34
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/commonjs/shared/index.js +4 -10
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +6 -7
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-activation.js +11 -6
- package/lib/commonjs/shared/providers/gestures/helpers/gesture-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/layout-anchor.provider.js +4 -6
- package/lib/commonjs/shared/providers/layout-anchor.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js +14 -7
- package/lib/commonjs/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js +36 -0
- package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles.provider.js +31 -10
- package/lib/commonjs/shared/providers/screen/styles.provider.js.map +1 -1
- package/lib/commonjs/shared/providers/stack/core.provider.js +14 -21
- package/lib/commonjs/shared/providers/stack/core.provider.js.map +1 -1
- package/lib/commonjs/shared/stores/animation.store.js +3 -1
- package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/presence.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +16 -7
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js +0 -5
- package/lib/commonjs/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/index.js +10 -0
- package/lib/commonjs/shared/utils/bounds/index.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/types/frame-props.js +6 -0
- package/lib/commonjs/shared/utils/bounds/types/frame-props.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/zoom/build.js +34 -31
- package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/resolve-screen-transition-options.js +25 -0
- package/lib/commonjs/shared/utils/resolve-screen-transition-options.js.map +1 -0
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js +69 -3
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js.map +1 -1
- package/lib/module/component-stack/navigators/create-component-stack-navigator.js +9 -0
- package/lib/module/component-stack/navigators/create-component-stack-navigator.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +182 -0
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -14
- package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js +19 -18
- package/lib/module/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +49 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +41 -8
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +67 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +16 -7
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js +7 -4
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +14 -15
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +27 -9
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/index.js +23 -10
- package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/module/shared/components/create-transition-aware-component.js +4 -4
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/native-screen-container.js +12 -6
- package/lib/module/shared/components/native-screen-container.js.map +1 -1
- package/lib/module/shared/components/native-screen.js +35 -8
- package/lib/module/shared/components/native-screen.js.map +1 -1
- package/lib/module/shared/components/screen-container/deferred-visibility-host.js +38 -0
- package/lib/module/shared/components/screen-container/deferred-visibility-host.js.map +1 -0
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +56 -0
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -0
- package/lib/module/shared/components/screen-container/index.js +7 -4
- package/lib/module/shared/components/screen-container/index.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +37 -53
- 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 +10 -21
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js.map +1 -1
- package/lib/module/shared/configs/presets.js +7 -7
- package/lib/module/shared/configs/presets.js.map +1 -1
- package/lib/module/shared/constants.js +9 -3
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/hooks/animation/use-associated-style.js +10 -35
- package/lib/module/shared/hooks/animation/use-associated-style.js.map +1 -1
- package/lib/module/shared/index.js +1 -1
- package/lib/module/shared/index.js.map +1 -1
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js +6 -7
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/module/shared/providers/gestures/helpers/gesture-activation.js +11 -6
- package/lib/module/shared/providers/gestures/helpers/gesture-activation.js.map +1 -1
- package/lib/module/shared/providers/layout-anchor.provider.js +4 -6
- package/lib/module/shared/providers/layout-anchor.provider.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js +14 -7
- package/lib/module/shared/providers/screen/animation/helpers/pipeline.js.map +1 -1
- package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js +31 -0
- package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +1 -0
- package/lib/module/shared/providers/screen/styles.provider.js +30 -11
- package/lib/module/shared/providers/screen/styles.provider.js.map +1 -1
- package/lib/module/shared/providers/stack/core.provider.js +14 -21
- package/lib/module/shared/providers/stack/core.provider.js.map +1 -1
- package/lib/module/shared/stores/animation.store.js +3 -1
- package/lib/module/shared/stores/animation.store.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/presence.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +17 -8
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js +0 -5
- package/lib/module/shared/utils/bounds/helpers/resolve-bound-tag.js.map +1 -1
- package/lib/module/shared/utils/bounds/index.js +10 -0
- package/lib/module/shared/utils/bounds/index.js.map +1 -1
- package/lib/module/shared/utils/bounds/types/frame-props.js +4 -0
- package/lib/module/shared/utils/bounds/types/frame-props.js.map +1 -0
- package/lib/module/shared/utils/bounds/zoom/build.js +35 -32
- package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/resolve-screen-transition-options.js +19 -0
- package/lib/module/shared/utils/resolve-screen-transition-options.js.map +1 -0
- package/lib/typescript/blank-stack/index.d.ts +1 -1
- package/lib/typescript/blank-stack/index.d.ts.map +1 -1
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +29 -4
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/blank-stack/types.d.ts +33 -4
- package/lib/typescript/blank-stack/types.d.ts.map +1 -1
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +8 -0
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +81 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts +2 -3
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts +11 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +2 -2
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts +11 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts +3 -3
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts +2 -2
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts +5 -3
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts +2 -4
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts +1 -0
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/native-screen-container.d.ts.map +1 -1
- package/lib/typescript/shared/components/native-screen.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts +13 -0
- package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts +3 -0
- package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -0
- package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/content.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts +3 -1
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
- package/lib/typescript/shared/configs/index.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +9 -3
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts +5 -11
- package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +1 -2
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts +1 -1
- package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/helpers/gesture-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/layout-anchor.provider.d.ts +1 -1
- package/lib/typescript/shared/providers/layout-anchor.provider.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/helpers/resolve-interpolated-style-output.d.ts +10 -0
- package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles.provider.d.ts +4 -2
- package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +1 -1
- package/lib/typescript/shared/providers/stack/core.provider.d.ts +2 -0
- package/lib/typescript/shared/providers/stack/core.provider.d.ts.map +1 -1
- package/lib/typescript/shared/stores/animation.store.d.ts +5 -3
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/presence.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +13 -1
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +51 -22
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts +11 -1
- package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/resolve-bound-tag.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/index.d.ts +2 -2
- package/lib/typescript/shared/utils/bounds/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts +5 -0
- package/lib/typescript/shared/utils/bounds/types/frame-props.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts +4 -4
- package/lib/typescript/shared/utils/bounds/zoom/accessor.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +2 -2
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/types.d.ts +3 -3
- package/lib/typescript/shared/utils/bounds/zoom/types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/resolve-screen-transition-options.d.ts +5 -0
- package/lib/typescript/shared/utils/resolve-screen-transition-options.d.ts.map +1 -0
- package/package.json +2 -1
- package/src/blank-stack/index.ts +1 -0
- package/src/blank-stack/navigators/create-blank-stack-navigator.tsx +138 -19
- package/src/blank-stack/types.ts +33 -5
- package/src/component-stack/navigators/create-component-stack-navigator.tsx +8 -0
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +258 -0
- package/src/shared/components/create-boundary-component/hooks/use-auto-source-measurement.ts +7 -17
- package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts +38 -28
- package/src/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.ts +58 -0
- package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +41 -10
- package/src/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.ts +82 -0
- package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +24 -12
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts +11 -9
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts +29 -26
- package/src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts +26 -17
- package/src/shared/components/create-boundary-component/index.tsx +25 -7
- package/src/shared/components/create-boundary-component/types.ts +8 -4
- package/src/shared/components/create-transition-aware-component.tsx +5 -3
- package/src/shared/components/native-screen-container.tsx +11 -3
- package/src/shared/components/native-screen.tsx +65 -20
- package/src/shared/components/screen-container/deferred-visibility-host.tsx +37 -0
- package/src/shared/components/screen-container/hooks/use-content-layout.ts +82 -0
- package/src/shared/components/screen-container/index.tsx +5 -2
- package/src/shared/components/screen-container/layers/content.tsx +53 -80
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +12 -27
- package/src/shared/configs/presets.ts +10 -10
- package/src/shared/constants.ts +5 -3
- package/src/shared/hooks/animation/use-associated-style.ts +10 -54
- package/src/shared/index.ts +2 -3
- package/src/shared/providers/gestures/handlers/use-handlers.ts +8 -5
- package/src/shared/providers/gestures/helpers/gesture-activation.ts +11 -6
- package/src/shared/providers/layout-anchor.provider.tsx +2 -5
- package/src/shared/providers/register-bounds.provider.tsx +1 -1
- package/src/shared/providers/screen/animation/helpers/pipeline.ts +24 -8
- package/src/shared/providers/screen/helpers/resolve-interpolated-style-output.ts +41 -0
- package/src/shared/providers/screen/styles.provider.tsx +95 -72
- package/src/shared/providers/stack/core.provider.tsx +27 -14
- package/src/shared/stores/animation.store.ts +11 -7
- package/src/shared/stores/bounds/internals/presence.ts +3 -1
- package/src/shared/types/animation.types.ts +13 -1
- package/src/shared/types/screen.types.ts +55 -22
- package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +17 -3
- package/src/shared/utils/bounds/helpers/resolve-bound-tag.ts +0 -6
- package/src/shared/utils/bounds/index.ts +16 -5
- package/src/shared/utils/bounds/types/frame-props.ts +5 -0
- package/src/shared/utils/bounds/zoom/accessor.ts +3 -3
- package/src/shared/utils/bounds/zoom/build.ts +46 -32
- package/src/shared/utils/bounds/zoom/types.ts +3 -3
- package/src/shared/utils/resolve-screen-transition-options.ts +37 -0
- package/lib/commonjs/shared/providers/viewport.provider.js +0 -33
- package/lib/commonjs/shared/providers/viewport.provider.js.map +0 -1
- package/lib/module/shared/providers/viewport.provider.js +0 -27
- package/lib/module/shared/providers/viewport.provider.js.map +0 -1
- package/lib/typescript/shared/providers/viewport.provider.d.ts +0 -13
- package/lib/typescript/shared/providers/viewport.provider.d.ts.map +0 -1
- package/src/shared/providers/viewport.provider.tsx +0 -39
|
@@ -5,12 +5,12 @@ import { StyleSheet } from "react-native";
|
|
|
5
5
|
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
6
6
|
import { StackType } from "../../types/stack.types";
|
|
7
7
|
import createProvider from "../../utils/create-provider";
|
|
8
|
-
import { ViewportProvider } from "../viewport.provider";
|
|
9
8
|
|
|
10
9
|
export interface StackCoreConfig {
|
|
11
10
|
TRANSITIONS_ALWAYS_ON?: boolean;
|
|
12
11
|
STACK_TYPE?: StackType;
|
|
13
12
|
DISABLE_NATIVE_SCREENS?: boolean;
|
|
13
|
+
DISABLE_NATIVE_SCREEN_CONTAINER?: boolean;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
interface StackCoreProviderProps {
|
|
@@ -23,6 +23,7 @@ export interface StackCoreContextValue {
|
|
|
23
23
|
TRANSITIONS_ALWAYS_ON: boolean;
|
|
24
24
|
STACK_TYPE?: StackType;
|
|
25
25
|
DISABLE_NATIVE_SCREENS: boolean;
|
|
26
|
+
DISABLE_NATIVE_SCREEN_CONTAINER: boolean;
|
|
26
27
|
};
|
|
27
28
|
}
|
|
28
29
|
|
|
@@ -34,18 +35,27 @@ const { StackCoreProvider: InternalStackCoreProvider, useStackCoreContext } =
|
|
|
34
35
|
const {
|
|
35
36
|
TRANSITIONS_ALWAYS_ON = false,
|
|
36
37
|
DISABLE_NATIVE_SCREENS = false,
|
|
38
|
+
DISABLE_NATIVE_SCREEN_CONTAINER = false,
|
|
37
39
|
STACK_TYPE = StackType.BLANK,
|
|
38
40
|
} = config;
|
|
39
41
|
|
|
40
42
|
const flags = useMemo(
|
|
41
|
-
() => ({
|
|
42
|
-
|
|
43
|
+
() => ({
|
|
44
|
+
TRANSITIONS_ALWAYS_ON,
|
|
45
|
+
STACK_TYPE,
|
|
46
|
+
DISABLE_NATIVE_SCREENS,
|
|
47
|
+
DISABLE_NATIVE_SCREEN_CONTAINER,
|
|
48
|
+
}),
|
|
49
|
+
[
|
|
50
|
+
TRANSITIONS_ALWAYS_ON,
|
|
51
|
+
STACK_TYPE,
|
|
52
|
+
DISABLE_NATIVE_SCREENS,
|
|
53
|
+
DISABLE_NATIVE_SCREEN_CONTAINER,
|
|
54
|
+
],
|
|
43
55
|
);
|
|
44
56
|
|
|
45
|
-
const value = useMemo(() => ({ flags }), [flags]);
|
|
46
|
-
|
|
47
57
|
return {
|
|
48
|
-
value,
|
|
58
|
+
value: { flags },
|
|
49
59
|
children: (
|
|
50
60
|
<GestureHandlerRootView
|
|
51
61
|
style={styles.container}
|
|
@@ -53,9 +63,7 @@ const { StackCoreProvider: InternalStackCoreProvider, useStackCoreContext } =
|
|
|
53
63
|
STACK_TYPE === StackType.COMPONENT ? "box-none" : undefined
|
|
54
64
|
}
|
|
55
65
|
>
|
|
56
|
-
<SafeAreaProviderCompat>
|
|
57
|
-
<ViewportProvider>{children}</ViewportProvider>
|
|
58
|
-
</SafeAreaProviderCompat>
|
|
66
|
+
<SafeAreaProviderCompat>{children}</SafeAreaProviderCompat>
|
|
59
67
|
</GestureHandlerRootView>
|
|
60
68
|
),
|
|
61
69
|
};
|
|
@@ -71,16 +79,21 @@ export function withStackCore<TProps extends object>(
|
|
|
71
79
|
): React.FC<TProps & StackCoreConfig> {
|
|
72
80
|
return function StackCoreWrapper({
|
|
73
81
|
DISABLE_NATIVE_SCREENS,
|
|
82
|
+
DISABLE_NATIVE_SCREEN_CONTAINER,
|
|
74
83
|
TRANSITIONS_ALWAYS_ON,
|
|
75
84
|
STACK_TYPE,
|
|
76
85
|
...props
|
|
77
86
|
}: TProps & StackCoreConfig) {
|
|
78
|
-
//
|
|
87
|
+
// Start from defaults, then apply explicit overrides from the caller.
|
|
79
88
|
const config: StackCoreConfig = {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
89
|
+
TRANSITIONS_ALWAYS_ON:
|
|
90
|
+
TRANSITIONS_ALWAYS_ON ?? defaultConfig.TRANSITIONS_ALWAYS_ON,
|
|
91
|
+
STACK_TYPE: STACK_TYPE ?? defaultConfig.STACK_TYPE,
|
|
92
|
+
DISABLE_NATIVE_SCREENS:
|
|
93
|
+
DISABLE_NATIVE_SCREENS ?? defaultConfig.DISABLE_NATIVE_SCREENS,
|
|
94
|
+
DISABLE_NATIVE_SCREEN_CONTAINER:
|
|
95
|
+
DISABLE_NATIVE_SCREEN_CONTAINER ??
|
|
96
|
+
defaultConfig.DISABLE_NATIVE_SCREEN_CONTAINER,
|
|
84
97
|
};
|
|
85
98
|
return (
|
|
86
99
|
<InternalStackCoreProvider config={config}>
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
makeMutable,
|
|
4
4
|
type SharedValue,
|
|
5
5
|
} from "react-native-reanimated";
|
|
6
|
-
import type { ScreenKey } from "../types/screen.types";
|
|
6
|
+
import type { Layout, ScreenKey } from "../types/screen.types";
|
|
7
7
|
|
|
8
8
|
export type AnimationStoreMap = {
|
|
9
9
|
progress: SharedValue<number>;
|
|
@@ -13,6 +13,8 @@ export type AnimationStoreMap = {
|
|
|
13
13
|
targetProgress: SharedValue<number>;
|
|
14
14
|
/** Resolved fraction (contentHeight / screenHeight) for the 'auto' snap point. -1 = not yet measured. */
|
|
15
15
|
autoSnapPoint: SharedValue<number>;
|
|
16
|
+
/** Intrinsic content layout measured from the screen container wrapper. */
|
|
17
|
+
contentLayout: SharedValue<Layout | null>;
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
const store: Record<ScreenKey, AnimationStoreMap> = {};
|
|
@@ -25,6 +27,7 @@ function createAnimationBag(): AnimationStoreMap {
|
|
|
25
27
|
entering: makeMutable(0),
|
|
26
28
|
targetProgress: makeMutable(1),
|
|
27
29
|
autoSnapPoint: makeMutable(-1),
|
|
30
|
+
contentLayout: makeMutable<Layout | null>(null),
|
|
28
31
|
};
|
|
29
32
|
}
|
|
30
33
|
|
|
@@ -43,17 +46,17 @@ function peekRouteAnimations(
|
|
|
43
46
|
return store[routeKey];
|
|
44
47
|
}
|
|
45
48
|
|
|
46
|
-
function getRouteAnimation(
|
|
49
|
+
function getRouteAnimation<K extends keyof AnimationStoreMap>(
|
|
47
50
|
routeKey: ScreenKey,
|
|
48
|
-
type:
|
|
49
|
-
):
|
|
51
|
+
type: K,
|
|
52
|
+
): AnimationStoreMap[K] {
|
|
50
53
|
return ensure(routeKey)[type];
|
|
51
54
|
}
|
|
52
55
|
|
|
53
|
-
function getAnimation(
|
|
56
|
+
function getAnimation<K extends keyof AnimationStoreMap>(
|
|
54
57
|
routeKey: ScreenKey,
|
|
55
|
-
type:
|
|
56
|
-
):
|
|
58
|
+
type: K,
|
|
59
|
+
): AnimationStoreMap[K] {
|
|
57
60
|
return getRouteAnimation(routeKey, type);
|
|
58
61
|
}
|
|
59
62
|
|
|
@@ -70,6 +73,7 @@ function clear(routeKey: ScreenKey) {
|
|
|
70
73
|
cancelAnimation(bag.entering);
|
|
71
74
|
cancelAnimation(bag.targetProgress);
|
|
72
75
|
cancelAnimation(bag.autoSnapPoint);
|
|
76
|
+
cancelAnimation(bag.contentLayout);
|
|
73
77
|
}
|
|
74
78
|
delete store[routeKey];
|
|
75
79
|
}
|
|
@@ -118,7 +118,9 @@ function setGroupActiveId(group: string, id: string) {
|
|
|
118
118
|
groups.modify(<T extends GroupsState>(state: T): T => {
|
|
119
119
|
"worklet";
|
|
120
120
|
const mutableState = state as GroupsState;
|
|
121
|
-
mutableState[group] = {
|
|
121
|
+
mutableState[group] = {
|
|
122
|
+
activeId: id,
|
|
123
|
+
};
|
|
122
124
|
return state;
|
|
123
125
|
});
|
|
124
126
|
debugStoreSizeLog(`setGroupActiveId(${group},${id})`);
|
|
@@ -103,6 +103,13 @@ export interface ScreenInterpolationProps {
|
|
|
103
103
|
* The `width` and `height` of the screen container.
|
|
104
104
|
*/
|
|
105
105
|
screen: Layout;
|
|
106
|
+
/**
|
|
107
|
+
* The intrinsic measured content wrapper layout when available.
|
|
108
|
+
*
|
|
109
|
+
* This is currently populated for the measured screen-container path used by
|
|
110
|
+
* auto snap-point sizing. It is undefined until a real measurement exists.
|
|
111
|
+
*/
|
|
112
|
+
content?: Layout;
|
|
106
113
|
};
|
|
107
114
|
|
|
108
115
|
/**
|
|
@@ -160,9 +167,14 @@ export interface ScreenInterpolationProps {
|
|
|
160
167
|
inactive: ScreenTransitionState | undefined;
|
|
161
168
|
}
|
|
162
169
|
|
|
170
|
+
/**
|
|
171
|
+
* Returning `null` explicitly defers rendering of the screen's visual subtree
|
|
172
|
+
* for the current frame. Returning an object applies transition styles
|
|
173
|
+
* immediately.
|
|
174
|
+
*/
|
|
163
175
|
export type ScreenStyleInterpolator = (
|
|
164
176
|
props: ScreenInterpolationProps,
|
|
165
|
-
) => TransitionInterpolatedStyle;
|
|
177
|
+
) => TransitionInterpolatedStyle | null;
|
|
166
178
|
|
|
167
179
|
/**
|
|
168
180
|
* Animated style properties with full autocomplete.
|
|
@@ -12,6 +12,9 @@ export type Layout = {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export type ScreenKey = string;
|
|
15
|
+
export type SheetScrollGestureBehavior =
|
|
16
|
+
| "expand-and-collapse"
|
|
17
|
+
| "collapse-only";
|
|
15
18
|
|
|
16
19
|
/**
|
|
17
20
|
* A single snap point value. Either a fraction of screen height (0–1) or
|
|
@@ -33,10 +36,13 @@ export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
|
|
|
33
36
|
* </Transition.View>
|
|
34
37
|
*
|
|
35
38
|
* // In your screenStyleInterpolator:
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
39
|
+
* screenStyleInterpolator: ({ progress }) => {
|
|
40
|
+
* "worklet";
|
|
41
|
+
* return {
|
|
42
|
+
* 'hero-image': {
|
|
43
|
+
* opacity: interpolate(progress, [0, 1], [0, 1]),
|
|
44
|
+
* transform: [{ scale: interpolate(progress, [0, 1], [0.8, 1]) }]
|
|
45
|
+
* }
|
|
40
46
|
* }
|
|
41
47
|
* }
|
|
42
48
|
*/
|
|
@@ -74,6 +80,11 @@ export type TransitionAwareProps<T extends object> = AnimatedProps<T> & {
|
|
|
74
80
|
export type ScreenTransitionConfig = {
|
|
75
81
|
/**
|
|
76
82
|
* The user-provided function to calculate styles based on animation progress.
|
|
83
|
+
*
|
|
84
|
+
* Return `null` to explicitly defer rendering of the screen's visual subtree
|
|
85
|
+
* until a later frame. This is useful for transitions such as
|
|
86
|
+
* `bounds().navigation.zoom()` where the screen should stay hidden until the
|
|
87
|
+
* interpolator has enough state to produce a safe first frame.
|
|
77
88
|
*/
|
|
78
89
|
screenStyleInterpolator?: ScreenStyleInterpolator;
|
|
79
90
|
|
|
@@ -87,6 +98,13 @@ export type ScreenTransitionConfig = {
|
|
|
87
98
|
* (e.g. `bounds().navigation.zoom()`) is ready from the first frame.
|
|
88
99
|
*
|
|
89
100
|
* Requires `@react-native-masked-view/masked-view` to be installed.
|
|
101
|
+
*
|
|
102
|
+
* @default false
|
|
103
|
+
*/
|
|
104
|
+
navigationMaskEnabled?: boolean;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @deprecated Use `navigationMaskEnabled` instead.
|
|
90
108
|
*/
|
|
91
109
|
maskEnabled?: boolean;
|
|
92
110
|
|
|
@@ -209,16 +227,25 @@ export type ScreenTransitionConfig = {
|
|
|
209
227
|
initialSnapIndex?: number;
|
|
210
228
|
|
|
211
229
|
/**
|
|
212
|
-
* Controls
|
|
213
|
-
*
|
|
214
|
-
* - `true` (Apple Maps style): Swiping up at scroll top expands the sheet
|
|
215
|
-
* - `false` (Instagram style): Expand only works via deadspace (non-scrollable areas)
|
|
230
|
+
* Controls how nested scroll content hands gestures off to a snap sheet.
|
|
216
231
|
*
|
|
217
|
-
*
|
|
232
|
+
* - `"expand-and-collapse"` (Apple Maps style): Swiping up at scroll boundary expands the sheet,
|
|
233
|
+
* and swiping down at scroll boundary collapses or dismisses it
|
|
234
|
+
* - `"collapse-only"` (Instagram style): Expand only works via deadspace; collapse/dismiss via
|
|
235
|
+
* nested scroll content still works at boundary
|
|
218
236
|
*
|
|
219
237
|
* Only applies to screens with `snapPoints` configured.
|
|
220
238
|
*
|
|
221
|
-
* @default
|
|
239
|
+
* @default "expand-and-collapse"
|
|
240
|
+
*/
|
|
241
|
+
sheetScrollGestureBehavior?: SheetScrollGestureBehavior;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* @deprecated Use `sheetScrollGestureBehavior` instead.
|
|
245
|
+
*
|
|
246
|
+
* Mapping:
|
|
247
|
+
* - `true` -> `"expand-and-collapse"`
|
|
248
|
+
* - `false` -> `"collapse-only"`
|
|
222
249
|
*/
|
|
223
250
|
expandViaScrollView?: boolean;
|
|
224
251
|
|
|
@@ -255,12 +282,15 @@ export type ScreenTransitionConfig = {
|
|
|
255
282
|
*
|
|
256
283
|
* @example
|
|
257
284
|
* backdropComponent: BlurView,
|
|
258
|
-
* screenStyleInterpolator: ({ progress }) =>
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
*
|
|
262
|
-
*
|
|
263
|
-
* }
|
|
285
|
+
* screenStyleInterpolator: ({ progress }) => {
|
|
286
|
+
* "worklet";
|
|
287
|
+
* return {
|
|
288
|
+
* backdrop: {
|
|
289
|
+
* style: { opacity: interpolate(progress, [0, 1], [0, 1]) },
|
|
290
|
+
* props: { intensity: interpolate(progress, [0, 1], [0, 80]) },
|
|
291
|
+
* },
|
|
292
|
+
* };
|
|
293
|
+
* }
|
|
264
294
|
*
|
|
265
295
|
* @default undefined
|
|
266
296
|
*/
|
|
@@ -277,12 +307,15 @@ export type ScreenTransitionConfig = {
|
|
|
277
307
|
*
|
|
278
308
|
* @example
|
|
279
309
|
* surfaceComponent: SquircleView,
|
|
280
|
-
* screenStyleInterpolator: ({ progress }) =>
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
* }
|
|
310
|
+
* screenStyleInterpolator: ({ progress }) => {
|
|
311
|
+
* "worklet";
|
|
312
|
+
* return {
|
|
313
|
+
* surface: {
|
|
314
|
+
* style: { opacity: interpolate(progress, [0, 1], [0, 1]) },
|
|
315
|
+
* props: { cornerRadius: 24, cornerSmoothing: 0.7 },
|
|
316
|
+
* },
|
|
317
|
+
* };
|
|
318
|
+
* }
|
|
286
319
|
*
|
|
287
320
|
* @default undefined
|
|
288
321
|
*/
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
ENTER_RANGE,
|
|
6
6
|
EXIT_RANGE,
|
|
7
7
|
FULLSCREEN_DIMENSIONS,
|
|
8
|
+
HIDDEN_STYLE,
|
|
8
9
|
} from "../../../constants";
|
|
9
10
|
import {
|
|
10
11
|
BoundStore,
|
|
@@ -73,6 +74,8 @@ const resolveBounds = (params: {
|
|
|
73
74
|
currentScreenKey,
|
|
74
75
|
sourceScreenKey: resolvedPair.sourceScreenKey,
|
|
75
76
|
destinationScreenKey: resolvedPair.destinationScreenKey,
|
|
77
|
+
hasTargetOverride,
|
|
78
|
+
usedSnapshotDestination: resolvedPair.usedSnapshotDestination,
|
|
76
79
|
};
|
|
77
80
|
}
|
|
78
81
|
|
|
@@ -85,6 +88,8 @@ const resolveBounds = (params: {
|
|
|
85
88
|
currentScreenKey,
|
|
86
89
|
sourceScreenKey: resolvedPair.sourceScreenKey,
|
|
87
90
|
destinationScreenKey: resolvedPair.destinationScreenKey,
|
|
91
|
+
hasTargetOverride,
|
|
92
|
+
usedSnapshotDestination: resolvedPair.usedSnapshotDestination,
|
|
88
93
|
};
|
|
89
94
|
}
|
|
90
95
|
|
|
@@ -107,6 +112,8 @@ const resolveBounds = (params: {
|
|
|
107
112
|
currentScreenKey,
|
|
108
113
|
sourceScreenKey: resolvedPair.sourceScreenKey,
|
|
109
114
|
destinationScreenKey: resolvedPair.destinationScreenKey,
|
|
115
|
+
hasTargetOverride,
|
|
116
|
+
usedSnapshotDestination: resolvedPair.usedSnapshotDestination,
|
|
110
117
|
};
|
|
111
118
|
};
|
|
112
119
|
|
|
@@ -121,7 +128,7 @@ export const computeBoundStyles = (
|
|
|
121
128
|
if (computeOptions.raw) {
|
|
122
129
|
return EMPTY_BOUND_HELPER_RESULT_RAW;
|
|
123
130
|
}
|
|
124
|
-
return
|
|
131
|
+
return HIDDEN_STYLE;
|
|
125
132
|
}
|
|
126
133
|
|
|
127
134
|
const {
|
|
@@ -131,6 +138,8 @@ export const computeBoundStyles = (
|
|
|
131
138
|
currentScreenKey,
|
|
132
139
|
sourceScreenKey,
|
|
133
140
|
destinationScreenKey,
|
|
141
|
+
hasTargetOverride,
|
|
142
|
+
usedSnapshotDestination,
|
|
134
143
|
} = resolveBounds({
|
|
135
144
|
id,
|
|
136
145
|
previous,
|
|
@@ -145,16 +154,21 @@ export const computeBoundStyles = (
|
|
|
145
154
|
if (computeOptions.raw) {
|
|
146
155
|
return EMPTY_BOUND_HELPER_RESULT_RAW;
|
|
147
156
|
}
|
|
148
|
-
return
|
|
157
|
+
return HIDDEN_STYLE;
|
|
149
158
|
}
|
|
150
159
|
|
|
151
160
|
const ranges: readonly [number, number] = entering ? ENTER_RANGE : EXIT_RANGE;
|
|
152
161
|
|
|
153
162
|
if (computeOptions.method === "content") {
|
|
163
|
+
const ignoresSnapshotDestinationOwnership =
|
|
164
|
+
hasTargetOverride &&
|
|
165
|
+
usedSnapshotDestination &&
|
|
166
|
+
destinationScreenKey === sourceScreenKey;
|
|
154
167
|
const currentOwnsSource =
|
|
155
168
|
!!currentScreenKey &&
|
|
156
169
|
currentScreenKey === sourceScreenKey &&
|
|
157
|
-
currentScreenKey !== destinationScreenKey
|
|
170
|
+
(currentScreenKey !== destinationScreenKey ||
|
|
171
|
+
ignoresSnapshotDestinationOwnership);
|
|
158
172
|
const contentStart = currentOwnsSource ? end : start;
|
|
159
173
|
const contentEnd = currentOwnsSource ? start : end;
|
|
160
174
|
const geometry = computeContentTransformGeometry({
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BoundStore } from "../../../stores/bounds";
|
|
2
1
|
import type { BoundId } from "../types/options";
|
|
3
2
|
|
|
4
3
|
export type ResolveBoundTagParams = {
|
|
@@ -20,10 +19,5 @@ export const resolveBoundTag = ({
|
|
|
20
19
|
return normalizedId;
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
const currentActiveId = BoundStore.getGroupActiveId(group);
|
|
24
|
-
if (currentActiveId !== normalizedId) {
|
|
25
|
-
BoundStore.setGroupActiveId(group, normalizedId);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
22
|
return `${group}:${normalizedId}`;
|
|
29
23
|
};
|
|
@@ -6,11 +6,23 @@ import { computeBoundStyles } from "./helpers/compute-bounds-styles";
|
|
|
6
6
|
import { createInterpolators } from "./helpers/interpolators";
|
|
7
7
|
import { createLinkAccessor } from "./helpers/link-accessor";
|
|
8
8
|
import { resolveBoundTag } from "./helpers/resolve-bound-tag";
|
|
9
|
+
import type { BoundsFrameProps } from "./types/frame-props";
|
|
9
10
|
import type { BoundsOptions } from "./types/options";
|
|
10
11
|
import { createZoomAccessor } from "./zoom";
|
|
11
12
|
|
|
13
|
+
const syncGroupActiveMember = (group?: string, id?: string | number) => {
|
|
14
|
+
"worklet";
|
|
15
|
+
if (!group) return;
|
|
16
|
+
if (id === undefined || id === null || id === "") return;
|
|
17
|
+
|
|
18
|
+
const normalizedId = String(id);
|
|
19
|
+
if (BoundStore.getGroupActiveId(group) === normalizedId) return;
|
|
20
|
+
|
|
21
|
+
BoundStore.setGroupActiveId(group, normalizedId);
|
|
22
|
+
};
|
|
23
|
+
|
|
12
24
|
export const createBoundsAccessor = (
|
|
13
|
-
getProps: () =>
|
|
25
|
+
getProps: () => BoundsFrameProps,
|
|
14
26
|
): BoundsAccessor => {
|
|
15
27
|
"worklet";
|
|
16
28
|
|
|
@@ -37,6 +49,7 @@ export const createBoundsAccessor = (
|
|
|
37
49
|
const computeElementBoundsStyles = (params?: BoundsOptions) => {
|
|
38
50
|
"worklet";
|
|
39
51
|
const props = getProps();
|
|
52
|
+
syncGroupActiveMember(params?.group, params?.id);
|
|
40
53
|
|
|
41
54
|
const resolved = buildBoundsOptions({
|
|
42
55
|
props,
|
|
@@ -54,15 +67,13 @@ export const createBoundsAccessor = (
|
|
|
54
67
|
scaleMode: params?.scaleMode,
|
|
55
68
|
target: params?.target,
|
|
56
69
|
};
|
|
57
|
-
let cachedNavigationPairProps:
|
|
58
|
-
| Omit<ScreenInterpolationProps, "bounds">
|
|
59
|
-
| undefined;
|
|
70
|
+
let cachedNavigationPairProps: BoundsFrameProps | undefined;
|
|
60
71
|
let cachedNavigationPairTag = "";
|
|
61
72
|
let cachedNavigationPair: ResolvedTransitionPair | undefined;
|
|
62
73
|
|
|
63
74
|
const resolveNavigationPair = (
|
|
64
75
|
tag: string,
|
|
65
|
-
frameProps:
|
|
76
|
+
frameProps: BoundsFrameProps,
|
|
66
77
|
): ResolvedTransitionPair | undefined => {
|
|
67
78
|
"worklet";
|
|
68
79
|
if (!tag) return undefined;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import type { ScreenInterpolationProps } from "../../../types/animation.types";
|
|
2
1
|
import type { BoundsNavigationZoomOptions } from "../../../types/bounds.types";
|
|
3
2
|
import type { ResolveBoundTagParams } from "../helpers/resolve-bound-tag";
|
|
3
|
+
import type { BoundsFrameProps } from "../types/frame-props";
|
|
4
4
|
import type { BoundId, BoundsOptions } from "../types/options";
|
|
5
5
|
import { buildZoomStyles } from "./build";
|
|
6
6
|
|
|
7
7
|
type ZoomAccessorParams = {
|
|
8
8
|
id?: BoundId;
|
|
9
9
|
group?: string;
|
|
10
|
-
getProps: () =>
|
|
10
|
+
getProps: () => BoundsFrameProps;
|
|
11
11
|
resolveBoundTag: (params: ResolveBoundTagParams) => string | undefined;
|
|
12
12
|
computeRaw: (
|
|
13
13
|
overrides?: Partial<BoundsOptions>,
|
|
14
|
-
frameProps?:
|
|
14
|
+
frameProps?: BoundsFrameProps,
|
|
15
15
|
) => Record<string, unknown>;
|
|
16
16
|
zoomBaseOptions?: Pick<
|
|
17
17
|
BoundsNavigationZoomOptions,
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { interpolate, type StyleProps } from "react-native-reanimated";
|
|
2
2
|
import {
|
|
3
3
|
EPSILON,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
HIDDEN_STYLE,
|
|
5
|
+
NAVIGATION_MASK_CONTAINER_STYLE_ID,
|
|
6
|
+
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
7
|
+
VISIBLE_STYLE,
|
|
7
8
|
} from "../../../constants";
|
|
8
9
|
import {
|
|
9
10
|
BoundStore,
|
|
10
11
|
type ResolvedTransitionPair,
|
|
11
12
|
} from "../../../stores/bounds";
|
|
12
|
-
import type {
|
|
13
|
+
import type {
|
|
14
|
+
ScreenStyleInterpolator,
|
|
15
|
+
TransitionInterpolatedStyle,
|
|
16
|
+
} from "../../../types/animation.types";
|
|
13
17
|
import type { BoundsNavigationZoomOptions } from "../../../types/bounds.types";
|
|
14
18
|
import type { Layout } from "../../../types/screen.types";
|
|
15
19
|
import type { BoundsOptions } from "../types/options";
|
|
@@ -449,7 +453,7 @@ export const buildZoomStyles = ({
|
|
|
449
453
|
props,
|
|
450
454
|
resolveTag,
|
|
451
455
|
computeRaw,
|
|
452
|
-
}: BuildZoomStylesParams):
|
|
456
|
+
}: BuildZoomStylesParams): ReturnType<ScreenStyleInterpolator> => {
|
|
453
457
|
"worklet";
|
|
454
458
|
|
|
455
459
|
const focused = props.focused;
|
|
@@ -459,6 +463,12 @@ export const buildZoomStyles = ({
|
|
|
459
463
|
const nextRouteKey = props.next?.route.key;
|
|
460
464
|
const entering = !props.next;
|
|
461
465
|
const screenLayout = props.layouts.screen;
|
|
466
|
+
const transitionContext = {
|
|
467
|
+
currentScreenKey: currentRouteKey,
|
|
468
|
+
previousScreenKey: previousRouteKey,
|
|
469
|
+
nextScreenKey: nextRouteKey,
|
|
470
|
+
entering,
|
|
471
|
+
};
|
|
462
472
|
|
|
463
473
|
const resolvedConfig = resolveZoomConfig({
|
|
464
474
|
id,
|
|
@@ -469,7 +479,7 @@ export const buildZoomStyles = ({
|
|
|
469
479
|
defaultAnchor: "top",
|
|
470
480
|
});
|
|
471
481
|
|
|
472
|
-
if (!resolvedConfig) return
|
|
482
|
+
if (!resolvedConfig) return null;
|
|
473
483
|
|
|
474
484
|
const {
|
|
475
485
|
resolvedTag,
|
|
@@ -478,6 +488,21 @@ export const buildZoomStyles = ({
|
|
|
478
488
|
zoomOptions: resolvedZoomOptions,
|
|
479
489
|
} = resolvedConfig;
|
|
480
490
|
|
|
491
|
+
const resolvedPair = BoundStore.resolveTransitionPair(
|
|
492
|
+
resolvedTag,
|
|
493
|
+
transitionContext,
|
|
494
|
+
);
|
|
495
|
+
|
|
496
|
+
const focusedVisibilityStyles = {
|
|
497
|
+
[resolvedTag]: VISIBLE_STYLE,
|
|
498
|
+
} satisfies TransitionInterpolatedStyle;
|
|
499
|
+
|
|
500
|
+
if (!resolvedPair.sourceBounds) {
|
|
501
|
+
return {
|
|
502
|
+
[NAVIGATION_MASK_CONTAINER_STYLE_ID]: HIDDEN_STYLE,
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
|
|
481
506
|
const normX = props.active.gesture.normX;
|
|
482
507
|
const normY = props.active.gesture.normY;
|
|
483
508
|
const initialDirection = props.active.gesture.direction;
|
|
@@ -519,13 +544,6 @@ export const buildZoomStyles = ({
|
|
|
519
544
|
const dragScale = combineScales(dragXScale, dragYScale);
|
|
520
545
|
|
|
521
546
|
if (focused) {
|
|
522
|
-
const focusedPair = BoundStore.resolveTransitionPair(resolvedTag, {
|
|
523
|
-
currentScreenKey: currentRouteKey,
|
|
524
|
-
previousScreenKey: previousRouteKey,
|
|
525
|
-
nextScreenKey: nextRouteKey,
|
|
526
|
-
entering,
|
|
527
|
-
});
|
|
528
|
-
|
|
529
547
|
const contentTarget = getZoomContentTarget({
|
|
530
548
|
explicitTarget,
|
|
531
549
|
resolvedTag,
|
|
@@ -535,7 +553,7 @@ export const buildZoomStyles = ({
|
|
|
535
553
|
entering,
|
|
536
554
|
screenLayout,
|
|
537
555
|
anchor: sharedOptions.anchor,
|
|
538
|
-
resolvedPair
|
|
556
|
+
resolvedPair,
|
|
539
557
|
});
|
|
540
558
|
|
|
541
559
|
const contentRaw = computeRaw({
|
|
@@ -565,21 +583,22 @@ export const buildZoomStyles = ({
|
|
|
565
583
|
const maskRadii = resolveMaskRadii({
|
|
566
584
|
progress,
|
|
567
585
|
zoomOptions: resolvedZoomOptions,
|
|
568
|
-
resolvedPair
|
|
586
|
+
resolvedPair,
|
|
569
587
|
});
|
|
588
|
+
const focusedContentStyle = {
|
|
589
|
+
opacity: focusedFade,
|
|
590
|
+
transform: [
|
|
591
|
+
{ translateX: contentTranslateX },
|
|
592
|
+
{ translateY: contentTranslateY },
|
|
593
|
+
{ scale: contentScale },
|
|
594
|
+
],
|
|
595
|
+
};
|
|
570
596
|
|
|
571
597
|
return {
|
|
572
|
-
[
|
|
573
|
-
style:
|
|
574
|
-
opacity: focusedFade,
|
|
575
|
-
transform: [
|
|
576
|
-
{ translateX: contentTranslateX },
|
|
577
|
-
{ translateY: contentTranslateY },
|
|
578
|
-
{ scale: contentScale },
|
|
579
|
-
],
|
|
580
|
-
},
|
|
598
|
+
[NAVIGATION_MASK_CONTAINER_STYLE_ID]: {
|
|
599
|
+
style: focusedContentStyle,
|
|
581
600
|
},
|
|
582
|
-
[
|
|
601
|
+
[NAVIGATION_MASK_ELEMENT_STYLE_ID]: {
|
|
583
602
|
style: {
|
|
584
603
|
width: maskWidth,
|
|
585
604
|
height: maskHeight,
|
|
@@ -598,13 +617,7 @@ export const buildZoomStyles = ({
|
|
|
598
617
|
: {}),
|
|
599
618
|
},
|
|
600
619
|
},
|
|
601
|
-
|
|
602
|
-
// Without this, useAssociatedStyles enters "waiting-first-style" mode
|
|
603
|
-
// (opacity: 0) because it detects previous-screen evidence but never
|
|
604
|
-
// receives a resolved style for this tag.
|
|
605
|
-
[resolvedTag]: {
|
|
606
|
-
style: { opacity: 1 },
|
|
607
|
-
},
|
|
620
|
+
...focusedVisibilityStyles,
|
|
608
621
|
};
|
|
609
622
|
}
|
|
610
623
|
|
|
@@ -626,6 +639,7 @@ export const buildZoomStyles = ({
|
|
|
626
639
|
entering,
|
|
627
640
|
screenLayout,
|
|
628
641
|
anchor: sharedOptions.anchor,
|
|
642
|
+
resolvedPair,
|
|
629
643
|
});
|
|
630
644
|
|
|
631
645
|
const elementRaw = computeRaw({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ScreenInterpolationProps } from "../../../types/animation.types";
|
|
2
1
|
import type { BoundsNavigationZoomOptions } from "../../../types/bounds.types";
|
|
2
|
+
import type { BoundsFrameProps } from "../types/frame-props";
|
|
3
3
|
import type { BoundId, BoundsOptions } from "../types/options";
|
|
4
4
|
|
|
5
5
|
export type ResolveTag = (params: {
|
|
@@ -9,14 +9,14 @@ export type ResolveTag = (params: {
|
|
|
9
9
|
|
|
10
10
|
export type ComputeRaw = (
|
|
11
11
|
overrides: Partial<BoundsOptions>,
|
|
12
|
-
frameProps?:
|
|
12
|
+
frameProps?: BoundsFrameProps,
|
|
13
13
|
) => Record<string, unknown>;
|
|
14
14
|
|
|
15
15
|
export type BuildZoomStylesParams = {
|
|
16
16
|
id: BoundId;
|
|
17
17
|
group?: string;
|
|
18
18
|
zoomOptions?: BoundsNavigationZoomOptions;
|
|
19
|
-
props:
|
|
19
|
+
props: BoundsFrameProps;
|
|
20
20
|
resolveTag: ResolveTag;
|
|
21
21
|
computeRaw: ComputeRaw;
|
|
22
22
|
};
|