expo-router 7.0.0-canary-20251206-615dec1 → 7.0.0-canary-20251211-7da85ea

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.
Files changed (103) hide show
  1. package/android/build.gradle +2 -2
  2. package/build/ExpoRoot.d.ts.map +1 -1
  3. package/build/ExpoRoot.js +2 -1
  4. package/build/ExpoRoot.js.map +1 -1
  5. package/build/color/android.dynamic.types.d.ts +3 -3
  6. package/build/color/android.dynamic.types.js.map +1 -1
  7. package/build/color/android.material.types.d.ts +3 -3
  8. package/build/color/android.material.types.js.map +1 -1
  9. package/build/fork/getPathFromState.d.ts.map +1 -1
  10. package/build/fork/getPathFromState.js +2 -1
  11. package/build/fork/getPathFromState.js.map +1 -1
  12. package/build/fork/getStateFromPath-forks.d.ts.map +1 -1
  13. package/build/fork/getStateFromPath-forks.js +3 -7
  14. package/build/fork/getStateFromPath-forks.js.map +1 -1
  15. package/build/link/Link.d.ts +2 -0
  16. package/build/link/Link.d.ts.map +1 -1
  17. package/build/link/Link.js +2 -0
  18. package/build/link/Link.js.map +1 -1
  19. package/build/link/elements.d.ts +15 -4
  20. package/build/link/elements.d.ts.map +1 -1
  21. package/build/link/elements.js +7 -2
  22. package/build/link/elements.js.map +1 -1
  23. package/build/link/preview/native.d.ts +5 -1
  24. package/build/link/preview/native.d.ts.map +1 -1
  25. package/build/link/preview/native.js +12 -1
  26. package/build/link/preview/native.js.map +1 -1
  27. package/build/link/useLinkHooks.d.ts +1 -1
  28. package/build/link/zoom/link-apple-zoom-target.d.ts +3 -0
  29. package/build/link/zoom/link-apple-zoom-target.d.ts.map +1 -0
  30. package/build/link/zoom/link-apple-zoom-target.js +20 -0
  31. package/build/link/zoom/link-apple-zoom-target.js.map +1 -0
  32. package/build/link/zoom/useZoomTransitionPrimitives.ios.d.ts.map +1 -1
  33. package/build/link/zoom/useZoomTransitionPrimitives.ios.js +4 -1
  34. package/build/link/zoom/useZoomTransitionPrimitives.ios.js.map +1 -1
  35. package/build/link/zoom/zoom-transition-context.d.ts +7 -0
  36. package/build/link/zoom/zoom-transition-context.d.ts.map +1 -1
  37. package/build/link/zoom/zoom-transition-context.js +32 -1
  38. package/build/link/zoom/zoom-transition-context.js.map +1 -1
  39. package/build/loaders/utils.d.ts.map +1 -1
  40. package/build/loaders/utils.js +2 -1
  41. package/build/loaders/utils.js.map +1 -1
  42. package/build/native-tabs/NativeTabTrigger.d.ts +1 -1
  43. package/build/native-tabs/NativeTabTrigger.d.ts.map +1 -1
  44. package/build/native-tabs/NativeTabTrigger.js +5 -6
  45. package/build/native-tabs/NativeTabTrigger.js.map +1 -1
  46. package/build/native-tabs/NativeTabsView.web.js +1 -1
  47. package/build/native-tabs/NativeTabsView.web.js.map +1 -1
  48. package/build/onboard/Tutorial.d.ts.map +1 -1
  49. package/build/onboard/Tutorial.js +19 -8
  50. package/build/onboard/Tutorial.js.map +1 -1
  51. package/build/typed-routes/types.d.ts +4 -1
  52. package/build/typed-routes/types.d.ts.map +1 -1
  53. package/build/typed-routes/types.js.map +1 -1
  54. package/build/useScreens.d.ts.map +1 -1
  55. package/build/useScreens.js +6 -3
  56. package/build/useScreens.js.map +1 -1
  57. package/build/utils/url.d.ts +1 -0
  58. package/build/utils/url.d.ts.map +1 -1
  59. package/build/utils/url.js +9 -0
  60. package/build/utils/url.js.map +1 -1
  61. package/expo-module.config.json +1 -1
  62. package/ios/LinkPreview/LinkPreviewNativeActionView.swift +1 -1
  63. package/ios/LinkPreview/LinkPreviewNativeModule.swift +11 -0
  64. package/ios/LinkPreview/LinkZoomTransition.swift +126 -15
  65. package/ios/Toolbar/RouterToolbarHostView.swift +5 -1
  66. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.module → 7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.module} +7 -7
  67. 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 +1 -0
  68. 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 +1 -0
  69. 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 +1 -0
  70. 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 +1 -0
  71. package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.pom → 7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.pom} +1 -1
  72. 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 +1 -0
  73. 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 +1 -0
  74. 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 +1 -0
  75. 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 +1 -0
  76. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
  77. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
  78. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
  79. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
  80. package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
  81. package/package.json +12 -12
  82. package/build/onboard/createEntryFile.d.ts +0 -4
  83. package/build/onboard/createEntryFile.d.ts.map +0 -1
  84. package/build/onboard/createEntryFile.js +0 -63
  85. package/build/onboard/createEntryFile.js.map +0 -1
  86. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.module.md5 +0 -1
  87. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.module.sha1 +0 -1
  88. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.module.sha256 +0 -1
  89. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.module.sha512 +0 -1
  90. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.pom.md5 +0 -1
  91. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.pom.sha1 +0 -1
  92. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.pom.sha256 +0 -1
  93. package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.pom.sha512 +0 -1
  94. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1-sources.jar → 7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar} +0 -0
  95. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1-sources.jar.md5 → 7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.md5} +0 -0
  96. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1-sources.jar.sha1 → 7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.sha1} +0 -0
  97. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1-sources.jar.sha256 → 7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.sha256} +0 -0
  98. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1-sources.jar.sha512 → 7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea-sources.jar.sha512} +0 -0
  99. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.aar → 7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar} +0 -0
  100. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.aar.md5 → 7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.md5} +0 -0
  101. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.aar.sha1 → 7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.sha1} +0 -0
  102. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.aar.sha256 → 7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.sha256} +0 -0
  103. /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251206-615dec1/expo.modules.router-7.0.0-canary-20251206-615dec1.aar.sha512 → 7.0.0-canary-20251211-7da85ea/expo.modules.router-7.0.0-canary-20251211-7da85ea.aar.sha512} +0 -0
@@ -1,6 +1,37 @@
1
1
  "use strict";
2
+ 'use client';
2
3
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZoomTransitionSourceContext = void 0;
4
+ exports.ZoomTransitionTargetContext = exports.ZoomTransitionSourceContext = void 0;
5
+ exports.ZoomTransitionTargetContextProvider = ZoomTransitionTargetContextProvider;
4
6
  const react_1 = require("react");
7
+ const ZoomTransitionEnabler_ios_1 = require("./ZoomTransitionEnabler.ios");
8
+ const navigationParams_1 = require("../../navigationParams");
9
+ const PreviewRouteContext_1 = require("../preview/PreviewRouteContext");
5
10
  exports.ZoomTransitionSourceContext = (0, react_1.createContext)(undefined);
11
+ exports.ZoomTransitionTargetContext = (0, react_1.createContext)({
12
+ identifier: null,
13
+ });
14
+ function ZoomTransitionTargetContextProvider({ route, children, }) {
15
+ const isPreview = (0, PreviewRouteContext_1.useIsPreview)();
16
+ if ((0, ZoomTransitionEnabler_ios_1.isZoomTransitionEnabled)() &&
17
+ !isPreview &&
18
+ route &&
19
+ typeof route === 'object' &&
20
+ 'params' in route &&
21
+ typeof route.params === 'object' &&
22
+ 'key' in route &&
23
+ typeof route.key === 'string') {
24
+ const params = route.params ?? {};
25
+ const internalParams = (0, navigationParams_1.getInternalExpoRouterParams)(params);
26
+ const zoomTransitionId = internalParams[navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME];
27
+ const zoomTransitionScreenId = internalParams[navigationParams_1.INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME];
28
+ const hasZoomTransition = !!zoomTransitionId && zoomTransitionScreenId === route.key;
29
+ if (hasZoomTransition && typeof zoomTransitionId === 'string') {
30
+ return (<exports.ZoomTransitionTargetContext value={{ identifier: zoomTransitionId }}>
31
+ {children}
32
+ </exports.ZoomTransitionTargetContext>);
33
+ }
34
+ }
35
+ return children;
36
+ }
6
37
  //# sourceMappingURL=zoom-transition-context.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zoom-transition-context.js","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context.tsx"],"names":[],"mappings":";;;AAAA,iCAAsC;AAUzB,QAAA,2BAA2B,GACtC,IAAA,qBAAa,EAAuC,SAAS,CAAC,CAAC","sourcesContent":["import { createContext } from 'react';\n\nexport type ZoomTransitionSourceContextValueType =\n | {\n identifier: string;\n addSource: () => void;\n removeSource: () => void;\n }\n | undefined;\n\nexport const ZoomTransitionSourceContext =\n createContext<ZoomTransitionSourceContextValueType>(undefined);\n"]}
1
+ {"version":3,"file":"zoom-transition-context.js","sourceRoot":"","sources":["../../../src/link/zoom/zoom-transition-context.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AA2Bb,kFA+BC;AAxDD,iCAA8D;AAE9D,2EAAsE;AACtE,6DAIgC;AAChC,wEAA8D;AAUjD,QAAA,2BAA2B,GACtC,IAAA,qBAAa,EAAuC,SAAS,CAAC,CAAC;AAEpD,QAAA,2BAA2B,GAAG,IAAA,qBAAa,EAAgC;IACtF,UAAU,EAAE,IAAI;CACjB,CAAC,CAAC;AAEH,SAAgB,mCAAmC,CAAC,EAClD,KAAK,EACL,QAAQ,GAC8B;IACtC,MAAM,SAAS,GAAG,IAAA,kCAAY,GAAE,CAAC;IACjC,IACE,IAAA,mDAAuB,GAAE;QACzB,CAAC,SAAS;QACV,KAAK;QACL,OAAO,KAAK,KAAK,QAAQ;QACzB,QAAQ,IAAI,KAAK;QACjB,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;QAChC,KAAK,IAAI,KAAK;QACd,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,EAC7B,CAAC;QACD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;QAClC,MAAM,cAAc,GAAG,IAAA,8CAA2B,EAAC,MAAM,CAAC,CAAC;QAC3D,MAAM,gBAAgB,GACpB,cAAc,CAAC,4EAAyD,CAAC,CAAC;QAC5E,MAAM,sBAAsB,GAC1B,cAAc,CAAC,4EAAyD,CAAC,CAAC;QAC5E,MAAM,iBAAiB,GAAG,CAAC,CAAC,gBAAgB,IAAI,sBAAsB,KAAK,KAAK,CAAC,GAAG,CAAC;QACrF,IAAI,iBAAiB,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE,CAAC;YAC9D,OAAO,CACL,CAAC,mCAA2B,CAAC,KAAK,CAAC,CAAC,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAC,CACnE;UAAA,CAAC,QAAQ,CACX;QAAA,EAAE,mCAA2B,CAAC,CAC/B,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["'use client';\n\nimport { createContext, type PropsWithChildren } from 'react';\n\nimport { isZoomTransitionEnabled } from './ZoomTransitionEnabler.ios';\nimport {\n getInternalExpoRouterParams,\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';\n\nexport type ZoomTransitionSourceContextValueType =\n | {\n identifier: string;\n addSource: () => void;\n removeSource: () => void;\n }\n | undefined;\n\nexport const ZoomTransitionSourceContext =\n createContext<ZoomTransitionSourceContextValueType>(undefined);\n\nexport const ZoomTransitionTargetContext = createContext<{ identifier: string | null }>({\n identifier: null,\n});\n\nexport function ZoomTransitionTargetContextProvider({\n route,\n children,\n}: PropsWithChildren<{ route: unknown }>) {\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 hasZoomTransition = !!zoomTransitionId && zoomTransitionScreenId === route.key;\n if (hasZoomTransition && typeof zoomTransitionId === 'string') {\n return (\n <ZoomTransitionTargetContext value={{ identifier: zoomTransitionId }}>\n {children}\n </ZoomTransitionTargetContext>\n );\n }\n }\n return children;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/loaders/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM5D;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAiBvE"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/loaders/utils.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAM5D;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAiBvE"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getLoaderModulePath = getLoaderModulePath;
4
4
  exports.fetchLoaderModule = fetchLoaderModule;
5
+ const url_1 = require("../utils/url");
5
6
  /**
6
7
  * Convert a route's pathname to a loader module path.
7
8
  *
@@ -11,7 +12,7 @@ exports.fetchLoaderModule = fetchLoaderModule;
11
12
  * getLoaderModulePath(`/posts/1`) // `/_expo/loaders/posts/1`
12
13
  */
13
14
  function getLoaderModulePath(pathname) {
14
- const urlPath = new URL(pathname, 'http://localhost').pathname;
15
+ const urlPath = (0, url_1.parseUrlUsingCustomBase)(pathname).pathname;
15
16
  const normalizedPath = urlPath === '/' ? '/' : urlPath.replace(/\/$/, '');
16
17
  const pathSegment = normalizedPath === '/' ? '/index' : normalizedPath;
17
18
  return `/_expo/loaders${pathSegment}`;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/loaders/utils.ts"],"names":[],"mappings":";;AAQA,kDAMC;AASD,8CAiBC;AAxCD;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAAC,QAAgB;IAClD,MAAM,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC,QAAQ,CAAC;IAC/D,MAAM,cAAc,GAAG,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC1E,MAAM,WAAW,GAAG,cAAc,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC;IAEvE,OAAO,iBAAiB,WAAW,EAAE,CAAC;AACxC,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,iBAAiB,CAAC,SAAiB;IACvD,MAAM,UAAU,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAElD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,UAAU,EAAE;QACvC,OAAO,EAAE;YACP,MAAM,EAAE,kBAAkB;SAC3B;KACF,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,gCAAgC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,IAAI,CAAC;QACH,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,gCAAgC,KAAK,EAAE,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC","sourcesContent":["/**\n * Convert a route's pathname to a loader module path.\n *\n * @example\n * getLoaderModulePath(`/`); // `/_expo/loaders/index`\n * getLoaderModulePath(`/about`) // `/_expo/loaders/about`\n * getLoaderModulePath(`/posts/1`) // `/_expo/loaders/posts/1`\n */\nexport function getLoaderModulePath(pathname: string): string {\n const urlPath = new URL(pathname, 'http://localhost').pathname;\n const normalizedPath = urlPath === '/' ? '/' : urlPath.replace(/\\/$/, '');\n const pathSegment = normalizedPath === '/' ? '/index' : normalizedPath;\n\n return `/_expo/loaders${pathSegment}`;\n}\n\n/**\n * Fetches and parses a loader module from the given route path.\n * This works in all environments including:\n * 1. Development with Metro dev server (see `LoaderModuleMiddleware`)\n * 2. Production with static files (SSG)\n * 3. SSR environments\n */\nexport async function fetchLoaderModule(routePath: string): Promise<any> {\n const loaderPath = getLoaderModulePath(routePath);\n\n const response = await fetch(loaderPath, {\n headers: {\n Accept: 'application/json',\n },\n });\n if (!response.ok) {\n throw new Error(`Failed to fetch loader data: ${response.status}`);\n }\n\n try {\n return await response.json();\n } catch (error) {\n throw new Error(`Failed to parse loader data: ${error}`);\n }\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/loaders/utils.ts"],"names":[],"mappings":";;AAUA,kDAMC;AASD,8CAiBC;AA1CD,sCAAuD;AAEvD;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAAC,QAAgB;IAClD,MAAM,OAAO,GAAG,IAAA,6BAAuB,EAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;IAC3D,MAAM,cAAc,GAAG,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC1E,MAAM,WAAW,GAAG,cAAc,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAc,CAAC;IAEvE,OAAO,iBAAiB,WAAW,EAAE,CAAC;AACxC,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,iBAAiB,CAAC,SAAiB;IACvD,MAAM,UAAU,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAElD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,UAAU,EAAE;QACvC,OAAO,EAAE;YACP,MAAM,EAAE,kBAAkB;SAC3B;KACF,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,gCAAgC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,IAAI,CAAC;QACH,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,gCAAgC,KAAK,EAAE,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC","sourcesContent":["import { parseUrlUsingCustomBase } from '../utils/url';\n\n/**\n * Convert a route's pathname to a loader module path.\n *\n * @example\n * getLoaderModulePath(`/`); // `/_expo/loaders/index`\n * getLoaderModulePath(`/about`) // `/_expo/loaders/about`\n * getLoaderModulePath(`/posts/1`) // `/_expo/loaders/posts/1`\n */\nexport function getLoaderModulePath(pathname: string): string {\n const urlPath = parseUrlUsingCustomBase(pathname).pathname;\n const normalizedPath = urlPath === '/' ? '/' : urlPath.replace(/\\/$/, '');\n const pathSegment = normalizedPath === '/' ? '/index' : normalizedPath;\n\n return `/_expo/loaders${pathSegment}`;\n}\n\n/**\n * Fetches and parses a loader module from the given route path.\n * This works in all environments including:\n * 1. Development with Metro dev server (see `LoaderModuleMiddleware`)\n * 2. Production with static files (SSG)\n * 3. SSR environments\n */\nexport async function fetchLoaderModule(routePath: string): Promise<any> {\n const loaderPath = getLoaderModulePath(routePath);\n\n const response = await fetch(loaderPath, {\n headers: {\n Accept: 'application/json',\n },\n });\n if (!response.ok) {\n throw new Error(`Failed to fetch loader data: ${response.status}`);\n }\n\n try {\n return await response.json();\n } catch (error) {\n throw new Error(`Failed to parse loader data: ${error}`);\n }\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import { type ReactElement, type ReactNode } from 'react';
2
- import type { NativeTabOptions, NativeTabTriggerProps } from './types';
3
2
  import { type NativeTabsTriggerBadgeProps, type NativeTabsTriggerLabelProps, type NativeTabsTriggerIconProps } from './common/elements';
3
+ import type { NativeTabOptions, NativeTabTriggerProps } from './types';
4
4
  /**
5
5
  * The component used to customize the native tab options both in the _layout file and from the tab screen.
6
6
  *
@@ -1 +1 @@
1
- {"version":3,"file":"NativeTabTrigger.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabTrigger.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAkB,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAGvE,OAAO,EAKL,KAAK,2BAA2B,EAChC,KAAK,2BAA2B,EAChC,KAAK,0BAA0B,EAEhC,MAAM,mBAAmB,CAAC;AAK3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,iBAAS,oBAAoB,CAAC,KAAK,EAAE,qBAAqB,QAsBzD;AAED,eAAO,MAAM,gBAAgB;;;;;CAK3B,CAAC;AAEH,wBAAgB,wBAAwB,CACtC,EACE,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,eAAe,EACf,kBAAkB,EAClB,oBAAoB,EACpB,6BAA6B,EAC7B,YAA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CAAA;CAAE,CAAC,CA6BjE"}
@@ -8,9 +8,9 @@ exports.isNativeTabTrigger = isNativeTabTrigger;
8
8
  const native_1 = require("@react-navigation/native");
9
9
  const react_1 = require("react");
10
10
  const react_native_1 = require("react-native");
11
- const PreviewRouteContext_1 = require("../link/preview/PreviewRouteContext");
12
- const useSafeLayoutEffect_1 = require("../views/useSafeLayoutEffect");
13
11
  const elements_1 = require("./common/elements");
12
+ const PreviewRouteContext_1 = require("../link/preview/PreviewRouteContext");
13
+ const useFocusEffect_1 = require("../useFocusEffect");
14
14
  const children_1 = require("../utils/children");
15
15
  const icon_1 = require("./utils/icon");
16
16
  const materialIconConverter_1 = require("./utils/materialIconConverter");
@@ -57,20 +57,19 @@ const materialIconConverter_1 = require("./utils/materialIconConverter");
57
57
  function NativeTabTriggerImpl(props) {
58
58
  const route = (0, native_1.useRoute)();
59
59
  const navigation = (0, native_1.useNavigation)();
60
- const isFocused = navigation.isFocused();
61
60
  const isInPreview = (0, PreviewRouteContext_1.useIsPreview)();
62
- (0, useSafeLayoutEffect_1.useSafeLayoutEffect)(() => {
61
+ (0, useFocusEffect_1.useFocusEffect)((0, react_1.useCallback)(() => {
63
62
  // This will cause the tab to update only when it is focused.
64
63
  // As long as all tabs are loaded at the start, we don't need this check.
65
64
  // It is here to ensure similar behavior to stack
66
- if (isFocused && !isInPreview) {
65
+ if (!isInPreview) {
67
66
  if (navigation.getState()?.type !== 'tab') {
68
67
  throw new Error(`Trigger component can only be used in the tab screen. Current route: ${route.name}`);
69
68
  }
70
69
  const options = convertTabPropsToOptions(props, true);
71
70
  navigation.setOptions(options);
72
71
  }
73
- }, [isFocused, props, isInPreview]);
72
+ }, [props, isInPreview]));
74
73
  return null;
75
74
  }
76
75
  exports.NativeTabTrigger = Object.assign(NativeTabTriggerImpl, {
@@ -1 +1 @@
1
- {"version":3,"file":"NativeTabTrigger.js","sourceRoot":"","sources":["../../src/native-tabs/NativeTabTrigger.tsx"],"names":[],"mappings":";AAAA,YAAY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AA,sBAAc,EAAC,KAAK,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,wBAAgB,EAAE,CAAC;QACtE,IACE,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ;YAC/B,KAAK,CAAC,KAAK;YACX,MAAM,IAAI,KAAK,CAAC,KAAK;YACrB,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EACjB,CAAC;YACD,MAAM,IAAI,KAAK,CACb,uDAAuD,UAAU,8EAA8E,CAChJ,CAAC;QACJ,CAAC;QAED,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;YAC1C,IACE,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,IAAI,CAChC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,GAAG,IAAI,KAAK,CAAC,KAAK,CAC9E,EACD,CAAC;gBACD,MAAM,IAAI,KAAK,CACb,uDAAuD,UAAU,0GAA0G,CAC5K,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["'use client';\n\nimport { useNavigation, useRoute } from '@react-navigation/native';\nimport { isValidElement, type ReactElement, type ReactNode } from 'react';\nimport { StyleSheet, type ImageSourcePropType } from 'react-native';\n\nimport type { NativeTabOptions, NativeTabTriggerProps } from './types';\nimport { useIsPreview } from '../link/preview/PreviewRouteContext';\nimport { useSafeLayoutEffect } from '../views/useSafeLayoutEffect';\nimport {\n NativeTabsTriggerIcon,\n NativeTabsTriggerBadge,\n NativeTabsTriggerLabel,\n NativeTabsTriggerVectorIcon,\n type NativeTabsTriggerBadgeProps,\n type NativeTabsTriggerLabelProps,\n type NativeTabsTriggerIconProps,\n type SrcIcon,\n} from './common/elements';\nimport { filterAllowedChildrenElements, isChildOfType } from '../utils/children';\nimport { convertComponentSrcToImageSource } from './utils/icon';\nimport { convertMaterialIconNameToImageSource } from './utils/materialIconConverter';\n\n/**\n * The component used to customize the native tab options both in the _layout file and from the tab screen.\n *\n * When used in the _layout file, you need to provide a `name` prop.\n * When used in the tab screen, the `name` prop takes no effect.\n *\n * @example\n * ```tsx\n * // In _layout file\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function Layout() {\n * return (\n * <NativeTabs>\n * <NativeTabs.Trigger name=\"home\" />\n * <NativeTabs.Trigger name=\"settings\" />\n * </NativeTabs>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // In a tab screen\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function HomeScreen() {\n * return (\n * <View>\n * <NativeTabs.Trigger>\n * <NativeTabs.Trigger.Label>Home</NativeTabs.Trigger.Label>\n * </NativeTabs.Trigger>\n * <Text>This is home screen!</Text>\n * </View>\n * );\n * }\n * ```\n *\n * > **Note:** You can use the alias `NativeTabs.Trigger` for this component.\n */\nfunction NativeTabTriggerImpl(props: NativeTabTriggerProps) {\n const route = useRoute();\n const navigation = useNavigation();\n const isFocused = navigation.isFocused();\n const isInPreview = useIsPreview();\n\n useSafeLayoutEffect(() => {\n // This will cause the tab to update only when it is focused.\n // As long as all tabs are loaded at the start, we don't need this check.\n // It is here to ensure similar behavior to stack\n if (isFocused && !isInPreview) {\n if (navigation.getState()?.type !== 'tab') {\n throw new Error(\n `Trigger component can only be used in the tab screen. Current route: ${route.name}`\n );\n }\n const options = convertTabPropsToOptions(props, true);\n navigation.setOptions(options);\n }\n }, [isFocused, props, isInPreview]);\n\n return null;\n}\n\nexport const NativeTabTrigger = Object.assign(NativeTabTriggerImpl, {\n Label: NativeTabsTriggerLabel,\n Icon: NativeTabsTriggerIcon,\n Badge: NativeTabsTriggerBadge,\n VectorIcon: NativeTabsTriggerVectorIcon,\n});\n\nexport function convertTabPropsToOptions(\n {\n hidden,\n children,\n role,\n disablePopToTop,\n disableScrollToTop,\n unstable_nativeProps,\n disableAutomaticContentInsets,\n contentStyle,\n }: NativeTabTriggerProps,\n isDynamic: boolean = false\n) {\n const initialOptions: NativeTabOptions = isDynamic\n ? {\n ...(unstable_nativeProps ? { nativeProps: unstable_nativeProps } : {}),\n }\n : {\n hidden: !!hidden,\n specialEffects: {\n repeatedTabSelection: {\n popToRoot: !disablePopToTop,\n scrollToTop: !disableScrollToTop,\n },\n },\n contentStyle,\n role,\n nativeProps: unstable_nativeProps,\n disableAutomaticContentInsets,\n };\n const allowedChildren = filterAllowedChildrenElements(children, [\n NativeTabsTriggerBadge,\n NativeTabsTriggerLabel,\n NativeTabsTriggerIcon,\n ]);\n return allowedChildren.reduce<NativeTabOptions>(\n (acc, child) => {\n if (isChildOfType(child, NativeTabsTriggerBadge)) {\n appendBadgeOptions(acc, child.props);\n } else if (isChildOfType(child, NativeTabsTriggerLabel)) {\n appendLabelOptions(acc, child.props);\n } else if (isChildOfType(child, NativeTabsTriggerIcon)) {\n appendIconOptions(acc, child.props);\n }\n return acc;\n },\n { ...initialOptions }\n );\n}\n\nfunction appendBadgeOptions(options: NativeTabOptions, props: NativeTabsTriggerBadgeProps) {\n if (props.children) {\n options.badgeValue = String(props.children);\n options.selectedBadgeBackgroundColor = props.selectedBackgroundColor;\n } else if (!props.hidden) {\n // If no value is provided, we set it to a space to show the badge\n // Otherwise, the `react-native-screens` will interpret it as a hidden badge\n // https://github.com/software-mansion/react-native-screens/blob/b4358fd95dd0736fc54df6bb97f210dc89edf24c/ios/bottom-tabs/RNSBottomTabsScreenComponentView.mm#L172\n options.badgeValue = ' ';\n }\n}\n\nfunction appendLabelOptions(options: NativeTabOptions, props: NativeTabsTriggerLabelProps) {\n if (props.hidden) {\n options.title = '';\n } else {\n options.title = props.children;\n if (props.selectedStyle) {\n options.selectedLabelStyle = StyleSheet.flatten(props.selectedStyle);\n }\n }\n}\n\nexport function appendIconOptions(options: NativeTabOptions, props: NativeTabsTriggerIconProps) {\n if ('sf' in props && props.sf && process.env.EXPO_OS === 'ios') {\n if (typeof props.sf === 'string') {\n options.icon = props.sf\n ? {\n sf: props.sf,\n }\n : undefined;\n options.selectedIcon = undefined;\n } else if (props.sf) {\n options.icon = props.sf.default\n ? {\n sf: props.sf.default,\n }\n : undefined;\n options.selectedIcon = props.sf.selected\n ? {\n sf: props.sf.selected,\n }\n : undefined;\n }\n } else if ('drawable' in props && props.drawable && process.env.EXPO_OS === 'android') {\n if ('md' in props) {\n console.warn(\n 'Both `md` and `drawable` props are provided to NativeTabs.Trigger.Icon. `drawable` will take precedence on Android platform.'\n );\n }\n options.icon = { drawable: props.drawable };\n options.selectedIcon = undefined;\n } else if ('md' in props && props.md && process.env.EXPO_OS === 'android') {\n if (process.env.NODE_ENV !== 'production') {\n if ('drawable' in props) {\n console.warn(\n 'Both `md` and `drawable` props are provided to NativeTabs.Trigger.Icon. `drawable` will take precedence on Android platform.'\n );\n }\n }\n options.icon = convertMaterialIconNameToImageSource(props.md);\n } else if ('src' in props && props.src) {\n const icon = convertIconSrcToIconOption(props);\n options.icon = icon?.icon;\n options.selectedIcon = icon?.selectedIcon;\n }\n if (props.selectedColor) {\n options.selectedIconColor = props.selectedColor;\n }\n}\n\nfunction convertIconSrcToIconOption(\n icon: SrcIcon | undefined\n): Pick<NativeTabOptions, 'icon' | 'selectedIcon'> | undefined {\n if (icon && icon.src) {\n const { defaultIcon, selected } =\n typeof icon.src === 'object' && 'selected' in icon.src\n ? { defaultIcon: icon.src.default, selected: icon.src.selected }\n : { defaultIcon: icon.src };\n\n const options: Pick<NativeTabOptions, 'icon' | 'selectedIcon'> = {};\n options.icon = convertSrcOrComponentToSrc(defaultIcon);\n options.selectedIcon = convertSrcOrComponentToSrc(selected);\n return options;\n }\n\n return undefined;\n}\n\nfunction convertSrcOrComponentToSrc(src: ImageSourcePropType | ReactElement | undefined) {\n if (src) {\n if (isValidElement(src)) {\n return convertComponentSrcToImageSource(src);\n } else {\n return { src };\n }\n }\n return undefined;\n}\n\nexport function isNativeTabTrigger(\n child: ReactNode,\n contextKey?: string\n): child is ReactElement<NativeTabTriggerProps & { name: string }> {\n if (isValidElement(child) && child && child.type === NativeTabTrigger) {\n if (\n typeof child.props === 'object' &&\n child.props &&\n 'name' in child.props &&\n !child.props.name\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must have a \\`name\\` prop when used as a child of a Layout Route.`\n );\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (\n ['component', 'getComponent'].some(\n (key) => child.props && typeof child.props === 'object' && key in child.props\n )\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must not have a \\`component\\` or \\`getComponent\\` prop when used as a child of a Layout Route`\n );\n }\n }\n\n return true;\n }\n\n return false;\n}\n"]}
1
+ {"version":3,"file":"NativeTabTrigger.js","sourceRoot":"","sources":["../../src/native-tabs/NativeTabTrigger.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AA+Fb,4DAgDC;AAyBD,8CA8CC;AA+BD,gDAgCC;AAnRD,qDAAmE;AACnE,iCAAuF;AACvF,+CAAoE;AAEpE,gDAS2B;AAE3B,6EAAmE;AACnE,sDAAmD;AACnD,gDAAiF;AACjF,uCAAgE;AAChE,yEAAqF;AAErF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,SAAS,oBAAoB,CAAC,KAA4B;IACxD,MAAM,KAAK,GAAG,IAAA,iBAAQ,GAAE,CAAC;IACzB,MAAM,UAAU,GAAG,IAAA,sBAAa,GAAE,CAAC;IACnC,MAAM,WAAW,GAAG,IAAA,kCAAY,GAAE,CAAC;IAEnC,IAAA,+BAAc,EACZ,IAAA,mBAAW,EAAC,GAAG,EAAE;QACf,6DAA6D;QAC7D,yEAAyE;QACzE,iDAAiD;QACjD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,IAAI,UAAU,CAAC,QAAQ,EAAE,EAAE,IAAI,KAAK,KAAK,EAAE,CAAC;g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AI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["'use client';\n\nimport { useNavigation, useRoute } from '@react-navigation/native';\nimport { isValidElement, useCallback, type ReactElement, type ReactNode } from 'react';\nimport { StyleSheet, type ImageSourcePropType } from 'react-native';\n\nimport {\n NativeTabsTriggerIcon,\n NativeTabsTriggerBadge,\n NativeTabsTriggerLabel,\n NativeTabsTriggerVectorIcon,\n type NativeTabsTriggerBadgeProps,\n type NativeTabsTriggerLabelProps,\n type NativeTabsTriggerIconProps,\n type SrcIcon,\n} from './common/elements';\nimport type { NativeTabOptions, NativeTabTriggerProps } from './types';\nimport { useIsPreview } from '../link/preview/PreviewRouteContext';\nimport { useFocusEffect } from '../useFocusEffect';\nimport { filterAllowedChildrenElements, isChildOfType } from '../utils/children';\nimport { convertComponentSrcToImageSource } from './utils/icon';\nimport { convertMaterialIconNameToImageSource } from './utils/materialIconConverter';\n\n/**\n * The component used to customize the native tab options both in the _layout file and from the tab screen.\n *\n * When used in the _layout file, you need to provide a `name` prop.\n * When used in the tab screen, the `name` prop takes no effect.\n *\n * @example\n * ```tsx\n * // In _layout file\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function Layout() {\n * return (\n * <NativeTabs>\n * <NativeTabs.Trigger name=\"home\" />\n * <NativeTabs.Trigger name=\"settings\" />\n * </NativeTabs>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * // In a tab screen\n * import { NativeTabs } from 'expo-router/unstable-native-tabs';\n *\n * export default function HomeScreen() {\n * return (\n * <View>\n * <NativeTabs.Trigger>\n * <NativeTabs.Trigger.Label>Home</NativeTabs.Trigger.Label>\n * </NativeTabs.Trigger>\n * <Text>This is home screen!</Text>\n * </View>\n * );\n * }\n * ```\n *\n * > **Note:** You can use the alias `NativeTabs.Trigger` for this component.\n */\nfunction NativeTabTriggerImpl(props: NativeTabTriggerProps) {\n const route = useRoute();\n const navigation = useNavigation();\n const isInPreview = useIsPreview();\n\n useFocusEffect(\n useCallback(() => {\n // This will cause the tab to update only when it is focused.\n // As long as all tabs are loaded at the start, we don't need this check.\n // It is here to ensure similar behavior to stack\n if (!isInPreview) {\n if (navigation.getState()?.type !== 'tab') {\n throw new Error(\n `Trigger component can only be used in the tab screen. Current route: ${route.name}`\n );\n }\n const options = convertTabPropsToOptions(props, true);\n navigation.setOptions(options);\n }\n }, [props, isInPreview])\n );\n\n return null;\n}\n\nexport const NativeTabTrigger = Object.assign(NativeTabTriggerImpl, {\n Label: NativeTabsTriggerLabel,\n Icon: NativeTabsTriggerIcon,\n Badge: NativeTabsTriggerBadge,\n VectorIcon: NativeTabsTriggerVectorIcon,\n});\n\nexport function convertTabPropsToOptions(\n {\n hidden,\n children,\n role,\n disablePopToTop,\n disableScrollToTop,\n unstable_nativeProps,\n disableAutomaticContentInsets,\n contentStyle,\n }: NativeTabTriggerProps,\n isDynamic: boolean = false\n) {\n const initialOptions: NativeTabOptions = isDynamic\n ? {\n ...(unstable_nativeProps ? { nativeProps: unstable_nativeProps } : {}),\n }\n : {\n hidden: !!hidden,\n specialEffects: {\n repeatedTabSelection: {\n popToRoot: !disablePopToTop,\n scrollToTop: !disableScrollToTop,\n },\n },\n contentStyle,\n role,\n nativeProps: unstable_nativeProps,\n disableAutomaticContentInsets,\n };\n const allowedChildren = filterAllowedChildrenElements(children, [\n NativeTabsTriggerBadge,\n NativeTabsTriggerLabel,\n NativeTabsTriggerIcon,\n ]);\n return allowedChildren.reduce<NativeTabOptions>(\n (acc, child) => {\n if (isChildOfType(child, NativeTabsTriggerBadge)) {\n appendBadgeOptions(acc, child.props);\n } else if (isChildOfType(child, NativeTabsTriggerLabel)) {\n appendLabelOptions(acc, child.props);\n } else if (isChildOfType(child, NativeTabsTriggerIcon)) {\n appendIconOptions(acc, child.props);\n }\n return acc;\n },\n { ...initialOptions }\n );\n}\n\nfunction appendBadgeOptions(options: NativeTabOptions, props: NativeTabsTriggerBadgeProps) {\n if (props.children) {\n options.badgeValue = String(props.children);\n options.selectedBadgeBackgroundColor = props.selectedBackgroundColor;\n } else if (!props.hidden) {\n // If no value is provided, we set it to a space to show the badge\n // Otherwise, the `react-native-screens` will interpret it as a hidden badge\n // https://github.com/software-mansion/react-native-screens/blob/b4358fd95dd0736fc54df6bb97f210dc89edf24c/ios/bottom-tabs/RNSBottomTabsScreenComponentView.mm#L172\n options.badgeValue = ' ';\n }\n}\n\nfunction appendLabelOptions(options: NativeTabOptions, props: NativeTabsTriggerLabelProps) {\n if (props.hidden) {\n options.title = '';\n } else {\n options.title = props.children;\n if (props.selectedStyle) {\n options.selectedLabelStyle = StyleSheet.flatten(props.selectedStyle);\n }\n }\n}\n\nexport function appendIconOptions(options: NativeTabOptions, props: NativeTabsTriggerIconProps) {\n if ('sf' in props && props.sf && process.env.EXPO_OS === 'ios') {\n if (typeof props.sf === 'string') {\n options.icon = props.sf\n ? {\n sf: props.sf,\n }\n : undefined;\n options.selectedIcon = undefined;\n } else if (props.sf) {\n options.icon = props.sf.default\n ? {\n sf: props.sf.default,\n }\n : undefined;\n options.selectedIcon = props.sf.selected\n ? {\n sf: props.sf.selected,\n }\n : undefined;\n }\n } else if ('drawable' in props && props.drawable && process.env.EXPO_OS === 'android') {\n if ('md' in props) {\n console.warn(\n 'Both `md` and `drawable` props are provided to NativeTabs.Trigger.Icon. `drawable` will take precedence on Android platform.'\n );\n }\n options.icon = { drawable: props.drawable };\n options.selectedIcon = undefined;\n } else if ('md' in props && props.md && process.env.EXPO_OS === 'android') {\n if (process.env.NODE_ENV !== 'production') {\n if ('drawable' in props) {\n console.warn(\n 'Both `md` and `drawable` props are provided to NativeTabs.Trigger.Icon. `drawable` will take precedence on Android platform.'\n );\n }\n }\n options.icon = convertMaterialIconNameToImageSource(props.md);\n } else if ('src' in props && props.src) {\n const icon = convertIconSrcToIconOption(props);\n options.icon = icon?.icon;\n options.selectedIcon = icon?.selectedIcon;\n }\n if (props.selectedColor) {\n options.selectedIconColor = props.selectedColor;\n }\n}\n\nfunction convertIconSrcToIconOption(\n icon: SrcIcon | undefined\n): Pick<NativeTabOptions, 'icon' | 'selectedIcon'> | undefined {\n if (icon && icon.src) {\n const { defaultIcon, selected } =\n typeof icon.src === 'object' && 'selected' in icon.src\n ? { defaultIcon: icon.src.default, selected: icon.src.selected }\n : { defaultIcon: icon.src };\n\n const options: Pick<NativeTabOptions, 'icon' | 'selectedIcon'> = {};\n options.icon = convertSrcOrComponentToSrc(defaultIcon);\n options.selectedIcon = convertSrcOrComponentToSrc(selected);\n return options;\n }\n\n return undefined;\n}\n\nfunction convertSrcOrComponentToSrc(src: ImageSourcePropType | ReactElement | undefined) {\n if (src) {\n if (isValidElement(src)) {\n return convertComponentSrcToImageSource(src);\n } else {\n return { src };\n }\n }\n return undefined;\n}\n\nexport function isNativeTabTrigger(\n child: ReactNode,\n contextKey?: string\n): child is ReactElement<NativeTabTriggerProps & { name: string }> {\n if (isValidElement(child) && child && child.type === NativeTabTrigger) {\n if (\n typeof child.props === 'object' &&\n child.props &&\n 'name' in child.props &&\n !child.props.name\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must have a \\`name\\` prop when used as a child of a Layout Route.`\n );\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (\n ['component', 'getComponent'].some(\n (key) => child.props && typeof child.props === 'object' && key in child.props\n )\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must not have a \\`component\\` or \\`getComponent\\` prop when used as a child of a Layout Route`\n );\n }\n }\n\n return true;\n }\n\n return false;\n}\n"]}
@@ -39,7 +39,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.NativeTabsView = NativeTabsView;
40
40
  const react_tabs_1 = require("@radix-ui/react-tabs");
41
41
  const react_1 = __importStar(require("react"));
42
- const native_tabs_module_css_1 = __importDefault(require("../../../assets/native-tabs.module.css"));
42
+ const native_tabs_module_css_1 = __importDefault(require("../../assets/native-tabs.module.css"));
43
43
  function NativeTabsView(props) {
44
44
  const { tabs, focusedIndex } = props;
45
45
  const currentTab = tabs[focusedIndex];
@@ -1 +1 @@
1
- {"version":3,"file":"NativeTabsView.web.js","sourceRoot":"","sources":["../../src/native-tabs/NativeTabsView.web.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wCA6CC;AAnDD,qDAAgF;AAChF,+CAAuC;AAGvC,oGAAsE;AAEtE,SAAgB,cAAc,CAAC,KAA0B;IACvD,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IACrC,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;IACtC,MAAM,UAAU,GAAG,IAAA,eAAO,EACxB,GAAG,EAAE,CAAC,UAAU;IAChB,yGAAyG;IACzG,EAAE,CACH,CAAC;IACF,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC;IAElC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAC9B,CAAC,OAAO,CACN,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAClB,QAAQ,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CACvB,KAAK,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,GAAG,CAAC,IAAI,CAAC,CACrC,UAAU,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,EACnC,CACH,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE;QAChC,OAAO,CACL,CAAC,wBAAW,CACV,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAClB,KAAK,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CACpB,SAAS,CAAC,CAAC,gCAAgB,CAAC,UAAU,CAAC,CACvC,UAAU,CACV;QAAA,CAAC,GAAG,CA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E,CAAC;QAC3B,IAAI,CAAC,sCAAsC,CAAC,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IACzE,CAAC;IACD,IAAI,iBAAiB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,CAAC;QACpD,IAAI,CAAC,qCAAqC,CAAC,GAAG,MAAM,CAClD,iBAAiB,EAAE,kBAAkB,EAAE,QAAQ,CAChD,CAAC;IACJ,CAAC;IACD,IAAI,iBAAiB,EAAE,cAAc,EAAE,CAAC;QACtC,IAAI,CAAC,4CAA4C,CAAC,GAAG,MAAM,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;IAChG,CAAC;IACD,IAAI,iBAAiB,EAAE,eAAe,EAAE,CAAC;QACvC,IAAI,CAAC,qCAAqC,CAAC,GAAG,MAAM,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAC;IAC1F,CAAC;IACD,IAAI,iBAAiB,EAAE,oBAAoB,EAAE,CAAC;QAC5C,IAAI,CAAC,2CAA2C,CAAC,GAAG,MAAM,CACxD,iBAAiB,CAAC,oBAAoB,CACvC,CAAC;IACJ,CAAC;IACD,IAAI,iBAAiB,EAAE,cAAc,EAAE,CAAC;QACtC,IAAI,CAAC,qCAAqC,CAAC,GAAG,MAAM,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { Tabs, TabsContent, TabsList, TabsTrigger } from '@radix-ui/react-tabs';\nimport React, { useMemo } from 'react';\n\nimport type { NativeTabOptions, NativeTabsViewProps } from './types';\nimport nativeTabsStyles from '../../../assets/native-tabs.module.css';\n\nexport function NativeTabsView(props: NativeTabsViewProps) {\n const { tabs, focusedIndex } = props;\n const currentTab = tabs[focusedIndex];\n const defaultTab = useMemo(\n () => currentTab,\n // We don't specify currentTab here, as we don't want to change the default tab when focusedIndex changes\n []\n );\n const value = currentTab.routeKey;\n\n const items = tabs.map((tab) => (\n <TabItem\n key={tab.routeKey}\n routeKey={tab.routeKey}\n title={tab.options.title ?? tab.name}\n badgeValue={tab.options.badgeValue}\n />\n ));\n const children = tabs.map((tab) => {\n return (\n <TabsContent\n key={tab.routeKey}\n value={tab.routeKey}\n className={nativeTabsStyles.tabContent}\n forceMount>\n {tab.contentRenderer()}\n </TabsContent>\n );\n });\n\n return (\n <Tabs\n className={nativeTabsStyles.nativeTabsContainer}\n defaultValue={defaultTab.routeKey}\n value={value}\n onValueChange={(value) => {\n props.onTabChange(value);\n }}\n style={convertNativeTabsPropsToStyleVars(props, currentTab.options)}>\n <TabsList aria-label=\"Main\" className={nativeTabsStyles.navigationMenuRoot}>\n {items}\n </TabsList>\n {children}\n </Tabs>\n );\n}\n\ninterface TabItemProps {\n title: string;\n badgeValue?: string;\n routeKey: string;\n}\n\nfunction TabItem(props: TabItemProps) {\n const { title, badgeValue, routeKey } = props;\n const isBadgeEmpty = badgeValue === ' ';\n\n return (\n <TabsTrigger value={routeKey} className={nativeTabsStyles.navigationMenuTrigger}>\n <span className={nativeTabsStyles.tabText}>{title}</span>\n {badgeValue && (\n <div\n className={`${nativeTabsStyles.tabBadge} ${isBadgeEmpty ? nativeTabsStyles.emptyTabBadge : ''}`}>\n {badgeValue}\n </div>\n )}\n </TabsTrigger>\n );\n}\n\nfunction convertNativeTabsPropsToStyleVars(\n props: NativeTabsViewProps | undefined,\n currentTabOptions: NativeTabOptions | undefined\n): Record<string, string | undefined> {\n const vars: Record<`--expo-router-tabs-${string}`, string | undefined> = {};\n if (!props) {\n return vars;\n }\n const optionsLabelStyle = currentTabOptions?.labelStyle;\n if (optionsLabelStyle?.fontFamily) {\n vars['--expo-router-tabs-font-family'] = String(optionsLabelStyle.fontFamily);\n }\n if (optionsLabelStyle?.fontSize) {\n vars['--expo-router-tabs-font-size'] = String(optionsLabelStyle.fontSize);\n }\n if (optionsLabelStyle?.fontWeight) {\n vars['--expo-router-tabs-font-weight'] = String(optionsLabelStyle.fontWeight);\n }\n if (optionsLabelStyle?.fontStyle) {\n vars['--expo-router-tabs-font-style'] = String(optionsLabelStyle.fontStyle);\n }\n if (optionsLabelStyle?.color) {\n vars['--expo-router-tabs-text-color'] = String(optionsLabelStyle.color);\n }\n if (currentTabOptions?.selectedLabelStyle?.color) {\n vars['--expo-router-tabs-active-text-color'] = String(\n currentTabOptions?.selectedLabelStyle?.color\n );\n } else if (props.tintColor) {\n vars['--expo-router-tabs-active-text-color'] = String(props.tintColor);\n }\n if (currentTabOptions?.selectedLabelStyle?.fontSize) {\n vars['--expo-router-tabs-active-font-size'] = String(\n currentTabOptions?.selectedLabelStyle?.fontSize\n );\n }\n if (currentTabOptions?.indicatorColor) {\n vars['--expo-router-tabs-active-background-color'] = String(currentTabOptions.indicatorColor);\n }\n if (currentTabOptions?.backgroundColor) {\n vars['--expo-router-tabs-background-color'] = String(currentTabOptions.backgroundColor);\n }\n if (currentTabOptions?.badgeBackgroundColor) {\n vars['--expo-router-tabs-badge-background-color'] = String(\n currentTabOptions.badgeBackgroundColor\n );\n }\n if (currentTabOptions?.badgeTextColor) {\n vars['--expo-router-tabs-badge-text-color'] = String(currentTabOptions.badgeTextColor);\n }\n return vars;\n}\n"]}
1
+ {"version":3,"file":"NativeTabsView.web.js","sourceRoot":"","sources":["../../src/native-tabs/NativeTabsView.web.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wCA6CC;AAnDD,qDAAgF;AAChF,+CAAuC;AAGvC,iGAAmE;AAEnE,SAAgB,cAAc,CAAC,KAA0B;IACvD,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IACrC,MAAM,UAAU,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC;IACtC,MAAM,UAAU,GAAG,IAAA,eAAO,EACxB,GAAG,EAAE,CAAC,UAAU;IAChB,yGAAyG;IACzG,EAAE,CACH,CAAC;IACF,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC;IAElC,MA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CAAC;QAC5C,IAAI,CAAC,2CAA2C,CAAC,GAAG,MAAM,CACxD,iBAAiB,CAAC,oBAAoB,CACvC,CAAC;IACJ,CAAC;IACD,IAAI,iBAAiB,EAAE,cAAc,EAAE,CAAC;QACtC,IAAI,CAAC,qCAAqC,CAAC,GAAG,MAAM,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC;IACzF,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { Tabs, TabsContent, TabsList, TabsTrigger } from '@radix-ui/react-tabs';\nimport React, { useMemo } from 'react';\n\nimport type { NativeTabOptions, NativeTabsViewProps } from './types';\nimport nativeTabsStyles from '../../assets/native-tabs.module.css';\n\nexport function NativeTabsView(props: NativeTabsViewProps) {\n const { tabs, focusedIndex } = props;\n const currentTab = tabs[focusedIndex];\n const defaultTab = useMemo(\n () => currentTab,\n // We don't specify currentTab here, as we don't want to change the default tab when focusedIndex changes\n []\n );\n const value = currentTab.routeKey;\n\n const items = tabs.map((tab) => (\n <TabItem\n key={tab.routeKey}\n routeKey={tab.routeKey}\n title={tab.options.title ?? tab.name}\n badgeValue={tab.options.badgeValue}\n />\n ));\n const children = tabs.map((tab) => {\n return (\n <TabsContent\n key={tab.routeKey}\n value={tab.routeKey}\n className={nativeTabsStyles.tabContent}\n forceMount>\n {tab.contentRenderer()}\n </TabsContent>\n );\n });\n\n return (\n <Tabs\n className={nativeTabsStyles.nativeTabsContainer}\n defaultValue={defaultTab.routeKey}\n value={value}\n onValueChange={(value) => {\n props.onTabChange(value);\n }}\n style={convertNativeTabsPropsToStyleVars(props, currentTab.options)}>\n <TabsList aria-label=\"Main\" className={nativeTabsStyles.navigationMenuRoot}>\n {items}\n </TabsList>\n {children}\n </Tabs>\n );\n}\n\ninterface TabItemProps {\n title: string;\n badgeValue?: string;\n routeKey: string;\n}\n\nfunction TabItem(props: TabItemProps) {\n const { title, badgeValue, routeKey } = props;\n const isBadgeEmpty = badgeValue === ' ';\n\n return (\n <TabsTrigger value={routeKey} className={nativeTabsStyles.navigationMenuTrigger}>\n <span className={nativeTabsStyles.tabText}>{title}</span>\n {badgeValue && (\n <div\n className={`${nativeTabsStyles.tabBadge} ${isBadgeEmpty ? nativeTabsStyles.emptyTabBadge : ''}`}>\n {badgeValue}\n </div>\n )}\n </TabsTrigger>\n );\n}\n\nfunction convertNativeTabsPropsToStyleVars(\n props: NativeTabsViewProps | undefined,\n currentTabOptions: NativeTabOptions | undefined\n): Record<string, string | undefined> {\n const vars: Record<`--expo-router-tabs-${string}`, string | undefined> = {};\n if (!props) {\n return vars;\n }\n const optionsLabelStyle = currentTabOptions?.labelStyle;\n if (optionsLabelStyle?.fontFamily) {\n vars['--expo-router-tabs-font-family'] = String(optionsLabelStyle.fontFamily);\n }\n if (optionsLabelStyle?.fontSize) {\n vars['--expo-router-tabs-font-size'] = String(optionsLabelStyle.fontSize);\n }\n if (optionsLabelStyle?.fontWeight) {\n vars['--expo-router-tabs-font-weight'] = String(optionsLabelStyle.fontWeight);\n }\n if (optionsLabelStyle?.fontStyle) {\n vars['--expo-router-tabs-font-style'] = String(optionsLabelStyle.fontStyle);\n }\n if (optionsLabelStyle?.color) {\n vars['--expo-router-tabs-text-color'] = String(optionsLabelStyle.color);\n }\n if (currentTabOptions?.selectedLabelStyle?.color) {\n vars['--expo-router-tabs-active-text-color'] = String(\n currentTabOptions?.selectedLabelStyle?.color\n );\n } else if (props.tintColor) {\n vars['--expo-router-tabs-active-text-color'] = String(props.tintColor);\n }\n if (currentTabOptions?.selectedLabelStyle?.fontSize) {\n vars['--expo-router-tabs-active-font-size'] = String(\n currentTabOptions?.selectedLabelStyle?.fontSize\n );\n }\n if (currentTabOptions?.indicatorColor) {\n vars['--expo-router-tabs-active-background-color'] = String(currentTabOptions.indicatorColor);\n }\n if (currentTabOptions?.backgroundColor) {\n vars['--expo-router-tabs-background-color'] = String(currentTabOptions.backgroundColor);\n }\n if (currentTabOptions?.badgeBackgroundColor) {\n vars['--expo-router-tabs-badge-background-color'] = String(\n currentTabOptions.badgeBackgroundColor\n );\n }\n if (currentTabOptions?.badgeTextColor) {\n vars['--expo-router-tabs-badge-text-color'] = String(currentTabOptions.badgeTextColor);\n }\n return vars;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Tutorial.d.ts","sourceRoot":"","sources":["../../src/onboard/Tutorial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,wBAAgB,QAAQ,sBAgEvB"}
1
+ {"version":3,"file":"Tutorial.d.ts","sourceRoot":"","sources":["../../src/onboard/Tutorial.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAwB1B,wBAAgB,QAAQ,sBAgEvB"}
@@ -7,10 +7,22 @@ exports.Tutorial = Tutorial;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const react_native_1 = require("react-native");
9
9
  const react_native_safe_area_context_1 = require("react-native-safe-area-context");
10
- const createEntryFile_1 = require("./createEntryFile");
11
10
  const exports_1 = require("../exports");
11
+ const getDevServer_1 = require("../getDevServer");
12
12
  const Pressable_1 = require("../views/Pressable");
13
13
  const canAutoTouchFile = process.env.EXPO_ROUTER_APP_ROOT != null;
14
+ function createEntryFileAsync() {
15
+ if (process.env.NODE_ENV === 'production') {
16
+ // No dev server
17
+ console.warn('createEntryFile() cannot be used in production');
18
+ return;
19
+ }
20
+ // Pings middleware in the Expo CLI dev server.
21
+ return fetch((0, getDevServer_1.getDevServer)().url + '_expo/touch', {
22
+ method: 'POST',
23
+ body: JSON.stringify({ type: 'router_index' }),
24
+ });
25
+ }
14
26
  function Tutorial() {
15
27
  react_1.default.useEffect(() => {
16
28
  if (react_native_1.Platform.OS === 'web') {
@@ -69,18 +81,18 @@ function Tutorial() {
69
81
  </react_native_safe_area_context_1.SafeAreaView>);
70
82
  }
71
83
  function getRootDir() {
72
- const dir = process.env.EXPO_ROUTER_ABS_APP_ROOT;
73
- if (dir.match(/\/src\/app$/)) {
84
+ const dir = process.env.EXPO_ROUTER_APP_ROOT ?? '';
85
+ if (/[\\/]src[\\/]app$/.test(dir)) {
74
86
  return 'src/app';
75
87
  }
76
- else if (dir.match(/\/app$/)) {
88
+ else if (/[\\/]app$/.test(dir)) {
77
89
  return 'app';
78
90
  }
79
- return dir.split('/').pop() ?? dir;
91
+ return dir.split(/[\\/]/).pop() ?? '';
80
92
  }
81
93
  function Button() {
82
94
  return (<Pressable_1.Pressable onPress={() => {
83
- (0, createEntryFile_1.createEntryFileAsync)();
95
+ createEntryFileAsync();
84
96
  }} style={styles.button}>
85
97
  {({ pressed, hovered }) => (<react_native_1.View style={[
86
98
  styles.buttonContainer,
@@ -106,8 +118,7 @@ function Button() {
106
118
  native: { color: '#000' },
107
119
  }),
108
120
  ]}>
109
- <react_native_1.Text style={styles.textSecondary}>$</react_native_1.Text> touch {getRootDir()}
110
- /index.tsx
121
+ <react_native_1.Text style={styles.textSecondary}>$</react_native_1.Text> touch {`${getRootDir()}/index.tsx`}
111
122
  </react_native_1.Text>
112
123
  </react_native_1.View>)}
113
124
  </Pressable_1.Pressable>);
@@ -1 +1 @@
1
- {"version":3,"file":"Tutorial.js","sourceRoot":"","sources":["../../src/onboard/Tutorial.tsx"],"names":[],"mappings":";;;;;AAUA,4BAgEC;AA1ED,kDAA0B;AAC1B,+CAAkF;AAClF,mFAA8D;AAE9D,uDAAyD;AACzD,wCAAkC;AAClC,kDAA+C;AAE/C,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,IAAI,CAAC;AAElE,SAAgB,QAAQ;IACtB,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,uBAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;YAC1B,gEAAgE;YAChE,uCAAuC;YACvC,+DAA+D;YAC/D,uGAAuG;YACvG,oFAAoF;YACpF,IAAI,OAAO,QAAQ,KAAK,WAAW,IAAI,QAAQ,CAAC,QAAQ,KAAK,GAAG,EAA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AAE,EAAE;QACrB,YAAY,EAAE,CAAC;KAChB;IACD,MAAM,EAAE;QACN,GAAG,uBAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,SAAS,EAAE,EAAE;aACd;YACD,MAAM,EAAE;gBACN,QAAQ,EAAE,UAAU;gBACpB,MAAM,EAAE,EAAE;gBACV,IAAI,EAAE,EAAE;gBACR,KAAK,EAAE,EAAE;gBACT,QAAQ,EAAE,QAAQ;aACnB;SACF,CAAC;KACH;IACD,IAAI,EAAE;QACJ,GAAG,uBAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,kBAAkB,EAAE,OAAO;gBAC3B,UAAU,EAAE,oBAAoB;aACjC;YACD,OAAO,EAAE;gBACP,UAAU,EAAE,uBAAQ,CAAC,MAAM,CAAC;oBAC1B,GAAG,EAAE,aAAa;oBAClB,OAAO,EAAE,WAAW;iBACrB,CAAC;aACH;SACF,CAAC;QACF,KAAK,EAAE,MAAM;QACb,SAAS,EAAE,QAAQ;QACnB,UAAU,EAAE,MAAM;QAClB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,MAAM;KACnB;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,QAAQ;KACpB;IACD,IAAI,EAAE;QACJ,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,EAAE;QACd,SAAS,EAAE,QAAQ;QACnB,KAAK,EAAE,SAAS;QAChB,SAAS,EAAE,EAAE;QACb,GAAG,uBAAQ,CAAC,MAAM,CAAC;YACjB,GAAG,EAAE;gBACH,YAAY,EAAE,EAAE;aACjB;SACF,CAAC;KACH;IACD,aAAa,EAAE;QACb,KAAK,EAAE,SAAS;KACjB;CACF,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Platform, StatusBar, StyleSheet, Text, View, Image } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { createEntryFileAsync } from './createEntryFile';\nimport { Link } from '../exports';\nimport { Pressable } from '../views/Pressable';\n\nconst canAutoTouchFile = process.env.EXPO_ROUTER_APP_ROOT != null;\n\nexport function Tutorial() {\n React.useEffect(() => {\n if (Platform.OS === 'web') {\n // Reset the route on web so the initial route isn't a 404 after\n // the user has created the entry file.\n // This is useful for cases where you are testing the tutorial.\n // To test: touch the new file, then navigate to a missing route `/foobar`, then delete the app folder.\n // you should see the tutorial again and be able to create the entry file once more.\n if (typeof location !== 'undefined' && location.pathname !== '/') {\n location.replace('/');\n }\n if (typeof window !== 'undefined' && typeof window.document !== 'undefined') {\n window.document.title = 'Welcome to Expo';\n }\n }\n }, []);\n\n return (\n <SafeAreaView style={styles.background}>\n <StatusBar barStyle=\"light-content\" />\n <View style={styles.container}>\n <View style={styles.logotypeWrapper}>\n <Image style={styles.logotype} source={require('expo-router/assets/logotype.png')} />\n </View>\n <Text role=\"heading\" aria-level={1} style={styles.title}>\n Welcome to Expo\n </Text>\n <Text role=\"heading\" aria-level={2} style={[styles.subtitle, styles.textSecondary]}>\n Start by creating a file{Platform.OS !== 'web' ? '\\n' : ' '}in the{' '}\n <Text style={{ fontWeight: '600' }}>{getRootDir()}</Text> directory.\n </Text>\n <Text>\n <Link\n href=\"https://docs.expo.dev/router/introduction/\"\n {...Platform.select({ web: { target: '_blank' }, native: { asChild: true } })}>\n <Pressable>\n {({ hovered, pressed }) => (\n <Text\n style={[\n styles.link,\n Platform.select({\n web: {\n transitionDuration: '200ms',\n marginBottom: 12,\n },\n }),\n hovered && {\n opacity: 0.8,\n textDecorationLine: 'underline',\n },\n pressed && {\n opacity: 0.8,\n },\n ]}>\n Learn more about Expo Router in the documentation.\n </Text>\n )}\n </Pressable>\n </Link>\n </Text>\n {canAutoTouchFile && <Button />}\n </View>\n </SafeAreaView>\n );\n}\n\nfunction getRootDir() {\n const dir = process.env.EXPO_ROUTER_ABS_APP_ROOT!;\n if (dir.match(/\\/src\\/app$/)) {\n return 'src/app';\n } else if (dir.match(/\\/app$/)) {\n return 'app';\n }\n return dir.split('/').pop() ?? dir;\n}\n\nfunction Button() {\n return (\n <Pressable\n onPress={() => {\n createEntryFileAsync();\n }}\n style={styles.button}>\n {({ pressed, hovered }) => (\n <View\n style={[\n styles.buttonContainer,\n hovered && {\n backgroundColor: '#fff',\n },\n pressed &&\n Platform.select({\n web: {\n transform: 'scale(0.98)',\n transitionDuration: '200ms',\n },\n default: {\n backgroundColor: '#fff',\n },\n }),\n ]}>\n <Text\n style={[\n styles.code,\n hovered && { color: '#000' },\n pressed &&\n Platform.select({\n native: { color: '#000' },\n }),\n ]}>\n <Text style={styles.textSecondary}>$</Text> touch {getRootDir()}\n /index.tsx\n </Text>\n </View>\n )}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n background: {\n backgroundColor: '#000',\n flex: 1,\n },\n container: {\n flex: 1,\n padding: 24,\n paddingBottom: 64,\n alignItems: 'center',\n justifyContent: 'center',\n marginHorizontal: 'auto',\n gap: 16,\n ...Platform.select({\n web: {\n maxWidth: 960,\n },\n native: {\n width: '100%',\n },\n }),\n },\n logotypeWrapper: {\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: '#151718',\n borderRadius: 12,\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: '#313538',\n width: 78,\n height: 78,\n marginBottom: 8,\n },\n logotype: {\n width: 48,\n height: 44,\n },\n title: {\n ...Platform.select({\n web: {\n fontSize: 64,\n lineHeight: 64,\n },\n default: {\n fontSize: 56,\n lineHeight: 56,\n },\n }),\n color: '#fff',\n fontWeight: '800',\n textAlign: 'center',\n },\n buttonContainer: {\n ...Platform.select({\n web: {\n transitionDuration: '200ms',\n },\n }),\n backgroundColor: 'transparent',\n borderColor: '#fff',\n borderWidth: 2,\n paddingVertical: 12,\n paddingHorizontal: 24,\n borderRadius: 8,\n },\n button: {\n ...Platform.select({\n web: {\n marginTop: 12,\n },\n native: {\n position: 'absolute',\n bottom: 24,\n left: 32,\n right: 32,\n overflow: 'hidden',\n },\n }),\n },\n code: {\n ...Platform.select({\n web: {\n transitionDuration: '200ms',\n fontFamily: 'Courier, monospace',\n },\n default: {\n fontFamily: Platform.select({\n ios: 'Courier New',\n android: 'monospace',\n }),\n },\n }),\n color: '#fff',\n textAlign: 'center',\n userSelect: 'none',\n fontSize: 18,\n fontWeight: 'bold',\n },\n subtitle: {\n fontSize: 34,\n fontWeight: '200',\n textAlign: 'center',\n },\n link: {\n fontSize: 20,\n lineHeight: 26,\n textAlign: 'center',\n color: '#52a9ff',\n marginTop: 12,\n ...Platform.select({\n web: {\n marginBottom: 24,\n },\n }),\n },\n textSecondary: {\n color: '#9ba1a6',\n },\n});\n"]}
1
+ {"version":3,"file":"Tutorial.js","sourceRoot":"","sources":["../../src/onboard/Tutorial.tsx"],"names":[],"mappings":";;;;;AAwBA,4BAgEC;AAxFD,kDAA0B;AAC1B,+CAAkF;AAClF,mFAA8D;AAE9D,wCAAkC;AAClC,kDAA+C;AAC/C,kDAA+C;AAE/C,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,IAAI,CAAC;AAElE,SAAS,oBAAoB;IAC3B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,YAAY,EAAE,CAAC;QAC1C,gBAAgB;QAChB,OAAO,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAC;QAC/D,OAAO;IACT,CAAC;IAED,+CAA+C;IAC/C,OAAO,KAAK,CAAC,IAAA,2BAAY,GAAE,CAAC,GAAG,GAAG,aAAa,EAAE;QAC/C,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;KAC/C,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,QAAQ;IACtB,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,uBAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;YAC1B,gEAAgE;YAChE,uCAAuC;YACv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CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { Platform, StatusBar, StyleSheet, Text, View, Image } from 'react-native';\nimport { SafeAreaView } from 'react-native-safe-area-context';\n\nimport { Link } from '../exports';\nimport { getDevServer } from '../getDevServer';\nimport { Pressable } from '../views/Pressable';\n\nconst canAutoTouchFile = process.env.EXPO_ROUTER_APP_ROOT != null;\n\nfunction createEntryFileAsync() {\n if (process.env.NODE_ENV === 'production') {\n // No dev server\n console.warn('createEntryFile() cannot be used in production');\n return;\n }\n\n // Pings middleware in the Expo CLI dev server.\n return fetch(getDevServer().url + '_expo/touch', {\n method: 'POST',\n body: JSON.stringify({ type: 'router_index' }),\n });\n}\n\nexport function Tutorial() {\n React.useEffect(() => {\n if (Platform.OS === 'web') {\n // Reset the route on web so the initial route isn't a 404 after\n // the user has created the entry file.\n // This is useful for cases where you are testing the tutorial.\n // To test: touch the new file, then navigate to a missing route `/foobar`, then delete the app folder.\n // you should see the tutorial again and be able to create the entry file once more.\n if (typeof location !== 'undefined' && location.pathname !== '/') {\n location.replace('/');\n }\n if (typeof window !== 'undefined' && typeof window.document !== 'undefined') {\n window.document.title = 'Welcome to Expo';\n }\n }\n }, []);\n\n return (\n <SafeAreaView style={styles.background}>\n <StatusBar barStyle=\"light-content\" />\n <View style={styles.container}>\n <View style={styles.logotypeWrapper}>\n <Image style={styles.logotype} source={require('expo-router/assets/logotype.png')} />\n </View>\n <Text role=\"heading\" aria-level={1} style={styles.title}>\n Welcome to Expo\n </Text>\n <Text role=\"heading\" aria-level={2} style={[styles.subtitle, styles.textSecondary]}>\n Start by creating a file{Platform.OS !== 'web' ? '\\n' : ' '}in the{' '}\n <Text style={{ fontWeight: '600' }}>{getRootDir()}</Text> directory.\n </Text>\n <Text>\n <Link\n href=\"https://docs.expo.dev/router/introduction/\"\n {...Platform.select({ web: { target: '_blank' }, native: { asChild: true } })}>\n <Pressable>\n {({ hovered, pressed }) => (\n <Text\n style={[\n styles.link,\n Platform.select({\n web: {\n transitionDuration: '200ms',\n marginBottom: 12,\n },\n }),\n hovered && {\n opacity: 0.8,\n textDecorationLine: 'underline',\n },\n pressed && {\n opacity: 0.8,\n },\n ]}>\n Learn more about Expo Router in the documentation.\n </Text>\n )}\n </Pressable>\n </Link>\n </Text>\n {canAutoTouchFile && <Button />}\n </View>\n </SafeAreaView>\n );\n}\n\nfunction getRootDir() {\n const dir = process.env.EXPO_ROUTER_APP_ROOT ?? '';\n if (/[\\\\/]src[\\\\/]app$/.test(dir)) {\n return 'src/app';\n } else if (/[\\\\/]app$/.test(dir)) {\n return 'app';\n }\n return dir.split(/[\\\\/]/).pop() ?? '';\n}\n\nfunction Button() {\n return (\n <Pressable\n onPress={() => {\n createEntryFileAsync();\n }}\n style={styles.button}>\n {({ pressed, hovered }) => (\n <View\n style={[\n styles.buttonContainer,\n hovered && {\n backgroundColor: '#fff',\n },\n pressed &&\n Platform.select({\n web: {\n transform: 'scale(0.98)',\n transitionDuration: '200ms',\n },\n default: {\n backgroundColor: '#fff',\n },\n }),\n ]}>\n <Text\n style={[\n styles.code,\n hovered && { color: '#000' },\n pressed &&\n Platform.select({\n native: { color: '#000' },\n }),\n ]}>\n <Text style={styles.textSecondary}>$</Text> touch {`${getRootDir()}/index.tsx`}\n </Text>\n </View>\n )}\n </Pressable>\n );\n}\n\nconst styles = StyleSheet.create({\n background: {\n backgroundColor: '#000',\n flex: 1,\n },\n container: {\n flex: 1,\n padding: 24,\n paddingBottom: 64,\n alignItems: 'center',\n justifyContent: 'center',\n marginHorizontal: 'auto',\n gap: 16,\n ...Platform.select({\n web: {\n maxWidth: 960,\n },\n native: {\n width: '100%',\n },\n }),\n },\n logotypeWrapper: {\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: '#151718',\n borderRadius: 12,\n borderWidth: 1,\n borderStyle: 'solid',\n borderColor: '#313538',\n width: 78,\n height: 78,\n marginBottom: 8,\n },\n logotype: {\n width: 48,\n height: 44,\n },\n title: {\n ...Platform.select({\n web: {\n fontSize: 64,\n lineHeight: 64,\n },\n default: {\n fontSize: 56,\n lineHeight: 56,\n },\n }),\n color: '#fff',\n fontWeight: '800',\n textAlign: 'center',\n },\n buttonContainer: {\n ...Platform.select({\n web: {\n transitionDuration: '200ms',\n },\n }),\n backgroundColor: 'transparent',\n borderColor: '#fff',\n borderWidth: 2,\n paddingVertical: 12,\n paddingHorizontal: 24,\n borderRadius: 8,\n },\n button: {\n ...Platform.select({\n web: {\n marginTop: 12,\n },\n native: {\n position: 'absolute',\n bottom: 24,\n left: 32,\n right: 32,\n overflow: 'hidden',\n },\n }),\n },\n code: {\n ...Platform.select({\n web: {\n transitionDuration: '200ms',\n fontFamily: 'Courier, monospace',\n },\n default: {\n fontFamily: Platform.select({\n ios: 'Courier New',\n android: 'monospace',\n }),\n },\n }),\n color: '#fff',\n textAlign: 'center',\n userSelect: 'none',\n fontSize: 18,\n fontWeight: 'bold',\n },\n subtitle: {\n fontSize: 34,\n fontWeight: '200',\n textAlign: 'center',\n },\n link: {\n fontSize: 20,\n lineHeight: 26,\n textAlign: 'center',\n color: '#52a9ff',\n marginTop: 12,\n ...Platform.select({\n web: {\n marginBottom: 24,\n },\n }),\n },\n textSecondary: {\n color: '#9ba1a6',\n },\n});\n"]}
@@ -70,7 +70,10 @@ export type RouteInputParams<T extends Route> = Extract<Href, {
70
70
  */
71
71
  export type RouteOutputParams<T extends Route> = Extract<HrefOutputParams, {
72
72
  pathname: T;
73
- }> extends never ? HrefOutputParams extends infer H ? H extends Record<'pathname' | 'params', any> ? T extends H['pathname'] ? H['params'] : never : never : never : Extract<HrefOutputParams, {
73
+ }> extends never ? HrefOutputParams extends infer H ? H extends {
74
+ pathname: any;
75
+ params?: any;
76
+ } ? T extends H['pathname'] ? H['params'] : never : never : never : Extract<HrefOutputParams, {
74
77
  pathname: T;
75
78
  }>['params'];
76
79
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/typed-routes/types.ts"],"names":[],"mappings":"AAAA;;;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AG,KAAK,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,cAAc,SAAS,KAAK,GAAG,MAAM,EAAE,IAAI,cAAc,SAAS,MAAM,EAAE,GAChG,cAAc,GACd,cAAc,SAAS,IAAI,MAAM,EAAE,GACjC,KAAK,GACL,cAAc,SAAS,EAAE,GACvB,KAAK,GACL,cAAc,SAAS,IAAI,MAAM,KAAK,EAAE,GACtC,aAAa,CAAC,KAAK,CAAC,GACpB,cAAc,SAAS,GAAG,MAAM,KAAK,IAAI,MAAM,EAAE,GAC/C,aAAa,CAAC,KAAK,CAAC,GACpB,cAAc,SAAS,GAAG,MAAM,KAAK,IAAI,MAAM,EAAE,GAC/C,aAAa,CAAC,KAAK,CAAC,GACpB,cAAc,SAAS,GAAG,MAAM,KAAK,IAAI,MAAM,KAAK,EAAE,GACpD,CAAC,KAAK,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,GAChC,CAAC,cAAc,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/typed-routes/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * The main routing type for Expo Router.\n *\n * @internal\n * @hidden\n */\nexport namespace ExpoRouter {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-object-type\n export interface __routes {}\n}\n\nexport type HrefObject = {\n /** The path of the route. */\n pathname: string;\n /** Optional parameters for the route. */\n params?: UnknownInputParams;\n};\n\n/**\n * @hidden\n */\nexport type HrefInputParamsObject = {\n /** The path of the route. */\n pathname: string;\n /** Optional input parameters for the route. */\n params?: UnknownInputParams;\n};\n\n/**\n * @hidden\n */\nexport type HrefOutputParamsObject = {\n /** The path of the route */\n pathname: string;\n /** Optional output parameters for the route */\n params?: UnknownOutputParams;\n};\n\nexport type RelativePathString = `./${string}` | `../${string}` | '..';\nexport type SearchOrHash = `?${string}` | `#${string}`;\nexport type ExternalPathString = `${string}:${string}` | `//${string}`;\nexport type Route = Exclude<\n Extract<Href, object>['pathname'], // Use the HrefObject, as it doesn't have query params\n RelativePathString | ExternalPathString\n>;\n\n/**\n * The main routing type for Expo Router. It includes all available routes with strongly\n * typed parameters. It can either be:\n * - **string**: A full path like `/profile/settings` or a relative path like `../settings`.\n * - **object**: An object with a `pathname` and optional `params`. The `pathname` can be\n * a full path like `/profile/settings` or a relative path like `../settings`.\n * The params can be an object of key-value pairs.\n *\n * An Href can either be a string or an object.\n */\nexport type Href<T extends ExpoRouter.__routes = ExpoRouter.__routes> = T extends { href: any }\n ? T['href']\n : string | HrefObject;\n\n/*\n * @hidden\n */\nexport type HrefInputParams<T extends ExpoRouter.__routes = ExpoRouter.__routes> = T extends {\n hrefInputParams: any;\n}\n ? T['hrefInputParams']\n : HrefInputParamsObject;\n\n/*\n * @hidden\n */\nexport type HrefOutputParams<T extends ExpoRouter.__routes = ExpoRouter.__routes> = T extends {\n hrefOutputParams: any;\n}\n ? T['hrefOutputParams']\n : HrefOutputParamsObject;\n\n/**\n * @hidden\n */\nexport type RouteInputParams<T extends Route> =\n Extract<Href, { pathname: T }> extends never\n ? HrefInputParams extends infer H\n ? H extends Record<'pathname' | 'params', any>\n ? T extends H['pathname']\n ? H['params']\n : never\n : never\n : never\n : Extract<HrefInputParams, { pathname: T }>['params'];\n\n/**\n * @hidden\n */\nexport type RouteOutputParams<T extends Route> =\n Extract<HrefOutputParams, { pathname: T }> extends never\n ? HrefOutputParams extends infer H\n ? H extends Record<'pathname' | 'params', any>\n ? T extends H['pathname']\n ? H['params']\n : never\n : never\n : never\n : Extract<HrefOutputParams, { pathname: T }>['params'];\n\n/**\n * @hidden\n */\nexport type RouteParams<T extends Route> = RouteOutputParams<T>;\n\n/**\n * Routes can have known inputs (e.g query params).\n * Unlike outputs, inputs can be `undefined` or `null`.\n *\n * @hidden\n */\nexport type UnknownInputParams = Record<\n string,\n string | number | undefined | null | (string | number)[]\n>;\n\n/**\n * Routes can have unknown outputs (e.g query params).\n * Unlike inputs, outputs can't be undefined or null.\n *\n * @hidden\n */\nexport type UnknownOutputParams = Record<string, string | string[]>;\n\n/**\n * Return only the RoutePart of a string. If the string has multiple parts return never\n *\n * string | type\n *| ---------|------|\n *| 123 | 123 |\n *| /123/abc | never |\n *| 123?abc | never |\n *| ./123 | never |\n *| /123 | never |\n *| 123/../ | never |\n *\n * @hidden\n */\nexport type SingleRoutePart<S extends string | object> = S extends object\n ? never\n : S extends `${string}/${string}`\n ? never\n : S extends `${string}${SearchOrHash}`\n ? never\n : S extends ''\n ? never\n : S extends `(${string})`\n ? never\n : S extends `[${string}]`\n ? never\n : S;\n\n/**\n * @deprecated Use `RouteParams` or `StrictRouteParams` instead.\n *\n * @hidden\n */\nexport type SearchParams<T extends string = never> = RouteParams<T>;\n\n/**\n * @hidden\n */\nexport type RouteSegments<HrefOrSegments extends Route | string[]> = HrefOrSegments extends string[]\n ? HrefOrSegments\n : HrefOrSegments extends `.${string}`\n ? never\n : HrefOrSegments extends ``\n ? never\n : HrefOrSegments extends `/${infer PartA}`\n ? RouteSegments<PartA>\n : HrefOrSegments extends `${infer PartA}?${string}`\n ? RouteSegments<PartA>\n : HrefOrSegments extends `${infer PartA}#${string}`\n ? RouteSegments<PartA>\n : HrefOrSegments extends `${infer PartA}/${infer PartB}`\n ? [PartA, ...RouteSegments<PartB>]\n : [HrefOrSegments];\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/typed-routes/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * The main routing type for Expo Router.\n *\n * @internal\n * @hidden\n */\nexport namespace ExpoRouter {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-object-type\n export interface __routes {}\n}\n\nexport type HrefObject = {\n /** The path of the route. */\n pathname: string;\n /** Optional parameters for the route. */\n params?: UnknownInputParams;\n};\n\n/**\n * @hidden\n */\nexport type HrefInputParamsObject = {\n /** The path of the route. */\n pathname: string;\n /** Optional input parameters for the route. */\n params?: UnknownInputParams;\n};\n\n/**\n * @hidden\n */\nexport type HrefOutputParamsObject = {\n /** The path of the route */\n pathname: string;\n /** Optional output parameters for the route */\n params?: UnknownOutputParams;\n};\n\nexport type RelativePathString = `./${string}` | `../${string}` | '..';\nexport type SearchOrHash = `?${string}` | `#${string}`;\nexport type ExternalPathString = `${string}:${string}` | `//${string}`;\nexport type Route = Exclude<\n Extract<Href, object>['pathname'], // Use the HrefObject, as it doesn't have query params\n RelativePathString | ExternalPathString\n>;\n\n/**\n * The main routing type for Expo Router. It includes all available routes with strongly\n * typed parameters. It can either be:\n * - **string**: A full path like `/profile/settings` or a relative path like `../settings`.\n * - **object**: An object with a `pathname` and optional `params`. The `pathname` can be\n * a full path like `/profile/settings` or a relative path like `../settings`.\n * The params can be an object of key-value pairs.\n *\n * An Href can either be a string or an object.\n */\nexport type Href<T extends ExpoRouter.__routes = ExpoRouter.__routes> = T extends { href: any }\n ? T['href']\n : string | HrefObject;\n\n/*\n * @hidden\n */\nexport type HrefInputParams<T extends ExpoRouter.__routes = ExpoRouter.__routes> = T extends {\n hrefInputParams: any;\n}\n ? T['hrefInputParams']\n : HrefInputParamsObject;\n\n/*\n * @hidden\n */\nexport type HrefOutputParams<T extends ExpoRouter.__routes = ExpoRouter.__routes> = T extends {\n hrefOutputParams: any;\n}\n ? T['hrefOutputParams']\n : HrefOutputParamsObject;\n\n/**\n * @hidden\n */\nexport type RouteInputParams<T extends Route> =\n Extract<Href, { pathname: T }> extends never\n ? HrefInputParams extends infer H\n ? H extends Record<'pathname' | 'params', any>\n ? T extends H['pathname']\n ? H['params']\n : never\n : never\n : never\n : Extract<HrefInputParams, { pathname: T }>['params'];\n\n/**\n * @hidden\n */\nexport type RouteOutputParams<T extends Route> =\n Extract<HrefOutputParams, { pathname: T }> extends never\n ? HrefOutputParams extends infer H\n ? H extends { pathname: any; params?: any }\n ? T extends H['pathname']\n ? H['params']\n : never\n : never\n : never\n : Extract<HrefOutputParams, { pathname: T }>['params'];\n\n/**\n * @hidden\n */\nexport type RouteParams<T extends Route> = RouteOutputParams<T>;\n\n/**\n * Routes can have known inputs (e.g query params).\n * Unlike outputs, inputs can be `undefined` or `null`.\n *\n * @hidden\n */\nexport type UnknownInputParams = Record<\n string,\n string | number | undefined | null | (string | number)[]\n>;\n\n/**\n * Routes can have unknown outputs (e.g query params).\n * Unlike inputs, outputs can't be undefined or null.\n *\n * @hidden\n */\nexport type UnknownOutputParams = Record<string, string | string[]>;\n\n/**\n * Return only the RoutePart of a string. If the string has multiple parts return never\n *\n * string | type\n *| ---------|------|\n *| 123 | 123 |\n *| /123/abc | never |\n *| 123?abc | never |\n *| ./123 | never |\n *| /123 | never |\n *| 123/../ | never |\n *\n * @hidden\n */\nexport type SingleRoutePart<S extends string | object> = S extends object\n ? never\n : S extends `${string}/${string}`\n ? never\n : S extends `${string}${SearchOrHash}`\n ? never\n : S extends ''\n ? never\n : S extends `(${string})`\n ? never\n : S extends `[${string}]`\n ? never\n : S;\n\n/**\n * @deprecated Use `RouteParams` or `StrictRouteParams` instead.\n *\n * @hidden\n */\nexport type SearchParams<T extends string = never> = RouteParams<T>;\n\n/**\n * @hidden\n */\nexport type RouteSegments<HrefOrSegments extends Route | string[]> = HrefOrSegments extends string[]\n ? HrefOrSegments\n : HrefOrSegments extends `.${string}`\n ? never\n : HrefOrSegments extends ``\n ? never\n : HrefOrSegments extends `/${infer PartA}`\n ? RouteSegments<PartA>\n : HrefOrSegments extends `${infer PartA}?${string}`\n ? RouteSegments<PartA>\n : HrefOrSegments extends `${infer PartA}#${string}`\n ? RouteSegments<PartA>\n : HrefOrSegments extends `${infer PartA}/${infer PartB}`\n ? [PartA, ...RouteSegments<PartB>]\n : [HrefOrSegments];\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useScreens.d.ts","sourceRoot":"","sources":["../src/useScreens.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KA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AE,SAAS;sCAiCtD,GAAG;;EAiEP;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,SAAS,EAChB,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,GAC/B,WAAW,CAAC,SAAS,CAAC,CAqBxB;AAED,wBAAgB,aAAa,CAC3B,KAAK,EAAE,SAAS,EAChB,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,GAAE,OAAO,CAAC,WAAW,CAAM,qBAYxD;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,UAa5E"}
@@ -48,6 +48,7 @@ const Route_1 = require("./Route");
48
48
  const storeContext_1 = require("./global-state/storeContext");
49
49
  const import_mode_1 = __importDefault(require("./import-mode"));
50
50
  const ZoomTransitionEnabler_1 = require("./link/zoom/ZoomTransitionEnabler");
51
+ const zoom_transition_context_1 = require("./link/zoom/zoom-transition-context");
51
52
  const navigationParams_1 = require("./navigationParams");
52
53
  const primitives_1 = require("./primitives");
53
54
  const EmptyRoute_1 = require("./views/EmptyRoute");
@@ -223,12 +224,14 @@ function getQualifiedRouteComponent(value) {
223
224
  }, [navigation]);
224
225
  return (<Route_1.Route node={value} route={route}>
225
226
  <ZoomTransitionEnabler_1.ZoomTransitionEnabler route={route}/>
226
- <react_1.default.Suspense fallback={<SuspenseFallback_1.SuspenseFallback route={value}/>}>
227
- <ScreenComponent {...props}
227
+ <zoom_transition_context_1.ZoomTransitionTargetContextProvider route={route}>
228
+ <react_1.default.Suspense fallback={<SuspenseFallback_1.SuspenseFallback route={value}/>}>
229
+ <ScreenComponent {...props}
228
230
  // Expose the template segment path, e.g. `(home)`, `[foo]`, `index`
229
231
  // the intention is to make it possible to deduce shared routes.
230
232
  segment={value.route}/>
231
- </react_1.default.Suspense>
233
+ </react_1.default.Suspense>
234
+ </zoom_transition_context_1.ZoomTransitionTargetContextProvider>
232
235
  </Route_1.Route>);
233
236
  }
234
237
  if (__DEV__) {