expo-router 56.2.1 → 56.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +2 -2
- package/build/internal/routing.d.ts +1 -1
- package/build/internal/routing.d.ts.map +1 -1
- package/build/internal/routing.js +2 -1
- package/build/internal/routing.js.map +1 -1
- package/build/internal/rsc.d.ts +1 -1
- package/build/internal/rsc.d.ts.map +1 -1
- package/build/internal/rsc.js +2 -1
- package/build/internal/rsc.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/types.d.ts +3 -3
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/types.d.ts.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/types.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/types.d.ts +4 -4
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/types.d.ts.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/types.js.map +1 -1
- package/build/link/elements.d.ts +3 -3
- package/build/link/elements.d.ts.map +1 -1
- package/build/link/elements.js.map +1 -1
- package/build/link/href.d.ts.map +1 -1
- package/build/link/href.js +4 -1
- package/build/link/href.js.map +1 -1
- package/build/link/preview/native.d.ts +2 -2
- package/build/link/preview/native.d.ts.map +1 -1
- package/build/link/preview/native.js.map +1 -1
- package/build/native-tabs/utils/materialIconConverter-not-implemented.d.ts +3 -0
- package/build/native-tabs/utils/materialIconConverter-not-implemented.d.ts.map +1 -0
- package/build/native-tabs/utils/materialIconConverter-not-implemented.js +7 -0
- package/build/native-tabs/utils/materialIconConverter-not-implemented.js.map +1 -0
- package/build/navigationEvents/types.d.ts +1 -0
- package/build/navigationEvents/types.d.ts.map +1 -1
- package/build/navigationEvents/types.js.map +1 -1
- package/build/rsc/router/client.d.ts.map +1 -1
- package/build/rsc/router/client.js +11 -3
- package/build/rsc/router/client.js.map +1 -1
- package/build/rsc/router/common.d.ts +1 -1
- package/build/rsc/router/common.d.ts.map +1 -1
- package/build/rsc/router/common.js +4 -12
- package/build/rsc/router/common.js.map +1 -1
- package/build/rsc/router/host.d.ts.map +1 -1
- package/build/rsc/router/host.js +2 -3
- package/build/rsc/router/host.js.map +1 -1
- package/build/rsc/router/idMinting.d.ts +31 -0
- package/build/rsc/router/idMinting.d.ts.map +1 -0
- package/build/rsc/router/idMinting.js +32 -0
- package/build/rsc/router/idMinting.js.map +1 -0
- package/build/toolbar/native.types.d.ts +2 -2
- package/build/toolbar/native.types.d.ts.map +1 -1
- package/build/toolbar/native.types.js.map +1 -1
- package/build/ts-declarations/expo-router-internal-globals.d.ts +0 -1
- package/build/ts-declarations/expo-router-internal-globals.d.ts.map +1 -1
- package/build/ts-declarations/expo-router-internal-globals.js.map +1 -1
- package/build/useScreens.d.ts.map +1 -1
- package/build/useScreens.js +8 -3
- package/build/useScreens.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.1/expo.modules.router-56.2.1.module → 56.2.3/expo.modules.router-56.2.3.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.1/expo.modules.router-56.2.1.pom → 56.2.3/expo.modules.router-56.2.3.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.3/expo.modules.router-56.2.3.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 +14 -15
- package/plugin/tsconfig.tsbuildinfo +1 -1
- package/vendor/react-helmet-async/lib/index.esm.js +1 -1
- package/vendor/react-helmet-async/lib/index.js +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.1/expo.modules.router-56.2.1.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.1/expo.modules.router-56.2.1.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.1/expo.modules.router-56.2.1.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.1/expo.modules.router-56.2.1.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.1/expo.modules.router-56.2.1.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.1/expo.modules.router-56.2.1.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.1/expo.modules.router-56.2.1.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/56.2.1/expo.modules.router-56.2.1.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.1/expo.modules.router-56.2.1-sources.jar → 56.2.3/expo.modules.router-56.2.3-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.1/expo.modules.router-56.2.1-sources.jar.md5 → 56.2.3/expo.modules.router-56.2.3-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.1/expo.modules.router-56.2.1-sources.jar.sha1 → 56.2.3/expo.modules.router-56.2.3-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.1/expo.modules.router-56.2.1-sources.jar.sha256 → 56.2.3/expo.modules.router-56.2.3-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.1/expo.modules.router-56.2.1-sources.jar.sha512 → 56.2.3/expo.modules.router-56.2.3-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.1/expo.modules.router-56.2.1.aar → 56.2.3/expo.modules.router-56.2.3.aar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.1/expo.modules.router-56.2.1.aar.md5 → 56.2.3/expo.modules.router-56.2.3.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.1/expo.modules.router-56.2.1.aar.sha1 → 56.2.3/expo.modules.router-56.2.3.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.1/expo.modules.router-56.2.1.aar.sha256 → 56.2.3/expo.modules.router-56.2.3.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{56.2.1/expo.modules.router-56.2.1.aar.sha512 → 56.2.3/expo.modules.router-56.2.3.aar.sha512} +0 -0
package/android/build.gradle
CHANGED
|
@@ -4,13 +4,13 @@ plugins {
|
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
group = 'expo.modules.router'
|
|
7
|
-
version = '56.2.
|
|
7
|
+
version = '56.2.3'
|
|
8
8
|
|
|
9
9
|
android {
|
|
10
10
|
namespace "expo.modules.router"
|
|
11
11
|
defaultConfig {
|
|
12
12
|
versionCode 1
|
|
13
|
-
versionName "56.2.
|
|
13
|
+
versionName "56.2.3"
|
|
14
14
|
}
|
|
15
15
|
lintOptions {
|
|
16
16
|
abortOnError false
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { getReactNavigationConfig } from '../getReactNavigationConfig';
|
|
2
2
|
export { getRoutes, getExactRoutes, type Options as GetRoutesOptions } from '../getRoutes';
|
|
3
3
|
export { extrapolateGroups, generateDynamic, getRoutes as getRoutesCore, type Options as GetRoutesCoreOptions, type RewriteConfig, } from '../getRoutesCore';
|
|
4
|
-
export { getContextKey, isTypedRoute, matchGroupName, removeSupportedExtensions, stripGroupSegmentsFromPath, } from '../matchers';
|
|
4
|
+
export { getContextKey, isTypedRoute, matchDynamicName, matchGroupName, removeSupportedExtensions, stripGroupSegmentsFromPath, } from '../matchers';
|
|
5
5
|
export type { DynamicConvention, RouteNode } from '../Route';
|
|
6
6
|
export { sortRoutes } from '../sortRoutes';
|
|
7
7
|
//# sourceMappingURL=routing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/internal/routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,OAAO,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,SAAS,IAAI,aAAa,EAC1B,KAAK,OAAO,IAAI,oBAAoB,EACpC,KAAK,aAAa,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,cAAc,EACd,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../src/internal/routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,OAAO,IAAI,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAC3F,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,SAAS,IAAI,aAAa,EAC1B,KAAK,OAAO,IAAI,oBAAoB,EACpC,KAAK,aAAa,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sortRoutes = exports.stripGroupSegmentsFromPath = exports.removeSupportedExtensions = exports.matchGroupName = exports.isTypedRoute = exports.getContextKey = exports.getRoutesCore = exports.generateDynamic = exports.extrapolateGroups = exports.getExactRoutes = exports.getRoutes = exports.getReactNavigationConfig = void 0;
|
|
3
|
+
exports.sortRoutes = exports.stripGroupSegmentsFromPath = exports.removeSupportedExtensions = exports.matchGroupName = exports.matchDynamicName = exports.isTypedRoute = exports.getContextKey = exports.getRoutesCore = exports.generateDynamic = exports.extrapolateGroups = exports.getExactRoutes = exports.getRoutes = exports.getReactNavigationConfig = void 0;
|
|
4
4
|
var getReactNavigationConfig_1 = require("../getReactNavigationConfig");
|
|
5
5
|
Object.defineProperty(exports, "getReactNavigationConfig", { enumerable: true, get: function () { return getReactNavigationConfig_1.getReactNavigationConfig; } });
|
|
6
6
|
var getRoutes_1 = require("../getRoutes");
|
|
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "getRoutesCore", { enumerable: true, get: functio
|
|
|
13
13
|
var matchers_1 = require("../matchers");
|
|
14
14
|
Object.defineProperty(exports, "getContextKey", { enumerable: true, get: function () { return matchers_1.getContextKey; } });
|
|
15
15
|
Object.defineProperty(exports, "isTypedRoute", { enumerable: true, get: function () { return matchers_1.isTypedRoute; } });
|
|
16
|
+
Object.defineProperty(exports, "matchDynamicName", { enumerable: true, get: function () { return matchers_1.matchDynamicName; } });
|
|
16
17
|
Object.defineProperty(exports, "matchGroupName", { enumerable: true, get: function () { return matchers_1.matchGroupName; } });
|
|
17
18
|
Object.defineProperty(exports, "removeSupportedExtensions", { enumerable: true, get: function () { return matchers_1.removeSupportedExtensions; } });
|
|
18
19
|
Object.defineProperty(exports, "stripGroupSegmentsFromPath", { enumerable: true, get: function () { return matchers_1.stripGroupSegmentsFromPath; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.js","sourceRoot":"","sources":["../../src/internal/routing.ts"],"names":[],"mappings":";;;AAAA,wEAAuE;AAA9D,oIAAA,wBAAwB,OAAA;AACjC,0CAA2F;AAAlF,sGAAA,SAAS,OAAA;AAAE,2GAAA,cAAc,OAAA;AAClC,kDAM0B;AALxB,kHAAA,iBAAiB,OAAA;AACjB,gHAAA,eAAe,OAAA;AACf,8GAAA,SAAS,OAAiB;AAI5B,
|
|
1
|
+
{"version":3,"file":"routing.js","sourceRoot":"","sources":["../../src/internal/routing.ts"],"names":[],"mappings":";;;AAAA,wEAAuE;AAA9D,oIAAA,wBAAwB,OAAA;AACjC,0CAA2F;AAAlF,sGAAA,SAAS,OAAA;AAAE,2GAAA,cAAc,OAAA;AAClC,kDAM0B;AALxB,kHAAA,iBAAiB,OAAA;AACjB,gHAAA,eAAe,OAAA;AACf,8GAAA,SAAS,OAAiB;AAI5B,wCAOqB;AANnB,yGAAA,aAAa,OAAA;AACb,wGAAA,YAAY,OAAA;AACZ,4GAAA,gBAAgB,OAAA;AAChB,0GAAA,cAAc,OAAA;AACd,qHAAA,yBAAyB,OAAA;AACzB,sHAAA,0BAA0B,OAAA;AAG5B,4CAA2C;AAAlC,wGAAA,UAAU,OAAA","sourcesContent":["export { getReactNavigationConfig } from '../getReactNavigationConfig';\nexport { getRoutes, getExactRoutes, type Options as GetRoutesOptions } from '../getRoutes';\nexport {\n extrapolateGroups,\n generateDynamic,\n getRoutes as getRoutesCore,\n type Options as GetRoutesCoreOptions,\n type RewriteConfig,\n} from '../getRoutesCore';\nexport {\n getContextKey,\n isTypedRoute,\n matchDynamicName,\n matchGroupName,\n removeSupportedExtensions,\n stripGroupSegmentsFromPath,\n} from '../matchers';\nexport type { DynamicConvention, RouteNode } from '../Route';\nexport { sortRoutes } from '../sortRoutes';\n"]}
|
package/build/internal/rsc.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { ServerRouter } from '../rsc/router/client';
|
|
2
|
-
export { getComponentIds, getInputString, parseInputString, PARAM_KEY_SKIP, SHOULD_SKIP_ID, LOCATION_ID, type RouteProps, type ShouldSkip, } from '../rsc/router/common';
|
|
2
|
+
export { getComponentIds, getInputString, parseInputString, mintComponentId, type ComponentIdKind, type ComponentIds, PARAM_KEY_SKIP, SHOULD_SKIP_ID, LOCATION_ID, type RouteProps, type ShouldSkip, } from '../rsc/router/common';
|
|
3
3
|
export { Children, Slot } from '../rsc/router/host';
|
|
4
4
|
export { decodeActionId } from '../rsc/router/utils';
|
|
5
5
|
//# sourceMappingURL=rsc.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc.d.ts","sourceRoot":"","sources":["../../src/internal/rsc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EACL,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,WAAW,EACX,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"rsc.d.ts","sourceRoot":"","sources":["../../src/internal/rsc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EACL,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,cAAc,EACd,cAAc,EACd,WAAW,EACX,KAAK,UAAU,EACf,KAAK,UAAU,GAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC"}
|
package/build/internal/rsc.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.decodeActionId = exports.Slot = exports.Children = exports.LOCATION_ID = exports.SHOULD_SKIP_ID = exports.PARAM_KEY_SKIP = exports.parseInputString = exports.getInputString = exports.getComponentIds = exports.ServerRouter = void 0;
|
|
3
|
+
exports.decodeActionId = exports.Slot = exports.Children = exports.LOCATION_ID = exports.SHOULD_SKIP_ID = exports.PARAM_KEY_SKIP = exports.mintComponentId = exports.parseInputString = exports.getInputString = exports.getComponentIds = exports.ServerRouter = void 0;
|
|
4
4
|
var client_1 = require("../rsc/router/client");
|
|
5
5
|
Object.defineProperty(exports, "ServerRouter", { enumerable: true, get: function () { return client_1.ServerRouter; } });
|
|
6
6
|
var common_1 = require("../rsc/router/common");
|
|
7
7
|
Object.defineProperty(exports, "getComponentIds", { enumerable: true, get: function () { return common_1.getComponentIds; } });
|
|
8
8
|
Object.defineProperty(exports, "getInputString", { enumerable: true, get: function () { return common_1.getInputString; } });
|
|
9
9
|
Object.defineProperty(exports, "parseInputString", { enumerable: true, get: function () { return common_1.parseInputString; } });
|
|
10
|
+
Object.defineProperty(exports, "mintComponentId", { enumerable: true, get: function () { return common_1.mintComponentId; } });
|
|
10
11
|
Object.defineProperty(exports, "PARAM_KEY_SKIP", { enumerable: true, get: function () { return common_1.PARAM_KEY_SKIP; } });
|
|
11
12
|
Object.defineProperty(exports, "SHOULD_SKIP_ID", { enumerable: true, get: function () { return common_1.SHOULD_SKIP_ID; } });
|
|
12
13
|
Object.defineProperty(exports, "LOCATION_ID", { enumerable: true, get: function () { return common_1.LOCATION_ID; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rsc.js","sourceRoot":"","sources":["../../src/internal/rsc.ts"],"names":[],"mappings":";;;AAAA,+CAAoD;AAA3C,sGAAA,YAAY,OAAA;AACrB,+
|
|
1
|
+
{"version":3,"file":"rsc.js","sourceRoot":"","sources":["../../src/internal/rsc.ts"],"names":[],"mappings":";;;AAAA,+CAAoD;AAA3C,sGAAA,YAAY,OAAA;AACrB,+CAY8B;AAX5B,yGAAA,eAAe,OAAA;AACf,wGAAA,cAAc,OAAA;AACd,0GAAA,gBAAgB,OAAA;AAChB,yGAAA,eAAe,OAAA;AAGf,wGAAA,cAAc,OAAA;AACd,wGAAA,cAAc,OAAA;AACd,qGAAA,WAAW,OAAA;AAIb,2CAAoD;AAA3C,gGAAA,QAAQ,OAAA;AAAE,4FAAA,IAAI,OAAA;AACvB,6CAAqD;AAA5C,uGAAA,cAAc,OAAA","sourcesContent":["export { ServerRouter } from '../rsc/router/client';\nexport {\n getComponentIds,\n getInputString,\n parseInputString,\n mintComponentId,\n type ComponentIdKind,\n type ComponentIds,\n PARAM_KEY_SKIP,\n SHOULD_SKIP_ID,\n LOCATION_ID,\n type RouteProps,\n type ShouldSkip,\n} from '../rsc/router/common';\nexport { Children, Slot } from '../rsc/router/host';\nexport { decodeActionId } from '../rsc/router/utils';\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SharedRef } from 'expo';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import type { ColorValue, ImageSourcePropType, StyleProp, TextStyle } from 'react-native';
|
|
4
4
|
import type { SFSymbol } from 'sf-symbols-typescript';
|
|
@@ -100,7 +100,7 @@ export interface StackToolbarButtonProps {
|
|
|
100
100
|
*
|
|
101
101
|
* @platform ios
|
|
102
102
|
*/
|
|
103
|
-
image?:
|
|
103
|
+
image?: SharedRef<'image'>;
|
|
104
104
|
/**
|
|
105
105
|
* Controls how image-based icons are rendered.
|
|
106
106
|
*
|
|
@@ -168,7 +168,7 @@ export interface NativeToolbarButtonProps {
|
|
|
168
168
|
hidesSharedBackground?: boolean;
|
|
169
169
|
icon?: SFSymbol;
|
|
170
170
|
xcassetName?: string;
|
|
171
|
-
image?:
|
|
171
|
+
image?: SharedRef<'image'>;
|
|
172
172
|
imageRenderingMode?: 'template' | 'original';
|
|
173
173
|
onPress?: () => void;
|
|
174
174
|
possibleTitles?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,mBAAmB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC1F,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,K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AAqB,CAAC,EAAE,OAAO,CAAC;IAChC,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B,kBAAkB,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,WAAW,CAAC;IACzC,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/types.ts"],"names":[],"mappings":"","sourcesContent":["import type {
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SharedRef } from 'expo';\nimport type { ReactNode } from 'react';\nimport type { ColorValue, ImageSourcePropType, StyleProp, TextStyle } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport type { BasicTextStyle } from '../../../../utils/font';\nimport type { StackHeaderItemSharedProps } from '../shared';\n\nexport interface StackToolbarButtonProps {\n /**\n * Accessibility label spoken by screen readers (TalkBack/VoiceOver).\n *\n * @see [Android — Compose accessibility for graphic elements](https://developer.android.com/develop/ui/compose/accessibility/api-defaults#graphic-elements) and [Apple — Supporting VoiceOver in your app](https://developer.apple.com/documentation/uikit/supporting-voiceover-in-your-app#Update-your-apps-accessibility) for more information.\n *\n * @platform android\n * @platform ios\n */\n accessibilityLabel?: string;\n /**\n * @platform ios\n */\n accessibilityHint?: string;\n /**\n * There are two ways to specify the content of the button:\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Page() {\n * return (\n * <>\n * <Stack.Toolbar placement=\"left\">\n * <Stack.Toolbar.Button icon=\"star.fill\">As text passed as children</Stack.Toolbar.Button>\n * </Stack.Toolbar>\n * <ScreenContent />\n * </>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Page() {\n * return (\n * <>\n * <Stack.Toolbar placement=\"left\">\n * <Stack.Toolbar.Button>\n * <Stack.Toolbar.Icon sf=\"star.fill\" />\n * <Stack.Toolbar.Label>As components</Stack.Toolbar.Label>\n * <Stack.Toolbar.Badge>3</Stack.Toolbar.Badge>\n * </Stack.Toolbar.Button>\n * </Stack.Toolbar>\n * <ScreenContent />\n * </>\n * );\n * }\n * ```\n *\n * > **Note**: When icon is used, the label will not be shown and will be used for accessibility purposes only. Badge is only supported in left/right placements, not in bottom (iOS toolbar limitation).\n */\n children?: ReactNode;\n /**\n * @platform android\n * @platform ios\n */\n disabled?: boolean;\n /**\n * Whether the button should be hidden.\n *\n * @default false\n *\n * @platform android\n * @platform ios\n */\n hidden?: boolean;\n /**\n * Whether to hide the shared background.\n *\n * @platform iOS 26+\n */\n hidesSharedBackground?: boolean;\n /**\n * Icon to display in the button.\n *\n * On Android, only image source is supported.\n *\n * On iOS, it can be a string representing an SFSymbol, an image source or xcasset.\n *\n * > **Note**: When used in `placement=\"bottom\"` on iOS, only string SFSymbols are supported. Use the `image` prop to provide custom images.\n *\n * @platform android\n * @platform ios\n */\n icon?: StackHeaderItemSharedProps['icon'];\n // TODO(@ubax): Add useImage support in a follow-up PR.\n /**\n * Image to display in the button.\n *\n * > **Note**: This prop is only supported in toolbar with `placement=\"bottom\"`.\n *\n * @platform ios\n */\n image?: SharedRef<'image'>;\n /**\n * Controls how image-based icons are rendered.\n *\n * - `'template'`: applies tint color to the icon\n * - `'original'`: preserves original icon colors (useful for multi-color icons)\n *\n * **Default behavior on iOS:**\n * - If `tintColor` is specified, defaults to `'template'`\n * - If no `tintColor`, defaults to `'original'`\n *\n * **On Android:** defaults to `'template'`.\n *\n * This prop only affects image-based icons (not SF Symbols).\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiimage/renderingmode-swift.enum) for more information.\n *\n * @platform android\n * @platform ios\n */\n iconRenderingMode?: 'template' | 'original';\n onPress?: () => void;\n /**\n * Whether to separate the background of this item from other header items.\n *\n * @default false\n * @platform ios\n */\n separateBackground?: boolean;\n /**\n * Whether the button is in a selected state\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/isselected) for more information\n *\n * @platform ios\n */\n selected?: boolean;\n /**\n * Style for the label of the header item.\n *\n * @platform android\n * @platform ios\n */\n style?: StyleProp<TextStyle>;\n /**\n * The tint color to apply to the button item.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/tintcolor) for more information.\n * @see [Android documentation](https://developer.android.com/develop/ui/compose/graphics/images/customize#tint-image) for more information.\n *\n * @platform android\n * @platform ios\n */\n tintColor?: StackHeaderItemSharedProps['tintColor'];\n /**\n * @default 'plain'\n * @platform ios\n */\n variant?: StackHeaderItemSharedProps['variant'];\n}\n\nexport interface NativeToolbarButtonProps {\n accessibilityLabel?: string;\n accessibilityHint?: string;\n disabled?: boolean;\n hidden?: boolean;\n hidesSharedBackground?: boolean;\n icon?: SFSymbol;\n xcassetName?: string;\n image?: SharedRef<'image'>;\n imageRenderingMode?: 'template' | 'original';\n onPress?: () => void;\n possibleTitles?: string[];\n selected?: boolean;\n separateBackground?: boolean;\n style?: StyleProp<BasicTextStyle>;\n tintColor?: ColorValue;\n variant?: 'plain' | 'done' | 'prominent';\n label?: string;\n /* @platform android */\n source?: ImageSourcePropType;\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SharedRef } from 'expo';
|
|
2
2
|
import type { ReactNode } from 'react';
|
|
3
3
|
import type { ColorValue, ImageSourcePropType, StyleProp, TextStyle } from 'react-native';
|
|
4
4
|
import type { SFSymbol } from 'sf-symbols-typescript';
|
|
@@ -54,7 +54,7 @@ export interface StackToolbarMenuProps {
|
|
|
54
54
|
*
|
|
55
55
|
* @platform ios
|
|
56
56
|
*/
|
|
57
|
-
image?:
|
|
57
|
+
image?: SharedRef<'image'>;
|
|
58
58
|
/**
|
|
59
59
|
* Whether to hide the shared background.
|
|
60
60
|
*
|
|
@@ -192,7 +192,7 @@ export interface NativeToolbarMenuProps {
|
|
|
192
192
|
/**
|
|
193
193
|
* Image to display for the menu item.
|
|
194
194
|
*/
|
|
195
|
-
image?:
|
|
195
|
+
image?: SharedRef<'image'>;
|
|
196
196
|
imageRenderingMode?: 'template' | 'original';
|
|
197
197
|
inline?: boolean;
|
|
198
198
|
label?: string;
|
|
@@ -233,7 +233,7 @@ export interface StackToolbarMenuActionProps {
|
|
|
233
233
|
*
|
|
234
234
|
* @platform ios
|
|
235
235
|
*/
|
|
236
|
-
image?:
|
|
236
|
+
image?: SharedRef<'image'>;
|
|
237
237
|
/**
|
|
238
238
|
* Controls how image-based icons are rendered on iOS.
|
|
239
239
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarMenu/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarMenu/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC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A2B;IAC1C;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;;;;OAOG;IACH,IAAI,CAAC,EAAE,QAAQ,GAAG,mBAAmB,CAAC;IAEtC;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC3B;;;;;;;;;;;;;;;OAeG;IACH,iBAAiB,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC5C;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;;;;OAUG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;;;;OAKG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,4BAA6B,SAAQ,mBAAmB;IACvE,wBAAwB;IACxB,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAC9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarMenu/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ImageRef } from 'expo-image';\nimport type { ReactNode } from 'react';\nimport type { ColorValue, ImageSourcePropType, StyleProp, TextStyle } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport type { LinkMenuActionProps } from '../../../../link/elements';\nimport type { StackHeaderItemSharedProps } from '../shared';\n\nexport interface StackToolbarMenuProps {\n /**\n * Accessibility label spoken by screen readers (TalkBack/VoiceOver).\n *\n * @see [Android — Compose accessibility for graphic elements](https://developer.android.com/develop/ui/compose/accessibility/api-defaults#graphic-elements) and [Apple — Supporting VoiceOver in your app](https://developer.apple.com/documentation/uikit/supporting-voiceover-in-your-app#Update-your-apps-accessibility) for more information.\n *\n * @platform android\n * @platform ios\n */\n accessibilityLabel?: string;\n /**\n * @platform ios\n */\n accessibilityHint?: string;\n /**\n * Menu content - can include icons, labels, badges and menu actions.\n *\n * @example\n * ```tsx\n * <Stack.Toolbar.Menu>\n * <Stack.Toolbar.Icon sfSymbol=\"ellipsis.circle\" />\n * <Stack.Toolbar.Label>Options</Stack.Toolbar.Label>\n * <Stack.Toolbar.MenuAction onPress={() => {}}>Action 1</Stack.Toolbar.MenuAction>\n * </Stack.Toolbar.Menu>\n * ```\n *\n * @platform android\n * @platform ios\n */\n children?: ReactNode;\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/destructive) for more information.\n *\n * @platform ios\n */\n destructive?: boolean;\n /**\n * @platform android\n * @platform ios\n */\n disabled?: boolean;\n // TODO(@ubax): Add useImage support in a follow-up PR.\n /**\n * Image to display for the menu item.\n *\n * > **Note**: This prop is only supported in toolbar with `placement=\"bottom\"`.\n *\n * @platform ios\n */\n image?: ImageRef;\n /**\n * Whether to hide the shared background.\n *\n * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.\n *\n * @platform iOS 26+\n */\n hidesSharedBackground?: boolean;\n /**\n * Whether the menu should be hidden.\n *\n * @default false\n *\n * @platform android\n * @platform ios\n */\n hidden?: boolean;\n /**\n * Icon for the menu item.\n *\n * Can be an SF Symbol name or an image source.\n *\n * > **Note**: When used in `placement=\"bottom\"` on iOS, only string SFSymbols are supported. Use the `image` prop to provide custom images.\n *\n * > **Note (Android)**: Only `ImageSourcePropType` icons are rendered at the menu root.\n * > SF Symbols and `xcasset` names are silently dropped — provide a `require()` or\n * > `{ uri }` source.\n *\n * @platform android\n * @platform ios\n */\n icon?: StackHeaderItemSharedProps['icon'];\n /**\n * Controls how image-based icons are rendered.\n *\n * - `'template'`: applies tint color to the icon (useful for monochrome icons)\n * - `'original'`: preserves original icon colors (useful for multi-color icons)\n *\n * **Default behavior on iOS:**\n * - If `tintColor` is specified, defaults to `'template'`\n * - If no `tintColor`, defaults to `'original'`\n *\n * **On Android:** defaults to `'template'`.\n *\n * This prop only affects image-based icons (not SF Symbols).\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiimage/renderingmode-swift.enum) for more information.\n *\n * @platform android\n * @platform ios\n */\n iconRenderingMode?: 'template' | 'original';\n /**\n * If `true`, the menu will be displayed inline.\n * This means that the menu will not be collapsed.\n *\n * > **Note**: Inline menus are only supported in submenus.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline) for more information.\n *\n * @platform android\n * @platform ios\n */\n inline?: boolean;\n /**\n * If `true`, the menu will be displayed as a palette.\n * This means that the menu will be displayed as one row.\n *\n * > **Note**: Palette menus are only supported in submenus.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette) for more information.\n *\n * @platform ios\n */\n palette?: boolean;\n /**\n * Whether to separate the background of this item from other header items.\n *\n * @default false\n * @platform ios\n */\n separateBackground?: boolean;\n /**\n * Style for the label of the header item.\n *\n * @platform android\n * @platform ios\n */\n style?: StackHeaderItemSharedProps['style'];\n /**\n * The tint color to apply to the button item.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/tintcolor) for more information.\n * @see [Android documentation](https://developer.android.com/develop/ui/compose/graphics/images/customize#tint-image) for more information.\n *\n * @platform android\n * @platform ios\n */\n tintColor?: StackHeaderItemSharedProps['tintColor'];\n /**\n * Optional title to show on top of the menu.\n *\n * @platform android\n * @platform ios\n */\n title?: string;\n /**\n * @default 'plain'\n *\n * @platform ios\n */\n variant?: StackHeaderItemSharedProps['variant'];\n // TODO(@ubax): Add elementSize support in react-native-screens for header menus.\n /**\n * The preferred size of the menu elements.\n *\n * > **Note**: This prop is only supported in `Stack.Toolbar.Bottom`.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/preferredelementsize) for more information.\n *\n * @platform iOS 16.0+\n */\n elementSize?: 'auto' | 'small' | 'medium' | 'large';\n}\n\nexport interface NativeToolbarMenuProps {\n accessibilityLabel?: string;\n accessibilityHint?: string;\n children?: ReactNode;\n subtitle?: string;\n destructive?: boolean;\n disabled?: boolean;\n hidden?: boolean;\n hidesSharedBackground?: boolean;\n icon?: SFSymbol;\n xcassetName?: string;\n // TODO(@ubax): Add useImage support in a follow-up PR.\n /**\n * Image to display for the menu item.\n */\n image?: ImageRef;\n imageRenderingMode?: 'template' | 'original';\n inline?: boolean;\n label?: string;\n palette?: boolean;\n separateBackground?: boolean;\n style?: StyleProp<TextStyle>;\n title?: string;\n tintColor?: ColorValue;\n variant?: 'plain' | 'done' | 'prominent';\n elementSize?: 'auto' | 'small' | 'medium' | 'large';\n /** @platform android */\n source?: ImageSourcePropType;\n}\n\nexport interface StackToolbarMenuActionProps {\n /**\n * Can be an Icon, Label or string title.\n */\n children?: ReactNode;\n /**\n * If `true`, the menu item will be disabled and not selectable.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/disabled) for more information.\n */\n disabled?: boolean;\n /**\n * Icon for the menu action.\n *\n * Can be an SF Symbol name or an image source.\n *\n * > **Note (Android)**: Only `ImageSourcePropType` icons are rendered. SF Symbols are\n * > silently dropped. Provide a `require()` or `{ uri }` source.\n */\n icon?: SFSymbol | ImageSourcePropType;\n // TODO(@ubax): Add useImage support in a follow-up PR.\n /**\n * Image to display for the menu action.\n *\n * > **Note**: This prop is only supported in `Stack.Toolbar.Bottom`.\n *\n * @platform ios\n */\n image?: ImageRef;\n /**\n * Controls how image-based icons are rendered on iOS.\n *\n * - `'template'`: iOS applies tint color to the icon (useful for monochrome icons)\n * - `'original'`: Preserves original icon colors (useful for multi-color icons)\n *\n * **Default behavior:**\n * - If `tintColor` is specified, defaults to `'template'`\n * - If no `tintColor`, defaults to `'original'`\n *\n * This prop only affects image-based icons (not SF Symbols).\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiimage/renderingmode-swift.enum) for more information.\n *\n * @platform ios\n */\n iconRenderingMode?: 'template' | 'original';\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/destructive) for more information.\n *\n * @platform android\n * @platform ios\n */\n destructive?: boolean;\n /**\n * If `true`, the menu will be kept presented after the action is selected.\n *\n * This is marked as unstable, because when action is selected on iOS it will recreate\n * the menu, which will close all opened submenus and reset the scroll position.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/keepsmenupresented) for more information.\n *\n * @platform android\n * @platform ios\n */\n unstable_keepPresented?: boolean;\n /**\n * If `true`, the menu item will be displayed as selected.\n *\n * @platform android\n * @platform ios\n */\n isOn?: boolean;\n onPress?: () => void;\n /**\n * An elaborated title that explains the purpose of the action.\n *\n * @platform ios\n */\n discoverabilityLabel?: string;\n /**\n * An optional subtitle for the menu item.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/subtitle) for more information.\n *\n * @platform ios\n */\n subtitle?: string;\n hidden?: boolean;\n}\n\nexport interface NativeToolbarMenuActionProps extends LinkMenuActionProps {\n /** @platform android */\n source?: ImageSourcePropType;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarMenu/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { SharedRef } from 'expo';\nimport type { ReactNode } from 'react';\nimport type { ColorValue, ImageSourcePropType, StyleProp, TextStyle } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport type { LinkMenuActionProps } from '../../../../link/elements';\nimport type { StackHeaderItemSharedProps } from '../shared';\n\nexport interface StackToolbarMenuProps {\n /**\n * Accessibility label spoken by screen readers (TalkBack/VoiceOver).\n *\n * @see [Android — Compose accessibility for graphic elements](https://developer.android.com/develop/ui/compose/accessibility/api-defaults#graphic-elements) and [Apple — Supporting VoiceOver in your app](https://developer.apple.com/documentation/uikit/supporting-voiceover-in-your-app#Update-your-apps-accessibility) for more information.\n *\n * @platform android\n * @platform ios\n */\n accessibilityLabel?: string;\n /**\n * @platform ios\n */\n accessibilityHint?: string;\n /**\n * Menu content - can include icons, labels, badges and menu actions.\n *\n * @example\n * ```tsx\n * <Stack.Toolbar.Menu>\n * <Stack.Toolbar.Icon sfSymbol=\"ellipsis.circle\" />\n * <Stack.Toolbar.Label>Options</Stack.Toolbar.Label>\n * <Stack.Toolbar.MenuAction onPress={() => {}}>Action 1</Stack.Toolbar.MenuAction>\n * </Stack.Toolbar.Menu>\n * ```\n *\n * @platform android\n * @platform ios\n */\n children?: ReactNode;\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/destructive) for more information.\n *\n * @platform ios\n */\n destructive?: boolean;\n /**\n * @platform android\n * @platform ios\n */\n disabled?: boolean;\n // TODO(@ubax): Add useImage support in a follow-up PR.\n /**\n * Image to display for the menu item.\n *\n * > **Note**: This prop is only supported in toolbar with `placement=\"bottom\"`.\n *\n * @platform ios\n */\n image?: SharedRef<'image'>;\n /**\n * Whether to hide the shared background.\n *\n * @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.\n *\n * @platform iOS 26+\n */\n hidesSharedBackground?: boolean;\n /**\n * Whether the menu should be hidden.\n *\n * @default false\n *\n * @platform android\n * @platform ios\n */\n hidden?: boolean;\n /**\n * Icon for the menu item.\n *\n * Can be an SF Symbol name or an image source.\n *\n * > **Note**: When used in `placement=\"bottom\"` on iOS, only string SFSymbols are supported. Use the `image` prop to provide custom images.\n *\n * > **Note (Android)**: Only `ImageSourcePropType` icons are rendered at the menu root.\n * > SF Symbols and `xcasset` names are silently dropped — provide a `require()` or\n * > `{ uri }` source.\n *\n * @platform android\n * @platform ios\n */\n icon?: StackHeaderItemSharedProps['icon'];\n /**\n * Controls how image-based icons are rendered.\n *\n * - `'template'`: applies tint color to the icon (useful for monochrome icons)\n * - `'original'`: preserves original icon colors (useful for multi-color icons)\n *\n * **Default behavior on iOS:**\n * - If `tintColor` is specified, defaults to `'template'`\n * - If no `tintColor`, defaults to `'original'`\n *\n * **On Android:** defaults to `'template'`.\n *\n * This prop only affects image-based icons (not SF Symbols).\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiimage/renderingmode-swift.enum) for more information.\n *\n * @platform android\n * @platform ios\n */\n iconRenderingMode?: 'template' | 'original';\n /**\n * If `true`, the menu will be displayed inline.\n * This means that the menu will not be collapsed.\n *\n * > **Note**: Inline menus are only supported in submenus.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline) for more information.\n *\n * @platform android\n * @platform ios\n */\n inline?: boolean;\n /**\n * If `true`, the menu will be displayed as a palette.\n * This means that the menu will be displayed as one row.\n *\n * > **Note**: Palette menus are only supported in submenus.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette) for more information.\n *\n * @platform ios\n */\n palette?: boolean;\n /**\n * Whether to separate the background of this item from other header items.\n *\n * @default false\n * @platform ios\n */\n separateBackground?: boolean;\n /**\n * Style for the label of the header item.\n *\n * @platform android\n * @platform ios\n */\n style?: StackHeaderItemSharedProps['style'];\n /**\n * The tint color to apply to the button item.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/tintcolor) for more information.\n * @see [Android documentation](https://developer.android.com/develop/ui/compose/graphics/images/customize#tint-image) for more information.\n *\n * @platform android\n * @platform ios\n */\n tintColor?: StackHeaderItemSharedProps['tintColor'];\n /**\n * Optional title to show on top of the menu.\n *\n * @platform android\n * @platform ios\n */\n title?: string;\n /**\n * @default 'plain'\n *\n * @platform ios\n */\n variant?: StackHeaderItemSharedProps['variant'];\n // TODO(@ubax): Add elementSize support in react-native-screens for header menus.\n /**\n * The preferred size of the menu elements.\n *\n * > **Note**: This prop is only supported in `Stack.Toolbar.Bottom`.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/preferredelementsize) for more information.\n *\n * @platform iOS 16.0+\n */\n elementSize?: 'auto' | 'small' | 'medium' | 'large';\n}\n\nexport interface NativeToolbarMenuProps {\n accessibilityLabel?: string;\n accessibilityHint?: string;\n children?: ReactNode;\n subtitle?: string;\n destructive?: boolean;\n disabled?: boolean;\n hidden?: boolean;\n hidesSharedBackground?: boolean;\n icon?: SFSymbol;\n xcassetName?: string;\n // TODO(@ubax): Add useImage support in a follow-up PR.\n /**\n * Image to display for the menu item.\n */\n image?: SharedRef<'image'>;\n imageRenderingMode?: 'template' | 'original';\n inline?: boolean;\n label?: string;\n palette?: boolean;\n separateBackground?: boolean;\n style?: StyleProp<TextStyle>;\n title?: string;\n tintColor?: ColorValue;\n variant?: 'plain' | 'done' | 'prominent';\n elementSize?: 'auto' | 'small' | 'medium' | 'large';\n /** @platform android */\n source?: ImageSourcePropType;\n}\n\nexport interface StackToolbarMenuActionProps {\n /**\n * Can be an Icon, Label or string title.\n */\n children?: ReactNode;\n /**\n * If `true`, the menu item will be disabled and not selectable.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/disabled) for more information.\n */\n disabled?: boolean;\n /**\n * Icon for the menu action.\n *\n * Can be an SF Symbol name or an image source.\n *\n * > **Note (Android)**: Only `ImageSourcePropType` icons are rendered. SF Symbols are\n * > silently dropped. Provide a `require()` or `{ uri }` source.\n */\n icon?: SFSymbol | ImageSourcePropType;\n // TODO(@ubax): Add useImage support in a follow-up PR.\n /**\n * Image to display for the menu action.\n *\n * > **Note**: This prop is only supported in `Stack.Toolbar.Bottom`.\n *\n * @platform ios\n */\n image?: SharedRef<'image'>;\n /**\n * Controls how image-based icons are rendered on iOS.\n *\n * - `'template'`: iOS applies tint color to the icon (useful for monochrome icons)\n * - `'original'`: Preserves original icon colors (useful for multi-color icons)\n *\n * **Default behavior:**\n * - If `tintColor` is specified, defaults to `'template'`\n * - If no `tintColor`, defaults to `'original'`\n *\n * This prop only affects image-based icons (not SF Symbols).\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiimage/renderingmode-swift.enum) for more information.\n *\n * @platform ios\n */\n iconRenderingMode?: 'template' | 'original';\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/destructive) for more information.\n *\n * @platform android\n * @platform ios\n */\n destructive?: boolean;\n /**\n * If `true`, the menu will be kept presented after the action is selected.\n *\n * This is marked as unstable, because when action is selected on iOS it will recreate\n * the menu, which will close all opened submenus and reset the scroll position.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/keepsmenupresented) for more information.\n *\n * @platform android\n * @platform ios\n */\n unstable_keepPresented?: boolean;\n /**\n * If `true`, the menu item will be displayed as selected.\n *\n * @platform android\n * @platform ios\n */\n isOn?: boolean;\n onPress?: () => void;\n /**\n * An elaborated title that explains the purpose of the action.\n *\n * @platform ios\n */\n discoverabilityLabel?: string;\n /**\n * An optional subtitle for the menu item.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/subtitle) for more information.\n *\n * @platform ios\n */\n subtitle?: string;\n hidden?: boolean;\n}\n\nexport interface NativeToolbarMenuActionProps extends LinkMenuActionProps {\n /** @platform android */\n source?: ImageSourcePropType;\n}\n"]}
|
package/build/link/elements.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { SharedRef } from 'expo';
|
|
2
2
|
import React, { type PropsWithChildren, type ReactNode } from 'react';
|
|
3
3
|
import type { ViewStyle } from 'react-native';
|
|
4
4
|
import type { SFSymbol } from 'sf-symbols-typescript';
|
|
@@ -54,7 +54,7 @@ export interface LinkMenuActionProps {
|
|
|
54
54
|
* </Link.Menu>
|
|
55
55
|
* ```
|
|
56
56
|
*/
|
|
57
|
-
image?:
|
|
57
|
+
image?: SharedRef<'image'> | null;
|
|
58
58
|
/**
|
|
59
59
|
* Controls how image-based icons are rendered on iOS.
|
|
60
60
|
*
|
|
@@ -133,7 +133,7 @@ export interface LinkMenuProps {
|
|
|
133
133
|
* </Link.Menu>
|
|
134
134
|
* ```
|
|
135
135
|
*/
|
|
136
|
-
image?:
|
|
136
|
+
image?: SharedRef<'image'> | null;
|
|
137
137
|
/**
|
|
138
138
|
* If `true`, the menu will be displayed as a palette.
|
|
139
139
|
* This means that the menu will be displayed as one row.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/link/elements.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/link/elements.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACtC,OAAO,KAAK,EAAE,EAA8B,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAYtD,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB;;OAEG;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CAAC,IAAI,CAAC,IAAA,sBAAc,EAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChF,6EAA6E;QAC7E,qGAAqG;QACrG,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;YAC7D,MAAM,IAAI,KAAK,CACb,gHAAgH,CACjH,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC;IACxB,CAAC;IACD,MAAM,OAAO,GAAG,uBAAC,WAAI,OAAK,KAAK,GAAI,CAAC;IACpC,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,uBAAC,+BAAa,cAAE,OAAO,GAAiB,CAAC;IAClD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["'use client';\n\nimport type { ImageRef } from 'expo-image';\nimport React, { isValidElement, use, useId, type PropsWithChildren, type ReactNode } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { InternalLinkPreviewContext } from './InternalLinkPreviewContext';\nimport { NativeMenuContext } from './NativeMenuContext';\nimport { Icon, Label } from '../primitives';\nimport { HrefPreview } from './preview/HrefPreview';\nimport { useIsPreview } from './preview/PreviewRouteContext';\nimport { NativeLinkPreviewAction, NativeLinkPreviewContent } from './preview/native';\nimport { Slot } from '../ui/Slot';\nimport { LinkAppleZoom } from './zoom/link-apple-zoom';\nimport { getFirstChildOfType } from '../utils/children';\n\nexport interface LinkMenuActionProps {\n /**\n * The title of the menu item.\n */\n children?: ReactNode;\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/destructive) for more information.\n */\n destructive?: boolean;\n /**\n * If `true`, the menu item will be disabled and not selectable.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/disabled) for more information.\n */\n disabled?: boolean;\n /**\n * An elaborated title that explains the purpose of the action.\n */\n discoverabilityLabel?: string;\n /**\n * Whether the menu element should be hidden.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/hidden) for more information.\n *\n * @default false\n */\n hidden?: boolean;\n // TODO: support ImageSourcePropType icons in addition to SFSymbols\n /**\n * SF Symbol displayed alongside the menu item.\n */\n icon?: SFSymbol;\n /**\n * Custom image loaded using `useImage()` hook from `expo-image`.\n * Takes priority over `icon` (SF Symbol) when both are provided.\n *\n * @example\n * ```tsx\n * import { useImage } from 'expo-image';\n * import { Link } from 'expo-router';\n *\n * const customIcon = useImage('https://simpleicons.org/icons/expo.svg', {\n * maxWidth: 24,\n * maxHeight: 24,\n * });\n *\n * <Link.Menu title=\"Menu\">\n * <Link.MenuAction image={customIcon} title=\"Action\" onPress={() => {}} />\n * </Link.Menu>\n * ```\n */\n image?: ImageRef | null;\n /**\n * Controls how image-based icons are rendered on iOS.\n *\n * - `'template'`: iOS applies tint color to the icon\n * - `'original'`: Preserves original icon colors\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiimage/renderingmode-swift.enum) for more information.\n *\n * @platform ios\n */\n imageRenderingMode?: 'template' | 'original';\n /**\n * If `true`, the menu item will be displayed as selected.\n */\n isOn?: boolean;\n onPress?: () => void;\n /**\n * An optional subtitle for the menu item.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/subtitle) for more information.\n */\n subtitle?: string;\n /**\n * The title of the menu item.\n * @deprecated Use `children` prop instead.\n */\n title?: string;\n /**\n * If `true`, the menu will be kept presented after the action is selected.\n *\n * This is marked as unstable, because when action is selected it will recreate the menu,\n * which will close all opened submenus and reset the scroll position.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/keepsmenupresented) for more information.\n */\n unstable_keepPresented?: boolean;\n}\n\n/**\n * This component renders a context menu action for a link.\n * It should only be used as a child of `Link.Menu` or `LinkMenu`.\n *\n * @platform ios\n */\nexport function LinkMenuAction(props: LinkMenuActionProps) {\n const identifier = useId();\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !use(NativeMenuContext)) {\n return null;\n }\n const { unstable_keepPresented, onPress, children, title, ...rest } = props;\n const areChildrenString = typeof children === 'string';\n const label = areChildrenString\n ? (children as string)\n : getFirstChildOfType(children, Label)?.props.children;\n const iconComponent =\n !props.icon && !areChildrenString ? getFirstChildOfType(children, Icon) : undefined;\n const icon =\n props.icon ??\n (iconComponent?.props && 'sf' in iconComponent.props ? iconComponent.props.sf : undefined);\n const sf = typeof icon === 'string' ? icon : undefined;\n const rawXcasset =\n iconComponent?.props && 'xcasset' in iconComponent.props\n ? iconComponent.props.xcasset\n : undefined;\n const xcassetName = typeof rawXcasset === 'string' ? rawXcasset : undefined;\n return (\n <NativeLinkPreviewAction\n {...rest}\n identifier={identifier}\n icon={sf}\n xcassetName={xcassetName}\n title={label ?? title ?? ''}\n keepPresented={unstable_keepPresented}\n onSelected={() => onPress?.()}\n />\n );\n}\n\nexport interface LinkMenuProps {\n /**\n * The title of the menu item\n */\n title?: string;\n /**\n * An optional subtitle for the submenu. Does not appear on `inline` menus.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/subtitle) for more information.\n */\n subtitle?: string;\n /**\n * Optional SF Symbol displayed alongside the menu item.\n */\n icon?: SFSymbol;\n /**\n * Custom image loaded using `useImage()` hook from `expo-image`.\n * Takes priority over `icon` (SF Symbol) when both are provided.\n *\n * @example\n * ```tsx\n * import { useImage } from 'expo-image';\n * import { Link } from 'expo-router';\n *\n * const customIcon = useImage('https://simpleicons.org/icons/expo.svg', {\n * maxWidth: 24,\n * maxHeight: 24,\n * });\n *\n * <Link.Menu image={customIcon} title=\"Menu\">\n * <Link.MenuAction title=\"Action\" onPress={() => {}} />\n * </Link.Menu>\n * ```\n */\n image?: ImageRef | null;\n /**\n * If `true`, the menu will be displayed as a palette.\n * This means that the menu will be displayed as one row.\n * The `elementSize` property is ignored when palette is used, all items will be `elementSize=\"small\"`. Use `elementSize=\"medium\"` instead of `palette` to display actions with titles horizontally.\n *\n * > **Note**: Palette menus are only supported in submenus.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette) for more information.\n */\n palette?: boolean;\n /**\n * @deprecated Use `palette` prop instead.\n */\n displayAsPalette?: boolean;\n /**\n * If `true`, the menu will be displayed inline.\n * This means that the menu will not be collapsed\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline) for more information.\n */\n inline?: boolean;\n /**\n * @deprecated Use `inline` prop instead.\n */\n displayInline?: boolean;\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/destructive) for more information.\n */\n destructive?: boolean;\n /**\n * The preferred size of the menu elements.\n * `elementSize` property is ignored when `palette` is used.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/preferredelementsize) for more information.\n *\n * @platform iOS 16.0+\n */\n elementSize?: 'small' | 'medium' | 'large' | 'auto';\n children?: React.ReactNode;\n}\n\n/**\n * Groups context menu actions for a link.\n *\n * If multiple `Link.Menu` components are used within a single `Link`, only the first will be rendered.\n * Only `Link.MenuAction` and `Link.Menu` components are allowed as children.\n *\n * @example\n * ```tsx\n * <Link.Menu>\n * <Link.MenuAction title=\"Action 1\" onPress={() => {}} />\n * <Link.MenuAction title=\"Action 2\" onPress={() => {}} />\n * </Link.Menu>\n * ```\n *\n * @platform ios\n */\nexport const LinkMenu = (props: LinkMenuProps) => {\n const identifier = useId();\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !use(NativeMenuContext)) {\n return null;\n }\n const children = React.Children.toArray(props.children).filter(\n (child) => isValidElement(child) && (child.type === LinkMenuAction || child.type === LinkMenu)\n );\n const displayAsPalette = props.palette ?? props.displayAsPalette;\n const displayInline = props.inline ?? props.displayInline;\n return (\n <NativeLinkPreviewAction\n {...props}\n displayAsPalette={displayAsPalette}\n displayInline={displayInline}\n preferredElementSize={props.elementSize}\n title={props.title ?? ''}\n onSelected={() => {}}\n children={children}\n identifier={identifier}\n />\n );\n};\n\nexport type LinkPreviewStyle = Omit<ViewStyle, 'position' | 'width' | 'height'> & {\n /**\n * Sets the preferred width of the preview.\n * If not set, full width of the screen will be used.\n *\n * This is only **preferred** width, the actual width may be different\n */\n width?: number;\n\n /**\n * Sets the preferred height of the preview.\n * If not set, full height of the screen will be used.\n *\n * This is only **preferred** height, the actual height may be different\n */\n height?: number;\n};\n\nexport interface LinkPreviewProps {\n children?: React.ReactNode;\n /**\n * Custom styles for the preview container.\n *\n * Note that some styles may not work, as they are limited or reset by the native view\n */\n style?: LinkPreviewStyle;\n}\n\n/**\n * A component used to render and customize the link preview.\n *\n * If `Link.Preview` is used without any props, it will render a preview of the `href` passed to the `Link`.\n *\n * If multiple `Link.Preview` components are used within a single `Link`, only the first one will be rendered.\n *\n * To customize the preview, you can pass custom content as children.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Preview>\n * <Text>Custom Preview Content</Text>\n * </Link.Preview>\n * </Link>\n * ```\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Preview />\n * </Link>\n * ```\n *\n * @platform ios\n */\nexport function LinkPreview(props: LinkPreviewProps) {\n const { children, style } = props;\n const internalPreviewContext = use(InternalLinkPreviewContext);\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !internalPreviewContext) {\n return null;\n }\n const { isVisible, href } = internalPreviewContext;\n const { width, height, ...restOfStyle } = style ?? {};\n const contentSize = {\n width: width ?? 0,\n height: height ?? 0,\n };\n let content: React.ReactNode;\n if (children) {\n content = isVisible ? children : null;\n } else {\n content = isVisible ? <HrefPreview href={href} /> : null;\n }\n\n return (\n <NativeLinkPreviewContent style={restOfStyle} preferredContentSize={contentSize}>\n {content}\n </NativeLinkPreviewContent>\n );\n}\n\nexport interface LinkTriggerProps extends PropsWithChildren {\n /**\n * A shorthand for enabling the Apple Zoom Transition on this link trigger.\n *\n * When set to `true`, the trigger will be wrapped with `Link.AppleZoom`.\n * If another `Link.AppleZoom` is already used inside `Link.Trigger`, an error\n * will be thrown.\n *\n * @platform ios 18+\n */\n withAppleZoom?: boolean;\n}\n\n/**\n * Serves as the trigger for a link.\n * The content inside this component will be rendered as part of the base link.\n *\n * If multiple `Link.Trigger` components are used within a single `Link`, only the first will be rendered.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Trigger>\n * Trigger\n * </Link.Trigger>\n * </Link>\n * ```\n *\n * @platform ios\n */\nexport function LinkTrigger({ withAppleZoom, ...props }: LinkTriggerProps) {\n if (React.Children.count(props.children) > 1 || !isValidElement(props.children)) {\n // If onPress is passed, this means that Link passed props to this component.\n // We can assume that asChild is used, so we throw an error, because link will not work in this case.\n if (props && typeof props === 'object' && 'onPress' in props) {\n throw new Error(\n 'When using Link.Trigger in an asChild Link, you must pass a single child element that will emit onPress event.'\n );\n }\n return props.children;\n }\n const content = <Slot {...props} />;\n if (withAppleZoom) {\n return <LinkAppleZoom>{content}</LinkAppleZoom>;\n }\n return content;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/link/elements.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmHb,wCAgCC;AA+KD,kCAwBC;AAgCD,kCAgBC;;AAvYD,+CAAkG;AAIlG,6EAA0E;AAC1E,2DAAwD;AACxD,8CAA4C;AAC5C,uDAAoD;AACpD,uEAA6D;AAC7D,6CAAqF;AACrF,qCAAkC;AAClC,4DAAuD;AACvD,gDAAwD;AA8FxD;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,KAA0B;IACvD,MAAM,UAAU,GAAG,IAAA,aAAK,GAAE,CAAC;IAC3B,IAAI,IAAA,kCAAY,GAAE,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,IAAI,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AAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChF,6EAA6E;QAC7E,qGAAqG;QACrG,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;YAC7D,MAAM,IAAI,KAAK,CACb,gHAAgH,CACjH,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC;IACxB,CAAC;IACD,MAAM,OAAO,GAAG,uBAAC,WAAI,OAAK,KAAK,GAAI,CAAC;IACpC,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,uBAAC,+BAAa,cAAE,OAAO,GAAiB,CAAC;IAClD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["'use client';\n\nimport type { SharedRef } from 'expo';\nimport React, { isValidElement, use, useId, type PropsWithChildren, type ReactNode } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { InternalLinkPreviewContext } from './InternalLinkPreviewContext';\nimport { NativeMenuContext } from './NativeMenuContext';\nimport { Icon, Label } from '../primitives';\nimport { HrefPreview } from './preview/HrefPreview';\nimport { useIsPreview } from './preview/PreviewRouteContext';\nimport { NativeLinkPreviewAction, NativeLinkPreviewContent } from './preview/native';\nimport { Slot } from '../ui/Slot';\nimport { LinkAppleZoom } from './zoom/link-apple-zoom';\nimport { getFirstChildOfType } from '../utils/children';\n\nexport interface LinkMenuActionProps {\n /**\n * The title of the menu item.\n */\n children?: ReactNode;\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/destructive) for more information.\n */\n destructive?: boolean;\n /**\n * If `true`, the menu item will be disabled and not selectable.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/disabled) for more information.\n */\n disabled?: boolean;\n /**\n * An elaborated title that explains the purpose of the action.\n */\n discoverabilityLabel?: string;\n /**\n * Whether the menu element should be hidden.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/hidden) for more information.\n *\n * @default false\n */\n hidden?: boolean;\n // TODO: support ImageSourcePropType icons in addition to SFSymbols\n /**\n * SF Symbol displayed alongside the menu item.\n */\n icon?: SFSymbol;\n /**\n * Custom image loaded using `useImage()` hook from `expo-image`.\n * Takes priority over `icon` (SF Symbol) when both are provided.\n *\n * @example\n * ```tsx\n * import { useImage } from 'expo-image';\n * import { Link } from 'expo-router';\n *\n * const customIcon = useImage('https://simpleicons.org/icons/expo.svg', {\n * maxWidth: 24,\n * maxHeight: 24,\n * });\n *\n * <Link.Menu title=\"Menu\">\n * <Link.MenuAction image={customIcon} title=\"Action\" onPress={() => {}} />\n * </Link.Menu>\n * ```\n */\n image?: SharedRef<'image'> | null;\n /**\n * Controls how image-based icons are rendered on iOS.\n *\n * - `'template'`: iOS applies tint color to the icon\n * - `'original'`: Preserves original icon colors\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uiimage/renderingmode-swift.enum) for more information.\n *\n * @platform ios\n */\n imageRenderingMode?: 'template' | 'original';\n /**\n * If `true`, the menu item will be displayed as selected.\n */\n isOn?: boolean;\n onPress?: () => void;\n /**\n * An optional subtitle for the menu item.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/subtitle) for more information.\n */\n subtitle?: string;\n /**\n * The title of the menu item.\n * @deprecated Use `children` prop instead.\n */\n title?: string;\n /**\n * If `true`, the menu will be kept presented after the action is selected.\n *\n * This is marked as unstable, because when action is selected it will recreate the menu,\n * which will close all opened submenus and reset the scroll position.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/keepsmenupresented) for more information.\n */\n unstable_keepPresented?: boolean;\n}\n\n/**\n * This component renders a context menu action for a link.\n * It should only be used as a child of `Link.Menu` or `LinkMenu`.\n *\n * @platform ios\n */\nexport function LinkMenuAction(props: LinkMenuActionProps) {\n const identifier = useId();\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !use(NativeMenuContext)) {\n return null;\n }\n const { unstable_keepPresented, onPress, children, title, ...rest } = props;\n const areChildrenString = typeof children === 'string';\n const label = areChildrenString\n ? (children as string)\n : getFirstChildOfType(children, Label)?.props.children;\n const iconComponent =\n !props.icon && !areChildrenString ? getFirstChildOfType(children, Icon) : undefined;\n const icon =\n props.icon ??\n (iconComponent?.props && 'sf' in iconComponent.props ? iconComponent.props.sf : undefined);\n const sf = typeof icon === 'string' ? icon : undefined;\n const rawXcasset =\n iconComponent?.props && 'xcasset' in iconComponent.props\n ? iconComponent.props.xcasset\n : undefined;\n const xcassetName = typeof rawXcasset === 'string' ? rawXcasset : undefined;\n return (\n <NativeLinkPreviewAction\n {...rest}\n identifier={identifier}\n icon={sf}\n xcassetName={xcassetName}\n title={label ?? title ?? ''}\n keepPresented={unstable_keepPresented}\n onSelected={() => onPress?.()}\n />\n );\n}\n\nexport interface LinkMenuProps {\n /**\n * The title of the menu item\n */\n title?: string;\n /**\n * An optional subtitle for the submenu. Does not appear on `inline` menus.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/subtitle) for more information.\n */\n subtitle?: string;\n /**\n * Optional SF Symbol displayed alongside the menu item.\n */\n icon?: SFSymbol;\n /**\n * Custom image loaded using `useImage()` hook from `expo-image`.\n * Takes priority over `icon` (SF Symbol) when both are provided.\n *\n * @example\n * ```tsx\n * import { useImage } from 'expo-image';\n * import { Link } from 'expo-router';\n *\n * const customIcon = useImage('https://simpleicons.org/icons/expo.svg', {\n * maxWidth: 24,\n * maxHeight: 24,\n * });\n *\n * <Link.Menu image={customIcon} title=\"Menu\">\n * <Link.MenuAction title=\"Action\" onPress={() => {}} />\n * </Link.Menu>\n * ```\n */\n image?: SharedRef<'image'> | null;\n /**\n * If `true`, the menu will be displayed as a palette.\n * This means that the menu will be displayed as one row.\n * The `elementSize` property is ignored when palette is used, all items will be `elementSize=\"small\"`. Use `elementSize=\"medium\"` instead of `palette` to display actions with titles horizontally.\n *\n * > **Note**: Palette menus are only supported in submenus.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette) for more information.\n */\n palette?: boolean;\n /**\n * @deprecated Use `palette` prop instead.\n */\n displayAsPalette?: boolean;\n /**\n * If `true`, the menu will be displayed inline.\n * This means that the menu will not be collapsed\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline) for more information.\n */\n inline?: boolean;\n /**\n * @deprecated Use `inline` prop instead.\n */\n displayInline?: boolean;\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/destructive) for more information.\n */\n destructive?: boolean;\n /**\n * The preferred size of the menu elements.\n * `elementSize` property is ignored when `palette` is used.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/preferredelementsize) for more information.\n *\n * @platform iOS 16.0+\n */\n elementSize?: 'small' | 'medium' | 'large' | 'auto';\n children?: React.ReactNode;\n}\n\n/**\n * Groups context menu actions for a link.\n *\n * If multiple `Link.Menu` components are used within a single `Link`, only the first will be rendered.\n * Only `Link.MenuAction` and `Link.Menu` components are allowed as children.\n *\n * @example\n * ```tsx\n * <Link.Menu>\n * <Link.MenuAction title=\"Action 1\" onPress={() => {}} />\n * <Link.MenuAction title=\"Action 2\" onPress={() => {}} />\n * </Link.Menu>\n * ```\n *\n * @platform ios\n */\nexport const LinkMenu = (props: LinkMenuProps) => {\n const identifier = useId();\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !use(NativeMenuContext)) {\n return null;\n }\n const children = React.Children.toArray(props.children).filter(\n (child) => isValidElement(child) && (child.type === LinkMenuAction || child.type === LinkMenu)\n );\n const displayAsPalette = props.palette ?? props.displayAsPalette;\n const displayInline = props.inline ?? props.displayInline;\n return (\n <NativeLinkPreviewAction\n {...props}\n displayAsPalette={displayAsPalette}\n displayInline={displayInline}\n preferredElementSize={props.elementSize}\n title={props.title ?? ''}\n onSelected={() => {}}\n children={children}\n identifier={identifier}\n />\n );\n};\n\nexport type LinkPreviewStyle = Omit<ViewStyle, 'position' | 'width' | 'height'> & {\n /**\n * Sets the preferred width of the preview.\n * If not set, full width of the screen will be used.\n *\n * This is only **preferred** width, the actual width may be different\n */\n width?: number;\n\n /**\n * Sets the preferred height of the preview.\n * If not set, full height of the screen will be used.\n *\n * This is only **preferred** height, the actual height may be different\n */\n height?: number;\n};\n\nexport interface LinkPreviewProps {\n children?: React.ReactNode;\n /**\n * Custom styles for the preview container.\n *\n * Note that some styles may not work, as they are limited or reset by the native view\n */\n style?: LinkPreviewStyle;\n}\n\n/**\n * A component used to render and customize the link preview.\n *\n * If `Link.Preview` is used without any props, it will render a preview of the `href` passed to the `Link`.\n *\n * If multiple `Link.Preview` components are used within a single `Link`, only the first one will be rendered.\n *\n * To customize the preview, you can pass custom content as children.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Preview>\n * <Text>Custom Preview Content</Text>\n * </Link.Preview>\n * </Link>\n * ```\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Preview />\n * </Link>\n * ```\n *\n * @platform ios\n */\nexport function LinkPreview(props: LinkPreviewProps) {\n const { children, style } = props;\n const internalPreviewContext = use(InternalLinkPreviewContext);\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !internalPreviewContext) {\n return null;\n }\n const { isVisible, href } = internalPreviewContext;\n const { width, height, ...restOfStyle } = style ?? {};\n const contentSize = {\n width: width ?? 0,\n height: height ?? 0,\n };\n let content: React.ReactNode;\n if (children) {\n content = isVisible ? children : null;\n } else {\n content = isVisible ? <HrefPreview href={href} /> : null;\n }\n\n return (\n <NativeLinkPreviewContent style={restOfStyle} preferredContentSize={contentSize}>\n {content}\n </NativeLinkPreviewContent>\n );\n}\n\nexport interface LinkTriggerProps extends PropsWithChildren {\n /**\n * A shorthand for enabling the Apple Zoom Transition on this link trigger.\n *\n * When set to `true`, the trigger will be wrapped with `Link.AppleZoom`.\n * If another `Link.AppleZoom` is already used inside `Link.Trigger`, an error\n * will be thrown.\n *\n * @platform ios 18+\n */\n withAppleZoom?: boolean;\n}\n\n/**\n * Serves as the trigger for a link.\n * The content inside this component will be rendered as part of the base link.\n *\n * If multiple `Link.Trigger` components are used within a single `Link`, only the first will be rendered.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Trigger>\n * Trigger\n * </Link.Trigger>\n * </Link>\n * ```\n *\n * @platform ios\n */\nexport function LinkTrigger({ withAppleZoom, ...props }: LinkTriggerProps) {\n if (React.Children.count(props.children) > 1 || !isValidElement(props.children)) {\n // If onPress is passed, this means that Link passed props to this component.\n // We can assume that asChild is used, so we throw an error, because link will not work in this case.\n if (props && typeof props === 'object' && 'onPress' in props) {\n throw new Error(\n 'When using Link.Trigger in an asChild Link, you must pass a single child element that will emit onPress event.'\n );\n }\n return props.children;\n }\n const content = <Slot {...props} />;\n if (withAppleZoom) {\n return <LinkAppleZoom>{content}</LinkAppleZoom>;\n }\n return content;\n}\n"]}
|
package/build/link/href.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"href.d.ts","sourceRoot":"","sources":["../../src/link/href.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,oEAAoE;AACpE,eAAO,MAAM,WAAW,GAAI,MAAM,IAAI,KAAG,MAaxC,CAAC;AAEF,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,EAAE,QAAa,EAAE,MAAW,EAAE,GAAE,OAAO,CAAC,SAAS,CAAM,EACvD,EAAE,mBAAmB,EAAE,GAAE,aAAkB,
|
|
1
|
+
{"version":3,"file":"href.d.ts","sourceRoot":"","sources":["../../src/link/href.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAErC,oEAAoE;AACpE,eAAO,MAAM,WAAW,GAAI,MAAM,IAAI,KAAG,MAaxC,CAAC;AAEF,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,MAAM,EACZ,EAAE,QAAa,EAAE,MAAW,EAAE,GAAE,OAAO,CAAC,SAAS,CAAM,EACvD,EAAE,mBAAmB,EAAE,GAAE,aAAkB,UAqC5C"}
|
package/build/link/href.js
CHANGED
|
@@ -48,7 +48,10 @@ function resolveHrefStringWithSegments(href, { segments = [], params = {} } = {}
|
|
|
48
48
|
const url = new URL(href, `http://hostname/${base}`);
|
|
49
49
|
href = `${url.pathname}${url.search}`;
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
// Collapse leading slashes so a scheme-relative `//host/...` href — whether
|
|
52
|
+
// smuggled in directly or produced by URL resolution above — cannot route
|
|
53
|
+
// navigation cross-origin.
|
|
54
|
+
return href.replace(/^\/+/, '/');
|
|
52
55
|
}
|
|
53
56
|
function createQualifiedPathname(pathname, params) {
|
|
54
57
|
for (const [key, value = ''] of Object.entries(params)) {
|
package/build/link/href.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"href.js","sourceRoot":"","sources":["../../src/link/href.ts"],"names":[],"mappings":";;;AAoBA,
|
|
1
|
+
{"version":3,"file":"href.js","sourceRoot":"","sources":["../../src/link/href.ts"],"names":[],"mappings":";;;AAoBA,sEAwCC;AAxDD,oEAAoE;AAC7D,MAAM,WAAW,GAAG,CAAC,IAAU,EAAU,EAAE;IAChD,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,OAAO,IAAA,mBAAW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C,cAAc,CAAC,EAAE,CAAC;YAC7C,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,cAAc,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;QAClE,CAAC;aAAM,CAAC;YACN,SAAS;QACX,CAAC;QAED,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;AAC9B,CAAC;AAED,SAAS,WAAW,CAAC,KAAU;IAC7B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACpD,CAAC;IAED,OAAO,kBAAkB,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC9C,CAAC;AAED,SAAS,iBAAiB,CAAC,MAA2B;IACpD,OAAO,CACL,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC;QACpB,uBAAuB;SACtB,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,IAAI,CAAC;SACpC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,GAAG,IAAI,kBAAkB,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;SACvE,IAAI,CAAC,GAAG,CAAC,CACb,CAAC;AACJ,CAAC","sourcesContent":["import type { UrlObject } from '../LocationProvider';\nimport type { LinkToOptions } from '../global-state/routing';\nimport type { Href } from '../types';\n\n/** Resolve an href object into a fully qualified, relative href. */\nexport const resolveHref = (href: Href): string => {\n if (typeof href === 'string') {\n return resolveHref({ pathname: href });\n }\n const path = href.pathname ?? '';\n if (!href?.params) {\n return path;\n }\n const { pathname, params } = createQualifiedPathname(path, {\n ...href.params,\n });\n const paramsString = createQueryParams(params);\n return pathname + (paramsString ? `?${paramsString}` : '');\n};\n\nexport function resolveHrefStringWithSegments(\n href: string,\n { segments = [], params = {} }: Partial<UrlObject> = {},\n { relativeToDirectory }: LinkToOptions = {}\n) {\n if (href.startsWith('.')) {\n // Resolve base path by merging the current segments with the params\n let base =\n segments\n ?.map((segment) => {\n if (!segment.startsWith('[')) return segment;\n\n if (segment.startsWith('[...')) {\n segment = segment.slice(4, -1);\n const param = params[segment];\n if (Array.isArray(param)) {\n return param.join('/');\n } else {\n return param?.split(',')?.join('/') ?? '';\n }\n } else {\n segment = segment.slice(1, -1);\n return params[segment];\n }\n })\n .filter(Boolean)\n .join('/') ?? '/';\n\n if (relativeToDirectory) {\n base = `${base}/`;\n }\n\n const url = new URL(href, `http://hostname/${base}`);\n href = `${url.pathname}${url.search}`;\n }\n\n // Collapse leading slashes so a scheme-relative `//host/...` href — whether\n // smuggled in directly or produced by URL resolution above — cannot route\n // navigation cross-origin.\n return href.replace(/^\\/+/, '/');\n}\n\nfunction createQualifiedPathname(\n pathname: string,\n params: Record<string, any>\n): { pathname: string; params: any } {\n for (const [key, value = ''] of Object.entries(params)) {\n const dynamicKey = `[${key}]`;\n const deepDynamicKey = `[...${key}]`;\n if (pathname.includes(dynamicKey)) {\n pathname = pathname.replace(dynamicKey, encodeParam(value));\n } else if (pathname.includes(deepDynamicKey)) {\n pathname = pathname.replace(deepDynamicKey, encodeParam(value));\n } else {\n continue;\n }\n\n delete params[key];\n }\n return { pathname, params };\n}\n\nfunction encodeParam(param: any): string {\n if (Array.isArray(param)) {\n return param.map((p) => encodeParam(p)).join('/');\n }\n\n return encodeURIComponent(param.toString());\n}\n\nfunction createQueryParams(params: Record<string, any>): string {\n return (\n Object.entries(params)\n // Allow nullish params\n .filter(([, value]) => value != null)\n .map(([key, value]) => `${key}=${encodeURIComponent(value.toString())}`)\n .join('&')\n );\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type SharedRef } from 'expo';
|
|
2
2
|
import { type PropsWithChildren } from 'react';
|
|
3
3
|
import { type ViewProps, type ColorValue } from 'react-native';
|
|
4
4
|
import type { BasicTextStyle } from '../../utils/font';
|
|
@@ -8,7 +8,7 @@ export interface NativeLinkPreviewActionProps {
|
|
|
8
8
|
label?: string;
|
|
9
9
|
icon?: string;
|
|
10
10
|
xcassetName?: string;
|
|
11
|
-
image?:
|
|
11
|
+
image?: SharedRef<'image'> | null;
|
|
12
12
|
imageRenderingMode?: 'template' | 'original';
|
|
13
13
|
children?: React.ReactNode;
|
|
14
14
|
disabled?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/link/preview/native.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/link/preview/native.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,SAAS,EAAE,MAAM,MAAM,CAAC;AACzD,OAAO,EAAY,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAwB,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAErF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAOvD,MAAM,WAAW,4BAA4B;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC;IAClC,kBAAkB,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;IAC7C,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW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["../../../src/link/preview/native.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../src/link/preview/native.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAwDb,0DAaC;AA4BD,8CAKC;AAYD,4DAaC;AAeD,8DAcC;AAyBD,4DAaC;AASD,0FAgBC;;AAzND,+BAAyD;AACzD,iCAAyD;AACzD,+CAAqF;AAIrF,kEAAkE;AAClE,MAAM,uBAAuB,GAC3B,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,IAAI,CAAC,uBAAQ,CAAC,IAAI,IAAK,MAAc,CAAC,aAAa,KAAK,IAAI,CAAC;AAyC5F,MAAM,2BAA2B,GAEtB,uBAAuB;IAChC,CAAC,CAAC,IAAA,wBAAiB,EAAC,6BAA6B,EAAE,6BAA6B,CAAC;IACjF,CAAC,CAAC,IAAI,CAAC;AACT,SAAgB,uBAAuB,CAAC,KAAmC;IACzE,IAAI,CAAC,2BAA2B,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,iDAAiD;IACjD,MAAM,aAAa,GACjB,KAAK,CAAC,KAKP,EAAE,yBAAyB,CAAC;IAC7B,OAAO,uBAAC,2BAA2B,OAAK,KAAK,EAAE,KAAK,EAAE,aAAa,GAAI,CAAC;AAC1E,CAAC;AAwBD,MAAM,qBAAqB,GACzB,uBAAuB;IACrB,CAAC,CAAC,IAAA,wBAAiB,EAAC,6BAA6B,EAAE,uBAAuB,CAAC;IAC3E,CAAC,CAAC,IAAI,CAAC;AACX,SAAgB,iBAAiB,CAAC,KAA6B;IAC7D,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,uBAAC,qBAAqB,OAAK,KAAK,GAAI,CAAC;AAC9C,CAAC;AAOD,MAAM,4BAA4B,GAChC,uBAAuB;IACrB,CAAC,CAAC,IAAA,wBAAiB,EAAC,6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AACD,aAAa;AAEb,wCAAwC;AACxC,MAAM,6CAA6C,GAExC,uBAAuB;IAChC,CAAC,CAAC,IAAA,wBAAiB,EAAC,6BAA6B,EAAE,yCAAyC,CAAC;IAC7F,CAAC,CAAC,gBAAQ,CAAC;AACb,SAAgB,uCAAuC,CAAC,KAGvD;IACC,IAAI,CAAC,6CAA6C,EAAE,CAAC;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL,uBAAC,6CAA6C,OACxC,KAAK,EACT,mBAAmB,QACnB,WAAW,EAAE,KAAK,EAClB,mBAAmB,EAAE,KAAK,EAC1B,KAAK,EAAE,EAAE,OAAO,EAAE,UAAU,EAAE,GAC9B,CACH,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport { requireNativeView, type SharedRef } from 'expo';\nimport { Fragment, type PropsWithChildren } from 'react';\nimport { Platform, StyleSheet, type ViewProps, type ColorValue } from 'react-native';\n\nimport type { BasicTextStyle } from '../../utils/font';\n\n// TODO(@kitten): Replace with `globalThis`, add typings in `expo`\nconst areNativeViewsAvailable =\n process.env.EXPO_OS === 'ios' && !Platform.isTV && (global as any).RN$Bridgeless === true;\n\n// #region Action View\nexport interface NativeLinkPreviewActionProps {\n identifier: string;\n title: string;\n label?: string;\n icon?: string;\n xcassetName?: string;\n image?: SharedRef<'image'> | null;\n imageRenderingMode?: 'template' | 'original';\n children?: React.ReactNode;\n disabled?: boolean;\n destructive?: boolean;\n discoverabilityLabel?: string;\n subtitle?: string;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n // This may lead to race conditions, when two menu actions are on at the same time.\n // The logic should be enforced in the JS code, rather than in the native code.\n // singleSelection?: boolean;\n displayAsPalette?: boolean;\n displayInline?: boolean;\n preferredElementSize?: 'auto' | 'small' | 'medium' | 'large';\n isOn?: boolean;\n // There are issues with menu state updates when keep presented is set to true.\n // When updating the context menu state, it will either not update or it will recreate the menu. The latter is a problem,\n // because it will close all opened submenus and reset the scroll position.\n // TODO: (@ubax) find a way to fix this.\n keepPresented?: boolean;\n hidden?: boolean;\n tintColor?: ColorValue;\n barButtonItemStyle?: 'plain' | 'prominent';\n\n // These properties are for UIBarButtonItem compatibility but don't apply to context menus.\n // They're included for API consistency with toolbar items.\n sharesBackground?: boolean;\n hidesSharedBackground?: boolean;\n onSelected: () => void;\n titleStyle?: BasicTextStyle;\n}\nconst LinkPreviewNativeActionView: React.ComponentType<\n Omit<NativeLinkPreviewActionProps, 'image'> & { image?: number }\n> | null = areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkPreviewNativeActionView')\n : null;\nexport function NativeLinkPreviewAction(props: NativeLinkPreviewActionProps) {\n if (!LinkPreviewNativeActionView) {\n return null;\n }\n // Needed to pass shared object ID to native side\n const imageObjectId = (\n props.image as\n | {\n __expo_shared_object_id__: number;\n }\n | undefined\n )?.__expo_shared_object_id__;\n return <LinkPreviewNativeActionView {...props} image={imageObjectId} />;\n}\n// #endregion\n\n// #region Preview View\nexport interface TabPath {\n oldTabKey: string;\n newTabKey: string;\n}\nexport interface NativeLinkPreviewProps extends ViewProps {\n nextScreenId: string | undefined;\n tabPath:\n | {\n path: TabPath[];\n }\n | undefined;\n disableForceFlatten?: boolean;\n onWillPreviewOpen?: () => void;\n onDidPreviewOpen?: () => void;\n onPreviewWillClose?: () => void;\n onPreviewDidClose?: () => void;\n onPreviewTapped?: () => void;\n onPreviewTappedAnimationCompleted?: () => void;\n children: React.ReactNode;\n}\nconst NativeLinkPreviewView: React.ComponentType<NativeLinkPreviewProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'NativeLinkPreviewView')\n : null;\nexport function NativeLinkPreview(props: NativeLinkPreviewProps) {\n if (!NativeLinkPreviewView) {\n return null;\n }\n return <NativeLinkPreviewView {...props} />;\n}\n// #endregion\n\n// #region Preview Content View\nexport interface NativeLinkPreviewContentProps extends ViewProps {\n preferredContentSize?: { width: number; height: number };\n}\nconst NativeLinkPreviewContentView: React.ComponentType<NativeLinkPreviewContentProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'NativeLinkPreviewContentView')\n : null;\n\nexport function NativeLinkPreviewContent(props: NativeLinkPreviewContentProps) {\n if (!NativeLinkPreviewContentView) {\n return null;\n }\n const style = StyleSheet.flatten([\n props.style,\n {\n position: 'absolute',\n top: 0,\n left: 0,\n } as const,\n ]);\n return <NativeLinkPreviewContentView {...props} style={style} />;\n}\n// #endregion\n\n// #region Zoom transition enabler\ninterface DismissalBoundsRect {\n minX?: number;\n maxX?: number;\n minY?: number;\n maxY?: number;\n}\nconst LinkZoomTransitionEnablerNativeView: React.ComponentType<\n ViewProps & { zoomTransitionSourceIdentifier: string; disableForceFlatten?: boolean }\n> | null = areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionEnabler')\n : null;\nexport function LinkZoomTransitionEnabler(props: {\n zoomTransitionSourceIdentifier: string;\n dismissalBoundsRect?: DismissalBoundsRect | null;\n}) {\n if (!LinkZoomTransitionEnablerNativeView) {\n return null;\n }\n return (\n <LinkZoomTransitionEnablerNativeView\n {...props}\n disableForceFlatten\n style={{ display: 'contents' }}\n />\n );\n}\n// #endregion\n\n// #region Zoom transition source\ninterface LinkSourceAlignmentRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\ninterface LinkZoomTransitionSourceProps extends PropsWithChildren {\n identifier: string;\n alignment?: LinkSourceAlignmentRect;\n animateAspectRatioChange?: boolean;\n}\n\ninterface LinkZoomTransitionSourceNativeProps extends ViewProps, LinkZoomTransitionSourceProps {\n disableForceFlatten?: boolean;\n}\n\nconst LinkZoomTransitionSourceNativeView: React.ComponentType<LinkZoomTransitionSourceNativeProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionSource')\n : null;\nexport function LinkZoomTransitionSource(props: LinkZoomTransitionSourceProps) {\n if (!LinkZoomTransitionSourceNativeView) {\n return null;\n }\n return (\n <LinkZoomTransitionSourceNativeView\n {...props}\n disableForceFlatten\n collapsable={false}\n collapsableChildren={false}\n style={{ display: 'contents' }}\n />\n );\n}\n// #endregion\n\n// #region Zoom transition rect detector\nconst LinkZoomTransitionAlignmentRectDetectorNative: React.ComponentType<\n ViewProps & { identifier: string; disableForceFlatten?: boolean; children?: React.ReactNode }\n> | null = areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionAlignmentRectDetector')\n : Fragment;\nexport function LinkZoomTransitionAlignmentRectDetector(props: {\n identifier: string;\n children: React.ReactNode;\n}) {\n if (!LinkZoomTransitionAlignmentRectDetectorNative) {\n return null;\n }\n return (\n <LinkZoomTransitionAlignmentRectDetectorNative\n {...props}\n disableForceFlatten\n collapsable={false}\n collapsableChildren={false}\n style={{ display: 'contents' }}\n />\n );\n}\n// #endregion\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { convertMaterialIconNameToImageSource as BaseType } from './materialIconConverter';
|
|
2
|
+
export declare function convertMaterialIconNameToImageSource(..._args: Parameters<typeof BaseType>): ReturnType<typeof BaseType>;
|
|
3
|
+
//# sourceMappingURL=materialIconConverter-not-implemented.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materialIconConverter-not-implemented.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/utils/materialIconConverter-not-implemented.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oCAAoC,IAAI,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEhG,wBAAgB,oCAAoC,CAClD,GAAG,KAAK,EAAE,UAAU,CAAC,OAAO,QAAQ,CAAC,GACpC,UAAU,CAAC,OAAO,QAAQ,CAAC,CAI7B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.convertMaterialIconNameToImageSource = convertMaterialIconNameToImageSource;
|
|
4
|
+
function convertMaterialIconNameToImageSource(..._args) {
|
|
5
|
+
throw new Error('NativeTabs `md` (Material Symbols) icons are not available. Material Symbols support was disabled via EXPO_ROUTER_DISABLE_NATIVE_TABS_MD. Use the `src` or `drawable` icon prop instead or remove the EXPO_ROUTER_DISABLE_NATIVE_TABS_MD.');
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=materialIconConverter-not-implemented.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"materialIconConverter-not-implemented.js","sourceRoot":"","sources":["../../../src/native-tabs/utils/materialIconConverter-not-implemented.tsx"],"names":[],"mappings":";;AAKA,oFAMC;AAND,SAAgB,oCAAoC,CAClD,GAAG,KAAkC;IAErC,MAAM,IAAI,KAAK,CACb,2OAA2O,CAC5O,CAAC;AACJ,CAAC","sourcesContent":["// This module is the swap target when EXPO_ROUTER_DISABLE_NATIVE_TABS_MD is set on Android, which lets the\n// Metro resolver tree-shake `expo-symbols` from the Android bundle. The type-only `expo-symbols`\n// import below is erased by the compiler, so no runtime dependency is introduced.\nimport type { convertMaterialIconNameToImageSource as BaseType } from './materialIconConverter';\n\nexport function convertMaterialIconNameToImageSource(\n ..._args: Parameters<typeof BaseType>\n): ReturnType<typeof BaseType> {\n throw new Error(\n 'NativeTabs `md` (Material Symbols) icons are not available. Material Symbols support was disabled via EXPO_ROUTER_DISABLE_NATIVE_TABS_MD. Use the `src` or `drawable` icon prop instead or remove the EXPO_ROUTER_DISABLE_NATIVE_TABS_MD.'\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/navigationEvents/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC5B,QAA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