expo-router 55.0.6 → 55.0.8
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/layouts/stack-utils/toolbar/StackToolbarButton/index.d.ts +44 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/index.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/{StackToolbarButton.js → StackToolbarButton/index.js} +7 -18
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/index.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.d.ts +3 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.ios.d.ts +7 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.ios.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.ios.js +18 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.ios.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.js +6 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/native.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/{StackToolbarButton.d.ts → StackToolbarButton/types.d.ts} +25 -45
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/types.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/types.js +3 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton/types.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/index.d.ts +64 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/index.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/{StackToolbarMenu.js → StackToolbarMenu/index.js} +10 -31
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/index.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.d.ts +4 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.ios.d.ts +12 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.ios.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.ios.js +26 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.ios.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.js +8 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/native.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/{StackToolbarMenu.d.ts → StackToolbarMenu/types.d.ts} +32 -65
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/types.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/types.js +3 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu/types.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot/index.d.ts +30 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot/index.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/{StackToolbarSearchBarSlot.js → StackToolbarSearchBarSlot/index.js} +4 -21
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot/index.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot/native.d.ts +3 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot/native.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot/native.ios.d.ts +7 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot/native.ios.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot/native.ios.js +23 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot/native.ios.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot/native.js +6 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot/native.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/{StackToolbarSearchBarSlot.d.ts → StackToolbarSearchBarSlot/types.d.ts} +6 -28
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot/types.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot/types.js +3 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot/types.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/{StackToolbarSpacer.d.ts → StackToolbarSpacer/index.d.ts} +3 -25
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer/index.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/{StackToolbarSpacer.js → StackToolbarSpacer/index.js} +4 -14
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer/index.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer/native.d.ts +3 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer/native.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer/native.ios.d.ts +7 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer/native.ios.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer/native.ios.js +16 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer/native.ios.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer/native.js +6 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer/native.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer/types.d.ts +31 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer/types.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer/types.js +3 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer/types.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/{StackToolbarView.d.ts → StackToolbarView/index.d.ts} +3 -29
- package/build/layouts/stack-utils/toolbar/StackToolbarView/index.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/{StackToolbarView.js → StackToolbarView/index.js} +4 -16
- package/build/layouts/stack-utils/toolbar/StackToolbarView/index.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarView/native.d.ts +3 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarView/native.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarView/native.ios.d.ts +7 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarView/native.ios.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarView/native.ios.js +18 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarView/native.ios.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarView/native.js +6 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarView/native.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarView/types.d.ts +37 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarView/types.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarView/types.js +3 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarView/types.js.map +1 -0
- package/expo-module.config.json +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.6/expo.modules.router-55.0.6.module → 55.0.8/expo.modules.router-55.0.8.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.8/expo.modules.router-55.0.8.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.8/expo.modules.router-55.0.8.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.8/expo.modules.router-55.0.8.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.8/expo.modules.router-55.0.8.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.6/expo.modules.router-55.0.6.pom → 55.0.8/expo.modules.router-55.0.8.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.8/expo.modules.router-55.0.8.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.8/expo.modules.router-55.0.8.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.8/expo.modules.router-55.0.8.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.8/expo.modules.router-55.0.8.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 +7 -7
- package/build/layouts/stack-utils/toolbar/StackToolbarButton.d.ts.map +0 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarButton.js.map +0 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu.d.ts.map +0 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu.js.map +0 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot.d.ts.map +0 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot.js.map +0 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer.d.ts.map +0 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer.js.map +0 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarView.d.ts.map +0 -1
- package/build/layouts/stack-utils/toolbar/StackToolbarView.js.map +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.6/expo.modules.router-55.0.6.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.6/expo.modules.router-55.0.6.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.6/expo.modules.router-55.0.6.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.6/expo.modules.router-55.0.6.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.6/expo.modules.router-55.0.6.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.6/expo.modules.router-55.0.6.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.6/expo.modules.router-55.0.6.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/55.0.6/expo.modules.router-55.0.6.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.6/expo.modules.router-55.0.6-sources.jar → 55.0.8/expo.modules.router-55.0.8-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.6/expo.modules.router-55.0.6-sources.jar.md5 → 55.0.8/expo.modules.router-55.0.8-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.6/expo.modules.router-55.0.6-sources.jar.sha1 → 55.0.8/expo.modules.router-55.0.8-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.6/expo.modules.router-55.0.6-sources.jar.sha256 → 55.0.8/expo.modules.router-55.0.8-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.6/expo.modules.router-55.0.6-sources.jar.sha512 → 55.0.8/expo.modules.router-55.0.8-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.6/expo.modules.router-55.0.6.aar → 55.0.8/expo.modules.router-55.0.8.aar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.6/expo.modules.router-55.0.6.aar.md5 → 55.0.8/expo.modules.router-55.0.8.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.6/expo.modules.router-55.0.6.aar.sha1 → 55.0.8/expo.modules.router-55.0.8.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.6/expo.modules.router-55.0.6.aar.sha256 → 55.0.8/expo.modules.router-55.0.8.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{55.0.6/expo.modules.router-55.0.6.aar.sha512 → 55.0.8/expo.modules.router-55.0.8.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 = '55.0.
|
|
7
|
+
version = '55.0.8'
|
|
8
8
|
|
|
9
9
|
android {
|
|
10
10
|
namespace "expo.modules.router"
|
|
11
11
|
defaultConfig {
|
|
12
12
|
versionCode 1
|
|
13
|
-
versionName "55.0.
|
|
13
|
+
versionName "55.0.8"
|
|
14
14
|
}
|
|
15
15
|
lintOptions {
|
|
16
16
|
abortOnError false
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { NativeStackHeaderItemButton } from '@react-navigation/native-stack';
|
|
2
|
+
import type { StackToolbarButtonProps } from './types';
|
|
3
|
+
export type { StackToolbarButtonProps, NativeToolbarButtonProps } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* A button used inside `Stack.Toolbar`.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { Stack } from 'expo-router';
|
|
10
|
+
*
|
|
11
|
+
* export default function Layout() {
|
|
12
|
+
* return (
|
|
13
|
+
* <Stack>
|
|
14
|
+
* <Stack.Screen name="index">
|
|
15
|
+
* <Stack.Toolbar placement="left">
|
|
16
|
+
* <Stack.Toolbar.Button icon="arrow.left.circle" onPress={() => alert('Left pressed')} />
|
|
17
|
+
* </Stack.Toolbar>
|
|
18
|
+
* </Stack.Screen>
|
|
19
|
+
* </Stack>
|
|
20
|
+
* );
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* import { Stack } from 'expo-router';
|
|
27
|
+
*
|
|
28
|
+
* export default function Page() {
|
|
29
|
+
* return (
|
|
30
|
+
* <>
|
|
31
|
+
* <Stack.Toolbar placement="left">
|
|
32
|
+
* <Stack.Toolbar.Button icon="arrow.left.circle" onPress={() => alert('Left pressed')} />
|
|
33
|
+
* </Stack.Toolbar>
|
|
34
|
+
* <ScreenContent />
|
|
35
|
+
* </>
|
|
36
|
+
* );
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @platform ios
|
|
41
|
+
*/
|
|
42
|
+
export declare const StackToolbarButton: React.FC<StackToolbarButtonProps>;
|
|
43
|
+
export declare function convertStackToolbarButtonPropsToRNHeaderItem(props: StackToolbarButtonProps): NativeStackHeaderItemButton | undefined;
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAIlF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAUvD,YAAY,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEjF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CA+ChE,CAAC;AAEF,wBAAgB,4CAA4C,CAC1D,KAAK,EAAE,uBAAuB,GAC7B,2BAA2B,GAAG,SAAS,CAWzC"}
|
package/build/layouts/stack-utils/toolbar/{StackToolbarButton.js → StackToolbarButton/index.js}
RENAMED
|
@@ -4,12 +4,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.StackToolbarButton = void 0;
|
|
5
5
|
exports.convertStackToolbarButtonPropsToRNHeaderItem = convertStackToolbarButtonPropsToRNHeaderItem;
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const children_1 = require("../../../utils/children");
|
|
7
|
+
const native_1 = require("./native");
|
|
8
|
+
const children_1 = require("../../../../utils/children");
|
|
9
|
+
const context_1 = require("../context");
|
|
10
|
+
const shared_1 = require("../shared");
|
|
11
|
+
const toolbar_primitives_1 = require("../toolbar-primitives");
|
|
13
12
|
/**
|
|
14
13
|
* A button used inside `Stack.Toolbar`.
|
|
15
14
|
*
|
|
@@ -74,7 +73,7 @@ const StackToolbarButton = (props) => {
|
|
|
74
73
|
const icon = sharedProps?.icon?.type === 'sfSymbol' ? sharedProps.icon.name : undefined;
|
|
75
74
|
const xcassetName = (0, shared_1.extractXcassetName)(props);
|
|
76
75
|
const imageRenderingMode = (0, shared_1.extractIconRenderingMode)(props) ?? props.iconRenderingMode;
|
|
77
|
-
return (<NativeToolbarButton {...sharedProps} icon={icon} xcassetName={xcassetName} image={props.image} imageRenderingMode={imageRenderingMode}/>);
|
|
76
|
+
return (<native_1.NativeToolbarButton {...sharedProps} icon={icon} xcassetName={xcassetName} image={props.image} imageRenderingMode={imageRenderingMode}/>);
|
|
78
77
|
};
|
|
79
78
|
exports.StackToolbarButton = StackToolbarButton;
|
|
80
79
|
function convertStackToolbarButtonPropsToRNHeaderItem(props) {
|
|
@@ -89,14 +88,4 @@ function convertStackToolbarButtonPropsToRNHeaderItem(props) {
|
|
|
89
88
|
};
|
|
90
89
|
}
|
|
91
90
|
const ALLOWED_CHILDREN = [toolbar_primitives_1.StackToolbarLabel, toolbar_primitives_1.StackToolbarIcon, toolbar_primitives_1.StackToolbarBadge];
|
|
92
|
-
|
|
93
|
-
* Native toolbar button component for bottom toolbar.
|
|
94
|
-
* Renders as RouterToolbarItem.
|
|
95
|
-
*/
|
|
96
|
-
const NativeToolbarButton = (props) => {
|
|
97
|
-
const id = (0, react_1.useId)();
|
|
98
|
-
const renderingMode = props.imageRenderingMode ?? (props.tintColor !== undefined ? 'template' : 'original');
|
|
99
|
-
return (<native_1.RouterToolbarItem accessibilityHint={props.accessibilityHint} accessibilityLabel={props.accessibilityLabel} barButtonItemStyle={props.variant === 'done' ? 'prominent' : props.variant} disabled={props.disabled} hidden={props.hidden} hidesSharedBackground={props.hidesSharedBackground} identifier={id} image={props.image} imageRenderingMode={renderingMode} onSelected={props.onPress} possibleTitles={props.possibleTitles} selected={props.selected} sharesBackground={!props.separateBackground} systemImageName={props.icon} xcassetName={props.xcassetName} title={props.label} tintColor={props.tintColor} titleStyle={react_native_1.StyleSheet.flatten(props.style)}/>);
|
|
100
|
-
};
|
|
101
|
-
// #endregion
|
|
102
|
-
//# sourceMappingURL=StackToolbarButton.js.map
|
|
91
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/index.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAwGb,oGAaC;AAnHD,iCAA0C;AAE1C,qCAA+C;AAE/C,yDAAgG;AAChG,wCAAiD;AACjD,sCAImB;AACnB,8DAA+F;AAI/F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACI,MAAM,kBAAkB,GAAsC,CAAC,KAAK,EAAE,EAAE;IAC7E,MAAM,SAAS,GAAG,IAAA,6BAAmB,GAAE,CAAC;IAExC,MAAM,aAAa,GAAG,IAAA,eAAO,EAC3B,GAAG,EAAE,CAAC,IAAA,wCAA6B,EAAC,KAAK,CAAC,QAAQ,EAAE,gBAAgB,CAAC,EACrE,CAAC,KAAK,CAAC,QAAQ,CAA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,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,WAAW,CAAC,CAAC,WAAW,CAAC,CACzB,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CACnB,kBAAkB,CAAC,CAAC,kBAAkB,CAAC,EACvC,CACH,CAAC;AACJ,CAAC,CAAC;AA/CW,QAAA,kBAAkB,sBA+C7B;AAEF,SAAgB,4CAA4C,CAC1D,KAA8B;IAE9B,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,GAAG,IAAA,0DAAiD,EAAC,KAAK,CAAC;QAC3D,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,KAAK,CAAC,OAAO,IAAI,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC;QACpC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ;KAC3B,CAAC;AACJ,CAAC;AAED,MAAM,gBAAgB,GAAG,CAAC,sCAAiB,EAAE,qCAAgB,EAAE,sCAAiB,CAAC,CAAC","sourcesContent":["'use client';\nimport type { NativeStackHeaderItemButton } from '@react-navigation/native-stack';\nimport { Children, useMemo } from 'react';\n\nimport { NativeToolbarButton } from './native';\nimport type { StackToolbarButtonProps } from './types';\nimport { filterAllowedChildrenElements, getFirstChildOfType } from '../../../../utils/children';\nimport { useToolbarPlacement } from '../context';\nimport {\n convertStackHeaderSharedPropsToRNSharedHeaderItem,\n extractIconRenderingMode,\n extractXcassetName,\n} from '../shared';\nimport { StackToolbarLabel, StackToolbarIcon, StackToolbarBadge } from '../toolbar-primitives';\n\nexport type { StackToolbarButtonProps, NativeToolbarButtonProps } from './types';\n\n/**\n * A button used inside `Stack.Toolbar`.\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Layout() {\n * return (\n * <Stack>\n * <Stack.Screen name=\"index\">\n * <Stack.Toolbar placement=\"left\">\n * <Stack.Toolbar.Button icon=\"arrow.left.circle\" onPress={() => alert('Left pressed')} />\n * </Stack.Toolbar>\n * </Stack.Screen>\n * </Stack>\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 icon=\"arrow.left.circle\" onPress={() => alert('Left pressed')} />\n * </Stack.Toolbar>\n * <ScreenContent />\n * </>\n * );\n * }\n * ```\n *\n * @platform ios\n */\nexport const StackToolbarButton: React.FC<StackToolbarButtonProps> = (props) => {\n const placement = useToolbarPlacement();\n\n const validChildren = useMemo(\n () => filterAllowedChildrenElements(props.children, ALLOWED_CHILDREN),\n [props.children]\n );\n\n if (process.env.NODE_ENV !== 'production') {\n // Skip validation for string children\n if (typeof props.children !== 'string') {\n const allChildren = Children.toArray(props.children);\n if (allChildren.length !== validChildren.length) {\n throw new Error(\n `Stack.Toolbar.Button only accepts a single string or Stack.Toolbar.Label, Stack.Toolbar.Icon, and Stack.Toolbar.Badge as its children.`\n );\n }\n }\n }\n\n if (process.env.NODE_ENV !== 'production' && placement === 'bottom') {\n const hasBadge = getFirstChildOfType(props.children, StackToolbarBadge);\n if (hasBadge) {\n console.warn(\n 'Stack.Toolbar.Badge is not supported in bottom toolbar (iOS limitation). The badge will be ignored.'\n );\n }\n }\n\n if (placement !== 'bottom') {\n throw new Error('Stack.Toolbar.Button must be used inside a Stack.Toolbar');\n }\n\n const sharedProps = convertStackHeaderSharedPropsToRNSharedHeaderItem(props, true);\n // TODO(@ubax): Handle image loading using useImage in a follow-up PR.\n const icon = sharedProps?.icon?.type === 'sfSymbol' ? sharedProps.icon.name : undefined;\n const xcassetName = extractXcassetName(props);\n const imageRenderingMode = extractIconRenderingMode(props) ?? props.iconRenderingMode;\n return (\n <NativeToolbarButton\n {...sharedProps}\n icon={icon}\n xcassetName={xcassetName}\n image={props.image}\n imageRenderingMode={imageRenderingMode}\n />\n );\n};\n\nexport function convertStackToolbarButtonPropsToRNHeaderItem(\n props: StackToolbarButtonProps\n): NativeStackHeaderItemButton | undefined {\n if (props.hidden) {\n return undefined;\n }\n\n return {\n ...convertStackHeaderSharedPropsToRNSharedHeaderItem(props),\n type: 'button',\n onPress: props.onPress ?? (() => {}),\n selected: !!props.selected,\n };\n}\n\nconst ALLOWED_CHILDREN = [StackToolbarLabel, StackToolbarIcon, StackToolbarBadge];\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAExD,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAAc,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { NativeToolbarButtonProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Native toolbar button component for bottom toolbar.
|
|
4
|
+
* Renders as RouterToolbarItem.
|
|
5
|
+
*/
|
|
6
|
+
export declare const NativeToolbarButton: React.FC<NativeToolbarButtonProps>;
|
|
7
|
+
//# sourceMappingURL=native.ios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.ios.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/native.ios.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAGxD;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA0BlE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.NativeToolbarButton = void 0;
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_native_1 = require("react-native");
|
|
7
|
+
const native_1 = require("../../../../toolbar/native");
|
|
8
|
+
/**
|
|
9
|
+
* Native toolbar button component for bottom toolbar.
|
|
10
|
+
* Renders as RouterToolbarItem.
|
|
11
|
+
*/
|
|
12
|
+
const NativeToolbarButton = (props) => {
|
|
13
|
+
const id = (0, react_1.useId)();
|
|
14
|
+
const renderingMode = props.imageRenderingMode ?? (props.tintColor !== undefined ? 'template' : 'original');
|
|
15
|
+
return (<native_1.RouterToolbarItem accessibilityHint={props.accessibilityHint} accessibilityLabel={props.accessibilityLabel} barButtonItemStyle={props.variant === 'done' ? 'prominent' : props.variant} disabled={props.disabled} hidden={props.hidden} hidesSharedBackground={props.hidesSharedBackground} identifier={id} image={props.image} imageRenderingMode={renderingMode} onSelected={props.onPress} possibleTitles={props.possibleTitles} selected={props.selected} sharesBackground={!props.separateBackground} systemImageName={props.icon} xcassetName={props.xcassetName} title={props.label} tintColor={props.tintColor} titleStyle={react_native_1.StyleSheet.flatten(props.style)}/>);
|
|
16
|
+
};
|
|
17
|
+
exports.NativeToolbarButton = NativeToolbarButton;
|
|
18
|
+
//# sourceMappingURL=native.ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.ios.js","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/native.ios.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AACb,iCAA8B;AAC9B,+CAA0C;AAG1C,uDAA+D;AAE/D;;;GAGG;AACI,MAAM,mBAAmB,GAAuC,CAAC,KAAK,EAAE,EAAE;IAC/E,MAAM,EAAE,GAAG,IAAA,aAAK,GAAE,CAAC;IACnB,MAAM,aAAa,GACjB,KAAK,CAAC,kBAAkB,IAAI,CAAC,KAAK,CAAC,SAAS,KAAK,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IACxF,OAAO,CACL,CAAC,0BAAiB,CAChB,iBAAiB,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAC3C,kBAAkB,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAC7C,kBAAkB,CAAC,CAAC,KAAK,CAAC,OAAO,KAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAC3E,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CACzB,MAAM,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CACrB,qBAAqB,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CACnD,UAAU,CAAC,CAAC,EAAE,CAAC,CACf,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CACnB,kBAAkB,CAAC,CAAC,aAAa,CAAC,CAClC,UAAU,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAC1B,cAAc,CAAC,CAAC,KAAK,CAAC,cAAc,CAAC,CACrC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,CACzB,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAC5C,eAAe,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAC5B,WAAW,CAAC,CAAC,KAAK,CAAC,WAAW,CAAC,CAC/B,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CACnB,SAAS,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAC3B,UAAU,CAAC,CAAC,yBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAC5C,CACH,CAAC;AACJ,CAAC,CAAC;AA1BW,QAAA,mBAAmB,uBA0B9B","sourcesContent":["'use client';\nimport { useId } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport type { NativeToolbarButtonProps } from './types';\nimport { RouterToolbarItem } from '../../../../toolbar/native';\n\n/**\n * Native toolbar button component for bottom toolbar.\n * Renders as RouterToolbarItem.\n */\nexport const NativeToolbarButton: React.FC<NativeToolbarButtonProps> = (props) => {\n const id = useId();\n const renderingMode =\n props.imageRenderingMode ?? (props.tintColor !== undefined ? 'template' : 'original');\n return (\n <RouterToolbarItem\n accessibilityHint={props.accessibilityHint}\n accessibilityLabel={props.accessibilityLabel}\n barButtonItemStyle={props.variant === 'done' ? 'prominent' : props.variant}\n disabled={props.disabled}\n hidden={props.hidden}\n hidesSharedBackground={props.hidesSharedBackground}\n identifier={id}\n image={props.image}\n imageRenderingMode={renderingMode}\n onSelected={props.onPress}\n possibleTitles={props.possibleTitles}\n selected={props.selected}\n sharesBackground={!props.separateBackground}\n systemImageName={props.icon}\n xcassetName={props.xcassetName}\n title={props.label}\n tintColor={props.tintColor}\n titleStyle={StyleSheet.flatten(props.style)}\n />\n );\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/native.tsx"],"names":[],"mappings":";;;AAEO,MAAM,mBAAmB,GAAuC,GAAG,EAAE,CAAC,IAAI,CAAC;AAArE,QAAA,mBAAmB,uBAAkD","sourcesContent":["import type { NativeToolbarButtonProps } from './types';\n\nexport const NativeToolbarButton: React.FC<NativeToolbarButtonProps> = () => null;\n"]}
|
package/build/layouts/stack-utils/toolbar/{StackToolbarButton.d.ts → StackToolbarButton/types.d.ts}
RENAMED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { NativeStackHeaderItemButton } from '@react-navigation/native-stack';
|
|
2
1
|
import type { ImageRef } from 'expo-image';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { ColorValue, StyleProp, TextStyle } from 'react-native';
|
|
4
|
+
import type { SFSymbol } from 'sf-symbols-typescript';
|
|
5
|
+
import type { BasicTextStyle } from '../../../../utils/font';
|
|
6
|
+
import type { StackHeaderItemSharedProps } from '../shared';
|
|
6
7
|
export interface StackToolbarButtonProps {
|
|
7
8
|
accessibilityLabel?: string;
|
|
8
9
|
accessibilityHint?: string;
|
|
@@ -120,44 +121,23 @@ export interface StackToolbarButtonProps {
|
|
|
120
121
|
*/
|
|
121
122
|
variant?: StackHeaderItemSharedProps['variant'];
|
|
122
123
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
* @example
|
|
144
|
-
* ```tsx
|
|
145
|
-
* import { Stack } from 'expo-router';
|
|
146
|
-
*
|
|
147
|
-
* export default function Page() {
|
|
148
|
-
* return (
|
|
149
|
-
* <>
|
|
150
|
-
* <Stack.Toolbar placement="left">
|
|
151
|
-
* <Stack.Toolbar.Button icon="arrow.left.circle" onPress={() => alert('Left pressed')} />
|
|
152
|
-
* </Stack.Toolbar>
|
|
153
|
-
* <ScreenContent />
|
|
154
|
-
* </>
|
|
155
|
-
* );
|
|
156
|
-
* }
|
|
157
|
-
* ```
|
|
158
|
-
*
|
|
159
|
-
* @platform ios
|
|
160
|
-
*/
|
|
161
|
-
export declare const StackToolbarButton: React.FC<StackToolbarButtonProps>;
|
|
162
|
-
export declare function convertStackToolbarButtonPropsToRNHeaderItem(props: StackToolbarButtonProps): NativeStackHeaderItemButton | undefined;
|
|
163
|
-
//# sourceMappingURL=StackToolbarButton.d.ts.map
|
|
124
|
+
export interface NativeToolbarButtonProps {
|
|
125
|
+
accessibilityLabel?: string;
|
|
126
|
+
accessibilityHint?: string;
|
|
127
|
+
disabled?: boolean;
|
|
128
|
+
hidden?: boolean;
|
|
129
|
+
hidesSharedBackground?: boolean;
|
|
130
|
+
icon?: SFSymbol;
|
|
131
|
+
xcassetName?: string;
|
|
132
|
+
image?: ImageRef;
|
|
133
|
+
imageRenderingMode?: 'template' | 'original';
|
|
134
|
+
onPress?: () => void;
|
|
135
|
+
possibleTitles?: string[];
|
|
136
|
+
selected?: boolean;
|
|
137
|
+
separateBackground?: boolean;
|
|
138
|
+
style?: StyleProp<BasicTextStyle>;
|
|
139
|
+
tintColor?: ColorValue;
|
|
140
|
+
variant?: 'plain' | 'done' | 'prominent';
|
|
141
|
+
label?: string;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAC;AAE5D,MAAM,WAAW,uBAAuB;IACtC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,0BAA0B,CAAC,MAAM,CAAC,CAAC;IAE1C;;;;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 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarButton/types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ImageRef } from 'expo-image';\nimport type { ReactNode } from 'react';\nimport type { ColorValue, 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 accessibilityLabel?: string;\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 disabled?: boolean;\n /**\n * Whether the button should be hidden.\n *\n * @default false\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 * Can be a string representing an SFSymbol or an image source.\n *\n * > **Note**: When used in `placement=\"bottom\"`, only string SFSymbols are supported. Use the `image` prop to provide custom images.\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 image?: ImageRef;\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 (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 onPress?: () => void;\n /**\n * Whether to separate the background of this item from other header items.\n *\n * @default false\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 selected?: boolean;\n /**\n * Style for the label of the header item.\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 */\n tintColor?: StackHeaderItemSharedProps['tintColor'];\n /**\n * @default 'plain'\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?: ImageRef;\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}\n"]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { NativeStackHeaderItemMenu, NativeStackHeaderItemMenuAction } from '@react-navigation/native-stack';
|
|
2
|
+
import type { StackToolbarMenuProps, StackToolbarMenuActionProps } from './types';
|
|
3
|
+
export type { StackToolbarMenuProps, NativeToolbarMenuProps, StackToolbarMenuActionProps, NativeToolbarMenuActionProps, } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Use as `Stack.Toolbar.Menu` to provide menus in iOS toolbar.
|
|
6
|
+
* It accepts `Stack.Toolbar.MenuAction` and nested `Stack.Toolbar.Menu`
|
|
7
|
+
* elements. Menu can be configured using both component props and child
|
|
8
|
+
* elements.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { Stack } from 'expo-router';
|
|
13
|
+
* import { Alert } from 'react-native';
|
|
14
|
+
*
|
|
15
|
+
* export default function Page() {
|
|
16
|
+
* return (
|
|
17
|
+
* <>
|
|
18
|
+
* <Stack.Toolbar placement="right">
|
|
19
|
+
* <Stack.Toolbar.Menu icon="ellipsis.circle">
|
|
20
|
+
* <Stack.Toolbar.MenuAction onPress={() => Alert.alert('Action pressed!')}>
|
|
21
|
+
* Action 1
|
|
22
|
+
* </Stack.Toolbar.MenuAction>
|
|
23
|
+
* </Stack.Toolbar.Menu>
|
|
24
|
+
* </Stack.Toolbar>
|
|
25
|
+
* <ScreenContent />
|
|
26
|
+
* </>
|
|
27
|
+
* );
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @see [Human Interface Guidelines](https://developer.apple.com/design/human-interface-guidelines/menus) for more information about menus on iOS.
|
|
32
|
+
*
|
|
33
|
+
* @platform ios
|
|
34
|
+
*/
|
|
35
|
+
export declare const StackToolbarMenu: React.FC<StackToolbarMenuProps>;
|
|
36
|
+
export declare function convertStackToolbarMenuPropsToRNHeaderItem(props: StackToolbarMenuProps, isBottomPlacement?: boolean): NativeStackHeaderItemMenu | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* An action item for a `Stack.Toolbar.Menu`.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* import { Stack } from 'expo-router';
|
|
43
|
+
*
|
|
44
|
+
* export default function Page() {
|
|
45
|
+
* return (
|
|
46
|
+
* <>
|
|
47
|
+
* <Stack.Toolbar placement="right">
|
|
48
|
+
* <Stack.Toolbar.Menu icon="ellipsis.circle">
|
|
49
|
+
* <Stack.Toolbar.MenuAction onPress={() => alert('Action pressed!')}>
|
|
50
|
+
* Action 1
|
|
51
|
+
* </Stack.Toolbar.MenuAction>
|
|
52
|
+
* </Stack.Toolbar.Menu>
|
|
53
|
+
* </Stack.Toolbar>
|
|
54
|
+
* <ScreenContent />
|
|
55
|
+
* </>
|
|
56
|
+
* );
|
|
57
|
+
* }
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
* @platform ios
|
|
61
|
+
*/
|
|
62
|
+
export declare const StackToolbarMenuAction: React.FC<StackToolbarMenuActionProps>;
|
|
63
|
+
export declare function convertStackToolbarMenuActionPropsToRNHeaderItem(props: StackToolbarMenuActionProps): NativeStackHeaderItemMenuAction;
|
|
64
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarMenu/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,yBAAyB,EACzB,+BAA+B,EAEhC,MAAM,gCAAgC,CAAC;AAMxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAclF,YAAY,EACV,qBAAqB,EACrB,sBAAsB,EACtB,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,SAAS,CAAC;AAqBjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,qBAAqB,CAsD5D,CAAC;AAEF,wBAAgB,0CAA0C,CACxD,KAAK,EAAE,qBAAqB,EAC5B,iBAAiB,GAAE,OAAe,GACjC,yBAAyB,GAAG,SAAS,CAsCvC;AAiED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAiBxE,CAAC;AAEF,wBAAgB,gDAAgD,CAC9D,KAAK,EAAE,2BAA2B,GACjC,+BAA+B,CAwBjC"}
|
|
@@ -5,13 +5,11 @@ exports.StackToolbarMenuAction = exports.StackToolbarMenu = void 0;
|
|
|
5
5
|
exports.convertStackToolbarMenuPropsToRNHeaderItem = convertStackToolbarMenuPropsToRNHeaderItem;
|
|
6
6
|
exports.convertStackToolbarMenuActionPropsToRNHeaderItem = convertStackToolbarMenuActionPropsToRNHeaderItem;
|
|
7
7
|
const react_1 = require("react");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const native_1 = require("../../../link/preview/native");
|
|
14
|
-
const children_1 = require("../../../utils/children");
|
|
8
|
+
const native_1 = require("./native");
|
|
9
|
+
const children_1 = require("../../../../utils/children");
|
|
10
|
+
const context_1 = require("../context");
|
|
11
|
+
const shared_1 = require("../shared");
|
|
12
|
+
const toolbar_primitives_1 = require("../toolbar-primitives");
|
|
15
13
|
/**
|
|
16
14
|
* Computes the label and menu title from children and title prop.
|
|
17
15
|
*
|
|
@@ -86,7 +84,7 @@ const StackToolbarMenu = (props) => {
|
|
|
86
84
|
}
|
|
87
85
|
}
|
|
88
86
|
// TODO(@ubax): Handle image loading using useImage in a follow-up PR.
|
|
89
|
-
return (<NativeToolbarMenu {...props} icon={icon} xcassetName={xcassetName} image={props.image} imageRenderingMode={imageRenderingMode} label={computedLabel} title={computedMenuTitle} children={validChildren}/>);
|
|
87
|
+
return (<native_1.NativeToolbarMenu {...props} icon={icon} xcassetName={xcassetName} image={props.image} imageRenderingMode={imageRenderingMode} label={computedLabel} title={computedMenuTitle} children={validChildren}/>);
|
|
90
88
|
};
|
|
91
89
|
exports.StackToolbarMenu = StackToolbarMenu;
|
|
92
90
|
function convertStackToolbarMenuPropsToRNHeaderItem(props, isBottomPlacement = false) {
|
|
@@ -198,7 +196,7 @@ const StackToolbarMenuAction = (props) => {
|
|
|
198
196
|
}
|
|
199
197
|
// TODO(@ubax): Handle image loading using useImage in a follow-up PR.
|
|
200
198
|
const icon = typeof props.icon === 'string' ? props.icon : undefined;
|
|
201
|
-
return (<NativeToolbarMenuAction {...props} icon={icon} image={props.image} imageRenderingMode={props.iconRenderingMode}/>);
|
|
199
|
+
return (<native_1.NativeToolbarMenuAction {...props} icon={icon} image={props.image} imageRenderingMode={props.iconRenderingMode}/>);
|
|
202
200
|
};
|
|
203
201
|
exports.StackToolbarMenuAction = StackToolbarMenuAction;
|
|
204
202
|
function convertStackToolbarMenuActionPropsToRNHeaderItem(props) {
|
|
@@ -225,32 +223,13 @@ function convertStackToolbarMenuActionPropsToRNHeaderItem(props) {
|
|
|
225
223
|
}
|
|
226
224
|
return item;
|
|
227
225
|
}
|
|
228
|
-
/**
|
|
229
|
-
* Native toolbar menu component for bottom toolbar.
|
|
230
|
-
* Renders as NativeLinkPreviewAction.
|
|
231
|
-
*/
|
|
232
|
-
const NativeToolbarMenu = ({ accessibilityHint, accessibilityLabel, separateBackground, hidesSharedBackground, palette, inline, hidden, subtitle, title, label, destructive, children, icon, xcassetName, image, imageRenderingMode, tintColor, variant, style, elementSize, }) => {
|
|
233
|
-
const identifier = (0, react_1.useId)();
|
|
234
|
-
const titleStyle = react_native_1.StyleSheet.flatten(style);
|
|
235
|
-
const renderingMode = imageRenderingMode ?? (tintColor !== undefined ? 'template' : 'original');
|
|
236
|
-
return (<native_1.NativeLinkPreviewAction sharesBackground={!separateBackground} hidesSharedBackground={hidesSharedBackground} hidden={hidden} icon={icon} xcassetName={xcassetName}
|
|
237
|
-
// TODO(@ubax): Handle image loading using useImage in a follow-up PR.
|
|
238
|
-
image={image} imageRenderingMode={renderingMode} destructive={destructive} subtitle={subtitle} accessibilityLabel={accessibilityLabel} accessibilityHint={accessibilityHint} displayAsPalette={palette} displayInline={inline} preferredElementSize={elementSize} tintColor={tintColor} titleStyle={titleStyle} barButtonItemStyle={variant === 'done' ? 'prominent' : variant} title={title ?? ''} label={label} onSelected={() => { }} children={children} identifier={identifier}/>);
|
|
239
|
-
};
|
|
240
|
-
// #endregion
|
|
241
|
-
// #region NativeToolbarMenuAction
|
|
242
|
-
/**
|
|
243
|
-
* Native toolbar menu action - reuses LinkMenuAction.
|
|
244
|
-
*/
|
|
245
|
-
const NativeToolbarMenuAction = elements_1.LinkMenuAction;
|
|
246
|
-
// #endregion
|
|
247
226
|
const ALLOWED_CHILDREN = [
|
|
248
227
|
exports.StackToolbarMenu,
|
|
249
228
|
exports.StackToolbarMenuAction,
|
|
250
|
-
NativeToolbarMenu,
|
|
251
|
-
NativeToolbarMenuAction,
|
|
229
|
+
native_1.NativeToolbarMenu,
|
|
230
|
+
native_1.NativeToolbarMenuAction,
|
|
252
231
|
toolbar_primitives_1.StackToolbarLabel,
|
|
253
232
|
toolbar_primitives_1.StackToolbarIcon,
|
|
254
233
|
toolbar_primitives_1.StackToolbarBadge,
|
|
255
234
|
];
|
|
256
|
-
//# sourceMappingURL=
|
|
235
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarMenu/index.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AA0Ib,gGAyCC;AA6GD,4GA0BC;AApTD,iCAA0D;AAI1D,qCAAsE;AAEtE,yDAIoC;AACpC,wCAAiD;AACjD,sCAImB;AACnB,8DAA+F;AAS/F;;;;;;GAMG;AACH,SAAS,wBAAwB,CAC/B,QAAmB,EACnB,KAAyB;IAEzB,MAAM,UAAU,GAAG,IAAA,8BAAmB,EAAC,QAAQ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AW,GAAG,IAAA,0DAAiD,EAAC,KAAK,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAoC;QAC5C,GAAG,IAAI;QACP,WAAW,EAAE,KAAK,CAAC,QAAQ;QAC3B,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,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,IAAI,CAAC,IAAI,GAAG,8BAA8B,CACxC,WAAW,CAAC,IAAI,CACqC,CAAC;QAC1D,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,gBAAgB,GAAG;IACvB,wBAAgB;IAChB,8BAAsB;IACtB,0BAAiB;IACjB,gCAAuB;IACvB,sCAAiB;IACjB,qCAAgB;IAChB,sCAAiB;CAClB,CAAC","sourcesContent":["'use client';\nimport type {\n NativeStackHeaderItemMenu,\n NativeStackHeaderItemMenuAction,\n NativeStackHeaderItemMenuSubmenu,\n} from '@react-navigation/native-stack';\nimport { Children, useMemo, type ReactNode } from 'react';\nimport type { ImageSourcePropType } from 'react-native';\nimport type { PlatformIconIOS } from 'react-native-screens';\n\nimport { NativeToolbarMenu, NativeToolbarMenuAction } from './native';\nimport type { StackToolbarMenuProps, StackToolbarMenuActionProps } from './types';\nimport {\n filterAllowedChildrenElements,\n getFirstChildOfType,\n isChildOfType,\n} from '../../../../utils/children';\nimport { useToolbarPlacement } from '../context';\nimport {\n convertStackHeaderSharedPropsToRNSharedHeaderItem,\n extractIconRenderingMode,\n extractXcassetName,\n} from '../shared';\nimport { StackToolbarLabel, StackToolbarIcon, StackToolbarBadge } from '../toolbar-primitives';\n\nexport type {\n StackToolbarMenuProps,\n NativeToolbarMenuProps,\n StackToolbarMenuActionProps,\n NativeToolbarMenuActionProps,\n} from './types';\n\n/**\n * Computes the label and menu title from children and title prop.\n *\n * - If only `title` prop is provided, it is used for both the label (button text) and menu title\n * - If only `.Label` child is provided, it is used for the label and the menu title is an empty string\n * - If both `.Label` child and `title` prop are provided. `.Label` is used for the label, and `title` is used for the menu title\n */\nfunction computeMenuLabelAndTitle(\n children: ReactNode,\n title: string | undefined\n): { label: string; menuTitle: string } {\n const labelChild = getFirstChildOfType(children, StackToolbarLabel);\n const labelFromChild = labelChild?.props.children;\n return {\n label: labelFromChild ?? title ?? '',\n menuTitle: title ?? '',\n };\n}\n\n/**\n * Use as `Stack.Toolbar.Menu` to provide menus in iOS toolbar.\n * It accepts `Stack.Toolbar.MenuAction` and nested `Stack.Toolbar.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 Page() {\n * return (\n * <>\n * <Stack.Toolbar placement=\"right\">\n * <Stack.Toolbar.Menu icon=\"ellipsis.circle\">\n * <Stack.Toolbar.MenuAction onPress={() => Alert.alert('Action pressed!')}>\n * Action 1\n * </Stack.Toolbar.MenuAction>\n * </Stack.Toolbar.Menu>\n * </Stack.Toolbar>\n * <ScreenContent />\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 StackToolbarMenu: React.FC<StackToolbarMenuProps> = (props) => {\n const placement = useToolbarPlacement();\n\n if (placement !== 'bottom') {\n // For placement other than bottom, this component will not render, and should be\n // converted to RN header item using convertStackToolbarMenuPropsToRNHeaderItem.\n // So if we reach here, it means we're not inside a toolbar or something else is wrong.\n throw new Error('Stack.Toolbar.Menu must be used inside a Stack.Toolbar');\n }\n\n const validChildren = useMemo(\n () => filterAllowedChildrenElements(props.children, ALLOWED_CHILDREN),\n [props.children]\n );\n\n const sharedProps = convertStackToolbarMenuPropsToRNHeaderItem(props, true);\n\n const computedLabel = sharedProps?.label;\n const computedMenuTitle = sharedProps?.menu?.title;\n const icon = sharedProps?.icon?.type === 'sfSymbol' ? sharedProps.icon.name : undefined;\n const xcassetName = extractXcassetName(props);\n const imageRenderingMode = extractIconRenderingMode(props) ?? props.iconRenderingMode;\n\n if (process.env.NODE_ENV !== 'production') {\n const allChildren = Children.toArray(props.children);\n if (allChildren.length !== validChildren.length) {\n throw new Error(\n `Stack.Toolbar.Menu only accepts Stack.Toolbar.Menu, Stack.Toolbar.MenuAction, Stack.Toolbar.Label, Stack.Toolbar.Icon, and Stack.Toolbar.Badge as its children.`\n );\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n const hasBadge = getFirstChildOfType(props.children, StackToolbarBadge);\n if (hasBadge) {\n console.warn(\n 'Stack.Toolbar.Badge is not supported in bottom toolbar (iOS limitation). The badge will be ignored.'\n );\n }\n }\n\n // TODO(@ubax): Handle image loading using useImage in a follow-up PR.\n return (\n <NativeToolbarMenu\n {...props}\n icon={icon}\n xcassetName={xcassetName}\n image={props.image}\n imageRenderingMode={imageRenderingMode}\n label={computedLabel}\n title={computedMenuTitle}\n children={validChildren}\n />\n );\n};\n\nexport function convertStackToolbarMenuPropsToRNHeaderItem(\n props: StackToolbarMenuProps,\n isBottomPlacement: boolean = false\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) =>\n isChildOfType(child, StackToolbarMenuAction) || isChildOfType(child, StackToolbarMenu)\n );\n\n const { label: computedLabel, menuTitle: computedMenuTitle } = computeMenuLabelAndTitle(\n props.children,\n title\n );\n\n const sharedProps = convertStackHeaderSharedPropsToRNSharedHeaderItem(rest, isBottomPlacement);\n\n const item: NativeStackHeaderItemMenu = {\n ...sharedProps,\n label: computedLabel,\n type: 'menu',\n menu: {\n multiselectable: true,\n items: actions\n .map((action) => {\n if (isChildOfType(action, StackToolbarMenu)) {\n return convertStackToolbarSubmenuMenuPropsToRNHeaderItem(action.props);\n }\n return convertStackToolbarMenuActionPropsToRNHeaderItem(action.props);\n })\n .filter((i) => !!i),\n },\n };\n if (computedMenuTitle) {\n item.menu.title = computedMenuTitle;\n }\n\n return item;\n}\n\n// Custom menu action icons are not supported in react-navigation yet\n// But they are supported in react-native-screens\n// TODO(@ubax): Remove this workaround once react-navigation supports custom icons for menu actions.\n// https://linear.app/expo/issue/ENG-19853/remove-custom-conversion-logic-for-icon-from-packagesexpo\nfunction convertImageIconToPlatformIcon(icon: {\n source: ImageSourcePropType;\n tinted?: boolean;\n}): PlatformIconIOS {\n return icon.tinted\n ? { type: 'templateSource', templateSource: icon.source }\n : { type: 'imageSource', imageSource: icon.source };\n}\n\nfunction convertStackToolbarSubmenuMenuPropsToRNHeaderItem(\n props: StackToolbarMenuProps\n): NativeStackHeaderItemMenuSubmenu | undefined {\n if (props.hidden) {\n return undefined;\n }\n const sharedProps = convertStackHeaderSharedPropsToRNSharedHeaderItem(props);\n const actions = Children.toArray(props.children).filter(\n (child) =>\n isChildOfType(child, StackToolbarMenuAction) || isChildOfType(child, StackToolbarMenu)\n );\n\n const item: NativeStackHeaderItemMenuSubmenu = {\n type: 'submenu',\n items: actions\n .map((action) => {\n if (isChildOfType(action, StackToolbarMenu)) {\n return convertStackToolbarSubmenuMenuPropsToRNHeaderItem(action.props);\n }\n return convertStackToolbarMenuActionPropsToRNHeaderItem(action.props);\n })\n .filter((i) => !!i),\n label: sharedProps.label || props.title || '',\n multiselectable: true,\n };\n\n if (props.inline !== undefined) {\n item.inline = props.inline;\n }\n if (props.palette !== undefined) {\n item.layout = props.palette ? 'palette' : 'default';\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 if (sharedProps.icon.type === 'sfSymbol') {\n item.icon = sharedProps.icon;\n } else {\n item.icon = convertImageIconToPlatformIcon(\n sharedProps.icon\n ) as unknown as NativeStackHeaderItemMenuSubmenu['icon'];\n }\n }\n\n return item;\n}\n\n/**\n * An action item for a `Stack.Toolbar.Menu`.\n *\n * @example\n * ```tsx\n * import { Stack } from 'expo-router';\n *\n * export default function Page() {\n * return (\n * <>\n * <Stack.Toolbar placement=\"right\">\n * <Stack.Toolbar.Menu icon=\"ellipsis.circle\">\n * <Stack.Toolbar.MenuAction onPress={() => alert('Action pressed!')}>\n * Action 1\n * </Stack.Toolbar.MenuAction>\n * </Stack.Toolbar.Menu>\n * </Stack.Toolbar>\n * <ScreenContent />\n * </>\n * );\n * }\n * ```\n *\n * @platform ios\n */\nexport const StackToolbarMenuAction: React.FC<StackToolbarMenuActionProps> = (props) => {\n const placement = useToolbarPlacement();\n\n if (placement !== 'bottom') {\n throw new Error('Stack.Toolbar.MenuAction must be used inside a Stack.Toolbar.Menu');\n }\n\n // TODO(@ubax): Handle image loading using useImage in a follow-up PR.\n const icon = typeof props.icon === 'string' ? props.icon : undefined;\n return (\n <NativeToolbarMenuAction\n {...props}\n icon={icon}\n image={props.image}\n imageRenderingMode={props.iconRenderingMode}\n />\n );\n};\n\nexport function convertStackToolbarMenuActionPropsToRNHeaderItem(\n props: StackToolbarMenuActionProps\n): NativeStackHeaderItemMenuAction {\n const { children, isOn, unstable_keepPresented, icon, ...rest } = props;\n const sharedProps = convertStackHeaderSharedPropsToRNSharedHeaderItem(props);\n const item: NativeStackHeaderItemMenuAction = {\n ...rest,\n description: props.subtitle,\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 if (sharedProps.icon.type === 'sfSymbol') {\n item.icon = sharedProps.icon;\n } else {\n item.icon = convertImageIconToPlatformIcon(\n sharedProps.icon\n ) as unknown as NativeStackHeaderItemMenuAction['icon'];\n }\n }\n return item;\n}\n\nconst ALLOWED_CHILDREN = [\n StackToolbarMenu,\n StackToolbarMenuAction,\n NativeToolbarMenu,\n NativeToolbarMenuAction,\n StackToolbarLabel,\n StackToolbarIcon,\n StackToolbarBadge,\n];\n"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { NativeToolbarMenuActionProps, NativeToolbarMenuProps } from './types';
|
|
2
|
+
export declare const NativeToolbarMenu: React.FC<NativeToolbarMenuProps>;
|
|
3
|
+
export declare const NativeToolbarMenuAction: React.FC<NativeToolbarMenuActionProps>;
|
|
4
|
+
//# sourceMappingURL=native.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarMenu/native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEpF,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAAc,CAAC;AAE9E,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAAc,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { NativeToolbarMenuProps } from './types';
|
|
2
|
+
import { LinkMenuAction } from '../../../../link/elements';
|
|
3
|
+
/**
|
|
4
|
+
* Native toolbar menu component for bottom toolbar.
|
|
5
|
+
* Renders as NativeLinkPreviewAction.
|
|
6
|
+
*/
|
|
7
|
+
export declare const NativeToolbarMenu: React.FC<NativeToolbarMenuProps>;
|
|
8
|
+
/**
|
|
9
|
+
* Native toolbar menu action - reuses LinkMenuAction.
|
|
10
|
+
*/
|
|
11
|
+
export declare const NativeToolbarMenuAction: typeof LinkMenuAction;
|
|
12
|
+
//# sourceMappingURL=native.ios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.ios.d.ts","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarMenu/native.ios.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D;;;GAGG;AACH,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAqD9D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,uBAAiB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.NativeToolbarMenuAction = exports.NativeToolbarMenu = void 0;
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_native_1 = require("react-native");
|
|
7
|
+
const elements_1 = require("../../../../link/elements");
|
|
8
|
+
const native_1 = require("../../../../link/preview/native");
|
|
9
|
+
/**
|
|
10
|
+
* Native toolbar menu component for bottom toolbar.
|
|
11
|
+
* Renders as NativeLinkPreviewAction.
|
|
12
|
+
*/
|
|
13
|
+
const NativeToolbarMenu = ({ accessibilityHint, accessibilityLabel, separateBackground, hidesSharedBackground, palette, inline, hidden, subtitle, title, label, destructive, children, icon, xcassetName, image, imageRenderingMode, tintColor, variant, style, elementSize, }) => {
|
|
14
|
+
const identifier = (0, react_1.useId)();
|
|
15
|
+
const titleStyle = react_native_1.StyleSheet.flatten(style);
|
|
16
|
+
const renderingMode = imageRenderingMode ?? (tintColor !== undefined ? 'template' : 'original');
|
|
17
|
+
return (<native_1.NativeLinkPreviewAction sharesBackground={!separateBackground} hidesSharedBackground={hidesSharedBackground} hidden={hidden} icon={icon} xcassetName={xcassetName}
|
|
18
|
+
// TODO(@ubax): Handle image loading using useImage in a follow-up PR.
|
|
19
|
+
image={image} imageRenderingMode={renderingMode} destructive={destructive} subtitle={subtitle} accessibilityLabel={accessibilityLabel} accessibilityHint={accessibilityHint} displayAsPalette={palette} displayInline={inline} preferredElementSize={elementSize} tintColor={tintColor} titleStyle={titleStyle} barButtonItemStyle={variant === 'done' ? 'prominent' : variant} title={title ?? ''} label={label} onSelected={() => { }} children={children} identifier={identifier}/>);
|
|
20
|
+
};
|
|
21
|
+
exports.NativeToolbarMenu = NativeToolbarMenu;
|
|
22
|
+
/**
|
|
23
|
+
* Native toolbar menu action - reuses LinkMenuAction.
|
|
24
|
+
*/
|
|
25
|
+
exports.NativeToolbarMenuAction = elements_1.LinkMenuAction;
|
|
26
|
+
//# sourceMappingURL=native.ios.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.ios.js","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarMenu/native.ios.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AACb,iCAA8B;AAC9B,+CAA0C;AAG1C,wDAA2D;AAC3D,4DAA0E;AAE1E;;;GAGG;AACI,MAAM,iBAAiB,GAAqC,CAAC,EAClE,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,OAAO,EACP,MAAM,EACN,MAAM,EACN,QAAQ,EACR,KAAK,EACL,KAAK,EACL,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,WAAW,EACX,KAAK,EACL,kBAAkB,EAClB,SAAS,EACT,OAAO,EACP,KAAK,EACL,WAAW,GACZ,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,IAAA,aAAK,GAAE,CAAC;IAE3B,MAAM,UAAU,GAAG,yBAAU,CAAC,OAAO,CAAC,KAAK,CAAC,C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port { useId } from 'react';\nimport { StyleSheet } from 'react-native';\n\nimport type { NativeToolbarMenuProps } from './types';\nimport { LinkMenuAction } from '../../../../link/elements';\nimport { NativeLinkPreviewAction } from '../../../../link/preview/native';\n\n/**\n * Native toolbar menu component for bottom toolbar.\n * Renders as NativeLinkPreviewAction.\n */\nexport const NativeToolbarMenu: React.FC<NativeToolbarMenuProps> = ({\n accessibilityHint,\n accessibilityLabel,\n separateBackground,\n hidesSharedBackground,\n palette,\n inline,\n hidden,\n subtitle,\n title,\n label,\n destructive,\n children,\n icon,\n xcassetName,\n image,\n imageRenderingMode,\n tintColor,\n variant,\n style,\n elementSize,\n}) => {\n const identifier = useId();\n\n const titleStyle = StyleSheet.flatten(style);\n const renderingMode = imageRenderingMode ?? (tintColor !== undefined ? 'template' : 'original');\n return (\n <NativeLinkPreviewAction\n sharesBackground={!separateBackground}\n hidesSharedBackground={hidesSharedBackground}\n hidden={hidden}\n icon={icon}\n xcassetName={xcassetName}\n // TODO(@ubax): Handle image loading using useImage in a follow-up PR.\n image={image}\n imageRenderingMode={renderingMode}\n destructive={destructive}\n subtitle={subtitle}\n accessibilityLabel={accessibilityLabel}\n accessibilityHint={accessibilityHint}\n displayAsPalette={palette}\n displayInline={inline}\n preferredElementSize={elementSize}\n tintColor={tintColor}\n titleStyle={titleStyle}\n barButtonItemStyle={variant === 'done' ? 'prominent' : variant}\n title={title ?? ''}\n label={label}\n onSelected={() => {}}\n children={children}\n identifier={identifier}\n />\n );\n};\n\n/**\n * Native toolbar menu action - reuses LinkMenuAction.\n */\nexport const NativeToolbarMenuAction = LinkMenuAction;\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NativeToolbarMenuAction = exports.NativeToolbarMenu = void 0;
|
|
4
|
+
const NativeToolbarMenu = () => null;
|
|
5
|
+
exports.NativeToolbarMenu = NativeToolbarMenu;
|
|
6
|
+
const NativeToolbarMenuAction = () => null;
|
|
7
|
+
exports.NativeToolbarMenuAction = NativeToolbarMenuAction;
|
|
8
|
+
//# sourceMappingURL=native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../../../src/layouts/stack-utils/toolbar/StackToolbarMenu/native.tsx"],"names":[],"mappings":";;;AAEO,MAAM,iBAAiB,GAAqC,GAAG,EAAE,CAAC,IAAI,CAAC;AAAjE,QAAA,iBAAiB,qBAAgD;AAEvE,MAAM,uBAAuB,GAA2C,GAAG,EAAE,CAAC,IAAI,CAAC;AAA7E,QAAA,uBAAuB,2BAAsD","sourcesContent":["import type { NativeToolbarMenuActionProps, NativeToolbarMenuProps } from './types';\n\nexport const NativeToolbarMenu: React.FC<NativeToolbarMenuProps> = () => null;\n\nexport const NativeToolbarMenuAction: React.FC<NativeToolbarMenuActionProps> = () => null;\n"]}
|