expo-router 7.0.0-canary-20251211-7da85ea → 7.0.0-canary-20251216-6e1f9a7
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/android/build.gradle +2 -2
- package/build/exports.d.ts +1 -0
- package/build/exports.d.ts.map +1 -1
- package/build/exports.js +1 -0
- package/build/exports.js.map +1 -1
- package/build/layouts/StackClient.d.ts +9 -1
- package/build/layouts/StackClient.d.ts.map +1 -1
- package/build/layouts/stack-utils/StackHeaderButton.d.ts +39 -0
- package/build/layouts/stack-utils/StackHeaderButton.d.ts.map +1 -0
- package/build/layouts/stack-utils/StackHeaderButton.js +46 -0
- package/build/layouts/stack-utils/StackHeaderButton.js.map +1 -0
- package/build/layouts/stack-utils/StackHeaderComponent.d.ts.map +1 -1
- package/build/layouts/stack-utils/StackHeaderComponent.js +5 -6
- package/build/layouts/stack-utils/StackHeaderComponent.js.map +1 -1
- package/build/layouts/stack-utils/StackHeaderItem.d.ts +45 -0
- package/build/layouts/stack-utils/StackHeaderItem.d.ts.map +1 -0
- package/build/layouts/stack-utils/StackHeaderItem.js +52 -0
- package/build/layouts/stack-utils/StackHeaderItem.js.map +1 -0
- package/build/layouts/stack-utils/StackHeaderLeftRight.d.ts +15 -0
- package/build/layouts/stack-utils/StackHeaderLeftRight.d.ts.map +1 -0
- package/build/layouts/stack-utils/StackHeaderLeftRight.js +111 -0
- package/build/layouts/stack-utils/StackHeaderLeftRight.js.map +1 -0
- package/build/layouts/stack-utils/StackHeaderMenu.d.ts +191 -0
- package/build/layouts/stack-utils/StackHeaderMenu.d.ts.map +1 -0
- package/build/layouts/stack-utils/StackHeaderMenu.js +203 -0
- package/build/layouts/stack-utils/StackHeaderMenu.js.map +1 -0
- package/build/layouts/stack-utils/StackHeaderSpacer.d.ts +40 -0
- package/build/layouts/stack-utils/StackHeaderSpacer.d.ts.map +1 -0
- package/build/layouts/stack-utils/StackHeaderSpacer.js +41 -0
- package/build/layouts/stack-utils/StackHeaderSpacer.js.map +1 -0
- package/build/layouts/stack-utils/common-primitives.d.ts +24 -0
- package/build/layouts/stack-utils/common-primitives.d.ts.map +1 -0
- package/build/layouts/stack-utils/common-primitives.js +8 -0
- package/build/layouts/stack-utils/common-primitives.js.map +1 -0
- package/build/layouts/stack-utils/index.d.ts +16 -3
- package/build/layouts/stack-utils/index.d.ts.map +1 -1
- package/build/layouts/stack-utils/index.js +27 -8
- package/build/layouts/stack-utils/index.js.map +1 -1
- package/build/layouts/stack-utils/shared.d.ts +62 -0
- package/build/layouts/stack-utils/shared.d.ts.map +1 -0
- package/build/layouts/stack-utils/shared.js +78 -0
- package/build/layouts/stack-utils/shared.js.map +1 -0
- package/build/link/ExpoLink.d.ts.map +1 -1
- package/build/link/ExpoLink.js +10 -9
- package/build/link/ExpoLink.js.map +1 -1
- package/build/link/preview/native.d.ts +4 -2
- package/build/link/preview/native.d.ts.map +1 -1
- package/build/link/preview/native.js +3 -1
- package/build/link/preview/native.js.map +1 -1
- package/build/link/zoom/ZoomTransitionEnabler.ios.d.ts.map +1 -1
- package/build/link/zoom/ZoomTransitionEnabler.ios.js +4 -2
- package/build/link/zoom/ZoomTransitionEnabler.ios.js.map +1 -1
- package/build/link/zoom/link-apple-zoom.js +10 -3
- package/build/link/zoom/link-apple-zoom.js.map +1 -1
- package/build/link/zoom/useZoomHref.d.ts +3 -0
- package/build/link/zoom/useZoomHref.d.ts.map +1 -0
- package/build/link/zoom/useZoomHref.ios.d.ts +3 -0
- package/build/link/zoom/useZoomHref.ios.d.ts.map +1 -0
- package/build/link/zoom/useZoomHref.ios.js +38 -0
- package/build/link/zoom/useZoomHref.ios.js.map +1 -0
- package/build/link/zoom/useZoomHref.js +8 -0
- package/build/link/zoom/useZoomHref.js.map +1 -0
- package/build/link/zoom/zoom-transition-context-providers.d.ts +4 -0
- package/build/link/zoom/zoom-transition-context-providers.d.ts.map +1 -0
- package/build/link/zoom/zoom-transition-context-providers.ios.d.ts +4 -0
- package/build/link/zoom/zoom-transition-context-providers.ios.d.ts.map +1 -0
- package/build/link/zoom/zoom-transition-context-providers.ios.js +71 -0
- package/build/link/zoom/zoom-transition-context-providers.ios.js.map +1 -0
- package/build/link/zoom/zoom-transition-context-providers.js +11 -0
- package/build/link/zoom/zoom-transition-context-providers.js.map +1 -0
- package/build/link/zoom/zoom-transition-context-providers.types.d.ts +9 -0
- package/build/link/zoom/zoom-transition-context-providers.types.d.ts.map +1 -0
- package/build/link/zoom/zoom-transition-context-providers.types.js +3 -0
- package/build/link/zoom/zoom-transition-context-providers.types.js.map +1 -0
- package/build/link/zoom/zoom-transition-context.d.ts +4 -6
- package/build/link/zoom/zoom-transition-context.d.ts.map +1 -1
- package/build/link/zoom/zoom-transition-context.js +0 -27
- package/build/link/zoom/zoom-transition-context.js.map +1 -1
- package/build/primitives/types.d.ts +6 -5
- package/build/primitives/types.d.ts.map +1 -1
- package/build/primitives/types.js.map +1 -1
- package/build/split-view/elements.d.ts +4 -5
- package/build/split-view/elements.d.ts.map +1 -1
- package/build/split-view/elements.js +3 -0
- package/build/split-view/elements.js.map +1 -1
- package/build/split-view/index.d.ts +2 -0
- package/build/split-view/index.d.ts.map +1 -1
- package/build/split-view/index.js +15 -0
- package/build/split-view/index.js.map +1 -1
- package/build/split-view/split-view.d.ts +3 -0
- package/build/split-view/split-view.d.ts.map +1 -1
- package/build/split-view/split-view.js.map +1 -1
- package/build/useScreens.js +3 -3
- package/build/useScreens.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/LinkPreview/LinkPreviewNativeModule.swift +4 -1
- package/ios/LinkPreview/LinkZoomTransition.swift +121 -43
- package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
- package/package.json +12 -12
- package/build/layouts/stack-utils/StackHeaderLeft.d.ts +0 -9
- package/build/layouts/stack-utils/StackHeaderLeft.d.ts.map +0 -1
- package/build/layouts/stack-utils/StackHeaderLeft.js +0 -17
- package/build/layouts/stack-utils/StackHeaderLeft.js.map +0 -1
- package/build/layouts/stack-utils/StackHeaderRight.d.ts +0 -9
- package/build/layouts/stack-utils/StackHeaderRight.d.ts.map +0 -1
- package/build/layouts/stack-utils/StackHeaderRight.js +0 -17
- package/build/layouts/stack-utils/StackHeaderRight.js.map +0 -1
- package/build/link/zoom/useZoomTransitionPrimitives.d.ts +0 -6
- package/build/link/zoom/useZoomTransitionPrimitives.d.ts.map +0 -1
- package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts +0 -11
- package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts.map +0 -1
- package/build/link/zoom/useZoomTransitionPrimitives.ios.js +0 -69
- package/build/link/zoom/useZoomTransitionPrimitives.ios.js.map +0 -1
- package/build/link/zoom/useZoomTransitionPrimitives.js +0 -9
- package/build/link/zoom/useZoomTransitionPrimitives.js.map +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.md5 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.sha1 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.sha256 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.sha512 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.md5 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.sha1 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.sha256 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.sha512 → 7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.sha512} +0 -0
|
@@ -1,24 +1,43 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.appendScreenStackPropsToOptions = exports.StackScreen = exports.
|
|
3
|
+
exports.appendScreenStackPropsToOptions = exports.StackScreen = exports.StackHeaderSpacer = exports.StackHeaderItem = exports.StackHeaderMenuAction = exports.StackHeaderMenu = exports.StackHeaderIcon = exports.StackHeaderLabel = exports.StackHeaderBadge = exports.StackHeaderButton = exports.StackHeaderTitle = exports.StackHeaderSearchBar = exports.StackHeaderRight = exports.StackHeaderLeft = exports.StackHeaderBackButton = exports.StackHeader = void 0;
|
|
4
4
|
const StackHeaderBackButton_1 = require("./StackHeaderBackButton");
|
|
5
5
|
Object.defineProperty(exports, "StackHeaderBackButton", { enumerable: true, get: function () { return StackHeaderBackButton_1.StackHeaderBackButton; } });
|
|
6
|
+
const StackHeaderButton_1 = require("./StackHeaderButton");
|
|
7
|
+
Object.defineProperty(exports, "StackHeaderButton", { enumerable: true, get: function () { return StackHeaderButton_1.StackHeaderButton; } });
|
|
6
8
|
const StackHeaderComponent_1 = require("./StackHeaderComponent");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Object.defineProperty(exports, "StackHeaderRight", { enumerable: true, get: function () { return
|
|
9
|
+
const StackHeaderItem_1 = require("./StackHeaderItem");
|
|
10
|
+
Object.defineProperty(exports, "StackHeaderItem", { enumerable: true, get: function () { return StackHeaderItem_1.StackHeaderItem; } });
|
|
11
|
+
const StackHeaderLeftRight_1 = require("./StackHeaderLeftRight");
|
|
12
|
+
Object.defineProperty(exports, "StackHeaderLeft", { enumerable: true, get: function () { return StackHeaderLeftRight_1.StackHeaderLeft; } });
|
|
13
|
+
Object.defineProperty(exports, "StackHeaderRight", { enumerable: true, get: function () { return StackHeaderLeftRight_1.StackHeaderRight; } });
|
|
14
|
+
const StackHeaderMenu_1 = require("./StackHeaderMenu");
|
|
15
|
+
Object.defineProperty(exports, "StackHeaderMenu", { enumerable: true, get: function () { return StackHeaderMenu_1.StackHeaderMenu; } });
|
|
16
|
+
Object.defineProperty(exports, "StackHeaderMenuAction", { enumerable: true, get: function () { return StackHeaderMenu_1.StackHeaderMenuAction; } });
|
|
12
17
|
const StackHeaderSearchBar_1 = require("./StackHeaderSearchBar");
|
|
13
18
|
Object.defineProperty(exports, "StackHeaderSearchBar", { enumerable: true, get: function () { return StackHeaderSearchBar_1.StackHeaderSearchBar; } });
|
|
19
|
+
const StackHeaderSpacer_1 = require("./StackHeaderSpacer");
|
|
20
|
+
Object.defineProperty(exports, "StackHeaderSpacer", { enumerable: true, get: function () { return StackHeaderSpacer_1.StackHeaderSpacer; } });
|
|
14
21
|
const StackHeaderTitle_1 = require("./StackHeaderTitle");
|
|
15
22
|
Object.defineProperty(exports, "StackHeaderTitle", { enumerable: true, get: function () { return StackHeaderTitle_1.StackHeaderTitle; } });
|
|
23
|
+
const common_primitives_1 = require("./common-primitives");
|
|
24
|
+
Object.defineProperty(exports, "StackHeaderBadge", { enumerable: true, get: function () { return common_primitives_1.StackHeaderBadge; } });
|
|
25
|
+
Object.defineProperty(exports, "StackHeaderIcon", { enumerable: true, get: function () { return common_primitives_1.StackHeaderIcon; } });
|
|
26
|
+
Object.defineProperty(exports, "StackHeaderLabel", { enumerable: true, get: function () { return common_primitives_1.StackHeaderLabel; } });
|
|
16
27
|
exports.StackHeader = Object.assign(StackHeaderComponent_1.StackHeaderComponent, {
|
|
17
|
-
Left:
|
|
18
|
-
Right:
|
|
28
|
+
Left: StackHeaderLeftRight_1.StackHeaderLeft,
|
|
29
|
+
Right: StackHeaderLeftRight_1.StackHeaderRight,
|
|
19
30
|
BackButton: StackHeaderBackButton_1.StackHeaderBackButton,
|
|
20
31
|
Title: StackHeaderTitle_1.StackHeaderTitle,
|
|
21
32
|
SearchBar: StackHeaderSearchBar_1.StackHeaderSearchBar,
|
|
33
|
+
Button: StackHeaderButton_1.StackHeaderButton,
|
|
34
|
+
Badge: common_primitives_1.StackHeaderBadge,
|
|
35
|
+
Label: common_primitives_1.StackHeaderLabel,
|
|
36
|
+
Icon: common_primitives_1.StackHeaderIcon,
|
|
37
|
+
Menu: StackHeaderMenu_1.StackHeaderMenu,
|
|
38
|
+
MenuAction: StackHeaderMenu_1.StackHeaderMenuAction,
|
|
39
|
+
Item: StackHeaderItem_1.StackHeaderItem,
|
|
40
|
+
Spacer: StackHeaderSpacer_1.StackHeaderSpacer,
|
|
22
41
|
});
|
|
23
42
|
var StackScreen_1 = require("./StackScreen");
|
|
24
43
|
Object.defineProperty(exports, "StackScreen", { enumerable: true, get: function () { return StackScreen_1.StackScreen; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/layouts/stack-utils/index.tsx"],"names":[],"mappings":";;;AAAA,mEAAiG;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/layouts/stack-utils/index.tsx"],"names":[],"mappings":";;;AAAA,mEAAiG;AA8C/F,sGA9CO,6CAAqB,OA8CP;AA7CvB,2DAAqF;AAwDnF,kGAxDO,qCAAiB,OAwDP;AAvDnB,iEAAqF;AACrF,uDAA+E;AAkE7E,gGAlEO,iCAAe,OAkEP;AAjEjB,iEAKgC;AAwC9B,gGA5CA,sCAAe,OA4CA;AAEf,iGA5CA,uCAAgB,OA4CA;AAzClB,uDAK2B;AAkDzB,gGAtDA,iCAAe,OAsDA;AAEf,sGAvDA,uCAAqB,OAuDA;AAnDvB,iEAA8F;AAqC5F,qGArCO,2CAAoB,OAqCP;AApCtB,2DAAqF;AAsDnF,kGAtDO,qCAAiB,OAsDP;AArDnB,yDAAkF;AAqChF,iGArCO,mCAAgB,OAqCP;AApClB,2DAO6B;AAiC3B,iGAvCA,oCAAgB,OAuCA;AAIhB,gGA1CA,mCAAe,OA0CA;AAFf,iGAvCA,oCAAgB,OAuCA;AAhCL,QAAA,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,2CAAoB,EAAE;IAC7D,IAAI,EAAE,sCAAe;IACrB,KAAK,EAAE,uCAAgB;IACvB,UAAU,EAAE,6CAAqB;IACjC,KAAK,EAAE,mCAAgB;IACvB,SAAS,EAAE,2CAAoB;IAC/B,MAAM,EAAE,qCAAiB;IACzB,KAAK,EAAE,oCAAgB;IACvB,KAAK,EAAE,oCAAgB;IACvB,IAAI,EAAE,mCAAe;IACrB,IAAI,EAAE,iCAAe;IACrB,UAAU,EAAE,uCAAqB;IACjC,IAAI,EAAE,iCAAe;IACrB,MAAM,EAAE,qCAAiB;CAC1B,CAAC,CAAC;AAiCH,6CAAoG;AAA3F,0GAAA,WAAW,OAAA;AAAE,8HAAA,+BAA+B,OAAA","sourcesContent":["import { StackHeaderBackButton, type StackHeaderBackButtonProps } from './StackHeaderBackButton';\nimport { StackHeaderButton, type StackHeaderButtonProps } from './StackHeaderButton';\nimport { StackHeaderComponent, type StackHeaderProps } from './StackHeaderComponent';\nimport { StackHeaderItem, type StackHeaderItemProps } from './StackHeaderItem';\nimport {\n StackHeaderLeft,\n type StackHeaderLeftProps,\n StackHeaderRight,\n type StackHeaderRightProps,\n} from './StackHeaderLeftRight';\nimport {\n StackHeaderMenu,\n StackHeaderMenuAction,\n type StackHeaderMenuActionProps,\n type StackHeaderMenuProps,\n} from './StackHeaderMenu';\nimport { StackHeaderSearchBar, type StackHeaderSearchBarProps } from './StackHeaderSearchBar';\nimport { StackHeaderSpacer, type StackHeaderSpacerProps } from './StackHeaderSpacer';\nimport { StackHeaderTitle, type StackHeaderTitleProps } from './StackHeaderTitle';\nimport {\n StackHeaderBadge,\n StackHeaderIcon,\n StackHeaderLabel,\n type StackHeaderBadgeProps,\n type StackHeaderIconProps,\n type StackHeaderLabelProps,\n} from './common-primitives';\nimport type { StackHeaderItemSharedProps } from './shared';\n\nexport const StackHeader = Object.assign(StackHeaderComponent, {\n Left: StackHeaderLeft,\n Right: StackHeaderRight,\n BackButton: StackHeaderBackButton,\n Title: StackHeaderTitle,\n SearchBar: StackHeaderSearchBar,\n Button: StackHeaderButton,\n Badge: StackHeaderBadge,\n Label: StackHeaderLabel,\n Icon: StackHeaderIcon,\n Menu: StackHeaderMenu,\n MenuAction: StackHeaderMenuAction,\n Item: StackHeaderItem,\n Spacer: StackHeaderSpacer,\n});\n\nexport {\n StackHeaderBackButton,\n type StackHeaderBackButtonProps,\n type StackHeaderProps,\n StackHeaderLeft,\n type StackHeaderLeftProps,\n StackHeaderRight,\n type StackHeaderRightProps,\n StackHeaderSearchBar,\n type StackHeaderSearchBarProps,\n StackHeaderTitle,\n type StackHeaderTitleProps,\n StackHeaderButton,\n type StackHeaderButtonProps,\n StackHeaderBadge,\n type StackHeaderBadgeProps,\n StackHeaderLabel,\n type StackHeaderLabelProps,\n StackHeaderIcon,\n type StackHeaderIconProps,\n StackHeaderMenu,\n type StackHeaderMenuProps,\n StackHeaderMenuAction,\n type StackHeaderMenuActionProps,\n StackHeaderItem,\n type StackHeaderItemProps,\n StackHeaderSpacer,\n type StackHeaderSpacerProps,\n type StackHeaderItemSharedProps,\n};\n\nexport { StackScreen, appendScreenStackPropsToOptions, type StackScreenProps } from './StackScreen';\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { NativeStackHeaderItemButton } from '@react-navigation/native-stack';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import { type ColorValue, type ImageSourcePropType, type StyleProp, type TextStyle } from 'react-native';
|
|
4
|
+
import type { SFSymbol } from 'sf-symbols-typescript';
|
|
5
|
+
export interface StackHeaderItemSharedProps {
|
|
6
|
+
/**
|
|
7
|
+
* There are two ways to specify the content of the header item:
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* import { Stack } from 'expo-router';
|
|
12
|
+
*
|
|
13
|
+
* ...
|
|
14
|
+
* <Stack.Header.Button>As text passed as children</Stack.Header.Button>
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* import { Stack } from 'expo-router';
|
|
20
|
+
*
|
|
21
|
+
* ...
|
|
22
|
+
* <Stack.Header.Button>
|
|
23
|
+
* <Stack.Header.Icon sf="star.fill" />
|
|
24
|
+
* <Stack.Header.Label>As components</Stack.Header.Label>
|
|
25
|
+
* <Stack.Header.Badge>3</Stack.Header.Badge>
|
|
26
|
+
* </Stack.Header.Button>
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* **Note**: When icon is used, the label will not be shown and will be used for accessibility purposes only.
|
|
30
|
+
*/
|
|
31
|
+
children?: ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* Style for the label of the header item.
|
|
34
|
+
*/
|
|
35
|
+
style?: StyleProp<Pick<TextStyle, 'fontFamily' | 'fontSize' | 'fontWeight' | 'color'> & {
|
|
36
|
+
/**
|
|
37
|
+
* When set to 'transparent', the button will have no background color.
|
|
38
|
+
*
|
|
39
|
+
* @platform iOS 26+
|
|
40
|
+
*/
|
|
41
|
+
backgroundColor?: 'transparent';
|
|
42
|
+
}>;
|
|
43
|
+
/**
|
|
44
|
+
* Whether to separate the background of this item from other header items.
|
|
45
|
+
*
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
separateBackground?: boolean;
|
|
49
|
+
accessibilityLabel?: string;
|
|
50
|
+
accessibilityHint?: string;
|
|
51
|
+
disabled?: boolean;
|
|
52
|
+
tintColor?: ColorValue;
|
|
53
|
+
icon?: SFSymbol | ImageSourcePropType;
|
|
54
|
+
/**
|
|
55
|
+
* @default 'plain'
|
|
56
|
+
*/
|
|
57
|
+
variant?: 'plain' | 'done' | 'prominent';
|
|
58
|
+
}
|
|
59
|
+
type RNSharedHeaderItem = Pick<NativeStackHeaderItemButton, 'label' | 'labelStyle' | 'icon' | 'variant' | 'tintColor' | 'disabled' | 'width' | 'hidesSharedBackground' | 'sharesBackground' | 'identifier' | 'badge' | 'accessibilityLabel' | 'accessibilityHint'>;
|
|
60
|
+
export declare function convertStackHeaderSharedPropsToRNSharedHeaderItem(props: StackHeaderItemSharedProps): RNSharedHeaderItem;
|
|
61
|
+
export {};
|
|
62
|
+
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/layouts/stack-utils/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAClF,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAKtD,MAAM,WAAW,0BAA0B;IACzC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CACf,IAAI,CAAC,SAAS,EAAE,YAAY,GAAG,UAAU,GAAG,YAAY,GAAG,OAAO,CAAC,GAAG;QACpE;;;;WAIG;QACH,eAAe,CAAC,EAAE,aAAa,CAAC;KACjC,CACF,CAAC;IACF;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,IAAI,CAAC,EAAE,QAAQ,GAAG,mBAAmB,CAAC;IACtC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,WAAW,CAAC;CAC1C;AAGD,KAAK,kBAAkB,GAAG,IAAI,CAC5B,2BAA2B,EACzB,OAAO,GACP,YAAY,GACZ,MAAM,GACN,SAAS,GACT,WAAW,GACX,UAAU,GACV,OAAO,GACP,uBAAuB,GACvB,kBAAkB,GAClB,YAAY,GACZ,OAAO,GACP,oBAAoB,GACpB,mBAAmB,CACtB,CAAC;AAEF,wBAAgB,iDAAiD,CAC/D,KAAK,EAAE,0BAA0B,GAChC,kBAAkB,CAsDpB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertStackHeaderSharedPropsToRNSharedHeaderItem = convertStackHeaderSharedPropsToRNSharedHeaderItem;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_native_1 = require("react-native");
|
|
6
|
+
const common_primitives_1 = require("./common-primitives");
|
|
7
|
+
const children_1 = require("../../utils/children");
|
|
8
|
+
function convertStackHeaderSharedPropsToRNSharedHeaderItem(props) {
|
|
9
|
+
const { children, style, separateBackground, icon, ...rest } = props;
|
|
10
|
+
const stringChildren = react_1.Children.toArray(children)
|
|
11
|
+
.filter((child) => typeof child === 'string')
|
|
12
|
+
.join('');
|
|
13
|
+
const label = (0, children_1.getFirstChildOfType)(children, common_primitives_1.StackHeaderLabel);
|
|
14
|
+
const iconPropConvertedToIcon = props.icon
|
|
15
|
+
? typeof props.icon === 'string'
|
|
16
|
+
? { sf: props.icon }
|
|
17
|
+
: { src: props.icon }
|
|
18
|
+
: undefined;
|
|
19
|
+
const iconComponentProps = (0, children_1.getFirstChildOfType)(children, common_primitives_1.StackHeaderIcon)?.props ?? iconPropConvertedToIcon;
|
|
20
|
+
const badgeComponent = (0, children_1.getFirstChildOfType)(children, common_primitives_1.StackHeaderBadge);
|
|
21
|
+
const rnsIcon = (() => {
|
|
22
|
+
if (!iconComponentProps) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
if ('src' in iconComponentProps) {
|
|
26
|
+
return {
|
|
27
|
+
type: 'image',
|
|
28
|
+
source: iconComponentProps.src,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
type: 'sfSymbol',
|
|
33
|
+
name: iconComponentProps.sf,
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
const item = {
|
|
37
|
+
...rest,
|
|
38
|
+
label: label?.props.children ?? stringChildren,
|
|
39
|
+
sharesBackground: !separateBackground,
|
|
40
|
+
};
|
|
41
|
+
if (style) {
|
|
42
|
+
const { backgroundColor, ...convertedStyle } = convertTextStyleToRNTextStyle(style) ?? {};
|
|
43
|
+
item.labelStyle = convertedStyle;
|
|
44
|
+
item.hidesSharedBackground = backgroundColor === 'transparent';
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
item.hidesSharedBackground = false;
|
|
48
|
+
}
|
|
49
|
+
if (badgeComponent) {
|
|
50
|
+
item.badge = {
|
|
51
|
+
value: badgeComponent.props.children ?? '',
|
|
52
|
+
};
|
|
53
|
+
const badgeStyle = convertTextStyleToRNTextStyle(badgeComponent.props.style);
|
|
54
|
+
if (badgeStyle) {
|
|
55
|
+
item.badge.style = badgeStyle;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
if (rnsIcon) {
|
|
59
|
+
item.icon = rnsIcon;
|
|
60
|
+
}
|
|
61
|
+
return item;
|
|
62
|
+
}
|
|
63
|
+
function convertTextStyleToRNTextStyle(style) {
|
|
64
|
+
const flattenedStyle = react_native_1.StyleSheet.flatten(style);
|
|
65
|
+
if (!flattenedStyle) {
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
if ('fontWeight' in flattenedStyle) {
|
|
69
|
+
return {
|
|
70
|
+
...flattenedStyle,
|
|
71
|
+
fontWeight: typeof flattenedStyle.fontWeight === 'number'
|
|
72
|
+
? String(flattenedStyle.fontWeight)
|
|
73
|
+
: flattenedStyle.fontWeight,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return flattenedStyle;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/layouts/stack-utils/shared.ts"],"names":[],"mappings":";;AAyFA,8GAwDC;AAhJD,iCAAiD;AACjD,+CAMsB;AAGtB,2DAA0F;AAC1F,mDAA2D;AA6E3D,SAAgB,iDAAiD,CAC/D,KAAiC;IAEjC,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,kBAAkB,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IACrE,MAAM,cAAc,GAAG,gBAAQ,CAAC,OAAO,CAAC,QAA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,cAAc,EAAE,GAAG,6BAA6B,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QAC1F,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC;QACjC,IAAI,CAAC,qBAAqB,GAAG,eAAe,KAAK,aAAa,CAAC;IACjE,CAAC;SAAM,CAAC;QACN,IAAI,CAAC,qBAAqB,GAAG,KAAK,CAAC;IACrC,CAAC;IACD,IAAI,cAAc,EAAE,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG;YACX,KAAK,EAAE,cAAc,CAAC,KAAK,CAAC,QAAQ,IAAI,EAAE;SAC3C,CAAC;QACF,MAAM,UAAU,GAAG,6BAA6B,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAC7E,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,UAAU,CAAC;QAChC,CAAC;IACH,CAAC;IACD,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;IACtB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAMD,SAAS,6BAA6B,CACpC,KAA2C;IAM3C,MAAM,cAAc,GAAG,yBAAU,CAAC,OAAO,CAAC,KAAK,CAA8B,CAAC;IAC9E,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,YAAY,IAAI,cAAc,EAAE,CAAC;QACnC,OAAO;YACL,GAAG,cAAc;YACjB,UAAU,EACR,OAAO,cAAc,CAAC,UAAU,KAAK,QAAQ;gBAC3C,CAAC,CAAE,MAAM,CAAC,cAAc,CAAC,UAAU,CAA4B;gBAC/D,CAAC,CAAC,cAAc,CAAC,UAAU;SAChC,CAAC;IACJ,CAAC;IACD,OAAO,cAAmD,CAAC;AAC7D,CAAC","sourcesContent":["import type { NativeStackHeaderItemButton } from '@react-navigation/native-stack';\nimport { Children, type ReactNode } from 'react';\nimport {\n StyleSheet,\n type ColorValue,\n type ImageSourcePropType,\n type StyleProp,\n type TextStyle,\n} from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { StackHeaderBadge, StackHeaderIcon, StackHeaderLabel } from './common-primitives';\nimport { getFirstChildOfType } from '../../utils/children';\n\nexport interface StackHeaderItemSharedProps {\n /**\n * There are two ways to specify the content of the header item:\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * ...\n * <Stack.Header.Button>As text passed as children</Stack.Header.Button>\n * ```\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * ...\n * <Stack.Header.Button>\n * <Stack.Header.Icon sf=\"star.fill\" />\n * <Stack.Header.Label>As components</Stack.Header.Label>\n * <Stack.Header.Badge>3</Stack.Header.Badge>\n * </Stack.Header.Button>\n * ```\n *\n * **Note**: When icon is used, the label will not be shown and will be used for accessibility purposes only.\n */\n children?: ReactNode;\n /**\n * Style for the label of the header item.\n */\n style?: StyleProp<\n Pick<TextStyle, 'fontFamily' | 'fontSize' | 'fontWeight' | 'color'> & {\n /**\n * When set to 'transparent', the button will have no background color.\n *\n * @platform iOS 26+\n */\n backgroundColor?: 'transparent';\n }\n >;\n /**\n * Whether to separate the background of this item from other header items.\n *\n * @default false\n */\n separateBackground?: boolean;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n disabled?: boolean;\n tintColor?: ColorValue;\n icon?: SFSymbol | ImageSourcePropType;\n /**\n * @default 'plain'\n */\n variant?: 'plain' | 'done' | 'prominent';\n}\n\n// We need to pick these properties, as the SharedHeaderItem is not exported by React Navigation\ntype RNSharedHeaderItem = Pick<\n NativeStackHeaderItemButton,\n | 'label'\n | 'labelStyle'\n | 'icon'\n | 'variant'\n | 'tintColor'\n | 'disabled'\n | 'width'\n | 'hidesSharedBackground'\n | 'sharesBackground'\n | 'identifier'\n | 'badge'\n | 'accessibilityLabel'\n | 'accessibilityHint'\n>;\n\nexport function convertStackHeaderSharedPropsToRNSharedHeaderItem(\n props: StackHeaderItemSharedProps\n): RNSharedHeaderItem {\n const { children, style, separateBackground, icon, ...rest } = props;\n const stringChildren = Children.toArray(children)\n .filter((child) => typeof child === 'string')\n .join('');\n const label = getFirstChildOfType(children, StackHeaderLabel);\n const iconPropConvertedToIcon = props.icon\n ? typeof props.icon === 'string'\n ? { sf: props.icon }\n : { src: props.icon }\n : undefined;\n const iconComponentProps =\n getFirstChildOfType(children, StackHeaderIcon)?.props ?? iconPropConvertedToIcon;\n const badgeComponent = getFirstChildOfType(children, StackHeaderBadge);\n const rnsIcon: NativeStackHeaderItemButton['icon'] = (() => {\n if (!iconComponentProps) {\n return undefined;\n }\n if ('src' in iconComponentProps) {\n return {\n type: 'image',\n source: iconComponentProps.src,\n };\n }\n return {\n type: 'sfSymbol',\n name: iconComponentProps.sf,\n };\n })();\n const item: RNSharedHeaderItem = {\n ...rest,\n label: label?.props.children ?? stringChildren,\n sharesBackground: !separateBackground,\n };\n if (style) {\n const { backgroundColor, ...convertedStyle } = convertTextStyleToRNTextStyle(style) ?? {};\n item.labelStyle = convertedStyle;\n item.hidesSharedBackground = backgroundColor === 'transparent';\n } else {\n item.hidesSharedBackground = false;\n }\n if (badgeComponent) {\n item.badge = {\n value: badgeComponent.props.children ?? '',\n };\n const badgeStyle = convertTextStyleToRNTextStyle(badgeComponent.props.style);\n if (badgeStyle) {\n item.badge.style = badgeStyle;\n }\n }\n if (rnsIcon) {\n item.icon = rnsIcon;\n }\n return item;\n}\n\ntype NumericFontWeight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;\n\ntype ConvertedFontWeightType = Exclude<TextStyle['fontWeight'], number> | `${NumericFontWeight}`;\n\nfunction convertTextStyleToRNTextStyle<BaseStyleType extends Pick<TextStyle, 'fontWeight'>>(\n style: StyleProp<BaseStyleType | undefined>\n):\n | (Omit<BaseStyleType, 'fontWeight'> & {\n fontWeight?: ConvertedFontWeightType;\n })\n | undefined {\n const flattenedStyle = StyleSheet.flatten(style) as BaseStyleType | undefined;\n if (!flattenedStyle) {\n return undefined;\n }\n if ('fontWeight' in flattenedStyle) {\n return {\n ...flattenedStyle,\n fontWeight:\n typeof flattenedStyle.fontWeight === 'number'\n ? (String(flattenedStyle.fontWeight) as `${NumericFontWeight}`)\n : flattenedStyle.fontWeight,\n };\n }\n return flattenedStyle as Omit<BaseStyleType, 'fontWeight'>;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoLink.d.ts","sourceRoot":"","sources":["../../src/link/ExpoLink.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAMxD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"ExpoLink.d.ts","sourceRoot":"","sources":["../../src/link/ExpoLink.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAMxD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,qBAMxC"}
|
package/build/link/ExpoLink.js
CHANGED
|
@@ -44,29 +44,30 @@ const BaseExpoRouterLink_1 = require("./BaseExpoRouterLink");
|
|
|
44
44
|
const LinkWithPreview_1 = require("./LinkWithPreview");
|
|
45
45
|
const elements_1 = require("./elements");
|
|
46
46
|
const PreviewRouteContext_1 = require("./preview/PreviewRouteContext");
|
|
47
|
-
const
|
|
47
|
+
const useZoomHref_1 = require("./zoom/useZoomHref");
|
|
48
48
|
const url_1 = require("../utils/url");
|
|
49
|
-
const
|
|
49
|
+
const zoom_transition_context_providers_1 = require("./zoom/zoom-transition-context-providers");
|
|
50
50
|
function ExpoLink(props) {
|
|
51
|
+
return (<zoom_transition_context_providers_1.ZoomTransitionSourceContextProvider linkProps={props}>
|
|
52
|
+
<ExpoLinkImpl {...props}/>
|
|
53
|
+
</zoom_transition_context_providers_1.ZoomTransitionSourceContextProvider>);
|
|
54
|
+
}
|
|
55
|
+
function ExpoLinkImpl(props) {
|
|
51
56
|
const isPreview = (0, PreviewRouteContext_1.useIsPreview)();
|
|
52
|
-
const
|
|
57
|
+
const href = (0, useZoomHref_1.useZoomHref)(props);
|
|
53
58
|
const shouldUseLinkWithPreview = process.env.EXPO_OS === 'ios' &&
|
|
54
59
|
isLinkWithPreview(props) &&
|
|
55
60
|
!isPreview &&
|
|
56
61
|
expo_constants_1.default?.expoConfig?.newArchEnabled !== false;
|
|
57
62
|
if (shouldUseLinkWithPreview) {
|
|
58
|
-
return
|
|
59
|
-
<LinkWithPreview_1.LinkWithPreview {...props} href={href} hrefForPreviewNavigation={props.href}/>
|
|
60
|
-
</zoom_transition_context_1.ZoomTransitionSourceContext>);
|
|
63
|
+
return <LinkWithPreview_1.LinkWithPreview {...props} href={href} hrefForPreviewNavigation={props.href}/>;
|
|
61
64
|
}
|
|
62
65
|
let children = props.children;
|
|
63
66
|
if (react_1.default.Children.count(props.children) > 1) {
|
|
64
67
|
const arrayChildren = react_1.default.Children.toArray(props.children).filter((child) => !(0, react_1.isValidElement)(child) || (child.type !== elements_1.LinkPreview && child.type !== elements_1.LinkMenu));
|
|
65
68
|
children = arrayChildren.length === 1 ? arrayChildren[0] : props.children;
|
|
66
69
|
}
|
|
67
|
-
return
|
|
68
|
-
<BaseExpoRouterLink_1.BaseExpoRouterLink {...props} href={href} children={children}/>
|
|
69
|
-
</zoom_transition_context_1.ZoomTransitionSourceContext>);
|
|
70
|
+
return <BaseExpoRouterLink_1.BaseExpoRouterLink {...props} href={href} children={children}/>;
|
|
70
71
|
}
|
|
71
72
|
function isLinkWithPreview(props) {
|
|
72
73
|
const isExternal = (0, url_1.shouldLinkExternally)(String(props.href));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoLink.js","sourceRoot":"","sources":["../../src/link/ExpoLink.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;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,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,CACjE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,IAAA,sBAAc,EAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,sBAAW,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAQ,CAAC,CAC7F,CAAC;QACF,QAAQ,GAAG,aAAa,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC;IAC5E,CAAC;IAED,OAAO,CAAC,uCAAkB,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,EAAG,CAAC;AAC3E,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAgB;IACzC,MAAM,UAAU,GAAG,IAAA,0BAAoB,EAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5D,OAAO,gBAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC1C,CAAC,KAAK,EAAE,EAAE,CACR,IAAA,sBAAc,EAAC,KAAK,CAAC;QACrB,CAAC,CAAC,CAAC,UAAU,IAAI,KAAK,CAAC,IAAI,KAAK,sBAAW,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAQ,CAAC,CAC3E,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport Constants from 'expo-constants';\nimport React, { Children, isValidElement } from 'react';\n\nimport { BaseExpoRouterLink } from './BaseExpoRouterLink';\nimport { LinkWithPreview } from './LinkWithPreview';\nimport { LinkMenu, LinkPreview } from './elements';\nimport { useIsPreview } from './preview/PreviewRouteContext';\nimport { LinkProps } from './useLinkHooks';\nimport { useZoomHref } from './zoom/useZoomHref';\nimport { shouldLinkExternally } from '../utils/url';\nimport { ZoomTransitionSourceContextProvider } from './zoom/zoom-transition-context-providers';\n\nexport function ExpoLink(props: LinkProps) {\n return (\n <ZoomTransitionSourceContextProvider linkProps={props}>\n <ExpoLinkImpl {...props} />\n </ZoomTransitionSourceContextProvider>\n );\n}\n\nfunction ExpoLinkImpl(props: LinkProps) {\n const isPreview = useIsPreview();\n const href = useZoomHref(props);\n const shouldUseLinkWithPreview =\n process.env.EXPO_OS === 'ios' &&\n isLinkWithPreview(props) &&\n !isPreview &&\n Constants?.expoConfig?.newArchEnabled !== false;\n if (shouldUseLinkWithPreview) {\n return <LinkWithPreview {...props} href={href} hrefForPreviewNavigation={props.href} />;\n }\n let children = props.children;\n if (React.Children.count(props.children) > 1) {\n const arrayChildren = React.Children.toArray(props.children).filter(\n (child) => !isValidElement(child) || (child.type !== LinkPreview && child.type !== LinkMenu)\n );\n children = arrayChildren.length === 1 ? arrayChildren[0] : props.children;\n }\n\n return <BaseExpoRouterLink {...props} href={href} children={children} />;\n}\n\nfunction isLinkWithPreview(props: LinkProps): boolean {\n const isExternal = shouldLinkExternally(String(props.href));\n return Children.toArray(props.children).some(\n (child) =>\n isValidElement(child) &&\n ((!isExternal && child.type === LinkPreview) || child.type === LinkMenu)\n );\n}\n"]}
|
|
@@ -50,10 +50,12 @@ interface LinkSourceAlignmentRect {
|
|
|
50
50
|
width: number;
|
|
51
51
|
height: number;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
interface LinkZoomTransitionSourceProps extends PropsWithChildren {
|
|
54
54
|
identifier: string;
|
|
55
55
|
alignment?: LinkSourceAlignmentRect;
|
|
56
|
-
|
|
56
|
+
animateAspectRatioChange?: boolean;
|
|
57
|
+
}
|
|
58
|
+
export declare function LinkZoomTransitionSource(props: LinkZoomTransitionSourceProps): import("react").JSX.Element | null;
|
|
57
59
|
export declare function LinkZoomTransitionAlignmentRectDetector(props: {
|
|
58
60
|
identifier: string;
|
|
59
61
|
children: React.ReactNode;
|
|
@@ -1 +1 @@
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AA6B,sCAa5E;AASD,wBAAgB,uCAAuC,CAAC,KAAK,EAAE;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,sCAaA"}
|
|
@@ -47,7 +47,7 @@ function NativeLinkPreviewContent(props) {
|
|
|
47
47
|
return <NativeLinkPreviewContentView {...props} style={style}/>;
|
|
48
48
|
}
|
|
49
49
|
// #endregion
|
|
50
|
-
// #region Zoom transition
|
|
50
|
+
// #region Zoom transition enabler
|
|
51
51
|
const LinkZoomTransitionEnablerNativeView = areNativeViewsAvailable
|
|
52
52
|
? (0, expo_1.requireNativeView)('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionEnabler')
|
|
53
53
|
: null;
|
|
@@ -66,6 +66,8 @@ function LinkZoomTransitionSource(props) {
|
|
|
66
66
|
}
|
|
67
67
|
return (<LinkZoomTransitionSourceNativeView {...props} disableForceFlatten collapsable={false} collapsableChildren={false} style={{ display: 'contents' }}/>);
|
|
68
68
|
}
|
|
69
|
+
// #endregion
|
|
70
|
+
// #region Zoom transition rect detector
|
|
69
71
|
const LinkZoomTransitionAlignmentRectDetectorNative = areNativeViewsAvailable
|
|
70
72
|
? (0, expo_1.requireNativeView)('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionAlignmentRectDetector')
|
|
71
73
|
: react_1.Fragment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../src/link/preview/native.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAkCb,0DAKC;AA4BD,8CAKC;AAYD,4DAaC;AASD,8DAcC;
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../src/link/preview/native.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAkCb,0DAKC;AA4BD,8CAKC;AAYD,4DAaC;AASD,8DAcC;AAyBD,4DAaC;AASD,0FAgBC;AArLD,+BAAyC;AACzC,iCAAyD;AACz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CAAC;IACd,CAAC;IACD,OAAO,CACL,CAAC,6CAA6C,CAC5C,IAAI,KAAK,CAAC,CACV,mBAAmB,CACnB,WAAW,CAAC,CAAC,KAAK,CAAC,CACnB,mBAAmB,CAAC,CAAC,KAAK,CAAC,CAC3B,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAC/B,CACH,CAAC;AACJ,CAAC;AACD,aAAa","sourcesContent":["'use client';\n\nimport { requireNativeView } from 'expo';\nimport { Fragment, type PropsWithChildren } from 'react';\nimport { Platform, StyleSheet, type ViewProps } from 'react-native';\n\nconst areNativeViewsAvailable =\n process.env.EXPO_OS === 'ios' && !Platform.isTV && global.RN$Bridgeless === true;\n\n// #region Action View\nexport interface NativeLinkPreviewActionProps {\n identifier: string;\n title: string;\n icon?: string;\n children?: React.ReactNode;\n disabled?: boolean;\n destructive?: boolean;\n // This may lead to race conditions, when two menu actions are on at the same time.\n // The logic should be enforced in the JS code, rather than in the native code.\n // singleSelection?: boolean;\n displayAsPalette?: boolean;\n displayInline?: boolean;\n isOn?: boolean;\n // There are issues with menu state updates when keep presented is set to true.\n // When updating the context menu state, it will either not update or it will recreate the menu. The latter is a problem,\n // because it will close all opened submenus and reset the scroll position.\n // TODO: (@ubax) find a way to fix this.\n keepPresented?: boolean;\n onSelected: () => void;\n}\nconst LinkPreviewNativeActionView: React.ComponentType<NativeLinkPreviewActionProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkPreviewNativeActionView')\n : null;\nexport function NativeLinkPreviewAction(props: NativeLinkPreviewActionProps) {\n if (!LinkPreviewNativeActionView) {\n return null;\n }\n return <LinkPreviewNativeActionView {...props} />;\n}\n// #endregion\n\n// #region Preview View\nexport interface TabPath {\n oldTabKey: string;\n newTabKey: string;\n}\nexport interface NativeLinkPreviewProps extends ViewProps {\n nextScreenId: string | undefined;\n tabPath:\n | {\n path: TabPath[];\n }\n | undefined;\n disableForceFlatten?: boolean;\n onWillPreviewOpen?: () => void;\n onDidPreviewOpen?: () => void;\n onPreviewWillClose?: () => void;\n onPreviewDidClose?: () => void;\n onPreviewTapped?: () => void;\n onPreviewTappedAnimationCompleted?: () => void;\n children: React.ReactNode;\n}\nconst NativeLinkPreviewView: React.ComponentType<NativeLinkPreviewProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'NativeLinkPreviewView')\n : null;\nexport function NativeLinkPreview(props: NativeLinkPreviewProps) {\n if (!NativeLinkPreviewView) {\n return null;\n }\n return <NativeLinkPreviewView {...props} />;\n}\n// #endregion\n\n// #region Preview Content View\nexport interface NativeLinkPreviewContentProps extends ViewProps {\n preferredContentSize?: { width: number; height: number };\n}\nconst NativeLinkPreviewContentView: React.ComponentType<NativeLinkPreviewContentProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'NativeLinkPreviewContentView')\n : null;\n\nexport function NativeLinkPreviewContent(props: NativeLinkPreviewContentProps) {\n if (!NativeLinkPreviewContentView) {\n return null;\n }\n const style = StyleSheet.flatten([\n props.style,\n {\n position: 'absolute',\n top: 0,\n left: 0,\n } as const,\n ]);\n return <NativeLinkPreviewContentView {...props} style={style} />;\n}\n// #endregion\n\n// #region Zoom transition enabler\nconst LinkZoomTransitionEnablerNativeView: React.ComponentType<\n ViewProps & { zoomTransitionSourceIdentifier: string; disableForceFlatten?: boolean }\n> | null = areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionEnabler')\n : null;\nexport function LinkZoomTransitionEnabler(props: {\n zoomTransitionSourceIdentifier: string;\n preventInteractiveDismissal?: boolean;\n}) {\n if (!LinkZoomTransitionEnablerNativeView) {\n return null;\n }\n return (\n <LinkZoomTransitionEnablerNativeView\n {...props}\n disableForceFlatten\n style={{ display: 'contents' }}\n />\n );\n}\n// #endregion\n\n// #region Zoom transition source\ninterface LinkSourceAlignmentRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\ninterface LinkZoomTransitionSourceProps extends PropsWithChildren {\n identifier: string;\n alignment?: LinkSourceAlignmentRect;\n animateAspectRatioChange?: boolean;\n}\n\ninterface LinkZoomTransitionSourceNativeProps extends ViewProps, LinkZoomTransitionSourceProps {\n disableForceFlatten?: boolean;\n}\n\nconst LinkZoomTransitionSourceNativeView: React.ComponentType<LinkZoomTransitionSourceNativeProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionSource')\n : null;\nexport function LinkZoomTransitionSource(props: LinkZoomTransitionSourceProps) {\n if (!LinkZoomTransitionSourceNativeView) {\n return null;\n }\n return (\n <LinkZoomTransitionSourceNativeView\n {...props}\n disableForceFlatten\n collapsable={false}\n collapsableChildren={false}\n style={{ display: 'contents' }}\n />\n );\n}\n// #endregion\n\n// #region Zoom transition rect detector\nconst LinkZoomTransitionAlignmentRectDetectorNative: React.ComponentType<\n ViewProps & { identifier: string; disableForceFlatten?: boolean; children?: React.ReactNode }\n> | null = areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionAlignmentRectDetector')\n : Fragment;\nexport function LinkZoomTransitionAlignmentRectDetector(props: {\n identifier: string;\n children: React.ReactNode;\n}) {\n if (!LinkZoomTransitionAlignmentRectDetectorNative) {\n return null;\n }\n return (\n <LinkZoomTransitionAlignmentRectDetectorNative\n {...props}\n disableForceFlatten\n collapsable={false}\n collapsableChildren={false}\n style={{ display: 'contents' }}\n />\n );\n}\n// #endregion\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoomTransitionEnabler.ios.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.ios.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAahF,wBAAgB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"ZoomTransitionEnabler.ios.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.ios.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAahF,wBAAgB,oBAAoB,SAKnC;AAED,wBAAgB,uBAAuB,YAEtC;AAED,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,EAAE,0BAA0B,sCAmC1E"}
|
|
@@ -10,8 +10,10 @@ const PreviewRouteContext_1 = require("../preview/PreviewRouteContext");
|
|
|
10
10
|
const native_1 = require("../preview/native");
|
|
11
11
|
let _isZoomTransitionEnabled = false;
|
|
12
12
|
function enableZoomTransition() {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
if (process.env.EXPO_OS === 'ios') {
|
|
14
|
+
console.warn('[expo-router] Zoom transition is an experimental feature. Use at your own risk.');
|
|
15
|
+
_isZoomTransitionEnabled = true;
|
|
16
|
+
}
|
|
15
17
|
}
|
|
16
18
|
function isZoomTransitionEnabled() {
|
|
17
19
|
return _isZoomTransitionEnabled;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoomTransitionEnabler.ios.js","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.ios.tsx"],"names":[],"mappings":";;AAeA,
|
|
1
|
+
{"version":3,"file":"ZoomTransitionEnabler.ios.js","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.ios.tsx"],"names":[],"mappings":";;AAeA,oDAKC;AAED,0DAEC;AAED,sDAmCC;AA7DD,iCAA4B;AAG5B,qFAAiF;AACjF,6DAKgC;AAChC,wEAA8D;AAC9D,8CAA8D;AAE9D,IAAI,wBAAwB,GAAG,KAAK,CAAC;AAErC,SAAgB,oBAAoB;IAClC,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;QAClC,OAAO,CAAC,IAAI,CAAC,iFAAiF,CAAC,CAAC;QAChG,wBAAwB,GAAG,IAAI,CAAC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zD,CACH,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { use } from 'react';\n\nimport type { ZoomTransitionEnablerProps } from './ZoomTransitionEnabler.types';\nimport { DescriptorsContext } from '../../fork/native-stack/descriptors-context';\nimport {\n getInternalExpoRouterParams,\n INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME,\n} from '../../navigationParams';\nimport { useIsPreview } from '../preview/PreviewRouteContext';\nimport { LinkZoomTransitionEnabler } from '../preview/native';\n\nlet _isZoomTransitionEnabled = false;\n\nexport function enableZoomTransition() {\n if (process.env.EXPO_OS === 'ios') {\n console.warn('[expo-router] Zoom transition is an experimental feature. Use at your own risk.');\n _isZoomTransitionEnabled = true;\n }\n}\n\nexport function isZoomTransitionEnabled() {\n return _isZoomTransitionEnabled;\n}\n\nexport function ZoomTransitionEnabler({ route }: ZoomTransitionEnablerProps) {\n const isPreview = useIsPreview();\n if (\n isZoomTransitionEnabled() &&\n !isPreview &&\n route &&\n typeof route === 'object' &&\n 'params' in route &&\n typeof route.params === 'object' &&\n 'key' in route &&\n typeof route.key === 'string'\n ) {\n const params = route.params ?? {};\n const internalParams = getInternalExpoRouterParams(params);\n const zoomTransitionId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME];\n const zoomTransitionScreenId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME];\n const isLinkPreviewNavigation =\n !!internalParams[INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME];\n const hasZoomTransition =\n !!zoomTransitionId && zoomTransitionScreenId === route.key && !isLinkPreviewNavigation;\n if (hasZoomTransition && typeof zoomTransitionId === 'string') {\n const descriptorsMap = use(DescriptorsContext);\n const currentDescriptor = descriptorsMap[route.key];\n const preventInteractiveDismissal = currentDescriptor?.options?.gestureEnabled === false;\n return (\n <LinkZoomTransitionEnabler\n zoomTransitionSourceIdentifier={zoomTransitionId}\n preventInteractiveDismissal={preventInteractiveDismissal}\n />\n );\n }\n }\n return null;\n}\n"]}
|
|
@@ -29,11 +29,18 @@ function LinkAppleZoomImpl({ children, alignmentRect, ...rest }) {
|
|
|
29
29
|
addSource();
|
|
30
30
|
return removeSource;
|
|
31
31
|
}, [addSource, removeSource]);
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
const hasTooManyChildren = react_1.Children.count(children) > 1;
|
|
33
|
+
(0, react_1.useEffect)(() => {
|
|
34
|
+
if (process.env.NODE_ENV !== 'production' && hasTooManyChildren) {
|
|
35
|
+
console.warn('[expo-router] Link.ZoomTransitionSource only accepts a single child component. Please wrap multiple children in a View or another container component.');
|
|
36
|
+
}
|
|
37
|
+
}, [hasTooManyChildren]);
|
|
38
|
+
if (hasTooManyChildren) {
|
|
34
39
|
return null;
|
|
35
40
|
}
|
|
36
|
-
return (<native_1.LinkZoomTransitionSource identifier={identifier} alignment={alignmentRect}
|
|
41
|
+
return (<native_1.LinkZoomTransitionSource identifier={identifier} alignment={alignmentRect}
|
|
42
|
+
// Note(@ubax): Even though we always set this to true, I want to keep the prop here for easier future changes.
|
|
43
|
+
animateAspectRatioChange>
|
|
37
44
|
<Slot_1.Slot {...rest}>{children}</Slot_1.Slot>
|
|
38
45
|
</native_1.LinkZoomTransitionSource>);
|
|
39
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link-apple-zoom.js","sourceRoot":"","sources":["../../../src/link/zoom/link-apple-zoom.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AA6Bb,sCAKC;AAhCD,iCAAyE;AAEzE,2EAAsE;AACtE,uEAAwE;AACxE,wCAAqC;AACrC,8CAA6D;AAgB7D;;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A0B;IACrF,MAAM,KAAK,GAAG,IAAA,WAAG,EAAC,qDAA2B,CAAC,CAAC;IAC/C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;IACxF,CAAC;IACD,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAEtD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,SAAS,EAAE,CAAC;QACZ,OAAO,YAAY,CAAC;IACtB,CAAC,EAAE,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC,CAAC;IAE9B,MAAM,kBAAkB,GAAG,gBAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAExD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,IAAI,kBAAkB,EAAE,CAAC;YAChE,OAAO,CAAC,IAAI,CACV,wJAAwJ,CACzJ,CAAC;QACJ,CAAC;IACH,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,CAAC;IAEzB,IAAI,kBAAkB,EAAE,CAAC;QACvB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,CACL,CAAC,iCAAwB,CACvB,UAAU,CAAC,CAAC,UAAU,CAAC,CACvB,SAAS,CAAC,CAAC,aAAa,CAAC;IACzB,+GAA+G;IAC/G,wBAAwB,CACxB;MAAA,CAAC,WAAI,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,WAAI,CAClC;IAAA,EAAE,iCAAwB,CAAC,CAC5B,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport { Children, use, useEffect, type PropsWithChildren } from 'react';\n\nimport { isZoomTransitionEnabled } from './ZoomTransitionEnabler.ios';\nimport { ZoomTransitionSourceContext } from './zoom-transition-context';\nimport { Slot } from '../../ui/Slot';\nimport { LinkZoomTransitionSource } from '../preview/native';\n\ninterface LinkAppleZoomProps extends PropsWithChildren {\n /**\n * Defines the rectangle used for the zoom transition's alignment. This rectangle is specified in the zoomed screen's coordinate space.\n *\n * @platform ios 18+\n */\n alignmentRect?: {\n x: number;\n y: number;\n width: number;\n height: number;\n };\n}\n\n/**\n * When this component is used inside a Link, [zoom transition](https://developer.apple.com/documentation/uikit/enhancing-your-app-with-fluid-transitions?language=objc)\n * will be used when navigating to the link's href.\n *\n * @platform ios 18+\n */\nexport function LinkAppleZoom(props: LinkAppleZoomProps) {\n if (!isZoomTransitionEnabled()) {\n return <Slot {...props} />;\n }\n return <LinkAppleZoomImpl {...props} />;\n}\n\ntype LinkAppleZoomImplProps = LinkAppleZoomProps & {\n onPress?: () => void;\n};\n\nfunction LinkAppleZoomImpl({ children, alignmentRect, ...rest }: LinkAppleZoomImplProps) {\n const value = use(ZoomTransitionSourceContext);\n if (!value) {\n throw new Error('[expo-router] Link.ZoomTransitionSource must be used within a Link');\n }\n const { identifier, addSource, removeSource } = value;\n\n useEffect(() => {\n addSource();\n return removeSource;\n }, [addSource, removeSource]);\n\n const hasTooManyChildren = Children.count(children) > 1;\n\n useEffect(() => {\n if (process.env.NODE_ENV !== 'production' && hasTooManyChildren) {\n console.warn(\n '[expo-router] Link.ZoomTransitionSource only accepts a single child component. Please wrap multiple children in a View or another container component.'\n );\n }\n }, [hasTooManyChildren]);\n\n if (hasTooManyChildren) {\n return null;\n }\n\n return (\n <LinkZoomTransitionSource\n identifier={identifier}\n alignment={alignmentRect}\n // Note(@ubax): Even though we always set this to true, I want to keep the prop here for easier future changes.\n animateAspectRatioChange>\n <Slot {...rest}>{children}</Slot>\n </LinkZoomTransitionSource>\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useZoomHref.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/useZoomHref.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS,uCAE9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useZoomHref.ios.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/useZoomHref.ios.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS,uCA8B9C"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.useZoomHref = useZoomHref;
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const navigationParams_1 = require("../../navigationParams");
|
|
7
|
+
const url_1 = require("../../utils/url");
|
|
8
|
+
const zoom_transition_context_1 = require("./zoom-transition-context");
|
|
9
|
+
function useZoomHref({ href }) {
|
|
10
|
+
const value = (0, react_1.use)(zoom_transition_context_1.ZoomTransitionSourceContext);
|
|
11
|
+
if (!value) {
|
|
12
|
+
throw new Error('[expo-router] useZoomHref must be used within a ZoomTransitionSourceContextProvider. This is most likely a bug in expo-router.');
|
|
13
|
+
}
|
|
14
|
+
const { hasZoomSource, identifier } = value;
|
|
15
|
+
return (0, react_1.useMemo)(() => {
|
|
16
|
+
if (!hasZoomSource) {
|
|
17
|
+
return href;
|
|
18
|
+
}
|
|
19
|
+
if (typeof href === 'string') {
|
|
20
|
+
const { pathname, searchParams } = (0, url_1.parseUrlUsingCustomBase)(href);
|
|
21
|
+
return {
|
|
22
|
+
pathname,
|
|
23
|
+
params: {
|
|
24
|
+
...Object.fromEntries(searchParams.entries()),
|
|
25
|
+
[navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: identifier,
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
pathname: href.pathname,
|
|
31
|
+
params: {
|
|
32
|
+
...(href.params ?? {}),
|
|
33
|
+
[navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: identifier,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
}, [href, identifier, hasZoomSource]);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=useZoomHref.ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useZoomHref.ios.js","sourceRoot":"","sources":["../../../src/link/zoom/useZoomHref.ios.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AASb,kCA8BC;AArCD,iCAAqC;AAErC,6DAAmG;AACnG,yCAA0D;AAE1D,uEAAwE;AAExE,SAAgB,WAAW,CAAC,EAAE,IAAI,EAAa;IAC7C,MAAM,KAAK,GAAG,IAAA,WAAG,EAAC,qDAA2B,CAAC,CAAC;IAC/C,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,KAAK,CACb,gIAAgI,CACjI,CAAC;IACJ,CAAC;IACD,MAAM,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,CAAC;IAC5C,OAAO,IAAA,eAAO,EAAC,GAAG,EAAE;QAClB,IAAI,CAAC,aAAa,EAAE,CAAC;YACnB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC7B,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,IAAA,6BAAuB,EAAC,IAAI,CAAC,CAAC;YACjE,OAAO;gBACL,QAAQ;gBACR,MAAM,EAAE;oBACN,GAAG,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC;oBAC7C,CAAC,4EAAyD,CAAC,EAAE,UAAU;iBACxE;aACF,CAAC;QACJ,CAAC;QACD,OAAO;YACL,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE;gBACN,GAAG,CAAC,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;gBACtB,CAAC,4EAAyD,CAAC,EAAE,UAAU;aACxE;SACF,CAAC;IACJ,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC,CAAC;AACxC,CAAC","sourcesContent":["'use client';\n\nimport { use, useMemo } from 'react';\n\nimport { INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME } from '../../navigationParams';\nimport { parseUrlUsingCustomBase } from '../../utils/url';\nimport { LinkProps } from '../useLinkHooks';\nimport { ZoomTransitionSourceContext } from './zoom-transition-context';\n\nexport function useZoomHref({ href }: LinkProps) {\n const value = use(ZoomTransitionSourceContext);\n if (!value) {\n throw new Error(\n '[expo-router] useZoomHref must be used within a ZoomTransitionSourceContextProvider. This is most likely a bug in expo-router.'\n );\n }\n const { hasZoomSource, identifier } = value;\n return useMemo(() => {\n if (!hasZoomSource) {\n return href;\n }\n if (typeof href === 'string') {\n const { pathname, searchParams } = parseUrlUsingCustomBase(href);\n return {\n pathname,\n params: {\n ...Object.fromEntries(searchParams.entries()),\n [INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: identifier,\n },\n };\n }\n return {\n pathname: href.pathname,\n params: {\n ...(href.params ?? {}),\n [INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME]: identifier,\n },\n };\n }, [href, identifier, hasZoomSource]);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useZoomHref.js","sourceRoot":"","sources":["../../../src/link/zoom/useZoomHref.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAIb,kCAEC;AAFD,SAAgB,WAAW,CAAC,EAAE,IAAI,EAAa;IAC7C,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["'use client';\n\nimport { LinkProps } from '../useLinkHooks';\n\nexport function useZoomHref({ href }: LinkProps) {\n return href;\n}\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ZoomTransitionSourceContextProviderProps, ZoomTransitionTargetContextProviderProps } from './zoom-transition-context-providers.types';
|
|
2
|
+
export declare function ZoomTransitionSourceContextProvider({ children, }: ZoomTransitionSourceContextProviderProps): import("react").ReactNode;
|
|
3
|
+
export declare function ZoomTransitionTargetContextProvider({ children, }: ZoomTransitionTargetContextProviderProps): import("react").ReactNode;
|
|
4
|
+
//# sourceMappingURL=zoom-transition-context-providers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom-transition-context-providers.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context-providers.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,wCAAwC,EACxC,wCAAwC,EACzC,MAAM,2CAA2C,CAAC;AAEnD,wBAAgB,mCAAmC,CAAC,EAClD,QAAQ,GACT,EAAE,wCAAwC,6BAE1C;AAED,wBAAgB,mCAAmC,CAAC,EAClD,QAAQ,GACT,EAAE,wCAAwC,6BAE1C"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ZoomTransitionSourceContextProviderProps, ZoomTransitionTargetContextProviderProps } from './zoom-transition-context-providers.types';
|
|
2
|
+
export declare function ZoomTransitionSourceContextProvider({ children, linkProps, }: ZoomTransitionSourceContextProviderProps): import("react").JSX.Element;
|
|
3
|
+
export declare function ZoomTransitionTargetContextProvider({ route, children, }: ZoomTransitionTargetContextProviderProps): string | number | bigint | boolean | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react").JSX.Element | null | undefined;
|
|
4
|
+
//# sourceMappingURL=zoom-transition-context-providers.ios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoom-transition-context-providers.ios.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context-providers.ios.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,wCAAwC,EACxC,wCAAwC,EACzC,MAAM,2CAA2C,CAAC;AASnD,wBAAgB,mCAAmC,CAAC,EAClD,QAAQ,EACR,SAAS,GACV,EAAE,wCAAwC,+BAgD1C;AAED,wBAAgB,mCAAmC,CAAC,EAClD,KAAK,EACL,QAAQ,GACT,EAAE,wCAAwC,+VA4B1C"}
|