react-native-screen-transitions 3.4.0-alpha.6 → 3.4.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +136 -46
- package/lib/commonjs/blank-stack/navigators/create-blank-stack-navigator.js +27 -45
- 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 +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js +41 -0
- package/lib/commonjs/shared/components/create-boundary-component/components/boundary-target.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js +193 -0
- package/lib/commonjs/shared/components/create-boundary-component/create-boundary-component.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +53 -43
- package/lib/commonjs/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -1
- 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 +8 -26
- 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-pending-destination-measurement.js +84 -2
- 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-prepare-transition-measurement.js +67 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.js.map +1 -0
- package/lib/commonjs/shared/components/create-boundary-component/index.js +27 -216
- package/lib/commonjs/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/commonjs/shared/components/create-boundary-component/providers/boundary-owner.provider.js +63 -0
- package/lib/commonjs/shared/components/create-boundary-component/providers/boundary-owner.provider.js.map +1 -0
- package/lib/commonjs/shared/components/create-transition-aware-component.js +37 -39
- 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/screen-container/hooks/use-content-layout.js +11 -9
- package/lib/commonjs/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/index.js +8 -12
- package/lib/commonjs/shared/components/screen-container/index.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js +11 -9
- package/lib/commonjs/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/commonjs/shared/components/screen-container/layers/content.js +4 -4
- 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 -4
- 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 -4
- package/lib/commonjs/shared/components/screen-container/layers/surface-container.js.map +1 -1
- package/lib/commonjs/shared/components/screen-lifecycle/index.js +3 -1
- package/lib/commonjs/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/commonjs/shared/constants.js +18 -2
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/hooks/reanimated/use-animated-debounce.js +43 -0
- package/lib/commonjs/shared/hooks/reanimated/use-animated-debounce.js.map +1 -0
- package/lib/commonjs/shared/index.js +6 -0
- package/lib/commonjs/shared/index.js.map +1 -1
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js +7 -0
- package/lib/commonjs/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js +23 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/screen-composer.js +1 -1
- package/lib/commonjs/shared/providers/screen/screen-composer.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/helpers/build-resolved-style-map.js +144 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/build-resolved-style-map.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js +28 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/split-normalized-style-maps.js +39 -0
- package/lib/commonjs/shared/providers/screen/styles/helpers/split-normalized-style-maps.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/styles/index.js +25 -0
- package/lib/commonjs/shared/providers/screen/styles/index.js.map +1 -0
- package/lib/commonjs/shared/providers/screen/{styles.provider.js → styles/styles.provider.js} +37 -39
- package/lib/commonjs/shared/providers/screen/styles/styles.provider.js.map +1 -0
- package/lib/commonjs/shared/stores/animation.store.js +9 -3
- package/lib/commonjs/shared/stores/animation.store.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/registry.js +18 -2
- package/lib/commonjs/shared/stores/bounds/internals/registry.js.map +1 -1
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js +7 -48
- package/lib/commonjs/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +10 -0
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js +6 -12
- package/lib/commonjs/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js +21 -10
- package/lib/commonjs/shared/utils/bounds/helpers/style-composers.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/build.js +158 -52
- package/lib/commonjs/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/zoom/config.js +3 -1
- package/lib/commonjs/shared/utils/bounds/zoom/config.js.map +1 -1
- package/lib/module/blank-stack/navigators/create-blank-stack-navigator.js +27 -45
- 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 +1 -1
- package/lib/module/shared/components/create-boundary-component/components/boundary-target.js +36 -0
- package/lib/module/shared/components/create-boundary-component/components/boundary-target.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js +188 -0
- package/lib/module/shared/components/create-boundary-component/create-boundary-component.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js +1 -1
- package/lib/module/shared/components/create-boundary-component/helpers/resolve-pending-source-key.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js +51 -41
- package/lib/module/shared/components/create-boundary-component/hooks/helpers/measurement-rules.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-auto-source-measurement.js +7 -1
- 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 +8 -26
- 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-pending-destination-measurement.js +86 -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-prepare-transition-measurement.js +62 -0
- package/lib/module/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.js.map +1 -0
- package/lib/module/shared/components/create-boundary-component/index.js +23 -215
- package/lib/module/shared/components/create-boundary-component/index.js.map +1 -1
- package/lib/module/shared/components/create-boundary-component/providers/boundary-owner.provider.js +56 -0
- package/lib/module/shared/components/create-boundary-component/providers/boundary-owner.provider.js.map +1 -0
- package/lib/module/shared/components/create-transition-aware-component.js +39 -41
- package/lib/module/shared/components/create-transition-aware-component.js.map +1 -1
- package/lib/module/shared/components/overlay/variations/float-overlay.js +1 -1
- package/lib/module/shared/components/overlay/variations/float-overlay.js.map +1 -1
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js +11 -9
- package/lib/module/shared/components/screen-container/hooks/use-content-layout.js.map +1 -1
- package/lib/module/shared/components/screen-container/index.js +8 -12
- package/lib/module/shared/components/screen-container/index.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/backdrop.js +11 -9
- package/lib/module/shared/components/screen-container/layers/backdrop.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/content.js +4 -4
- package/lib/module/shared/components/screen-container/layers/content.js.map +1 -1
- package/lib/module/shared/components/screen-container/layers/maybe-masked-navigation-container.js +4 -4
- 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 -4
- package/lib/module/shared/components/screen-container/layers/surface-container.js.map +1 -1
- package/lib/module/shared/components/screen-lifecycle/index.js +3 -1
- package/lib/module/shared/components/screen-lifecycle/index.js.map +1 -1
- package/lib/module/shared/constants.js +17 -1
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/hooks/reanimated/use-animated-debounce.js +39 -0
- package/lib/module/shared/hooks/reanimated/use-animated-debounce.js.map +1 -0
- 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 +7 -0
- package/lib/module/shared/providers/gestures/handlers/use-handlers.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js +23 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js +3 -0
- package/lib/module/shared/providers/screen/animation/helpers/use-build-transition-state.js.map +1 -1
- package/lib/module/shared/providers/screen/screen-composer.js +1 -1
- package/lib/module/shared/providers/screen/screen-composer.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/helpers/build-resolved-style-map.js +139 -0
- package/lib/module/shared/providers/screen/styles/helpers/build-resolved-style-map.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js +23 -0
- package/lib/module/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/helpers/split-normalized-style-maps.js +34 -0
- package/lib/module/shared/providers/screen/styles/helpers/split-normalized-style-maps.js.map +1 -0
- package/lib/module/shared/providers/screen/styles/index.js +4 -0
- package/lib/module/shared/providers/screen/styles/index.js.map +1 -0
- package/lib/module/shared/providers/screen/{styles.provider.js → styles/styles.provider.js} +38 -40
- package/lib/module/shared/providers/screen/styles/styles.provider.js.map +1 -0
- package/lib/module/shared/stores/animation.store.js +9 -3
- package/lib/module/shared/stores/animation.store.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/registry.js +18 -2
- package/lib/module/shared/stores/bounds/internals/registry.js.map +1 -1
- package/lib/module/shared/stores/bounds/internals/resolver.js +7 -48
- package/lib/module/shared/stores/bounds/internals/resolver.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +10 -0
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js +7 -13
- package/lib/module/shared/utils/bounds/helpers/compute-bounds-styles.js.map +1 -1
- package/lib/module/shared/utils/bounds/helpers/style-composers.js +21 -10
- package/lib/module/shared/utils/bounds/helpers/style-composers.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/build.js +159 -52
- package/lib/module/shared/utils/bounds/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/zoom/config.js +2 -0
- package/lib/module/shared/utils/bounds/zoom/config.js.map +1 -1
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts +9 -15
- package/lib/typescript/blank-stack/navigators/create-blank-stack-navigator.d.ts.map +1 -1
- package/lib/typescript/blank-stack/types.d.ts +6 -4
- package/lib/typescript/blank-stack/types.d.ts.map +1 -1
- package/lib/typescript/component-stack/navigators/create-component-stack-navigator.d.ts +1 -1
- package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts +209 -0
- package/lib/typescript/shared/components/create-boundary-component/components/boundary-target.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts +8 -0
- package/lib/typescript/shared/components/create-boundary-component/create-boundary-component.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/helpers/resolve-pending-source-key.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts +16 -11
- package/lib/typescript/shared/components/create-boundary-component/hooks/helpers/measurement-rules.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-auto-source-measurement.d.ts +3 -1
- 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 -9
- 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-pending-destination-measurement.d.ts +6 -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-prepare-transition-measurement.d.ts +12 -0
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts +224 -14
- package/lib/typescript/shared/components/create-boundary-component/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-boundary-component/providers/boundary-owner.provider.d.ts +35 -0
- package/lib/typescript/shared/components/create-boundary-component/providers/boundary-owner.provider.d.ts.map +1 -0
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts +1 -1
- package/lib/typescript/shared/components/create-boundary-component/types.d.ts.map +1 -1
- package/lib/typescript/shared/components/create-transition-aware-component.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/hooks/use-content-layout.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/backdrop.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-container/layers/maybe-masked-navigation-container.d.ts.map +1 -1
- package/lib/typescript/shared/components/screen-lifecycle/index.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts +34 -0
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/hooks/reanimated/use-animated-debounce.d.ts +13 -0
- package/lib/typescript/shared/hooks/reanimated/use-animated-debounce.d.ts.map +1 -0
- package/lib/typescript/shared/index.d.ts +210 -3
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/gestures/handlers/use-handlers.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts +3 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts +3 -0
- package/lib/typescript/shared/providers/screen/animation/helpers/use-build-transition-state.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/helpers/build-resolved-style-map.d.ts +11 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/build-resolved-style-map.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.d.ts +7 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/split-normalized-style-maps.d.ts +6 -0
- package/lib/typescript/shared/providers/screen/styles/helpers/split-normalized-style-maps.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/styles/index.d.ts +2 -0
- package/lib/typescript/shared/providers/screen/styles/index.d.ts.map +1 -0
- package/lib/typescript/shared/providers/screen/{styles.provider.d.ts → styles/styles.provider.d.ts} +3 -5
- package/lib/typescript/shared/providers/screen/styles/styles.provider.d.ts.map +1 -0
- package/lib/typescript/shared/stores/animation.store.d.ts +5 -2
- package/lib/typescript/shared/stores/animation.store.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/registry.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/internals/resolver.d.ts.map +1 -1
- package/lib/typescript/shared/stores/bounds/types.d.ts +0 -2
- package/lib/typescript/shared/stores/bounds/types.d.ts.map +1 -1
- package/lib/typescript/shared/types/animation.types.d.ts +14 -9
- package/lib/typescript/shared/types/animation.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +34 -1
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/index.d.ts +1 -1
- package/lib/typescript/shared/types/index.d.ts.map +1 -1
- package/lib/typescript/shared/types/screen.types.d.ts +2 -4
- package/lib/typescript/shared/types/screen.types.d.ts.map +1 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts +2 -1
- package/lib/typescript/shared/utils/animation/animate-to-progress.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts +1 -11
- package/lib/typescript/shared/utils/bounds/helpers/compute-bounds-styles.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/helpers/style-composers.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts +2 -0
- package/lib/typescript/shared/utils/bounds/zoom/config.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/blank-stack/navigators/create-blank-stack-navigator.tsx +37 -80
- package/src/blank-stack/types.ts +7 -4
- package/src/component-stack/navigators/create-component-stack-navigator.tsx +1 -1
- package/src/shared/components/create-boundary-component/components/boundary-target.tsx +47 -0
- package/src/shared/components/create-boundary-component/create-boundary-component.tsx +249 -0
- package/src/shared/components/create-boundary-component/helpers/resolve-pending-source-key.ts +5 -1
- package/src/shared/components/create-boundary-component/hooks/helpers/measurement-rules.ts +68 -59
- package/src/shared/components/create-boundary-component/hooks/use-auto-source-measurement.ts +19 -3
- package/src/shared/components/create-boundary-component/hooks/use-boundary-measure-and-store.ts +11 -44
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-measurement.ts +165 -6
- package/src/shared/components/create-boundary-component/hooks/use-prepare-transition-measurement.ts +107 -0
- package/src/shared/components/create-boundary-component/index.tsx +23 -254
- package/src/shared/components/create-boundary-component/providers/boundary-owner.provider.tsx +109 -0
- package/src/shared/components/create-boundary-component/types.ts +1 -2
- package/src/shared/components/create-transition-aware-component.tsx +43 -52
- package/src/shared/components/overlay/variations/float-overlay.tsx +1 -1
- package/src/shared/components/screen-container/hooks/use-content-layout.ts +10 -17
- package/src/shared/components/screen-container/index.tsx +10 -13
- package/src/shared/components/screen-container/layers/backdrop.tsx +10 -13
- package/src/shared/components/screen-container/layers/content.tsx +4 -4
- package/src/shared/components/screen-container/layers/maybe-masked-navigation-container.tsx +6 -4
- package/src/shared/components/screen-container/layers/surface-container.tsx +4 -4
- package/src/shared/components/screen-lifecycle/index.tsx +1 -4
- package/src/shared/constants.ts +12 -0
- package/src/shared/hooks/reanimated/use-animated-debounce.ts +56 -0
- package/src/shared/index.ts +1 -1
- package/src/shared/providers/gestures/handlers/use-handlers.ts +9 -0
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state.ts +27 -1
- package/src/shared/providers/screen/animation/helpers/use-build-transition-state.ts +6 -0
- package/src/shared/providers/screen/screen-composer.tsx +1 -1
- package/src/shared/providers/screen/styles/helpers/build-resolved-style-map.ts +185 -0
- package/src/shared/providers/screen/styles/helpers/resolve-interpolated-style-output.ts +31 -0
- package/src/shared/providers/screen/styles/helpers/split-normalized-style-maps.ts +44 -0
- package/src/shared/providers/screen/styles/index.tsx +5 -0
- package/src/shared/providers/screen/{styles.provider.tsx → styles/styles.provider.tsx} +54 -56
- package/src/shared/stores/animation.store.ts +11 -2
- package/src/shared/stores/bounds/internals/registry.ts +24 -3
- package/src/shared/stores/bounds/internals/resolver.ts +6 -75
- package/src/shared/stores/bounds/types.ts +0 -2
- package/src/shared/types/animation.types.ts +16 -10
- package/src/shared/types/bounds.types.ts +34 -1
- package/src/shared/types/index.ts +0 -1
- package/src/shared/types/screen.types.ts +2 -4
- package/src/shared/utils/animation/animate-to-progress.ts +11 -1
- package/src/shared/utils/bounds/helpers/compute-bounds-styles.ts +3 -12
- package/src/shared/utils/bounds/helpers/style-composers.ts +11 -0
- package/src/shared/utils/bounds/zoom/build.ts +228 -100
- package/src/shared/utils/bounds/zoom/config.ts +2 -0
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +0 -54
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +0 -122
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +0 -72
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +0 -66
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +0 -57
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +0 -53
- package/lib/commonjs/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +0 -1
- package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js +0 -45
- package/lib/commonjs/shared/components/screen-container/deferred-visibility-host.js.map +0 -1
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js +0 -234
- package/lib/commonjs/shared/hooks/animation/use-associated-style.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js +0 -50
- package/lib/commonjs/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +0 -1
- package/lib/commonjs/shared/providers/screen/styles.provider.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js +0 -49
- package/lib/module/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js +0 -118
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js +0 -67
- package/lib/module/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js +0 -61
- package/lib/module/shared/components/create-boundary-component/hooks/use-initial-layout-handler.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js +0 -52
- package/lib/module/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.js.map +0 -1
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js +0 -48
- package/lib/module/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.js.map +0 -1
- package/lib/module/shared/components/screen-container/deferred-visibility-host.js +0 -40
- package/lib/module/shared/components/screen-container/deferred-visibility-host.js.map +0 -1
- package/lib/module/shared/hooks/animation/use-associated-style.js +0 -229
- package/lib/module/shared/hooks/animation/use-associated-style.js.map +0 -1
- package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js +0 -44
- package/lib/module/shared/providers/screen/helpers/resolve-interpolated-style-output.js.map +0 -1
- package/lib/module/shared/providers/screen/styles.provider.js.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts +0 -11
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts +0 -17
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts +0 -11
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts +0 -10
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-initial-layout-handler.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts +0 -12
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts +0 -10
- package/lib/typescript/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.d.ts.map +0 -1
- package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts +0 -14
- package/lib/typescript/shared/components/screen-container/deferred-visibility-host.d.ts.map +0 -1
- package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts +0 -32
- package/lib/typescript/shared/hooks/animation/use-associated-style.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts +0 -14
- package/lib/typescript/shared/providers/screen/helpers/resolve-interpolated-style-output.d.ts.map +0 -1
- package/lib/typescript/shared/providers/screen/styles.provider.d.ts.map +0 -1
- package/src/shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.ts +0 -58
- package/src/shared/components/create-boundary-component/hooks/use-group-active-measurement.ts +0 -162
- package/src/shared/components/create-boundary-component/hooks/use-group-active-source-measurement.ts +0 -82
- package/src/shared/components/create-boundary-component/hooks/use-initial-layout-handler.ts +0 -92
- package/src/shared/components/create-boundary-component/hooks/use-pending-destination-retry-measurement.ts +0 -86
- package/src/shared/components/create-boundary-component/hooks/use-scroll-settled-measurement.ts +0 -49
- package/src/shared/components/screen-container/deferred-visibility-host.tsx +0 -44
- package/src/shared/hooks/animation/use-associated-style.ts +0 -297
- package/src/shared/providers/screen/helpers/resolve-interpolated-style-output.ts +0 -61
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bounds.types.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/bounds.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAC9E,OAAO,EACN,kCAAkC,EAClC,gCAAgC,EAChC,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EACX,OAAO,EACP,aAAa,EACb,mBAAmB,EACnB,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EACX,wBAAwB,EACxB,2BAA2B,EAC3B,mBAAmB,EACnB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5D,MAAM,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,MAAM,EAAE,UAAU,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B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AO,EACX,QAAQ,EAAE,MAAM,kBAAkB,EAClC,mBAAmB,CAAC,EAAE,MAAM,GAAG,MAAM,EACrC,QAAQ,CAAC,EAAE,MAAM,KACb,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAC1C,wBAAwB,EACxB,QAAQ,CACR,GAAG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CAChC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { FALSE, TRUE } from "../constants";
|
|
2
|
-
export type { AnimatedViewStyle, AnimationConfig,
|
|
2
|
+
export type { AnimatedViewStyle, AnimationConfig, ScreenInterpolationProps, ScreenStyleInterpolator, ScreenTransitionState, TransitionInterpolatedStyle, TransitionSlotStyle, TransitionSpec, } from "./animation.types";
|
|
3
3
|
export type { BoundsAccessor, BoundsMethod, BoundsNavigationAccessor, BoundsNavigationZoomOptions, BoundsNavigationZoomStyle, } from "./bounds.types";
|
|
4
4
|
export type { ActivationArea, GestureActivationArea, GestureDirection, GestureValues, SideActivation, } from "./gesture.types";
|
|
5
5
|
export type { OverlayProps } from "./overlay.types";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC3C,YAAY,EACX,iBAAiB,EACjB,eAAe,EACf,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC3C,YAAY,EACX,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC3B,mBAAmB,EACnB,cAAc,GACd,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EACX,cAAc,EACd,YAAY,EACZ,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,GACzB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACX,cAAc,EACd,qBAAqB,EACrB,gBAAgB,EAChB,aAAa,EACb,cAAc,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,YAAY,EACX,MAAM,EACN,SAAS,EACT,sBAAsB,EACtB,oBAAoB,GACpB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EACX,mBAAmB,EACnB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,cAAc,EACd,aAAa,GACb,MAAM,eAAe,CAAC"}
|
|
@@ -70,10 +70,8 @@ export type ScreenTransitionConfig = {
|
|
|
70
70
|
/**
|
|
71
71
|
* The user-provided function to calculate styles based on animation progress.
|
|
72
72
|
*
|
|
73
|
-
* Return `null`
|
|
74
|
-
*
|
|
75
|
-
* `bounds().navigation.zoom()` where the screen should stay hidden until the
|
|
76
|
-
* interpolator has enough state to produce a safe first frame.
|
|
73
|
+
* Return `null`, `undefined`, or `{}` to apply no transition styles for the
|
|
74
|
+
* current frame.
|
|
77
75
|
*/
|
|
78
76
|
screenStyleInterpolator?: ScreenStyleInterpolator;
|
|
79
77
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"screen.types.d.ts","sourceRoot":"","sources":["../../../../src/shared/types/screen.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EACX,uBAAuB,EACvB,cAAc,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,MAAM,MAAM,MAAM,GAAG;IACpB,KAAK,EAAE,MAAM,CAAC;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;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,KAAK,KAAK,CAAC,SAAS,CAAC;IAEnD;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;;;;;OASG;IACH,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAE7C;;;;;;;;;OASG;IACH,kCAAkC,CAAC,EAAE,OAAO,CAAC;IAE7C;;;;;;;;;;;;;;OAcG;IACH,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IAEzB;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;;;;;;;;OAWG;IACH,0BAA0B,CAAC,EAAE,0BAA0B,CAAC;IAExD;;;;;;OAMG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;;;;;OAQG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;;;;;;;OASG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAEpC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,iBAAiB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;IAE7C;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;CAC5C,CAAC"}
|
|
@@ -13,9 +13,10 @@ interface AnimateToProgressProps {
|
|
|
13
13
|
onAnimationFinish?: (finished: boolean) => void;
|
|
14
14
|
animations: AnimationStoreMap;
|
|
15
15
|
targetProgress: SharedValue<number>;
|
|
16
|
+
emitWillAnimate?: boolean;
|
|
16
17
|
/** Optional initial velocity for spring-based progress (units: progress/sec). */
|
|
17
18
|
initialVelocity?: number;
|
|
18
19
|
}
|
|
19
|
-
export declare const animateToProgress: ({ target, spec, onAnimationFinish, animations, targetProgress, initialVelocity, }: AnimateToProgressProps) => void;
|
|
20
|
+
export declare const animateToProgress: ({ target, spec, onAnimationFinish, animations, targetProgress, emitWillAnimate, initialVelocity, }: AnimateToProgressProps) => void;
|
|
20
21
|
export {};
|
|
21
22
|
//# sourceMappingURL=animate-to-progress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"animate-to-progress.d.ts","sourceRoot":"","sources":["../../../../../src/shared/utils/animation/animate-to-progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE,UAAU,sBAAsB;IAC/B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAClC,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,iBAAiB,CAAC;IAC9B,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,iFAAiF;IACjF,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,iBAAiB,GAAI,
|
|
1
|
+
{"version":3,"file":"animate-to-progress.d.ts","sourceRoot":"","sources":["../../../../../src/shared/utils/animation/animate-to-progress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAGlE,UAAU,sBAAsB;IAC/B;;;;;OAKG;IACH,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IAClC,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,iBAAiB,CAAC,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,iBAAiB,CAAC;IAC9B,cAAc,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACpC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iFAAiF;IACjF,eAAe,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,iBAAiB,GAAI,oGAQ/B,sBAAsB,SAuExB,CAAC"}
|
|
@@ -1,14 +1,4 @@
|
|
|
1
1
|
import { type ResolvedTransitionPair } from "../../../stores/bounds";
|
|
2
2
|
import type { BoundsComputeParams, BoundsOptions } from "../types/options";
|
|
3
|
-
export declare const computeBoundStyles: ({ id, previous, current, next, progress, dimensions }: BoundsComputeParams, computeOptions?: BoundsOptions, resolvedPair?: ResolvedTransitionPair) =>
|
|
4
|
-
opacity: 0;
|
|
5
|
-
}> | Readonly<{
|
|
6
|
-
scaleX: 1;
|
|
7
|
-
scaleY: 1;
|
|
8
|
-
scale: 1;
|
|
9
|
-
translateX: 0;
|
|
10
|
-
translateY: 0;
|
|
11
|
-
width: 0;
|
|
12
|
-
height: 0;
|
|
13
|
-
}>;
|
|
3
|
+
export declare const computeBoundStyles: ({ id, previous, current, next, progress, dimensions }: BoundsComputeParams, computeOptions?: BoundsOptions, resolvedPair?: ResolvedTransitionPair) => Readonly<{}>;
|
|
14
4
|
//# sourceMappingURL=compute-bounds-styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute-bounds-styles.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/compute-bounds-styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compute-bounds-styles.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/compute-bounds-styles.ts"],"names":[],"mappings":"AASA,OAAO,EAEN,KAAK,sBAAsB,EAC3B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAEX,mBAAmB,EACnB,aAAa,EACb,MAAM,kBAAkB,CAAC;AAiG1B,eAAO,MAAM,kBAAkB,GAC9B,uDAAuD,mBAAmB,EAC1E,iBAAgB,aAAkC,EAClD,eAAe,sBAAsB,iBA0FrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style-composers.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/style-composers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"style-composers.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/helpers/style-composers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAE9E,OAAO,KAAK,EACX,wBAAwB,EACxB,gBAAgB,EAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGpE;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IAClC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,GAAG,EAAE,kBAAkB,CAAC;IACxB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,cAAc,EAAE,aAAa,CAAC;CAC9B,CAAC;AAEF;;;;;;GAMG;AACH,KAAK,oBAAoB,GAAG;IAC3B,KAAK,EAAE,kBAAkB,CAAC;IAC1B,GAAG,EAAE,kBAAkB,CAAC;IACxB,QAAQ,EAAE,wBAAwB,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,cAAc,EAAE,aAAa,CAAC;CAC9B,CAAC;AAiEF,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,GAAG,UAAU,CA0C5E;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,GAAG,UAAU,CA2C5E;AAED,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,oBAAoB,GAC1B,UAAU,CA+BZ;AAED,wBAAgB,wBAAwB,CACvC,MAAM,EAAE,oBAAoB,GAC1B,UAAU,CAsCZ;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,GAAG,UAAU,CAiC5E"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { BuildZoomStylesParams, ZoomInterpolatedStyle } from "./types";
|
|
2
|
-
export declare
|
|
2
|
+
export declare function buildZoomStyles({ resolvedTag, zoomOptions, props, }: BuildZoomStylesParams): ZoomInterpolatedStyle;
|
|
3
3
|
//# sourceMappingURL=build.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/zoom/build.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/zoom/build.ts"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAoJ5E,wBAAgB,eAAe,CAAC,EAC/B,WAAW,EACX,WAAW,EACX,KAAK,GACL,EAAE,qBAAqB,GAAG,qBAAqB,CAqW/C"}
|
|
@@ -6,6 +6,8 @@ export declare const ZOOM_SHARED_OPTIONS: Readonly<{
|
|
|
6
6
|
export declare const ZOOM_DRAG_RESISTANCE = 0.4;
|
|
7
7
|
export declare const ZOOM_DRAG_DIRECTIONAL_SCALE_MIN = 0.25;
|
|
8
8
|
export declare const ZOOM_DRAG_DIRECTIONAL_SCALE_MAX = 1.06;
|
|
9
|
+
export declare const ZOOM_DRAG_DIRECTIONAL_SCALE_EXPONENT = 2;
|
|
10
|
+
export declare const ZOOM_BACKGROUND_SCALE = 0.9375;
|
|
9
11
|
export declare const ZOOM_MASK_OUTSET: Readonly<{
|
|
10
12
|
top: 0;
|
|
11
13
|
right: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/zoom/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,eAAO,MAAM,mBAAmB;;;EAG9B,CAAC;AAEH,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,+BAA+B,OAAO,CAAC;AACpD,eAAO,MAAM,+BAA+B,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../../src/shared/utils/bounds/zoom/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEtD,eAAO,MAAM,mBAAmB;;;EAG9B,CAAC;AAEH,eAAO,MAAM,oBAAoB,MAAM,CAAC;AACxC,eAAO,MAAM,+BAA+B,OAAO,CAAC;AACpD,eAAO,MAAM,+BAA+B,OAAO,CAAC;AACpD,eAAO,MAAM,oCAAoC,IAAI,CAAC;AACtD,eAAO,MAAM,qBAAqB,SAAS,CAAC;AAE5C,eAAO,MAAM,gBAAgB;;;;;EAK3B,CAAC;AAEH,eAAO,MAAM,aAAa,GACzB,QAAQ,aAAa,CAAC,QAAQ,CAAC,GAAG,SAAS,KACzC,aAAa,CAAC,QAAQ,CAGxB,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,OAAO,OAAO,EAAE,iBAAY,KAAG,MAGvD,CAAC"}
|
package/package.json
CHANGED
|
@@ -23,7 +23,10 @@ import type {
|
|
|
23
23
|
BlankStackNavigatorProps,
|
|
24
24
|
} from "../types";
|
|
25
25
|
|
|
26
|
-
type BlankStackNavigatorInnerProps =
|
|
26
|
+
type BlankStackNavigatorInnerProps = Omit<
|
|
27
|
+
BlankStackNavigatorProps,
|
|
28
|
+
keyof BlankStackFactoryOptions
|
|
29
|
+
> & {
|
|
27
30
|
DISABLE_NATIVE_SCREENS?: boolean;
|
|
28
31
|
DISABLE_NATIVE_SCREEN_CONTAINER?: boolean;
|
|
29
32
|
};
|
|
@@ -77,49 +80,39 @@ function BlankStackNavigatorInner({
|
|
|
77
80
|
);
|
|
78
81
|
}
|
|
79
82
|
|
|
80
|
-
function
|
|
81
|
-
independent,
|
|
82
|
-
enableNativeScreens,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
if (!independent || isNested) {
|
|
98
|
-
return navigator;
|
|
99
|
-
}
|
|
83
|
+
function BlankStackNavigator({
|
|
84
|
+
independent = false,
|
|
85
|
+
enableNativeScreens = true,
|
|
86
|
+
...rest
|
|
87
|
+
}: BlankStackNavigatorProps) {
|
|
88
|
+
const isNested = React.useContext(BlankStackContext);
|
|
89
|
+
|
|
90
|
+
const navigator = (
|
|
91
|
+
<BlankStackNavigatorInner
|
|
92
|
+
{...rest}
|
|
93
|
+
{...(!enableNativeScreens && {
|
|
94
|
+
DISABLE_NATIVE_SCREENS: true,
|
|
95
|
+
})}
|
|
96
|
+
DISABLE_NATIVE_SCREEN_CONTAINER={independent}
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
100
99
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
<NavigationContainer>
|
|
104
|
-
<BlankStackContext.Provider value={true}>
|
|
105
|
-
{navigator}
|
|
106
|
-
</BlankStackContext.Provider>
|
|
107
|
-
</NavigationContainer>
|
|
108
|
-
</NavigationIndependentTree>
|
|
109
|
-
);
|
|
100
|
+
if (!independent || isNested) {
|
|
101
|
+
return navigator;
|
|
110
102
|
}
|
|
111
103
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
104
|
+
return (
|
|
105
|
+
<NavigationIndependentTree>
|
|
106
|
+
<NavigationContainer>
|
|
107
|
+
<BlankStackContext.Provider value={true}>
|
|
108
|
+
{navigator}
|
|
109
|
+
</BlankStackContext.Provider>
|
|
110
|
+
</NavigationContainer>
|
|
111
|
+
</NavigationIndependentTree>
|
|
112
|
+
);
|
|
117
113
|
}
|
|
118
114
|
|
|
119
|
-
|
|
120
|
-
independent: false,
|
|
121
|
-
enableNativeScreens: true,
|
|
122
|
-
});
|
|
115
|
+
BlankStackNavigator.displayName = "BlankStackNavigator";
|
|
123
116
|
|
|
124
117
|
type BlankStackTypeBag<
|
|
125
118
|
ParamList extends ParamListBase,
|
|
@@ -147,14 +140,13 @@ type BlankStackTypeBag<
|
|
|
147
140
|
* it participates in the current navigation tree and uses native screen
|
|
148
141
|
* primitives on supported native platforms.
|
|
149
142
|
*
|
|
150
|
-
*
|
|
143
|
+
* Blank stack also accepts navigator-specific props for embedded-flow behavior:
|
|
151
144
|
* - `independent: true` creates an isolated navigator for nested flows
|
|
152
145
|
* - `enableNativeScreens: false` renders the stack with regular views instead
|
|
153
146
|
* of `react-native-screens`
|
|
154
147
|
*
|
|
155
|
-
*
|
|
156
|
-
*
|
|
157
|
-
* itself is hosted.
|
|
148
|
+
* In the dynamic API, pass these to `<Stack.Navigator />`.
|
|
149
|
+
* In the static API, pass them in the same config object as `screens`.
|
|
158
150
|
*/
|
|
159
151
|
export function createBlankStackNavigator<
|
|
160
152
|
const ParamList extends ParamListBase,
|
|
@@ -163,42 +155,7 @@ export function createBlankStackNavigator<
|
|
|
163
155
|
ParamList,
|
|
164
156
|
NavigatorID
|
|
165
157
|
>,
|
|
166
|
-
|
|
167
|
-
export function createBlankStackNavigator<
|
|
168
|
-
const ParamList extends ParamListBase,
|
|
169
|
-
const NavigatorID extends string | undefined = undefined,
|
|
170
|
-
const TypeBag extends NavigatorTypeBagBase = BlankStackTypeBag<
|
|
171
|
-
ParamList,
|
|
172
|
-
NavigatorID
|
|
173
|
-
>,
|
|
174
|
-
>(
|
|
175
|
-
/**
|
|
176
|
-
* Factory-level hosting options for the blank stack.
|
|
177
|
-
*/
|
|
178
|
-
options: BlankStackFactoryOptions,
|
|
179
|
-
): TypedNavigator<TypeBag, StaticConfig<TypeBag>>;
|
|
180
|
-
export function createBlankStackNavigator<
|
|
181
|
-
const ParamList extends ParamListBase,
|
|
182
|
-
const NavigatorID extends string | undefined = undefined,
|
|
183
|
-
const TypeBag extends NavigatorTypeBagBase = BlankStackTypeBag<
|
|
184
|
-
ParamList,
|
|
185
|
-
NavigatorID
|
|
186
|
-
>,
|
|
187
|
-
const Config extends StaticConfig<TypeBag> &
|
|
188
|
-
BlankStackFactoryOptions = StaticConfig<TypeBag> & BlankStackFactoryOptions,
|
|
158
|
+
const Config extends StaticConfig<TypeBag> = StaticConfig<TypeBag>,
|
|
189
159
|
>(config?: Config): TypedNavigator<TypeBag, Config> {
|
|
190
|
-
|
|
191
|
-
independent = false,
|
|
192
|
-
enableNativeScreens = true,
|
|
193
|
-
...staticConfig
|
|
194
|
-
} = (config ?? {}) as StaticConfig<TypeBag> & BlankStackFactoryOptions;
|
|
195
|
-
|
|
196
|
-
const Navigator = createBlankStackNavigatorComponent({
|
|
197
|
-
independent,
|
|
198
|
-
enableNativeScreens,
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
return createNavigatorFactory(Navigator)(
|
|
202
|
-
(config ? (staticConfig as StaticConfig<TypeBag>) : undefined) as Config,
|
|
203
|
-
);
|
|
160
|
+
return createNavigatorFactory(BlankStackNavigator)(config);
|
|
204
161
|
}
|
package/src/blank-stack/types.ts
CHANGED
|
@@ -52,10 +52,12 @@ export type BlankStackNavigationHelpers = NavigationHelpers<
|
|
|
52
52
|
>;
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
|
-
*
|
|
55
|
+
* Additional props accepted by the blank stack navigator.
|
|
56
56
|
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
57
|
+
* These can be passed to `<BlankStack.Navigator />` in the dynamic API, and
|
|
58
|
+
* they are also supported as top-level keys in static navigator config.
|
|
59
|
+
*
|
|
60
|
+
* The exported name is kept for backward compatibility.
|
|
59
61
|
*/
|
|
60
62
|
export interface BlankStackFactoryOptions {
|
|
61
63
|
/**
|
|
@@ -120,7 +122,8 @@ export type BlankStackNavigatorProps = DefaultNavigatorOptions<
|
|
|
120
122
|
BlankStackNavigationEventMap,
|
|
121
123
|
BlankStackNavigationProp<ParamListBase>
|
|
122
124
|
> &
|
|
123
|
-
StackRouterOptions
|
|
125
|
+
StackRouterOptions &
|
|
126
|
+
BlankStackFactoryOptions;
|
|
124
127
|
|
|
125
128
|
export type BlankStackDescriptor = Descriptor<
|
|
126
129
|
BlankStackNavigationOptions,
|
|
@@ -98,7 +98,7 @@ function IsolatedComponentStackNavigator(props: ComponentStackNavigatorProps) {
|
|
|
98
98
|
/**
|
|
99
99
|
* @deprecated Component stack was originally introduced for independent,
|
|
100
100
|
* embedded navigation flows. Blank stack now supports that use case directly
|
|
101
|
-
* via
|
|
101
|
+
* via navigator props such as `<BlankStack.Navigator independent />`, with
|
|
102
102
|
* `enableNativeScreens` available when you need to switch between native
|
|
103
103
|
* screens and regular views. Prefer blank stack for new work; component stack
|
|
104
104
|
* will be removed in a future release.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type React from "react";
|
|
2
|
+
import { memo, useLayoutEffect } from "react";
|
|
3
|
+
import type { View } from "react-native";
|
|
4
|
+
import Animated, { useAnimatedRef } from "react-native-reanimated";
|
|
5
|
+
import {
|
|
6
|
+
TARGET_OUTSIDE_OWNER_WARNING,
|
|
7
|
+
useBoundaryOwnerContext,
|
|
8
|
+
} from "../providers/boundary-owner.provider";
|
|
9
|
+
|
|
10
|
+
type BoundaryTargetProps = React.ComponentProps<typeof Animated.View>;
|
|
11
|
+
|
|
12
|
+
export const BoundaryTarget = memo(function BoundaryTarget(
|
|
13
|
+
props: BoundaryTargetProps,
|
|
14
|
+
) {
|
|
15
|
+
const { style, ...rest } = props;
|
|
16
|
+
const targetAnimatedRef = useAnimatedRef<View>();
|
|
17
|
+
const ownerContext = useBoundaryOwnerContext();
|
|
18
|
+
const registerTargetRef = ownerContext?.registerTargetRef;
|
|
19
|
+
const unregisterTargetRef = ownerContext?.unregisterTargetRef;
|
|
20
|
+
const isActiveTarget = ownerContext?.activeTargetRef === targetAnimatedRef;
|
|
21
|
+
|
|
22
|
+
useLayoutEffect(() => {
|
|
23
|
+
if (!registerTargetRef || !unregisterTargetRef) {
|
|
24
|
+
if (__DEV__) {
|
|
25
|
+
console.warn(TARGET_OUTSIDE_OWNER_WARNING);
|
|
26
|
+
}
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
registerTargetRef(targetAnimatedRef);
|
|
31
|
+
return () => {
|
|
32
|
+
unregisterTargetRef(targetAnimatedRef);
|
|
33
|
+
};
|
|
34
|
+
}, [registerTargetRef, unregisterTargetRef, targetAnimatedRef]);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<Animated.View
|
|
38
|
+
{...rest}
|
|
39
|
+
ref={targetAnimatedRef}
|
|
40
|
+
style={[
|
|
41
|
+
style,
|
|
42
|
+
isActiveTarget ? ownerContext.associatedTargetStyles : undefined,
|
|
43
|
+
]}
|
|
44
|
+
collapsable={false}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
});
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type ComponentType,
|
|
3
|
+
forwardRef,
|
|
4
|
+
memo,
|
|
5
|
+
useCallback,
|
|
6
|
+
useImperativeHandle,
|
|
7
|
+
useMemo,
|
|
8
|
+
} from "react";
|
|
9
|
+
import type { View } from "react-native";
|
|
10
|
+
import Animated, {
|
|
11
|
+
runOnUI,
|
|
12
|
+
useAnimatedRef,
|
|
13
|
+
useAnimatedStyle,
|
|
14
|
+
} from "react-native-reanimated";
|
|
15
|
+
import { NO_STYLES } from "../../constants";
|
|
16
|
+
import { useDescriptorDerivations } from "../../providers/screen/descriptors";
|
|
17
|
+
import { useScreenStyles } from "../../providers/screen/styles";
|
|
18
|
+
import { AnimationStore } from "../../stores/animation.store";
|
|
19
|
+
import { BoundStore } from "../../stores/bounds";
|
|
20
|
+
import { prepareStyleForBounds } from "../../utils/bounds/helpers/styles";
|
|
21
|
+
import { useAutoSourceMeasurement } from "./hooks/use-auto-source-measurement";
|
|
22
|
+
import { useBoundaryMeasureAndStore } from "./hooks/use-boundary-measure-and-store";
|
|
23
|
+
import { useBoundaryPresence } from "./hooks/use-boundary-presence";
|
|
24
|
+
import { usePendingDestinationMeasurement } from "./hooks/use-pending-destination-measurement";
|
|
25
|
+
import { usePrepareTransitionMeasurement } from "./hooks/use-prepare-transition-measurement";
|
|
26
|
+
import {
|
|
27
|
+
BoundaryOwnerProvider,
|
|
28
|
+
useBoundaryOwner,
|
|
29
|
+
} from "./providers/boundary-owner.provider";
|
|
30
|
+
import type { BoundaryComponentProps, BoundaryConfigProps } from "./types";
|
|
31
|
+
import { buildBoundaryMatchKey } from "./utils/build-boundary-match-key";
|
|
32
|
+
|
|
33
|
+
interface CreateBoundaryComponentOptions {
|
|
34
|
+
alreadyAnimated?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function createBoundaryComponent<P extends object>(
|
|
38
|
+
Wrapped: ComponentType<P>,
|
|
39
|
+
options: CreateBoundaryComponentOptions = {},
|
|
40
|
+
) {
|
|
41
|
+
const { alreadyAnimated = false } = options;
|
|
42
|
+
const AnimatedComponent = alreadyAnimated
|
|
43
|
+
? Wrapped
|
|
44
|
+
: Animated.createAnimatedComponent(Wrapped);
|
|
45
|
+
|
|
46
|
+
const Inner = forwardRef<
|
|
47
|
+
React.ComponentRef<typeof AnimatedComponent>,
|
|
48
|
+
BoundaryComponentProps<P>
|
|
49
|
+
>((props, forwardedRef) => {
|
|
50
|
+
const ownerRef = useAnimatedRef<View>();
|
|
51
|
+
const {
|
|
52
|
+
enabled = true,
|
|
53
|
+
group,
|
|
54
|
+
id,
|
|
55
|
+
anchor,
|
|
56
|
+
scaleMode,
|
|
57
|
+
target,
|
|
58
|
+
method,
|
|
59
|
+
style,
|
|
60
|
+
onPress,
|
|
61
|
+
...rest
|
|
62
|
+
} = props as any;
|
|
63
|
+
|
|
64
|
+
const sharedBoundTag = buildBoundaryMatchKey({ group, id });
|
|
65
|
+
|
|
66
|
+
const {
|
|
67
|
+
previousScreenKey: preferredSourceScreenKey,
|
|
68
|
+
currentScreenKey,
|
|
69
|
+
nextScreenKey,
|
|
70
|
+
ancestorKeys,
|
|
71
|
+
navigatorKey,
|
|
72
|
+
ancestorNavigatorKeys,
|
|
73
|
+
hasConfiguredInterpolator,
|
|
74
|
+
} = useDescriptorDerivations();
|
|
75
|
+
|
|
76
|
+
const runtimeEnabled = enabled && hasConfiguredInterpolator;
|
|
77
|
+
const hasNextScreen = !!nextScreenKey;
|
|
78
|
+
const boundaryConfig = useMemo<BoundaryConfigProps | undefined>(() => {
|
|
79
|
+
if (
|
|
80
|
+
anchor === undefined &&
|
|
81
|
+
scaleMode === undefined &&
|
|
82
|
+
target === undefined &&
|
|
83
|
+
method === undefined
|
|
84
|
+
) {
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
anchor,
|
|
90
|
+
scaleMode,
|
|
91
|
+
target,
|
|
92
|
+
method,
|
|
93
|
+
};
|
|
94
|
+
}, [anchor, scaleMode, target, method]);
|
|
95
|
+
|
|
96
|
+
const isAnimating = AnimationStore.getValue(currentScreenKey, "animating");
|
|
97
|
+
|
|
98
|
+
const preparedStyles = useMemo(() => prepareStyleForBounds(style), [style]);
|
|
99
|
+
const { elementStylesMap } = useScreenStyles();
|
|
100
|
+
|
|
101
|
+
const associatedStyles = useAnimatedStyle(() => {
|
|
102
|
+
"worklet";
|
|
103
|
+
|
|
104
|
+
const baseStyle =
|
|
105
|
+
(elementStylesMap.value[sharedBoundTag]?.style as
|
|
106
|
+
| Record<string, any>
|
|
107
|
+
| undefined) ?? (NO_STYLES as Record<string, any>);
|
|
108
|
+
|
|
109
|
+
if ("opacity" in baseStyle) {
|
|
110
|
+
return baseStyle;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return { ...baseStyle, opacity: 1 };
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
const associatedStackingStyles = useAnimatedStyle(() => {
|
|
117
|
+
"worklet";
|
|
118
|
+
const baseStyle =
|
|
119
|
+
(elementStylesMap.value[sharedBoundTag]?.style as
|
|
120
|
+
| Record<string, any>
|
|
121
|
+
| undefined) ?? (NO_STYLES as Record<string, any>);
|
|
122
|
+
|
|
123
|
+
return {
|
|
124
|
+
zIndex: (baseStyle.zIndex as number | undefined) ?? 0,
|
|
125
|
+
elevation: (baseStyle.elevation as number | undefined) ?? 0,
|
|
126
|
+
};
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
const { contextValue, measuredRef, hasActiveTarget } = useBoundaryOwner({
|
|
130
|
+
ownerRef,
|
|
131
|
+
associatedTargetStyles: runtimeEnabled ? associatedStyles : undefined,
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
const maybeMeasureAndStore = useBoundaryMeasureAndStore({
|
|
135
|
+
enabled,
|
|
136
|
+
sharedBoundTag,
|
|
137
|
+
preferredSourceScreenKey,
|
|
138
|
+
currentScreenKey,
|
|
139
|
+
ancestorKeys,
|
|
140
|
+
navigatorKey,
|
|
141
|
+
ancestorNavigatorKeys,
|
|
142
|
+
preparedStyles,
|
|
143
|
+
measuredAnimatedRef: measuredRef,
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const shouldRunDestinationEffects = runtimeEnabled && !hasNextScreen;
|
|
147
|
+
|
|
148
|
+
// Register/unregister this boundary in the presence map so source/destination
|
|
149
|
+
// matching can resolve across screens (including ancestor relationships).
|
|
150
|
+
useBoundaryPresence({
|
|
151
|
+
enabled: runtimeEnabled,
|
|
152
|
+
sharedBoundTag,
|
|
153
|
+
currentScreenKey,
|
|
154
|
+
ancestorKeys,
|
|
155
|
+
navigatorKey,
|
|
156
|
+
ancestorNavigatorKeys,
|
|
157
|
+
boundaryConfig,
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// On the source screen, capture source bounds when a matching destination
|
|
161
|
+
// appears on the next screen.
|
|
162
|
+
useAutoSourceMeasurement({
|
|
163
|
+
enabled: runtimeEnabled,
|
|
164
|
+
sharedBoundTag,
|
|
165
|
+
id,
|
|
166
|
+
group,
|
|
167
|
+
nextScreenKey,
|
|
168
|
+
maybeMeasureAndStore,
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
// Destination completion path: do one immediate completion attempt when a
|
|
172
|
+
// pending source link appears, then retry during transition progress if the
|
|
173
|
+
// first attempt races layout readiness.
|
|
174
|
+
usePendingDestinationMeasurement({
|
|
175
|
+
sharedBoundTag,
|
|
176
|
+
enabled: shouldRunDestinationEffects,
|
|
177
|
+
id,
|
|
178
|
+
group,
|
|
179
|
+
currentScreenKey,
|
|
180
|
+
expectedSourceScreenKey: preferredSourceScreenKey,
|
|
181
|
+
animating: isAnimating,
|
|
182
|
+
maybeMeasureAndStore,
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
// Pre-transition measurement path: when this route or its next sibling is
|
|
186
|
+
// about to animate, capture one clean base measurement before progress or
|
|
187
|
+
// transform state mutates.
|
|
188
|
+
usePrepareTransitionMeasurement({
|
|
189
|
+
enabled: runtimeEnabled,
|
|
190
|
+
sharedBoundTag,
|
|
191
|
+
id,
|
|
192
|
+
group,
|
|
193
|
+
currentScreenKey,
|
|
194
|
+
nextScreenKey,
|
|
195
|
+
hasNextScreen,
|
|
196
|
+
maybeMeasureAndStore,
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
const handlePress = useCallback(
|
|
200
|
+
(...args: unknown[]) => {
|
|
201
|
+
// Press path has priority: capture source before user onPress/navigation.
|
|
202
|
+
if (group) {
|
|
203
|
+
runOnUI(BoundStore.setGroupActiveId)(group, String(id));
|
|
204
|
+
}
|
|
205
|
+
runOnUI(maybeMeasureAndStore)({ intent: "capture-source" });
|
|
206
|
+
|
|
207
|
+
if (typeof onPress === "function") {
|
|
208
|
+
onPress(...args);
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
[group, id, maybeMeasureAndStore, onPress],
|
|
212
|
+
);
|
|
213
|
+
|
|
214
|
+
const resolvedOnPress =
|
|
215
|
+
typeof onPress === "function" ? handlePress : undefined;
|
|
216
|
+
|
|
217
|
+
useImperativeHandle(forwardedRef, () => ownerRef.current as any, [
|
|
218
|
+
ownerRef,
|
|
219
|
+
]);
|
|
220
|
+
|
|
221
|
+
return (
|
|
222
|
+
<BoundaryOwnerProvider value={contextValue}>
|
|
223
|
+
<AnimatedComponent
|
|
224
|
+
{...rest}
|
|
225
|
+
ref={ownerRef}
|
|
226
|
+
style={[
|
|
227
|
+
style,
|
|
228
|
+
runtimeEnabled
|
|
229
|
+
? hasActiveTarget
|
|
230
|
+
? associatedStackingStyles
|
|
231
|
+
: associatedStyles
|
|
232
|
+
: undefined,
|
|
233
|
+
]}
|
|
234
|
+
onPress={resolvedOnPress}
|
|
235
|
+
collapsable={false}
|
|
236
|
+
/>
|
|
237
|
+
</BoundaryOwnerProvider>
|
|
238
|
+
);
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
return memo(
|
|
242
|
+
Animated.createAnimatedComponent(Inner),
|
|
243
|
+
) as unknown as React.MemoExoticComponent<
|
|
244
|
+
React.ForwardRefExoticComponent<
|
|
245
|
+
BoundaryComponentProps<P> &
|
|
246
|
+
React.RefAttributes<React.ComponentRef<typeof Wrapped>>
|
|
247
|
+
>
|
|
248
|
+
>;
|
|
249
|
+
}
|
package/src/shared/components/create-boundary-component/helpers/resolve-pending-source-key.ts
CHANGED
|
@@ -7,7 +7,11 @@ export const resolvePendingSourceKey = (
|
|
|
7
7
|
"worklet";
|
|
8
8
|
if (
|
|
9
9
|
expectedSourceScreenKey &&
|
|
10
|
-
BoundStore.hasPendingLinkFromSource(
|
|
10
|
+
(BoundStore.hasPendingLinkFromSource(
|
|
11
|
+
sharedBoundTag,
|
|
12
|
+
expectedSourceScreenKey,
|
|
13
|
+
) ||
|
|
14
|
+
BoundStore.hasSourceLink(sharedBoundTag, expectedSourceScreenKey))
|
|
11
15
|
) {
|
|
12
16
|
return expectedSourceScreenKey;
|
|
13
17
|
}
|