expo-router 5.2.0-canary-20250811-5c940c0 → 6.0.0-beta.0

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.
Files changed (91) hide show
  1. package/build/layouts/Stack.web.d.ts +1 -1
  2. package/build/layouts/Stack.web.d.ts.map +1 -1
  3. package/build/layouts/Stack.web.js +3 -3
  4. package/build/layouts/Stack.web.js.map +1 -1
  5. package/build/layouts/StackClient.d.ts.map +1 -1
  6. package/build/layouts/StackClient.js +7 -8
  7. package/build/layouts/StackClient.js.map +1 -1
  8. package/build/layouts/withLayoutContext.d.ts.map +1 -1
  9. package/build/layouts/withLayoutContext.js +3 -3
  10. package/build/layouts/withLayoutContext.js.map +1 -1
  11. package/build/link/LinkWithPreview.d.ts.map +1 -1
  12. package/build/link/LinkWithPreview.js +13 -4
  13. package/build/link/LinkWithPreview.js.map +1 -1
  14. package/build/link/elements.d.ts +26 -18
  15. package/build/link/elements.d.ts.map +1 -1
  16. package/build/link/elements.js +4 -4
  17. package/build/link/elements.js.map +1 -1
  18. package/build/link/preview/HrefPreview.d.ts.map +1 -1
  19. package/build/link/preview/HrefPreview.js +22 -4
  20. package/build/link/preview/HrefPreview.js.map +1 -1
  21. package/build/link/preview/useNextScreenId.d.ts.map +1 -1
  22. package/build/link/preview/useNextScreenId.js +0 -1
  23. package/build/link/preview/useNextScreenId.js.map +1 -1
  24. package/build/modal/ModalsRenderer.web.js +4 -4
  25. package/build/modal/ModalsRenderer.web.js.map +1 -1
  26. package/build/modal/web/{ModalStack.web.d.ts → ModalStack.d.ts} +1 -1
  27. package/build/modal/web/ModalStack.d.ts.map +1 -0
  28. package/build/modal/web/{ModalStack.web.js → ModalStack.js} +5 -5
  29. package/build/modal/web/ModalStack.js.map +1 -0
  30. package/build/modal/web/{ModalStackRouteDrawer.web.d.ts → ModalStackRouteDrawer.d.ts} +1 -1
  31. package/build/modal/web/ModalStackRouteDrawer.d.ts.map +1 -0
  32. package/build/modal/web/{ModalStackRouteDrawer.web.js → ModalStackRouteDrawer.js} +1 -1
  33. package/build/modal/web/ModalStackRouteDrawer.js.map +1 -0
  34. package/build/modal/web/{TransparentModalStackRouteDrawer.web.d.ts → TransparentModalStackRouteDrawer.d.ts} +1 -1
  35. package/build/modal/web/TransparentModalStackRouteDrawer.d.ts.map +1 -0
  36. package/build/modal/web/{TransparentModalStackRouteDrawer.web.js → TransparentModalStackRouteDrawer.js} +1 -1
  37. package/build/modal/web/TransparentModalStackRouteDrawer.js.map +1 -0
  38. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.d.ts +4 -12
  39. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.d.ts.map +1 -1
  40. package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.js.map +1 -1
  41. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts +47 -0
  42. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts.map +1 -0
  43. package/build/native-tabs/NativeBottomTabs/{TabOptions.js → NativeTabTrigger.js} +57 -7
  44. package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js.map +1 -0
  45. package/build/native-tabs/NativeBottomTabs/NativeTabs.d.ts +22 -5
  46. package/build/native-tabs/NativeBottomTabs/NativeTabs.d.ts.map +1 -1
  47. package/build/native-tabs/NativeBottomTabs/NativeTabs.js +20 -2
  48. package/build/native-tabs/NativeBottomTabs/NativeTabs.js.map +1 -1
  49. package/build/native-tabs/NativeBottomTabs/NativeTabsView.d.ts +1 -100
  50. package/build/native-tabs/NativeBottomTabs/NativeTabsView.d.ts.map +1 -1
  51. package/build/native-tabs/NativeBottomTabs/NativeTabsView.js +53 -6
  52. package/build/native-tabs/NativeBottomTabs/NativeTabsView.js.map +1 -1
  53. package/build/native-tabs/NativeBottomTabs/types.d.ts +166 -0
  54. package/build/native-tabs/NativeBottomTabs/types.d.ts.map +1 -0
  55. package/build/native-tabs/NativeBottomTabs/types.js +3 -0
  56. package/build/native-tabs/NativeBottomTabs/types.js.map +1 -0
  57. package/build/native-tabs/NativeBottomTabs/utils.d.ts +2 -2
  58. package/build/native-tabs/NativeBottomTabs/utils.d.ts.map +1 -1
  59. package/build/native-tabs/NativeBottomTabs/utils.js.map +1 -1
  60. package/build/native-tabs/common/elements.d.ts +21 -6
  61. package/build/native-tabs/common/elements.d.ts.map +1 -1
  62. package/build/native-tabs/common/elements.js +6 -0
  63. package/build/native-tabs/common/elements.js.map +1 -1
  64. package/build/native-tabs/index.d.ts +3 -1
  65. package/build/native-tabs/index.d.ts.map +1 -1
  66. package/build/native-tabs/index.js +18 -5
  67. package/build/native-tabs/index.js.map +1 -1
  68. package/build/rsc/middleware.d.ts +1 -1
  69. package/build/rsc/middleware.d.ts.map +1 -1
  70. package/build/rsc/middleware.js.map +1 -1
  71. package/build/views/Sitemap.d.ts.map +1 -1
  72. package/build/views/Sitemap.js +66 -36
  73. package/build/views/Sitemap.js.map +1 -1
  74. package/ios/LinkPreview/LinkPreviewNativeModule.swift +7 -1
  75. package/ios/LinkPreview/LinkPreviewNativePreviewView.swift +0 -1
  76. package/ios/LinkPreview/LinkPreviewNativeTriggerView.swift +1 -1
  77. package/ios/LinkPreview/LinkPreviewNativeView.swift +4 -3
  78. package/package.json +10 -7
  79. package/plugin/tsconfig.tsbuildinfo +1 -0
  80. package/server.d.ts +2 -2
  81. package/unstable-native-tabs.d.ts +1 -0
  82. package/unstable-native-tabs.js +1 -0
  83. package/build/modal/web/ModalStack.web.d.ts.map +0 -1
  84. package/build/modal/web/ModalStack.web.js.map +0 -1
  85. package/build/modal/web/ModalStackRouteDrawer.web.d.ts.map +0 -1
  86. package/build/modal/web/ModalStackRouteDrawer.web.js.map +0 -1
  87. package/build/modal/web/TransparentModalStackRouteDrawer.web.d.ts.map +0 -1
  88. package/build/modal/web/TransparentModalStackRouteDrawer.web.js.map +0 -1
  89. package/build/native-tabs/NativeBottomTabs/TabOptions.d.ts +0 -40
  90. package/build/native-tabs/NativeBottomTabs/TabOptions.d.ts.map +0 -1
  91. package/build/native-tabs/NativeBottomTabs/TabOptions.js.map +0 -1
package/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { ExpoRequest, ExpoResponse } from '@expo/server';
2
- export { MiddlewareFunction } from '@expo/server/build/types';
1
+ import { type ExpoRequest, type ExpoResponse } from '@expo/server';
2
+ export { type MiddlewareFunction } from '@expo/server';
3
3
 
4
4
  export type RequestHandler = (
5
5
  request: Request,
@@ -0,0 +1 @@
1
+ export * from './build/native-tabs';
@@ -0,0 +1 @@
1
+ module.exports = require('./build/native-tabs');
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalStack.web.d.ts","sourceRoot":"","sources":["../../../src/modal/web/ModalStack.web.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,aAAa,EAOd,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAsB,MAAM,OAAO,CAAC;AAgG3C,QAAA,MAAM,WAAW;;;;;;;;;;;CAAkD,CAAC;AACpE,QAAA,MAAM,iBAAiB;;;;;;;;6DAAqB,CAAC;AAE7C,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalStack.web.js","sourceRoot":"","sources":["../../../src/modal/web/ModalStack.web.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACb,qDASkC;AAClC,iEAIwC;AACxC,+CAA2C;AAE3C,2EAAoE;AACpE,iGAA0F;AAE1F,mCAIiB;AAEjB,uEAAoE;AAEpE,SAAS,mBAAmB,CAAC,EAC3B,gBAAgB,EAChB,QAAQ,EACR,aAAa,GACY;IACzB,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,QAAQ,EAAE,GAAG,IAAA,6BAAoB,EAM1F,oBAAW,EAAE;QACb,QAAQ;QACR,aAAa;QACb,gBAAgB;KACjB,CAAC,CAAC;IAE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client';\nimport {\n createNavigatorFactory,\n ParamListBase,\n StackActionHelpers,\n StackNavigationState,\n StackRouter,\n StackRouterOptions,\n useNavigationBuilder,\n useTheme,\n} from '@react-navigation/native';\nimport {\n NativeStackNavigationEventMap,\n NativeStackNavigationOptions,\n NativeStackView,\n} from '@react-navigation/native-stack';\nimport React, { useCallback } from 'react';\n\nimport { ModalStackRouteDrawer } from './ModalStackRouteDrawer.web';\nimport { TransparentModalStackRouteDrawer } from './TransparentModalStackRouteDrawer.web';\nimport { ModalStackNavigatorProps, ModalStackViewProps } from './types';\nimport {\n convertStackStateToNonModalState,\n findLastNonModalIndex,\n isTransparentModalPresentation,\n} from './utils';\nimport { ExtendedStackNavigationOptions } from '../../layouts/StackClient';\nimport { withLayoutContext } from '../../layouts/withLayoutContext';\n\nfunction ModalStackNavigator({\n initialRouteName,\n children,\n screenOptions,\n}: ModalStackNavigatorProps) {\n const { state, navigation, descriptors, NavigationContent, describe } = useNavigationBuilder<\n StackNavigationState<ParamListBase>,\n StackRouterOptions,\n StackActionHelpers<ParamListBase>,\n NativeStackNavigationOptions,\n NativeStackNavigationEventMap\n >(StackRouter, {\n children,\n screenOptions,\n initialRouteName,\n });\n\n return (\n <NavigationContent>\n <ModalStackView\n state={state}\n navigation={navigation}\n descriptors={descriptors}\n describe={describe}\n />\n </NavigationContent>\n );\n}\n\nconst ModalStackView = ({ state, navigation, descriptors, describe }: ModalStackViewProps) => {\n const isWeb = process.env.EXPO_OS === 'web';\n const { colors } = useTheme();\n\n const { routes: filteredRoutes, index: nonModalIndex } = convertStackStateToNonModalState(\n state,\n descriptors,\n isWeb\n );\n\n const newStackState = { ...state, routes: filteredRoutes, index: nonModalIndex };\n\n const dismiss = useCallback(() => {\n navigation.goBack();\n }, [navigation]);\n\n const overlayRoutes = React.useMemo(() => {\n if (!isWeb) return [];\n const idx = findLastNonModalIndex(state, descriptors);\n return state.routes.slice(idx + 1);\n }, [isWeb, state, descriptors]);\n\n return (\n <div style={{ flex: 1, display: 'flex' }}>\n <NativeStackView\n state={newStackState}\n navigation={navigation}\n descriptors={descriptors}\n describe={describe}\n />\n {isWeb &&\n overlayRoutes.map((route) => {\n const isTransparentModal = isTransparentModalPresentation(descriptors[route.key].options);\n\n const ModalComponent = isTransparentModal\n ? TransparentModalStackRouteDrawer\n : ModalStackRouteDrawer;\n\n return (\n <ModalComponent\n key={route.key}\n routeKey={route.key}\n options={descriptors[route.key].options as ExtendedStackNavigationOptions}\n renderScreen={descriptors[route.key].render}\n onDismiss={dismiss}\n themeColors={colors}\n />\n );\n })}\n </div>\n );\n};\n\nconst createModalStack = createNavigatorFactory(ModalStackNavigator);\nconst RouterModal = withLayoutContext(createModalStack().Navigator);\nconst RouterModalScreen = RouterModal.Screen;\n\nexport { RouterModal, RouterModalScreen };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalStackRouteDrawer.web.d.ts","sourceRoot":"","sources":["../../../src/modal/web/ModalStackRouteDrawer.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAE3E,iBAAS,qBAAqB,CAAC,EAC7B,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,EACT,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,8BAA8B,CAAC;IACxC,YAAY,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACpC,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,WAAW,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAA;KAAE,CAAC;CACnD,qBAsMA;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ModalStackRouteDrawer.web.js","sourceRoot":"","sources":["../../../src/modal/web/ModalStackRouteDrawer.web.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;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CAAC,OAAO,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CACnD,KAAK,CAAC,CAAC,cAAc,CAAC,CACtB;YAAA,CAAC,oHAAoH,CACrH;YAAA,CAAC,aAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EACzE;YAAA,CAAC,aAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EAC3D;YAAA,CAAC,+BAA+B,CAChC;YAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,EAAE,GAAG,CAC9D;UAAA,EAAE,GAAG,CACP;QAAA,EAAE,aAAM,CAAC,OAAO,CAClB;MAAA,EAAE,aAAM,CAAC,MAAM,CACjB;IAAA,EAAE,aAAM,CAAC,IAAI,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["'use client';\nimport React from 'react';\nimport { Drawer } from 'vaul';\n\nimport modalStyles from './modalStyles';\nimport { CSSWithVars } from './types';\nimport { useIsDesktop } from './utils';\nimport { ExtendedStackNavigationOptions } from '../../layouts/StackClient';\n\nfunction ModalStackRouteDrawer({\n routeKey,\n options,\n renderScreen,\n onDismiss,\n themeColors,\n}: {\n routeKey: string;\n options: ExtendedStackNavigationOptions;\n renderScreen: () => React.ReactNode;\n onDismiss: () => void;\n themeColors: { card: string; background: string };\n}) {\n const [open, setOpen] = React.useState(true);\n // Determine sheet vs. modal with an SSR-safe hook. The first render (during\n // hydration) always assumes mobile/sheet to match the server markup; an\n // effect then updates the state after mount if the viewport is desktop.\n const isDesktop = useIsDesktop();\n const isSheet = !isDesktop;\n\n // Resolve snap points logic.\n const allowed = options.sheetAllowedDetents;\n\n const isArrayDetents = Array.isArray(allowed);\n const useCustomSnapPoints = isArrayDetents && !(allowed.length === 1 && allowed[0] === 1);\n\n let snapPoints: (number | string)[] | undefined = useCustomSnapPoints\n ? (allowed as (number | string)[])\n : undefined;\n\n if (!isSheet) {\n snapPoints = [1];\n }\n\n const [snap, setSnap] = React.useState<number | string | null>(\n useCustomSnapPoints && isArrayDetents ? allowed[0] : 1\n );\n\n // Update the snap value when custom snap points change.\n React.useEffect(() => {\n if (isSheet) {\n const next = useCustomSnapPoints && isArrayDetents ? allowed[0] : 1;\n setSnap(next);\n } else {\n // Desktop modal always fixed snap at 1\n setSnap(1);\n }\n }, [isSheet, useCustomSnapPoints, isArrayDetents, allowed]);\n\n // Map react-native-screens ios sheet undimmed logic to Vaul's fadeFromIndex\n const fadeFromIndex = isSheet\n ? options.sheetLargestUndimmedDetentIndex === 'last'\n ? (snapPoints?.length ?? 0)\n : typeof options.sheetLargestUndimmedDetentIndex === 'number'\n ? options.sheetLargestUndimmedDetentIndex + 1\n : 0\n : 0;\n\n // --- Styling -----------------------------------------------------------\n\n // Using CSS variables so defaults live in CSS and can be overridden via props.\n const modalStyleVars: CSSWithVars = {\n backgroundColor: themeColors.background,\n };\n\n if (!isSheet) {\n if (options.webModalStyle?.width) {\n modalStyleVars['--expo-router-modal-width'] =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n\n modalStyleVars['--expo-router-modal-max-width'] =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n\n // Also set explicit width so browsers that ignore CSS vars in `width` prop still work.\n modalStyleVars.width =\n typeof options.webModalStyle.width === 'number'\n ? `${options.webModalStyle.width}px`\n : options.webModalStyle.width;\n }\n\n // Min width override\n if (options.webModalStyle?.minWidth) {\n const mw =\n typeof options.webModalStyle.minWidth === 'number'\n ? `${options.webModalStyle.minWidth}px`\n : options.webModalStyle.minWidth;\n modalStyleVars['--expo-router-modal-min-width'] = mw;\n modalStyleVars.minWidth = mw;\n }\n\n if (options.webModalStyle?.height) {\n const h =\n typeof options.webModalStyle.height === 'number'\n ? `${options.webModalStyle.height}px`\n : options.webModalStyle.height;\n modalStyleVars['--expo-router-modal-height'] = h;\n modalStyleVars.maxHeight = h;\n modalStyleVars.height = h;\n modalStyleVars.minHeight = h;\n }\n\n // Separate min-height override (takes precedence over modalHeight)\n if (options.webModalStyle?.minHeight) {\n const mh =\n typeof options.webModalStyle.minHeight === 'number'\n ? `${options.webModalStyle.minHeight}px`\n : options.webModalStyle.minHeight;\n modalStyleVars['--expo-router-modal-min-height'] = mh;\n modalStyleVars.minHeight = mh;\n }\n }\n\n const fitToContents = options.sheetAllowedDetents === 'fitToContents';\n\n if (fitToContents) {\n modalStyleVars.height = 'auto';\n modalStyleVars.minHeight = 'auto';\n\n // TODO:(@Hirbod) Clarify if we should limit maxHeight to sheets only\n // Allow sheet to grow with content but never exceed viewport height\n // dvh is important, otherwise it will scale over the visible viewport height\n modalStyleVars.maxHeight = '100dvh';\n }\n\n // Apply corner radius (default 10px)\n const radiusValue = options.sheetCornerRadius ?? 10;\n const radiusCss = typeof radiusValue === 'number' ? `${radiusValue}px` : radiusValue;\n\n if (options.webModalStyle?.border) {\n modalStyleVars['--expo-router-modal-border'] = options.webModalStyle.border;\n }\n\n if (isSheet) {\n // Only top corners for mobile sheet\n modalStyleVars.borderTopLeftRadius = radiusCss;\n modalStyleVars.borderTopRightRadius = radiusCss;\n\n // Only apply CSS var override if a custom corner radius was provided\n if (options.sheetCornerRadius) {\n modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;\n }\n } else {\n // All corners for desktop modal\n if (options.sheetCornerRadius) {\n modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;\n }\n }\n // --- End Styling -----------------------------------------------------------\n\n const handleOpenChange = (open: boolean) => {\n if (!open) onDismiss();\n };\n\n // Props that only make sense for sheets\n const sheetProps = isSheet\n ? {\n snapPoints: snapPoints as (number | string)[],\n activeSnapPoint: snap,\n setActiveSnapPoint: setSnap,\n fadeFromIndex,\n }\n : {};\n\n return (\n <Drawer.Root\n key={`${routeKey}-${isSheet ? 'sheet' : 'modal'}`}\n open={open}\n dismissible={options.gestureEnabled ?? true}\n onAnimationEnd={handleOpenChange}\n shouldScaleBackground\n autoFocus\n onOpenChange={setOpen}\n {...sheetProps}>\n <Drawer.Portal>\n <Drawer.Overlay\n className={modalStyles.overlay}\n style={\n options.webModalStyle?.overlayBackground\n ? ({\n '--expo-router-modal-overlay-background': options.webModalStyle.overlayBackground,\n } as React.CSSProperties)\n : undefined\n }\n />\n <Drawer.Content\n aria-describedby=\"modal-description\"\n className={modalStyles.drawerContent}\n style={{\n pointerEvents: 'none',\n // This needs to be limited to sheets, otherwise it will position the modal at the bottom of the screen\n ...(isSheet && fitToContents ? { height: 'auto' } : null),\n }}>\n <div\n className={modalStyles.modal}\n data-presentation={isSheet ? 'formSheet' : 'modal'}\n style={modalStyleVars}>\n {/* TODO:(@Hirbod) Figure out how to add title and description to the modal for screen readers in a meaningful way */}\n <Drawer.Title about=\"\" aria-describedby=\"\" className={modalStyles.srOnly} />\n <Drawer.Description about=\"\" className={modalStyles.srOnly} />\n {/* Render the screen content */}\n <div className={modalStyles.modalBody}>{renderScreen()}</div>\n </div>\n </Drawer.Content>\n </Drawer.Portal>\n </Drawer.Root>\n );\n}\n\nexport { ModalStackRouteDrawer };\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TransparentModalStackRouteDrawer.web.d.ts","sourceRoot":"","sources":["../../../src/modal/web/TransparentModalStackRouteDrawer.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAE3E,iBAAS,gCAAgC,CAAC,EACxC,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,GACV,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,8BAA8B,CAAC;IACxC,YAAY,EAAE,MAAM,KAAK,CAAC,SAAS,CAAC;IACpC,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB,qBAuBA;AAED,OAAO,EAAE,gCAAgC,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"TransparentModalStackRouteDrawer.web.js","sourceRoot":"","sources":["../../../src/modal/web/TransparentModalStackRouteDrawer.web.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;AA0CJ,4EAAgC;AAzCzC,kDAA0B;AAC1B,+BAA8B;AAE9B,gEAAwC;AAGxC,SAAS,gCAAgC,CAAC,EACxC,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,SAAS,GAMV;IACC,MAAM,gBAAgB,GAAG,CAAC,IAAa,EAAE,EAAE;QACzC,IAAI,CAAC,IAAI;YAAE,SAAS,EAAE,CAAC;IACzB,CAAC,CAAC;IAEF,OAAO,CACL,CAAC,aAAM,CAAC,IAAI,CACV,WAAW,CACX,SAAS,CACT,GAAG,CAAC,CAAC,GAAG,QAAQ,cAAc,CAAC,CAC/B,WAAW,CAAC,CAAC,OAAO,CAAC,cAAc,IAAI,KAAK,CAAC,CAC7C,cAAc,CAAC,CAAC,gBAAgB,CAAC,CACjC;MAAA,CAAC,aAAM,CAAC,MAAM,CACZ;QAAA,CAAC,aAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,wBAAwB,CAAC,CAC9D;UAAA,CAAC,oHAAoH,CACrH;UAAA,CAAC,aAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EACzE;UAAA,CAAC,aAAM,CAAC,WAAW,CAAC,KAAK,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,MAAM,CAAC,EAC3D;UAAA,CAAC,+BAA+B,CAChC;UAAA,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,qBAAW,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,EAAE,GAAG,CAC9D;QAAA,EAAE,aAAM,CAAC,OAAO,CAClB;MAAA,EAAE,aAAM,CAAC,MAAM,CACjB;IAAA,EAAE,aAAM,CAAC,IAAI,CAAC,CACf,CAAC;AACJ,CAAC","sourcesContent":["'use client';\nimport React from 'react';\nimport { Drawer } from 'vaul';\n\nimport modalStyles from './modalStyles';\nimport { ExtendedStackNavigationOptions } from '../../layouts/StackClient';\n\nfunction TransparentModalStackRouteDrawer({\n routeKey,\n options,\n renderScreen,\n onDismiss,\n}: {\n routeKey: string;\n options: ExtendedStackNavigationOptions;\n renderScreen: () => React.ReactNode;\n onDismiss: () => void;\n}) {\n const handleOpenChange = (open: boolean) => {\n if (!open) onDismiss();\n };\n\n return (\n <Drawer.Root\n defaultOpen\n autoFocus\n key={`${routeKey}-transparent`}\n dismissible={options.gestureEnabled ?? false}\n onAnimationEnd={handleOpenChange}>\n <Drawer.Portal>\n <Drawer.Content className={modalStyles.transparentDrawerContent}>\n {/* TODO:(@Hirbod) Figure out how to add title and description to the modal for screen readers in a meaningful way */}\n <Drawer.Title about=\"\" aria-describedby=\"\" className={modalStyles.srOnly} />\n <Drawer.Description about=\"\" className={modalStyles.srOnly} />\n {/* Render the screen content */}\n <div className={modalStyles.modalBody}>{renderScreen()}</div>\n </Drawer.Content>\n </Drawer.Portal>\n </Drawer.Root>\n );\n}\n\nexport { TransparentModalStackRouteDrawer };\n"]}
@@ -1,40 +0,0 @@
1
- import type { PropsWithChildren, ReactElement, ReactNode } from 'react';
2
- import type { NativeTabOptions } from './NativeTabsView';
3
- export type TabProps = PropsWithChildren<{
4
- /**
5
- * The name of the route.
6
- *
7
- * This is required when used inside a Layout component.
8
- *
9
- * When used in a route it has no effect.
10
- */
11
- name?: string;
12
- /**
13
- * If true, the tab will be hidden from the tab bar.
14
- */
15
- hidden?: boolean;
16
- /**
17
- * The options for the tab.
18
- */
19
- options?: Omit<NativeTabOptions, 'hidden' | 'specialEffects'>;
20
- /**
21
- * If true, the tab will not pop stack to the root when selected again.
22
- * @default false
23
- *
24
- * @platform ios
25
- */
26
- disablePopToTop?: boolean;
27
- /**
28
- * If true, the tab will not scroll to the top when selected again.
29
- * @default false
30
- *
31
- * @platform ios
32
- */
33
- disableScrollToTop?: boolean;
34
- }>;
35
- export declare function TabTrigger(props: TabProps): null;
36
- export declare function convertTabPropsToOptions({ options, hidden, children, disablePopToTop, disableScrollToTop, }: TabProps): NativeTabOptions;
37
- export declare function isTab(child: ReactNode, contextKey?: string): child is ReactElement<TabProps & {
38
- name: string;
39
- }>;
40
- //# sourceMappingURL=TabOptions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TabOptions.d.ts","sourceRoot":"","sources":["../../../src/native-tabs/NativeBottomTabs/TabOptions.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAKzD,MAAM,MAAM,QAAQ,GAAG,iBAAiB,CAAC;IACvC;;;;;;OAMG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,gBAAgB,CAAC,CAAC;IAC9D;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC,CAAC;AAEH,wBAAgB,UAAU,CAAC,KAAK,EAAE,QAAQ,QAqBzC;AAED,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,EACP,MAAM,EACN,QAAQ,EACR,eAAe,EACf,kBAAkB,GACnB,EAAE,QAAQ,oBAuDV;AAED,wBAAgB,KAAK,CACnB,KAAK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E,CAAC;YAC1C,IACE,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC,IAAI,CAChC,CAAC,GAAG,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,IAAI,GAAG,IAAI,KAAK,CAAC,KAAK,CAC9E,EACD,CAAC;gBACD,MAAM,IAAI,KAAK,CACb,uDAAuD,UAAU,0GAA0G,CAC5K,CAAC;YACJ,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["'use client';\n\nimport { useNavigation, useRoute } from '@react-navigation/native';\nimport type { PropsWithChildren, ReactElement, ReactNode } from 'react';\nimport { isValidElement } from 'react';\n\nimport type { NativeTabOptions } from './NativeTabsView';\nimport { filterAllowedChildrenElements, isChildOfType } from './utils';\nimport { useSafeLayoutEffect } from '../../views/useSafeLayoutEffect';\nimport { Icon, Badge, Label } from '../common/elements';\n\nexport type TabProps = PropsWithChildren<{\n /**\n * The name of the route.\n *\n * This is required when used inside a Layout component.\n *\n * When used in a route it has no effect.\n */\n name?: string;\n /**\n * If true, the tab will be hidden from the tab bar.\n */\n hidden?: boolean;\n /**\n * The options for the tab.\n */\n options?: Omit<NativeTabOptions, 'hidden' | 'specialEffects'>;\n /**\n * If true, the tab will not pop stack to the root when selected again.\n * @default false\n *\n * @platform ios\n */\n disablePopToTop?: boolean;\n /**\n * If true, the tab will not scroll to the top when selected again.\n * @default false\n *\n * @platform ios\n */\n disableScrollToTop?: boolean;\n}>;\n\nexport function TabTrigger(props: TabProps) {\n const route = useRoute();\n const navigation = useNavigation();\n const isFocused = navigation.isFocused();\n\n useSafeLayoutEffect(() => {\n // This will cause the tab to update only when it is focused.\n // As long as all tabs are loaded at the start, we don't need this check.\n // It is here to ensure similar behavior to stack\n if (isFocused) {\n if (navigation.getState()?.type !== 'tab') {\n throw new Error(\n `Trigger component can only be used in the tab screen. Current route: ${route.name}`\n );\n }\n const options = convertTabPropsToOptions(props);\n navigation.setOptions(options);\n }\n }, [isFocused, props]);\n\n return null;\n}\n\nexport function convertTabPropsToOptions({\n options,\n hidden,\n children,\n disablePopToTop,\n disableScrollToTop,\n}: TabProps) {\n const initialOptions: NativeTabOptions = {\n ...options,\n hidden: !!hidden,\n specialEffects: {\n repeatedTabSelection: {\n popToRoot: !disablePopToTop,\n scrollToTop: !disableScrollToTop,\n },\n },\n };\n const allowedChildren = filterAllowedChildrenElements(children, [Badge, Label, Icon]);\n return allowedChildren.reduce<NativeTabOptions>(\n (acc, child) => {\n if (isChildOfType(child, Badge)) {\n if (child.props.children) {\n acc.badgeValue = String(child.props.children);\n }\n } else if (isChildOfType(child, Label)) {\n acc.title = child.props.children;\n } else if (isChildOfType(child, Icon)) {\n if ('src' in child.props || 'selectedSrc' in child.props) {\n acc.icon = child.props.src\n ? {\n src: child.props.src,\n }\n : undefined;\n acc.selectedIcon = child.props.selectedSrc\n ? {\n src: child.props.selectedSrc,\n }\n : undefined;\n } else if ('sf' in child.props || 'selectedSf' in child.props) {\n if (process.env.EXPO_OS === 'ios') {\n acc.icon = child.props.sf\n ? {\n sf: child.props.sf,\n }\n : undefined;\n acc.selectedIcon = child.props.selectedSf\n ? {\n sf: child.props.selectedSf,\n }\n : undefined;\n }\n }\n if (process.env.EXPO_OS === 'android') {\n acc.icon = { drawable: child.props.drawable };\n acc.selectedIcon = undefined;\n }\n }\n return acc;\n },\n { ...initialOptions }\n );\n}\n\nexport function isTab(\n child: ReactNode,\n contextKey?: string\n): child is ReactElement<TabProps & { name: string }> {\n if (isValidElement(child) && child && child.type === TabTrigger) {\n if (\n typeof child.props === 'object' &&\n child.props &&\n 'name' in child.props &&\n !child.props.name\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must have a \\`name\\` prop when used as a child of a Layout Route.`\n );\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (\n ['component', 'getComponent'].some(\n (key) => child.props && typeof child.props === 'object' && key in child.props\n )\n ) {\n throw new Error(\n `<Trigger /> component in \\`default export\\` at \\`app${contextKey}/_layout\\` must not have a \\`component\\` or \\`getComponent\\` prop when used as a child of a Layout Route`\n );\n }\n }\n\n return true;\n }\n\n return false;\n}\n"]}