react-native-screen-transitions 3.9.0-beta.3 → 3.9.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/lib/commonjs/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +2 -2
- 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/utils/ownership.js +4 -1
- package/lib/commonjs/shared/components/boundary/portal/utils/ownership.js.map +1 -1
- package/lib/commonjs/shared/configs/index.js +2 -1
- package/lib/commonjs/shared/configs/index.js.map +1 -1
- package/lib/commonjs/shared/configs/specs.js +23 -1
- package/lib/commonjs/shared/configs/specs.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js +3 -1
- package/lib/commonjs/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js +10 -3
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js +4 -3
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js +6 -3
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js +3 -2
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/mask.js.map +1 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js +36 -1
- package/lib/commonjs/shared/utils/bounds/navigation/zoom/targets.js.map +1 -1
- package/lib/module/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.js +2 -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/utils/ownership.js +4 -1
- package/lib/module/shared/components/boundary/portal/utils/ownership.js.map +1 -1
- package/lib/module/shared/configs/index.js +3 -2
- package/lib/module/shared/configs/index.js.map +1 -1
- package/lib/module/shared/configs/specs.js +22 -0
- package/lib/module/shared/configs/specs.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js +3 -1
- package/lib/module/shared/utils/bounds/navigation/reveal/math.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js +11 -4
- package/lib/module/shared/utils/bounds/navigation/zoom/build.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/config.js +4 -3
- package/lib/module/shared/utils/bounds/navigation/zoom/config.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js +6 -3
- package/lib/module/shared/utils/bounds/navigation/zoom/helpers.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/mask.js +3 -2
- package/lib/module/shared/utils/bounds/navigation/zoom/mask.js.map +1 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/targets.js +35 -1
- package/lib/module/shared/utils/bounds/navigation/zoom/targets.js.map +1 -1
- package/lib/typescript/shared/components/boundary/portal/utils/ownership.d.ts.map +1 -1
- package/lib/typescript/shared/configs/index.d.ts +16 -0
- package/lib/typescript/shared/configs/index.d.ts.map +1 -1
- package/lib/typescript/shared/configs/specs.d.ts +19 -0
- package/lib/typescript/shared/configs/specs.d.ts.map +1 -1
- package/lib/typescript/shared/index.d.ts +16 -0
- package/lib/typescript/shared/index.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/reveal/math.d.ts +3 -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.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts +2 -2
- package/lib/typescript/shared/utils/bounds/navigation/zoom/config.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/helpers.d.ts +3 -1
- 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 +3 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/mask.d.ts.map +1 -1
- package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts +6 -0
- package/lib/typescript/shared/utils/bounds/navigation/zoom/targets.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/shared/components/boundary/portal/components/boundary-portal/components/portal-boundary-host.tsx +2 -2
- package/src/shared/components/boundary/portal/utils/ownership.ts +5 -1
- package/src/shared/configs/index.ts +2 -1
- package/src/shared/configs/specs.ts +23 -0
- package/src/shared/utils/bounds/navigation/reveal/math.ts +4 -0
- package/src/shared/utils/bounds/navigation/zoom/build.ts +9 -1
- package/src/shared/utils/bounds/navigation/zoom/config.ts +4 -3
- package/src/shared/utils/bounds/navigation/zoom/helpers.ts +5 -0
- package/src/shared/utils/bounds/navigation/zoom/mask.ts +4 -1
- package/src/shared/utils/bounds/navigation/zoom/targets.ts +59 -1
|
@@ -6,8 +6,8 @@ export declare const ZOOM_DISMISS_VELOCITY_DEPTH = 1;
|
|
|
6
6
|
export declare const ZOOM_BACKGROUND_SCALE = 0.9375;
|
|
7
7
|
export declare const ZOOM_BACKDROP_MAX_OPACITY = 0.45;
|
|
8
8
|
export declare const ZOOM_SCREEN_A_FADE_END = 0.54;
|
|
9
|
-
export declare const ZOOM_FOCUSED_ELEMENT_OPEN_OPACITY_RANGE: readonly [0, 0.
|
|
10
|
-
export declare const ZOOM_UNFOCUSED_ELEMENT_OPEN_OPACITY_RANGE: readonly [1.
|
|
9
|
+
export declare const ZOOM_FOCUSED_ELEMENT_OPEN_OPACITY_RANGE: readonly [0, 0.28, 0, 1];
|
|
10
|
+
export declare const ZOOM_UNFOCUSED_ELEMENT_OPEN_OPACITY_RANGE: readonly [1.08, 1.32, 1, 0];
|
|
11
11
|
export declare const ZOOM_FOCUSED_ELEMENT_CLOSE_OPACITY_RANGE: readonly [0.13, 0.7, 0, 1];
|
|
12
12
|
export declare const ZOOM_UNFOCUSED_ELEMENT_CLOSE_OPACITY_RANGE: readonly [1.7, 2, 1, 0];
|
|
13
13
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/utils/bounds/navigation/zoom/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;EAG9B,CAAC;AAEH,eAAO,MAAM,2BAA2B,IAAM,CAAC;AAC/C,eAAO,MAAM,qBAAqB,SAAS,CAAC;AAE5C,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,eAAO,MAAM,sBAAsB,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/utils/bounds/navigation/zoom/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;EAG9B,CAAC;AAEH,eAAO,MAAM,2BAA2B,IAAM,CAAC;AAC/C,eAAO,MAAM,qBAAqB,SAAS,CAAC;AAE5C,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,eAAO,MAAM,sBAAsB,OAAO,CAAC;AAG3C,eAAO,MAAM,uCAAuC,0BAA2B,CAAC;AAChF,eAAO,MAAM,yCAAyC,6BAE5C,CAAC;AAEX,eAAO,MAAM,wCAAwC,4BAE3C,CAAC;AACX,eAAO,MAAM,0CAA0C,yBAE7C,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { MeasuredDimensions } from "react-native-reanimated";
|
|
2
2
|
import type { Layout } from "../../../../types/screen.types";
|
|
3
|
+
import type { BoundsAnchor } from "../../types/options";
|
|
3
4
|
export declare function resolveZoomBackdropOpacity({ transitionProgress, dismissalDrag, fadeEnd, maxOpacity, }: {
|
|
4
5
|
transitionProgress: number;
|
|
5
6
|
dismissalDrag: number;
|
|
@@ -17,7 +18,7 @@ export declare function resolveZoomPinchFocalOffset({ gestureScale, pinchOriginX
|
|
|
17
18
|
x: number;
|
|
18
19
|
y: number;
|
|
19
20
|
};
|
|
20
|
-
export declare function resolveZoomTrackedSourceTransform({ progress, sourceBounds, destinationBounds, screenLayout, dragX, dragY, gestureScale, parentScale, rotation, }: {
|
|
21
|
+
export declare function resolveZoomTrackedSourceTransform({ progress, sourceBounds, destinationBounds, screenLayout, dragX, dragY, gestureScale, parentScale, rotation, anchor, }: {
|
|
21
22
|
progress: number;
|
|
22
23
|
sourceBounds: MeasuredDimensions;
|
|
23
24
|
destinationBounds: MeasuredDimensions;
|
|
@@ -27,6 +28,7 @@ export declare function resolveZoomTrackedSourceTransform({ progress, sourceBoun
|
|
|
27
28
|
gestureScale: number;
|
|
28
29
|
parentScale: number;
|
|
29
30
|
rotation?: number;
|
|
31
|
+
anchor?: BoundsAnchor;
|
|
30
32
|
}): {
|
|
31
33
|
scaleX: number;
|
|
32
34
|
scaleY: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/utils/bounds/navigation/zoom/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/utils/bounds/navigation/zoom/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAMxD,wBAAgB,0BAA0B,CAAC,EAC1C,kBAAkB,EAClB,aAAa,EACb,OAAO,EACP,UAAU,GACV,EAAE;IACF,kBAAkB,EAAE,MAAM,CAAC;IAC3B,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACnB,UAUA;AAED,wBAAgB,2BAA2B,CAAC,EAC3C,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,YAAY,GACZ,EAAE;IACF,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACrB;;;EAmBA;AAED,wBAAgB,iCAAiC,CAAC,EACjD,QAAQ,EACR,YAAY,EACZ,iBAAiB,EACjB,YAAY,EACZ,KAAK,EACL,KAAK,EACL,YAAY,EACZ,WAAW,EACX,QAAY,EACZ,MAAM,GACN,EAAE;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,kBAAkB,CAAC;IACjC,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;CACtB;;;;;EAkEA"}
|
|
@@ -2,6 +2,7 @@ import type { MeasuredDimensions } from "react-native-reanimated";
|
|
|
2
2
|
import type { ScreenTransitionState, TransitionSlotStyle } from "../../../../types/animation.types";
|
|
3
3
|
import type { BoundsLink, BoundsScopedAccessor } from "../../../../types/bounds.types";
|
|
4
4
|
import type { Layout } from "../../../../types/screen.types";
|
|
5
|
+
import type { BoundsAnchor } from "../../types/options";
|
|
5
6
|
import type { ZoomDragState } from "./drag";
|
|
6
7
|
export declare const ZOOM_NAVIGATION_MASK_BORDER_RADIUS = 64;
|
|
7
8
|
interface ZoomNavigationMaskStyleProps {
|
|
@@ -19,7 +20,8 @@ interface ZoomNavigationMaskStyleProps {
|
|
|
19
20
|
sourceBorderRadius: number;
|
|
20
21
|
expandedBorderRadius: number;
|
|
21
22
|
active: ScreenTransitionState;
|
|
23
|
+
anchor: BoundsAnchor;
|
|
22
24
|
}
|
|
23
|
-
export declare function resolveZoomNavigationMaskStyle({ scopedBounds, link, sourceBounds, screenLayout, transitionProgress, drag, contentTransform, sourceBorderRadius, expandedBorderRadius, active, }: ZoomNavigationMaskStyleProps): TransitionSlotStyle;
|
|
25
|
+
export declare function resolveZoomNavigationMaskStyle({ scopedBounds, link, sourceBounds, screenLayout, transitionProgress, drag, contentTransform, sourceBorderRadius, expandedBorderRadius, active, anchor, }: ZoomNavigationMaskStyleProps): TransitionSlotStyle;
|
|
24
26
|
export {};
|
|
25
27
|
//# sourceMappingURL=mask.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/utils/bounds/navigation/zoom/mask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,KAAK,EACX,qBAAqB,EACrB,mBAAmB,EACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EACX,UAAU,EACV,oBAAoB,EACpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"mask.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/utils/bounds/navigation/zoom/mask.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,KAAK,EACX,qBAAqB,EACrB,mBAAmB,EACnB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EACX,UAAU,EACV,oBAAoB,EACpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAQxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,eAAO,MAAM,kCAAkC,KAAK,CAAC;AAGrD,UAAU,4BAA4B;IACrC,YAAY,EAAE,oBAAoB,CAAC;IACnC,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,kBAAkB,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,IAAI,EAAE,aAAa,CAAC;IACpB,gBAAgB,EAAE;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,UAAU,EAAE,MAAM,CAAC;QACnB,KAAK,EAAE,MAAM,CAAC;KACd,CAAC;IACF,kBAAkB,EAAE,MAAM,CAAC;IAC3B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,qBAAqB,CAAC;IAC9B,MAAM,EAAE,YAAY,CAAC;CACrB;AAED,wBAAgB,8BAA8B,CAAC,EAC9C,YAAY,EACZ,IAAI,EACJ,YAAY,EACZ,YAAY,EACZ,kBAAkB,EAClB,IAAI,EACJ,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,MAAM,EACN,MAAM,GACN,EAAE,4BAA4B,GAAG,mBAAmB,CA8EpD"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import type { MeasuredDimensions } from "react-native-reanimated";
|
|
2
2
|
import type { BoundsLink, BoundsNavigationZoomOptions } from "../../../../types/bounds.types";
|
|
3
3
|
import type { Layout } from "../../../../types/screen.types";
|
|
4
|
+
import type { BoundsAnchor } from "../../types/options";
|
|
4
5
|
type ZoomContentTarget = Exclude<BoundsNavigationZoomOptions["target"], undefined>;
|
|
5
6
|
export declare function getZoomContentTarget({ explicitTarget, screenLayout, link, }: {
|
|
6
7
|
explicitTarget: BoundsNavigationZoomOptions["target"];
|
|
7
8
|
screenLayout: Layout;
|
|
8
9
|
link: BoundsLink;
|
|
9
10
|
}): ZoomContentTarget;
|
|
11
|
+
export declare function getZoomContentAnchor({ explicitTarget, screenLayout, link, }: {
|
|
12
|
+
explicitTarget: BoundsNavigationZoomOptions["target"];
|
|
13
|
+
screenLayout: Layout;
|
|
14
|
+
link: BoundsLink;
|
|
15
|
+
}): BoundsAnchor;
|
|
10
16
|
export declare function resolveZoomTrackingContentTarget({ contentTarget, link, screenLayout, }: {
|
|
11
17
|
contentTarget: ZoomContentTarget;
|
|
12
18
|
link: BoundsLink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"targets.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/utils/bounds/navigation/zoom/targets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EACX,UAAU,EACV,2BAA2B,EAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"targets.d.ts","sourceRoot":"","sources":["../../../../../../../src/shared/utils/bounds/navigation/zoom/targets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EACX,UAAU,EACV,2BAA2B,EAC3B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAExD,KAAK,iBAAiB,GAAG,OAAO,CAC/B,2BAA2B,CAAC,QAAQ,CAAC,EACrC,SAAS,CACT,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,EACpC,cAAc,EACd,YAAY,EACZ,IAAI,GACJ,EAAE;IACF,cAAc,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IACtD,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;CACjB,GAAG,iBAAiB,CAiDpB;AAED,wBAAgB,oBAAoB,CAAC,EACpC,cAAc,EACd,YAAY,EACZ,IAAI,GACJ,EAAE;IACF,cAAc,EAAE,2BAA2B,CAAC,QAAQ,CAAC,CAAC;IACtD,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,UAAU,CAAC;CACjB,GAAG,YAAY,CAsBf;AAED,wBAAgB,gCAAgC,CAAC,EAChD,aAAa,EACb,IAAI,EACJ,YAAY,GACZ,EAAE;IACF,aAAa,EAAE,iBAAiB,CAAC;IACjC,IAAI,EAAE,UAAU,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACrB,GAAG,kBAAkB,GAAG,SAAS,CAmBjC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-screen-transitions",
|
|
3
|
-
"version": "3.9.0
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "Easy screen transitions for React Native and Expo",
|
|
5
5
|
"author": "Ed",
|
|
6
6
|
"license": "MIT",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"react-native-reanimated": ">=3.16.0 || >=4.0.0-",
|
|
86
86
|
"react-native-safe-area-context": "*",
|
|
87
87
|
"react-native-screens": ">=4.4.0",
|
|
88
|
-
"react-native-teleport": ">=1.1.0 <
|
|
88
|
+
"react-native-teleport": ">=1.1.0 <1.1.11"
|
|
89
89
|
},
|
|
90
90
|
"peerDependenciesMeta": {
|
|
91
91
|
"react-native-teleport": {
|
|
@@ -48,7 +48,7 @@ export const PortalBoundaryHost = memo(function PortalBoundaryHost({
|
|
|
48
48
|
// Strict per-member lookup - a fallback member's source rect would
|
|
49
49
|
// misplace this host's teleported content.
|
|
50
50
|
const link = getLink(host.pairKey, host.boundaryId);
|
|
51
|
-
if (!link?.source
|
|
51
|
+
if (!link?.source) {
|
|
52
52
|
return NO_STYLES;
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -95,7 +95,7 @@ export const PortalBoundaryHost = memo(function PortalBoundaryHost({
|
|
|
95
95
|
const contentFrameStyle = useAnimatedStyle(() => {
|
|
96
96
|
"worklet";
|
|
97
97
|
const link = getLink(host.pairKey, host.boundaryId);
|
|
98
|
-
if (!link?.source
|
|
98
|
+
if (!link?.source) {
|
|
99
99
|
return NO_STYLES;
|
|
100
100
|
}
|
|
101
101
|
|
|
@@ -196,7 +196,7 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
196
196
|
const linkKey = getLinkKeyFromTag(boundaryId);
|
|
197
197
|
const link = getPairLink(pairsState, sourcePairKey, linkKey);
|
|
198
198
|
|
|
199
|
-
if (link?.
|
|
199
|
+
if (!link?.source) {
|
|
200
200
|
return pendingSignal(sourcePairKey);
|
|
201
201
|
}
|
|
202
202
|
|
|
@@ -220,6 +220,10 @@ export const resolveBoundaryPortalOwnership = ({
|
|
|
220
220
|
};
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
if (link.status !== "complete") {
|
|
224
|
+
return pendingSignal(sourcePairKey);
|
|
225
|
+
}
|
|
226
|
+
|
|
223
227
|
let hostScreenKey = link.destination.screenKey;
|
|
224
228
|
let ownerPairKey = sourcePairKey;
|
|
225
229
|
const seenScreenKeys: ScreenKey[] = [
|
|
@@ -8,12 +8,13 @@ import {
|
|
|
8
8
|
SlideFromTop,
|
|
9
9
|
ZoomIn,
|
|
10
10
|
} from "./presets";
|
|
11
|
-
import { DefaultSnapSpec, DefaultSpec, FlingSpec } from "./specs";
|
|
11
|
+
import { DefaultSnapSpec, DefaultSpec, FlingSpec, Zoom } from "./specs";
|
|
12
12
|
|
|
13
13
|
export const Specs = {
|
|
14
14
|
DefaultSpec,
|
|
15
15
|
DefaultSnapSpec,
|
|
16
16
|
FlingSpec,
|
|
17
|
+
Zoom,
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
export const Presets = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { WithSpringConfig } from "react-native-reanimated";
|
|
2
|
+
import type { TransitionSpec } from "../types/animation.types";
|
|
2
3
|
|
|
3
4
|
export const DefaultSpec: WithSpringConfig = {
|
|
4
5
|
stiffness: 1000,
|
|
@@ -22,3 +23,25 @@ export const FlingSpec: WithSpringConfig = {
|
|
|
22
23
|
overshootClamping: false,
|
|
23
24
|
energyThreshold: 6e-9,
|
|
24
25
|
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Paired spring configuration tuned for navigation zoom transitions.
|
|
29
|
+
*/
|
|
30
|
+
export const Zoom = {
|
|
31
|
+
open: {
|
|
32
|
+
stiffness: 1000,
|
|
33
|
+
damping: 500,
|
|
34
|
+
mass: 3,
|
|
35
|
+
overshootClamping: false,
|
|
36
|
+
// @ts-expect-error Reanimated v3 spring config support.
|
|
37
|
+
restSpeedThreshold: 0.02,
|
|
38
|
+
},
|
|
39
|
+
close: {
|
|
40
|
+
stiffness: 1100,
|
|
41
|
+
damping: 98,
|
|
42
|
+
mass: 3,
|
|
43
|
+
overshootClamping: false,
|
|
44
|
+
// @ts-expect-error Reanimated v3 spring config support.
|
|
45
|
+
restSpeedThreshold: 0.02,
|
|
46
|
+
},
|
|
47
|
+
} satisfies TransitionSpec;
|
|
@@ -2,6 +2,7 @@ import type { MeasuredDimensions } from "react-native-reanimated";
|
|
|
2
2
|
import { EPSILON } from "../../../../constants";
|
|
3
3
|
import type { Layout } from "../../../../types/screen.types";
|
|
4
4
|
import { computeContentTransformGeometry } from "../../helpers/geometry";
|
|
5
|
+
import type { BoundsAnchor } from "../../types/options";
|
|
5
6
|
import {
|
|
6
7
|
DRAG_DIRECTIONAL_SCALE_EXPONENT,
|
|
7
8
|
DRAG_DIRECTIONAL_SCALE_MAX,
|
|
@@ -189,11 +190,13 @@ export function resolveRevealContentBaseTransform({
|
|
|
189
190
|
sourceBounds,
|
|
190
191
|
destinationBounds,
|
|
191
192
|
screenLayout,
|
|
193
|
+
anchor,
|
|
192
194
|
}: {
|
|
193
195
|
progress: number;
|
|
194
196
|
sourceBounds: MeasuredDimensions;
|
|
195
197
|
destinationBounds: MeasuredDimensions;
|
|
196
198
|
screenLayout: Layout;
|
|
199
|
+
anchor?: BoundsAnchor;
|
|
197
200
|
}) {
|
|
198
201
|
"worklet";
|
|
199
202
|
|
|
@@ -202,6 +205,7 @@ export function resolveRevealContentBaseTransform({
|
|
|
202
205
|
end: destinationBounds,
|
|
203
206
|
entering: true,
|
|
204
207
|
dimensions: screenLayout,
|
|
208
|
+
anchor,
|
|
205
209
|
scaleMode: "uniform",
|
|
206
210
|
});
|
|
207
211
|
|
|
@@ -27,6 +27,7 @@ import {
|
|
|
27
27
|
ZOOM_NAVIGATION_MASK_BORDER_RADIUS,
|
|
28
28
|
} from "./mask";
|
|
29
29
|
import {
|
|
30
|
+
getZoomContentAnchor,
|
|
30
31
|
getZoomContentTarget,
|
|
31
32
|
resolveZoomTrackingContentTarget,
|
|
32
33
|
} from "./targets";
|
|
@@ -91,6 +92,11 @@ export function buildZoomStyles({
|
|
|
91
92
|
screenLayout,
|
|
92
93
|
link,
|
|
93
94
|
});
|
|
95
|
+
const zoomContentAnchor = getZoomContentAnchor({
|
|
96
|
+
explicitTarget: target,
|
|
97
|
+
screenLayout,
|
|
98
|
+
link,
|
|
99
|
+
});
|
|
94
100
|
const trackingContentTarget = resolveZoomTrackingContentTarget({
|
|
95
101
|
contentTarget: zoomContentTarget,
|
|
96
102
|
link,
|
|
@@ -149,7 +155,7 @@ export function buildZoomStyles({
|
|
|
149
155
|
|
|
150
156
|
const contentRaw = scopedBounds.values({
|
|
151
157
|
scaleMode: ZOOM_SHARED_OPTIONS.scaleMode,
|
|
152
|
-
anchor:
|
|
158
|
+
anchor: zoomContentAnchor,
|
|
153
159
|
method: "content",
|
|
154
160
|
target: zoomContentTarget,
|
|
155
161
|
progress: transitionProgress,
|
|
@@ -222,6 +228,7 @@ export function buildZoomStyles({
|
|
|
222
228
|
sourceBorderRadius,
|
|
223
229
|
expandedBorderRadius,
|
|
224
230
|
active,
|
|
231
|
+
anchor: zoomContentAnchor,
|
|
225
232
|
})
|
|
226
233
|
: {},
|
|
227
234
|
};
|
|
@@ -291,6 +298,7 @@ export function buildZoomStyles({
|
|
|
291
298
|
gestureScale: trackedGestureScale,
|
|
292
299
|
parentScale: unfocusedContentScale,
|
|
293
300
|
rotation: drag.rotation,
|
|
301
|
+
anchor: zoomContentAnchor,
|
|
294
302
|
});
|
|
295
303
|
|
|
296
304
|
return {
|
|
@@ -9,10 +9,11 @@ export const ZOOM_BACKGROUND_SCALE = 0.9375;
|
|
|
9
9
|
export const ZOOM_BACKDROP_MAX_OPACITY = 0.45;
|
|
10
10
|
// Geometry-aligned native frames reach their darkest point around here.
|
|
11
11
|
export const ZOOM_SCREEN_A_FADE_END = 0.54;
|
|
12
|
-
//
|
|
13
|
-
|
|
12
|
+
// Native starts revealing the destination immediately while the source begins
|
|
13
|
+
// handing ownership over in the first tenth of the opening travel.
|
|
14
|
+
export const ZOOM_FOCUSED_ELEMENT_OPEN_OPACITY_RANGE = [0, 0.28, 0, 1] as const;
|
|
14
15
|
export const ZOOM_UNFOCUSED_ELEMENT_OPEN_OPACITY_RANGE = [
|
|
15
|
-
1.
|
|
16
|
+
1.08, 1.32, 1, 0,
|
|
16
17
|
] as const;
|
|
17
18
|
// On close, red is prepared behind opaque blue before blue fades away.
|
|
18
19
|
export const ZOOM_FOCUSED_ELEMENT_CLOSE_OPACITY_RANGE = [
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MeasuredDimensions } from "react-native-reanimated";
|
|
2
2
|
import { EPSILON } from "../../../../constants";
|
|
3
3
|
import type { Layout } from "../../../../types/screen.types";
|
|
4
|
+
import type { BoundsAnchor } from "../../types/options";
|
|
4
5
|
import {
|
|
5
6
|
resolveRevealContentBaseTransform,
|
|
6
7
|
resolveTrackedSourceElementTransform,
|
|
@@ -73,6 +74,7 @@ export function resolveZoomTrackedSourceTransform({
|
|
|
73
74
|
gestureScale,
|
|
74
75
|
parentScale,
|
|
75
76
|
rotation = 0,
|
|
77
|
+
anchor,
|
|
76
78
|
}: {
|
|
77
79
|
progress: number;
|
|
78
80
|
sourceBounds: MeasuredDimensions;
|
|
@@ -83,6 +85,7 @@ export function resolveZoomTrackedSourceTransform({
|
|
|
83
85
|
gestureScale: number;
|
|
84
86
|
parentScale: number;
|
|
85
87
|
rotation?: number;
|
|
88
|
+
anchor?: BoundsAnchor;
|
|
86
89
|
}) {
|
|
87
90
|
"worklet";
|
|
88
91
|
|
|
@@ -91,12 +94,14 @@ export function resolveZoomTrackedSourceTransform({
|
|
|
91
94
|
sourceBounds,
|
|
92
95
|
destinationBounds,
|
|
93
96
|
screenLayout,
|
|
97
|
+
anchor,
|
|
94
98
|
});
|
|
95
99
|
const collapsedContentScale = resolveRevealContentBaseTransform({
|
|
96
100
|
progress: 0,
|
|
97
101
|
sourceBounds,
|
|
98
102
|
destinationBounds,
|
|
99
103
|
screenLayout,
|
|
104
|
+
anchor,
|
|
100
105
|
}).scale;
|
|
101
106
|
const contentScale = contentBaseTransform.scale * gestureScale;
|
|
102
107
|
const safeCollapsedContentScale = Math.max(
|
|
@@ -9,6 +9,7 @@ import type {
|
|
|
9
9
|
BoundsScopedAccessor,
|
|
10
10
|
} from "../../../../types/bounds.types";
|
|
11
11
|
import type { Layout } from "../../../../types/screen.types";
|
|
12
|
+
import type { BoundsAnchor } from "../../types/options";
|
|
12
13
|
import { toNumber } from "../helpers";
|
|
13
14
|
import { DRAG_MASK_HEIGHT_COLLAPSE_END } from "../reveal/config";
|
|
14
15
|
import {
|
|
@@ -36,6 +37,7 @@ interface ZoomNavigationMaskStyleProps {
|
|
|
36
37
|
sourceBorderRadius: number;
|
|
37
38
|
expandedBorderRadius: number;
|
|
38
39
|
active: ScreenTransitionState;
|
|
40
|
+
anchor: BoundsAnchor;
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
export function resolveZoomNavigationMaskStyle({
|
|
@@ -49,12 +51,13 @@ export function resolveZoomNavigationMaskStyle({
|
|
|
49
51
|
sourceBorderRadius,
|
|
50
52
|
expandedBorderRadius,
|
|
51
53
|
active,
|
|
54
|
+
anchor,
|
|
52
55
|
}: ZoomNavigationMaskStyleProps): TransitionSlotStyle {
|
|
53
56
|
"worklet";
|
|
54
57
|
|
|
55
58
|
const maskRaw = scopedBounds.values({
|
|
56
59
|
scaleMode: ZOOM_SHARED_OPTIONS.scaleMode,
|
|
57
|
-
anchor
|
|
60
|
+
anchor,
|
|
58
61
|
method: "size",
|
|
59
62
|
space: "absolute",
|
|
60
63
|
target: "fullscreen",
|
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
BoundsNavigationZoomOptions,
|
|
5
5
|
} from "../../../../types/bounds.types";
|
|
6
6
|
import type { Layout } from "../../../../types/screen.types";
|
|
7
|
+
import type { BoundsAnchor } from "../../types/options";
|
|
7
8
|
|
|
8
9
|
type ZoomContentTarget = Exclude<
|
|
9
10
|
BoundsNavigationZoomOptions["target"],
|
|
@@ -27,11 +28,36 @@ export function getZoomContentTarget({
|
|
|
27
28
|
|
|
28
29
|
const sourceBounds = link.source?.bounds;
|
|
29
30
|
const screenWidth = screenLayout.width;
|
|
31
|
+
const screenHeight = screenLayout.height;
|
|
30
32
|
|
|
31
|
-
if (
|
|
33
|
+
if (
|
|
34
|
+
!sourceBounds ||
|
|
35
|
+
sourceBounds.width <= 0 ||
|
|
36
|
+
sourceBounds.height <= 0 ||
|
|
37
|
+
screenWidth <= 0 ||
|
|
38
|
+
screenHeight <= 0
|
|
39
|
+
) {
|
|
32
40
|
return "fullscreen";
|
|
33
41
|
}
|
|
34
42
|
|
|
43
|
+
const sourceAspectRatio = sourceBounds.width / sourceBounds.height;
|
|
44
|
+
const screenAspectRatio = screenWidth / screenHeight;
|
|
45
|
+
|
|
46
|
+
// Zoom keeps one edge of the virtual destination attached to the source.
|
|
47
|
+
// A wide source fills the destination width and follows its top edge. A
|
|
48
|
+
// narrow source fills the destination height instead, so it follows the
|
|
49
|
+
// destination's leading edge rather than taking a long vertical path.
|
|
50
|
+
if (sourceAspectRatio < screenAspectRatio) {
|
|
51
|
+
return {
|
|
52
|
+
x: 0,
|
|
53
|
+
y: 0,
|
|
54
|
+
pageX: 0,
|
|
55
|
+
pageY: 0,
|
|
56
|
+
width: (sourceBounds.width / sourceBounds.height) * screenHeight,
|
|
57
|
+
height: screenHeight,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
35
61
|
const height = (sourceBounds.height / sourceBounds.width) * screenWidth;
|
|
36
62
|
|
|
37
63
|
return {
|
|
@@ -44,6 +70,38 @@ export function getZoomContentTarget({
|
|
|
44
70
|
};
|
|
45
71
|
}
|
|
46
72
|
|
|
73
|
+
export function getZoomContentAnchor({
|
|
74
|
+
explicitTarget,
|
|
75
|
+
screenLayout,
|
|
76
|
+
link,
|
|
77
|
+
}: {
|
|
78
|
+
explicitTarget: BoundsNavigationZoomOptions["target"];
|
|
79
|
+
screenLayout: Layout;
|
|
80
|
+
link: BoundsLink;
|
|
81
|
+
}): BoundsAnchor {
|
|
82
|
+
"worklet";
|
|
83
|
+
|
|
84
|
+
if (explicitTarget !== undefined) {
|
|
85
|
+
return explicitTarget === "bound" ? "center" : "top";
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const sourceBounds = link.source?.bounds;
|
|
89
|
+
if (
|
|
90
|
+
!sourceBounds ||
|
|
91
|
+
sourceBounds.width <= 0 ||
|
|
92
|
+
sourceBounds.height <= 0 ||
|
|
93
|
+
screenLayout.width <= 0 ||
|
|
94
|
+
screenLayout.height <= 0
|
|
95
|
+
) {
|
|
96
|
+
return "top";
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return sourceBounds.width / sourceBounds.height <
|
|
100
|
+
screenLayout.width / screenLayout.height
|
|
101
|
+
? "leading"
|
|
102
|
+
: "top";
|
|
103
|
+
}
|
|
104
|
+
|
|
47
105
|
export function resolveZoomTrackingContentTarget({
|
|
48
106
|
contentTarget,
|
|
49
107
|
link,
|