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
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { MeasuredDimensions } from "react-native-reanimated";
|
|
2
|
+
import { interpolate } from "react-native-reanimated";
|
|
3
|
+
import type {
|
|
4
|
+
ScreenTransitionState,
|
|
5
|
+
TransitionSlotStyle,
|
|
6
|
+
} from "../../../../types/animation.types";
|
|
7
|
+
import type {
|
|
8
|
+
BoundsLink,
|
|
9
|
+
BoundsScopedAccessor,
|
|
10
|
+
} from "../../../../types/bounds.types";
|
|
11
|
+
import type { Layout } from "../../../../types/screen.types";
|
|
12
|
+
import { toNumber } from "../helpers";
|
|
13
|
+
import { DRAG_MASK_HEIGHT_COLLAPSE_END } from "../reveal/config";
|
|
14
|
+
import {
|
|
15
|
+
interpolateClamped,
|
|
16
|
+
resolveAspectRatioMaskHeight,
|
|
17
|
+
} from "../reveal/math";
|
|
18
|
+
import { ZOOM_SHARED_OPTIONS } from "./config";
|
|
19
|
+
import type { ZoomDragState } from "./drag";
|
|
20
|
+
|
|
21
|
+
export const ZOOM_NAVIGATION_MASK_BORDER_RADIUS = 64;
|
|
22
|
+
const ZOOM_VERTICAL_DRAG_MASK_COLLAPSE_SCALE = 0.8;
|
|
23
|
+
|
|
24
|
+
interface ZoomNavigationMaskStyleProps {
|
|
25
|
+
scopedBounds: BoundsScopedAccessor;
|
|
26
|
+
link: BoundsLink;
|
|
27
|
+
sourceBounds: MeasuredDimensions;
|
|
28
|
+
screenLayout: Layout;
|
|
29
|
+
transitionProgress: number;
|
|
30
|
+
drag: ZoomDragState;
|
|
31
|
+
contentTransform: {
|
|
32
|
+
translateX: number;
|
|
33
|
+
translateY: number;
|
|
34
|
+
scale: number;
|
|
35
|
+
};
|
|
36
|
+
sourceBorderRadius: number;
|
|
37
|
+
expandedBorderRadius: number;
|
|
38
|
+
active: ScreenTransitionState;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function resolveZoomNavigationMaskStyle({
|
|
42
|
+
scopedBounds,
|
|
43
|
+
link,
|
|
44
|
+
sourceBounds,
|
|
45
|
+
screenLayout,
|
|
46
|
+
transitionProgress,
|
|
47
|
+
drag,
|
|
48
|
+
contentTransform,
|
|
49
|
+
sourceBorderRadius,
|
|
50
|
+
expandedBorderRadius,
|
|
51
|
+
active,
|
|
52
|
+
}: ZoomNavigationMaskStyleProps): TransitionSlotStyle {
|
|
53
|
+
"worklet";
|
|
54
|
+
|
|
55
|
+
const maskRaw = scopedBounds.values({
|
|
56
|
+
scaleMode: ZOOM_SHARED_OPTIONS.scaleMode,
|
|
57
|
+
anchor: ZOOM_SHARED_OPTIONS.anchor,
|
|
58
|
+
method: "size",
|
|
59
|
+
space: "absolute",
|
|
60
|
+
target: "fullscreen",
|
|
61
|
+
progress: transitionProgress,
|
|
62
|
+
});
|
|
63
|
+
const maskWidth = maskRaw.width;
|
|
64
|
+
const maskHeight = maskRaw.height;
|
|
65
|
+
const maskAspectBounds = link.initialSource?.bounds ?? sourceBounds;
|
|
66
|
+
const minMaskHeight = resolveAspectRatioMaskHeight({
|
|
67
|
+
maskWidth,
|
|
68
|
+
maskHeight,
|
|
69
|
+
targetWidth: maskAspectBounds.width,
|
|
70
|
+
targetHeight: maskAspectBounds.height,
|
|
71
|
+
});
|
|
72
|
+
const maskHeightCollapseDrag = drag.collapsesMask
|
|
73
|
+
? Math.max(
|
|
74
|
+
0,
|
|
75
|
+
drag.dismissNorm * ZOOM_VERTICAL_DRAG_MASK_COLLAPSE_SCALE,
|
|
76
|
+
drag.dismissProgress,
|
|
77
|
+
)
|
|
78
|
+
: 0;
|
|
79
|
+
const renderedMaskHeight = interpolateClamped(
|
|
80
|
+
maskHeightCollapseDrag,
|
|
81
|
+
0,
|
|
82
|
+
DRAG_MASK_HEIGHT_COLLAPSE_END,
|
|
83
|
+
maskHeight,
|
|
84
|
+
minMaskHeight,
|
|
85
|
+
);
|
|
86
|
+
const maskCenterX = maskWidth / 2;
|
|
87
|
+
const maskCenterY = renderedMaskHeight / 2;
|
|
88
|
+
const contentCenterX = screenLayout.width / 2;
|
|
89
|
+
const contentCenterY = screenLayout.height / 2;
|
|
90
|
+
const maskOriginOffsetY = drag.isVerticalInverted
|
|
91
|
+
? maskHeight - renderedMaskHeight
|
|
92
|
+
: 0;
|
|
93
|
+
const compensatedMaskTranslateX =
|
|
94
|
+
(maskRaw.translateX -
|
|
95
|
+
contentTransform.translateX +
|
|
96
|
+
(1 - contentTransform.scale) * (maskCenterX - contentCenterX)) /
|
|
97
|
+
contentTransform.scale;
|
|
98
|
+
const compensatedMaskTranslateY =
|
|
99
|
+
(maskRaw.translateY -
|
|
100
|
+
contentTransform.translateY +
|
|
101
|
+
maskOriginOffsetY +
|
|
102
|
+
(1 - contentTransform.scale) * (maskCenterY - contentCenterY)) /
|
|
103
|
+
contentTransform.scale;
|
|
104
|
+
const initialSourceBorderRadius = toNumber(
|
|
105
|
+
link.initialSource?.styles.borderRadius,
|
|
106
|
+
sourceBorderRadius,
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
style: {
|
|
111
|
+
width: maskWidth,
|
|
112
|
+
height: renderedMaskHeight,
|
|
113
|
+
borderRadius: interpolate(
|
|
114
|
+
transitionProgress,
|
|
115
|
+
[0, 1],
|
|
116
|
+
[
|
|
117
|
+
initialSourceBorderRadius,
|
|
118
|
+
active.animating ? expandedBorderRadius : 0,
|
|
119
|
+
],
|
|
120
|
+
"clamp",
|
|
121
|
+
),
|
|
122
|
+
borderCurve: "continuous",
|
|
123
|
+
transform: [
|
|
124
|
+
{ translateX: compensatedMaskTranslateX },
|
|
125
|
+
{ translateY: compensatedMaskTranslateY },
|
|
126
|
+
{ scale: 1 / contentTransform.scale },
|
|
127
|
+
],
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { MeasuredDimensions } from "react-native-reanimated";
|
|
2
|
+
import type {
|
|
3
|
+
BoundsLink,
|
|
4
|
+
BoundsNavigationZoomOptions,
|
|
5
|
+
} from "../../../../types/bounds.types";
|
|
6
|
+
import type { Layout } from "../../../../types/screen.types";
|
|
7
|
+
|
|
8
|
+
type ZoomContentTarget = Exclude<
|
|
9
|
+
BoundsNavigationZoomOptions["target"],
|
|
10
|
+
undefined
|
|
11
|
+
>;
|
|
12
|
+
|
|
13
|
+
export function getZoomContentTarget({
|
|
14
|
+
explicitTarget,
|
|
15
|
+
screenLayout,
|
|
16
|
+
link,
|
|
17
|
+
}: {
|
|
18
|
+
explicitTarget: BoundsNavigationZoomOptions["target"];
|
|
19
|
+
screenLayout: Layout;
|
|
20
|
+
link: BoundsLink;
|
|
21
|
+
}): ZoomContentTarget {
|
|
22
|
+
"worklet";
|
|
23
|
+
|
|
24
|
+
if (explicitTarget !== undefined) {
|
|
25
|
+
return explicitTarget;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const sourceBounds = link.source?.bounds;
|
|
29
|
+
const screenWidth = screenLayout.width;
|
|
30
|
+
|
|
31
|
+
if (!sourceBounds || sourceBounds.width <= 0 || screenWidth <= 0) {
|
|
32
|
+
return "fullscreen";
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const height = (sourceBounds.height / sourceBounds.width) * screenWidth;
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
x: 0,
|
|
39
|
+
y: 0,
|
|
40
|
+
pageX: 0,
|
|
41
|
+
pageY: 0,
|
|
42
|
+
width: screenWidth,
|
|
43
|
+
height,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function resolveZoomTrackingContentTarget({
|
|
48
|
+
contentTarget,
|
|
49
|
+
link,
|
|
50
|
+
screenLayout,
|
|
51
|
+
}: {
|
|
52
|
+
contentTarget: ZoomContentTarget;
|
|
53
|
+
link: BoundsLink;
|
|
54
|
+
screenLayout: Layout;
|
|
55
|
+
}): MeasuredDimensions | undefined {
|
|
56
|
+
"worklet";
|
|
57
|
+
|
|
58
|
+
if (typeof contentTarget === "object") {
|
|
59
|
+
return contentTarget;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
if (contentTarget === "bound") {
|
|
63
|
+
return link.destination?.bounds;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
x: 0,
|
|
68
|
+
y: 0,
|
|
69
|
+
pageX: 0,
|
|
70
|
+
pageY: 0,
|
|
71
|
+
width: screenLayout.width,
|
|
72
|
+
height: screenLayout.height,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.resolveDirectionalDragTranslation = void 0;
|
|
7
|
-
const resolveDirectionalDragTranslation = ({
|
|
8
|
-
translation,
|
|
9
|
-
dimension,
|
|
10
|
-
negativeMax,
|
|
11
|
-
positiveMax,
|
|
12
|
-
exponent = 1
|
|
13
|
-
}) => {
|
|
14
|
-
"worklet";
|
|
15
|
-
|
|
16
|
-
const baseDistance = Math.max(1, dimension);
|
|
17
|
-
const clampedMagnitude = Math.min(1, Math.abs(translation) / baseDistance);
|
|
18
|
-
const curvedMagnitude = clampedMagnitude ** Math.max(1, exponent);
|
|
19
|
-
if (translation < 0) {
|
|
20
|
-
return -baseDistance * negativeMax * curvedMagnitude;
|
|
21
|
-
}
|
|
22
|
-
return baseDistance * positiveMax * curvedMagnitude;
|
|
23
|
-
};
|
|
24
|
-
exports.resolveDirectionalDragTranslation = resolveDirectionalDragTranslation;
|
|
25
|
-
//# sourceMappingURL=math.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["resolveDirectionalDragTranslation","translation","dimension","negativeMax","positiveMax","exponent","baseDistance","Math","max","clampedMagnitude","min","abs","curvedMagnitude","exports"],"sourceRoot":"../../../../../../../src","sources":["shared/utils/bounds/navigation/zoom/math.ts"],"mappings":";;;;;;AAAO,MAAMA,iCAAiC,GAAGA,CAAC;EACjDC,WAAW;EACXC,SAAS;EACTC,WAAW;EACXC,WAAW;EACXC,QAAQ,GAAG;AAOZ,CAAC,KAAK;EACL,SAAS;;EAET,MAAMC,YAAY,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEN,SAAS,CAAC;EAC3C,MAAMO,gBAAgB,GAAGF,IAAI,CAACG,GAAG,CAAC,CAAC,EAAEH,IAAI,CAACI,GAAG,CAACV,WAAW,CAAC,GAAGK,YAAY,CAAC;EAC1E,MAAMM,eAAe,GAAGH,gBAAgB,IAAIF,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,QAAQ,CAAC;EAEjE,IAAIJ,WAAW,GAAG,CAAC,EAAE;IACpB,OAAO,CAACK,YAAY,GAAGH,WAAW,GAAGS,eAAe;EACrD;EAEA,OAAON,YAAY,GAAGF,WAAW,GAAGQ,eAAe;AACpD,CAAC;AAACC,OAAA,CAAAb,iCAAA,GAAAA,iCAAA","ignoreList":[]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
export const resolveDirectionalDragTranslation = ({
|
|
4
|
-
translation,
|
|
5
|
-
dimension,
|
|
6
|
-
negativeMax,
|
|
7
|
-
positiveMax,
|
|
8
|
-
exponent = 1
|
|
9
|
-
}) => {
|
|
10
|
-
"worklet";
|
|
11
|
-
|
|
12
|
-
const baseDistance = Math.max(1, dimension);
|
|
13
|
-
const clampedMagnitude = Math.min(1, Math.abs(translation) / baseDistance);
|
|
14
|
-
const curvedMagnitude = clampedMagnitude ** Math.max(1, exponent);
|
|
15
|
-
if (translation < 0) {
|
|
16
|
-
return -baseDistance * negativeMax * curvedMagnitude;
|
|
17
|
-
}
|
|
18
|
-
return baseDistance * positiveMax * curvedMagnitude;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=math.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["resolveDirectionalDragTranslation","translation","dimension","negativeMax","positiveMax","exponent","baseDistance","Math","max","clampedMagnitude","min","abs","curvedMagnitude"],"sourceRoot":"../../../../../../../src","sources":["shared/utils/bounds/navigation/zoom/math.ts"],"mappings":";;AAAA,OAAO,MAAMA,iCAAiC,GAAGA,CAAC;EACjDC,WAAW;EACXC,SAAS;EACTC,WAAW;EACXC,WAAW;EACXC,QAAQ,GAAG;AAOZ,CAAC,KAAK;EACL,SAAS;;EAET,MAAMC,YAAY,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEN,SAAS,CAAC;EAC3C,MAAMO,gBAAgB,GAAGF,IAAI,CAACG,GAAG,CAAC,CAAC,EAAEH,IAAI,CAACI,GAAG,CAACV,WAAW,CAAC,GAAGK,YAAY,CAAC;EAC1E,MAAMM,eAAe,GAAGH,gBAAgB,IAAIF,IAAI,CAACC,GAAG,CAAC,CAAC,EAAEH,QAAQ,CAAC;EAEjE,IAAIJ,WAAW,GAAG,CAAC,EAAE;IACpB,OAAO,CAACK,YAAY,GAAGH,WAAW,GAAGS,eAAe;EACrD;EAEA,OAAON,YAAY,GAAGF,WAAW,GAAGQ,eAAe;AACpD,CAAC","ignoreList":[]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
export declare const resolveDirectionalDragTranslation: ({ translation, dimension, negativeMax, positiveMax, exponent, }: {
|
|
2
|
-
translation: number;
|
|
3
|
-
dimension: number;
|
|
4
|
-
negativeMax: number;
|
|
5
|
-
positiveMax: number;
|
|
6
|
-
exponent?: number;
|
|
7
|
-
}) => number;
|
|
8
|
-
//# sourceMappingURL=math.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/utils/bounds/navigation/zoom/math.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iCAAiC,GAAI,iEAM/C;IACF,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;CAClB,WAYA,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export const resolveDirectionalDragTranslation = ({
|
|
2
|
-
translation,
|
|
3
|
-
dimension,
|
|
4
|
-
negativeMax,
|
|
5
|
-
positiveMax,
|
|
6
|
-
exponent = 1,
|
|
7
|
-
}: {
|
|
8
|
-
translation: number;
|
|
9
|
-
dimension: number;
|
|
10
|
-
negativeMax: number;
|
|
11
|
-
positiveMax: number;
|
|
12
|
-
exponent?: number;
|
|
13
|
-
}) => {
|
|
14
|
-
"worklet";
|
|
15
|
-
|
|
16
|
-
const baseDistance = Math.max(1, dimension);
|
|
17
|
-
const clampedMagnitude = Math.min(1, Math.abs(translation) / baseDistance);
|
|
18
|
-
const curvedMagnitude = clampedMagnitude ** Math.max(1, exponent);
|
|
19
|
-
|
|
20
|
-
if (translation < 0) {
|
|
21
|
-
return -baseDistance * negativeMax * curvedMagnitude;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return baseDistance * positiveMax * curvedMagnitude;
|
|
25
|
-
};
|