expo-router 7.0.0-canary-20251216-6e1f9a7 → 7.0.0-canary-20251223-b83b31e
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/color/index.d.ts +44 -0
- package/build/color/index.d.ts.map +1 -1
- package/build/color/index.js +69 -5
- package/build/color/index.js.map +1 -1
- package/build/exports.d.ts +1 -0
- package/build/exports.d.ts.map +1 -1
- package/build/exports.js +3 -1
- package/build/exports.js.map +1 -1
- package/build/layouts/StackClient.d.ts +3 -3
- package/build/layouts/stack-utils/StackHeaderButton.d.ts +77 -2
- package/build/layouts/stack-utils/StackHeaderButton.d.ts.map +1 -1
- package/build/layouts/stack-utils/StackHeaderButton.js +3 -0
- package/build/layouts/stack-utils/StackHeaderButton.js.map +1 -1
- package/build/layouts/stack-utils/StackHeaderComponent.d.ts +84 -1
- package/build/layouts/stack-utils/StackHeaderComponent.d.ts.map +1 -1
- package/build/layouts/stack-utils/StackHeaderComponent.js +54 -1
- package/build/layouts/stack-utils/StackHeaderComponent.js.map +1 -1
- package/build/layouts/stack-utils/StackHeaderLeftRight.d.ts +107 -3
- package/build/layouts/stack-utils/StackHeaderLeftRight.d.ts.map +1 -1
- package/build/layouts/stack-utils/StackHeaderLeftRight.js +108 -13
- package/build/layouts/stack-utils/StackHeaderLeftRight.js.map +1 -1
- package/build/layouts/stack-utils/StackHeaderMenu.d.ts +83 -7
- package/build/layouts/stack-utils/StackHeaderMenu.d.ts.map +1 -1
- package/build/layouts/stack-utils/StackHeaderMenu.js +14 -4
- package/build/layouts/stack-utils/StackHeaderMenu.js.map +1 -1
- package/build/layouts/stack-utils/StackHeaderSpacer.d.ts +7 -1
- package/build/layouts/stack-utils/StackHeaderSpacer.d.ts.map +1 -1
- package/build/layouts/stack-utils/StackHeaderSpacer.js +5 -2
- package/build/layouts/stack-utils/StackHeaderSpacer.js.map +1 -1
- package/build/layouts/stack-utils/{StackHeaderItem.d.ts → StackHeaderView.d.ts} +18 -5
- package/build/layouts/stack-utils/StackHeaderView.d.ts.map +1 -0
- package/build/layouts/stack-utils/{StackHeaderItem.js → StackHeaderView.js} +14 -10
- package/build/layouts/stack-utils/StackHeaderView.js.map +1 -0
- package/build/layouts/stack-utils/index.d.ts +5 -5
- package/build/layouts/stack-utils/index.d.ts.map +1 -1
- package/build/layouts/stack-utils/index.js +4 -4
- package/build/layouts/stack-utils/index.js.map +1 -1
- package/build/layouts/stack-utils/shared.d.ts +4 -42
- package/build/layouts/stack-utils/shared.d.ts.map +1 -1
- package/build/layouts/stack-utils/shared.js +3 -22
- package/build/layouts/stack-utils/shared.js.map +1 -1
- package/build/link/ExpoLink.d.ts.map +1 -1
- package/build/link/ExpoLink.js +1 -8
- package/build/link/ExpoLink.js.map +1 -1
- package/build/link/elements.d.ts +36 -13
- package/build/link/elements.d.ts.map +1 -1
- package/build/link/elements.js +14 -5
- package/build/link/elements.js.map +1 -1
- package/build/link/preview/native.d.ts +12 -1
- package/build/link/preview/native.d.ts.map +1 -1
- package/build/link/preview/native.js.map +1 -1
- package/build/navigationEvents/index.d.ts +36 -0
- package/build/navigationEvents/index.d.ts.map +1 -0
- package/build/navigationEvents/index.js +53 -0
- package/build/navigationEvents/index.js.map +1 -0
- package/build/toolbar/elements.d.ts +325 -16
- package/build/toolbar/elements.d.ts.map +1 -1
- package/build/toolbar/elements.js +130 -12
- package/build/toolbar/elements.js.map +1 -1
- package/build/toolbar/index.d.ts +38 -6
- package/build/toolbar/index.d.ts.map +1 -1
- package/build/toolbar/index.js +36 -1
- package/build/toolbar/index.js.map +1 -1
- package/build/toolbar/native.ios.d.ts.map +1 -1
- package/build/toolbar/native.ios.js.map +1 -1
- package/build/toolbar/native.types.d.ts +6 -5
- package/build/toolbar/native.types.d.ts.map +1 -1
- package/build/toolbar/native.types.js.map +1 -1
- package/build/useScreens.d.ts.map +1 -1
- package/build/useScreens.js +50 -0
- package/build/useScreens.js.map +1 -1
- package/build/utils/font.d.ts +9 -0
- package/build/utils/font.d.ts.map +1 -0
- package/build/utils/font.js +20 -0
- package/build/utils/font.js.map +1 -0
- package/expo-module.config.json +1 -1
- package/ios/LinkPreview/LinkPreviewNativeActionView.swift +105 -24
- package/ios/LinkPreview/LinkPreviewNativeModule.swift +35 -8
- package/ios/LinkPreview/LinkPreviewNativeNavigation.swift +16 -20
- package/ios/LinkPreview/LinkPreviewNativePreviewView.swift +1 -8
- package/ios/LinkPreview/LinkPreviewNativeView.swift +48 -50
- package/ios/LinkPreview/LinkZoomTransition.swift +8 -10
- package/ios/RouterViewWithLogger.swift +5 -0
- package/ios/Toolbar/RouterFontUtils.swift +50 -0
- package/ios/Toolbar/RouterToolbarHostView.swift +41 -17
- package/ios/Toolbar/RouterToolbarItemView.swift +30 -13
- package/ios/Toolbar/RouterToolbarModule.swift +28 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.aar +0 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.aar.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.aar.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.aar.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.aar.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module → 7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.module} +17 -17
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.module.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.module.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.module.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.module.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom → 7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.pom} +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.pom.md5 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.pom.sha1 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.pom.sha256 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e.pom.sha512 +1 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml +4 -4
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.md5 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha1 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha256 +1 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/maven-metadata.xml.sha512 +1 -1
- package/package.json +10 -10
- package/build/layouts/stack-utils/StackHeaderItem.d.ts.map +0 -1
- package/build/layouts/stack-utils/StackHeaderItem.js.map +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar +0 -0
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.aar.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.module.sha512 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.md5 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.sha1 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.sha256 +0 -1
- package/local-maven-repo/expo/modules/router/expo.modules.router/7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7.pom.sha512 +0 -1
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar → 7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e-sources.jar} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.md5 → 7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e-sources.jar.md5} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.sha1 → 7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e-sources.jar.sha1} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.sha256 → 7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e-sources.jar.sha256} +0 -0
- /package/local-maven-repo/expo/modules/router/expo.modules.router/{7.0.0-canary-20251216-6e1f9a7/expo.modules.router-7.0.0-canary-20251216-6e1f9a7-sources.jar.sha512 → 7.0.0-canary-20251223-b83b31e/expo.modules.router-7.0.0-canary-20251223-b83b31e-sources.jar.sha512} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/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OAAO,CAAC,+BAAa,CAAC,CAAC,OAAO,CAAC,EAAE,+BAAa,CAAC,CAAC;IAClD,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["'use client';\n\nimport { nanoid } from 'nanoid/non-secure';\nimport React, { isValidElement, use, useMemo, type PropsWithChildren } from 'react';\nimport type { ViewStyle } from 'react-native';\nimport type { SFSymbol } from 'sf-symbols-typescript';\n\nimport { InternalLinkPreviewContext } from './InternalLinkPreviewContext';\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';\n\nexport interface LinkMenuActionProps {\n /**\n * The title of the menu item.\n */\n title: string;\n /**\n * Optional SF Symbol displayed alongside the menu item.\n */\n icon?: SFSymbol;\n /**\n * If `true`, the menu 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 * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/destructive) for more information.\n */\n destructive?: boolean;\n /**\n * If `true`, the menu will be kept presented after the action is selected.\n *\n * This is marked as unstable, because when action is selected it will recreate the menu,\n * which will close all opened submenus and reset the scroll position.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenuelement/attributes/keepsmenupresented) for more information.\n */\n unstable_keepPresented?: boolean;\n /**\n * If `true`, the menu item will be displayed as selected.\n */\n isOn?: boolean;\n onPress: () => void;\n}\n\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 = useMemo(() => nanoid(), []);\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !use(InternalLinkPreviewContext)) {\n return null;\n }\n const { unstable_keepPresented, onPress, ...rest } = props;\n return (\n <NativeLinkPreviewAction\n {...rest}\n onSelected={onPress}\n keepPresented={unstable_keepPresented}\n identifier={identifier}\n />\n );\n}\n\nexport interface LinkMenuProps {\n /**\n * The title of the menu item\n */\n title?: string;\n /**\n * Optional SF Symbol displayed alongside the menu item.\n */\n icon?: string;\n /**\n * If `true`, the menu will be displayed as a palette.\n * This means that the menu will be displayed as one row\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette) for more information.\n */\n palette?: boolean;\n /**\n * @deprecated Use `palette` prop instead.\n */\n displayAsPalette?: boolean;\n /**\n * If `true`, the menu will be displayed inline.\n * This means that the menu will not be collapsed\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline) for more information.\n */\n inline?: boolean;\n /**\n * @deprecated Use `inline` prop instead.\n */\n displayInline?: boolean;\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/destructive) for more information.\n */\n destructive?: boolean;\n children?: React.ReactNode;\n}\n\n/**\n * Groups context menu actions for a link.\n *\n * If multiple `Link.Menu` components are used within a single `Link`, only the first will be rendered.\n * Only `Link.MenuAction` and `LinkMenuAction` components are allowed as children.\n *\n * @example\n * ```tsx\n * <Link.Menu>\n * <Link.MenuAction title=\"Action 1\" onPress={() => {}} />\n * <Link.MenuAction title=\"Action 2\" onPress={() => {}} />\n * </Link.Menu>\n * ```\n *\n * > **Note**: You can use the alias `Link.Menu` for this component.\n *\n * @platform ios\n */\nexport const LinkMenu: React.FC<LinkMenuProps> = (props) => {\n const identifier = useMemo(() => nanoid(), []);\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !use(InternalLinkPreviewContext)) {\n return null;\n }\n const children = React.Children.toArray(props.children).filter(\n (child) => isValidElement(child) && (child.type === LinkMenuAction || child.type === LinkMenu)\n );\n const displayAsPalette = props.palette ?? props.displayAsPalette;\n const displayInline = props.inline ?? props.displayInline;\n return (\n <NativeLinkPreviewAction\n {...props}\n displayAsPalette={displayAsPalette}\n displayInline={displayInline}\n title={props.title ?? ''}\n onSelected={() => {}}\n children={children}\n identifier={identifier}\n />\n );\n};\n\nexport type LinkPreviewStyle = Omit<ViewStyle, 'position' | 'width' | 'height'> & {\n /**\n * Sets the preferred width of the preview.\n * If not set, full width of the screen will be used.\n *\n * This is only **preferred** width, the actual width may be different\n */\n width?: number;\n\n /**\n * Sets the preferred height of the preview.\n * If not set, full height of the screen will be used.\n *\n * This is only **preferred** height, the actual height may be different\n */\n height?: number;\n};\n\nexport interface LinkPreviewProps {\n children?: React.ReactNode;\n /**\n * Custom styles for the preview container.\n *\n * Note that some styles may not work, as they are limited or reset by the native view\n */\n style?: LinkPreviewStyle;\n}\n\n/**\n * A component used to render and customize the link preview.\n *\n * If `Link.Preview` is used without any props, it will render a preview of the `href` passed to the `Link`.\n *\n * If multiple `Link.Preview` components are used within a single `Link`, only the first one will be rendered.\n *\n * To customize the preview, you can pass custom content as children.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Preview>\n * <Text>Custom Preview Content</Text>\n * </Link.Preview>\n * </Link>\n * ```\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Preview />\n * </Link>\n * ```\n *\n * > **Note**: You can use the alias `Link.Preview` for this component.\n *\n * @platform ios\n */\nexport function LinkPreview(props: LinkPreviewProps) {\n const { children, style } = props;\n const internalPreviewContext = use(InternalLinkPreviewContext);\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !internalPreviewContext) {\n return null;\n }\n const { isVisible, href } = internalPreviewContext;\n const { width, height, ...restOfStyle } = style ?? {};\n const contentSize = {\n width: width ?? 0,\n height: height ?? 0,\n };\n let content: React.ReactNode;\n if (children) {\n content = isVisible ? children : null;\n } else {\n content = isVisible ? <HrefPreview href={href} /> : null;\n }\n\n return (\n <NativeLinkPreviewContent style={restOfStyle} preferredContentSize={contentSize}>\n {content}\n </NativeLinkPreviewContent>\n );\n}\n\nexport interface LinkTriggerProps extends PropsWithChildren {\n /**\n * A shorthand for enabling the Apple Zoom Transition on this link trigger.\n *\n * When set to `true`, the trigger will be wrapped with `Link.AppleZoom`.\n * If another `Link.AppleZoom` is already used inside `Link.Trigger`, an error\n * will be thrown.\n *\n * @platform ios 18+\n */\n withAppleZoom?: boolean;\n}\n\n/**\n * Serves as the trigger for a link.\n * The content inside this component will be rendered as part of the base link.\n *\n * If multiple `Link.Trigger` components are used within a single `Link`, only the first will be rendered.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Trigger>\n * Trigger\n * </Link.Trigger>\n * </Link>\n * ```\n *\n * > **Note**: You can use the alias `Link.Trigger` for this component.\n *\n * @platform ios\n */\nexport function LinkTrigger({ withAppleZoom, ...props }: LinkTriggerProps) {\n if (React.Children.count(props.children) > 1 || !isValidElement(props.children)) {\n // If onPress is passed, this means that Link passed props to this component.\n // We can assume that asChild is used, so we throw an error, because link will not work in this case.\n if (props && typeof props === 'object' && 'onPress' in props) {\n throw new Error(\n 'When using Link.Trigger in an asChild Link, you must pass a single child element that will emit onPress event.'\n );\n }\n return props.children;\n }\n const content = <Slot {...props} />;\n if (withAppleZoom) {\n return <LinkAppleZoom>{content}</LinkAppleZoom>;\n }\n return content;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/link/elements.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoFb,wCA0BC;AA4ID,kCAwBC;AAkCD,kCAgBC;AAlUD,+CAAkG;AAIlG,6EAA0E;AAC1E,8CAA4C;AAC5C,uDAAoD;AACpD,uEAA6D;AAC7D,6CAAqF;AACrF,qCAAkC;AAClC,4DAAuD;AACvD,gDAAwD;AA+Dx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AAC,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 * Optional SF Symbol displayed alongside the menu item.\n */\n icon?: SFSymbol;\n /**\n * If `true`, the menu will be displayed as a palette.\n * This means that the menu will be displayed as one row\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette) for more information.\n */\n palette?: boolean;\n /**\n * @deprecated Use `palette` prop instead.\n */\n displayAsPalette?: boolean;\n /**\n * If `true`, the menu will be displayed inline.\n * This means that the menu will not be collapsed\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline) for more information.\n */\n inline?: boolean;\n /**\n * @deprecated Use `inline` prop instead.\n */\n displayInline?: boolean;\n /**\n * If `true`, the menu item will be displayed as destructive.\n *\n * @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/destructive) for more information.\n */\n destructive?: boolean;\n children?: React.ReactNode;\n}\n\n/**\n * Groups context menu actions for a link.\n *\n * If multiple `Link.Menu` components are used within a single `Link`, only the first will be rendered.\n * Only `Link.MenuAction` and `LinkMenuAction` components are allowed as children.\n *\n * @example\n * ```tsx\n * <Link.Menu>\n * <Link.MenuAction title=\"Action 1\" onPress={() => {}} />\n * <Link.MenuAction title=\"Action 2\" onPress={() => {}} />\n * </Link.Menu>\n * ```\n *\n * > **Note**: You can use the alias `Link.Menu` for this component.\n *\n * @platform ios\n */\nexport const LinkMenu: React.FC<LinkMenuProps> = (props) => {\n const identifier = useId();\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !use(InternalLinkPreviewContext)) {\n return null;\n }\n const children = React.Children.toArray(props.children).filter(\n (child) => isValidElement(child) && (child.type === LinkMenuAction || child.type === LinkMenu)\n );\n const displayAsPalette = props.palette ?? props.displayAsPalette;\n const displayInline = props.inline ?? props.displayInline;\n return (\n <NativeLinkPreviewAction\n {...props}\n displayAsPalette={displayAsPalette}\n displayInline={displayInline}\n title={props.title ?? ''}\n onSelected={() => {}}\n children={children}\n identifier={identifier}\n />\n );\n};\n\nexport type LinkPreviewStyle = Omit<ViewStyle, 'position' | 'width' | 'height'> & {\n /**\n * Sets the preferred width of the preview.\n * If not set, full width of the screen will be used.\n *\n * This is only **preferred** width, the actual width may be different\n */\n width?: number;\n\n /**\n * Sets the preferred height of the preview.\n * If not set, full height of the screen will be used.\n *\n * This is only **preferred** height, the actual height may be different\n */\n height?: number;\n};\n\nexport interface LinkPreviewProps {\n children?: React.ReactNode;\n /**\n * Custom styles for the preview container.\n *\n * Note that some styles may not work, as they are limited or reset by the native view\n */\n style?: LinkPreviewStyle;\n}\n\n/**\n * A component used to render and customize the link preview.\n *\n * If `Link.Preview` is used without any props, it will render a preview of the `href` passed to the `Link`.\n *\n * If multiple `Link.Preview` components are used within a single `Link`, only the first one will be rendered.\n *\n * To customize the preview, you can pass custom content as children.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Preview>\n * <Text>Custom Preview Content</Text>\n * </Link.Preview>\n * </Link>\n * ```\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Preview />\n * </Link>\n * ```\n *\n * > **Note**: You can use the alias `Link.Preview` for this component.\n *\n * @platform ios\n */\nexport function LinkPreview(props: LinkPreviewProps) {\n const { children, style } = props;\n const internalPreviewContext = use(InternalLinkPreviewContext);\n if (useIsPreview() || process.env.EXPO_OS !== 'ios' || !internalPreviewContext) {\n return null;\n }\n const { isVisible, href } = internalPreviewContext;\n const { width, height, ...restOfStyle } = style ?? {};\n const contentSize = {\n width: width ?? 0,\n height: height ?? 0,\n };\n let content: React.ReactNode;\n if (children) {\n content = isVisible ? children : null;\n } else {\n content = isVisible ? <HrefPreview href={href} /> : null;\n }\n\n return (\n <NativeLinkPreviewContent style={restOfStyle} preferredContentSize={contentSize}>\n {content}\n </NativeLinkPreviewContent>\n );\n}\n\nexport interface LinkTriggerProps extends PropsWithChildren {\n /**\n * A shorthand for enabling the Apple Zoom Transition on this link trigger.\n *\n * When set to `true`, the trigger will be wrapped with `Link.AppleZoom`.\n * If another `Link.AppleZoom` is already used inside `Link.Trigger`, an error\n * will be thrown.\n *\n * @platform ios 18+\n */\n withAppleZoom?: boolean;\n}\n\n/**\n * Serves as the trigger for a link.\n * The content inside this component will be rendered as part of the base link.\n *\n * If multiple `Link.Trigger` components are used within a single `Link`, only the first will be rendered.\n *\n * @example\n * ```tsx\n * <Link href=\"/about\">\n * <Link.Trigger>\n * Trigger\n * </Link.Trigger>\n * </Link>\n * ```\n *\n * > **Note**: You can use the alias `Link.Trigger` for this component.\n *\n * @platform ios\n */\nexport function LinkTrigger({ withAppleZoom, ...props }: LinkTriggerProps) {\n if (React.Children.count(props.children) > 1 || !isValidElement(props.children)) {\n // If onPress is passed, this means that Link passed props to this component.\n // We can assume that asChild is used, so we throw an error, because link will not work in this case.\n if (props && typeof props === 'object' && 'onPress' in props) {\n throw new Error(\n 'When using Link.Trigger in an asChild Link, you must pass a single child element that will emit onPress event.'\n );\n }\n return props.children;\n }\n const content = <Slot {...props} />;\n if (withAppleZoom) {\n return <LinkAppleZoom>{content}</LinkAppleZoom>;\n }\n return content;\n}\n"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
|
-
import { type ViewProps } from 'react-native';
|
|
2
|
+
import { type ViewProps, type ColorValue } from 'react-native';
|
|
3
|
+
import type { BasicTextStyle } from '../../utils/font';
|
|
3
4
|
export interface NativeLinkPreviewActionProps {
|
|
4
5
|
identifier: string;
|
|
5
6
|
title: string;
|
|
@@ -7,11 +8,21 @@ export interface NativeLinkPreviewActionProps {
|
|
|
7
8
|
children?: React.ReactNode;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
destructive?: boolean;
|
|
11
|
+
discoverabilityLabel?: string;
|
|
12
|
+
subtitle?: string;
|
|
13
|
+
accessibilityLabel?: string;
|
|
14
|
+
accessibilityHint?: string;
|
|
10
15
|
displayAsPalette?: boolean;
|
|
11
16
|
displayInline?: boolean;
|
|
12
17
|
isOn?: boolean;
|
|
13
18
|
keepPresented?: boolean;
|
|
19
|
+
hidden?: boolean;
|
|
20
|
+
tintColor?: ColorValue;
|
|
21
|
+
barButtonItemStyle?: 'plain' | 'prominent';
|
|
22
|
+
sharesBackground?: boolean;
|
|
23
|
+
hidesSharedBackground?: boolean;
|
|
14
24
|
onSelected: () => void;
|
|
25
|
+
titleStyle?: BasicTextStyle;
|
|
15
26
|
}
|
|
16
27
|
export declare function NativeLinkPreviewAction(props: NativeLinkPreviewActionProps): import("react").JSX.Element | null;
|
|
17
28
|
export interface TabPath {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/link/preview/native.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/link/preview/native.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAwB,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAErF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMvD,MAAM,WAAW,4BAA4B;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC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ID,MAAM,WAAW,6BAA8B,SAAQ,SAAS;IAC9D,oBAAoB,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAC1D;AAMD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,sCAa5E;AASD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAC/C,8BAA8B,EAAE,MAAM,CAAC;IACvC,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC,sCAWA;AAID,UAAU,uBAAuB;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,6BAA8B,SAAQ,iBAAiB;IAC/D,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,uBAAuB,CAAC;IACpC,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAUD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,6BAA6B,sCAa5E;AASD,wBAAgB,uCAAuC,CAAC,KAAK,EAAE;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,sCAaA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../src/link/preview/native.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../src/link/preview/native.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAiDb,0DAKC;AA4BD,8CAKC;AAYD,4DAaC;AASD,8DAcC;AAyBD,4DAaC;AASD,0FAgBC;AApMD,+BAAyC;AACzC,iCAAyD;AACzD,+CAAqF;AAIrF,MAAM,uBAAuB,GAC3B,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,IAAI,CAAC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AAW,CAAC,CAAC,KAAK,CAAC,CACnB,mBAAmB,CAAC,CAAC,KAAK,CAAC,CAC3B,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,EAC/B,CACH,CAAC;AACJ,CAAC;AACD,aAAa","sourcesContent":["'use client';\n\nimport { requireNativeView } from 'expo';\nimport { Fragment, type PropsWithChildren } from 'react';\nimport { Platform, StyleSheet, type ViewProps, type ColorValue } from 'react-native';\n\nimport type { BasicTextStyle } from '../../utils/font';\n\nconst areNativeViewsAvailable =\n process.env.EXPO_OS === 'ios' && !Platform.isTV && global.RN$Bridgeless === true;\n\n// #region Action View\nexport interface NativeLinkPreviewActionProps {\n identifier: string;\n title: string;\n icon?: string;\n children?: React.ReactNode;\n disabled?: boolean;\n destructive?: boolean;\n discoverabilityLabel?: string;\n subtitle?: string;\n accessibilityLabel?: string;\n accessibilityHint?: string;\n // This may lead to race conditions, when two menu actions are on at the same time.\n // The logic should be enforced in the JS code, rather than in the native code.\n // singleSelection?: boolean;\n displayAsPalette?: boolean;\n displayInline?: boolean;\n isOn?: boolean;\n // There are issues with menu state updates when keep presented is set to true.\n // When updating the context menu state, it will either not update or it will recreate the menu. The latter is a problem,\n // because it will close all opened submenus and reset the scroll position.\n // TODO: (@ubax) find a way to fix this.\n keepPresented?: boolean;\n hidden?: boolean;\n tintColor?: ColorValue;\n barButtonItemStyle?: 'plain' | 'prominent';\n\n // These properties are for UIBarButtonItem compatibility but don't apply to context menus.\n // They're included for API consistency with toolbar items.\n sharesBackground?: boolean;\n hidesSharedBackground?: boolean;\n onSelected: () => void;\n titleStyle?: BasicTextStyle;\n}\nconst LinkPreviewNativeActionView: React.ComponentType<NativeLinkPreviewActionProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkPreviewNativeActionView')\n : null;\nexport function NativeLinkPreviewAction(props: NativeLinkPreviewActionProps) {\n if (!LinkPreviewNativeActionView) {\n return null;\n }\n return <LinkPreviewNativeActionView {...props} />;\n}\n// #endregion\n\n// #region Preview View\nexport interface TabPath {\n oldTabKey: string;\n newTabKey: string;\n}\nexport interface NativeLinkPreviewProps extends ViewProps {\n nextScreenId: string | undefined;\n tabPath:\n | {\n path: TabPath[];\n }\n | undefined;\n disableForceFlatten?: boolean;\n onWillPreviewOpen?: () => void;\n onDidPreviewOpen?: () => void;\n onPreviewWillClose?: () => void;\n onPreviewDidClose?: () => void;\n onPreviewTapped?: () => void;\n onPreviewTappedAnimationCompleted?: () => void;\n children: React.ReactNode;\n}\nconst NativeLinkPreviewView: React.ComponentType<NativeLinkPreviewProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'NativeLinkPreviewView')\n : null;\nexport function NativeLinkPreview(props: NativeLinkPreviewProps) {\n if (!NativeLinkPreviewView) {\n return null;\n }\n return <NativeLinkPreviewView {...props} />;\n}\n// #endregion\n\n// #region Preview Content View\nexport interface NativeLinkPreviewContentProps extends ViewProps {\n preferredContentSize?: { width: number; height: number };\n}\nconst NativeLinkPreviewContentView: React.ComponentType<NativeLinkPreviewContentProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'NativeLinkPreviewContentView')\n : null;\n\nexport function NativeLinkPreviewContent(props: NativeLinkPreviewContentProps) {\n if (!NativeLinkPreviewContentView) {\n return null;\n }\n const style = StyleSheet.flatten([\n props.style,\n {\n position: 'absolute',\n top: 0,\n left: 0,\n } as const,\n ]);\n return <NativeLinkPreviewContentView {...props} style={style} />;\n}\n// #endregion\n\n// #region Zoom transition enabler\nconst LinkZoomTransitionEnablerNativeView: React.ComponentType<\n ViewProps & { zoomTransitionSourceIdentifier: string; disableForceFlatten?: boolean }\n> | null = areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionEnabler')\n : null;\nexport function LinkZoomTransitionEnabler(props: {\n zoomTransitionSourceIdentifier: string;\n preventInteractiveDismissal?: boolean;\n}) {\n if (!LinkZoomTransitionEnablerNativeView) {\n return null;\n }\n return (\n <LinkZoomTransitionEnablerNativeView\n {...props}\n disableForceFlatten\n style={{ display: 'contents' }}\n />\n );\n}\n// #endregion\n\n// #region Zoom transition source\ninterface LinkSourceAlignmentRect {\n x: number;\n y: number;\n width: number;\n height: number;\n}\n\ninterface LinkZoomTransitionSourceProps extends PropsWithChildren {\n identifier: string;\n alignment?: LinkSourceAlignmentRect;\n animateAspectRatioChange?: boolean;\n}\n\ninterface LinkZoomTransitionSourceNativeProps extends ViewProps, LinkZoomTransitionSourceProps {\n disableForceFlatten?: boolean;\n}\n\nconst LinkZoomTransitionSourceNativeView: React.ComponentType<LinkZoomTransitionSourceNativeProps> | null =\n areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionSource')\n : null;\nexport function LinkZoomTransitionSource(props: LinkZoomTransitionSourceProps) {\n if (!LinkZoomTransitionSourceNativeView) {\n return null;\n }\n return (\n <LinkZoomTransitionSourceNativeView\n {...props}\n disableForceFlatten\n collapsable={false}\n collapsableChildren={false}\n style={{ display: 'contents' }}\n />\n );\n}\n// #endregion\n\n// #region Zoom transition rect detector\nconst LinkZoomTransitionAlignmentRectDetectorNative: React.ComponentType<\n ViewProps & { identifier: string; disableForceFlatten?: boolean; children?: React.ReactNode }\n> | null = areNativeViewsAvailable\n ? requireNativeView('ExpoRouterNativeLinkPreview', 'LinkZoomTransitionAlignmentRectDetector')\n : Fragment;\nexport function LinkZoomTransitionAlignmentRectDetector(props: {\n identifier: string;\n children: React.ReactNode;\n}) {\n if (!LinkZoomTransitionAlignmentRectDetectorNative) {\n return null;\n }\n return (\n <LinkZoomTransitionAlignmentRectDetectorNative\n {...props}\n disableForceFlatten\n collapsable={false}\n collapsableChildren={false}\n style={{ display: 'contents' }}\n />\n );\n}\n// #endregion\n"]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
interface BasePageEvent {
|
|
2
|
+
pathname: string;
|
|
3
|
+
screenId: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The rendering of the page started
|
|
7
|
+
*
|
|
8
|
+
* This can happen if screen is to be focused for the first time or when the screen is preloaded
|
|
9
|
+
*/
|
|
10
|
+
export interface PageWillRender extends BasePageEvent {
|
|
11
|
+
type: 'pageWillRender';
|
|
12
|
+
}
|
|
13
|
+
export interface PageFocusedEvent extends BasePageEvent {
|
|
14
|
+
type: 'pageFocused';
|
|
15
|
+
}
|
|
16
|
+
export interface PageBlurredEvent extends BasePageEvent {
|
|
17
|
+
type: 'pageBlurred';
|
|
18
|
+
}
|
|
19
|
+
export interface PageRemoved extends BasePageEvent {
|
|
20
|
+
type: 'pageRemoved';
|
|
21
|
+
}
|
|
22
|
+
export type AnalyticsEvent = PageWillRender | PageFocusedEvent | PageBlurredEvent | PageRemoved;
|
|
23
|
+
type EventTypeName = AnalyticsEvent['type'];
|
|
24
|
+
type Payload<T extends EventTypeName> = Omit<Extract<AnalyticsEvent, {
|
|
25
|
+
type: T;
|
|
26
|
+
}>, 'type'>;
|
|
27
|
+
declare function addListener<EventType extends EventTypeName>(eventType: EventType, callback: (event: Payload<EventType>) => void): () => void;
|
|
28
|
+
export declare function emit<EventType extends EventTypeName>(type: EventType, event: Payload<EventType>): void;
|
|
29
|
+
export declare const unstable_navigationEvents: {
|
|
30
|
+
addListener: typeof addListener;
|
|
31
|
+
emit: typeof emit;
|
|
32
|
+
hasAnyListener(): boolean;
|
|
33
|
+
markInitialRender(): void;
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/navigationEvents/index.ts"],"names":[],"mappings":"AAAA,UAAU,aAAa;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAe,SAAQ,aAAa;IACnD,IAAI,EAAE,gBAAgB,CAAC;CACxB;AAED,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,WAAW,WAAY,SAAQ,aAAa;IAChD,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,gBAAgB,GAAG,gBAAgB,GAAG,WAAW,CAAC;AAYhG,KAAK,aAAa,GAAG,cAAc,CAAC,MAAM,CAAC,CAAC;AAC5C,KAAK,OAAO,CAAC,CAAC,SAAS,aAAa,IAAI,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC,EAAE,MAAM,CAAC,CAAC;AAM3F,iBAAS,WAAW,CAAC,SAAS,SAAS,aAAa,EAClD,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,KAAK,IAAI,cAuB9C;AAED,wBAAgB,IAAI,CAAC,SAAS,SAAS,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,SAAS,CAAC,QAO/F;AAED,eAAO,MAAM,yBAAyB;;;;;CASrC,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unstable_navigationEvents = void 0;
|
|
4
|
+
exports.emit = emit;
|
|
5
|
+
const availableEvents = [
|
|
6
|
+
'pageWillRender',
|
|
7
|
+
'pageFocused',
|
|
8
|
+
'pageBlurred',
|
|
9
|
+
'pageRemoved',
|
|
10
|
+
];
|
|
11
|
+
let isAfterInitialRender = false;
|
|
12
|
+
let hasListener = false;
|
|
13
|
+
const subscribers = {};
|
|
14
|
+
function addListener(eventType, callback) {
|
|
15
|
+
if (isAfterInitialRender) {
|
|
16
|
+
console.warn('[expo-router] unstable_analytics.addListener was called after the initial render. Analytics listeners should be added in the global scope before first render of your app, preferably in a root _layout.tsx');
|
|
17
|
+
return () => { };
|
|
18
|
+
}
|
|
19
|
+
if (!availableEvents.includes(eventType)) {
|
|
20
|
+
throw new Error(`Unsupported event type: ${eventType}`);
|
|
21
|
+
}
|
|
22
|
+
hasListener = true;
|
|
23
|
+
if (!subscribers[eventType]) {
|
|
24
|
+
subscribers[eventType] = new Set();
|
|
25
|
+
}
|
|
26
|
+
subscribers[eventType].add(callback);
|
|
27
|
+
return () => {
|
|
28
|
+
subscribers[eventType].delete(callback);
|
|
29
|
+
if (subscribers[eventType].size === 0) {
|
|
30
|
+
delete subscribers[eventType];
|
|
31
|
+
}
|
|
32
|
+
hasListener = Object.keys(subscribers).length > 0;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function emit(type, event) {
|
|
36
|
+
const subscribersForEvent = subscribers[type];
|
|
37
|
+
if (subscribersForEvent) {
|
|
38
|
+
for (const callback of subscribersForEvent) {
|
|
39
|
+
callback(event);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.unstable_navigationEvents = {
|
|
44
|
+
addListener,
|
|
45
|
+
emit,
|
|
46
|
+
hasAnyListener() {
|
|
47
|
+
return hasListener;
|
|
48
|
+
},
|
|
49
|
+
markInitialRender() {
|
|
50
|
+
isAfterInitialRender = true;
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/navigationEvents/index.ts"],"names":[],"mappings":";;;AAwEA,oBAOC;AAnDD,MAAM,eAAe,GAA6B;IAChD,gBAAgB;IAChB,aAAa;IACb,aAAa;IACb,aAAa;CACd,CAAC;AAEF,IAAI,oBAAoB,GAAG,KAAK,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AyB,GAAG;IACvC,WAAW;IACX,IAAI;IACJ,cAAc;QACZ,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,iBAAiB;QACf,oBAAoB,GAAG,IAAI,CAAC;IAC9B,CAAC;CACF,CAAC","sourcesContent":["interface BasePageEvent {\n pathname: string;\n screenId: string;\n}\n\n/**\n * The rendering of the page started\n *\n * This can happen if screen is to be focused for the first time or when the screen is preloaded\n */\nexport interface PageWillRender extends BasePageEvent {\n type: 'pageWillRender';\n}\n\nexport interface PageFocusedEvent extends BasePageEvent {\n type: 'pageFocused';\n}\n\nexport interface PageBlurredEvent extends BasePageEvent {\n type: 'pageBlurred';\n}\n\nexport interface PageRemoved extends BasePageEvent {\n type: 'pageRemoved';\n}\n\nexport type AnalyticsEvent = PageWillRender | PageFocusedEvent | PageBlurredEvent | PageRemoved;\n\nconst availableEvents: AnalyticsEvent['type'][] = [\n 'pageWillRender',\n 'pageFocused',\n 'pageBlurred',\n 'pageRemoved',\n];\n\nlet isAfterInitialRender = false;\nlet hasListener = false;\n\ntype EventTypeName = AnalyticsEvent['type'];\ntype Payload<T extends EventTypeName> = Omit<Extract<AnalyticsEvent, { type: T }>, 'type'>;\n\nconst subscribers: {\n [K in EventTypeName]?: Set<(event: Payload<K>) => void>;\n} = {};\n\nfunction addListener<EventType extends EventTypeName>(\n eventType: EventType,\n callback: (event: Payload<EventType>) => void\n) {\n if (isAfterInitialRender) {\n console.warn(\n '[expo-router] unstable_analytics.addListener was called after the initial render. Analytics listeners should be added in the global scope before first render of your app, preferably in a root _layout.tsx'\n );\n return () => {};\n }\n if (!availableEvents.includes(eventType)) {\n throw new Error(`Unsupported event type: ${eventType}`);\n }\n hasListener = true;\n if (!subscribers[eventType]) {\n subscribers[eventType] = new Set() as (typeof subscribers)[EventType];\n }\n subscribers[eventType]!.add(callback);\n return () => {\n subscribers[eventType]!.delete(callback);\n if (subscribers[eventType]!.size === 0) {\n delete subscribers[eventType];\n }\n hasListener = Object.keys(subscribers).length > 0;\n };\n}\n\nexport function emit<EventType extends EventTypeName>(type: EventType, event: Payload<EventType>) {\n const subscribersForEvent = subscribers[type];\n if (subscribersForEvent) {\n for (const callback of subscribersForEvent) {\n callback(event);\n }\n }\n}\n\nexport const unstable_navigationEvents = {\n addListener,\n emit,\n hasAnyListener() {\n return hasListener;\n },\n markInitialRender() {\n isAfterInitialRender = true;\n },\n};\n"]}
|
|
@@ -1,24 +1,333 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ColorValue, type StyleProp } from 'react-native';
|
|
2
3
|
import type { SFSymbol } from 'sf-symbols-typescript';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
export
|
|
6
|
-
|
|
4
|
+
import { LinkMenuAction, type LinkMenuActionProps } from '../link/elements';
|
|
5
|
+
import type { BasicTextStyle } from '../utils/font';
|
|
6
|
+
export interface ToolbarMenuProps {
|
|
7
|
+
accessibilityLabel?: string;
|
|
8
|
+
accessibilityHint?: string;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* If `true`, the menu item will be displayed as destructive.
|
|
12
|
+
*
|
|
13
|
+
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/destructive) for more information.
|
|
14
|
+
*/
|
|
15
|
+
destructive?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
hidden?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Whether to hide the shared background when `sharesBackground` is enabled.
|
|
20
|
+
*
|
|
21
|
+
* Only available for root level menus.
|
|
22
|
+
*
|
|
23
|
+
* @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.
|
|
24
|
+
*
|
|
25
|
+
* @platform iOS 26+
|
|
26
|
+
*/
|
|
27
|
+
hidesSharedBackground?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Optional SF Symbol displayed alongside the menu item.
|
|
30
|
+
*/
|
|
31
|
+
icon?: SFSymbol;
|
|
32
|
+
/**
|
|
33
|
+
* If `true`, the menu will be displayed inline.
|
|
34
|
+
* This means that the menu will not be collapsed
|
|
35
|
+
*
|
|
36
|
+
* > **Note*: Inline menus are only supported in submenus.
|
|
37
|
+
*
|
|
38
|
+
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayinline) for more information.
|
|
39
|
+
*/
|
|
40
|
+
inline?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* If `true`, the menu will be displayed as a palette.
|
|
43
|
+
* This means that the menu will be displayed as one row
|
|
44
|
+
*
|
|
45
|
+
* > **Note**: Palette menus are only supported in submenus.
|
|
46
|
+
*
|
|
47
|
+
* @see [Apple documentation](https://developer.apple.com/documentation/uikit/uimenu/options-swift.struct/displayaspalette) for more information.
|
|
48
|
+
*/
|
|
49
|
+
palette?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether to separate the background of this item from other header items.
|
|
52
|
+
*
|
|
53
|
+
* > **Note**: Text buttons cannot share the background.
|
|
54
|
+
*
|
|
55
|
+
* This prop reverses the native behavior of `sharesBackground`.
|
|
56
|
+
*
|
|
57
|
+
* @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/sharesbackground) for more information.
|
|
58
|
+
*
|
|
59
|
+
* @default false
|
|
60
|
+
*
|
|
61
|
+
* @platform iOS 26+
|
|
62
|
+
*/
|
|
63
|
+
separateBackground?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Style for the label of the header item.
|
|
66
|
+
*/
|
|
67
|
+
style?: StyleProp<BasicTextStyle>;
|
|
68
|
+
/**
|
|
69
|
+
* The title of the menu item
|
|
70
|
+
*/
|
|
71
|
+
title?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Tint color for the menu icon and text.
|
|
74
|
+
*/
|
|
75
|
+
tintColor?: ColorValue;
|
|
76
|
+
/**
|
|
77
|
+
* Controls the visual style of the menu when represented as a bar button.
|
|
78
|
+
*
|
|
79
|
+
* @default 'plain'
|
|
80
|
+
*/
|
|
81
|
+
variant?: 'plain' | 'done' | 'prominent';
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Adds a context menu for to a toolbar.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```tsx
|
|
88
|
+
* <Toolbar>
|
|
89
|
+
* <Toolbar.Menu title="Options">
|
|
90
|
+
* <Toolbar.MenuAction title="Action 1" onPress={() => {}} />
|
|
91
|
+
* <Toolbar.MenuAction title="Action 2" onPress={() => {}} />
|
|
92
|
+
* </Toolbar.Menu>
|
|
93
|
+
* </Toolbar>
|
|
94
|
+
* ```
|
|
95
|
+
*
|
|
96
|
+
* @platform ios
|
|
97
|
+
*/
|
|
98
|
+
export declare const ToolbarMenu: React.FC<ToolbarMenuProps>;
|
|
7
99
|
export type ToolbarMenuActionProps = LinkMenuActionProps;
|
|
100
|
+
/**
|
|
101
|
+
* A single action item within a toolbar menu.
|
|
102
|
+
*
|
|
103
|
+
* For available props, see [`LinkMenuActionProps`](./router/#linkmenuactionprops).
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```tsx
|
|
107
|
+
* <Toolbar>
|
|
108
|
+
* <Toolbar.Menu title="Options">
|
|
109
|
+
* <Toolbar.MenuAction title="Action 1" onPress={() => {}} />
|
|
110
|
+
* <Toolbar.MenuAction title="Action 2" onPress={() => {}} />
|
|
111
|
+
* </Toolbar.Menu>
|
|
112
|
+
* </Toolbar>
|
|
113
|
+
* ```
|
|
114
|
+
*
|
|
115
|
+
* @platform ios
|
|
116
|
+
*/
|
|
8
117
|
export declare const ToolbarMenuAction: typeof LinkMenuAction;
|
|
9
|
-
export interface ToolbarButtonProps
|
|
10
|
-
|
|
11
|
-
|
|
118
|
+
export interface ToolbarButtonProps {
|
|
119
|
+
accessibilityLabel?: string;
|
|
120
|
+
accessibilityHint?: string;
|
|
121
|
+
/**
|
|
122
|
+
* The text label for the button.
|
|
123
|
+
*
|
|
124
|
+
* > **Note**: When icon is used, the label will not be shown and will be used for accessibility purposes only.
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```tsx
|
|
128
|
+
* import { Toolbar } from 'expo-router/unstable-toolbar';
|
|
129
|
+
*
|
|
130
|
+
* ...
|
|
131
|
+
* <Toolbar.Button>This is button label</Toolbar.Button>
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
children?: ReactNode;
|
|
135
|
+
disabled?: boolean;
|
|
136
|
+
/**
|
|
137
|
+
* Whether the button should be hidden.
|
|
138
|
+
*
|
|
139
|
+
* @default false
|
|
140
|
+
*/
|
|
141
|
+
hidden?: boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Whether to hide the shared background.
|
|
144
|
+
*
|
|
145
|
+
* @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.
|
|
146
|
+
*
|
|
147
|
+
* @platform iOS 26+
|
|
148
|
+
*/
|
|
149
|
+
hidesSharedBackground?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* The name of the SF Symbol to display as the button icon.
|
|
152
|
+
* For a list of available symbols, see [SF Symbols](https://developer.apple.com/sf-symbols/).
|
|
153
|
+
*/
|
|
154
|
+
icon?: SFSymbol;
|
|
155
|
+
/**
|
|
156
|
+
* Callback function when the button is pressed.
|
|
157
|
+
*/
|
|
12
158
|
onPress?: () => void;
|
|
159
|
+
/**
|
|
160
|
+
* @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/possibletitles) for more information.
|
|
161
|
+
*/
|
|
162
|
+
possibleTitles?: string[];
|
|
163
|
+
/**
|
|
164
|
+
* Whether the button is in a selected state
|
|
165
|
+
*
|
|
166
|
+
* @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/isselected) for more information.
|
|
167
|
+
*/
|
|
168
|
+
selected?: boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Whether to separate the background of this item from other header items.
|
|
171
|
+
*
|
|
172
|
+
* > **Note**: Text buttons cannot share the background.
|
|
173
|
+
*
|
|
174
|
+
* This prop reverses the native behavior of `sharesBackground`.
|
|
175
|
+
*
|
|
176
|
+
* @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/sharesbackground) for more information.
|
|
177
|
+
*
|
|
178
|
+
* @default false
|
|
179
|
+
*
|
|
180
|
+
* @platform iOS 26+
|
|
181
|
+
*/
|
|
182
|
+
separateBackground?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Style for the label of the header item.
|
|
185
|
+
*/
|
|
186
|
+
style?: StyleProp<BasicTextStyle>;
|
|
187
|
+
/**
|
|
188
|
+
* Tint color for the button icon and text.
|
|
189
|
+
*/
|
|
190
|
+
tintColor?: ColorValue;
|
|
191
|
+
/**
|
|
192
|
+
* @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/style-swift.enum) for more information.
|
|
193
|
+
*
|
|
194
|
+
* @default 'plain'
|
|
195
|
+
*/
|
|
196
|
+
variant?: 'plain' | 'done' | 'prominent';
|
|
13
197
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
198
|
+
/**
|
|
199
|
+
* A button component for use in the toolbar.
|
|
200
|
+
* It should only be used as a child of `Toolbar`.
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```tsx
|
|
204
|
+
* <Toolbar>
|
|
205
|
+
* <Toolbar.Button icon="magnifyingglass" tintColor={Color.ios.placeholderText} />
|
|
206
|
+
* <Toolbar.Button>Text Button</Toolbar.Button>
|
|
207
|
+
* <Toolbar.Button hidden={!isSearchFocused} icon="xmark" onPress={handleClear} />
|
|
208
|
+
* </Toolbar>
|
|
209
|
+
* ```
|
|
210
|
+
*
|
|
211
|
+
* @platform ios
|
|
212
|
+
*/
|
|
213
|
+
export declare const ToolbarButton: (props: ToolbarButtonProps) => import("react").JSX.Element;
|
|
214
|
+
export type ToolbarSpacerProps = {
|
|
215
|
+
/**
|
|
216
|
+
* Whether to hide the shared background when `sharesBackground` is enabled.
|
|
217
|
+
*
|
|
218
|
+
* @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.
|
|
219
|
+
*
|
|
220
|
+
* @platform iOS 26+
|
|
221
|
+
*/
|
|
222
|
+
hidesSharedBackground?: boolean;
|
|
223
|
+
/**
|
|
224
|
+
* Whether the spacer should be hidden.
|
|
225
|
+
*
|
|
226
|
+
* @default false
|
|
227
|
+
*/
|
|
228
|
+
hidden?: boolean;
|
|
229
|
+
/**
|
|
230
|
+
* Whether the spacer shares the background with adjacent toolbar items.
|
|
231
|
+
*
|
|
232
|
+
* @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/sharesbackground) for more information.
|
|
233
|
+
*
|
|
234
|
+
* @platform iOS 26+
|
|
235
|
+
* @default false
|
|
236
|
+
*/
|
|
237
|
+
sharesBackground?: boolean;
|
|
238
|
+
/**
|
|
239
|
+
* By default, the spacer is flexible and expands to fill available space.
|
|
240
|
+
* If a width is provided, it creates a [fixed-width spacer](https://developer.apple.com/documentation/uikit/uibarbuttonitem/fixedspace(_:)).
|
|
241
|
+
*/
|
|
242
|
+
width?: number;
|
|
243
|
+
};
|
|
244
|
+
/**
|
|
245
|
+
* A spacer component for the toolbar.
|
|
246
|
+
* Without a width, it creates a flexible spacer that expands to fill available space.
|
|
247
|
+
* With a width, it creates a fixed-width spacer.
|
|
248
|
+
* It should only be used as a child of `Toolbar`.
|
|
249
|
+
*
|
|
250
|
+
* @example
|
|
251
|
+
* ```tsx
|
|
252
|
+
* <Toolbar>
|
|
253
|
+
* <Toolbar.Spacer />
|
|
254
|
+
* <Toolbar.Button icon="magnifyingglass" />
|
|
255
|
+
* <Toolbar.Spacer width={20} />
|
|
256
|
+
* <Toolbar.Button icon="mic" />
|
|
257
|
+
* <Toolbar.Spacer />
|
|
258
|
+
* </Toolbar>
|
|
259
|
+
* ```
|
|
260
|
+
*
|
|
261
|
+
* @platform ios
|
|
262
|
+
*/
|
|
263
|
+
export declare const ToolbarSpacer: (props: ToolbarSpacerProps) => import("react").JSX.Element;
|
|
264
|
+
/**
|
|
265
|
+
* Props for the ToolbarView component.
|
|
266
|
+
*
|
|
267
|
+
* @platform ios
|
|
268
|
+
*/
|
|
269
|
+
export interface ToolbarViewProps {
|
|
270
|
+
/**
|
|
271
|
+
* React elements to render inside the toolbar view.
|
|
272
|
+
*/
|
|
18
273
|
children: React.ReactNode;
|
|
19
|
-
|
|
274
|
+
/**
|
|
275
|
+
* Whether the view should be hidden.
|
|
276
|
+
*
|
|
277
|
+
* @default false
|
|
278
|
+
*/
|
|
279
|
+
hidden?: boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Whether to hide the shared background when `sharesBackground` is enabled.
|
|
282
|
+
*
|
|
283
|
+
* @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/hidessharedbackground) for more information.
|
|
284
|
+
*
|
|
285
|
+
* @platform iOS 18+
|
|
286
|
+
*/
|
|
287
|
+
hidesSharedBackground?: boolean;
|
|
288
|
+
/**
|
|
289
|
+
* Whether to separate the background of this item from other header items.
|
|
290
|
+
*
|
|
291
|
+
* This prop reverses the native behavior of `sharesBackground`.
|
|
292
|
+
*
|
|
293
|
+
* @see [Official Apple documentation](https://developer.apple.com/documentation/uikit/uibarbuttonitem/sharesbackground) for more information.
|
|
294
|
+
*
|
|
295
|
+
* @default false
|
|
296
|
+
*
|
|
297
|
+
* @platform iOS 26+
|
|
298
|
+
*/
|
|
299
|
+
separateBackground?: boolean;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* A custom view component for the toolbar that can contain any React elements.
|
|
303
|
+
* Useful for embedding custom components.
|
|
304
|
+
* It should only be used as a child of `Toolbar`.
|
|
305
|
+
*
|
|
306
|
+
* The items within the view will be absolutely positioned, so flexbox styles will not work as expected.
|
|
307
|
+
*
|
|
308
|
+
* @example
|
|
309
|
+
* ```tsx
|
|
310
|
+
* <Toolbar>
|
|
311
|
+
* <Toolbar.Spacer />
|
|
312
|
+
* <Toolbar.View>
|
|
313
|
+
* <TextInput
|
|
314
|
+
* placeholder="Search"
|
|
315
|
+
* placeholderTextColor={Color.ios.placeholderText}
|
|
316
|
+
* />
|
|
317
|
+
* </Toolbar.View>
|
|
318
|
+
* <Toolbar.View separateBackground style={{ width: 32, height: 32 }}>
|
|
319
|
+
* <Pressable onPress={handlePress}>
|
|
320
|
+
* <SymbolView name="plus" size={22} />
|
|
321
|
+
* </Pressable>
|
|
322
|
+
* </Toolbar.View>
|
|
323
|
+
* </Toolbar>
|
|
324
|
+
* ```
|
|
325
|
+
*
|
|
326
|
+
* @platform ios
|
|
327
|
+
*/
|
|
328
|
+
export declare const ToolbarView: ({ children, hidden, hidesSharedBackground, separateBackground, }: ToolbarViewProps) => import("react").JSX.Element;
|
|
329
|
+
export interface ToolbarProps {
|
|
330
|
+
children?: React.ReactNode;
|
|
20
331
|
}
|
|
21
|
-
export declare const
|
|
22
|
-
export type ToolbarHostProps = RouterToolbarHostProps;
|
|
23
|
-
export declare const ToolbarHost: (props: ToolbarHostProps) => import("react").JSX.Element;
|
|
332
|
+
export declare const ToolbarHost: (props: ToolbarProps) => import("react").JSX.Element;
|
|
24
333
|
//# sourceMappingURL=elements.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/toolbar/elements.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"elements.d.ts","sourceRoot":"","sources":["../../src/toolbar/elements.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmC,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAc,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAItD,OAAO,EAAE,cAAc,EA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