react-native-screen-transitions 3.9.0-beta.2 → 3.9.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js +19 -14
- package/lib/commonjs/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +14 -7
- package/lib/commonjs/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +32 -2
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js +4 -3
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js +3 -2
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +2 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +2 -3
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +1 -0
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js +1 -3
- package/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/portal/teleport.js +2 -1
- package/lib/commonjs/shared/components/boundary/portal/teleport.js.map +1 -1
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js +16 -3
- package/lib/commonjs/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/commonjs/shared/constants.js +4 -0
- package/lib/commonjs/shared/constants.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
- package/lib/commonjs/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
- package/lib/commonjs/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
- package/lib/commonjs/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +25 -3
- package/lib/commonjs/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
- package/lib/commonjs/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
- package/lib/commonjs/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js +2 -0
- package/lib/commonjs/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/gestures/shared/values.js +2 -0
- package/lib/commonjs/shared/providers/screen/gestures/shared/values.js.map +1 -1
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +11 -0
- package/lib/commonjs/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/commonjs/shared/stores/gesture.store.js +8 -0
- package/lib/commonjs/shared/stores/gesture.store.js.map +1 -1
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js +24 -7
- package/lib/commonjs/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +2 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +177 -314
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js +12 -18
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js +196 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +94 -108
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js +72 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js +55 -0
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
- package/lib/module/shared/components/boundary/components/boundary-target.js +20 -15
- package/lib/module/shared/components/boundary/components/boundary-target.js.map +1 -1
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js +14 -7
- package/lib/module/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js +2 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/components/host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js +32 -2
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js +5 -4
- package/lib/module/shared/components/boundary/portal/components/boundary-content-portal/index.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js +3 -2
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +3 -2
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js +3 -4
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js +1 -0
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js +1 -3
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/index.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/teleport.js +1 -0
- package/lib/module/shared/components/boundary/portal/teleport.js.map +1 -1
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js +17 -4
- package/lib/module/shared/components/boundary/providers/boundary-root.provider.js.map +1 -1
- package/lib/module/shared/constants.js +4 -0
- package/lib/module/shared/constants.js.map +1 -1
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js +4 -0
- package/lib/module/shared/providers/screen/animation/helpers/hydrate-transition-state/index.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js +10 -10
- package/lib/module/shared/providers/screen/gestures/pan/activation/use-pan-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js +10 -2
- package/lib/module/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js +1 -1
- package/lib/module/shared/providers/screen/gestures/pan/use-build-pan-gesture.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js +23 -2
- package/lib/module/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js +4 -6
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js +2 -2
- package/lib/module/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js +6 -1
- package/lib/module/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/snapshot.js +2 -0
- package/lib/module/shared/providers/screen/gestures/shared/snapshot.js.map +1 -1
- package/lib/module/shared/providers/screen/gestures/shared/values.js +2 -0
- package/lib/module/shared/providers/screen/gestures/shared/values.js.map +1 -1
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js +11 -0
- package/lib/module/shared/providers/screen/styles/hooks/use-maybe-block-visibility.js.map +1 -1
- package/lib/module/shared/stores/gesture.store.js +8 -0
- package/lib/module/shared/stores/gesture.store.js.map +1 -1
- package/lib/module/shared/types/bounds.types.js +26 -0
- package/lib/module/shared/types/bounds.types.js.map +1 -1
- package/lib/module/shared/utils/animation/animate-to-progress.js +24 -7
- package/lib/module/shared/utils/animation/animate-to-progress.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js +2 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js +181 -318
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/config.js +11 -17
- package/lib/module/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/drag.js +184 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/drag.js.map +1 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +91 -102
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/mask.js +67 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/mask.js.map +1 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/targets.js +50 -0
- package/lib/module/shared/utils/bounds/navigation/zoom/targets.js.map +1 -0
- package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts +3 -1
- package/lib/typescript/shared/components/boundary/components/boundary-target.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/components/host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts +1 -3
- package/lib/typescript/shared/components/boundary/portal/components/boundary-content-portal/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts +2 -3
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts +2 -3
- package/lib/typescript/shared/components/boundary/portal/components/boundary-portal/index.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts +1 -0
- package/lib/typescript/shared/components/boundary/portal/teleport.d.ts.map +1 -1
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts +1 -0
- package/lib/typescript/shared/components/boundary/providers/boundary-root.provider.d.ts.map +1 -1
- package/lib/typescript/shared/constants.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +1 -1
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/animation/helpers/hydrate-transition-state/index.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts +2 -0
- package/lib/typescript/shared/providers/screen/gestures/pan/activation/use-pan-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts +2 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pan/use-build-pan-gesture.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts +2 -0
- package/lib/typescript/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/snapshot.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/gestures/shared/values.d.ts.map +1 -1
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts +4 -0
- package/lib/typescript/shared/providers/screen/styles/hooks/use-maybe-block-visibility.d.ts.map +1 -1
- package/lib/typescript/shared/stores/gesture.store.d.ts +4 -0
- package/lib/typescript/shared/stores/gesture.store.d.ts.map +1 -1
- package/lib/typescript/shared/types/bounds.types.d.ts +115 -88
- package/lib/typescript/shared/types/bounds.types.d.ts.map +1 -1
- package/lib/typescript/shared/types/gesture.types.d.ts +10 -0
- package/lib/typescript/shared/types/gesture.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/utils/animation/animate-to-progress.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/build.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts +7 -17
- package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts +55 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/drag.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +31 -34
- package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts +25 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts +16 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts.map +1 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/shared/components/boundary/components/boundary-target.tsx +37 -26
- package/src/shared/components/boundary/hooks/lifecycles/use-initial-destination-measurement.ts +16 -13
- package/src/shared/components/boundary/portal/components/boundary-content-portal/components/host.tsx +6 -2
- package/src/shared/components/boundary/portal/components/boundary-content-portal/hooks/use-boundary-content-portal-attachment.ts +46 -3
- package/src/shared/components/boundary/portal/components/boundary-content-portal/index.tsx +8 -5
- package/src/shared/components/boundary/portal/components/boundary-portal/components/host.tsx +3 -2
- package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +3 -2
- package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-slot.tsx +4 -5
- package/src/shared/components/boundary/portal/components/boundary-portal/hooks/use-boundary-portal-attachment.ts +5 -1
- package/src/shared/components/boundary/portal/components/boundary-portal/index.tsx +1 -4
- package/src/shared/components/boundary/portal/teleport.ts +1 -0
- package/src/shared/components/boundary/providers/boundary-root.provider.tsx +23 -3
- package/src/shared/constants.ts +4 -0
- package/src/shared/index.ts +2 -0
- package/src/shared/providers/screen/animation/helpers/hydrate-transition-state/index.ts +8 -0
- package/src/shared/providers/screen/gestures/pan/activation/use-pan-activation.ts +16 -7
- package/src/shared/providers/screen/gestures/pan/behavior/use-pan-behavior.ts +18 -1
- package/src/shared/providers/screen/gestures/pan/use-build-pan-gesture.ts +1 -0
- package/src/shared/providers/screen/gestures/pinch/activation/use-pinch-activation.ts +40 -2
- package/src/shared/providers/screen/gestures/pinch/behavior/pinch-lifecycle.ts +7 -11
- package/src/shared/providers/screen/gestures/pinch/behavior/use-pinch-behavior.ts +12 -15
- package/src/shared/providers/screen/gestures/scroll-coordination/use-scroll-gesture-coordination.ts +6 -1
- package/src/shared/providers/screen/gestures/shared/snapshot.ts +2 -0
- package/src/shared/providers/screen/gestures/shared/values.ts +2 -0
- package/src/shared/providers/screen/styles/hooks/use-maybe-block-visibility.tsx +14 -1
- package/src/shared/stores/gesture.store.ts +12 -0
- package/src/shared/types/bounds.types.ts +119 -90
- package/src/shared/types/gesture.types.ts +10 -0
- package/src/shared/types/index.ts +2 -0
- package/src/shared/utils/animation/animate-to-progress.ts +23 -7
- package/src/shared/utils/bounds/navigation/reveal/math.ts +2 -1
- package/src/shared/utils/bounds/navigation/zoom/build.ts +223 -411
- package/src/shared/utils/bounds/navigation/zoom/config.ts +15 -18
- package/src/shared/utils/bounds/navigation/zoom/drag.ts +327 -0
- package/src/shared/utils/bounds/navigation/zoom/helpers.ts +122 -184
- package/src/shared/utils/bounds/navigation/zoom/mask.ts +130 -0
- package/src/shared/utils/bounds/navigation/zoom/targets.ts +74 -0
- package/src/shared/utils/bounds/navigation/zoom/types.ts +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js +0 -25
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/math.js +0 -20
- package/lib/module/shared/utils/bounds/navigation/zoom/math.js.map +0 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts +0 -8
- package/lib/typescript/shared/utils/bounds/navigation/zoom/math.d.ts.map +0 -1
- package/src/shared/utils/bounds/navigation/zoom/math.ts +0 -25
|
@@ -2,73 +2,40 @@ import { interpolate } from "react-native-reanimated";
|
|
|
2
2
|
import {
|
|
3
3
|
EPSILON,
|
|
4
4
|
NAVIGATION_MASK_ELEMENT_STYLE_ID,
|
|
5
|
-
VISIBLE_STYLE,
|
|
6
5
|
} from "../../../../constants";
|
|
7
|
-
import type { TransitionInterpolatedStyle } from "../../../../types/animation.types";
|
|
8
6
|
import { createBoundsAccessorCore } from "../../helpers/create-bounds-accessor-core";
|
|
9
|
-
import { getSourceBorderRadius
|
|
7
|
+
import { getSourceBorderRadius } from "../helpers";
|
|
8
|
+
import { resolveRevealContentBaseTransform } from "../reveal/math";
|
|
10
9
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
computeCenterScaleShift,
|
|
14
|
-
resolveDirectionalDragScale,
|
|
15
|
-
resolveOpacityRangeTuple,
|
|
16
|
-
} from "../math";
|
|
17
|
-
import {
|
|
18
|
-
resolveDismissScaleHandoff,
|
|
19
|
-
resolveRevealGestureHandoff,
|
|
20
|
-
} from "../reveal/math";
|
|
21
|
-
import {
|
|
22
|
-
ZOOM_DISMISS_SCALE_ORBIT_DEPTH,
|
|
10
|
+
ZOOM_BACKDROP_MAX_OPACITY,
|
|
11
|
+
ZOOM_BACKGROUND_SCALE,
|
|
23
12
|
ZOOM_FOCUSED_ELEMENT_CLOSE_OPACITY_RANGE,
|
|
24
13
|
ZOOM_FOCUSED_ELEMENT_OPEN_OPACITY_RANGE,
|
|
25
|
-
|
|
14
|
+
ZOOM_SCREEN_A_FADE_END,
|
|
26
15
|
ZOOM_SHARED_OPTIONS,
|
|
27
16
|
ZOOM_UNFOCUSED_ELEMENT_CLOSE_OPACITY_RANGE,
|
|
28
17
|
ZOOM_UNFOCUSED_ELEMENT_OPEN_OPACITY_RANGE,
|
|
29
18
|
} from "./config";
|
|
19
|
+
import { resolveZoomDragState, resolveZoomTrackedGestureScale } from "./drag";
|
|
30
20
|
import {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
resolveDragScaleTuple,
|
|
35
|
-
resolveDragTranslationTuple,
|
|
36
|
-
resolveZoomPanGestureDirection,
|
|
21
|
+
resolveZoomBackdropOpacity,
|
|
22
|
+
resolveZoomPinchFocalOffset,
|
|
23
|
+
resolveZoomTrackedSourceTransform,
|
|
37
24
|
} from "./helpers";
|
|
38
|
-
import {
|
|
25
|
+
import {
|
|
26
|
+
resolveZoomNavigationMaskStyle,
|
|
27
|
+
ZOOM_NAVIGATION_MASK_BORDER_RADIUS,
|
|
28
|
+
} from "./mask";
|
|
29
|
+
import {
|
|
30
|
+
getZoomContentTarget,
|
|
31
|
+
resolveZoomTrackingContentTarget,
|
|
32
|
+
} from "./targets";
|
|
39
33
|
import type { BuildZoomStylesParams, ZoomInterpolatedStyle } from "./types";
|
|
40
34
|
|
|
41
|
-
const IDENTITY_DRAG_SCALE_OUTPUT = [1, 1] as const;
|
|
42
|
-
|
|
43
|
-
function resolveZoomGestureOptions({
|
|
44
|
-
rawDrag,
|
|
45
|
-
maxSensitivity,
|
|
46
|
-
}: {
|
|
47
|
-
rawDrag: number;
|
|
48
|
-
maxSensitivity: number;
|
|
49
|
-
}) {
|
|
50
|
-
"worklet";
|
|
51
|
-
|
|
52
|
-
const { gestureSensitivity, gestureReleaseVelocityScale } =
|
|
53
|
-
resolveRevealGestureHandoff({
|
|
54
|
-
rawDrag,
|
|
55
|
-
maxSensitivity,
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
gestureSensitivity,
|
|
60
|
-
gestureReleaseVelocityScale,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/* -------------------------------------------------------------------------- */
|
|
65
|
-
/* BUILD ZOOM STYLES */
|
|
66
|
-
/* -------------------------------------------------------------------------- */
|
|
67
|
-
|
|
68
35
|
export function buildZoomStyles({
|
|
69
36
|
tag,
|
|
70
|
-
zoomOptions,
|
|
71
37
|
props,
|
|
38
|
+
zoomOptions,
|
|
72
39
|
}: BuildZoomStylesParams): ZoomInterpolatedStyle {
|
|
73
40
|
"worklet";
|
|
74
41
|
|
|
@@ -76,424 +43,269 @@ export function buildZoomStyles({
|
|
|
76
43
|
return {};
|
|
77
44
|
}
|
|
78
45
|
|
|
79
|
-
/* ------------------------------ Shared Setup ------------------------------ */
|
|
80
|
-
|
|
81
46
|
const target = zoomOptions?.target;
|
|
47
|
+
const keepFocusedVisible = zoomOptions?.keepFocusedVisible === true;
|
|
48
|
+
const expandedBorderRadius = Math.max(
|
|
49
|
+
0,
|
|
50
|
+
zoomOptions?.borderRadius ?? ZOOM_NAVIGATION_MASK_BORDER_RADIUS,
|
|
51
|
+
);
|
|
52
|
+
const backgroundScale = zoomOptions?.backgroundScale ?? ZOOM_BACKGROUND_SCALE;
|
|
53
|
+
const backdropColor = zoomOptions?.backdropColor ?? "black";
|
|
54
|
+
const maxBackdropOpacity =
|
|
55
|
+
zoomOptions?.backdropOpacity ?? ZOOM_BACKDROP_MAX_OPACITY;
|
|
56
|
+
|
|
82
57
|
const {
|
|
58
|
+
active,
|
|
59
|
+
current,
|
|
83
60
|
focused,
|
|
61
|
+
transitionProgress,
|
|
84
62
|
layouts: { screen: screenLayout },
|
|
85
63
|
} = props;
|
|
86
|
-
const transitionProgress =
|
|
87
|
-
props.current.transitionProgress + (props.next?.transitionProgress ?? 0);
|
|
88
|
-
const activeTransitionProgress = props.active.transitionProgress;
|
|
89
64
|
|
|
90
|
-
const
|
|
65
|
+
const activeTransitionProgress = active.transitionProgress;
|
|
91
66
|
|
|
92
67
|
const bounds = createBoundsAccessorCore({
|
|
93
68
|
getProps: () => props,
|
|
94
69
|
});
|
|
70
|
+
|
|
95
71
|
const scopedBounds = bounds(tag);
|
|
96
72
|
const link = scopedBounds.link();
|
|
73
|
+
const sourceBounds = link?.source?.bounds;
|
|
74
|
+
|
|
75
|
+
if (!link || !sourceBounds) {
|
|
76
|
+
if (target !== "bound") {
|
|
77
|
+
scopedBounds.values({
|
|
78
|
+
scaleMode: ZOOM_SHARED_OPTIONS.scaleMode,
|
|
79
|
+
anchor: ZOOM_SHARED_OPTIONS.anchor,
|
|
80
|
+
method: "content",
|
|
81
|
+
target: target ?? "fullscreen",
|
|
82
|
+
progress: transitionProgress,
|
|
83
|
+
});
|
|
84
|
+
}
|
|
97
85
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
const baseRawOptions = {
|
|
101
|
-
scaleMode: ZOOM_SHARED_OPTIONS.scaleMode,
|
|
102
|
-
} as const;
|
|
103
|
-
|
|
104
|
-
const buildEffectiveTag = link.id;
|
|
105
|
-
const sourceBorderRadius = getSourceBorderRadius(link);
|
|
106
|
-
const targetBorderRadius = zoomOptions?.borderRadius ?? sourceBorderRadius;
|
|
107
|
-
const focusedElementOpacity = {
|
|
108
|
-
open: resolveOpacityRangeTuple({
|
|
109
|
-
value: zoomOptions?.focusedElementOpacity?.open,
|
|
110
|
-
fallback: ZOOM_FOCUSED_ELEMENT_OPEN_OPACITY_RANGE,
|
|
111
|
-
}),
|
|
112
|
-
close: resolveOpacityRangeTuple({
|
|
113
|
-
value: zoomOptions?.focusedElementOpacity?.close,
|
|
114
|
-
fallback: ZOOM_FOCUSED_ELEMENT_CLOSE_OPACITY_RANGE,
|
|
115
|
-
}),
|
|
116
|
-
};
|
|
117
|
-
const unfocusedElementOpacity = {
|
|
118
|
-
open: resolveOpacityRangeTuple({
|
|
119
|
-
value: zoomOptions?.unfocusedElementOpacity?.open,
|
|
120
|
-
fallback: ZOOM_UNFOCUSED_ELEMENT_OPEN_OPACITY_RANGE,
|
|
121
|
-
}),
|
|
122
|
-
close: resolveOpacityRangeTuple({
|
|
123
|
-
value: zoomOptions?.unfocusedElementOpacity?.close,
|
|
124
|
-
fallback: ZOOM_UNFOCUSED_ELEMENT_CLOSE_OPACITY_RANGE,
|
|
125
|
-
}),
|
|
126
|
-
};
|
|
127
|
-
const sourceVisibilityStyle = {
|
|
128
|
-
[buildEffectiveTag]: {
|
|
129
|
-
style: VISIBLE_STYLE,
|
|
130
|
-
},
|
|
131
|
-
} satisfies TransitionInterpolatedStyle;
|
|
132
|
-
const navigationMaskEnabled = props.current.options.navigationMaskEnabled;
|
|
133
|
-
const maxSensitivity = zoomOptions?.maxSensitivity ?? 0.8;
|
|
134
|
-
const velocityDepth =
|
|
135
|
-
zoomOptions?.velocityDepth ?? ZOOM_DISMISS_SCALE_ORBIT_DEPTH;
|
|
136
|
-
|
|
137
|
-
/* --------------------------- Gesture / Drag Values ------------------------- */
|
|
86
|
+
return {};
|
|
87
|
+
}
|
|
138
88
|
|
|
139
|
-
const
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
const initialGesture = resolveZoomPanGestureDirection({
|
|
144
|
-
active: gestureHandoff.active,
|
|
145
|
-
direction: gestureHandoff.direction,
|
|
146
|
-
normX,
|
|
147
|
-
normY,
|
|
148
|
-
rawNormX: gestureHandoff.raw.normX,
|
|
149
|
-
rawNormY: gestureHandoff.raw.normY,
|
|
89
|
+
const zoomContentTarget = getZoomContentTarget({
|
|
90
|
+
explicitTarget: target,
|
|
91
|
+
screenLayout,
|
|
92
|
+
link,
|
|
150
93
|
});
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
const rawDrag = isHorizontalDismiss
|
|
156
|
-
? Math.abs(gestureHandoff.raw.normX)
|
|
157
|
-
: isVerticalDismiss
|
|
158
|
-
? Math.abs(gestureHandoff.raw.normY)
|
|
159
|
-
: 0;
|
|
160
|
-
|
|
161
|
-
const horizontalDragTranslation = resolveDragTranslationTuple(
|
|
162
|
-
zoomOptions?.horizontalDragTranslation,
|
|
163
|
-
);
|
|
164
|
-
const verticalDragTranslation = resolveDragTranslationTuple(
|
|
165
|
-
zoomOptions?.verticalDragTranslation,
|
|
166
|
-
);
|
|
167
|
-
const dragX = resolveDirectionalDragTranslation({
|
|
168
|
-
translation: liveGesture.x,
|
|
169
|
-
dimension: screenLayout.width,
|
|
170
|
-
negativeMax: horizontalDragTranslation.negativeMax,
|
|
171
|
-
positiveMax: horizontalDragTranslation.positiveMax,
|
|
172
|
-
exponent: horizontalDragTranslation.exponent,
|
|
94
|
+
const trackingContentTarget = resolveZoomTrackingContentTarget({
|
|
95
|
+
contentTarget: zoomContentTarget,
|
|
96
|
+
link,
|
|
97
|
+
screenLayout,
|
|
173
98
|
});
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
99
|
+
|
|
100
|
+
if (!trackingContentTarget) {
|
|
101
|
+
return {};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const drag = resolveZoomDragState({
|
|
105
|
+
gesture: active.gesture,
|
|
106
|
+
activeTransitionProgress,
|
|
107
|
+
screenLayout,
|
|
108
|
+
sourceBounds,
|
|
109
|
+
trackingContentTarget,
|
|
110
|
+
dragOptions: zoomOptions?.drag,
|
|
180
111
|
});
|
|
181
|
-
const horizontalDragScale = resolveDragScaleTuple(
|
|
182
|
-
zoomOptions?.horizontalDragScale,
|
|
183
|
-
);
|
|
184
|
-
const verticalDragScale = resolveDragScaleTuple(
|
|
185
|
-
zoomOptions?.verticalDragScale,
|
|
186
|
-
);
|
|
187
|
-
const backgroundScale = resolveBackgroundScale(zoomOptions?.backgroundScale);
|
|
188
112
|
|
|
189
|
-
const
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
growMax: horizontalDragScale.growMax,
|
|
196
|
-
exponent: horizontalDragScale.exponent,
|
|
197
|
-
})
|
|
198
|
-
: IDENTITY_DRAG_SCALE_OUTPUT[0];
|
|
199
|
-
const dragYScale = isVerticalDismiss
|
|
200
|
-
? resolveDirectionalDragScale({
|
|
201
|
-
normalized: normY,
|
|
202
|
-
dismissDirection:
|
|
203
|
-
initialGesture === "vertical-inverted" ? "negative" : "positive",
|
|
204
|
-
shrinkMin: verticalDragScale.shrinkMin,
|
|
205
|
-
growMax: verticalDragScale.growMax,
|
|
206
|
-
exponent: verticalDragScale.exponent,
|
|
207
|
-
})
|
|
208
|
-
: IDENTITY_DRAG_SCALE_OUTPUT[1];
|
|
209
|
-
const dragScale = combineScales(dragXScale, dragYScale);
|
|
210
|
-
const handoffDragScale = props.active.gesture.dismissing
|
|
211
|
-
? resolveDismissScaleHandoff({
|
|
212
|
-
progress: activeTransitionProgress,
|
|
213
|
-
releaseScale: dragScale,
|
|
214
|
-
targetScale: 1,
|
|
215
|
-
velocity: gestureHandoff.velocity,
|
|
216
|
-
velocityDepth,
|
|
217
|
-
})
|
|
218
|
-
: dragScale;
|
|
219
|
-
const zoomGestureOptions = resolveZoomGestureOptions({
|
|
220
|
-
rawDrag,
|
|
221
|
-
maxSensitivity,
|
|
113
|
+
const trackedGestureScale = resolveZoomTrackedGestureScale({
|
|
114
|
+
drag,
|
|
115
|
+
activeTransitionProgress,
|
|
116
|
+
screenLayout,
|
|
117
|
+
sourceBounds,
|
|
118
|
+
trackingContentTarget,
|
|
222
119
|
});
|
|
223
120
|
|
|
224
|
-
|
|
121
|
+
const focalGesture = drag.isDismissing
|
|
122
|
+
? active.gesture.handoff
|
|
123
|
+
: active.gesture;
|
|
124
|
+
|
|
125
|
+
const focalProgress = drag.isDismissing ? activeTransitionProgress : 1;
|
|
126
|
+
const pinchFocalOffset =
|
|
127
|
+
active.gesture.handoff.active === "pinch-in"
|
|
128
|
+
? resolveZoomPinchFocalOffset({
|
|
129
|
+
gestureScale: drag.isDismissing
|
|
130
|
+
? focalGesture.scale
|
|
131
|
+
: trackedGestureScale,
|
|
132
|
+
pinchOriginX: focalGesture.pinchOriginX,
|
|
133
|
+
pinchOriginY: focalGesture.pinchOriginY,
|
|
134
|
+
progress: focalProgress,
|
|
135
|
+
rotation: drag.isDismissing ? focalGesture.rotation : drag.rotation,
|
|
136
|
+
screenLayout,
|
|
137
|
+
})
|
|
138
|
+
: { x: 0, y: 0 };
|
|
225
139
|
|
|
226
140
|
if (focused) {
|
|
227
|
-
const
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
141
|
+
const sourceBorderRadius = getSourceBorderRadius(link);
|
|
142
|
+
const navigationMaskEnabled = current.options.navigationMaskEnabled;
|
|
143
|
+
const backdropOpacity = resolveZoomBackdropOpacity({
|
|
144
|
+
transitionProgress,
|
|
145
|
+
dismissalDrag: drag.dismissNorm,
|
|
146
|
+
fadeEnd: ZOOM_SCREEN_A_FADE_END,
|
|
147
|
+
maxOpacity: maxBackdropOpacity,
|
|
232
148
|
});
|
|
233
149
|
|
|
234
150
|
const contentRaw = scopedBounds.values({
|
|
235
|
-
|
|
236
|
-
anchor:
|
|
151
|
+
scaleMode: ZOOM_SHARED_OPTIONS.scaleMode,
|
|
152
|
+
anchor: target === "bound" ? "center" : ZOOM_SHARED_OPTIONS.anchor,
|
|
237
153
|
method: "content",
|
|
238
|
-
target:
|
|
154
|
+
target: zoomContentTarget,
|
|
239
155
|
progress: transitionProgress,
|
|
240
156
|
});
|
|
241
157
|
|
|
242
|
-
const
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
method: "size",
|
|
246
|
-
space: "absolute",
|
|
247
|
-
target: "fullscreen",
|
|
248
|
-
progress: transitionProgress,
|
|
249
|
-
});
|
|
158
|
+
const focusedOpacityRange = active.closing
|
|
159
|
+
? ZOOM_FOCUSED_ELEMENT_CLOSE_OPACITY_RANGE
|
|
160
|
+
: ZOOM_FOCUSED_ELEMENT_OPEN_OPACITY_RANGE;
|
|
250
161
|
|
|
251
|
-
const focusedFade =
|
|
252
|
-
? interpolateOpacityRange({
|
|
253
|
-
progress: transitionProgress,
|
|
254
|
-
range: focusedElementOpacity.close,
|
|
255
|
-
})
|
|
256
|
-
: interpolateOpacityRange({
|
|
257
|
-
progress: transitionProgress,
|
|
258
|
-
range: focusedElementOpacity.open,
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* This is also how swiftui handles their navigation zoom.
|
|
263
|
-
* They remove clipping as soon as the screen stops animating
|
|
264
|
-
*/
|
|
265
|
-
const shouldRemoveClipping = !props.active.animating;
|
|
266
|
-
const focusedMaskBorderRadius = interpolate(
|
|
162
|
+
const focusedFade = interpolate(
|
|
267
163
|
transitionProgress,
|
|
268
|
-
[0, 1],
|
|
269
|
-
[
|
|
164
|
+
[focusedOpacityRange[0], focusedOpacityRange[1]],
|
|
165
|
+
[focusedOpacityRange[2], focusedOpacityRange[3]],
|
|
270
166
|
"clamp",
|
|
271
167
|
);
|
|
272
168
|
|
|
273
|
-
const
|
|
274
|
-
const
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
const maskCenterX = maskWidth / 2;
|
|
289
|
-
const maskCenterY = maskHeight / 2;
|
|
290
|
-
const contentCenterX = screenLayout.width / 2;
|
|
291
|
-
const contentCenterY = screenLayout.height / 2;
|
|
292
|
-
const compensatedMaskTranslateX =
|
|
293
|
-
(maskBaseTranslateX -
|
|
294
|
-
contentBaseTranslateX +
|
|
295
|
-
(1 - contentBaseScale) * (maskCenterX - contentCenterX)) /
|
|
296
|
-
safeContentBaseScale;
|
|
297
|
-
const compensatedMaskTranslateY =
|
|
298
|
-
(maskBaseTranslateY -
|
|
299
|
-
contentBaseTranslateY +
|
|
300
|
-
(1 - contentBaseScale) * (maskCenterY - contentCenterY)) /
|
|
301
|
-
safeContentBaseScale;
|
|
302
|
-
const compensatedMaskScale = 1 / safeContentBaseScale;
|
|
169
|
+
const contentBaseTranslateX = contentRaw.translateX;
|
|
170
|
+
const contentBaseTranslateY = contentRaw.translateY;
|
|
171
|
+
const contentBaseScale = contentRaw.scale;
|
|
172
|
+
|
|
173
|
+
const contentTranslateX =
|
|
174
|
+
contentBaseTranslateX +
|
|
175
|
+
drag.dragX +
|
|
176
|
+
pinchFocalOffset.x * contentBaseScale;
|
|
177
|
+
const contentTranslateY =
|
|
178
|
+
contentBaseTranslateY +
|
|
179
|
+
drag.dragY +
|
|
180
|
+
pinchFocalOffset.y * contentBaseScale;
|
|
181
|
+
const contentScale = drag.isDismissing
|
|
182
|
+
? drag.dismissContentScale
|
|
183
|
+
: contentBaseScale * drag.gestureScale;
|
|
303
184
|
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
{ translateX: contentTranslateX },
|
|
308
|
-
{ translateY: contentTranslateY },
|
|
309
|
-
{ scale: contentScale },
|
|
310
|
-
],
|
|
311
|
-
...(navigationMaskEnabled
|
|
312
|
-
? {}
|
|
313
|
-
: {
|
|
314
|
-
borderRadius: focusedMaskBorderRadius,
|
|
315
|
-
overflow: "hidden" as const,
|
|
316
|
-
}),
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
const focusedStyles: ZoomInterpolatedStyle = {
|
|
320
|
-
content: {
|
|
321
|
-
style: focusedContentStyle,
|
|
185
|
+
return {
|
|
186
|
+
options: {
|
|
187
|
+
gestureReleaseVelocityScale: 0.5,
|
|
322
188
|
},
|
|
323
|
-
|
|
324
|
-
};
|
|
325
|
-
|
|
326
|
-
if (navigationMaskEnabled) {
|
|
327
|
-
focusedStyles[NAVIGATION_MASK_ELEMENT_STYLE_ID] = {
|
|
189
|
+
backdrop: {
|
|
328
190
|
style: {
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
191
|
+
backgroundColor: backdropColor,
|
|
192
|
+
opacity: backdropOpacity,
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
content: {
|
|
196
|
+
style: {
|
|
197
|
+
...(keepFocusedVisible ? {} : { opacity: focusedFade }),
|
|
332
198
|
transform: [
|
|
333
|
-
{ translateX:
|
|
334
|
-
{ translateY:
|
|
335
|
-
{ scale:
|
|
199
|
+
{ translateX: contentTranslateX },
|
|
200
|
+
{ translateY: contentTranslateY },
|
|
201
|
+
{ scale: contentScale },
|
|
202
|
+
{ rotateZ: `${drag.rotation}rad` },
|
|
336
203
|
],
|
|
204
|
+
borderRadius: interpolate(
|
|
205
|
+
transitionProgress,
|
|
206
|
+
[0, 1],
|
|
207
|
+
[sourceBorderRadius, active.animating ? expandedBorderRadius : 0],
|
|
208
|
+
"clamp",
|
|
209
|
+
),
|
|
210
|
+
overflow: "hidden" as const,
|
|
337
211
|
},
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
212
|
+
},
|
|
213
|
+
[NAVIGATION_MASK_ELEMENT_STYLE_ID]: navigationMaskEnabled
|
|
214
|
+
? resolveZoomNavigationMaskStyle({
|
|
215
|
+
scopedBounds,
|
|
216
|
+
link,
|
|
217
|
+
sourceBounds,
|
|
218
|
+
screenLayout,
|
|
219
|
+
transitionProgress,
|
|
220
|
+
drag,
|
|
221
|
+
contentTransform: contentRaw,
|
|
222
|
+
sourceBorderRadius,
|
|
223
|
+
expandedBorderRadius,
|
|
224
|
+
active,
|
|
225
|
+
})
|
|
226
|
+
: {},
|
|
344
227
|
};
|
|
345
228
|
}
|
|
346
229
|
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
range: unfocusedElementOpacity.open,
|
|
357
|
-
});
|
|
230
|
+
const unfocusedOpacityRange = active.closing
|
|
231
|
+
? ZOOM_UNFOCUSED_ELEMENT_CLOSE_OPACITY_RANGE
|
|
232
|
+
: ZOOM_UNFOCUSED_ELEMENT_OPEN_OPACITY_RANGE;
|
|
233
|
+
const unfocusedFade = interpolate(
|
|
234
|
+
transitionProgress,
|
|
235
|
+
[unfocusedOpacityRange[0], unfocusedOpacityRange[1]],
|
|
236
|
+
[unfocusedOpacityRange[2], unfocusedOpacityRange[3]],
|
|
237
|
+
"clamp",
|
|
238
|
+
);
|
|
358
239
|
const unfocusedScale = interpolate(
|
|
359
240
|
transitionProgress,
|
|
360
241
|
[1, 2],
|
|
361
242
|
[1, backgroundScale],
|
|
362
243
|
"clamp",
|
|
363
244
|
);
|
|
364
|
-
const didSourceComponentVisiblyHide =
|
|
365
|
-
!props.active.closing && unfocusedFade <= EPSILON;
|
|
366
|
-
|
|
367
|
-
const shouldHideUnfocusedElement =
|
|
368
|
-
!props.active.closing && didSourceComponentVisiblyHide;
|
|
369
|
-
|
|
370
|
-
const unfocusedElementTarget = getZoomContentTarget({
|
|
371
|
-
explicitTarget: target,
|
|
372
|
-
screenLayout,
|
|
373
|
-
anchor: ZOOM_SHARED_OPTIONS.anchor,
|
|
374
|
-
link,
|
|
375
|
-
});
|
|
376
|
-
|
|
377
|
-
const elementRaw = scopedBounds.values({
|
|
378
|
-
...baseRawOptions,
|
|
379
|
-
anchor: zoomAnchor,
|
|
380
|
-
method: "transform",
|
|
381
|
-
space: "relative",
|
|
382
|
-
target: unfocusedElementTarget,
|
|
383
|
-
progress: transitionProgress,
|
|
384
|
-
});
|
|
385
245
|
|
|
386
|
-
const
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
: undefined;
|
|
394
|
-
|
|
395
|
-
const elementCenterX =
|
|
396
|
-
boundTargetCenterX ??
|
|
397
|
-
(typeof unfocusedElementTarget === "object"
|
|
398
|
-
? unfocusedElementTarget.pageX + unfocusedElementTarget.width / 2
|
|
399
|
-
: screenLayout.width / 2);
|
|
400
|
-
const elementCenterY =
|
|
401
|
-
boundTargetCenterY ??
|
|
402
|
-
(typeof unfocusedElementTarget === "object"
|
|
403
|
-
? unfocusedElementTarget.pageY + unfocusedElementTarget.height / 2
|
|
404
|
-
: screenLayout.height / 2);
|
|
405
|
-
|
|
406
|
-
const unfocusedContentScale = props.active.settled ? 1 : unfocusedScale;
|
|
407
|
-
const shouldTrackGestureTranslation = !props.active.settled;
|
|
408
|
-
const shouldTrackGestureScale = !props.active.settled;
|
|
409
|
-
const elementGestureScale = shouldTrackGestureScale ? handoffDragScale : 1;
|
|
410
|
-
const elementGestureX = shouldTrackGestureTranslation ? dragX : 0;
|
|
411
|
-
const elementGestureY = shouldTrackGestureTranslation ? dragY : 0;
|
|
412
|
-
const safeUnfocusedContentScale = Math.max(
|
|
413
|
-
Math.abs(unfocusedContentScale),
|
|
414
|
-
EPSILON,
|
|
415
|
-
);
|
|
416
|
-
// A naturally settled close can leave this as the last emitted style frame,
|
|
417
|
-
// so drop temporary stacking here instead of waiting for a later reset pass.
|
|
418
|
-
const shouldElevateUnfocusedElement =
|
|
419
|
-
!props.active.closing || !props.active.settled;
|
|
246
|
+
const shouldHideSource = !active.closing && unfocusedFade <= EPSILON;
|
|
247
|
+
const unfocusedContentScale = active.settled ? 1 : unfocusedScale;
|
|
248
|
+
const unfocusedContent = {
|
|
249
|
+
style: {
|
|
250
|
+
transform: [{ scale: unfocusedContentScale }],
|
|
251
|
+
},
|
|
252
|
+
};
|
|
420
253
|
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
254
|
+
// To avoid measuring a component from a bad position,
|
|
255
|
+
// we'll want to hide + reset this component when the animation has reached a visual settling point
|
|
256
|
+
if (shouldHideSource || active.settled) {
|
|
257
|
+
return {
|
|
258
|
+
content: unfocusedContent,
|
|
259
|
+
[link.id]: {
|
|
260
|
+
style: {
|
|
261
|
+
transform: [
|
|
262
|
+
{ translateX: 0 },
|
|
263
|
+
{ translateY: 0 },
|
|
264
|
+
{ scaleX: 1 },
|
|
265
|
+
{ scaleY: 1 },
|
|
266
|
+
],
|
|
267
|
+
opacity: shouldHideSource ? 0 : unfocusedFade,
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
}
|
|
431
272
|
|
|
432
|
-
const
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
});
|
|
438
|
-
const
|
|
439
|
-
|
|
273
|
+
const trackedContentBaseScale = resolveRevealContentBaseTransform({
|
|
274
|
+
progress: activeTransitionProgress,
|
|
275
|
+
sourceBounds,
|
|
276
|
+
destinationBounds: trackingContentTarget,
|
|
277
|
+
screenLayout,
|
|
278
|
+
}).scale;
|
|
279
|
+
const trackedDragX =
|
|
280
|
+
drag.dragX + pinchFocalOffset.x * trackedContentBaseScale;
|
|
281
|
+
const trackedDragY =
|
|
282
|
+
drag.dragY + pinchFocalOffset.y * trackedContentBaseScale;
|
|
283
|
+
|
|
284
|
+
const trackedSourceElement = resolveZoomTrackedSourceTransform({
|
|
285
|
+
progress: activeTransitionProgress,
|
|
286
|
+
sourceBounds,
|
|
287
|
+
destinationBounds: trackingContentTarget,
|
|
288
|
+
screenLayout,
|
|
289
|
+
dragX: trackedDragX,
|
|
290
|
+
dragY: trackedDragY,
|
|
291
|
+
gestureScale: trackedGestureScale,
|
|
440
292
|
parentScale: unfocusedContentScale,
|
|
441
|
-
|
|
442
|
-
epsilon: EPSILON,
|
|
293
|
+
rotation: drag.rotation,
|
|
443
294
|
});
|
|
444
295
|
|
|
445
|
-
const elementTranslateX =
|
|
446
|
-
toNumber(elementRaw.translateX) + compensatedGestureX;
|
|
447
|
-
const elementTranslateY =
|
|
448
|
-
toNumber(elementRaw.translateY) + compensatedGestureY;
|
|
449
|
-
const elementScaleX =
|
|
450
|
-
(toNumber(elementRaw.scaleX, 1) * elementGestureScale) /
|
|
451
|
-
safeUnfocusedContentScale;
|
|
452
|
-
const elementScaleY =
|
|
453
|
-
(toNumber(elementRaw.scaleY, 1) * elementGestureScale) /
|
|
454
|
-
safeUnfocusedContentScale;
|
|
455
|
-
|
|
456
|
-
const resolvedElementStyle = shouldHideUnfocusedElement
|
|
457
|
-
? {
|
|
458
|
-
transform: [
|
|
459
|
-
{ translateX: 0 },
|
|
460
|
-
{ translateY: 0 },
|
|
461
|
-
{ scaleX: 1 },
|
|
462
|
-
{ scaleY: 1 },
|
|
463
|
-
],
|
|
464
|
-
opacity: zoomOptions?.debug ? 1 : 0,
|
|
465
|
-
zIndex: 0,
|
|
466
|
-
elevation: 0,
|
|
467
|
-
}
|
|
468
|
-
: {
|
|
469
|
-
transform: [
|
|
470
|
-
{
|
|
471
|
-
translateX: elementTranslateX,
|
|
472
|
-
},
|
|
473
|
-
{
|
|
474
|
-
translateY: elementTranslateY,
|
|
475
|
-
},
|
|
476
|
-
{
|
|
477
|
-
scaleX: elementScaleX,
|
|
478
|
-
},
|
|
479
|
-
{
|
|
480
|
-
scaleY: elementScaleY,
|
|
481
|
-
},
|
|
482
|
-
],
|
|
483
|
-
opacity: zoomOptions?.debug ? 1 : unfocusedFade,
|
|
484
|
-
zIndex: shouldElevateUnfocusedElement ? 9999 : 0,
|
|
485
|
-
elevation: shouldElevateUnfocusedElement ? 9999 : 0,
|
|
486
|
-
};
|
|
487
|
-
|
|
488
296
|
return {
|
|
489
|
-
|
|
490
|
-
|
|
297
|
+
content: unfocusedContent,
|
|
298
|
+
[link.id]: {
|
|
491
299
|
style: {
|
|
492
|
-
transform: [
|
|
300
|
+
transform: [
|
|
301
|
+
{ translateX: trackedSourceElement.translateX },
|
|
302
|
+
{ translateY: trackedSourceElement.translateY },
|
|
303
|
+
{ rotateZ: `${drag.rotation}rad` },
|
|
304
|
+
{ scaleX: trackedSourceElement.scaleX },
|
|
305
|
+
{ scaleY: trackedSourceElement.scaleY },
|
|
306
|
+
],
|
|
307
|
+
opacity: unfocusedFade,
|
|
493
308
|
},
|
|
494
309
|
},
|
|
495
|
-
[buildEffectiveTag]: {
|
|
496
|
-
style: resolvedElementStyle,
|
|
497
|
-
},
|
|
498
310
|
};
|
|
499
311
|
}
|