expo-router 7.0.0-canary-20251223-b83b31e → 7.0.0-canary-20260105-6b962e6
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/utils.d.ts +1 -1
- package/build/internal/utils.d.ts.map +1 -1
- package/build/internal/utils.js +2 -2
- package/build/internal/utils.js.map +1 -1
- package/build/layouts/stack-utils/StackHeaderMenu.d.ts.map +1 -1
- package/build/layouts/stack-utils/StackHeaderMenu.js +1 -0
- package/build/layouts/stack-utils/StackHeaderMenu.js.map +1 -1
- package/build/link/elements.d.ts +19 -1
- package/build/link/elements.d.ts.map +1 -1
- package/build/link/elements.js +1 -1
- package/build/link/elements.js.map +1 -1
- package/build/link/preview/native.d.ts +1 -0
- package/build/link/preview/native.d.ts.map +1 -1
- package/build/link/preview/native.js.map +1 -1
- package/build/link/zoom/ZoomTransitionEnabler.d.ts +1 -1
- package/build/link/zoom/ZoomTransitionEnabler.d.ts.map +1 -1
- package/build/link/zoom/ZoomTransitionEnabler.ios.d.ts +1 -1
- package/build/link/zoom/ZoomTransitionEnabler.ios.d.ts.map +1 -1
- package/build/link/zoom/ZoomTransitionEnabler.ios.js +4 -7
- package/build/link/zoom/ZoomTransitionEnabler.ios.js.map +1 -1
- package/build/link/zoom/ZoomTransitionEnabler.js +2 -2
- package/build/link/zoom/ZoomTransitionEnabler.js.map +1 -1
- package/build/native-tabs/NativeTabsView.d.ts.map +1 -1
- package/build/native-tabs/NativeTabsView.js +21 -2
- package/build/native-tabs/NativeTabsView.js.map +1 -1
- package/build/native-tabs/common/elements.d.ts +8 -0
- package/build/native-tabs/common/elements.d.ts.map +1 -1
- package/build/native-tabs/common/elements.js.map +1 -1
- package/build/toolbar/elements.d.ts +19 -3
- package/build/toolbar/elements.d.ts.map +1 -1
- package/build/toolbar/elements.js +4 -4
- package/build/toolbar/elements.js.map +1 -1
- package/build/toolbar/index.d.ts +2 -2
- package/build/toolbar/index.js +2 -2
- package/build/toolbar/index.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/LinkPreview/LinkPreviewNativeActionView.swift +81 -138
- package/ios/LinkPreview/LinkPreviewNativeModule.swift +28 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.module → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.pom → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.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 +10 -10
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e-sources.jar → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e-sources.jar.md5 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e-sources.jar.sha1 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e-sources.jar.sha256 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e-sources.jar.sha512 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.aar → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.aar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.aar.md5 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.aar.sha1 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.aar.sha256 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.aar.sha512 → 7.0.0-canary-20260105-6b962e6/expo.modules.router-7.0.0-canary-20260105-6b962e6.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 = '7.0.0-canary-
|
|
7
|
+
version = '7.0.0-canary-20260105-6b962e6'
|
|
8
8
|
|
|
9
9
|
android {
|
|
10
10
|
namespace "expo.modules.router"
|
|
11
11
|
defaultConfig {
|
|
12
12
|
versionCode 1
|
|
13
|
-
versionName "7.0.0-canary-
|
|
13
|
+
versionName "7.0.0-canary-20260105-6b962e6"
|
|
14
14
|
}
|
|
15
15
|
lintOptions {
|
|
16
16
|
abortOnError false
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/internal/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/internal/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC"}
|
package/build/internal/utils.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.disableZoomTransition = exports.shouldLinkExternally = void 0;
|
|
4
4
|
var url_1 = require("../utils/url");
|
|
5
5
|
Object.defineProperty(exports, "shouldLinkExternally", { enumerable: true, get: function () { return url_1.shouldLinkExternally; } });
|
|
6
6
|
var ZoomTransitionEnabler_1 = require("../link/zoom/ZoomTransitionEnabler");
|
|
7
|
-
Object.defineProperty(exports, "
|
|
7
|
+
Object.defineProperty(exports, "disableZoomTransition", { enumerable: true, get: function () { return ZoomTransitionEnabler_1.disableZoomTransition; } });
|
|
8
8
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/internal/utils.ts"],"names":[],"mappings":";;;AAAA,oCAAoD;AAA3C,2GAAA,oBAAoB,OAAA;AAC7B,
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/internal/utils.ts"],"names":[],"mappings":";;;AAAA,oCAAoD;AAA3C,2GAAA,oBAAoB,OAAA;AAC7B,4EAA2E;AAAlE,8HAAA,qBAAqB,OAAA","sourcesContent":["export { shouldLinkExternally } from '../utils/url';\nexport { disableZoomTransition } from '../link/zoom/ZoomTransitionEnabler';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackHeaderMenu.d.ts","sourceRoot":"","sources":["../../../src/layouts/stack-utils/StackHeaderMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,+BAA+B,EAEhC,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAExD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAEL,KAAK,0B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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAAQ,CAAC;AAEpE,wBAAgB,yCAAyC,CACvD,KAAK,EAAE,oBAAoB,GAC1B,yBAAyB,GAAG,SAAS,CA2BvC;AAuDD,MAAM,WAAW,0BAA0B;IACzC;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,mBAAmB,CAAC;IACtC;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAc,CAAC;AAEtF,wBAAgB,+CAA+C,CAC7D,KAAK,EAAE,0BAA0B,GAChC,+BAA+B,CAwBjC"}
|
|
@@ -137,6 +137,7 @@ function convertStackHeaderSubmenuMenuPropsToRNHeaderItem(props) {
|
|
|
137
137
|
if (props.destructive !== undefined) {
|
|
138
138
|
item.destructive = props.destructive;
|
|
139
139
|
}
|
|
140
|
+
// TODO: Add elementSize to react-native-screens
|
|
140
141
|
if (sharedProps.icon) {
|
|
141
142
|
// Only SF Symbols are supported in submenu icons
|
|
142
143
|
if (sharedProps.icon.type === 'sfSymbol') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackHeaderMenu.js","sourceRoot":"","sources":["../../../src/layouts/stack-utils/StackHeaderMenu.tsx"],"names":[],"mappings":";;;AAoMA,8FA6BC;AA0ID,0GA0BC;AAhYD,iCAAiD;AAKjD,qCAGkB;AAClB,iDAAoD;AACpD,mDAAqD;AAyGrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACU,QAAA,eAAe,GAAmC,iBAAI,CAAC;AAEpE,SAAgB,yCAAyC,CACvD,KAA2B;IAE3B,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IACjC,MAAM,OAAO,GAAG,gBAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,CACrD,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,wBAAa,EAAC,KAAK,EAAE,6BAAqB,CAAC,IAAI,IAAA,wBAAa,EAAC,KAAK,EAAE,uBAAe,CAAC,CAChG,CAAC;IACF,MAAM,IAAI,GAA8B;QACtC,GAAG,IAAA,0DAAiD,EAAC,IAAI,CAAC;QAC1D,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE;YACJ,KAAK,EAAE,OAAO;iBACX,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;gBACd,IAAI,IAAA,wBAAa,EAAC,MAAM,EAAE,uBAAe,CAAC,EAAE,CAAC;oBAC3C,OAAO,gDAAgD,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;gBACxE,CAAC;gBACD,OAAO,+CAA+C,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,CAAC,CAAC;iBACD,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,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AAW,CAAC,IAAI,EAAE,CAAC;QACrB,gDAAgD;QAChD,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACzC,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;QAC/B,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CACV,qIAAqI,CACtI,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type {\n NativeStackHeaderItemMenu,\n NativeStackHeaderItemMenuAction,\n NativeStackHeaderItemMenuSubmenu,\n} from '@react-navigation/native-stack';\nimport { Children, type ReactNode } from 'react';\nimport type { ImageSourcePropType } from 'react-native';\nimport type { HeaderBarButtonItemSubmenu } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport {\n convertStackHeaderSharedPropsToRNSharedHeaderItem,\n type StackHeaderItemSharedProps,\n} from './shared';\nimport { Menu, MenuAction } from '../../primitives';\nimport { isChildOfType } from '../../utils/children';\n\nexport interface StackHeaderMenuProps {\n accessibilityLabel?: string;\n accessibilityHint?: string;\n /**\n * There are two ways to specify the content of the menu header item - using props or child components:\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * ...\n * <Stack.Header.Menu icon=\"star.fill\" title=\"As props\">\n * <Stack.Header.MenuAction>Action 1</Stack.Header.MenuAction>\n * </Stack.Header.Menu>\n * ```\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * ...\n * <Stack.Header.Menu>\n * <Stack.Header.Icon sf=\"star.fill\" />\n * <Stack.Header.Label>As components</Stack.Header.Label>\n * <Stack.Header.Badge>3</Stack.Header.Badge>\n * <Stack.Header.MenuAction>Action 1</Stack.Header.MenuAction>\n * </Stack.Header.Menu>\n * ```\n *\n * **Note**: When icon is used, the label will not be shown and will be used for accessibility purposes only.\n */\n children?: ReactNode;\n /**\n * 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 disabled?: boolean;\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 hidden?: boolean;\n /**\n * Icon for the menu item.\n *\n * Can be an SF Symbol name or an image source.\n */\n icon?: StackHeaderItemSharedProps['icon'];\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 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 palette?: boolean;\n /**\n * Whether to separate the background of this item from other header items.\n *\n * @default false\n */\n separateBackground?: boolean;\n /**\n * Style for the label of the header item.\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 */\n tintColor?: StackHeaderItemSharedProps['tintColor'];\n /**\n * Optional title to show on top of the menu.\n */\n title?: string;\n /**\n * @default 'plain'\n */\n variant?: StackHeaderItemSharedProps['variant'];\n}\n\n/**\n * Component representing menu for `Stack.Header.Right` or `Stack.Header.Left`.\n *\n * Use as `Stack.Header.Menu` to provide top-level menus on iOS header bars.\n * It accepts `Stack.Header.MenuAction` and nested `Stack.Header.Menu`\n * elements. Menu can be configured using both component props and child\n * elements.\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n * import { Alert } from 'react-native';\n *\n * export default function Screen() {\n * return (\n * <>\n * <ScreenContent />\n * <Stack.Screen>\n * <Stack.Header>\n * <Stack.Header.Right>\n * <Stack.Header.Menu>\n * <Stack.Header.Label>Menu</Stack.Header.Label>\n * <Stack.Header.Icon sf=\"ellipsis.circle\" />\n * <Stack.Header.MenuAction onPress={() => Alert.alert('Action 1 pressed!')}>\n * Action 1\n * </Stack.Header.MenuAction>\n * <Stack.Header.MenuAction isOn icon=\"star.fill\">\n * Action 2\n * </Stack.Header.MenuAction>\n * <Stack.Header.Menu inline>\n * <Stack.Header.MenuAction isOn>Sub Action</Stack.Header.MenuAction>\n * </Stack.Header.Menu>\n * </Stack.Header.Menu>\n * </Stack.Header.Right>\n * </Stack.Header>\n * </Stack.Screen>\n * </>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n * import { Text } from 'react-native';\n *\n * export default function Screen() {\n * return (\n * <>\n * <ScreenContent />\n * <Stack.Screen>\n * <Stack.Header>\n * <Stack.Header.Left>\n * <Stack.Header.Menu>\n * <Stack.Header.MenuAction onPress={() => Alert.alert('Action 1 pressed!')}>\n * Action 1\n * </Stack.Header.MenuAction>\n * <Stack.Header.Menu inline palette title=\"Icons\">\n * <Stack.Header.MenuAction isOn icon=\"star.fill\" />\n * <Stack.Header.MenuAction icon=\"heart.fill\" />\n * </Stack.Header.Menu>\n * </Stack.Header.Menu>\n * </Stack.Header.Left>\n * </Stack.Header>\n * </Stack.Screen>\n * </>\n * );\n * }\n * ```\n *\n * @see [Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/menus) for more information about menus on iOS.\n *\n * @platform ios\n */\nexport const StackHeaderMenu: React.FC<StackHeaderMenuProps> = Menu;\n\nexport function convertStackHeaderMenuPropsToRNHeaderItem(\n props: StackHeaderMenuProps\n): NativeStackHeaderItemMenu | undefined {\n if (props.hidden) {\n return undefined;\n }\n const { title, ...rest } = props;\n const actions = Children.toArray(props.children).filter(\n (child) => isChildOfType(child, StackHeaderMenuAction) || isChildOfType(child, StackHeaderMenu)\n );\n const item: NativeStackHeaderItemMenu = {\n ...convertStackHeaderSharedPropsToRNSharedHeaderItem(rest),\n type: 'menu',\n menu: {\n items: actions\n .map((action) => {\n if (isChildOfType(action, StackHeaderMenu)) {\n return convertStackHeaderSubmenuMenuPropsToRNHeaderItem(action.props);\n }\n return convertStackHeaderMenuActionPropsToRNHeaderItem(action.props);\n })\n .filter((i) => !!i),\n },\n };\n if (title) {\n item.menu.title = title;\n }\n\n return item;\n}\n\nfunction convertStackHeaderSubmenuMenuPropsToRNHeaderItem(\n props: StackHeaderMenuProps\n): NativeStackHeaderItemMenuSubmenu | undefined {\n if (props.hidden) {\n return undefined;\n }\n // Removing children. Otherwise the buttons will be broken\n const sharedProps = convertStackHeaderSharedPropsToRNSharedHeaderItem(props);\n const actions = Children.toArray(props.children).filter(\n (child) => isChildOfType(child, StackHeaderMenuAction) || isChildOfType(child, StackHeaderMenu)\n );\n\n // TODO: Remove Pick<HeaderBarButtonItemSubmenu> when this PR is merged and released in react-navigation:\n // https://github.com/react-navigation/react-navigation/pull/12895\n const item: NativeStackHeaderItemMenuSubmenu &\n Pick<HeaderBarButtonItemSubmenu, 'displayAsPalette' | 'displayInline' | 'destructive'> = {\n type: 'submenu',\n items: actions\n .map((action) => {\n if (isChildOfType(action, StackHeaderMenu)) {\n return convertStackHeaderSubmenuMenuPropsToRNHeaderItem(action.props);\n }\n return convertStackHeaderMenuActionPropsToRNHeaderItem(action.props);\n })\n .filter((i) => !!i),\n label: sharedProps.label || props.title || '',\n };\n\n if (props.inline !== undefined) {\n item.displayInline = props.inline;\n }\n if (props.palette !== undefined) {\n item.displayAsPalette = props.palette;\n }\n if (props.destructive !== undefined) {\n item.destructive = props.destructive;\n }\n\n if (sharedProps.icon) {\n // Only SF Symbols are supported in submenu icons\n if (sharedProps.icon.type === 'sfSymbol') {\n item.icon = sharedProps.icon;\n } else {\n console.warn(\n 'When Icon is used inside Stack.Header.Menu used as a submenu, only sfSymbol icons are supported. This is a limitation of React Native Screens.'\n );\n }\n }\n\n return item;\n}\n\nexport interface StackHeaderMenuActionProps {\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 icon?: SFSymbol | ImageSourcePropType;\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 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 * If `true`, the menu item will be displayed as selected.\n */\n isOn?: boolean;\n onPress?: () => void;\n /**\n * An elaborated title that explains the purpose of the action.\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 subtitle?: string;\n hidden?: boolean;\n}\n\n/**\n * An action item for a `Stack.Header.Menu`.\n *\n * @example\n * ```tsx\n * import React from 'react';\n * import { Alert } from 'react-native';\n * import { Stack, Label, Icon } from 'expo-router';\n *\n * export default function ExampleScreen() {\n * return (\n * <>\n * <ScreenContent />\n * <Stack.Screen>\n * <Stack.Header>\n * <Stack.Header.Right>\n * <Stack.Header.Menu icon=\"ellipsis.circle\">\n * <Stack.Header.MenuAction onPress={() => Alert.alert('Action 1 pressed!')}>\n * Action 1\n * </Stack.Header.MenuAction>\n * <Stack.Header.MenuAction isOn onPress={() => Alert.alert('Action 2 pressed!')}>\n * <Label>Action 2</Label>\n * <Icon sf=\"star.fill\" />\n * </Stack.Header.MenuAction>\n * </Stack.Header.Menu>\n * </Stack.Header.Right>\n * </Stack.Header>\n * </Stack.Screen>\n * </>\n * );\n * }\n * ```\n *\n * @see [Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/menus) for more information about menus on iOS.\n *\n * @platform ios\n */\nexport const StackHeaderMenuAction: React.FC<StackHeaderMenuActionProps> = MenuAction;\n\nexport function convertStackHeaderMenuActionPropsToRNHeaderItem(\n props: StackHeaderMenuActionProps\n): NativeStackHeaderItemMenuAction {\n const { children, isOn, unstable_keepPresented, icon, ...rest } = props;\n const sharedProps = convertStackHeaderSharedPropsToRNSharedHeaderItem(props);\n const item: NativeStackHeaderItemMenuAction = {\n ...rest,\n type: 'action',\n label: sharedProps.label,\n state: isOn ? 'on' : 'off',\n onPress: props.onPress ?? (() => {}),\n };\n if (unstable_keepPresented !== undefined) {\n item.keepsMenuPresented = unstable_keepPresented;\n }\n if (sharedProps.icon) {\n // Only SF Symbols are supported in action icons\n if (sharedProps.icon.type === 'sfSymbol') {\n item.icon = sharedProps.icon;\n } else {\n console.warn(\n 'When Icon is used inside Stack.Header.Menu.Action, only sfSymbol icons are supported. This is a limitation of React Native Screens.'\n );\n }\n }\n return item;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"StackHeaderMenu.js","sourceRoot":"","sources":["../../../src/layouts/stack-utils/StackHeaderMenu.tsx"],"names":[],"mappings":";;;AAoMA,8FA6BC;AA2ID,0GA0BC;AAjYD,iCAAiD;AAKjD,qCAGkB;AAClB,iDAAoD;AACpD,mDAAqD;AAyGrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACU,QAAA,eAAe,GAAmC,iBAAI,CAAC;AAEpE,SAAgB,yCAAyC,CACvD,KAA2B;IAE3B,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,G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AC;AACd,CAAC;AA+CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACU,QAAA,qBAAqB,GAAyC,uBAAU,CAAC;AAEtF,SAAgB,+CAA+C,CAC7D,KAAiC;IAEjC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IACxE,MAAM,WAAW,GAAG,IAAA,0DAAiD,EAAC,KAAK,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAoC;QAC5C,GAAG,IAAI;QACP,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,WAAW,CAAC,KAAK;QACxB,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK;QAC1B,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC;KACrC,CAAC;IACF,IAAI,sBAAsB,KAAK,SAAS,EAAE,CAAC;QACzC,IAAI,CAAC,kBAAkB,GAAG,sBAAsB,CAAC;IACnD,CAAC;IACD,IAAI,WAAW,CAAC,IAAI,EAAE,CAAC;QACrB,gDAAgD;QAChD,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACzC,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC,IAAI,CAAC;QAC/B,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,IAAI,CACV,qIAAqI,CACtI,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type {\n NativeStackHeaderItemMenu,\n NativeStackHeaderItemMenuAction,\n NativeStackHeaderItemMenuSubmenu,\n} from '@react-navigation/native-stack';\nimport { Children, type ReactNode } from 'react';\nimport type { ImageSourcePropType } from 'react-native';\nimport type { HeaderBarButtonItemSubmenu } from 'react-native-screens';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport {\n convertStackHeaderSharedPropsToRNSharedHeaderItem,\n type StackHeaderItemSharedProps,\n} from './shared';\nimport { Menu, MenuAction } from '../../primitives';\nimport { isChildOfType } from '../../utils/children';\n\nexport interface StackHeaderMenuProps {\n accessibilityLabel?: string;\n accessibilityHint?: string;\n /**\n * There are two ways to specify the content of the menu header item - using props or child components:\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * ...\n * <Stack.Header.Menu icon=\"star.fill\" title=\"As props\">\n * <Stack.Header.MenuAction>Action 1</Stack.Header.MenuAction>\n * </Stack.Header.Menu>\n * ```\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * ...\n * <Stack.Header.Menu>\n * <Stack.Header.Icon sf=\"star.fill\" />\n * <Stack.Header.Label>As components</Stack.Header.Label>\n * <Stack.Header.Badge>3</Stack.Header.Badge>\n * <Stack.Header.MenuAction>Action 1</Stack.Header.MenuAction>\n * </Stack.Header.Menu>\n * ```\n *\n * **Note**: When icon is used, the label will not be shown and will be used for accessibility purposes only.\n */\n children?: ReactNode;\n /**\n * 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 disabled?: boolean;\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 hidden?: boolean;\n /**\n * Icon for the menu item.\n *\n * Can be an SF Symbol name or an image source.\n */\n icon?: StackHeaderItemSharedProps['icon'];\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 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 palette?: boolean;\n /**\n * Whether to separate the background of this item from other header items.\n *\n * @default false\n */\n separateBackground?: boolean;\n /**\n * Style for the label of the header item.\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 */\n tintColor?: StackHeaderItemSharedProps['tintColor'];\n /**\n * Optional title to show on top of the menu.\n */\n title?: string;\n /**\n * @default 'plain'\n */\n variant?: StackHeaderItemSharedProps['variant'];\n}\n\n/**\n * Component representing menu for `Stack.Header.Right` or `Stack.Header.Left`.\n *\n * Use as `Stack.Header.Menu` to provide top-level menus on iOS header bars.\n * It accepts `Stack.Header.MenuAction` and nested `Stack.Header.Menu`\n * elements. Menu can be configured using both component props and child\n * elements.\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n * import { Alert } from 'react-native';\n *\n * export default function Screen() {\n * return (\n * <>\n * <ScreenContent />\n * <Stack.Screen>\n * <Stack.Header>\n * <Stack.Header.Right>\n * <Stack.Header.Menu>\n * <Stack.Header.Label>Menu</Stack.Header.Label>\n * <Stack.Header.Icon sf=\"ellipsis.circle\" />\n * <Stack.Header.MenuAction onPress={() => Alert.alert('Action 1 pressed!')}>\n * Action 1\n * </Stack.Header.MenuAction>\n * <Stack.Header.MenuAction isOn icon=\"star.fill\">\n * Action 2\n * </Stack.Header.MenuAction>\n * <Stack.Header.Menu inline>\n * <Stack.Header.MenuAction isOn>Sub Action</Stack.Header.MenuAction>\n * </Stack.Header.Menu>\n * </Stack.Header.Menu>\n * </Stack.Header.Right>\n * </Stack.Header>\n * </Stack.Screen>\n * </>\n * );\n * }\n * ```\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n * import { Text } from 'react-native';\n *\n * export default function Screen() {\n * return (\n * <>\n * <ScreenContent />\n * <Stack.Screen>\n * <Stack.Header>\n * <Stack.Header.Left>\n * <Stack.Header.Menu>\n * <Stack.Header.MenuAction onPress={() => Alert.alert('Action 1 pressed!')}>\n * Action 1\n * </Stack.Header.MenuAction>\n * <Stack.Header.Menu inline palette title=\"Icons\">\n * <Stack.Header.MenuAction isOn icon=\"star.fill\" />\n * <Stack.Header.MenuAction icon=\"heart.fill\" />\n * </Stack.Header.Menu>\n * </Stack.Header.Menu>\n * </Stack.Header.Left>\n * </Stack.Header>\n * </Stack.Screen>\n * </>\n * );\n * }\n * ```\n *\n * @see [Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/menus) for more information about menus on iOS.\n *\n * @platform ios\n */\nexport const StackHeaderMenu: React.FC<StackHeaderMenuProps> = Menu;\n\nexport function convertStackHeaderMenuPropsToRNHeaderItem(\n props: StackHeaderMenuProps\n): NativeStackHeaderItemMenu | undefined {\n if (props.hidden) {\n return undefined;\n }\n const { title, ...rest } = props;\n const actions = Children.toArray(props.children).filter(\n (child) => isChildOfType(child, StackHeaderMenuAction) || isChildOfType(child, StackHeaderMenu)\n );\n const item: NativeStackHeaderItemMenu = {\n ...convertStackHeaderSharedPropsToRNSharedHeaderItem(rest),\n type: 'menu',\n menu: {\n items: actions\n .map((action) => {\n if (isChildOfType(action, StackHeaderMenu)) {\n return convertStackHeaderSubmenuMenuPropsToRNHeaderItem(action.props);\n }\n return convertStackHeaderMenuActionPropsToRNHeaderItem(action.props);\n })\n .filter((i) => !!i),\n },\n };\n if (title) {\n item.menu.title = title;\n }\n\n return item;\n}\n\nfunction convertStackHeaderSubmenuMenuPropsToRNHeaderItem(\n props: StackHeaderMenuProps\n): NativeStackHeaderItemMenuSubmenu | undefined {\n if (props.hidden) {\n return undefined;\n }\n // Removing children. Otherwise the buttons will be broken\n const sharedProps = convertStackHeaderSharedPropsToRNSharedHeaderItem(props);\n const actions = Children.toArray(props.children).filter(\n (child) => isChildOfType(child, StackHeaderMenuAction) || isChildOfType(child, StackHeaderMenu)\n );\n\n // TODO: Remove Pick<HeaderBarButtonItemSubmenu> when this PR is merged and released in react-navigation:\n // https://github.com/react-navigation/react-navigation/pull/12895\n const item: NativeStackHeaderItemMenuSubmenu &\n Pick<HeaderBarButtonItemSubmenu, 'displayAsPalette' | 'displayInline' | 'destructive'> = {\n type: 'submenu',\n items: actions\n .map((action) => {\n if (isChildOfType(action, StackHeaderMenu)) {\n return convertStackHeaderSubmenuMenuPropsToRNHeaderItem(action.props);\n }\n return convertStackHeaderMenuActionPropsToRNHeaderItem(action.props);\n })\n .filter((i) => !!i),\n label: sharedProps.label || props.title || '',\n };\n\n if (props.inline !== undefined) {\n item.displayInline = props.inline;\n }\n if (props.palette !== undefined) {\n item.displayAsPalette = props.palette;\n }\n if (props.destructive !== undefined) {\n item.destructive = props.destructive;\n }\n // TODO: Add elementSize to react-native-screens\n\n if (sharedProps.icon) {\n // Only SF Symbols are supported in submenu icons\n if (sharedProps.icon.type === 'sfSymbol') {\n item.icon = sharedProps.icon;\n } else {\n console.warn(\n 'When Icon is used inside Stack.Header.Menu used as a submenu, only sfSymbol icons are supported. This is a limitation of React Native Screens.'\n );\n }\n }\n\n return item;\n}\n\nexport interface StackHeaderMenuActionProps {\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 icon?: SFSymbol | ImageSourcePropType;\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 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 * If `true`, the menu item will be displayed as selected.\n */\n isOn?: boolean;\n onPress?: () => void;\n /**\n * An elaborated title that explains the purpose of the action.\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 subtitle?: string;\n hidden?: boolean;\n}\n\n/**\n * An action item for a `Stack.Header.Menu`.\n *\n * @example\n * ```tsx\n * import React from 'react';\n * import { Alert } from 'react-native';\n * import { Stack, Label, Icon } from 'expo-router';\n *\n * export default function ExampleScreen() {\n * return (\n * <>\n * <ScreenContent />\n * <Stack.Screen>\n * <Stack.Header>\n * <Stack.Header.Right>\n * <Stack.Header.Menu icon=\"ellipsis.circle\">\n * <Stack.Header.MenuAction onPress={() => Alert.alert('Action 1 pressed!')}>\n * Action 1\n * </Stack.Header.MenuAction>\n * <Stack.Header.MenuAction isOn onPress={() => Alert.alert('Action 2 pressed!')}>\n * <Label>Action 2</Label>\n * <Icon sf=\"star.fill\" />\n * </Stack.Header.MenuAction>\n * </Stack.Header.Menu>\n * </Stack.Header.Right>\n * </Stack.Header>\n * </Stack.Screen>\n * </>\n * );\n * }\n * ```\n *\n * @see [Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/menus) for more information about menus on iOS.\n *\n * @platform ios\n */\nexport const StackHeaderMenuAction: React.FC<StackHeaderMenuActionProps> = MenuAction;\n\nexport function convertStackHeaderMenuActionPropsToRNHeaderItem(\n props: StackHeaderMenuActionProps\n): NativeStackHeaderItemMenuAction {\n const { children, isOn, unstable_keepPresented, icon, ...rest } = props;\n const sharedProps = convertStackHeaderSharedPropsToRNSharedHeaderItem(props);\n const item: NativeStackHeaderItemMenuAction = {\n ...rest,\n type: 'action',\n label: sharedProps.label,\n state: isOn ? 'on' : 'off',\n onPress: props.onPress ?? (() => {}),\n };\n if (unstable_keepPresented !== undefined) {\n item.keepsMenuPresented = unstable_keepPresented;\n }\n if (sharedProps.icon) {\n // Only SF Symbols are supported in action icons\n if (sharedProps.icon.type === 'sfSymbol') {\n item.icon = sharedProps.icon;\n } else {\n console.warn(\n 'When Icon is used inside Stack.Header.Menu.Action, only sfSymbol icons are supported. This is a limitation of React Native Screens.'\n );\n }\n }\n return item;\n}\n"]}
|
package/build/link/elements.d.ts
CHANGED
|
@@ -74,13 +74,22 @@ export interface LinkMenuProps {
|
|
|
74
74
|
* The title of the menu item
|
|
75
75
|
*/
|
|
76
76
|
title?: string;
|
|
77
|
+
/**
|
|
78
|
+
* An optional subtitle for the submenu. Does not appear on `inline` menus.
|
|
79
|
+
*
|
|
80
|
+
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/subtitle) for more information.
|
|
81
|
+
*/
|
|
82
|
+
subtitle?: string;
|
|
77
83
|
/**
|
|
78
84
|
* Optional SF Symbol displayed alongside the menu item.
|
|
79
85
|
*/
|
|
80
86
|
icon?: SFSymbol;
|
|
81
87
|
/**
|
|
82
88
|
* If `true`, the menu will be displayed as a palette.
|
|
83
|
-
* This means that the menu will be displayed as one row
|
|
89
|
+
* This means that the menu will be displayed as one row.
|
|
90
|
+
* 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.
|
|
91
|
+
*
|
|
92
|
+
* > **Note**: Palette menus are only supported in submenus.
|
|
84
93
|
*
|
|
85
94
|
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette) for more information.
|
|
86
95
|
*/
|
|
@@ -106,6 +115,15 @@ export interface LinkMenuProps {
|
|
|
106
115
|
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/destructive) for more information.
|
|
107
116
|
*/
|
|
108
117
|
destructive?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* The preferred size of the menu elements.
|
|
120
|
+
* `elementSize` property is ignored when `palette` is used.
|
|
121
|
+
*
|
|
122
|
+
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/preferredelementsize) for more information.
|
|
123
|
+
*
|
|
124
|
+
* @platform iOS 16.0+
|
|
125
|
+
*/
|
|
126
|
+
elementSize?: 'small' | 'medium' | 'large' | 'auto';
|
|
109
127
|
children?: React.ReactNode;
|
|
110
128
|
}
|
|
111
129
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/link/elements.tsx"],"names":[],"mappings":"AAEA,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;AAWtD,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;IACH,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,4BA0BxD;AAED,MAAM,WAAW,aAAa;IAC5B;;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
97
|
const children = react_1.default.Children.toArray(props.children).filter((child) => (0, react_1.isValidElement)(child) && (child.type === LinkMenuAction || child.type === exports.LinkMenu));
|
|
98
98
|
const displayAsPalette = props.palette ?? props.displayAsPalette;
|
|
99
99
|
const displayInline = props.inline ?? props.displayInline;
|
|
100
|
-
return (<native_1.NativeLinkPreviewAction {...props} displayAsPalette={displayAsPalette} displayInline={displayInline} title={props.title ?? ''} onSelected={() => { }} children={children} identifier={identifier}/>);
|
|
100
|
+
return (<native_1.NativeLinkPreviewAction {...props} displayAsPalette={displayAsPalette} displayInline={displayInline} preferredElementSize={props.elementSize} title={props.title ?? ''} onSelected={() => { }} children={children} identifier={identifier}/>);
|
|
101
101
|
};
|
|
102
102
|
exports.LinkMenu = LinkMenu;
|
|
103
103
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/link/elements.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFb,wCA0BC;AA4ID,kCAwBC;AAkCD,kCAgBC;AAlUD,+CAAkG;AAIlG,6EAA0E;AAC1E,8CAA4C;AAC5C,uDAAoD;AACpD,uEAA6D;AAC7D,6CAAqF;AACrF,qCAAkC;AAClC,4DAAuD;AACvD,gDAAwD;AA+DxD;;;;;;;GAOG;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,CAAC,IAAA,WAAG,EAAC,uDAA0B,CAAC,EAAE,CAAC;QACxF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC5E,MAAM,iBAAiB,GAAG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AK,CAAC,EAAG,CAAC;IACpC,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,CAAC,+BAAa,CAAC,CAAC,OAAO,CAAC,EAAE,+BAAa,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["'use client';\n\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 { 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 * 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 * > **Note**: You can use the alias `Link.MenuAction` for this component.\n *\n * @platform ios\n */\nexport function LinkMenuAction(props: LinkMenuActionProps) {\n const identifier = useId();\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !use(InternalLinkPreviewContext)) {\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 return (\n <NativeLinkPreviewAction\n {...rest}\n identifier={identifier}\n icon={sf}\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 * Optional SF Symbol displayed alongside the menu item.\n */\n icon?: SFSymbol;\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 * @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 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 `LinkMenuAction` 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 * > **Note**: You can use the alias `Link.Menu` for this component.\n *\n * @platform ios\n */\nexport const LinkMenu: React.FC<LinkMenuProps> = (props) => {\n const identifier = useId();\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !use(InternalLinkPreviewContext)) {\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 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 * > **Note**: You can use the alias `Link.Preview` for this component.\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 * > **Note**: You can use the alias `Link.Trigger` for this component.\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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFb,wCA0BC;AA+JD,kCAwBC;AAkCD,kCAgBC;AArVD,+CAAkG;AAIlG,6EAA0E;AAC1E,8CAA4C;AAC5C,uDAAoD;AACpD,uEAA6D;AAC7D,6CAAqF;AACrF,qCAAkC;AAClC,4DAAuD;AACvD,gDAAwD;AA+DxD;;;;;;;GAOG;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,CAAC,IAAA,WAAG,EAAC,uDAA0B,CAAC,EAAE,CAAC;QACxF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC5E,MAAM,iBAAiB,GAAG,OAAO,QAAQ,KAAK,QAAQ,CAAC;IACvD,MAAM,KAAK,GAAG,iBAAiB;QAC7B,CAAC,CAAE,QAAmB;QACtB,CAAC,CAAC,IAAA,8BAAmB,EAAC,QAAQ,EAAE,kB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CAAC,EAAE,+BAAa,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["'use client';\n\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 { 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 * 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 * > **Note**: You can use the alias `Link.MenuAction` for this component.\n *\n * @platform ios\n */\nexport function LinkMenuAction(props: LinkMenuActionProps) {\n const identifier = useId();\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !use(InternalLinkPreviewContext)) {\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 return (\n <NativeLinkPreviewAction\n {...rest}\n identifier={identifier}\n icon={sf}\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 * 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 `LinkMenuAction` 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 * > **Note**: You can use the alias `Link.Menu` for this component.\n *\n * @platform ios\n */\nexport const LinkMenu: React.FC<LinkMenuProps> = (props) => {\n const identifier = useId();\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !use(InternalLinkPreviewContext)) {\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 * > **Note**: You can use the alias `Link.Preview` for this component.\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 * > **Note**: You can use the alias `Link.Trigger` for this component.\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"]}
|
|
@@ -14,6 +14,7 @@ export interface NativeLinkPreviewActionProps {
|
|
|
14
14
|
accessibilityHint?: string;
|
|
15
15
|
displayAsPalette?: boolean;
|
|
16
16
|
displayInline?: boolean;
|
|
17
|
+
preferredElementSize?: 'auto' | 'small' | 'medium' | 'large';
|
|
17
18
|
isOn?: boolean;
|
|
18
19
|
keepPresented?: boolean;
|
|
19
20
|
hidden?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/link/preview/native.tsx"],"names":[],"mappings":"AAGA,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,C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AA6B,sCAa5E;AASD,wBAAgB,uCAAuC,CAAC,KAAK,EAAE;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,sCAaA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../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;;AAkDb,0DAKC;AA4BD,8CAKC;AAYD,4DAaC;AASD,8DAcC;AAyBD,4DAaC;AASD,0FAgBC;AArMD,+BAAyC;AACzC,iCAAyD;AACzD,+CAAqF;AAIrF,MAAM,uBAAuB,GAC3B,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,IAAI,CAAC,uBAAQ,CAAC,IAAI,IAAI,MAAM,CAAC,aAAa,KAAK,IAAI,CAAC;AAqCnF,MAAM,2BAA2B,GAC/B,uBAAuB;IACrB,CAAC,CAAC,IAAA,wBAAiB,EAAC,6BAA6B,EAAE,6BAA6B,CAAC;IACjF,CAAC,CAAC,IAAI,CAAC;AACX,SAAgB,uBAAuB,CAAC,KAAmC;IACzE,IAAI,CAAC,2BAA2B,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,2BAA2B,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACpD,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,CAAC,qBAAqB,CAAC,IAAI,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AAO,CACL,CAAC,kCAAkC,CACjC,IAAI,KAAK,CAAC,CACV,mBAAmB,CACnB,WAAW,CAAC,CAAC,KAAK,CAAC,CACnB,mBAAmB,CAAC,CAAC,KAAK,CAAC,CAC3B,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAC/B,CACH,CAAC;AACJ,CAAC;AACD,aAAa;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,CAAC,6CAA6C,CAC5C,IAAI,KAAK,CAAC,CACV,mBAAmB,CACnB,WAAW,CAAC,CAAC,KAAK,CAAC,CACnB,mBAAmB,CAAC,CAAC,KAAK,CAAC,CAC3B,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAC/B,CACH,CAAC;AACJ,CAAC;AACD,aAAa","sourcesContent":["'use client';\n\nimport { requireNativeView } from 'expo';\nimport { Fragment, type PropsWithChildren } from 'react';\nimport { Platform, StyleSheet, type ViewProps, type ColorValue } from 'react-native';\n\nimport type { BasicTextStyle } from '../../utils/font';\n\nconst areNativeViewsAvailable =\n process.env.EXPO_OS === 'ios' && !Platform.isTV && global.RN$Bridgeless === true;\n\n// #region Action View\nexport interface NativeLinkPreviewActionProps {\n identifier: string;\n title: string;\n icon?: string;\n children?: React.ReactNode;\n disabled?: boolean;\n destructive?: boolean;\n 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<NativeLinkPreviewActionProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkPreviewNativeActionView')\n : null;\nexport function NativeLinkPreviewAction(props: NativeLinkPreviewActionProps) {\n if (!LinkPreviewNativeActionView) {\n return null;\n }\n return <LinkPreviewNativeActionView {...props} />;\n}\n// #endregion\n\n// #region Preview View\nexport interface TabPath {\n oldTabKey: string;\n newTabKey: string;\n}\nexport interface NativeLinkPreviewProps extends ViewProps {\n nextScreenId: string | undefined;\n tabPath:\n | {\n path: TabPath[];\n }\n | undefined;\n disableForceFlatten?: boolean;\n onWillPreviewOpen?: () => void;\n onDidPreviewOpen?: () => void;\n onPreviewWillClose?: () => void;\n onPreviewDidClose?: () => void;\n onPreviewTapped?: () => void;\n onPreviewTappedAnimationCompleted?: () => void;\n children: React.ReactNode;\n}\nconst NativeLinkPreviewView: React.ComponentType<NativeLinkPreviewProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'NativeLinkPreviewView')\n : null;\nexport function NativeLinkPreview(props: NativeLinkPreviewProps) {\n if (!NativeLinkPreviewView) {\n return null;\n }\n return <NativeLinkPreviewView {...props} />;\n}\n// #endregion\n\n// #region Preview Content View\nexport interface NativeLinkPreviewContentProps extends ViewProps {\n preferredContentSize?: { width: number; height: number };\n}\nconst NativeLinkPreviewContentView: React.ComponentType<NativeLinkPreviewContentProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'NativeLinkPreviewContentView')\n : null;\n\nexport function NativeLinkPreviewContent(props: NativeLinkPreviewContentProps) {\n if (!NativeLinkPreviewContentView) {\n return null;\n }\n const style = StyleSheet.flatten([\n props.style,\n {\n position: 'absolute',\n top: 0,\n left: 0,\n } as const,\n ]);\n return <NativeLinkPreviewContentView {...props} style={style} />;\n}\n// #endregion\n\n// #region Zoom transition enabler\nconst LinkZoomTransitionEnablerNativeView: React.ComponentType<\n ViewProps & { zoomTransitionSourceIdentifier: string; disableForceFlatten?: boolean }\n> | null = areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionEnabler')\n : null;\nexport function LinkZoomTransitionEnabler(props: {\n zoomTransitionSourceIdentifier: string;\n preventInteractiveDismissal?: boolean;\n}) {\n if (!LinkZoomTransitionEnablerNativeView) {\n return null;\n }\n return (\n <LinkZoomTransitionEnablerNativeView\n {...props}\n disableForceFlatten\n style={{ display: 'contents' }}\n />\n );\n}\n// #endregion\n\n// #region Zoom transition source\ninterface LinkSourceAlignmentRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\ninterface LinkZoomTransitionSourceProps extends PropsWithChildren {\n identifier: string;\n alignment?: LinkSourceAlignmentRect;\n animateAspectRatioChange?: boolean;\n}\n\ninterface LinkZoomTransitionSourceNativeProps extends ViewProps, LinkZoomTransitionSourceProps {\n disableForceFlatten?: boolean;\n}\n\nconst LinkZoomTransitionSourceNativeView: React.ComponentType<LinkZoomTransitionSourceNativeProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionSource')\n : null;\nexport function LinkZoomTransitionSource(props: LinkZoomTransitionSourceProps) {\n if (!LinkZoomTransitionSourceNativeView) {\n return null;\n }\n return (\n <LinkZoomTransitionSourceNativeView\n {...props}\n disableForceFlatten\n collapsable={false}\n collapsableChildren={false}\n style={{ display: 'contents' }}\n />\n );\n}\n// #endregion\n\n// #region Zoom transition rect detector\nconst LinkZoomTransitionAlignmentRectDetectorNative: React.ComponentType<\n ViewProps & { identifier: string; disableForceFlatten?: boolean; children?: React.ReactNode }\n> | null = areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionAlignmentRectDetector')\n : Fragment;\nexport function LinkZoomTransitionAlignmentRectDetector(props: {\n identifier: string;\n children: React.ReactNode;\n}) {\n if (!LinkZoomTransitionAlignmentRectDetectorNative) {\n return null;\n }\n return (\n <LinkZoomTransitionAlignmentRectDetectorNative\n {...props}\n disableForceFlatten\n collapsable={false}\n collapsableChildren={false}\n style={{ display: 'contents' }}\n />\n );\n}\n// #endregion\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ZoomTransitionEnablerProps } from './ZoomTransitionEnabler.types';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function disableZoomTransition(): void;
|
|
3
3
|
export declare function isZoomTransitionEnabled(): boolean;
|
|
4
4
|
export declare function ZoomTransitionEnabler(props: ZoomTransitionEnablerProps): null;
|
|
5
5
|
//# sourceMappingURL=ZoomTransitionEnabler.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoomTransitionEnabler.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAEhF,wBAAgB,
|
|
1
|
+
{"version":3,"file":"ZoomTransitionEnabler.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAEhF,wBAAgB,qBAAqB,SAAK;AAE1C,wBAAgB,uBAAuB,YAEtC;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,QAEtE"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ZoomTransitionEnablerProps } from './ZoomTransitionEnabler.types';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function disableZoomTransition(): void;
|
|
3
3
|
export declare function isZoomTransitionEnabled(): boolean;
|
|
4
4
|
export declare function ZoomTransitionEnabler({ route }: ZoomTransitionEnablerProps): import("react").JSX.Element | null;
|
|
5
5
|
//# sourceMappingURL=ZoomTransitionEnabler.ios.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoomTransitionEnabler.ios.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.ios.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAahF,wBAAgB,
|
|
1
|
+
{"version":3,"file":"ZoomTransitionEnabler.ios.d.ts","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.ios.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAahF,wBAAgB,qBAAqB,SAEpC;AAED,wBAAgB,uBAAuB,YAEtC;AAED,wBAAgB,qBAAqB,CAAC,EAAE,KAAK,EAAE,EAAE,0BAA0B,sCAmC1E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.disableZoomTransition = disableZoomTransition;
|
|
4
4
|
exports.isZoomTransitionEnabled = isZoomTransitionEnabled;
|
|
5
5
|
exports.ZoomTransitionEnabler = ZoomTransitionEnabler;
|
|
6
6
|
const react_1 = require("react");
|
|
@@ -8,12 +8,9 @@ const descriptors_context_1 = require("../../fork/native-stack/descriptors-conte
|
|
|
8
8
|
const navigationParams_1 = require("../../navigationParams");
|
|
9
9
|
const PreviewRouteContext_1 = require("../preview/PreviewRouteContext");
|
|
10
10
|
const native_1 = require("../preview/native");
|
|
11
|
-
let _isZoomTransitionEnabled =
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
console.warn('[expo-router] Zoom transition is an experimental feature. Use at your own risk.');
|
|
15
|
-
_isZoomTransitionEnabled = true;
|
|
16
|
-
}
|
|
11
|
+
let _isZoomTransitionEnabled = process.env.EXPO_OS === 'ios';
|
|
12
|
+
function disableZoomTransition() {
|
|
13
|
+
_isZoomTransitionEnabled = false;
|
|
17
14
|
}
|
|
18
15
|
function isZoomTransitionEnabled() {
|
|
19
16
|
return _isZoomTransitionEnabled;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoomTransitionEnabler.ios.js","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.ios.tsx"],"names":[],"mappings":";;AAeA,
|
|
1
|
+
{"version":3,"file":"ZoomTransitionEnabler.ios.js","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.ios.tsx"],"names":[],"mappings":";;AAeA,sDAEC;AAED,0DAEC;AAED,sDAmCC;AA1DD,iCAA4B;AAG5B,qFAAiF;AACjF,6DAKgC;AAChC,wEAA8D;AAC9D,8CAA8D;AAE9D,IAAI,wBAAwB,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,CAAC;AAE7D,SAAgB,qBAAqB;IACnC,wBAAwB,GAAG,KAAK,CAAC;AACnC,CAAC;AAED,SAAgB,uBAAuB;IACrC,OAAO,wBAAwB,CAAC;AAClC,CAAC;AAED,SAAgB,qBAAqB,CAAC,EAAE,KAAK,EAA8B;IACzE,MAAM,SAAS,GAAG,IAAA,kCAAY,GAAE,CAAC;IACjC,IACE,uBAAuB,EAAE;QACzB,CAAC,SAAS;QACV,KAAK;QACL,OAAO,KAAK,KAAK,QAAQ;QACzB,QAAQ,IAAI,KAAK;QACjB,OAAO,KAAK,CAAC,MAAM,KAAK,QAAQ;QAChC,KAAK,IAAI,KAAK;QACd,OAAO,KAAK,CAAC,GAAG,KAAK,QAAQ,EAC7B,CAAC;QACD,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,IAAI,EAAE,CAAC;QAClC,MAAM,cAAc,GAAG,IAAA,8CAA2B,EAAC,MAAM,CAAC,CAAC;QAC3D,MAAM,gBAAgB,GACpB,cAAc,CAAC,4EAAyD,CAAC,CAAC;QAC5E,MAAM,sBAAsB,GAC1B,cAAc,CAAC,4EAAyD,CAAC,CAAC;QAC5E,MAAM,uBAAuB,GAC3B,CAAC,CAAC,cAAc,CAAC,wEAAqD,CAAC,CAAC;QAC1E,MAAM,iBAAiB,GACrB,CAAC,CAAC,gBAAgB,IAAI,sBAAsB,KAAK,KAAK,CAAC,GAAG,IAAI,CAAC,uBAAuB,CAAC;QACzF,IAAI,iBAAiB,IAAI,OAAO,gBAAgB,KAAK,QAAQ,EAAE,CAAC;YAC9D,MAAM,cAAc,GAAG,IAAA,WAAG,EAAC,wCAAkB,CAAC,CAAC;YAC/C,MAAM,iBAAiB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YACpD,MAAM,2BAA2B,GAAG,iBAAiB,EAAE,OAAO,EAAE,cAAc,KAAK,KAAK,CAAC;YACzF,OAAO,CACL,CAAC,kCAAyB,CACxB,8BAA8B,CAAC,CAAC,gBAAgB,CAAC,CACjD,2BAA2B,CAAC,CAAC,2BAA2B,CAAC,EACzD,CACH,CAAC;QACJ,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import { use } from 'react';\n\nimport type { ZoomTransitionEnablerProps } from './ZoomTransitionEnabler.types';\nimport { DescriptorsContext } from '../../fork/native-stack/descriptors-context';\nimport {\n getInternalExpoRouterParams,\n INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME,\n INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME,\n} from '../../navigationParams';\nimport { useIsPreview } from '../preview/PreviewRouteContext';\nimport { LinkZoomTransitionEnabler } from '../preview/native';\n\nlet _isZoomTransitionEnabled = process.env.EXPO_OS === 'ios';\n\nexport function disableZoomTransition() {\n _isZoomTransitionEnabled = false;\n}\n\nexport function isZoomTransitionEnabled() {\n return _isZoomTransitionEnabled;\n}\n\nexport function ZoomTransitionEnabler({ route }: ZoomTransitionEnablerProps) {\n const isPreview = useIsPreview();\n if (\n isZoomTransitionEnabled() &&\n !isPreview &&\n route &&\n typeof route === 'object' &&\n 'params' in route &&\n typeof route.params === 'object' &&\n 'key' in route &&\n typeof route.key === 'string'\n ) {\n const params = route.params ?? {};\n const internalParams = getInternalExpoRouterParams(params);\n const zoomTransitionId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SOURCE_ID_PARAM_NAME];\n const zoomTransitionScreenId =\n internalParams[INTERNAL_EXPO_ROUTER_ZOOM_TRANSITION_SCREEN_ID_PARAM_NAME];\n const isLinkPreviewNavigation =\n !!internalParams[INTERNAL_EXPO_ROUTER_IS_PREVIEW_NAVIGATION_PARAM_NAME];\n const hasZoomTransition =\n !!zoomTransitionId && zoomTransitionScreenId === route.key && !isLinkPreviewNavigation;\n if (hasZoomTransition && typeof zoomTransitionId === 'string') {\n const descriptorsMap = use(DescriptorsContext);\n const currentDescriptor = descriptorsMap[route.key];\n const preventInteractiveDismissal = currentDescriptor?.options?.gestureEnabled === false;\n return (\n <LinkZoomTransitionEnabler\n zoomTransitionSourceIdentifier={zoomTransitionId}\n preventInteractiveDismissal={preventInteractiveDismissal}\n />\n );\n }\n }\n return null;\n}\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.disableZoomTransition = disableZoomTransition;
|
|
4
4
|
exports.isZoomTransitionEnabled = isZoomTransitionEnabled;
|
|
5
5
|
exports.ZoomTransitionEnabler = ZoomTransitionEnabler;
|
|
6
|
-
function
|
|
6
|
+
function disableZoomTransition() { }
|
|
7
7
|
function isZoomTransitionEnabled() {
|
|
8
8
|
return false;
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZoomTransitionEnabler.js","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.tsx"],"names":[],"mappings":";;AAEA,
|
|
1
|
+
{"version":3,"file":"ZoomTransitionEnabler.js","sourceRoot":"","sources":["../../../src/link/zoom/ZoomTransitionEnabler.tsx"],"names":[],"mappings":";;AAEA,sDAA0C;AAE1C,0DAEC;AAED,sDAEC;AARD,SAAgB,qBAAqB,KAAI,CAAC;AAE1C,SAAgB,uBAAuB;IACrC,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,qBAAqB,CAAC,KAAiC;IACrE,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["import type { ZoomTransitionEnablerProps } from './ZoomTransitionEnabler.types';\n\nexport function disableZoomTransition() {}\n\nexport function isZoomTransitionEnabled() {\n return false;\n}\n\nexport function ZoomTransitionEnabler(props: ZoomTransitionEnablerProps) {\n return null;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeTabsView.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabsView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"NativeTabsView.d.ts","sourceRoot":"","sources":["../../src/native-tabs/NativeTabsView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAiBzD,OAAO,EAIL,KAAK,mBAAmB,EACzB,MAAM,SAAS,CAAC;AAajB,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,qBAyHxD"}
|
|
@@ -40,6 +40,7 @@ const react_native_1 = require("react-native");
|
|
|
40
40
|
const react_native_screens_1 = require("react-native-screens");
|
|
41
41
|
const experimental_1 = require("react-native-screens/experimental");
|
|
42
42
|
const appearance_1 = require("./appearance");
|
|
43
|
+
const color_1 = require("../color");
|
|
43
44
|
const elements_1 = require("./common/elements");
|
|
44
45
|
const types_1 = require("./types");
|
|
45
46
|
const icon_1 = require("./utils/icon");
|
|
@@ -73,11 +74,29 @@ function NativeTabsView(props) {
|
|
|
73
74
|
: sidebarAdaptable === false
|
|
74
75
|
? 'tabBar'
|
|
75
76
|
: 'automatic';
|
|
77
|
+
// Material Design 3 dynamic color defaults for Android
|
|
78
|
+
const androidMaterialDefaults = process.env.EXPO_OS === 'android'
|
|
79
|
+
? {
|
|
80
|
+
inactiveColor: color_1.Color.android.dynamic.onSurfaceVariant,
|
|
81
|
+
activeIconColor: color_1.Color.android.dynamic.onSecondaryContainer,
|
|
82
|
+
activeLabelColor: color_1.Color.android.dynamic.onSurface,
|
|
83
|
+
backgroundColor: color_1.Color.android.dynamic.surfaceContainer,
|
|
84
|
+
rippleColor: color_1.Color.android.dynamic.primary,
|
|
85
|
+
indicatorColor: color_1.Color.android.dynamic.secondaryContainer,
|
|
86
|
+
}
|
|
87
|
+
: undefined;
|
|
76
88
|
return (<BottomTabsWrapper
|
|
77
89
|
// #region android props
|
|
78
|
-
tabBarItemTitleFontColor={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontColor
|
|
90
|
+
tabBarItemTitleFontColor={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontColor ??
|
|
91
|
+
androidMaterialDefaults?.inactiveColor} tabBarItemTitleFontFamily={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontFamily} tabBarItemTitleFontSize={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontSize} tabBarItemTitleFontSizeActive={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontSize} tabBarItemTitleFontWeight={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontWeight} tabBarItemTitleFontStyle={currentTabAppearance?.stacked?.normal?.tabBarItemTitleFontStyle} tabBarItemIconColor={currentTabAppearance?.stacked?.normal?.tabBarItemIconColor ??
|
|
92
|
+
androidMaterialDefaults?.inactiveColor} tabBarBackgroundColor={currentTabAppearance?.tabBarBackgroundColor ?? androidMaterialDefaults?.backgroundColor} tabBarItemRippleColor={props.rippleColor ?? androidMaterialDefaults?.rippleColor} tabBarItemLabelVisibilityMode={props.labelVisibilityMode} tabBarItemIconColorActive={currentTabAppearance?.stacked?.selected?.tabBarItemIconColor ??
|
|
93
|
+
props?.tintColor ??
|
|
94
|
+
androidMaterialDefaults?.activeIconColor} tabBarItemTitleFontColorActive={currentTabAppearance?.stacked?.selected?.tabBarItemTitleFontColor ??
|
|
95
|
+
props?.tintColor ??
|
|
96
|
+
androidMaterialDefaults?.activeLabelColor}
|
|
79
97
|
// tabBarItemTitleFontSizeActive={activeStyle?.fontSize}
|
|
80
|
-
tabBarItemActiveIndicatorColor={options[inBoundsDeferredFocusedIndex]?.indicatorColor
|
|
98
|
+
tabBarItemActiveIndicatorColor={options[inBoundsDeferredFocusedIndex]?.indicatorColor ??
|
|
99
|
+
androidMaterialDefaults?.indicatorColor} tabBarItemActiveIndicatorEnabled={!disableIndicator}
|
|
81
100
|
// #endregion
|
|
82
101
|
// #region iOS props
|
|
83
102
|
tabBarTintColor={props?.tintColor} tabBarMinimizeBehavior={minimizeBehavior} tabBarControllerMode={tabBarControllerMode} bottomAccessory={bottomAccessoryFn} tabBarHidden={props.hidden}
|