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,4 +1,4 @@
|
|
|
1
|
-
import { interpolate } from "react-native-reanimated";
|
|
1
|
+
import { interpolate, makeMutable } from "react-native-reanimated";
|
|
2
2
|
import {
|
|
3
3
|
EPSILON,
|
|
4
4
|
HIDDEN_STYLE,
|
|
@@ -17,6 +17,8 @@ import type { BoundsOptions } from "../types/options";
|
|
|
17
17
|
import {
|
|
18
18
|
getZoomAnchor,
|
|
19
19
|
toNumber,
|
|
20
|
+
ZOOM_BACKGROUND_SCALE,
|
|
21
|
+
ZOOM_DRAG_DIRECTIONAL_SCALE_EXPONENT,
|
|
20
22
|
ZOOM_DRAG_DIRECTIONAL_SCALE_MAX,
|
|
21
23
|
ZOOM_DRAG_DIRECTIONAL_SCALE_MIN,
|
|
22
24
|
ZOOM_DRAG_RESISTANCE,
|
|
@@ -33,18 +35,22 @@ import {
|
|
|
33
35
|
import type { BuildZoomStylesParams, ZoomInterpolatedStyle } from "./types";
|
|
34
36
|
|
|
35
37
|
const IDENTITY_DRAG_SCALE_OUTPUT = [1, 1] as const;
|
|
38
|
+
const UNFOCUSED_ENTER_FADE_END = 1.6;
|
|
39
|
+
const presentedZoomTagByRoute = makeMutable<Record<string, string>>({});
|
|
36
40
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
/* -------------------------------------------------------------------------- */
|
|
42
|
+
/* LOCAL HELPERS */
|
|
43
|
+
/* -------------------------------------------------------------------------- */
|
|
44
|
+
|
|
45
|
+
function getSourceBorderRadius(resolvedPair: ResolvedTransitionPair): number {
|
|
40
46
|
"worklet";
|
|
41
47
|
|
|
42
48
|
return typeof resolvedPair.sourceStyles?.borderRadius === "number"
|
|
43
49
|
? resolvedPair.sourceStyles.borderRadius
|
|
44
50
|
: 0;
|
|
45
|
-
}
|
|
51
|
+
}
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
function getZoomContentTarget({
|
|
48
54
|
explicitTarget,
|
|
49
55
|
screenLayout,
|
|
50
56
|
anchor,
|
|
@@ -54,7 +60,7 @@ const getZoomContentTarget = ({
|
|
|
54
60
|
screenLayout: Layout;
|
|
55
61
|
anchor: BoundsOptions["anchor"] | undefined;
|
|
56
62
|
resolvedPair: ResolvedTransitionPair;
|
|
57
|
-
})
|
|
63
|
+
}) {
|
|
58
64
|
"worklet";
|
|
59
65
|
|
|
60
66
|
if (explicitTarget) return explicitTarget;
|
|
@@ -90,71 +96,183 @@ const getZoomContentTarget = ({
|
|
|
90
96
|
width: screenWidth,
|
|
91
97
|
height,
|
|
92
98
|
};
|
|
93
|
-
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function resolveDragScaleTuple(
|
|
102
|
+
value:
|
|
103
|
+
| readonly [shrinkMin: number, growMax: number, exponent?: number]
|
|
104
|
+
| undefined,
|
|
105
|
+
) {
|
|
106
|
+
"worklet";
|
|
107
|
+
|
|
108
|
+
return {
|
|
109
|
+
shrinkMin: value?.[0] ?? ZOOM_DRAG_DIRECTIONAL_SCALE_MIN,
|
|
110
|
+
growMax: value?.[1] ?? ZOOM_DRAG_DIRECTIONAL_SCALE_MAX,
|
|
111
|
+
exponent: value?.[2] ?? ZOOM_DRAG_DIRECTIONAL_SCALE_EXPONENT,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function resolveBackgroundScale(value: number | undefined) {
|
|
116
|
+
"worklet";
|
|
117
|
+
|
|
118
|
+
return value ?? ZOOM_BACKGROUND_SCALE;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function resolveEffectiveZoomTag(params: {
|
|
122
|
+
resolvedTag: string;
|
|
123
|
+
activeRouteKey?: string;
|
|
124
|
+
entering: boolean;
|
|
125
|
+
animating: boolean;
|
|
126
|
+
activeProgress: number;
|
|
127
|
+
livePairReady: boolean;
|
|
128
|
+
}) {
|
|
129
|
+
"worklet";
|
|
130
|
+
|
|
131
|
+
const {
|
|
132
|
+
resolvedTag,
|
|
133
|
+
activeRouteKey,
|
|
134
|
+
entering,
|
|
135
|
+
animating,
|
|
136
|
+
activeProgress,
|
|
137
|
+
livePairReady,
|
|
138
|
+
} = params;
|
|
139
|
+
|
|
140
|
+
// Only grouped ids need retarget stabilization. Plain ids should keep their
|
|
141
|
+
// normal behavior with no route-level caching.
|
|
142
|
+
if (!activeRouteKey || !resolvedTag.includes(":")) {
|
|
143
|
+
return resolvedTag;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const cachedTag = presentedZoomTagByRoute.value[activeRouteKey];
|
|
147
|
+
const isFreshOpenFrame = entering && activeProgress <= 0.05;
|
|
148
|
+
const shouldFreezeDuringEnter = entering && animating && !isFreshOpenFrame;
|
|
94
149
|
|
|
95
|
-
|
|
150
|
+
if (!cachedTag || isFreshOpenFrame) {
|
|
151
|
+
presentedZoomTagByRoute.modify((state) => ({
|
|
152
|
+
...state,
|
|
153
|
+
[activeRouteKey]: resolvedTag,
|
|
154
|
+
}));
|
|
155
|
+
return resolvedTag;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (shouldFreezeDuringEnter) {
|
|
159
|
+
return cachedTag;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// After the enter animation, grouped retargeting can still briefly point at a
|
|
163
|
+
// new active id before that tag has usable bounds. Keep presenting the last
|
|
164
|
+
// good tag until the next one is transition-ready.
|
|
165
|
+
if (cachedTag !== resolvedTag && !livePairReady) {
|
|
166
|
+
return cachedTag;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if (cachedTag !== resolvedTag) {
|
|
170
|
+
presentedZoomTagByRoute.modify((state) => ({
|
|
171
|
+
...state,
|
|
172
|
+
[activeRouteKey]: resolvedTag,
|
|
173
|
+
}));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
return resolvedTag;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/* -------------------------------------------------------------------------- */
|
|
180
|
+
/* BUILD ZOOM STYLES */
|
|
181
|
+
/* -------------------------------------------------------------------------- */
|
|
182
|
+
|
|
183
|
+
export function buildZoomStyles({
|
|
96
184
|
resolvedTag,
|
|
97
185
|
zoomOptions,
|
|
98
186
|
props,
|
|
99
|
-
}: BuildZoomStylesParams): ZoomInterpolatedStyle
|
|
187
|
+
}: BuildZoomStylesParams): ZoomInterpolatedStyle {
|
|
100
188
|
"worklet";
|
|
101
189
|
|
|
102
190
|
if (!resolvedTag) return {};
|
|
103
191
|
|
|
104
|
-
|
|
105
|
-
const debug = zoomOptions?.DEBUG === true;
|
|
192
|
+
/* ------------------------------ Shared Setup ------------------------------ */
|
|
106
193
|
|
|
194
|
+
const explicitTarget = zoomOptions?.target;
|
|
107
195
|
const focused = props.focused;
|
|
108
196
|
const progress = props.progress;
|
|
197
|
+
const screenLayout = props.layouts.screen;
|
|
198
|
+
const isEnteringTransition = !props.next;
|
|
199
|
+
const activeRouteKey = props.active.route.key;
|
|
109
200
|
const currentRouteKey = props.current?.route.key;
|
|
110
201
|
const previousRouteKey = props.previous?.route.key;
|
|
111
202
|
const nextRouteKey = props.next?.route.key;
|
|
112
|
-
const entering = !props.next;
|
|
113
|
-
const screenLayout = props.layouts.screen;
|
|
114
203
|
const resolvedZoomAnchor = getZoomAnchor(explicitTarget);
|
|
204
|
+
const liveResolvedPair = BoundStore.resolveTransitionPair(resolvedTag, {
|
|
205
|
+
currentScreenKey: currentRouteKey,
|
|
206
|
+
previousScreenKey: previousRouteKey,
|
|
207
|
+
nextScreenKey: nextRouteKey,
|
|
208
|
+
entering: isEnteringTransition,
|
|
209
|
+
});
|
|
210
|
+
const effectiveTag = resolveEffectiveZoomTag({
|
|
211
|
+
resolvedTag,
|
|
212
|
+
activeRouteKey,
|
|
213
|
+
entering: !!props.active.entering,
|
|
214
|
+
animating: !!props.active.animating,
|
|
215
|
+
activeProgress: props.active.progress,
|
|
216
|
+
livePairReady: !!liveResolvedPair.sourceBounds,
|
|
217
|
+
});
|
|
218
|
+
|
|
115
219
|
const zoomComputeParams = {
|
|
116
|
-
id:
|
|
220
|
+
id: effectiveTag,
|
|
117
221
|
previous: props.previous,
|
|
118
222
|
current: props.current,
|
|
119
223
|
next: props.next,
|
|
120
224
|
progress,
|
|
121
225
|
dimensions: screenLayout,
|
|
122
226
|
} as const;
|
|
227
|
+
|
|
123
228
|
const baseRawOptions = {
|
|
124
|
-
id:
|
|
229
|
+
id: effectiveTag,
|
|
125
230
|
raw: true,
|
|
126
231
|
scaleMode: ZOOM_SHARED_OPTIONS.scaleMode,
|
|
127
232
|
} as const;
|
|
128
233
|
|
|
129
|
-
const resolvedPair =
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
234
|
+
const resolvedPair =
|
|
235
|
+
effectiveTag === resolvedTag
|
|
236
|
+
? liveResolvedPair
|
|
237
|
+
: BoundStore.resolveTransitionPair(effectiveTag, {
|
|
238
|
+
currentScreenKey: currentRouteKey,
|
|
239
|
+
previousScreenKey: previousRouteKey,
|
|
240
|
+
nextScreenKey: nextRouteKey,
|
|
241
|
+
entering: isEnteringTransition,
|
|
242
|
+
});
|
|
135
243
|
|
|
136
244
|
const sourceBorderRadius = getSourceBorderRadius(resolvedPair);
|
|
137
245
|
const targetBorderRadius = zoomOptions?.borderRadius ?? sourceBorderRadius;
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
[resolvedTag]: VISIBLE_STYLE,
|
|
246
|
+
const sourceVisibilityStyle = {
|
|
247
|
+
[effectiveTag]: VISIBLE_STYLE,
|
|
141
248
|
} satisfies TransitionInterpolatedStyle;
|
|
142
|
-
const
|
|
249
|
+
const focusedContentSlot = props.navigationMaskEnabled
|
|
143
250
|
? NAVIGATION_MASK_CONTAINER_STYLE_ID
|
|
144
251
|
: "content";
|
|
145
252
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
//
|
|
149
|
-
|
|
253
|
+
/* --------------------------- Missing Source Guard -------------------------- */
|
|
254
|
+
|
|
255
|
+
// Only the focused entering route should be hidden when source bounds are
|
|
256
|
+
// missing. During grouped retargeting, the unfocused/source route can still be
|
|
257
|
+
// styled by the destination interpolator while the new active member is warming
|
|
258
|
+
// up; hiding there blanks the wrong screen.
|
|
259
|
+
if (focused && !resolvedPair.sourceBounds && props.active.entering) {
|
|
150
260
|
return {
|
|
151
|
-
[
|
|
261
|
+
[focusedContentSlot]: HIDDEN_STYLE,
|
|
152
262
|
};
|
|
153
263
|
}
|
|
154
264
|
|
|
265
|
+
/* --------------------------- Gesture / Drag Values ------------------------- */
|
|
266
|
+
|
|
155
267
|
const normX = props.active.gesture.normX;
|
|
156
268
|
const normY = props.active.gesture.normY;
|
|
157
269
|
const initialDirection = props.active.gesture.direction;
|
|
270
|
+
const isHorizontalDismiss =
|
|
271
|
+
initialDirection === "horizontal" ||
|
|
272
|
+
initialDirection === "horizontal-inverted";
|
|
273
|
+
const isVerticalDismiss =
|
|
274
|
+
initialDirection === "vertical" || initialDirection === "vertical-inverted";
|
|
275
|
+
|
|
158
276
|
const dragX = normalizedToTranslation({
|
|
159
277
|
normalized: normX,
|
|
160
278
|
dimension: screenLayout.width,
|
|
@@ -165,35 +283,40 @@ export const buildZoomStyles = ({
|
|
|
165
283
|
dimension: screenLayout.height,
|
|
166
284
|
resistance: ZOOM_DRAG_RESISTANCE,
|
|
167
285
|
});
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
286
|
+
const horizontalDragScale = resolveDragScaleTuple(
|
|
287
|
+
zoomOptions?.horizontalDragScale,
|
|
288
|
+
);
|
|
289
|
+
const verticalDragScale = resolveDragScaleTuple(
|
|
290
|
+
zoomOptions?.verticalDragScale,
|
|
291
|
+
);
|
|
292
|
+
const backgroundScale = resolveBackgroundScale(zoomOptions?.backgroundScale);
|
|
293
|
+
|
|
294
|
+
const dragXScale = isHorizontalDismiss
|
|
295
|
+
? resolveDirectionalDragScale({
|
|
296
|
+
normalized: normX,
|
|
297
|
+
dismissDirection:
|
|
298
|
+
initialDirection === "horizontal-inverted" ? "negative" : "positive",
|
|
299
|
+
shrinkMin: horizontalDragScale.shrinkMin,
|
|
300
|
+
growMax: horizontalDragScale.growMax,
|
|
301
|
+
exponent: horizontalDragScale.exponent,
|
|
302
|
+
})
|
|
303
|
+
: IDENTITY_DRAG_SCALE_OUTPUT[0];
|
|
304
|
+
const dragYScale = isVerticalDismiss
|
|
305
|
+
? resolveDirectionalDragScale({
|
|
306
|
+
normalized: normY,
|
|
307
|
+
dismissDirection:
|
|
308
|
+
initialDirection === "vertical-inverted" ? "negative" : "positive",
|
|
309
|
+
shrinkMin: verticalDragScale.shrinkMin,
|
|
310
|
+
growMax: verticalDragScale.growMax,
|
|
311
|
+
exponent: verticalDragScale.exponent,
|
|
312
|
+
})
|
|
313
|
+
: IDENTITY_DRAG_SCALE_OUTPUT[1];
|
|
193
314
|
const dragScale = combineScales(dragXScale, dragYScale);
|
|
194
315
|
|
|
316
|
+
/* ----------------------------- Focused Screen ----------------------------- */
|
|
317
|
+
|
|
195
318
|
if (focused) {
|
|
196
|
-
const
|
|
319
|
+
const focusedContentTarget = getZoomContentTarget({
|
|
197
320
|
explicitTarget,
|
|
198
321
|
screenLayout,
|
|
199
322
|
anchor: ZOOM_SHARED_OPTIONS.anchor,
|
|
@@ -206,7 +329,7 @@ export const buildZoomStyles = ({
|
|
|
206
329
|
...baseRawOptions,
|
|
207
330
|
anchor: resolvedZoomAnchor,
|
|
208
331
|
method: "content",
|
|
209
|
-
target:
|
|
332
|
+
target: focusedContentTarget,
|
|
210
333
|
},
|
|
211
334
|
resolvedPair,
|
|
212
335
|
) as Record<string, unknown>;
|
|
@@ -224,8 +347,8 @@ export const buildZoomStyles = ({
|
|
|
224
347
|
) as Record<string, unknown>;
|
|
225
348
|
|
|
226
349
|
const focusedFade = props.active?.closing
|
|
227
|
-
? interpolate(progress, [0.6, 1], [0,
|
|
228
|
-
: interpolate(progress, [0, 0.5], [0,
|
|
350
|
+
? interpolate(progress, [0.6, 1], [0, 1], "clamp")
|
|
351
|
+
: interpolate(progress, [0, 0.5], [0, 1], "clamp");
|
|
229
352
|
|
|
230
353
|
/**
|
|
231
354
|
* This is also how swiftui handles their navigation zoom.
|
|
@@ -247,6 +370,7 @@ export const buildZoomStyles = ({
|
|
|
247
370
|
const contentScale = toNumber(contentRaw.scale, 1) * dragScale;
|
|
248
371
|
const maskTranslateX = toNumber(maskRaw.translateX) + dragX - left;
|
|
249
372
|
const maskTranslateY = toNumber(maskRaw.translateY) + dragY - top;
|
|
373
|
+
|
|
250
374
|
const focusedContentStyle = {
|
|
251
375
|
opacity: focusedFade,
|
|
252
376
|
transform: [
|
|
@@ -259,10 +383,10 @@ export const buildZoomStyles = ({
|
|
|
259
383
|
};
|
|
260
384
|
|
|
261
385
|
const focusedStyles: ZoomInterpolatedStyle = {
|
|
262
|
-
[
|
|
386
|
+
[focusedContentSlot]: {
|
|
263
387
|
style: focusedContentStyle,
|
|
264
388
|
},
|
|
265
|
-
...
|
|
389
|
+
...sourceVisibilityStyle,
|
|
266
390
|
};
|
|
267
391
|
|
|
268
392
|
if (props.navigationMaskEnabled) {
|
|
@@ -283,22 +407,32 @@ export const buildZoomStyles = ({
|
|
|
283
407
|
return focusedStyles;
|
|
284
408
|
}
|
|
285
409
|
|
|
286
|
-
|
|
287
|
-
? interpolate(progress, [1.6, 2], [1, debug ? 1 : 0], "clamp")
|
|
288
|
-
: interpolate(progress, [1, 1.5], [1, debug ? 1 : 0], "clamp");
|
|
410
|
+
/* ---------------------------- Unfocused Screen ---------------------------- */
|
|
289
411
|
|
|
290
|
-
const
|
|
412
|
+
const unfocusedFade = props.active?.closing
|
|
413
|
+
? interpolate(progress, [1.9, 2], [1, 0], "clamp")
|
|
414
|
+
: interpolate(progress, [1, 2], [1, 0], "clamp");
|
|
415
|
+
const unfocusedScale = interpolate(
|
|
416
|
+
progress,
|
|
417
|
+
[1, 2],
|
|
418
|
+
[1, backgroundScale],
|
|
419
|
+
"clamp",
|
|
420
|
+
);
|
|
291
421
|
const isUnfocusedIdle = props.active.settled === 1;
|
|
292
|
-
const shouldHideUnfocusedIdle = isUnfocusedIdle
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
422
|
+
const shouldHideUnfocusedIdle = isUnfocusedIdle;
|
|
423
|
+
const didSourceComponentVisiblyHide =
|
|
424
|
+
!props.active.closing && unfocusedFade <= EPSILON;
|
|
425
|
+
|
|
426
|
+
const shouldResetUnfocusedElement =
|
|
427
|
+
!props.active.closing &&
|
|
428
|
+
(props.active.logicallySettled || didSourceComponentVisiblyHide);
|
|
429
|
+
|
|
430
|
+
const unfocusedElementTarget = getZoomContentTarget({
|
|
431
|
+
explicitTarget,
|
|
432
|
+
screenLayout,
|
|
433
|
+
anchor: ZOOM_SHARED_OPTIONS.anchor,
|
|
434
|
+
resolvedPair,
|
|
435
|
+
});
|
|
302
436
|
|
|
303
437
|
const elementRaw = computeBoundStyles(
|
|
304
438
|
zoomComputeParams,
|
|
@@ -307,10 +441,11 @@ export const buildZoomStyles = ({
|
|
|
307
441
|
anchor: resolvedZoomAnchor,
|
|
308
442
|
method: "transform",
|
|
309
443
|
space: "relative",
|
|
310
|
-
target:
|
|
444
|
+
target: unfocusedElementTarget,
|
|
311
445
|
},
|
|
312
446
|
resolvedPair,
|
|
313
447
|
) as Record<string, unknown>;
|
|
448
|
+
|
|
314
449
|
const boundTargetCenterX =
|
|
315
450
|
explicitTarget === "bound" && resolvedPair.destinationBounds
|
|
316
451
|
? resolvedPair.destinationBounds.pageX +
|
|
@@ -321,16 +456,18 @@ export const buildZoomStyles = ({
|
|
|
321
456
|
? resolvedPair.destinationBounds.pageY +
|
|
322
457
|
resolvedPair.destinationBounds.height / 2
|
|
323
458
|
: undefined;
|
|
459
|
+
|
|
324
460
|
const elementCenterX =
|
|
325
461
|
boundTargetCenterX ??
|
|
326
|
-
(typeof
|
|
327
|
-
?
|
|
462
|
+
(typeof unfocusedElementTarget === "object"
|
|
463
|
+
? unfocusedElementTarget.pageX + unfocusedElementTarget.width / 2
|
|
328
464
|
: screenLayout.width / 2);
|
|
329
465
|
const elementCenterY =
|
|
330
466
|
boundTargetCenterY ??
|
|
331
|
-
(typeof
|
|
332
|
-
?
|
|
467
|
+
(typeof unfocusedElementTarget === "object"
|
|
468
|
+
? unfocusedElementTarget.pageY + unfocusedElementTarget.height / 2
|
|
333
469
|
: screenLayout.height / 2);
|
|
470
|
+
|
|
334
471
|
const scaleShiftX = computeCenterScaleShift({
|
|
335
472
|
center: elementCenterX,
|
|
336
473
|
containerCenter: screenLayout.width / 2,
|
|
@@ -341,6 +478,7 @@ export const buildZoomStyles = ({
|
|
|
341
478
|
containerCenter: screenLayout.height / 2,
|
|
342
479
|
scale: dragScale,
|
|
343
480
|
});
|
|
481
|
+
|
|
344
482
|
const compensatedGestureX = composeCompensatedTranslation({
|
|
345
483
|
gesture: dragX,
|
|
346
484
|
parentScale: unfocusedScale,
|
|
@@ -353,12 +491,14 @@ export const buildZoomStyles = ({
|
|
|
353
491
|
centerShift: scaleShiftY,
|
|
354
492
|
epsilon: EPSILON,
|
|
355
493
|
});
|
|
494
|
+
|
|
356
495
|
const elementTranslateX =
|
|
357
496
|
toNumber(elementRaw.translateX) + compensatedGestureX;
|
|
358
497
|
const elementTranslateY =
|
|
359
498
|
toNumber(elementRaw.translateY) + compensatedGestureY;
|
|
360
499
|
const elementScaleX = toNumber(elementRaw.scaleX, 1) * dragScale;
|
|
361
500
|
const elementScaleY = toNumber(elementRaw.scaleY, 1) * dragScale;
|
|
501
|
+
|
|
362
502
|
const resolvedElementStyle = shouldHideUnfocusedIdle
|
|
363
503
|
? {
|
|
364
504
|
transform: [
|
|
@@ -374,31 +514,19 @@ export const buildZoomStyles = ({
|
|
|
374
514
|
: {
|
|
375
515
|
transform: [
|
|
376
516
|
{
|
|
377
|
-
translateX:
|
|
378
|
-
props.active.logicallySettled && !props.active.closing
|
|
379
|
-
? 0
|
|
380
|
-
: elementTranslateX,
|
|
517
|
+
translateX: shouldResetUnfocusedElement ? 0 : elementTranslateX,
|
|
381
518
|
},
|
|
382
519
|
{
|
|
383
|
-
translateY:
|
|
384
|
-
props.active.logicallySettled && !props.active.closing
|
|
385
|
-
? 0
|
|
386
|
-
: elementTranslateY,
|
|
520
|
+
translateY: shouldResetUnfocusedElement ? 0 : elementTranslateY,
|
|
387
521
|
},
|
|
388
522
|
{
|
|
389
|
-
scaleX:
|
|
390
|
-
props.active.logicallySettled && !props.active.closing
|
|
391
|
-
? 1
|
|
392
|
-
: elementScaleX,
|
|
523
|
+
scaleX: shouldResetUnfocusedElement ? 1 : elementScaleX,
|
|
393
524
|
},
|
|
394
525
|
{
|
|
395
|
-
scaleY:
|
|
396
|
-
props.active.logicallySettled && !props.active.closing
|
|
397
|
-
? 1
|
|
398
|
-
: elementScaleY,
|
|
526
|
+
scaleY: shouldResetUnfocusedElement ? 1 : elementScaleY,
|
|
399
527
|
},
|
|
400
528
|
],
|
|
401
|
-
opacity:
|
|
529
|
+
opacity: unfocusedFade,
|
|
402
530
|
zIndex: 9999,
|
|
403
531
|
elevation: 9999,
|
|
404
532
|
};
|
|
@@ -409,8 +537,8 @@ export const buildZoomStyles = ({
|
|
|
409
537
|
transform: [{ scale: unfocusedScale }],
|
|
410
538
|
},
|
|
411
539
|
},
|
|
412
|
-
[
|
|
540
|
+
[effectiveTag]: {
|
|
413
541
|
style: resolvedElementStyle,
|
|
414
542
|
},
|
|
415
543
|
};
|
|
416
|
-
}
|
|
544
|
+
}
|
|
@@ -8,6 +8,8 @@ export const ZOOM_SHARED_OPTIONS = Object.freeze({
|
|
|
8
8
|
export const ZOOM_DRAG_RESISTANCE = 0.4;
|
|
9
9
|
export const ZOOM_DRAG_DIRECTIONAL_SCALE_MIN = 0.25;
|
|
10
10
|
export const ZOOM_DRAG_DIRECTIONAL_SCALE_MAX = 1.06;
|
|
11
|
+
export const ZOOM_DRAG_DIRECTIONAL_SCALE_EXPONENT = 2;
|
|
12
|
+
export const ZOOM_BACKGROUND_SCALE = 0.9375;
|
|
11
13
|
|
|
12
14
|
export const ZOOM_MASK_OUTSET = Object.freeze({
|
|
13
15
|
top: 0,
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useDeferredMeasurementTrigger = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactNativeReanimated = require("react-native-reanimated");
|
|
9
|
-
const useDeferredMeasurementTrigger = params => {
|
|
10
|
-
const {
|
|
11
|
-
enabled,
|
|
12
|
-
isAnimating,
|
|
13
|
-
canFlush,
|
|
14
|
-
onFlush
|
|
15
|
-
} = params;
|
|
16
|
-
const hasPendingMeasurement = (0, _reactNativeReanimated.useSharedValue)(false);
|
|
17
|
-
const clearPendingMeasurement = (0, _react.useCallback)(() => {
|
|
18
|
-
"worklet";
|
|
19
|
-
|
|
20
|
-
hasPendingMeasurement.value = false;
|
|
21
|
-
}, [hasPendingMeasurement]);
|
|
22
|
-
const queueOrFlushMeasurement = (0, _react.useCallback)(() => {
|
|
23
|
-
"worklet";
|
|
24
|
-
|
|
25
|
-
if (!enabled) return;
|
|
26
|
-
if (isAnimating.value) {
|
|
27
|
-
hasPendingMeasurement.value = true;
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
hasPendingMeasurement.value = false;
|
|
31
|
-
onFlush();
|
|
32
|
-
}, [enabled, isAnimating, hasPendingMeasurement, onFlush]);
|
|
33
|
-
(0, _reactNativeReanimated.useAnimatedReaction)(() => {
|
|
34
|
-
"worklet";
|
|
35
|
-
|
|
36
|
-
if (!enabled) return false;
|
|
37
|
-
if (!hasPendingMeasurement.value) return false;
|
|
38
|
-
if (isAnimating.value) return false;
|
|
39
|
-
return canFlush ? canFlush() : true;
|
|
40
|
-
}, (shouldFlush, previousShouldFlush) => {
|
|
41
|
-
"worklet";
|
|
42
|
-
|
|
43
|
-
if (!enabled) return;
|
|
44
|
-
if (!shouldFlush || shouldFlush === previousShouldFlush) return;
|
|
45
|
-
hasPendingMeasurement.value = false;
|
|
46
|
-
onFlush();
|
|
47
|
-
}, [enabled, isAnimating, hasPendingMeasurement, canFlush, onFlush]);
|
|
48
|
-
return {
|
|
49
|
-
clearPendingMeasurement,
|
|
50
|
-
queueOrFlushMeasurement
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
exports.useDeferredMeasurementTrigger = useDeferredMeasurementTrigger;
|
|
54
|
-
//# sourceMappingURL=use-deferred-measurement-trigger.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_react","require","_reactNativeReanimated","useDeferredMeasurementTrigger","params","enabled","isAnimating","canFlush","onFlush","hasPendingMeasurement","useSharedValue","clearPendingMeasurement","useCallback","value","queueOrFlushMeasurement","useAnimatedReaction","shouldFlush","previousShouldFlush","exports"],"sourceRoot":"../../../../../../src","sources":["shared/components/create-boundary-component/hooks/use-deferred-measurement-trigger.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAMO,MAAME,6BAA6B,GAAIC,MAK7C,IAAK;EACL,MAAM;IAAEC,OAAO;IAAEC,WAAW;IAAEC,QAAQ;IAAEC;EAAQ,CAAC,GAAGJ,MAAM;EAC1D,MAAMK,qBAAqB,GAAG,IAAAC,qCAAc,EAAC,KAAK,CAAC;EAEnD,MAAMC,uBAAuB,GAAG,IAAAC,kBAAW,EAAC,MAAM;IACjD,SAAS;;IACTH,qBAAqB,CAACI,KAAK,GAAG,KAAK;EACpC,CAAC,EAAE,CAACJ,qBAAqB,CAAC,CAAC;EAE3B,MAAMK,uBAAuB,GAAG,IAAAF,kBAAW,EAAC,MAAM;IACjD,SAAS;;IACT,IAAI,CAACP,OAAO,EAAE;IAEd,IAAIC,WAAW,CAACO,KAAK,EAAE;MACtBJ,qBAAqB,CAACI,KAAK,GAAG,IAAI;MAClC;IACD;IAEAJ,qBAAqB,CAACI,KAAK,GAAG,KAAK;IACnCL,OAAO,CAAC,CAAC;EACV,CAAC,EAAE,CAACH,OAAO,EAAEC,WAAW,EAAEG,qBAAqB,EAAED,OAAO,CAAC,CAAC;EAE1D,IAAAO,0CAAmB,EAClB,MAAM;IACL,SAAS;;IACT,IAAI,CAACV,OAAO,EAAE,OAAO,KAAK;IAC1B,IAAI,CAACI,qBAAqB,CAACI,KAAK,EAAE,OAAO,KAAK;IAC9C,IAAIP,WAAW,CAACO,KAAK,EAAE,OAAO,KAAK;IACnC,OAAON,QAAQ,GAAGA,QAAQ,CAAC,CAAC,GAAG,IAAI;EACpC,CAAC,EACD,CAACS,WAAW,EAAEC,mBAAmB,KAAK;IACrC,SAAS;;IACT,IAAI,CAACZ,OAAO,EAAE;IACd,IAAI,CAACW,WAAW,IAAIA,WAAW,KAAKC,mBAAmB,EAAE;IAEzDR,qBAAqB,CAACI,KAAK,GAAG,KAAK;IACnCL,OAAO,CAAC,CAAC;EACV,CAAC,EACD,CAACH,OAAO,EAAEC,WAAW,EAAEG,qBAAqB,EAAEF,QAAQ,EAAEC,OAAO,CAChE,CAAC;EAED,OAAO;IACNG,uBAAuB;IACvBG;EACD,CAAC;AACF,CAAC;AAACI,OAAA,CAAAf,6BAAA,GAAAA,6BAAA","ignoreList":[]}
|