expo-router 7.0.0-canary-20260113-4879b86 → 7.0.0-canary-20260119-70f7c28
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/ExpoRoot.d.ts.map +1 -1
- package/build/ExpoRoot.js +2 -0
- package/build/ExpoRoot.js.map +1 -1
- package/build/global.d.ts +29 -0
- package/build/global.d.ts.map +1 -0
- package/build/global.js +3 -0
- package/build/global.js.map +1 -0
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/layouts/Stack.d.ts.map +1 -1
- package/build/layouts/Stack.js +3 -0
- package/build/layouts/Stack.js.map +1 -1
- package/build/layouts/Stack.web.js +1 -0
- package/build/layouts/Stack.web.js.map +1 -1
- package/build/layouts/StackClient.d.ts +13 -14
- package/build/layouts/StackClient.d.ts.map +1 -1
- package/build/layouts/StackClient.js +3 -2
- package/build/layouts/StackClient.js.map +1 -1
- package/build/layouts/stack-utils/StackHeaderComponent.d.ts +12 -23
- package/build/layouts/stack-utils/StackHeaderComponent.d.ts.map +1 -1
- package/build/layouts/stack-utils/StackHeaderComponent.js +15 -55
- package/build/layouts/stack-utils/StackHeaderComponent.js.map +1 -1
- package/build/layouts/stack-utils/StackScreen.d.ts +5 -0
- package/build/layouts/stack-utils/StackScreen.d.ts.map +1 -1
- package/build/layouts/stack-utils/StackScreen.js +34 -7
- package/build/layouts/stack-utils/StackScreen.js.map +1 -1
- package/build/layouts/stack-utils/StackSearchBar.d.ts +28 -0
- package/build/layouts/stack-utils/StackSearchBar.d.ts.map +1 -1
- package/build/layouts/stack-utils/StackSearchBar.js +29 -0
- package/build/layouts/stack-utils/StackSearchBar.js.map +1 -1
- package/build/layouts/stack-utils/common-primitives.d.ts +6 -6
- package/build/layouts/stack-utils/common-primitives.d.ts.map +1 -1
- package/build/layouts/stack-utils/common-primitives.js +4 -4
- package/build/layouts/stack-utils/common-primitives.js.map +1 -1
- package/build/layouts/stack-utils/index.d.ts +4 -23
- package/build/layouts/stack-utils/index.d.ts.map +1 -1
- package/build/layouts/stack-utils/index.js +18 -35
- package/build/layouts/stack-utils/index.js.map +1 -1
- package/build/layouts/stack-utils/screen/StackScreenBackButton.d.ts +68 -0
- package/build/layouts/stack-utils/screen/StackScreenBackButton.d.ts.map +1 -0
- package/build/layouts/stack-utils/screen/StackScreenBackButton.js +58 -0
- package/build/layouts/stack-utils/screen/StackScreenBackButton.js.map +1 -0
- package/build/layouts/stack-utils/screen/StackScreenTitle.d.ts +58 -0
- package/build/layouts/stack-utils/screen/StackScreenTitle.d.ts.map +1 -0
- package/build/layouts/stack-utils/screen/StackScreenTitle.js +75 -0
- package/build/layouts/stack-utils/screen/StackScreenTitle.js.map +1 -0
- package/build/layouts/stack-utils/screen/index.d.ts +3 -0
- package/build/layouts/stack-utils/screen/index.d.ts.map +1 -0
- package/build/layouts/stack-utils/screen/index.js +10 -0
- package/build/layouts/stack-utils/screen/index.js.map +1 -0
- package/build/layouts/stack-utils/shared.js +3 -3
- package/build/layouts/stack-utils/shared.js.map +1 -1
- package/build/layouts/stack-utils/toolbar/StackToolbar.d.ts +3 -0
- package/build/layouts/stack-utils/toolbar/StackToolbar.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbar.js +24 -0
- package/build/layouts/stack-utils/toolbar/StackToolbar.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton.d.ts +144 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton.js +68 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarButton.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarClient.d.ts +104 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarClient.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarClient.js +214 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarClient.js.map +1 -0
- package/build/layouts/stack-utils/{StackHeaderMenu.d.ts → toolbar/StackToolbarMenu.d.ts} +58 -106
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu.js +190 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarMenu.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot.d.ts +48 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot.js +44 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSearchBarSlot.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer.d.ts +80 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer.js +77 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarSpacer.js.map +1 -0
- package/build/layouts/stack-utils/{StackHeaderView.d.ts → toolbar/StackToolbarView.d.ts} +21 -17
- package/build/layouts/stack-utils/toolbar/StackToolbarView.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarView.js +61 -0
- package/build/layouts/stack-utils/toolbar/StackToolbarView.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/bottom-toolbar-native-elements.d.ts +93 -0
- package/build/layouts/stack-utils/toolbar/bottom-toolbar-native-elements.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/bottom-toolbar-native-elements.js +89 -0
- package/build/layouts/stack-utils/toolbar/bottom-toolbar-native-elements.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/context.d.ts +9 -0
- package/build/layouts/stack-utils/toolbar/context.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/context.js +16 -0
- package/build/layouts/stack-utils/toolbar/context.js.map +1 -0
- package/build/layouts/stack-utils/toolbar/index.d.ts +10 -0
- package/build/layouts/stack-utils/toolbar/index.d.ts.map +1 -0
- package/build/layouts/stack-utils/toolbar/index.js +23 -0
- package/build/layouts/stack-utils/toolbar/index.js.map +1 -0
- package/build/link/LinkWithPreview.d.ts.map +1 -1
- package/build/link/LinkWithPreview.js +8 -5
- package/build/link/LinkWithPreview.js.map +1 -1
- package/build/link/NativeMenuContext.d.ts +5 -0
- package/build/link/NativeMenuContext.d.ts.map +1 -0
- package/build/link/NativeMenuContext.js +9 -0
- package/build/link/NativeMenuContext.js.map +1 -0
- package/build/link/elements.d.ts +41 -0
- package/build/link/elements.d.ts.map +1 -1
- package/build/link/elements.js +3 -2
- package/build/link/elements.js.map +1 -1
- package/build/link/preview/native.d.ts +2 -0
- package/build/link/preview/native.d.ts.map +1 -1
- package/build/link/preview/native.js +3 -1
- package/build/link/preview/native.js.map +1 -1
- package/build/native-tabs/NativeBottomTabsNavigator.d.ts +1 -1
- package/build/native-tabs/NativeBottomTabsNavigator.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabsNavigator.js +2 -1
- package/build/native-tabs/NativeBottomTabsNavigator.js.map +1 -1
- package/build/native-tabs/NativeTabTrigger.d.ts.map +1 -1
- package/build/native-tabs/NativeTabTrigger.js +6 -4
- package/build/native-tabs/NativeTabTrigger.js.map +1 -1
- package/build/native-tabs/NativeTabsView.d.ts.map +1 -1
- package/build/native-tabs/NativeTabsView.js +0 -3
- package/build/native-tabs/NativeTabsView.js.map +1 -1
- package/build/native-tabs/common/elements.d.ts +10 -0
- package/build/native-tabs/common/elements.d.ts.map +1 -1
- package/build/native-tabs/common/elements.js.map +1 -1
- package/build/native-tabs/types.d.ts +6 -0
- package/build/native-tabs/types.d.ts.map +1 -1
- package/build/native-tabs/types.js.map +1 -1
- package/build/native-tabs/utils/icon.d.ts +2 -0
- package/build/native-tabs/utils/icon.d.ts.map +1 -1
- package/build/native-tabs/utils/icon.js +3 -0
- package/build/native-tabs/utils/icon.js.map +1 -1
- package/build/navigationEvents/index.d.ts +7 -24
- package/build/navigationEvents/index.d.ts.map +1 -1
- package/build/navigationEvents/index.js +47 -12
- package/build/navigationEvents/index.js.map +1 -1
- package/build/navigationEvents/types.d.ts +23 -0
- package/build/navigationEvents/types.d.ts.map +1 -0
- package/build/navigationEvents/types.js +3 -0
- package/build/navigationEvents/types.js.map +1 -0
- package/build/navigationEvents/utils.d.ts +9 -0
- package/build/navigationEvents/utils.d.ts.map +1 -0
- package/build/navigationEvents/utils.js +25 -0
- package/build/navigationEvents/utils.js.map +1 -0
- package/build/primitives/types.d.ts +6 -6
- package/build/primitives/types.d.ts.map +1 -1
- package/build/primitives/types.js.map +1 -1
- package/build/screensFeatureFlags.d.ts +2 -0
- package/build/screensFeatureFlags.d.ts.map +1 -0
- package/build/screensFeatureFlags.js +20 -0
- package/build/screensFeatureFlags.js.map +1 -0
- package/build/split-view/split-view.d.ts.map +1 -1
- package/build/split-view/split-view.js +0 -7
- package/build/split-view/split-view.js.map +1 -1
- package/build/toolbar/native.types.d.ts +0 -14
- package/build/toolbar/native.types.d.ts.map +1 -1
- package/build/toolbar/native.types.js.map +1 -1
- package/build/ui/TabRouter.d.ts +14 -2
- package/build/ui/TabRouter.d.ts.map +1 -1
- package/build/ui/TabRouter.js +34 -4
- package/build/ui/TabRouter.js.map +1 -1
- package/build/useScreens.d.ts.map +1 -1
- package/build/useScreens.js +30 -15
- package/build/useScreens.js.map +1 -1
- package/expo-module.config.json +1 -1
- package/ios/LinkPreview/LinkPreviewNativeActionView.swift +18 -2
- package/ios/LinkPreview/LinkPreviewNativeModule.swift +3 -0
- package/ios/LinkPreview/LinkPreviewNativeNavigation.swift +2 -2
- package/ios/LinkPreview/LinkZoomTransition.swift +2 -2
- package/ios/Toolbar/RouterToolbarHostView.swift +68 -43
- package/ios/Toolbar/RouterToolbarItemView.swift +89 -21
- package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86.module → 7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.module} +7 -7
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86.pom → 7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
- package/package.json +11 -13
- package/plugin/build/index.js +3 -4
- package/plugin/options.json +2 -2
- package/plugin/src/index.ts +3 -9
- package/build/layouts/stack-utils/StackHeaderBackButton.d.ts +0 -14
- package/build/layouts/stack-utils/StackHeaderBackButton.d.ts.map +0 -1
- package/build/layouts/stack-utils/StackHeaderBackButton.js +0 -19
- package/build/layouts/stack-utils/StackHeaderBackButton.js.map +0 -1
- package/build/layouts/stack-utils/StackHeaderButton.d.ts +0 -114
- package/build/layouts/stack-utils/StackHeaderButton.d.ts.map +0 -1
- package/build/layouts/stack-utils/StackHeaderButton.js +0 -49
- package/build/layouts/stack-utils/StackHeaderButton.js.map +0 -1
- package/build/layouts/stack-utils/StackHeaderLeftRight.d.ts +0 -119
- package/build/layouts/stack-utils/StackHeaderLeftRight.d.ts.map +0 -1
- package/build/layouts/stack-utils/StackHeaderLeftRight.js +0 -206
- package/build/layouts/stack-utils/StackHeaderLeftRight.js.map +0 -1
- package/build/layouts/stack-utils/StackHeaderMenu.d.ts.map +0 -1
- package/build/layouts/stack-utils/StackHeaderMenu.js +0 -214
- package/build/layouts/stack-utils/StackHeaderMenu.js.map +0 -1
- package/build/layouts/stack-utils/StackHeaderSpacer.d.ts +0 -46
- package/build/layouts/stack-utils/StackHeaderSpacer.d.ts.map +0 -1
- package/build/layouts/stack-utils/StackHeaderSpacer.js +0 -44
- package/build/layouts/stack-utils/StackHeaderSpacer.js.map +0 -1
- package/build/layouts/stack-utils/StackHeaderTitle.d.ts +0 -22
- package/build/layouts/stack-utils/StackHeaderTitle.d.ts.map +0 -1
- package/build/layouts/stack-utils/StackHeaderTitle.js +0 -36
- package/build/layouts/stack-utils/StackHeaderTitle.js.map +0 -1
- package/build/layouts/stack-utils/StackHeaderView.d.ts.map +0 -1
- package/build/layouts/stack-utils/StackHeaderView.js +0 -56
- package/build/layouts/stack-utils/StackHeaderView.js.map +0 -1
- package/build/toolbar/elements.d.ts +0 -417
- package/build/toolbar/elements.d.ts.map +0 -1
- package/build/toolbar/elements.js +0 -188
- package/build/toolbar/elements.js.map +0 -1
- package/build/toolbar/index.d.ts +0 -42
- package/build/toolbar/index.d.ts.map +0 -1
- package/build/toolbar/index.js +0 -49
- package/build/toolbar/index.js.map +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86.pom.sha512 +0 -1
- package/unstable-toolbar.d.ts +0 -1
- package/unstable-toolbar.js +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86-sources.jar → 7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86-sources.jar.md5 → 7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86-sources.jar.sha1 → 7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86-sources.jar.sha256 → 7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86-sources.jar.sha512 → 7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28-sources.jar.sha512} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86.aar → 7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.aar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86.aar.md5 → 7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.aar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86.aar.sha1 → 7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.aar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86.aar.sha256 → 7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.aar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20260113-4879b86/expo.modules.router-7.0.0-canary-20260113-4879b86.aar.sha512 → 7.0.0-canary-20260119-70f7c28/expo.modules.router-7.0.0-canary-20260119-70f7c28.aar.sha512} +0 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type { ImageRef } from 'expo-image';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import { type ColorValue, type ImageSourcePropType, type StyleProp, type TextStyle } from 'react-native';
|
|
4
|
+
import type { SFSymbol } from 'sf-symbols-typescript';
|
|
5
|
+
import { LinkMenuAction } from '../../../link/elements';
|
|
6
|
+
import type { BasicTextStyle } from '../../../utils/font';
|
|
7
|
+
export interface NativeToolbarMenuProps {
|
|
8
|
+
accessibilityLabel?: string;
|
|
9
|
+
accessibilityHint?: string;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
destructive?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
hidden?: boolean;
|
|
15
|
+
hidesSharedBackground?: boolean;
|
|
16
|
+
icon?: SFSymbol | ImageSourcePropType;
|
|
17
|
+
/**
|
|
18
|
+
* Image to display for the menu item.
|
|
19
|
+
*/
|
|
20
|
+
image?: ImageRef;
|
|
21
|
+
inline?: boolean;
|
|
22
|
+
palette?: boolean;
|
|
23
|
+
separateBackground?: boolean;
|
|
24
|
+
style?: StyleProp<TextStyle>;
|
|
25
|
+
title?: string;
|
|
26
|
+
tintColor?: ColorValue;
|
|
27
|
+
variant?: 'plain' | 'done' | 'prominent';
|
|
28
|
+
elementSize?: 'auto' | 'small' | 'medium' | 'large';
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Native toolbar menu component for bottom toolbar.
|
|
32
|
+
* Renders as NativeLinkPreviewAction.
|
|
33
|
+
*/
|
|
34
|
+
export declare const NativeToolbarMenu: React.FC<NativeToolbarMenuProps>;
|
|
35
|
+
/**
|
|
36
|
+
* Native toolbar menu action - reuses LinkMenuAction.
|
|
37
|
+
*/
|
|
38
|
+
export declare const NativeToolbarMenuAction: typeof LinkMenuAction;
|
|
39
|
+
export interface NativeToolbarButtonProps {
|
|
40
|
+
accessibilityLabel?: string;
|
|
41
|
+
accessibilityHint?: string;
|
|
42
|
+
children?: ReactNode;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
hidden?: boolean;
|
|
45
|
+
hidesSharedBackground?: boolean;
|
|
46
|
+
icon?: SFSymbol;
|
|
47
|
+
image?: ImageRef;
|
|
48
|
+
onPress?: () => void;
|
|
49
|
+
possibleTitles?: string[];
|
|
50
|
+
selected?: boolean;
|
|
51
|
+
separateBackground?: boolean;
|
|
52
|
+
style?: StyleProp<BasicTextStyle>;
|
|
53
|
+
tintColor?: ColorValue;
|
|
54
|
+
variant?: 'plain' | 'done' | 'prominent';
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Native toolbar button component for bottom toolbar.
|
|
58
|
+
* Renders as RouterToolbarItem.
|
|
59
|
+
*/
|
|
60
|
+
export declare const NativeToolbarButton: React.FC<NativeToolbarButtonProps>;
|
|
61
|
+
export interface NativeToolbarSpacerProps {
|
|
62
|
+
hidden?: boolean;
|
|
63
|
+
hidesSharedBackground?: boolean;
|
|
64
|
+
sharesBackground?: boolean;
|
|
65
|
+
width?: number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Native toolbar spacer component for bottom toolbar.
|
|
69
|
+
* Renders as RouterToolbarItem with type 'fixedSpacer' or 'fluidSpacer'.
|
|
70
|
+
*/
|
|
71
|
+
export declare const NativeToolbarSpacer: React.FC<NativeToolbarSpacerProps>;
|
|
72
|
+
export interface NativeToolbarSearchBarSlotProps {
|
|
73
|
+
hidesSharedBackground?: boolean;
|
|
74
|
+
hidden?: boolean;
|
|
75
|
+
sharesBackground?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Native toolbar search bar slot for bottom toolbar (iOS 26+).
|
|
79
|
+
* Renders as RouterToolbarItem with type 'searchBar'.
|
|
80
|
+
*/
|
|
81
|
+
export declare const NativeToolbarSearchBarSlot: React.FC<NativeToolbarSearchBarSlotProps>;
|
|
82
|
+
export interface NativeToolbarViewProps {
|
|
83
|
+
children?: ReactNode;
|
|
84
|
+
hidden?: boolean;
|
|
85
|
+
hidesSharedBackground?: boolean;
|
|
86
|
+
separateBackground?: boolean;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Native toolbar view component for bottom toolbar.
|
|
90
|
+
* Renders as RouterToolbarItem with children.
|
|
91
|
+
*/
|
|
92
|
+
export declare const NativeToolbarView: React.FC<NativeToolbarViewProps>;
|
|
93
|
+
//# sourceMappingURL=bottom-toolbar-native-elements.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottom-toolbar-native-elements.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/bottom-toolbar-native-elements.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAS,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAC9C,OAAO,EAGL,KAAK,UAAU,EACf,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAKxD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAI1D,MAAM,WAAW,sBAAsB;IACrC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IA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
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.NativeToolbarView = exports.NativeToolbarSearchBarSlot = exports.NativeToolbarSpacer = exports.NativeToolbarButton = 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
|
+
const primitives_1 = require("../../../primitives");
|
|
10
|
+
const native_2 = require("../../../toolbar/native");
|
|
11
|
+
const children_1 = require("../../../utils/children");
|
|
12
|
+
/**
|
|
13
|
+
* Native toolbar menu component for bottom toolbar.
|
|
14
|
+
* Renders as NativeLinkPreviewAction.
|
|
15
|
+
*/
|
|
16
|
+
const NativeToolbarMenu = ({ accessibilityHint, accessibilityLabel, separateBackground, hidesSharedBackground, palette, inline, hidden, subtitle, title, destructive, children, icon, image, tintColor, variant, style, elementSize, }) => {
|
|
17
|
+
const identifier = (0, react_1.useId)();
|
|
18
|
+
const label = (0, children_1.getFirstChildOfType)(children, primitives_1.Label);
|
|
19
|
+
const iconComponent = (0, children_1.getFirstChildOfType)(children, primitives_1.Icon);
|
|
20
|
+
const computedTitle = title ?? label?.props.children ?? '';
|
|
21
|
+
const computedIcon = icon ??
|
|
22
|
+
(iconComponent?.props && 'sf' in iconComponent.props ? iconComponent.props.sf : undefined);
|
|
23
|
+
const sf = typeof computedIcon === 'string' ? computedIcon : undefined;
|
|
24
|
+
const titleStyle = react_native_1.StyleSheet.flatten(style);
|
|
25
|
+
return (<native_1.NativeLinkPreviewAction sharesBackground={!separateBackground} hidesSharedBackground={hidesSharedBackground} hidden={hidden} icon={sf}
|
|
26
|
+
// TODO(@ubax): Handle image loading using useImage in a follow-up PR.
|
|
27
|
+
image={image} destructive={destructive} subtitle={subtitle} accessibilityLabel={accessibilityLabel} accessibilityHint={accessibilityHint} displayAsPalette={palette} displayInline={inline} preferredElementSize={elementSize} tintColor={tintColor} titleStyle={titleStyle} barButtonItemStyle={variant === 'done' ? 'prominent' : variant} title={computedTitle} onSelected={() => { }} children={children} identifier={identifier}/>);
|
|
28
|
+
};
|
|
29
|
+
exports.NativeToolbarMenu = NativeToolbarMenu;
|
|
30
|
+
// #endregion
|
|
31
|
+
// #region NativeToolbarMenuAction
|
|
32
|
+
/**
|
|
33
|
+
* Native toolbar menu action - reuses LinkMenuAction.
|
|
34
|
+
*/
|
|
35
|
+
exports.NativeToolbarMenuAction = elements_1.LinkMenuAction;
|
|
36
|
+
/**
|
|
37
|
+
* Native toolbar button component for bottom toolbar.
|
|
38
|
+
* Renders as RouterToolbarItem.
|
|
39
|
+
*/
|
|
40
|
+
const NativeToolbarButton = (props) => {
|
|
41
|
+
const id = (0, react_1.useId)();
|
|
42
|
+
const areChildrenString = typeof props.children === 'string';
|
|
43
|
+
const label = areChildrenString
|
|
44
|
+
? props.children
|
|
45
|
+
: (0, children_1.getFirstChildOfType)(props.children, primitives_1.Label)?.props.children;
|
|
46
|
+
const iconComponent = !props.icon && !areChildrenString ? (0, children_1.getFirstChildOfType)(props.children, primitives_1.Icon) : undefined;
|
|
47
|
+
const icon = props.icon ??
|
|
48
|
+
(iconComponent?.props && 'sf' in iconComponent.props ? iconComponent.props.sf : undefined);
|
|
49
|
+
const sf = typeof icon === 'string' ? icon : undefined;
|
|
50
|
+
return (<native_2.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} onSelected={props.onPress} possibleTitles={props.possibleTitles} selected={props.selected} sharesBackground={!props.separateBackground} systemImageName={sf} title={label} tintColor={props.tintColor} titleStyle={react_native_1.StyleSheet.flatten(props.style)}/>);
|
|
51
|
+
};
|
|
52
|
+
exports.NativeToolbarButton = NativeToolbarButton;
|
|
53
|
+
/**
|
|
54
|
+
* Native toolbar spacer component for bottom toolbar.
|
|
55
|
+
* Renders as RouterToolbarItem with type 'fixedSpacer' or 'fluidSpacer'.
|
|
56
|
+
*/
|
|
57
|
+
const NativeToolbarSpacer = (props) => {
|
|
58
|
+
const id = (0, react_1.useId)();
|
|
59
|
+
return (<native_2.RouterToolbarItem hidesSharedBackground={props.hidesSharedBackground} hidden={props.hidden} identifier={id} sharesBackground={props.sharesBackground} type={props.width ? 'fixedSpacer' : 'fluidSpacer'} width={props.width}/>);
|
|
60
|
+
};
|
|
61
|
+
exports.NativeToolbarSpacer = NativeToolbarSpacer;
|
|
62
|
+
/**
|
|
63
|
+
* Native toolbar search bar slot for bottom toolbar (iOS 26+).
|
|
64
|
+
* Renders as RouterToolbarItem with type 'searchBar'.
|
|
65
|
+
*/
|
|
66
|
+
const NativeToolbarSearchBarSlot = ({ hidesSharedBackground, hidden, sharesBackground, }) => {
|
|
67
|
+
const id = (0, react_1.useId)();
|
|
68
|
+
if (process.env.EXPO_OS !== 'ios' || parseInt(String(react_native_1.Platform.Version).split('.')[0], 10) < 26) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
if (hidden) {
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
return (<native_2.RouterToolbarItem hidesSharedBackground={hidesSharedBackground} identifier={id} sharesBackground={sharesBackground} type="searchBar"/>);
|
|
75
|
+
};
|
|
76
|
+
exports.NativeToolbarSearchBarSlot = NativeToolbarSearchBarSlot;
|
|
77
|
+
/**
|
|
78
|
+
* Native toolbar view component for bottom toolbar.
|
|
79
|
+
* Renders as RouterToolbarItem with children.
|
|
80
|
+
*/
|
|
81
|
+
const NativeToolbarView = ({ children, hidden, hidesSharedBackground, separateBackground, }) => {
|
|
82
|
+
const id = (0, react_1.useId)();
|
|
83
|
+
return (<native_2.RouterToolbarItem hidesSharedBackground={hidesSharedBackground} hidden={hidden} identifier={id} sharesBackground={!separateBackground}>
|
|
84
|
+
{children}
|
|
85
|
+
</native_2.RouterToolbarItem>);
|
|
86
|
+
};
|
|
87
|
+
exports.NativeToolbarView = NativeToolbarView;
|
|
88
|
+
// #endregion
|
|
89
|
+
//# sourceMappingURL=bottom-toolbar-native-elements.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bottom-toolbar-native-elements.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/bottom-toolbar-native-elements.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAEb,iCAA8C;AAC9C,+CAOsB;AAGtB,qDAAwD;AACxD,yDAAuE;AACvE,oDAAkD;AAClD,oDAA4D;AAC5D,sDAA8D;AA8B9D;;;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,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,SAAS,EACT,OAAO,EACP,KAAK,EACL,WAAW,GACZ,EAAE,EAAE;IACH,MAAM,UAAU,GAAG,IAAA,aAAK,GAAE,CAAC;IAC3B,MAAM,KAAK,GAAG,IAAA,8BAAmB,EAAC,QAAQ,EAAE,kBAAK,CAAC,CAAC;IACnD,MAAM,aAAa,GAAG,IAAA,8BAAmB,EAAC,QAAQ,EAAE,iBAAI,CAAC,CAAC;IAE1D,MAAM,aAAa,GAAG,KAAK,IAAI,KAAK,EAAE,KAAK,CAAC,QAAQ,IAAI,EAAE,CAAC;IAC3D,MAAM,YAAY,GAChB,IAAI;QACJ,CAAC,aAAa,EAAE,KAAK,IAAI,IAAI,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7F,MAAM,EAAE,GAAG,OAAO,YAAY,KAAK,QAAQ,CAAC,CA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AC,uBAAQ,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC;QAC/F,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,MAAM,EAAE,CAAC;QACX,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CACL,CAAC,0BAAiB,CAChB,qBAAqB,CAAC,CAAC,qBAAqB,CAAC,CAC7C,UAAU,CAAC,CAAC,EAAE,CAAC,CACf,gBAAgB,CAAC,CAAC,gBAAgB,CAAC,CACnC,IAAI,CAAC,WAAW,EAChB,CACH,CAAC;AACJ,CAAC,CAAC;AApBW,QAAA,0BAA0B,8BAoBrC;AAaF;;;GAGG;AACI,MAAM,iBAAiB,GAAqC,CAAC,EAClE,QAAQ,EACR,MAAM,EACN,qBAAqB,EACrB,kBAAkB,GACnB,EAAE,EAAE;IACH,MAAM,EAAE,GAAG,IAAA,aAAK,GAAE,CAAC;IACnB,OAAO,CACL,CAAC,0BAAiB,CAChB,qBAAqB,CAAC,CAAC,qBAAqB,CAAC,CAC7C,MAAM,CAAC,CAAC,MAAM,CAAC,CACf,UAAU,CAAC,CAAC,EAAE,CAAC,CACf,gBAAgB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CACtC;MAAA,CAAC,QAAQ,CACX;IAAA,EAAE,0BAAiB,CAAC,CACrB,CAAC;AACJ,CAAC,CAAC;AAhBW,QAAA,iBAAiB,qBAgB5B;AAEF,aAAa","sourcesContent":["'use client';\nimport type { ImageRef } from 'expo-image';\nimport { useId, type ReactNode } from 'react';\nimport {\n Platform,\n StyleSheet,\n type ColorValue,\n type ImageSourcePropType,\n type StyleProp,\n type TextStyle,\n} from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { LinkMenuAction } from '../../../link/elements';\nimport { NativeLinkPreviewAction } from '../../../link/preview/native';\nimport { Label, Icon } from '../../../primitives';\nimport { RouterToolbarItem } from '../../../toolbar/native';\nimport { getFirstChildOfType } from '../../../utils/children';\nimport type { BasicTextStyle } from '../../../utils/font';\n\n// #region NativeToolbarMenu\n\nexport interface NativeToolbarMenuProps {\n accessibilityLabel?: string;\n accessibilityHint?: string;\n children?: ReactNode;\n subtitle?: string;\n destructive?: boolean;\n disabled?: boolean;\n hidden?: boolean;\n hidesSharedBackground?: boolean;\n icon?: SFSymbol | ImageSourcePropType;\n // TODO(@ubax): Add useImage support in a follow-up PR.\n /**\n * Image to display for the menu item.\n */\n image?: ImageRef;\n inline?: boolean;\n palette?: boolean;\n separateBackground?: boolean;\n style?: StyleProp<TextStyle>;\n title?: string;\n tintColor?: ColorValue;\n variant?: 'plain' | 'done' | 'prominent';\n elementSize?: 'auto' | 'small' | 'medium' | 'large';\n}\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 destructive,\n children,\n icon,\n image,\n tintColor,\n variant,\n style,\n elementSize,\n}) => {\n const identifier = useId();\n const label = getFirstChildOfType(children, Label);\n const iconComponent = getFirstChildOfType(children, Icon);\n\n const computedTitle = title ?? label?.props.children ?? '';\n const computedIcon =\n icon ??\n (iconComponent?.props && 'sf' in iconComponent.props ? iconComponent.props.sf : undefined);\n const sf = typeof computedIcon === 'string' ? computedIcon : undefined;\n const titleStyle = StyleSheet.flatten(style);\n return (\n <NativeLinkPreviewAction\n sharesBackground={!separateBackground}\n hidesSharedBackground={hidesSharedBackground}\n hidden={hidden}\n icon={sf}\n // TODO(@ubax): Handle image loading using useImage in a follow-up PR.\n image={image}\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={computedTitle}\n onSelected={() => {}}\n children={children}\n identifier={identifier}\n />\n );\n};\n\n// #endregion\n\n// #region NativeToolbarMenuAction\n\n/**\n * Native toolbar menu action - reuses LinkMenuAction.\n */\nexport const NativeToolbarMenuAction = LinkMenuAction;\n\n// #endregion\n\n// #region NativeToolbarButton\n\nexport interface NativeToolbarButtonProps {\n accessibilityLabel?: string;\n accessibilityHint?: string;\n children?: ReactNode;\n disabled?: boolean;\n hidden?: boolean;\n hidesSharedBackground?: boolean;\n icon?: SFSymbol;\n image?: ImageRef;\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}\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 areChildrenString = typeof props.children === 'string';\n const label = areChildrenString\n ? (props.children as string)\n : getFirstChildOfType(props.children, Label)?.props.children;\n const iconComponent =\n !props.icon && !areChildrenString ? getFirstChildOfType(props.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 <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 onSelected={props.onPress}\n possibleTitles={props.possibleTitles}\n selected={props.selected}\n sharesBackground={!props.separateBackground}\n systemImageName={sf}\n title={label}\n tintColor={props.tintColor}\n titleStyle={StyleSheet.flatten(props.style)}\n />\n );\n};\n\n// #endregion\n\n// #region NativeToolbarSpacer\n\nexport interface NativeToolbarSpacerProps {\n hidden?: boolean;\n hidesSharedBackground?: boolean;\n sharesBackground?: boolean;\n width?: number;\n}\n\n/**\n * Native toolbar spacer component for bottom toolbar.\n * Renders as RouterToolbarItem with type 'fixedSpacer' or 'fluidSpacer'.\n */\nexport const NativeToolbarSpacer: React.FC<NativeToolbarSpacerProps> = (props) => {\n const id = useId();\n return (\n <RouterToolbarItem\n hidesSharedBackground={props.hidesSharedBackground}\n hidden={props.hidden}\n identifier={id}\n sharesBackground={props.sharesBackground}\n type={props.width ? 'fixedSpacer' : 'fluidSpacer'}\n width={props.width}\n />\n );\n};\n\n// #endregion\n\n// #region NativeToolbarSearchBarSlot\n\nexport interface NativeToolbarSearchBarSlotProps {\n hidesSharedBackground?: boolean;\n hidden?: boolean;\n sharesBackground?: boolean;\n}\n\n/**\n * Native toolbar search bar slot for bottom toolbar (iOS 26+).\n * Renders as RouterToolbarItem with type 'searchBar'.\n */\nexport const NativeToolbarSearchBarSlot: React.FC<NativeToolbarSearchBarSlotProps> = ({\n hidesSharedBackground,\n hidden,\n sharesBackground,\n}) => {\n const id = useId();\n if (process.env.EXPO_OS !== 'ios' || parseInt(String(Platform.Version).split('.')[0], 10) < 26) {\n return null;\n }\n if (hidden) {\n return null;\n }\n return (\n <RouterToolbarItem\n hidesSharedBackground={hidesSharedBackground}\n identifier={id}\n sharesBackground={sharesBackground}\n type=\"searchBar\"\n />\n );\n};\n\n// #endregion\n\n// #region NativeToolbarView\n\nexport interface NativeToolbarViewProps {\n children?: ReactNode;\n hidden?: boolean;\n hidesSharedBackground?: boolean;\n separateBackground?: boolean;\n}\n\n/**\n * Native toolbar view component for bottom toolbar.\n * Renders as RouterToolbarItem with children.\n */\nexport const NativeToolbarView: React.FC<NativeToolbarViewProps> = ({\n children,\n hidden,\n hidesSharedBackground,\n separateBackground,\n}) => {\n const id = useId();\n return (\n <RouterToolbarItem\n hidesSharedBackground={hidesSharedBackground}\n hidden={hidden}\n identifier={id}\n sharesBackground={!separateBackground}>\n {children}\n </RouterToolbarItem>\n );\n};\n\n// #endregion\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type ToolbarPlacement = 'left' | 'right' | 'bottom';
|
|
2
|
+
/**
|
|
3
|
+
* Context to track which toolbar placement the current component is in.
|
|
4
|
+
* This allows shared components (Button, Menu, Spacer, etc.) to behave
|
|
5
|
+
* differently based on their placement.
|
|
6
|
+
*/
|
|
7
|
+
export declare const ToolbarPlacementContext: import("react").Context<ToolbarPlacement | null>;
|
|
8
|
+
export declare function useToolbarPlacement(): ToolbarPlacement | null;
|
|
9
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/context.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3D;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,kDAA+C,CAAC;AAEpF,wBAAgB,mBAAmB,IAAI,gBAAgB,GAAG,IAAI,CAE7D"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ToolbarPlacementContext = void 0;
|
|
5
|
+
exports.useToolbarPlacement = useToolbarPlacement;
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
/**
|
|
8
|
+
* Context to track which toolbar placement the current component is in.
|
|
9
|
+
* This allows shared components (Button, Menu, Spacer, etc.) to behave
|
|
10
|
+
* differently based on their placement.
|
|
11
|
+
*/
|
|
12
|
+
exports.ToolbarPlacementContext = (0, react_1.createContext)(null);
|
|
13
|
+
function useToolbarPlacement() {
|
|
14
|
+
return (0, react_1.useContext)(exports.ToolbarPlacementContext);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/context.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AAYb,kDAEC;AAbD,iCAAkD;AAIlD;;;;GAIG;AACU,QAAA,uBAAuB,GAAG,IAAA,qBAAa,EAA0B,IAAI,CAAC,CAAC;AAEpF,SAAgB,mBAAmB;IACjC,OAAO,IAAA,kBAAU,EAAC,+BAAuB,CAAC,CAAC;AAC7C,CAAC","sourcesContent":["'use client';\nimport { createContext, useContext } from 'react';\n\nexport type ToolbarPlacement = 'left' | 'right' | 'bottom';\n\n/**\n * Context to track which toolbar placement the current component is in.\n * This allows shared components (Button, Menu, Spacer, etc.) to behave\n * differently based on their placement.\n */\nexport const ToolbarPlacementContext = createContext<ToolbarPlacement | null>(null);\n\nexport function useToolbarPlacement(): ToolbarPlacement | null {\n return useContext(ToolbarPlacementContext);\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { StackToolbarBadge, StackToolbarIcon, StackToolbarLabel, type StackToolbarBadgeProps, type StackToolbarIconProps, type StackToolbarLabelProps, } from '../common-primitives';
|
|
2
|
+
export { StackToolbar } from './StackToolbar';
|
|
3
|
+
export { appendStackToolbarPropsToOptions, type StackToolbarProps } from './StackToolbarClient';
|
|
4
|
+
export { StackToolbarButton, type StackToolbarButtonProps } from './StackToolbarButton';
|
|
5
|
+
export { StackToolbarMenu, StackToolbarMenuAction, type StackToolbarMenuProps, type StackToolbarMenuActionProps, } from './StackToolbarMenu';
|
|
6
|
+
export { StackToolbarSearchBarSlot, type StackToolbarSearchBarSlotProps, } from './StackToolbarSearchBarSlot';
|
|
7
|
+
export { StackToolbarSpacer, type StackToolbarSpacerProps } from './StackToolbarSpacer';
|
|
8
|
+
export { StackToolbarView, type StackToolbarViewProps } from './StackToolbarView';
|
|
9
|
+
export type { ToolbarPlacement } from './context';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,gCAAgC,EAAE,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEhG,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAExF,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,GACjC,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,yBAAyB,EACzB,KAAK,8BAA8B,GACpC,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,kBAAkB,EAAE,KAAK,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAExF,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAElF,YAAY,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StackToolbarView = exports.StackToolbarSpacer = exports.StackToolbarSearchBarSlot = exports.StackToolbarMenuAction = exports.StackToolbarMenu = exports.StackToolbarButton = exports.appendStackToolbarPropsToOptions = exports.StackToolbar = exports.StackToolbarLabel = exports.StackToolbarIcon = exports.StackToolbarBadge = void 0;
|
|
4
|
+
var common_primitives_1 = require("../common-primitives");
|
|
5
|
+
Object.defineProperty(exports, "StackToolbarBadge", { enumerable: true, get: function () { return common_primitives_1.StackToolbarBadge; } });
|
|
6
|
+
Object.defineProperty(exports, "StackToolbarIcon", { enumerable: true, get: function () { return common_primitives_1.StackToolbarIcon; } });
|
|
7
|
+
Object.defineProperty(exports, "StackToolbarLabel", { enumerable: true, get: function () { return common_primitives_1.StackToolbarLabel; } });
|
|
8
|
+
var StackToolbar_1 = require("./StackToolbar");
|
|
9
|
+
Object.defineProperty(exports, "StackToolbar", { enumerable: true, get: function () { return StackToolbar_1.StackToolbar; } });
|
|
10
|
+
var StackToolbarClient_1 = require("./StackToolbarClient");
|
|
11
|
+
Object.defineProperty(exports, "appendStackToolbarPropsToOptions", { enumerable: true, get: function () { return StackToolbarClient_1.appendStackToolbarPropsToOptions; } });
|
|
12
|
+
var StackToolbarButton_1 = require("./StackToolbarButton");
|
|
13
|
+
Object.defineProperty(exports, "StackToolbarButton", { enumerable: true, get: function () { return StackToolbarButton_1.StackToolbarButton; } });
|
|
14
|
+
var StackToolbarMenu_1 = require("./StackToolbarMenu");
|
|
15
|
+
Object.defineProperty(exports, "StackToolbarMenu", { enumerable: true, get: function () { return StackToolbarMenu_1.StackToolbarMenu; } });
|
|
16
|
+
Object.defineProperty(exports, "StackToolbarMenuAction", { enumerable: true, get: function () { return StackToolbarMenu_1.StackToolbarMenuAction; } });
|
|
17
|
+
var StackToolbarSearchBarSlot_1 = require("./StackToolbarSearchBarSlot");
|
|
18
|
+
Object.defineProperty(exports, "StackToolbarSearchBarSlot", { enumerable: true, get: function () { return StackToolbarSearchBarSlot_1.StackToolbarSearchBarSlot; } });
|
|
19
|
+
var StackToolbarSpacer_1 = require("./StackToolbarSpacer");
|
|
20
|
+
Object.defineProperty(exports, "StackToolbarSpacer", { enumerable: true, get: function () { return StackToolbarSpacer_1.StackToolbarSpacer; } });
|
|
21
|
+
var StackToolbarView_1 = require("./StackToolbarView");
|
|
22
|
+
Object.defineProperty(exports, "StackToolbarView", { enumerable: true, get: function () { return StackToolbarView_1.StackToolbarView; } });
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/layouts/stack-utils/toolbar/index.tsx"],"names":[],"mappings":";;;AAAA,0DAO8B;AAN5B,sHAAA,iBAAiB,OAAA;AACjB,qHAAA,gBAAgB,OAAA;AAChB,sHAAA,iBAAiB,OAAA;AAMnB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AAErB,2DAAgG;AAAvF,sIAAA,gCAAgC,OAAA;AAEzC,2DAAwF;AAA/E,wHAAA,kBAAkB,OAAA;AAE3B,uDAK4B;AAJ1B,oHAAA,gBAAgB,OAAA;AAChB,0HAAA,sBAAsB,OAAA;AAKxB,yEAGqC;AAFnC,sIAAA,yBAAyB,OAAA;AAI3B,2DAAwF;AAA/E,wHAAA,kBAAkB,OAAA;AAE3B,uDAAkF;AAAzE,oHAAA,gBAAgB,OAAA","sourcesContent":["export {\n StackToolbarBadge,\n StackToolbarIcon,\n StackToolbarLabel,\n type StackToolbarBadgeProps,\n type StackToolbarIconProps,\n type StackToolbarLabelProps,\n} from '../common-primitives';\n\nexport { StackToolbar } from './StackToolbar';\n\nexport { appendStackToolbarPropsToOptions, type StackToolbarProps } from './StackToolbarClient';\n\nexport { StackToolbarButton, type StackToolbarButtonProps } from './StackToolbarButton';\n\nexport {\n StackToolbarMenu,\n StackToolbarMenuAction,\n type StackToolbarMenuProps,\n type StackToolbarMenuActionProps,\n} from './StackToolbarMenu';\n\nexport {\n StackToolbarSearchBarSlot,\n type StackToolbarSearchBarSlotProps,\n} from './StackToolbarSearchBarSlot';\n\nexport { StackToolbarSpacer, type StackToolbarSpacerProps } from './StackToolbarSpacer';\n\nexport { StackToolbarView, type StackToolbarViewProps } from './StackToolbarView';\n\nexport type { ToolbarPlacement } from './context';\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkWithPreview.d.ts","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+C,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"LinkWithPreview.d.ts","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA+C,MAAM,OAAO,CAAC;AASpE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAIrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAM3C,UAAU,oBAAqB,SAAQ,SAAS;IAC9C,wBAAwB,EAAE,IAAI,CAAC;CAChC;AAED,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,oBAAoB,qBA2H1E"}
|
|
@@ -40,6 +40,7 @@ const react_native_1 = require("react-native");
|
|
|
40
40
|
const hooks_1 = require("../hooks");
|
|
41
41
|
const BaseExpoRouterLink_1 = require("./BaseExpoRouterLink");
|
|
42
42
|
const InternalLinkPreviewContext_1 = require("./InternalLinkPreviewContext");
|
|
43
|
+
const NativeMenuContext_1 = require("./NativeMenuContext");
|
|
43
44
|
const elements_1 = require("./elements");
|
|
44
45
|
const href_1 = require("./href");
|
|
45
46
|
const LinkPreviewContext_1 = require("./preview/LinkPreviewContext");
|
|
@@ -121,11 +122,13 @@ function LinkWithPreview({ children, ...rest }) {
|
|
|
121
122
|
router.navigate(rest.hrefForPreviewNavigation, { __internal__PreviewKey: nextScreenId });
|
|
122
123
|
}
|
|
123
124
|
}} style={{ display: 'contents' }} disableForceFlatten>
|
|
124
|
-
<
|
|
125
|
-
<
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
125
|
+
<NativeMenuContext_1.NativeMenuContext value>
|
|
126
|
+
<InternalLinkPreviewContext_1.InternalLinkPreviewContext value={{ isVisible: isCurrentPreviewOpen, href: rest.hrefForPreviewNavigation }}>
|
|
127
|
+
<BaseExpoRouterLink_1.BaseExpoRouterLink {...rest} children={trigger} ref={rest.ref}/>
|
|
128
|
+
{preview}
|
|
129
|
+
{menuElement}
|
|
130
|
+
</InternalLinkPreviewContext_1.InternalLinkPreviewContext>
|
|
131
|
+
</NativeMenuContext_1.NativeMenuContext>
|
|
129
132
|
</native_1.NativeLinkPreview>);
|
|
130
133
|
}
|
|
131
134
|
//# sourceMappingURL=LinkWithPreview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkWithPreview.js","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"LinkWithPreview.js","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBb,0CA2HC;AAlJD,+CAAoE;AACpE,+CAAwC;AAExC,oCAAqC;AACrC,6DAA0D;AAC1D,6EAA0E;AAC1E,2DAAwD;AACxD,yCAAgE;AAChE,iCAAqC;AAErC,qEAAqE;AACrE,6CAAqD;AACrD,+DAA4D;AAE5D,gDAAwD;AACxD,sCAAoD;AAEpD,MAAM,KAAK,GAAG,uBAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,uBAAQ,CAAC,KAAK,CAAC;AAMtD,SAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAwB;IACzE,MAAM,MAAM,GAAG,IAAA,iBAAS,GAAE,CAAC;IAC3B,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAA,0CAAqB,GAAE,CAAC;IACtD,MAAM,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEvE,MAAM,gBAAgB,GAAG,IAAA,kBAAW,EAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACl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EAAE,UAAU,EAAE,CAAC,CAC/B,mBAAmB,CACnB;MAAA,CAAC,qCAAiB,CAAC,KAAK,CACtB;QAAA,CAAC,uDAA0B,CACzB,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAChF;UAAA,CAAC,uCAAkB,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAC/D;UAAA,CAAC,OAAO,CACR;UAAA,CAAC,WAAW,CACd;QAAA,EAAE,uDAA0B,CAC9B;MAAA,EAAE,qCAAiB,CACrB;IAAA,EAAE,0BAAiB,CAAC,CACrB,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport React, { useEffect, useMemo, useRef, useState } from 'react';\nimport { Platform } from 'react-native';\n\nimport { useRouter } from '../hooks';\nimport { BaseExpoRouterLink } from './BaseExpoRouterLink';\nimport { InternalLinkPreviewContext } from './InternalLinkPreviewContext';\nimport { NativeMenuContext } from './NativeMenuContext';\nimport { LinkMenu, LinkPreview, LinkTrigger } from './elements';\nimport { resolveHref } from './href';\nimport type { Href } from '../types';\nimport { useLinkPreviewContext } from './preview/LinkPreviewContext';\nimport { NativeLinkPreview } from './preview/native';\nimport { useNextScreenId } from './preview/useNextScreenId';\nimport { LinkProps } from './useLinkHooks';\nimport { getFirstChildOfType } from '../utils/children';\nimport { shouldLinkExternally } from '../utils/url';\n\nconst isPad = Platform.OS === 'ios' && Platform.isPad;\n\ninterface LinkWithPreviewProps extends LinkProps {\n hrefForPreviewNavigation: Href;\n}\n\nexport function LinkWithPreview({ children, ...rest }: LinkWithPreviewProps) {\n const router = useRouter();\n const { setOpenPreviewKey } = useLinkPreviewContext();\n const [isCurrentPreviewOpen, setIsCurrenPreviewOpen] = useState(false);\n\n const hrefWithoutQuery = resolveHref(rest.hrefForPreviewNavigation).split('?')[0];\n const prevHrefWithoutQuery = useRef(hrefWithoutQuery);\n\n useEffect(() => {\n if (isCurrentPreviewOpen) {\n if (prevHrefWithoutQuery.current !== hrefWithoutQuery) {\n throw new Error(\n 'Link does not support changing the href prop after the preview has been opened. Please ensure that the href prop is stable and does not change between renders.'\n );\n }\n } else {\n prevHrefWithoutQuery.current = hrefWithoutQuery;\n }\n }, [hrefWithoutQuery]);\n\n const [{ nextScreenId, tabPath }, prefetch] = useNextScreenId();\n\n useEffect(() => {\n if (rest.replace) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Using replace links with preview is not supported');\n } else {\n console.warn('Using replace links with preview is not supported');\n }\n }\n }, [rest.href, rest.replace]);\n\n const triggerElement = React.useMemo(\n () => getFirstChildOfType(children, LinkTrigger),\n [children]\n );\n const menuElement = React.useMemo(() => getFirstChildOfType(children, LinkMenu), [children]);\n const previewElement = React.useMemo(\n () => getFirstChildOfType(children, LinkPreview),\n [children]\n );\n\n if ((previewElement || menuElement) && !triggerElement) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'When you use Link.Preview, you must use Link.Trigger to specify the trigger element.'\n );\n } else {\n console.warn(\n 'When you use Link.Preview, you must use Link.Trigger to specify the trigger element.'\n );\n }\n }\n\n const trigger = React.useMemo(\n () => triggerElement ?? <LinkTrigger>{children}</LinkTrigger>,\n [triggerElement, children]\n );\n\n const preview = React.useMemo(\n () => (shouldLinkExternally(String(rest.href)) || !previewElement ? null : previewElement),\n [previewElement, rest.href]\n );\n\n const isPreviewTapped = useRef(false);\n\n const tabPathValue = useMemo(\n () => ({\n path: tabPath,\n }),\n [tabPath]\n );\n\n const hasPreview = !!previewElement;\n\n if (rest.replace) {\n return <BaseExpoRouterLink children={children} {...rest} />;\n }\n\n return (\n <NativeLinkPreview\n nextScreenId={isPad ? undefined : nextScreenId}\n tabPath={isPad ? undefined : tabPathValue}\n onWillPreviewOpen={() => {\n if (hasPreview) {\n isPreviewTapped.current = false;\n prefetch(rest.hrefForPreviewNavigation);\n setIsCurrenPreviewOpen(true);\n }\n }}\n onPreviewWillClose={() => {\n if (hasPreview) {\n setIsCurrenPreviewOpen(false);\n // When preview was not tapped, then we need to enable the screen stack animation\n // Otherwise this will happen in StackNavigator, when new screen is opened\n if (!isPreviewTapped.current || isPad) {\n setOpenPreviewKey(undefined);\n }\n }\n }}\n onPreviewDidClose={() => {\n if (hasPreview && isPreviewTapped.current && isPad) {\n router.navigate(rest.hrefForPreviewNavigation, { __internal__PreviewKey: nextScreenId });\n }\n }}\n onPreviewTapped={() => {\n isPreviewTapped.current = true;\n if (!isPad) {\n router.navigate(rest.hrefForPreviewNavigation, { __internal__PreviewKey: nextScreenId });\n }\n }}\n style={{ display: 'contents' }}\n disableForceFlatten>\n <NativeMenuContext value>\n <InternalLinkPreviewContext\n value={{ isVisible: isCurrentPreviewOpen, href: rest.hrefForPreviewNavigation }}>\n <BaseExpoRouterLink {...rest} children={trigger} ref={rest.ref} />\n {preview}\n {menuElement}\n </InternalLinkPreviewContext>\n </NativeMenuContext>\n </NativeLinkPreview>\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeMenuContext.d.ts","sourceRoot":"","sources":["../../src/link/NativeMenuContext.tsx"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,iBAAiB,kCAAgC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NativeMenuContext = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
/**
|
|
6
|
+
* Context to indicate if native menu in toolbar or link preview can be used.
|
|
7
|
+
*/
|
|
8
|
+
exports.NativeMenuContext = (0, react_1.createContext)(false);
|
|
9
|
+
//# sourceMappingURL=NativeMenuContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeMenuContext.js","sourceRoot":"","sources":["../../src/link/NativeMenuContext.tsx"],"names":[],"mappings":";;;AAAA,iCAAsC;AAEtC;;GAEG;AACU,QAAA,iBAAiB,GAAG,IAAA,qBAAa,EAAU,KAAK,CAAC,CAAC","sourcesContent":["import { createContext } from 'react';\n\n/**\n * Context to indicate if native menu in toolbar or link preview can be used.\n */\nexport const NativeMenuContext = createContext<boolean>(false);\n"]}
|
package/build/link/elements.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ImageRef } from 'expo-image';
|
|
1
2
|
import React, { type PropsWithChildren, type ReactNode } from 'react';
|
|
2
3
|
import type { ViewStyle } from 'react-native';
|
|
3
4
|
import type { SFSymbol } from 'sf-symbols-typescript';
|
|
@@ -34,6 +35,26 @@ export interface LinkMenuActionProps {
|
|
|
34
35
|
* SF Symbol displayed alongside the menu item.
|
|
35
36
|
*/
|
|
36
37
|
icon?: SFSymbol;
|
|
38
|
+
/**
|
|
39
|
+
* Custom image loaded using `useImage()` hook from `expo-image`.
|
|
40
|
+
* Takes priority over `icon` (SF Symbol) when both are provided.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```tsx
|
|
44
|
+
* import { useImage } from 'expo-image';
|
|
45
|
+
* import { Link } from 'expo-router';
|
|
46
|
+
*
|
|
47
|
+
* const customIcon = useImage('https://simpleicons.org/icons/expo.svg', {
|
|
48
|
+
* maxWidth: 24,
|
|
49
|
+
* maxHeight: 24,
|
|
50
|
+
* });
|
|
51
|
+
*
|
|
52
|
+
* <Link.Menu title="Menu">
|
|
53
|
+
* <Link.MenuAction image={customIcon} title="Action" onPress={() => {}} />
|
|
54
|
+
* </Link.Menu>
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
image?: ImageRef | null;
|
|
37
58
|
/**
|
|
38
59
|
* If `true`, the menu item will be displayed as selected.
|
|
39
60
|
*/
|
|
@@ -84,6 +105,26 @@ export interface LinkMenuProps {
|
|
|
84
105
|
* Optional SF Symbol displayed alongside the menu item.
|
|
85
106
|
*/
|
|
86
107
|
icon?: SFSymbol;
|
|
108
|
+
/**
|
|
109
|
+
* Custom image loaded using `useImage()` hook from `expo-image`.
|
|
110
|
+
* Takes priority over `icon` (SF Symbol) when both are provided.
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```tsx
|
|
114
|
+
* import { useImage } from 'expo-image';
|
|
115
|
+
* import { Link } from 'expo-router';
|
|
116
|
+
*
|
|
117
|
+
* const customIcon = useImage('https://simpleicons.org/icons/expo.svg', {
|
|
118
|
+
* maxWidth: 24,
|
|
119
|
+
* maxHeight: 24,
|
|
120
|
+
* });
|
|
121
|
+
*
|
|
122
|
+
* <Link.Menu image={customIcon} title="Menu">
|
|
123
|
+
* <Link.MenuAction title="Action" onPress={() => {}} />
|
|
124
|
+
* </Link.Menu>
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
image?: ImageRef | null;
|
|
87
128
|
/**
|
|
88
129
|
* If `true`, the menu will be displayed as a palette.
|
|
89
130
|
* This means that the menu will be displayed as one row.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/link/elements.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,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;
|
|
1
|
+
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/link/elements.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,EAA8B,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAClG,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9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CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;IACpD,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAsB5C,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,GAAG,QAAQ,CAAC,GAAG;IAChF;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;OAIG;IACH,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,4BAwBlD;AAED,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD;;;;;;;;OAQG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,WAAW,CAAC,EAAE,aAAa,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,mSAgBxE"}
|
package/build/link/elements.js
CHANGED
|
@@ -40,6 +40,7 @@ exports.LinkPreview = LinkPreview;
|
|
|
40
40
|
exports.LinkTrigger = LinkTrigger;
|
|
41
41
|
const react_1 = __importStar(require("react"));
|
|
42
42
|
const InternalLinkPreviewContext_1 = require("./InternalLinkPreviewContext");
|
|
43
|
+
const NativeMenuContext_1 = require("./NativeMenuContext");
|
|
43
44
|
const primitives_1 = require("../primitives");
|
|
44
45
|
const HrefPreview_1 = require("./preview/HrefPreview");
|
|
45
46
|
const PreviewRouteContext_1 = require("./preview/PreviewRouteContext");
|
|
@@ -57,7 +58,7 @@ const children_1 = require("../utils/children");
|
|
|
57
58
|
*/
|
|
58
59
|
function LinkMenuAction(props) {
|
|
59
60
|
const identifier = (0, react_1.useId)();
|
|
60
|
-
if ((0, PreviewRouteContext_1.useIsPreview)() || process.env.EXPO_OS !== 'ios' || !(0, react_1.use)(
|
|
61
|
+
if ((0, PreviewRouteContext_1.useIsPreview)() || process.env.EXPO_OS !== 'ios' || !(0, react_1.use)(NativeMenuContext_1.NativeMenuContext)) {
|
|
61
62
|
return null;
|
|
62
63
|
}
|
|
63
64
|
const { unstable_keepPresented, onPress, children, title, ...rest } = props;
|
|
@@ -91,7 +92,7 @@ function LinkMenuAction(props) {
|
|
|
91
92
|
*/
|
|
92
93
|
const LinkMenu = (props) => {
|
|
93
94
|
const identifier = (0, react_1.useId)();
|
|
94
|
-
if ((0, PreviewRouteContext_1.useIsPreview)() || process.env.EXPO_OS !== 'ios' || !(0, react_1.use)(
|
|
95
|
+
if ((0, PreviewRouteContext_1.useIsPreview)() || process.env.EXPO_OS !== 'ios' || !(0, react_1.use)(NativeMenuContext_1.NativeMenuContext)) {
|
|
95
96
|
return null;
|
|
96
97
|
}
|
|
97
98
|
const children = react_1.default.Children.toArray(props.children).filter((child) => (0, react_1.isValidElement)(child) && (child.type === LinkMenuAction || child.type === exports.LinkMenu));
|
|
@@ -1 +1 @@
|
|
|
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,uEAA6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;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,WAAW,CAAC,EAAE,aAAa,EAAE,GAAG,KAAK,EAAoB;IACvE,IAAI,eAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAA,sBAAc,EAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChF,6EAA6E;QAC7E,qGAAqG;QACrG,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;YAC7D,MAAM,IAAI,KAAK,CACb,gHAAgH,CACjH,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC;IACxB,CAAC;IACD,MAAM,OAAO,GAAG,CAAC,WAAI,CAAC,IAAI,KAAK,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 * 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"]}
|
|
1
|
+
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/link/elements.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0Gb,wCA0BC;AAmLD,kCAwBC;AAkCD,kCAgBC;AA9XD,+CAAkG;AAIlG,6EAA0E;AAC1E,2DAAwD;AACxD,8CAA4C;AAC5C,uDAAoD;AACpD,uEAA6D;AAC7D,6CAAqF;AACrF,qCAAkC;AAClC,4DAAuD;AACvD,gDAAwD;AAmFxD;;;;;;;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,qCAAiB,CAAC,EAAE,CAAC;QAC/E,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,kBAAK,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC;IACzD,MAAM,aAAa,GACjB,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,IAAA,8BAAmB,EAAC,QAAQ,EAAE,iBAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACtF,MAAM,IAAI,GACR,KAAK,CAAC,IAAI;QACV,CAAC,aAAa,EAAE,KA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C;SAAM,CAAC;QACN,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,yBAAW,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAG,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3D,CAAC;IAED,OAAO,CACL,CAAC,iCAAwB,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,CAAC,oBAAoB,CAAC,CAAC,WAAW,CAAC,CAC9E;MAAA,CAAC,OAAO,CACV;IAAA,EAAE,iCAAwB,CAAC,CAC5B,CAAC;AACJ,CAAC;AAeD;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,WAAW,CAAC,EAAE,aAAa,EAAE,GAAG,KAAK,EAAoB;IACvE,IAAI,eAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAA,sBAAc,EAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChF,6EAA6E;QAC7E,qGAAqG;QACrG,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;YAC7D,MAAM,IAAI,KAAK,CACb,gHAAgH,CACjH,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC;IACxB,CAAC;IACD,MAAM,OAAO,GAAG,CAAC,WAAI,CAAC,IAAI,KAAK,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 type { ImageRef } from 'expo-image';\nimport React, { isValidElement, use, useId, type PropsWithChildren, type ReactNode } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { InternalLinkPreviewContext } from './InternalLinkPreviewContext';\nimport { NativeMenuContext } from './NativeMenuContext';\nimport { Icon, Label } from '../primitives';\nimport { HrefPreview } from './preview/HrefPreview';\nimport { useIsPreview } from './preview/PreviewRouteContext';\nimport { NativeLinkPreviewAction, NativeLinkPreviewContent } from './preview/native';\nimport { Slot } from '../ui/Slot';\nimport { LinkAppleZoom } from './zoom/link-apple-zoom';\nimport { getFirstChildOfType } from '../utils/children';\n\nexport interface LinkMenuActionProps {\n /**\n * The title of the menu item.\n */\n children?: ReactNode;\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/destructive) for more information.\n */\n destructive?: boolean;\n /**\n * If `true`, the menu item will be disabled and not selectable.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/disabled) for more information.\n */\n disabled?: boolean;\n /**\n * An elaborated title that explains the purpose of the action.\n */\n discoverabilityLabel?: string;\n /**\n * Whether the menu element should be hidden.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/hidden) for more information.\n *\n * @default false\n */\n hidden?: boolean;\n // TODO: support ImageSourcePropType icons in addition to SFSymbols\n /**\n * SF Symbol displayed alongside the menu item.\n */\n icon?: SFSymbol;\n /**\n * Custom image loaded using `useImage()` hook from `expo-image`.\n * Takes priority over `icon` (SF Symbol) when both are provided.\n *\n * @example\n * ```tsx\n * import { useImage } from 'expo-image';\n * import { Link } from 'expo-router';\n *\n * const customIcon = useImage('https://simpleicons.org/icons/expo.svg', {\n * maxWidth: 24,\n * maxHeight: 24,\n * });\n *\n * <Link.Menu title=\"Menu\">\n * <Link.MenuAction image={customIcon} title=\"Action\" onPress={() => {}} />\n * </Link.Menu>\n * ```\n */\n image?: ImageRef | null;\n /**\n * 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(NativeMenuContext)) {\n return null;\n }\n const { unstable_keepPresented, onPress, children, title, ...rest } = props;\n const areChildrenString = typeof children === 'string';\n const label = areChildrenString\n ? (children as string)\n : getFirstChildOfType(children, Label)?.props.children;\n const iconComponent =\n !props.icon && !areChildrenString ? getFirstChildOfType(children, Icon) : undefined;\n const icon =\n props.icon ??\n (iconComponent?.props && 'sf' in iconComponent.props ? iconComponent.props.sf : undefined);\n const sf = typeof icon === 'string' ? icon : undefined;\n 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 * Custom image loaded using `useImage()` hook from `expo-image`.\n * Takes priority over `icon` (SF Symbol) when both are provided.\n *\n * @example\n * ```tsx\n * import { useImage } from 'expo-image';\n * import { Link } from 'expo-router';\n *\n * const customIcon = useImage('https://simpleicons.org/icons/expo.svg', {\n * maxWidth: 24,\n * maxHeight: 24,\n * });\n *\n * <Link.Menu image={customIcon} title=\"Menu\">\n * <Link.MenuAction title=\"Action\" onPress={() => {}} />\n * </Link.Menu>\n * ```\n */\n image?: ImageRef | null;\n /**\n * If `true`, the menu will be displayed as a palette.\n * This means that the menu will be displayed as one row.\n * The `elementSize` property is ignored when palette is used, all items will be `elementSize=\"small\"`. Use `elementSize=\"medium\"` instead of `palette` to display actions with titles horizontally.\n *\n * > **Note**: Palette menus are only supported in submenus.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette) for more information.\n */\n palette?: boolean;\n /**\n * @deprecated Use `palette` prop instead.\n */\n displayAsPalette?: boolean;\n /**\n * If `true`, the menu will be displayed inline.\n * This means that the menu will not be collapsed\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline) for more information.\n */\n inline?: boolean;\n /**\n * @deprecated Use `inline` prop instead.\n */\n displayInline?: boolean;\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/destructive) for more information.\n */\n destructive?: boolean;\n /**\n * The preferred size of the menu elements.\n * `elementSize` property is ignored when `palette` is used.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/preferredelementsize) for more information.\n *\n * @platform iOS 16.0+\n */\n elementSize?: 'small' | 'medium' | 'large' | 'auto';\n children?: React.ReactNode;\n}\n\n/**\n * Groups context menu actions for a link.\n *\n * If multiple `Link.Menu` components are used within a single `Link`, only the first will be rendered.\n * Only `Link.MenuAction` and `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(NativeMenuContext)) {\n return null;\n }\n const children = React.Children.toArray(props.children).filter(\n (child) => isValidElement(child) && (child.type === LinkMenuAction || child.type === LinkMenu)\n );\n const displayAsPalette = props.palette ?? props.displayAsPalette;\n const displayInline = props.inline ?? props.displayInline;\n return (\n <NativeLinkPreviewAction\n {...props}\n displayAsPalette={displayAsPalette}\n displayInline={displayInline}\n preferredElementSize={props.elementSize}\n title={props.title ?? ''}\n onSelected={() => {}}\n children={children}\n identifier={identifier}\n />\n );\n};\n\nexport type LinkPreviewStyle = Omit<ViewStyle, 'position' | 'width' | 'height'> & {\n /**\n * Sets the preferred width of the preview.\n * If not set, full width of the screen will be used.\n *\n * This is only **preferred** width, the actual width may be different\n */\n width?: number;\n\n /**\n * Sets the preferred height of the preview.\n * If not set, full height of the screen will be used.\n *\n * This is only **preferred** height, the actual height may be different\n */\n height?: number;\n};\n\nexport interface LinkPreviewProps {\n children?: React.ReactNode;\n /**\n * Custom styles for the preview container.\n *\n * Note that some styles may not work, as they are limited or reset by the native view\n */\n style?: LinkPreviewStyle;\n}\n\n/**\n * A component used to render and customize the link preview.\n *\n * If `Link.Preview` is used without any props, it will render a preview of the `href` passed to the `Link`.\n *\n * If multiple `Link.Preview` components are used within a single `Link`, only the first one will be rendered.\n *\n * To customize the preview, you can pass custom content as children.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Preview>\n * <Text>Custom Preview Content</Text>\n * </Link.Preview>\n * </Link>\n * ```\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Preview />\n * </Link>\n * ```\n *\n * > **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,3 +1,4 @@
|
|
|
1
|
+
import type { ImageRef } from 'expo-image';
|
|
1
2
|
import { type PropsWithChildren } from 'react';
|
|
2
3
|
import { type ViewProps, type ColorValue } from 'react-native';
|
|
3
4
|
import type { BasicTextStyle } from '../../utils/font';
|
|
@@ -5,6 +6,7 @@ export interface NativeLinkPreviewActionProps {
|
|
|
5
6
|
identifier: string;
|
|
6
7
|
title: string;
|
|
7
8
|
icon?: string;
|
|
9
|
+
image?: ImageRef | null;
|
|
8
10
|
children?: React.ReactNode;
|
|
9
11
|
disabled?: boolean;
|
|
10
12
|
destructive?: boolean;
|