expo-router 7.0.0-canary-20260119-70f7c28 → 7.0.0-canary-20260121-a63c0dd
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/global-state/routing.d.ts.map +1 -1
- package/build/global-state/routing.js +7 -2
- package/build/global-state/routing.js.map +1 -1
- package/build/loaders/utils.d.ts +5 -2
- package/build/loaders/utils.d.ts.map +1 -1
- package/build/loaders/utils.js +8 -5
- package/build/loaders/utils.js.map +1 -1
- package/build/native-tabs/NativeTabsView.d.ts.map +1 -1
- package/build/native-tabs/NativeTabsView.js +6 -6
- package/build/native-tabs/NativeTabsView.js.map +1 -1
- package/build/native-tabs/appearance.d.ts +7 -7
- package/build/native-tabs/appearance.d.ts.map +1 -1
- package/build/native-tabs/appearance.js.map +1 -1
- package/build/native-tabs/types.d.ts +3 -3
- package/build/native-tabs/types.d.ts.map +1 -1
- package/build/native-tabs/types.js.map +1 -1
- package/build/native-tabs/utils/bottomAccessory.d.ts +2 -2
- package/build/native-tabs/utils/bottomAccessory.d.ts.map +1 -1
- package/build/native-tabs/utils/bottomAccessory.js.map +1 -1
- package/build/native-tabs/utils/icon.d.ts +2 -2
- package/build/native-tabs/utils/icon.d.ts.map +1 -1
- package/build/native-tabs/utils/icon.js.map +1 -1
- package/build/split-view/elements.js +3 -3
- package/build/split-view/elements.js.map +1 -1
- package/build/split-view/index.d.ts +1 -1
- package/build/split-view/index.d.ts.map +1 -1
- package/build/split-view/index.js.map +1 -1
- package/build/split-view/split-view.d.ts +3 -3
- package/build/split-view/split-view.d.ts.map +1 -1
- package/build/split-view/split-view.js +4 -4
- package/build/split-view/split-view.js.map +1 -1
- package/build/types.d.ts +4 -4
- package/build/types.d.ts.map +1 -1
- package/build/types.js.map +1 -1
- package/build/ui/TabTrigger.d.ts.map +1 -1
- package/build/ui/TabTrigger.js +8 -4
- package/build/ui/TabTrigger.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/Toolbar/RouterToolbarHostView.swift +0 -9
- package/ios/Toolbar/RouterToolbarItemView.swift +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.module → 7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.pom → 7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd.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 +11 -11
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28-sources.jar → 7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28-sources.jar.md5 → 7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28-sources.jar.sha1 → 7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28-sources.jar.sha256 → 7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28-sources.jar.sha512 → 7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.aar → 7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd.aar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.aar.md5 → 7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.aar.sha1 → 7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.aar.sha256 → 7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.aar.sha512 → 7.0.0-canary-20260121-a63c0dd/expo.modules.router-7.0.0-canary-20260121-a63c0dd.aar.sha512} +0 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type ReactElement } from 'react';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TabAccessoryComponentFactory } from 'react-native-screens';
|
|
3
3
|
import type { NativeTabsBottomAccessoryProps } from '../common/elements';
|
|
4
4
|
/**
|
|
5
5
|
* Converts `<NativeTabs.BottomAccessory>` component into a function,
|
|
6
6
|
* which can be used by `react-native-screens` to render the accessory.
|
|
7
7
|
*/
|
|
8
|
-
export declare function useBottomAccessoryFunctionFromBottomAccessories(bottomAccessory: ReactElement<NativeTabsBottomAccessoryProps, string | React.JSXElementConstructor<any>> | undefined):
|
|
8
|
+
export declare function useBottomAccessoryFunctionFromBottomAccessories(bottomAccessory: ReactElement<NativeTabsBottomAccessoryProps, string | React.JSXElementConstructor<any>> | undefined): TabAccessoryComponentFactory | undefined;
|
|
9
9
|
//# sourceMappingURL=bottomAccessory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottomAccessory.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/bottomAccessory.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"bottomAccessory.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/bottomAccessory.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAEzE,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAGzE;;;GAGG;AACH,wBAAgB,+CAA+C,CAC7D,eAAe,EACX,YAAY,CAAC,8BAA8B,EAAE,MAAM,GAAG,KAAK,CAAC,qBAAqB,CAAC,GAAG,CAAC,CAAC,GACvF,SAAS,GACZ,4BAA4B,GAAG,SAAS,CAY1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottomAccessory.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/bottomAccessory.tsx"],"names":[],"mappings":";;AAUA,0GAgBC;AA1BD,iCAAmD;AAInD,oCAA2D;AAE3D;;;GAGG;AACH,SAAgB,+CAA+C,CAC7D,eAEa;IAEb,OAAO,IAAA,eAAO,EACZ,GAAG,EAAE,CACH,eAAe;QACb,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CACf,CAAC,uCAA+B,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAClD;cAAA,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ,CACjC;YAAA,EAAE,uCAA+B,CAAC,CACnC;QACH,CAAC,CAAC,SAAS,EACf,CAAC,eAAe,CAAC,CAClB,CAAC;AACJ,CAAC","sourcesContent":["import { useMemo, type ReactElement } from 'react';\nimport type {
|
|
1
|
+
{"version":3,"file":"bottomAccessory.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/bottomAccessory.tsx"],"names":[],"mappings":";;AAUA,0GAgBC;AA1BD,iCAAmD;AAInD,oCAA2D;AAE3D;;;GAGG;AACH,SAAgB,+CAA+C,CAC7D,eAEa;IAEb,OAAO,IAAA,eAAO,EACZ,GAAG,EAAE,CACH,eAAe;QACb,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,CACf,CAAC,uCAA+B,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAClD;cAAA,CAAC,eAAe,CAAC,KAAK,CAAC,QAAQ,CACjC;YAAA,EAAE,uCAA+B,CAAC,CACnC;QACH,CAAC,CAAC,SAAS,EACf,CAAC,eAAe,CAAC,CAClB,CAAC;AACJ,CAAC","sourcesContent":["import { useMemo, type ReactElement } from 'react';\nimport type { TabAccessoryComponentFactory } from 'react-native-screens';\n\nimport type { NativeTabsBottomAccessoryProps } from '../common/elements';\nimport { BottomAccessoryPlacementContext } from '../hooks';\n\n/**\n * Converts `<NativeTabs.BottomAccessory>` component into a function,\n * which can be used by `react-native-screens` to render the accessory.\n */\nexport function useBottomAccessoryFunctionFromBottomAccessories(\n bottomAccessory:\n | ReactElement<NativeTabsBottomAccessoryProps, string | React.JSXElementConstructor<any>>\n | undefined\n): TabAccessoryComponentFactory | undefined {\n return useMemo<TabAccessoryComponentFactory | undefined>(\n () =>\n bottomAccessory\n ? (environment) => (\n <BottomAccessoryPlacementContext value={environment}>\n {bottomAccessory.props.children}\n </BottomAccessoryPlacementContext>\n )\n : undefined,\n [bottomAccessory]\n );\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ColorValue, ImageSourcePropType } from 'react-native';
|
|
2
|
-
import type {
|
|
2
|
+
import type { TabsScreenProps, PlatformIconAndroid, PlatformIconIOS } from 'react-native-screens';
|
|
3
3
|
import type { SFSymbol } from 'sf-symbols-typescript';
|
|
4
4
|
import type { NativeTabOptions, NativeTabsProps } from '../types';
|
|
5
5
|
export declare function convertIconColorPropToObject(iconColor: NativeTabsProps['iconColor']): {
|
|
@@ -20,7 +20,7 @@ export declare function useAwaitedScreensIcon(icon: NativeTabOptions['icon']): {
|
|
|
20
20
|
src?: ImageSourcePropType;
|
|
21
21
|
renderingMode?: "template" | "original";
|
|
22
22
|
} | undefined;
|
|
23
|
-
export declare function convertOptionsIconToRNScreensPropsIcon(icon: AwaitedIcon | undefined):
|
|
23
|
+
export declare function convertOptionsIconToRNScreensPropsIcon(icon: AwaitedIcon | undefined): TabsScreenProps['icon'];
|
|
24
24
|
export declare function convertOptionsIconToIOSPropsIcon(icon: AwaitedIcon | undefined): PlatformIconIOS | undefined;
|
|
25
25
|
export declare function convertOptionsIconToAndroidPropsIcon(icon: AwaitedIcon): PlatformIconAndroid | undefined;
|
|
26
26
|
export declare function convertComponentSrcToImageSource(src: React.ReactElement): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/icon.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"icon.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/icon.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAElE,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,eAAe,CAAC,WAAW,CAAC,GAAG;IACrF,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,QAAQ,CAAC,EAAE,UAAU,CAAC;CACvB,CAUA;AAED,KAAK,WAAW,GACZ;IACE,EAAE,CAAC,EAAE,QAAQ,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GACD;IACE,GAAG,CAAC,EAAE,mBAAmB,CAAC;IAC1B,aAAa,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CACzC,CAAC;AAEN,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC;;;;UAJxD,mBAAmB;oBACT,UAAU,GAAG,UAAU;cAyB5C;AAMD,wBAAgB,sCAAsC,CACpD,IAAI,EAAE,WAAW,GAAG,SAAS,GAC5B,eAAe,CAAC,MAAM,CAAC,CAQzB;AAED,wBAAgB,gCAAgC,CAC9C,IAAI,EAAE,WAAW,GAAG,SAAS,GAC5B,eAAe,GAAG,SAAS,CAc7B;AAED,wBAAgB,oCAAoC,CAClD,IAAI,EAAE,WAAW,GAChB,mBAAmB,GAAG,SAAS,CAWjC;AAED,wBAAgB,gCAAgC,CAAC,GAAG,EAAE,KAAK,CAAC,YAAY;;cAUvE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/icon.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"icon.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/icon.ts"],"names":[],"mappings":";;AASA,oEAaC;AAYD,sDAsBC;AAMD,wFAUC;AAED,4EAgBC;AAED,oFAaC;AAED,4EAUC;AArHD,iCAAqD;AAKrD,mDAAqD;AACrD,iDAA+F;AAG/F,SAAgB,4BAA4B,CAAC,SAAuC;IAIlF,IAAI,SAAS,EAAE,CAAC;QACd,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,SAAS,IAAI,SAAS,IAAI,UAAU,IAAI,SAAS,CAAC,EAAE,CAAC;YACzF,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,OAAO;YACL,OAAO,EAAE,SAAuB;SACjC,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAYD,SAAgB,qBAAqB,CAAC,IAA8B;IAClE,MAAM,GAAG,GAAG,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG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AAI,IAAA,wBAAa,EAAC,GAAG,EAAE,uCAA4B,CAAC,EAAE,CAAC;QAC5D,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;IACrC,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC","sourcesContent":["import { useEffect, useMemo, useState } from 'react';\nimport type { ColorValue, ImageSourcePropType } from 'react-native';\nimport type { TabsScreenProps, PlatformIconAndroid, PlatformIconIOS } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { isChildOfType } from '../../utils/children';\nimport { NativeTabsTriggerPromiseIcon, NativeTabsTriggerVectorIcon } from '../common/elements';\nimport type { NativeTabOptions, NativeTabsProps } from '../types';\n\nexport function convertIconColorPropToObject(iconColor: NativeTabsProps['iconColor']): {\n default?: ColorValue;\n selected?: ColorValue;\n} {\n if (iconColor) {\n if (typeof iconColor === 'object' && ('default' in iconColor || 'selected' in iconColor)) {\n return iconColor;\n }\n return {\n default: iconColor as ColorValue,\n };\n }\n return {};\n}\n\ntype AwaitedIcon =\n | {\n sf?: SFSymbol;\n drawable?: string;\n }\n | {\n src?: ImageSourcePropType;\n renderingMode?: 'template' | 'original';\n };\n\nexport function useAwaitedScreensIcon(icon: NativeTabOptions['icon']) {\n const src = icon && typeof icon === 'object' && 'src' in icon ? icon.src : undefined;\n const [awaitedIcon, setAwaitedIcon] = useState<AwaitedIcon | undefined>(undefined);\n\n useEffect(() => {\n const loadIcon = async () => {\n if (src && src instanceof Promise) {\n const awaitedSrc = await src;\n if (awaitedSrc) {\n const currentAwaitedIcon = { src: awaitedSrc };\n setAwaitedIcon(currentAwaitedIcon);\n }\n }\n };\n loadIcon();\n // Checking `src` rather then icon here, to avoid unnecessary re-renders\n // The icon object can be recreated, while src should stay the same\n // In this case as we control `VectorIcon`, it will only change if `family` or `name` props change\n // So we should be safe with promise resolving\n }, [src]);\n\n return useMemo(() => (isAwaitedIcon(icon) ? icon : awaitedIcon), [awaitedIcon, icon]);\n}\n\nfunction isAwaitedIcon(icon: NativeTabOptions['icon']): icon is AwaitedIcon {\n return !icon || !('src' in icon && icon.src instanceof Promise);\n}\n\nexport function convertOptionsIconToRNScreensPropsIcon(\n icon: AwaitedIcon | undefined\n): TabsScreenProps['icon'] {\n if (!icon) {\n return undefined;\n }\n return {\n ios: convertOptionsIconToIOSPropsIcon(icon),\n android: convertOptionsIconToAndroidPropsIcon(icon),\n };\n}\n\nexport function convertOptionsIconToIOSPropsIcon(\n icon: AwaitedIcon | undefined\n): PlatformIconIOS | undefined {\n if (icon && 'sf' in icon && icon.sf) {\n return {\n type: 'sfSymbol',\n name: icon.sf,\n };\n }\n if (icon && 'src' in icon && icon.src) {\n if (icon.renderingMode === 'original') {\n return { type: 'imageSource', imageSource: icon.src };\n }\n return { type: 'templateSource', templateSource: icon.src };\n }\n return undefined;\n}\n\nexport function convertOptionsIconToAndroidPropsIcon(\n icon: AwaitedIcon\n): PlatformIconAndroid | undefined {\n if (icon && 'drawable' in icon && icon.drawable) {\n return {\n type: 'drawableResource',\n name: icon.drawable,\n };\n }\n if (icon && 'src' in icon && icon.src) {\n return { type: 'imageSource', imageSource: icon.src };\n }\n return undefined;\n}\n\nexport function convertComponentSrcToImageSource(src: React.ReactElement) {\n if (isChildOfType(src, NativeTabsTriggerVectorIcon)) {\n const props = src.props;\n return { src: props.family.getImageSource(props.name, 24, 'white') };\n } else if (isChildOfType(src, NativeTabsTriggerPromiseIcon)) {\n return { src: src.props.loader() };\n } else {\n console.warn('Only VectorIcon is supported as a React element in Icon.src');\n }\n return undefined;\n}\n"]}
|
|
@@ -5,14 +5,14 @@ exports.SplitViewInspector = SplitViewInspector;
|
|
|
5
5
|
const react_native_safe_area_context_1 = require("react-native-safe-area-context");
|
|
6
6
|
const experimental_1 = require("react-native-screens/experimental");
|
|
7
7
|
function SplitViewColumn(props) {
|
|
8
|
-
return (<experimental_1.
|
|
8
|
+
return (<experimental_1.Split.Column>
|
|
9
9
|
<react_native_safe_area_context_1.SafeAreaProvider>{props.children}</react_native_safe_area_context_1.SafeAreaProvider>
|
|
10
|
-
</experimental_1.
|
|
10
|
+
</experimental_1.Split.Column>);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* @platform iOS 26+
|
|
14
14
|
*/
|
|
15
15
|
function SplitViewInspector(props) {
|
|
16
|
-
return <experimental_1.
|
|
16
|
+
return <experimental_1.Split.Inspector>{props.children}</experimental_1.Split.Inspector>;
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=elements.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/split-view/elements.tsx"],"names":[],"mappings":";;AAOA,0CAMC;AAKD,gDAEC;AApBD,mFAAkE;AAClE,
|
|
1
|
+
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/split-view/elements.tsx"],"names":[],"mappings":";;AAOA,0CAMC;AAKD,gDAEC;AApBD,mFAAkE;AAClE,oEAA0D;AAM1D,SAAgB,eAAe,CAAC,KAA2B;IACzD,OAAO,CACL,CAAC,oBAAK,CAAC,MAAM,CACX;MAAA,CAAC,iDAAgB,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,iDAAgB,CACtD;IAAA,EAAE,oBAAK,CAAC,MAAM,CAAC,CAChB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAA2B;IAC5D,OAAO,CAAC,oBAAK,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,oBAAK,CAAC,SAAS,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import { SafeAreaProvider } from 'react-native-safe-area-context';\nimport { Split } from 'react-native-screens/experimental';\n\nexport interface SplitViewColumnProps {\n children?: React.ReactNode;\n}\n\nexport function SplitViewColumn(props: SplitViewColumnProps) {\n return (\n <Split.Column>\n <SafeAreaProvider>{props.children}</SafeAreaProvider>\n </Split.Column>\n );\n}\n\n/**\n * @platform iOS 26+\n */\nexport function SplitViewInspector(props: SplitViewColumnProps) {\n return <Split.Inspector>{props.children}</Split.Inspector>;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { SplitView, SplitViewProps } from './split-view';
|
|
2
2
|
export * from './elements';
|
|
3
|
-
export { type
|
|
3
|
+
export { type SplitHostProps } from 'react-native-screens/experimental';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/split-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACzD,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/split-view/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACzD,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mCAAmC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/split-view/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAyD;AAAhD,uGAAA,SAAS,OAAA;AAClB,6CAA2B","sourcesContent":["export { SplitView, SplitViewProps } from './split-view';\nexport * from './elements';\nexport { type
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/split-view/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,2CAAyD;AAAhD,uGAAA,SAAS,OAAA;AAClB,6CAA2B","sourcesContent":["export { SplitView, SplitViewProps } from './split-view';\nexport * from './elements';\nexport { type SplitHostProps } from 'react-native-screens/experimental';\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { type ReactNode } from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type SplitHostProps } from 'react-native-screens/experimental';
|
|
3
3
|
import { SplitViewColumn, SplitViewInspector } from './elements';
|
|
4
4
|
/**
|
|
5
|
-
* For full list of supported props, see [`
|
|
5
|
+
* For full list of supported props, see [`SplitHostProps`](http://github.com/software-mansion/react-native-screens/blob/main/src/components/gamma/split/SplitHost.types.ts#L117)
|
|
6
6
|
*/
|
|
7
|
-
export interface SplitViewProps extends Omit<
|
|
7
|
+
export interface SplitViewProps extends Omit<SplitHostProps, 'children'> {
|
|
8
8
|
children?: ReactNode;
|
|
9
9
|
}
|
|
10
10
|
declare function SplitViewNavigator({ children, ...splitViewHostProps }: SplitViewProps): React.JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-view.d.ts","sourceRoot":"","sources":["../../src/split-view/split-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClF,OAAO,
|
|
1
|
+
{"version":3,"file":"split-view.d.ts","sourceRoot":"","sources":["../../src/split-view/split-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAsC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClF,OAAO,EAAS,KAAK,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAMjE;;GAEG;AACH,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC;IACtE,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,iBAAS,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,kBAAkB,EAAE,EAAE,cAAc,qBA0D9E;AAED,eAAO,MAAM,SAAS;;;CAGpB,CAAC"}
|
|
@@ -71,13 +71,13 @@ function SplitViewNavigator({ children, ...splitViewHostProps }) {
|
|
|
71
71
|
return <Navigator_1.Slot />;
|
|
72
72
|
}
|
|
73
73
|
// The key is needed, because number of columns cannot be changed dynamically
|
|
74
|
-
return (<experimental_1.
|
|
74
|
+
return (<experimental_1.Split.Host key={numberOfSidebars + numberOfInspectors} {...splitViewHostProps}>
|
|
75
75
|
{columnChildren}
|
|
76
|
-
<experimental_1.
|
|
76
|
+
<experimental_1.Split.Column>
|
|
77
77
|
<WrappedSlot />
|
|
78
|
-
</experimental_1.
|
|
78
|
+
</experimental_1.Split.Column>
|
|
79
79
|
{inspectorChildren}
|
|
80
|
-
</experimental_1.
|
|
80
|
+
</experimental_1.Split.Host>);
|
|
81
81
|
}
|
|
82
82
|
exports.SplitView = Object.assign(SplitViewNavigator, {
|
|
83
83
|
Column: elements_1.SplitViewColumn,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"split-view.js","sourceRoot":"","sources":["../../src/split-view/split-view.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAkF;AAClF,
|
|
1
|
+
{"version":3,"file":"split-view.js","sourceRoot":"","sources":["../../src/split-view/split-view.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAkF;AAClF,oEAA+E;AAE/E,yCAAiE;AACjE,4EAAyE;AACzE,kDAA0C;AAE1C,MAAM,wBAAwB,GAAG,IAAA,qBAAa,EAAC,KAAK,CAAC,CAAC;AAStD,SAAS,kBAAkB,CAAC,EAAE,QAAQ,EAAE,GAAG,kBAAkB,EAAkB;IAC7E,IAAI,IAAA,WAAG,EAAC,wBAAwB,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAC;IAClF,CAAC;IAED,sFAAsF;IACtF,IAAI,IAAA,WAAG,EAAC,6CAAqB,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CAAC,EAAE,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;QAChF,OAAO,CAAC,gBAAI,CAAC,AAAD,EAAG,CAAC;IAClB,CAAC;IAED,6EAA6E;IAC7E,OAAO,CACL,CAAC,oBAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,gBAAgB,GAAG,kBAAkB,CAAC,CAAC,IAAI,kBAAkB,CAAC,CAC7E;MAAA,CAAC,cAAc,CACf;MAAA,CAAC,oBAAK,CAAC,MAAM,CACX;QAAA,CAAC,WAAW,CAAC,AAAD,EACd;MAAA,EAAE,oBAAK,CAAC,MAAM,CACd;MAAA,CAAC,iBAAiB,CACpB;IAAA,EAAE,oBAAK,CAAC,IAAI,CAAC,CACd,CAAC;AACJ,CAAC;AAEY,QAAA,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;IACzD,MAAM,EAAE,0BAAe;IACvB,SAAS,EAAE,6BAAkB;CAC9B,CAAC,CAAC","sourcesContent":["import React, { createContext, isValidElement, use, type ReactNode } from 'react';\nimport { Split, type SplitHostProps } from 'react-native-screens/experimental';\n\nimport { SplitViewColumn, SplitViewInspector } from './elements';\nimport { IsWithinLayoutContext } from '../layouts/IsWithinLayoutContext';\nimport { Slot } from '../views/Navigator';\n\nconst IsWithinSplitViewContext = createContext(false);\n\n/**\n * For full list of supported props, see [`SplitHostProps`](http://github.com/software-mansion/react-native-screens/blob/main/src/components/gamma/split/SplitHost.types.ts#L117)\n */\nexport interface SplitViewProps extends Omit<SplitHostProps, 'children'> {\n children?: ReactNode;\n}\n\nfunction SplitViewNavigator({ children, ...splitViewHostProps }: SplitViewProps) {\n if (use(IsWithinSplitViewContext)) {\n throw new Error('There can only be one SplitView in the navigation hierarchy.');\n }\n\n // TODO: Add better way of detecting if SplitView is rendered inside Native navigator.\n if (use(IsWithinLayoutContext)) {\n throw new Error('SplitView cannot be used inside another navigator, except for Slot.');\n }\n\n if (process.env.EXPO_OS !== 'ios') {\n console.warn(\n 'SplitView is only supported on iOS. The SplitView will behave like a Slot navigator on other platforms.'\n );\n return <Slot />;\n }\n\n const WrappedSlot = () => (\n <IsWithinLayoutContext value>\n <Slot />\n </IsWithinLayoutContext>\n );\n\n const allChildrenArray = React.Children.toArray(children);\n const columnChildren = allChildrenArray.filter(\n (child) => isValidElement(child) && child.type === SplitViewColumn\n );\n const inspectorChildren = allChildrenArray.filter(\n (child) => isValidElement(child) && child.type === SplitViewInspector\n );\n const numberOfSidebars = columnChildren.length;\n const numberOfInspectors = inspectorChildren.length;\n\n if (allChildrenArray.length !== columnChildren.length + inspectorChildren.length) {\n console.warn(\n 'Only SplitView.Column and SplitView.Inspector components are allowed as direct children of SplitView.'\n );\n }\n\n if (numberOfSidebars > 2) {\n throw new Error('There can only be two SplitView.Column in the SplitView.');\n }\n\n if (numberOfSidebars + numberOfInspectors === 0) {\n console.warn('No SplitView.Column and SplitView.Inspector found in SplitView.');\n return <Slot />;\n }\n\n // The key is needed, because number of columns cannot be changed dynamically\n return (\n <Split.Host key={numberOfSidebars + numberOfInspectors} {...splitViewHostProps}>\n {columnChildren}\n <Split.Column>\n <WrappedSlot />\n </Split.Column>\n {inspectorChildren}\n </Split.Host>\n );\n}\n\nexport const SplitView = Object.assign(SplitViewNavigator, {\n Column: SplitViewColumn,\n Inspector: SplitViewInspector,\n});\n"]}
|
package/build/types.d.ts
CHANGED
|
@@ -60,10 +60,10 @@ export type NativeIntent = {
|
|
|
60
60
|
/**
|
|
61
61
|
* Function type for route loaders. Loaders are executed on the server during
|
|
62
62
|
* SSR/SSG to fetch data required by a route.
|
|
63
|
+
*
|
|
64
|
+
* During SSG (Static Site Generation), the `request` parameter will be `undefined`
|
|
65
|
+
* as there is no HTTP request at build time.
|
|
63
66
|
*/
|
|
64
|
-
export type LoaderFunction<T = any> = (
|
|
65
|
-
params: Record<string, string | string[]>;
|
|
66
|
-
request?: Request;
|
|
67
|
-
}) => Promise<T> | T;
|
|
67
|
+
export type LoaderFunction<T = any> = (request: Request | undefined, params: Record<string, string | string[]>) => Promise<T> | T;
|
|
68
68
|
export type * from './typed-routes/types';
|
|
69
69
|
//# sourceMappingURL=types.d.ts.map
|
package/build/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4CAA4C;IAC5C,IAAI,IAAI,MAAM,EAAE,CAAC;IACjB,CAAC,EAAE,EAAE,MAAM,GAAG,GAAG,CAAC;IAClB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC;IACnB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IAC5B,qEAAqE;IACrE,EAAE,EAAE,MAAM,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AAEjF;;;;;;;;;GASG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB;;;;;;;;;;;;;OAaG;IACH,kBAAkB,CAAC,EAAE,CAAC,KAAK,EAAE;QAC3B,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,OAAO,CAAC;KAClB,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7C;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,KAAK,SAAS,GAAG,IAAI,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC;CACzF,CAAC;AAEF
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["// TODO: Use the global type\n/**\n * @hidden\n */\nexport interface RequireContext {\n /** Return the keys that can be resolved. */\n keys(): string[];\n (id: string): any;\n <T>(id: string): T;\n /** **Unimplemented:** Return the module identifier for a user request. */\n resolve(id: string): string;\n /** **Unimplemented:** Readable identifier for the context module. */\n id: string;\n}\n\n/**\n * The list of input keys will become optional, everything else will remain the same.\n */\nexport type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\n/**\n * Created by using a special file called `+native-intent.tsx` at the top-level of your\n * project's **app** directory. It exports `redirectSystemPath` or `legacy_subscribe` functions,\n * both methods designed to handle URL/path processing.\n *\n * Useful for re-writing URLs to correctly target a route when unique/referred URLs\n * are incoming from third-party providers or stale URLs from previous versions.\n *\n * @see For more information on how to use `NativeIntent`, see [Customizing links](/router/advanced/native-intent/).\n */\nexport type NativeIntent = {\n /**\n * A special method used to process URLs in native apps. When invoked, it receives an\n * `options` object with the following properties:\n * - **path**: represents the URL or path undergoing processing.\n * - **initial**: a boolean indicating whether the path is the app's initial URL.\n *\n * Its return value should be a `string`, a `Promise<string | null>`, or `null`. When a falsy value\n * is returned (for example, `null`), no redirection occurs and the app stays on the current path.\n *\n * Note that throwing errors within this method may result in app crashes. It's recommended to\n * wrap your code inside a `try/catch` block and utilize `.catch()` when appropriate.\n *\n * @see For usage information, see [Redirecting system paths](/router/advanced/native-intent/#redirectsystempath).\n */\n redirectSystemPath?: (event: {\n path: string;\n initial: boolean;\n }) => Promise<string | null> | string | null;\n /**\n * > **warning** Experimentally available in SDK 52.\n *\n * Useful as an alternative API when a third-party provider doesn't support Expo Router\n * but has support for React Navigation via `Linking.subscribe()` for existing projects.\n *\n * Using this API is not recommended for newer projects or integrations since it is\n * incompatible with Server Side Routing and\n * [Static Rendering](/router/reference/static-rendering/), and can become challenging to manage while offline or in a low network environment.\n *\n */\n legacy_subscribe?: (listener: (url: string) => void) => undefined | void | (() => void);\n};\n\n/**\n * Function type for route loaders. Loaders are executed on the server during\n * SSR/SSG to fetch data required by a route.\n */\nexport type LoaderFunction<T = any> = (
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["// TODO: Use the global type\n/**\n * @hidden\n */\nexport interface RequireContext {\n /** Return the keys that can be resolved. */\n keys(): string[];\n (id: string): any;\n <T>(id: string): T;\n /** **Unimplemented:** Return the module identifier for a user request. */\n resolve(id: string): string;\n /** **Unimplemented:** Readable identifier for the context module. */\n id: string;\n}\n\n/**\n * The list of input keys will become optional, everything else will remain the same.\n */\nexport type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\n/**\n * Created by using a special file called `+native-intent.tsx` at the top-level of your\n * project's **app** directory. It exports `redirectSystemPath` or `legacy_subscribe` functions,\n * both methods designed to handle URL/path processing.\n *\n * Useful for re-writing URLs to correctly target a route when unique/referred URLs\n * are incoming from third-party providers or stale URLs from previous versions.\n *\n * @see For more information on how to use `NativeIntent`, see [Customizing links](/router/advanced/native-intent/).\n */\nexport type NativeIntent = {\n /**\n * A special method used to process URLs in native apps. When invoked, it receives an\n * `options` object with the following properties:\n * - **path**: represents the URL or path undergoing processing.\n * - **initial**: a boolean indicating whether the path is the app's initial URL.\n *\n * Its return value should be a `string`, a `Promise<string | null>`, or `null`. When a falsy value\n * is returned (for example, `null`), no redirection occurs and the app stays on the current path.\n *\n * Note that throwing errors within this method may result in app crashes. It's recommended to\n * wrap your code inside a `try/catch` block and utilize `.catch()` when appropriate.\n *\n * @see For usage information, see [Redirecting system paths](/router/advanced/native-intent/#redirectsystempath).\n */\n redirectSystemPath?: (event: {\n path: string;\n initial: boolean;\n }) => Promise<string | null> | string | null;\n /**\n * > **warning** Experimentally available in SDK 52.\n *\n * Useful as an alternative API when a third-party provider doesn't support Expo Router\n * but has support for React Navigation via `Linking.subscribe()` for existing projects.\n *\n * Using this API is not recommended for newer projects or integrations since it is\n * incompatible with Server Side Routing and\n * [Static Rendering](/router/reference/static-rendering/), and can become challenging to manage while offline or in a low network environment.\n *\n */\n legacy_subscribe?: (listener: (url: string) => void) => undefined | void | (() => void);\n};\n\n/**\n * Function type for route loaders. Loaders are executed on the server during\n * SSR/SSG to fetch data required by a route.\n *\n * During SSG (Static Site Generation), the `request` parameter will be `undefined`\n * as there is no HTTP request at build time.\n */\nexport type LoaderFunction<T = any> = (\n request: Request | undefined,\n params: Record<string, string | string[]>\n) => Promise<T> | T;\n\nexport type * from './typed-routes/types';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabTrigger.d.ts","sourceRoot":"","sources":["../../src/ui/TabTrigger.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAO,YAAY,EAAE,cAAc,EAAe,MAAM,OAAO,CAAC;AAClF,OAAO,EAAE,IAAI,EAAyB,cAAc,EAAE,MAAM,cAAc,CAAC;AAG3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAK3C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGrC,KAAK,qCAAqC,GAAG,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,GAAG;IAC9E,QAAQ,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,qCAAqC,GAAG;IACpE;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B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|
117
117
|
return;
|
|
118
|
-
|
|
118
|
+
if (!trigger.isFocused) {
|
|
119
|
+
switchTab(name, { resetOnFocus });
|
|
120
|
+
}
|
|
119
121
|
}, [onPress, name, resetOnFocus, trigger]);
|
|
120
122
|
const handleOnLongPress = (0, react_1.useCallback)((event) => {
|
|
121
123
|
onLongPress?.(event);
|
|
@@ -129,9 +131,11 @@ function useTabTrigger(options) {
|
|
|
129
131
|
});
|
|
130
132
|
if (!(0, useLinkToPathProps_1.shouldHandleMouseEvent)(event))
|
|
131
133
|
return;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
134
|
+
if (!trigger.isFocused) {
|
|
135
|
+
switchTab(name, {
|
|
136
|
+
resetOnFocus,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
135
139
|
}, [onLongPress, name, resetOnFocus, trigger]);
|
|
136
140
|
const triggerProps = {
|
|
137
141
|
isFocused: Boolean(trigger?.isFocused),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabTrigger.js","sourceRoot":"","sources":["../../src/ui/TabTrigger.tsx"],"names":[],"mappings":";;AAoEA,gCA4BC;AAKD,oCAIC;AAkCD,sCAyGC;AApPD,qDAA4C;AAE5C,iCAAkF;AAClF,+CAA2E;AAE3E,6CAAoD;AAEpD,+DAAyD;AACzD,sDAA2C;AAC3C,mEAAoE;AACpE,0CAAyD;AAEzD,kDAAyD;AAqCzD,MAAM,cAAc,GAAG,iBAA4D,CAAC;AAEpF;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,UAAU,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,KAAK,EAAmB;IACzF,MAAM,EAAE,OAAO,EAAE,YAAY,EAAE,GAAG,aAAa,CAAC;QAC9C,IAAI;QACJ,YAAY;QACZ,GAAG,KAAK;KACT,CAAC,CAAC;IAEH,sFAAsF;IACtF,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CACL,CAAC,cAA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S;QACT,UAAU;QACV,OAAO;QACP,YAAY;KACb,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,UAAU,EAAE;QACV,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;KAChC;CACF,CAAC,CAAC","sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { TabNavigationState } from '@react-navigation/native';\nimport { ReactNode, use, ReactElement, ComponentProps, useCallback } from 'react';\nimport { View, StyleSheet, Pressable, PressableProps } from 'react-native';\n\nimport { TabTriggerMapContext } from './TabContext';\nimport type { TriggerMap } from './common';\nimport { appendBaseUrl } from '../fork/getPathFromState';\nimport { router } from '../imperative-api';\nimport { shouldHandleMouseEvent } from '../link/useLinkToPathProps';\nimport { stripGroupSegmentsFromPath } from '../matchers';\nimport type { Href } from '../types';\nimport { useNavigatorContext } from '../views/Navigator';\n\ntype PressablePropsWithoutFunctionChildren = Omit<PressableProps, 'children'> & {\n children?: ReactNode | undefined;\n};\n\nexport type TabTriggerProps = PressablePropsWithoutFunctionChildren & {\n /**\n * Name of tab. When used within a `TabList` this sets the name of the tab.\n * Otherwise, this references the name.\n */\n name: string;\n /**\n * Name of tab. Required when used within a `TabList`.\n */\n href?: Href;\n /**\n * Forward props to child component. Useful for custom wrappers.\n */\n asChild?: boolean;\n /**\n * Resets the route when switching to a tab.\n */\n resetOnFocus?: boolean;\n};\n\nexport type TabTriggerOptions = {\n name: string;\n href: Href;\n};\n\nexport type TabTriggerSlotProps = PressablePropsWithoutFunctionChildren &\n React.RefAttributes<View> & {\n isFocused?: boolean;\n href?: string;\n };\n\nconst TabTriggerSlot = Slot as React.ForwardRefExoticComponent<TabTriggerSlotProps>;\n\n/**\n * Creates a trigger to navigate to a tab. When used as child of `TabList`, its\n * functionality slightly changes since the `href` prop is required,\n * and the trigger also defines what routes are present in the `Tabs`.\n *\n * When used outside of `TabList`, this component no longer requires an `href`.\n *\n * @example\n * ```tsx\n * <Tabs>\n * <TabSlot />\n * <TabList>\n * <TabTrigger name=\"home\" href=\"/\" />\n * </TabList>\n * </Tabs>\n * ```\n */\nexport function TabTrigger({ asChild, name, href, resetOnFocus, ...props }: TabTriggerProps) {\n const { trigger, triggerProps } = useTabTrigger({\n name,\n resetOnFocus,\n ...props,\n });\n\n // Pressable doesn't accept the extra props, so only pass them if we are using asChild\n if (asChild) {\n return (\n <TabTriggerSlot\n style={styles.tabTrigger}\n {...props}\n {...triggerProps}\n href={trigger?.resolvedHref}>\n {props.children}\n </TabTriggerSlot>\n );\n } else {\n // These props are not typed, but are allowed by React Native Web\n const reactNativeWebProps = { href: trigger?.resolvedHref };\n\n return (\n <Pressable style={styles.tabTrigger} {...reactNativeWebProps} {...props} {...triggerProps}>\n {props.children}\n </Pressable>\n );\n }\n}\n\n/**\n * @hidden\n */\nexport function isTabTrigger(\n child: ReactElement<any>\n): child is ReactElement<ComponentProps<typeof TabTrigger>> {\n return child.type === TabTrigger;\n}\n\n/**\n * Options for `switchTab` function.\n */\nexport type SwitchToOptions = {\n /**\n * Navigate and reset the history on route focus.\n */\n resetOnFocus?: boolean;\n};\n\nexport type Trigger = TriggerMap[string] & {\n isFocused: boolean;\n resolvedHref: string;\n route: TabNavigationState<any>['routes'][number];\n};\n\nexport type UseTabTriggerResult = {\n switchTab: (name: string, options: SwitchToOptions) => void;\n getTrigger: (name: string) => Trigger | undefined;\n trigger?: Trigger;\n triggerProps: TriggerProps;\n};\n\nexport type TriggerProps = {\n isFocused: boolean;\n onPress: PressableProps['onPress'];\n onLongPress: PressableProps['onLongPress'];\n};\n\n/**\n * Utility hook creating custom `TabTrigger`.\n */\nexport function useTabTrigger(options: TabTriggerProps): UseTabTriggerResult {\n const { state, navigation } = useNavigatorContext();\n const { name, resetOnFocus, onPress, onLongPress } = options;\n const triggerMap = use(TabTriggerMapContext);\n\n const getTrigger = useCallback(\n (name: string) => {\n const config = triggerMap[name];\n\n if (!config) {\n return;\n }\n\n return {\n isFocused: state.index === config.index,\n route: state.routes[config.index],\n resolvedHref: stripGroupSegmentsFromPath(appendBaseUrl(config.href)),\n ...config,\n };\n },\n [triggerMap]\n );\n\n const trigger = name !== undefined ? getTrigger(name) : undefined;\n\n const switchTab = useCallback(\n (name: string, options?: SwitchToOptions) => {\n const config = triggerMap[name];\n\n if (config) {\n if (config.type === 'external') {\n return router.navigate(config.href);\n } else {\n return navigation?.dispatch({\n ...config.action,\n type: 'JUMP_TO',\n payload: {\n ...config.action.payload,\n ...options,\n },\n });\n }\n } else {\n return navigation?.dispatch({\n type: 'JUMP_TO',\n payload: {\n name,\n },\n });\n }\n },\n [navigation, triggerMap]\n );\n\n const handleOnPress = useCallback<NonNullable<PressableProps['onPress']>>(\n (event) => {\n onPress?.(event);\n if (!trigger) return;\n if (event?.isDefaultPrevented()) return;\n\n navigation?.emit({\n type: 'tabPress',\n target: trigger.type === 'internal' ? trigger.route.key : trigger?.href,\n canPreventDefault: true,\n });\n\n if (!shouldHandleMouseEvent(event)) return;\n\n switchTab(name, { resetOnFocus });\n },\n [onPress, name, resetOnFocus, trigger]\n );\n\n const handleOnLongPress = useCallback<NonNullable<PressableProps['onLongPress']>>(\n (event) => {\n onLongPress?.(event);\n if (!trigger) return;\n if (event?.isDefaultPrevented()) return;\n\n navigation?.emit({\n type: 'tabLongPress',\n target: trigger.type === 'internal' ? trigger.route.key : trigger?.href,\n });\n\n if (!shouldHandleMouseEvent(event)) return;\n\n switchTab(name, {\n resetOnFocus,\n });\n },\n [onLongPress, name, resetOnFocus, trigger]\n );\n\n const triggerProps = {\n isFocused: Boolean(trigger?.isFocused),\n onPress: handleOnPress,\n onLongPress: handleOnLongPress,\n };\n\n return {\n switchTab,\n getTrigger,\n trigger,\n triggerProps,\n };\n}\n\nconst styles = StyleSheet.create({\n tabTrigger: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n});\n"]}
|
|
1
|
+
{"version":3,"file":"TabTrigger.js","sourceRoot":"","sources":["../../src/ui/TabTrigger.tsx"],"names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IAAI,KAAK,EAAE,kBAAkB,EAAE;YAAE,OAAO;QAExC,UAAU,EAAE,IAAI,CAAC;YACf,IAAI,EAAE,cAAc;YACpB,MAAM,EAAE,OAAO,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,IAAI;SACxE,CAAC,CAAC;QAEH,IAAI,CAAC,IAAA,2CAAsB,EAAC,KAAK,CAAC;YAAE,OAAO;QAE3C,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC;YACvB,SAAS,CAAC,IAAI,EAAE;gBACd,YAAY;aACb,CAAC,CAAC;QACL,CAAC;IACH,CAAC,EACD,CAAC,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,CAC3C,CAAC;IAEF,MAAM,YAAY,GAAG;QACnB,SAAS,EAAE,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC;QACtC,OAAO,EAAE,aAAa;QACtB,WAAW,EAAE,iBAAiB;KAC/B,CAAC;IAEF,OAAO;QACL,SAAS;QACT,UAAU;QACV,OAAO;QACP,YAAY;KACb,CAAC;AACJ,CAAC;AAED,MAAM,MAAM,GAAG,yBAAU,CAAC,MAAM,CAAC;IAC/B,UAAU,EAAE;QACV,aAAa,EAAE,KAAK;QACpB,cAAc,EAAE,eAAe;KAChC;CACF,CAAC,CAAC","sourcesContent":["import { Slot } from '@radix-ui/react-slot';\nimport { TabNavigationState } from '@react-navigation/native';\nimport { ReactNode, use, ReactElement, ComponentProps, useCallback } from 'react';\nimport { View, StyleSheet, Pressable, PressableProps } from 'react-native';\n\nimport { TabTriggerMapContext } from './TabContext';\nimport type { TriggerMap } from './common';\nimport { appendBaseUrl } from '../fork/getPathFromState';\nimport { router } from '../imperative-api';\nimport { shouldHandleMouseEvent } from '../link/useLinkToPathProps';\nimport { stripGroupSegmentsFromPath } from '../matchers';\nimport type { Href } from '../types';\nimport { useNavigatorContext } from '../views/Navigator';\n\ntype PressablePropsWithoutFunctionChildren = Omit<PressableProps, 'children'> & {\n children?: ReactNode | undefined;\n};\n\nexport type TabTriggerProps = PressablePropsWithoutFunctionChildren & {\n /**\n * Name of tab. When used within a `TabList` this sets the name of the tab.\n * Otherwise, this references the name.\n */\n name: string;\n /**\n * Name of tab. Required when used within a `TabList`.\n */\n href?: Href;\n /**\n * Forward props to child component. Useful for custom wrappers.\n */\n asChild?: boolean;\n /**\n * Resets the route when switching to a tab.\n */\n resetOnFocus?: boolean;\n};\n\nexport type TabTriggerOptions = {\n name: string;\n href: Href;\n};\n\nexport type TabTriggerSlotProps = PressablePropsWithoutFunctionChildren &\n React.RefAttributes<View> & {\n isFocused?: boolean;\n href?: string;\n };\n\nconst TabTriggerSlot = Slot as React.ForwardRefExoticComponent<TabTriggerSlotProps>;\n\n/**\n * Creates a trigger to navigate to a tab. When used as child of `TabList`, its\n * functionality slightly changes since the `href` prop is required,\n * and the trigger also defines what routes are present in the `Tabs`.\n *\n * When used outside of `TabList`, this component no longer requires an `href`.\n *\n * @example\n * ```tsx\n * <Tabs>\n * <TabSlot />\n * <TabList>\n * <TabTrigger name=\"home\" href=\"/\" />\n * </TabList>\n * </Tabs>\n * ```\n */\nexport function TabTrigger({ asChild, name, href, resetOnFocus, ...props }: TabTriggerProps) {\n const { trigger, triggerProps } = useTabTrigger({\n name,\n resetOnFocus,\n ...props,\n });\n\n // Pressable doesn't accept the extra props, so only pass them if we are using asChild\n if (asChild) {\n return (\n <TabTriggerSlot\n style={styles.tabTrigger}\n {...props}\n {...triggerProps}\n href={trigger?.resolvedHref}>\n {props.children}\n </TabTriggerSlot>\n );\n } else {\n // These props are not typed, but are allowed by React Native Web\n const reactNativeWebProps = { href: trigger?.resolvedHref };\n\n return (\n <Pressable style={styles.tabTrigger} {...reactNativeWebProps} {...props} {...triggerProps}>\n {props.children}\n </Pressable>\n );\n }\n}\n\n/**\n * @hidden\n */\nexport function isTabTrigger(\n child: ReactElement<any>\n): child is ReactElement<ComponentProps<typeof TabTrigger>> {\n return child.type === TabTrigger;\n}\n\n/**\n * Options for `switchTab` function.\n */\nexport type SwitchToOptions = {\n /**\n * Navigate and reset the history on route focus.\n */\n resetOnFocus?: boolean;\n};\n\nexport type Trigger = TriggerMap[string] & {\n isFocused: boolean;\n resolvedHref: string;\n route: TabNavigationState<any>['routes'][number];\n};\n\nexport type UseTabTriggerResult = {\n switchTab: (name: string, options: SwitchToOptions) => void;\n getTrigger: (name: string) => Trigger | undefined;\n trigger?: Trigger;\n triggerProps: TriggerProps;\n};\n\nexport type TriggerProps = {\n isFocused: boolean;\n onPress: PressableProps['onPress'];\n onLongPress: PressableProps['onLongPress'];\n};\n\n/**\n * Utility hook creating custom `TabTrigger`.\n */\nexport function useTabTrigger(options: TabTriggerProps): UseTabTriggerResult {\n const { state, navigation } = useNavigatorContext();\n const { name, resetOnFocus, onPress, onLongPress } = options;\n const triggerMap = use(TabTriggerMapContext);\n\n const getTrigger = useCallback(\n (name: string) => {\n const config = triggerMap[name];\n\n if (!config) {\n return;\n }\n\n return {\n isFocused: state.index === config.index,\n route: state.routes[config.index],\n resolvedHref: stripGroupSegmentsFromPath(appendBaseUrl(config.href)),\n ...config,\n };\n },\n [triggerMap]\n );\n\n const trigger = name !== undefined ? getTrigger(name) : undefined;\n\n const switchTab = useCallback(\n (name: string, options?: SwitchToOptions) => {\n const config = triggerMap[name];\n\n if (config) {\n if (config.type === 'external') {\n return router.navigate(config.href);\n } else {\n return navigation?.dispatch({\n ...config.action,\n type: 'JUMP_TO',\n payload: {\n ...config.action.payload,\n ...options,\n },\n });\n }\n } else {\n return navigation?.dispatch({\n type: 'JUMP_TO',\n payload: {\n name,\n },\n });\n }\n },\n [navigation, triggerMap]\n );\n\n const handleOnPress = useCallback<NonNullable<PressableProps['onPress']>>(\n (event) => {\n onPress?.(event);\n if (!trigger) return;\n if (event?.isDefaultPrevented()) return;\n\n navigation?.emit({\n type: 'tabPress',\n target: trigger.type === 'internal' ? trigger.route.key : trigger?.href,\n canPreventDefault: true,\n });\n\n if (!shouldHandleMouseEvent(event)) return;\n\n if (!trigger.isFocused) {\n switchTab(name, { resetOnFocus });\n }\n },\n [onPress, name, resetOnFocus, trigger]\n );\n\n const handleOnLongPress = useCallback<NonNullable<PressableProps['onLongPress']>>(\n (event) => {\n onLongPress?.(event);\n if (!trigger) return;\n if (event?.isDefaultPrevented()) return;\n\n navigation?.emit({\n type: 'tabLongPress',\n target: trigger.type === 'internal' ? trigger.route.key : trigger?.href,\n });\n\n if (!shouldHandleMouseEvent(event)) return;\n\n if (!trigger.isFocused) {\n switchTab(name, {\n resetOnFocus,\n });\n }\n },\n [onLongPress, name, resetOnFocus, trigger]\n );\n\n const triggerProps = {\n isFocused: Boolean(trigger?.isFocused),\n onPress: handleOnPress,\n onLongPress: handleOnLongPress,\n };\n\n return {\n switchTab,\n getTrigger,\n trigger,\n triggerProps,\n };\n}\n\nconst styles = StyleSheet.create({\n tabTrigger: {\n flexDirection: 'row',\n justifyContent: 'space-between',\n },\n});\n"]}
|
package/expo-module.config.json
CHANGED
|
@@ -38,15 +38,6 @@ class RouterToolbarHostView: RouterViewWithLogger, LinkPreviewMenuUpdatable {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
func updateToolbarItem(withId id: String) {
|
|
42
|
-
if let controller = self.findViewController() {
|
|
43
|
-
let index = toolbarItemsArray.firstIndex(of: id)
|
|
44
|
-
if let index = index, let item = toolbarItemsMap[id] {
|
|
45
|
-
controller.toolbarItems?[index] = item.barButtonItem
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
41
|
func updateToolbarItems() {
|
|
51
42
|
// If update already scheduled, skip - the pending async block will handle it
|
|
52
43
|
if hasPendingToolbarUpdate {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"component": {
|
|
4
4
|
"group": "expo.modules.router",
|
|
5
5
|
"module": "expo.modules.router",
|
|
6
|
-
"version": "7.0.0-canary-
|
|
6
|
+
"version": "7.0.0-canary-20260121-a63c0dd",
|
|
7
7
|
"attributes": {
|
|
8
8
|
"org.gradle.status": "release"
|
|
9
9
|
}
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
},
|
|
25
25
|
"files": [
|
|
26
26
|
{
|
|
27
|
-
"name": "expo.modules.router-7.0.0-canary-
|
|
28
|
-
"url": "expo.modules.router-7.0.0-canary-
|
|
27
|
+
"name": "expo.modules.router-7.0.0-canary-20260121-a63c0dd.aar",
|
|
28
|
+
"url": "expo.modules.router-7.0.0-canary-20260121-a63c0dd.aar",
|
|
29
29
|
"size": 13665,
|
|
30
30
|
"sha512": "0c996832cda246cbf02acf875f7c3add8610a0e5e7c466bbe5fa2f073a6a644933eec90d1bff2a7fac7fd3c0c5bdae8a695373cebdec4f9853ce116658960554",
|
|
31
31
|
"sha256": "054876f9b960d2ed5b7762c66b32c7e994f942c05013456f5e41e1fe6c71ee54",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
],
|
|
61
61
|
"files": [
|
|
62
62
|
{
|
|
63
|
-
"name": "expo.modules.router-7.0.0-canary-
|
|
64
|
-
"url": "expo.modules.router-7.0.0-canary-
|
|
63
|
+
"name": "expo.modules.router-7.0.0-canary-20260121-a63c0dd.aar",
|
|
64
|
+
"url": "expo.modules.router-7.0.0-canary-20260121-a63c0dd.aar",
|
|
65
65
|
"size": 13665,
|
|
66
66
|
"sha512": "0c996832cda246cbf02acf875f7c3add8610a0e5e7c466bbe5fa2f073a6a644933eec90d1bff2a7fac7fd3c0c5bdae8a695373cebdec4f9853ce116658960554",
|
|
67
67
|
"sha256": "054876f9b960d2ed5b7762c66b32c7e994f942c05013456f5e41e1fe6c71ee54",
|
|
@@ -80,8 +80,8 @@
|
|
|
80
80
|
},
|
|
81
81
|
"files": [
|
|
82
82
|
{
|
|
83
|
-
"name": "expo.modules.router-7.0.0-canary-
|
|
84
|
-
"url": "expo.modules.router-7.0.0-canary-
|
|
83
|
+
"name": "expo.modules.router-7.0.0-canary-20260121-a63c0dd-sources.jar",
|
|
84
|
+
"url": "expo.modules.router-7.0.0-canary-20260121-a63c0dd-sources.jar",
|
|
85
85
|
"size": 2318,
|
|
86
86
|
"sha512": "9864add8e93e3c0a9a9c930aaed67016b15054c3fafd59a0bd3a5402d7cdc5827be84c22c2c137f3e5acb4e39270d9bfb9ca3fe11234458d4f2e0d4c78747f48",
|
|
87
87
|
"sha256": "d5dff6259e86de721fc0f07fe740a5e18088e19b76738719b0a6f94caef06224",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fdc4f8bb4fa3dea686f0198ad3069a31
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
c629ce645b8bb23c5c0d8603df005c7c78e42b22
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
25b1369cb51c612b0d071234dd5e6b29e80a65056bc0dbc86d0baa686ec86d3d
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
946347bdb853b44b18ed1ecd45f1f92ba89bf9552ef9b25995529a503a6d564935cb11e61c9c55eac47e901f2a5be73dda65e8ba4e42fb7ad1ed29de7d08755e
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<modelVersion>4.0.0</modelVersion>
|
|
10
10
|
<groupId>expo.modules.router</groupId>
|
|
11
11
|
<artifactId>expo.modules.router</artifactId>
|
|
12
|
-
<version>7.0.0-canary-
|
|
12
|
+
<version>7.0.0-canary-20260121-a63c0dd</version>
|
|
13
13
|
<packaging>aar</packaging>
|
|
14
14
|
<name>expo.modules.router</name>
|
|
15
15
|
<url>https://github.com/expo/expo</url>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ac0cae2ee999829d5cbddc8726daeb0e
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4ed2d842a8d222c2ace5b22d884c3c317a664bf3
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2152b95737630dd4a4559a40af8ff886a52acb2d3b258f53ad3d25abcd26cffa
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
61d6848b75ac46466a4ddad317c549d8c74a7e40bcc6e7d10c7ab80ebb437196cb4e3a9377e4d493aaea07c4baa23534b06c50f703ac204dbd2bd8314ca6ba99
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
<groupId>expo.modules.router</groupId>
|
|
4
4
|
<artifactId>expo.modules.router</artifactId>
|
|
5
5
|
<versioning>
|
|
6
|
-
<latest>7.0.0-canary-
|
|
7
|
-
<release>7.0.0-canary-
|
|
6
|
+
<latest>7.0.0-canary-20260121-a63c0dd</latest>
|
|
7
|
+
<release>7.0.0-canary-20260121-a63c0dd</release>
|
|
8
8
|
<versions>
|
|
9
|
-
<version>7.0.0-canary-
|
|
9
|
+
<version>7.0.0-canary-20260121-a63c0dd</version>
|
|
10
10
|
</versions>
|
|
11
|
-
<lastUpdated>
|
|
11
|
+
<lastUpdated>20260121081958</lastUpdated>
|
|
12
12
|
</versioning>
|
|
13
13
|
</metadata>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
e98e4ff0479fd3ecbc5ed45ca72768b7
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
544d2b277ce9116adc754518b68a535e92ee0217
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
90d0c8cc8acb48ed2165dc63ce916a2202f3c0ef782899aaf57123b6a8b4c38f
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
72abb0fe63239d6d838cc238fabe2acf791dab5a1a6058d5f4ee3c07115ee814cbd28dce44317bcdb0778293a9a228cc3b96003458dc75357cda9aeaa581a46a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "expo-router",
|
|
3
|
-
"version": "7.0.0-canary-
|
|
3
|
+
"version": "7.0.0-canary-20260121-a63c0dd",
|
|
4
4
|
"description": "Expo Router is a file-based router for React Native and web applications.",
|
|
5
5
|
"author": "650 Industries, Inc.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -81,13 +81,13 @@
|
|
|
81
81
|
"expo"
|
|
82
82
|
],
|
|
83
83
|
"peerDependencies": {
|
|
84
|
-
"@expo/metro-runtime": "6.2.0-canary-
|
|
85
|
-
"@expo/log-box": "0.0.13-canary-
|
|
84
|
+
"@expo/metro-runtime": "6.2.0-canary-20260121-a63c0dd",
|
|
85
|
+
"@expo/log-box": "0.0.13-canary-20260121-a63c0dd",
|
|
86
86
|
"@react-navigation/drawer": "^7.7.2",
|
|
87
87
|
"@testing-library/react-native": ">= 12.0.0",
|
|
88
|
-
"expo": "55.0.0-canary-
|
|
89
|
-
"expo-constants": "18.1.0-canary-
|
|
90
|
-
"expo-linking": "8.0.12-canary-
|
|
88
|
+
"expo": "55.0.0-canary-20260121-a63c0dd",
|
|
89
|
+
"expo-constants": "18.1.0-canary-20260121-a63c0dd",
|
|
90
|
+
"expo-linking": "8.0.12-canary-20260121-a63c0dd",
|
|
91
91
|
"react": "*",
|
|
92
92
|
"react-dom": "*",
|
|
93
93
|
"react-native": "*",
|
|
@@ -132,8 +132,8 @@
|
|
|
132
132
|
"react-server-dom-webpack": "~19.0.3"
|
|
133
133
|
},
|
|
134
134
|
"dependencies": {
|
|
135
|
-
"@expo/metro-runtime": "6.2.0-canary-
|
|
136
|
-
"@expo/schema-utils": "0.1.9-canary-
|
|
135
|
+
"@expo/metro-runtime": "6.2.0-canary-20260121-a63c0dd",
|
|
136
|
+
"@expo/schema-utils": "0.1.9-canary-20260121-a63c0dd",
|
|
137
137
|
"@radix-ui/react-slot": "1.2.0",
|
|
138
138
|
"@radix-ui/react-tabs": "^1.1.12",
|
|
139
139
|
"@react-navigation/bottom-tabs": "^7.7.3",
|
|
@@ -142,9 +142,9 @@
|
|
|
142
142
|
"client-only": "^0.0.1",
|
|
143
143
|
"debug": "^4.3.4",
|
|
144
144
|
"escape-string-regexp": "^4.0.0",
|
|
145
|
-
"expo-image": "3.1.0-canary-
|
|
146
|
-
"expo-server": "1.1.0-canary-
|
|
147
|
-
"expo-symbols": "1.1.0-canary-
|
|
145
|
+
"expo-image": "3.1.0-canary-20260121-a63c0dd",
|
|
146
|
+
"expo-server": "1.1.0-canary-20260121-a63c0dd",
|
|
147
|
+
"expo-symbols": "1.1.0-canary-20260121-a63c0dd",
|
|
148
148
|
"fast-deep-equal": "^3.1.3",
|
|
149
149
|
"invariant": "^2.2.4",
|
|
150
150
|
"nanoid": "^3.3.8",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
11b8480e59748399d02040e2a028c7b7
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
e743dddc31f2dd22ba2c44a943ba287badc82b7a
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
dc2d047c1378071e59cdab45be1da38e4742cc191d323757ef99a7912d943e6c
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
a55d5da6929e191fac4d4e1f694ed277eea559c7ec184330404dca31ae0f5556491140098f4149400d813b0d1ce1dea9285c617c79784929d77e93736337b2b0
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
7bde9e9e6e8ccec77bcf9bd040310d85
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
b037c14311d0cf28f7323d1fb266f09c6d464510
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
97d335647fc14d009ef930db1f1501568ec68f41e460e0074ceb0c077360365b
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
db9186302bc8a06aaec1661211f7750b6db4b7bc6b99361a40b1e59688fbc05847b005859de4d51c55a4dc3c5f2ed00377286501fbf0ce60137372be356dce11
|
|
File without changes
|