expo-router 6.0.0-beta.1 → 6.0.0-beta.10
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/assets/modal.module.css +15 -14
- package/assets/native-tabs.module.css +1 -1
- package/build/fork/extractPathFromURL.d.ts.map +1 -1
- package/build/fork/extractPathFromURL.js +4 -0
- package/build/fork/extractPathFromURL.js.map +1 -1
- package/build/fork/getPathFromState.d.ts.map +1 -1
- package/build/fork/getPathFromState.js +2 -0
- package/build/fork/getPathFromState.js.map +1 -1
- package/build/global-state/routing.d.ts.map +1 -1
- package/build/global-state/routing.js +12 -3
- package/build/global-state/routing.js.map +1 -1
- package/build/layouts/StackClient.d.ts +12 -7
- package/build/layouts/StackClient.d.ts.map +1 -1
- package/build/layouts/StackClient.js +27 -25
- package/build/layouts/StackClient.js.map +1 -1
- package/build/link/ExpoLink.d.ts.map +1 -1
- package/build/link/ExpoLink.js +4 -1
- package/build/link/ExpoLink.js.map +1 -1
- package/build/link/LinkWithPreview.d.ts.map +1 -1
- package/build/link/LinkWithPreview.js +18 -23
- package/build/link/LinkWithPreview.js.map +1 -1
- package/build/link/elements.d.ts +1 -1
- package/build/link/elements.js +1 -1
- package/build/link/elements.js.map +1 -1
- package/build/link/preview/native.d.ts +0 -2
- package/build/link/preview/native.d.ts.map +1 -1
- package/build/link/preview/native.js +0 -10
- package/build/link/preview/native.js.map +1 -1
- package/build/link/preview/utils.d.ts.map +1 -1
- package/build/link/preview/utils.js +5 -2
- package/build/link/preview/utils.js.map +1 -1
- package/build/modal/web/ModalStackRouteDrawer.js +9 -10
- package/build/modal/web/ModalStackRouteDrawer.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.d.ts +1 -0
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.js +45 -6
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsNavigator.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.js +6 -27
- package/build/native-tabs/NativeBottomTabs/NativeBottomTabsRouter.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts +11 -3
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js +154 -62
- package/build/native-tabs/NativeBottomTabs/NativeTabTrigger.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabs.d.ts +3 -2
- package/build/native-tabs/NativeBottomTabs/NativeTabs.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.d.ts +24 -0
- package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.d.ts.map +1 -0
- package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.js +28 -0
- package/build/native-tabs/NativeBottomTabs/NativeTabsTriggerTabBar.js.map +1 -0
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.d.ts +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.js +115 -30
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.web.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.web.js +57 -27
- package/build/native-tabs/NativeBottomTabs/NativeTabsView.web.js.map +1 -1
- package/build/native-tabs/NativeBottomTabs/appearance.d.ts +20 -0
- package/build/native-tabs/NativeBottomTabs/appearance.d.ts.map +1 -0
- package/build/native-tabs/NativeBottomTabs/appearance.js +119 -0
- package/build/native-tabs/NativeBottomTabs/appearance.js.map +1 -0
- package/build/native-tabs/NativeBottomTabs/types.d.ts +298 -59
- package/build/native-tabs/NativeBottomTabs/types.d.ts.map +1 -1
- package/build/native-tabs/NativeBottomTabs/types.js +51 -0
- package/build/native-tabs/NativeBottomTabs/types.js.map +1 -1
- package/build/native-tabs/common/elements.d.ts +84 -21
- package/build/native-tabs/common/elements.d.ts.map +1 -1
- package/build/native-tabs/common/elements.js +23 -0
- package/build/native-tabs/common/elements.js.map +1 -1
- package/build/native-tabs/index.d.ts +2 -1
- package/build/native-tabs/index.d.ts.map +1 -1
- package/build/native-tabs/index.js +3 -1
- package/build/native-tabs/index.js.map +1 -1
- package/build/navigationParams.d.ts +9 -0
- package/build/navigationParams.d.ts.map +1 -0
- package/build/navigationParams.js +67 -0
- package/build/navigationParams.js.map +1 -0
- package/build/testing-library/index.d.ts +15 -4
- package/build/testing-library/index.d.ts.map +1 -1
- package/build/testing-library/index.js +31 -28
- package/build/testing-library/index.js.map +1 -1
- package/build/typed-routes/generate.d.ts +2 -1
- package/build/typed-routes/generate.d.ts.map +1 -1
- package/build/typed-routes/generate.js +3 -1
- package/build/typed-routes/generate.js.map +1 -1
- package/build/ui/Slot.d.ts +5 -1
- package/build/ui/Slot.d.ts.map +1 -1
- package/build/ui/Slot.js.map +1 -1
- package/build/ui/Tabs.d.ts.map +1 -1
- package/build/ui/Tabs.js +1 -1
- package/build/ui/Tabs.js.map +1 -1
- package/build/ui/common.d.ts +2 -3
- package/build/ui/common.d.ts.map +1 -1
- package/build/ui/common.js +1 -3
- package/build/ui/common.js.map +1 -1
- package/build/useFocusEffect.js +1 -1
- package/build/useFocusEffect.js.map +1 -1
- package/ios/ExpoHead.podspec +2 -0
- package/ios/LinkPreview/LinkPreviewNativeModule.swift +7 -9
- package/ios/LinkPreview/LinkPreviewNativeView.swift +13 -28
- package/package.json +10 -11
- package/ios/LinkPreview/LinkPreviewNativeTriggerView.swift +0 -9
- package/plugin/tsconfig.tsbuildinfo +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackClient.js","sourceRoot":"","sources":["../../src/layou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;AACJ,CAAC,CAAC;AANW,QAAA,WAAW,eAMtB","sourcesContent":["'use client';\nimport {\n CommonNavigationAction,\n NavigationAction,\n ParamListBase,\n PartialRoute,\n PartialState,\n Route,\n RouterConfigOptions,\n StackRouter as RNStackRouter,\n StackActionType,\n StackNavigationState,\n} from '@react-navigation/native';\nimport {\n NativeStackNavigationEventMap,\n NativeStackNavigationOptions,\n} from '@react-navigation/native-stack';\nimport { nanoid } from 'nanoid/non-secure';\nimport { ComponentProps, useMemo } from 'react';\nimport { StackAnimationTypes } from 'react-native-screens';\n\nimport { withLayoutContext } from './withLayoutContext';\nimport { createNativeStackNavigator } from '../fork/native-stack/createNativeStackNavigator';\nimport { useLinkPreviewContext } from '../link/preview/LinkPreviewContext';\nimport { SingularOptions, getSingularId } from '../useScreens';\nimport { Protected } from '../views/Protected';\n\ntype GetId = NonNullable<RouterConfigOptions['routeGetIdList'][string]>;\n\nconst NativeStackNavigator = createNativeStackNavigator().Navigator;\n\n/**\n * We extend NativeStackNavigationOptions with our custom props\n * to allow for several extra props to be used on web, like modalWidth\n */\nexport type ExtendedStackNavigationOptions = NativeStackNavigationOptions & {\n webModalStyle?: {\n /**\n * Override the width of the modal (px or percentage). Only applies on web platform.\n * @platform web\n */\n width?: number | string;\n /**\n * Override the height of the modal (px or percentage). Applies on web desktop.\n * @platform web\n */\n height?: number | string;\n /**\n * Minimum height of the desktop modal (px or percentage). Overrides the default 640px clamp.\n * @platform web\n */\n minHeight?: number | string;\n /**\n * Minimum width of the desktop modal (px or percentage). Overrides the default 580px.\n * @platform web\n */\n minWidth?: number | string;\n /**\n * Override the border of the desktop modal (any valid CSS border value, e.g. '1px solid #ccc' or 'none').\n * @platform web\n */\n border?: string;\n /**\n * Override the overlay background color (any valid CSS color or rgba/hsla value).\n * @platform web\n */\n overlayBackground?: string;\n };\n};\n\nconst RNStack = withLayoutContext<\n ExtendedStackNavigationOptions,\n typeof NativeStackNavigator,\n StackNavigationState<ParamListBase>,\n NativeStackNavigationEventMap\n>(NativeStackNavigator);\n\ntype RNNavigationAction = Extract<CommonNavigationAction, { type: 'NAVIGATE' }>;\ntype RNPreloadAction = Extract<CommonNavigationAction, { type: 'PRELOAD' }>;\ntype ExpoNavigationAction = Omit<RNNavigationAction, 'payload'> & {\n payload: Omit<RNNavigationAction['payload'], 'params'> & {\n params: {\n __internal__expoRouterIsPreviewNavigation?: boolean;\n params?: Record<string, unknown>;\n };\n };\n};\n\nfunction isStackAction(\n action: NavigationAction\n): action is StackActionType | RNPreloadAction | ExpoNavigationAction {\n return (\n action.type === 'PUSH' ||\n action.type === 'NAVIGATE' ||\n action.type === 'POP' ||\n action.type === 'POP_TO_TOP' ||\n action.type === 'REPLACE' ||\n action.type === 'PRELOAD'\n );\n}\n\nconst isPreviewAction = (action: NavigationAction): action is ExpoNavigationAction =>\n !!action.payload &&\n 'params' in action.payload &&\n !!action.payload.params &&\n typeof action.payload === 'object' &&\n '__internal__expoRouterIsPreviewNavigation' in (action.payload.params as any) &&\n !!(action.payload.params as any).__internal__expoRouterIsPreviewNavigation;\n\n/**\n * React Navigation matches a screen by its name or a 'getID' function that uniquely identifies a screen.\n * When a screen has been uniquely identified, the Stack can only have one instance of that screen.\n *\n * Expo Router allows for a screen to be matched by name and path params, a 'getID' function or a singular id.\n *\n * Instead of reimplementing the entire StackRouter, we can override the getStateForAction method to handle the singular screen logic.\n *\n */\nexport const stackRouterOverride: NonNullable<ComponentProps<typeof RNStack>['UNSTABLE_router']> = (\n original\n) => {\n return {\n getStateForAction: (state, action, options) => {\n if (action.target && action.target !== state.key) {\n return null;\n }\n\n if (!isStackAction(action)) {\n return original.getStateForAction(state, action, options);\n }\n\n // The dynamic getId added to an action, `router.push('screen', { singular: true })`\n const actionSingularOptions =\n action.payload && 'singular' in action.payload\n ? (action.payload.singular as SingularOptions)\n : undefined;\n\n // Handle if 'getID' or 'singular' is set.\n function getIdFunction(): GetId | undefined {\n // Actions can be fired by the user, so we do need to validate their structure.\n if (\n !('payload' in action) ||\n !action.payload ||\n !('name' in action.payload) ||\n typeof action.payload.name !== 'string'\n ) {\n return;\n }\n\n const actionName = action.payload.name;\n\n return (\n // The dynamic singular added to an action, `router.push('screen', { singular: () => 'id' })`\n getActionSingularIdFn(actionSingularOptions, actionName) ||\n // The static getId added as a prop to `<Screen singular />` or `<Screen getId={} />`\n options.routeGetIdList[actionName]\n );\n }\n\n const { routeParamList } = options;\n\n switch (action.type) {\n case 'PUSH':\n case 'NAVIGATE': {\n if (!state.routeNames.includes(action.payload.name)) {\n return null;\n }\n\n // START FORK\n const getId = getIdFunction();\n // const getId = options.routeGetIdList[action.payload.name];\n // END FORK\n const id = getId?.({ params: action.payload.params });\n\n let route: Route<string> | undefined;\n\n if (id !== undefined) {\n route = state.routes.findLast(\n (route) =>\n route.name === action.payload.name && id === getId?.({ params: route.params })\n );\n } else if (action.type === 'NAVIGATE') {\n const currentRoute = state.routes[state.index];\n\n // If the route matches the current one, then navigate to it\n if (action.payload.name === currentRoute.name) {\n route = currentRoute;\n } else if (action.payload.pop) {\n route = state.routes.findLast((route) => route.name === action.payload.name);\n }\n }\n\n // START FORK\n if (isPreviewAction(action)) {\n route = state.preloadedRoutes.find(\n (route) => route.name === action.payload.name && id === route.key\n );\n }\n // END FORK\n\n if (!route) {\n route = state.preloadedRoutes.find(\n (route) =>\n route.name === action.payload.name && id === getId?.({ params: route.params })\n );\n }\n\n let params;\n\n if (action.type === 'NAVIGATE' && action.payload.merge && route) {\n params =\n action.payload.params !== undefined ||\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...route.params,\n ...action.payload.params,\n }\n : route.params;\n } else {\n params =\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...action.payload.params,\n }\n : action.payload.params;\n }\n\n let routes: Route<string>[];\n\n if (route) {\n if (action.type === 'NAVIGATE' && action.payload.pop) {\n routes = [];\n\n // Get all routes until the matching one\n for (const r of state.routes) {\n if (r.key === route.key) {\n routes.push({\n ...route,\n path: action.payload.path !== undefined ? action.payload.path : route.path,\n params,\n });\n break;\n }\n\n routes.push(r);\n }\n } else {\n // START FORK\n // If there is an id, then filter out the existing route with the same id.\n // THIS ACTION IS DANGEROUS. This can cause React Native Screens to freeze\n if (id !== undefined) {\n routes = state.routes.filter((r) => r.key !== route.key);\n } else if (action.type === 'NAVIGATE' && state.routes.length > 0) {\n // The navigation action should only replace the last route if it has the same name and path params.\n const lastRoute = state.routes[state.routes.length - 1];\n if (\n getSingularId(lastRoute.name, { params: lastRoute.params }) ===\n getSingularId(route.name, { params })\n ) {\n routes = state.routes.slice(0, -1);\n } else {\n routes = [...state.routes];\n }\n } else {\n routes = [...state.routes];\n }\n\n // If the routes length is the same as the state routes length, then we are navigating to a new route.\n // Otherwise we are replacing an existing route.\n const key =\n routes.length === state.routes.length && !isPreviewAction(action)\n ? `${action.payload.name}-${nanoid()}`\n : route.key;\n\n routes.push({\n ...route,\n key,\n path:\n action.type === 'NAVIGATE' && action.payload.path !== undefined\n ? action.payload.path\n : route.path,\n params,\n });\n\n // routes = state.routes.filter((r) => r.key !== route.key);\n // routes.push({\n // ...route,\n // path:\n // action.type === 'NAVIGATE' && action.payload.path !== undefined\n // ? action.payload.path\n // : route.path,\n // params,\n // });\n // END FORK\n }\n } else {\n routes = [\n ...state.routes,\n {\n key: `${action.payload.name}-${nanoid()}`,\n name: action.payload.name,\n path: action.type === 'NAVIGATE' ? action.payload.path : undefined,\n params,\n },\n ];\n }\n\n // START FORK\n // return filterSingular(\n const result = {\n ...state,\n index: routes.length - 1,\n preloadedRoutes: state.preloadedRoutes.filter(\n (route) => routes[routes.length - 1].key !== route.key\n ),\n routes,\n };\n\n if (actionSingularOptions) {\n return filterSingular(result, getId);\n }\n\n return result;\n // return {\n // ...state,\n // index: routes.length - 1,\n // preloadedRoutes: state.preloadedRoutes.filter(\n // (route) => routes[routes.length - 1].key !== route.key\n // ),\n // routes,\n // };\n // END FORK\n }\n case 'PRELOAD': {\n // START FORK\n // This will be the case for example for protected route\n if (!state.routeNames.includes(action.payload.name)) {\n return null;\n }\n // END FORK\n const getId = options.routeGetIdList[action.payload.name];\n const id = getId?.({ params: action.payload.params });\n\n let route: Route<string> | undefined;\n\n if (id !== undefined) {\n route = state.routes.find(\n (route) =>\n route.name === action.payload.name && id === getId?.({ params: route.params })\n );\n }\n\n if (route) {\n return {\n ...state,\n routes: state.routes.map((r) => {\n if (r.key !== route?.key) {\n return r;\n }\n return {\n ...r,\n params:\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...action.payload.params,\n }\n : action.payload.params,\n };\n }),\n };\n } else {\n // START FORK\n const currentPreloadedRoute: (typeof state)['preloadedRoutes'][number] = {\n key: `${action.payload.name}-${nanoid()}`,\n name: action.payload.name,\n params:\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...action.payload.params,\n }\n : action.payload.params,\n };\n // END FORK\n return {\n ...state,\n // START FORK\n // Adding the current preloaded route to the beginning of the preloadedRoutes array\n // This ensures that the preloaded route will be the next one after the visible route\n // and when navigation will happen, there will be no reshuffling\n // This is a workaround for the link preview navigation issue, when screen would freeze after navigation from native side\n // and reshuffling from react-navigation\n preloadedRoutes: [currentPreloadedRoute].concat(\n state.preloadedRoutes.filter(\n (r) => r.name !== action.payload.name || id !== getId?.({ params: r.params })\n )\n ),\n // preloadedRoutes: state.preloadedRoutes\n // .filter(\n // (r) =>\n // r.name !== action.payload.name ||\n // id !== getId?.({ params: r.params })\n // )\n // .concat({\n // key: `${action.payload.name}-${nanoid()}`,\n // name: action.payload.name,\n // params:\n // routeParamList[action.payload.name] !== undefined\n // ? {\n // ...routeParamList[action.payload.name],\n // ...action.payload.params,\n // }\n // : action.payload.params,\n // }),\n // END FORK\n };\n }\n }\n default: {\n return original.getStateForAction(state, action, options);\n }\n }\n },\n };\n};\n\nfunction getActionSingularIdFn(\n actionGetId: SingularOptions | undefined,\n name: string\n): GetId | undefined {\n if (typeof actionGetId === 'function') {\n return (options) => actionGetId(name, options.params ?? {});\n } else if (actionGetId === true) {\n return (options) => getSingularId(name, options);\n }\n\n return undefined;\n}\n\n/**\n * If there is a dynamic singular on an action, then we need to filter the state to only have singular screens.\n * As multiples may have been added before we did the singular navigation.\n */\nfunction filterSingular<\n T extends\n | StackNavigationState<ParamListBase>\n | PartialState<StackNavigationState<ParamListBase>>\n | null,\n>(state: T, getId?: GetId): T {\n if (!state) {\n return state;\n }\n\n if (!state.routes) {\n return state;\n }\n\n const currentIndex = state.index || state.routes.length - 1;\n const current = state.routes[currentIndex];\n const name = current.name;\n\n const id = getId?.({ params: current.params });\n\n if (!id) {\n return state;\n }\n\n // TypeScript needs a type assertion here for the filter to work.\n let routes = state.routes as PartialRoute<Route<string, object | undefined>>[];\n routes = routes.filter((route, index) => {\n // If the route is the current route, keep it.\n if (index === currentIndex) {\n return true;\n }\n\n // Remove all other routes with the same name and id.\n return name !== route.name || id !== getId?.({ params: route.params });\n });\n\n return {\n ...state,\n index: routes.length - 1,\n routes,\n };\n}\n\nconst Stack = Object.assign(\n (props: ComponentProps<typeof RNStack>) => {\n const { isStackAnimationDisabled } = useLinkPreviewContext();\n const screenOptions = useMemo(() => {\n if (isStackAnimationDisabled) {\n return disableAnimationInScreenOptions(props.screenOptions);\n }\n return props.screenOptions;\n }, [props.screenOptions, isStackAnimationDisabled]);\n\n return (\n <RNStack {...props} screenOptions={screenOptions} UNSTABLE_router={stackRouterOverride} />\n );\n },\n {\n Screen: RNStack.Screen as (\n props: ComponentProps<typeof RNStack.Screen> & { singular?: boolean }\n ) => null,\n Protected,\n }\n);\n\ntype NativeStackScreenOptions = ComponentProps<typeof RNStack>['screenOptions'];\n\nfunction disableAnimationInScreenOptions(\n options: NativeStackScreenOptions | undefined\n): NativeStackScreenOptions {\n const animationNone: StackAnimationTypes = 'none';\n if (options) {\n if (typeof options === 'function') {\n const newOptions: typeof options = (...args) => {\n const oldResult = options(...args);\n return {\n ...oldResult,\n animation: animationNone,\n };\n };\n return newOptions;\n }\n return {\n ...options,\n animation: animationNone,\n };\n }\n return {\n animation: animationNone,\n };\n}\n\nexport default Stack;\n\nexport const StackRouter: typeof RNStackRouter = (options) => {\n const router = RNStackRouter(options);\n return {\n ...router,\n ...stackRouterOverride(router),\n };\n};\n"]}
|
|
1
|
+
{"version":3,"file":"StackClient.js","sourceRoot":"","sources":["../../src/layouts/StackClient.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AACb,qDAYkC;AAKlC,kDAA2C;AAC3C,iCAAgD;AAEhD,2DAAwD;AACxD,gGAA6F;AAC7F,2EAA2E;AAC3E,0DAAiG;AACjG,8CAA+D;AAC/D,kDAA+C;AAI/C,MAAM,oBAAoB,GAAG,IAAA,uDAA0B,GAAE,CAAC,SAAS,CAAC;AA8CpE,MAAM,OAAO,GAAG,IAAA,qCAAiB,EAK/B,oBAAoB,CAAC,CAAC;AAUxB,SAAS,aAAa,CACpB,MAAwB;IAExB,OAAO,CACL,MAAM,CAAC,IAAI,KAAK,MAAM;QACtB,MAAM,CAAC,IAAI,KAAK,UAAU;QAC1B,MAAM,CAAC,IAAI,KAAK,KAAK;QACrB,MAAM,CAAC,IAAI,KAAK,YAAY;QAC5B,MAAM,CAAC,IAAI,KAAK,SAAS;QACzB,MAAM,CAAC,IAAI,KAAK,SAAS,CAC1B,CAAC;AACJ,CAAC;AAED,MAAM,eAAe,GAAG,CAAC,MAAwB,EAAkC,EAAE,CACnF,CAAC,CAAC,MAAM,CAAC,OAAO;IAChB,QAAQ,IAAI,MAAM,CAAC,OAAO;IAC1B,OAAO,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,QAAQ;IACzC,CAAC,CAAC,IAAA,8CAA2B,EAAC,MAAM,CAAC,OAAO,EAAE,MAAM,IAAI,SAAS,CAAC,CAChE,+CAA+C,CAChD,CAAC;AAEJ;;;;;;;;GAQG;AACI,MAAM,mBAAmB,GAAmE,CACjG,QAAQ,EACR,EAAE;IACF,OAAO;QACL,i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AC,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO;gBACL,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;gBAClB,SAAS,EAAE,MAAM;aAClB,CAAC;QACJ,CAAC;QACD,OAAO,OAAO,IAAI,EAAE,CAAC;IACvB,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,mCAAmC,CAAC,KAAuC;IAClF,MAAM,UAAU,GAAG,IAAA,8CAA2B,EAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IAC7D,OAAO,CAAC,CAAC,UAAU,CAAC,mCAAmC,CAAC;AAC1D,CAAC;AAED,kBAAe,KAAK,CAAC;AAEd,MAAM,WAAW,GAAyB,CAAC,OAAO,EAAE,EAAE;IAC3D,MAAM,MAAM,GAAG,IAAA,oBAAa,EAAC,OAAO,CAAC,CAAC;IACtC,OAAO;QACL,GAAG,MAAM;QACT,GAAG,IAAA,2BAAmB,EAAC,MAAM,CAAC;KAC/B,CAAC;AACJ,CAAC,CAAC;AANW,QAAA,WAAW,eAMtB","sourcesContent":["'use client';\nimport {\n CommonNavigationAction,\n NavigationAction,\n ParamListBase,\n PartialRoute,\n PartialState,\n Route,\n RouterConfigOptions,\n StackRouter as RNStackRouter,\n StackActionType,\n StackNavigationState,\n type RouteProp,\n} from '@react-navigation/native';\nimport {\n NativeStackNavigationEventMap,\n NativeStackNavigationOptions,\n} from '@react-navigation/native-stack';\nimport { nanoid } from 'nanoid/non-secure';\nimport { ComponentProps, useMemo } from 'react';\n\nimport { withLayoutContext } from './withLayoutContext';\nimport { createNativeStackNavigator } from '../fork/native-stack/createNativeStackNavigator';\nimport { useLinkPreviewContext } from '../link/preview/LinkPreviewContext';\nimport { getInternalExpoRouterParams, type InternalExpoRouterParams } from '../navigationParams';\nimport { SingularOptions, getSingularId } from '../useScreens';\nimport { Protected } from '../views/Protected';\n\ntype GetId = NonNullable<RouterConfigOptions['routeGetIdList'][string]>;\n\nconst NativeStackNavigator = createNativeStackNavigator().Navigator;\n\n/**\n * We extend NativeStackNavigationOptions with our custom props\n * to allow for several extra props to be used on web, like modalWidth\n */\nexport type ExtendedStackNavigationOptions = NativeStackNavigationOptions & {\n webModalStyle?: {\n /**\n * Override the width of the modal (px or percentage). Only applies on web platform.\n * @platform web\n */\n width?: number | string;\n /**\n * Override the height of the modal (px or percentage). Applies on web desktop.\n * @platform web\n */\n height?: number | string;\n /**\n * Minimum height of the desktop modal (px or percentage). Overrides the default 640px clamp.\n * @platform web\n */\n minHeight?: number | string;\n /**\n * Minimum width of the desktop modal (px or percentage). Overrides the default 580px.\n * @platform web\n */\n minWidth?: number | string;\n /**\n * Override the border of the desktop modal (any valid CSS border value, e.g. '1px solid #ccc' or 'none').\n * @platform web\n */\n border?: string;\n /**\n * Override the overlay background color (any valid CSS color or rgba/hsla value).\n * @platform web\n */\n overlayBackground?: string;\n /**\n * Override the modal shadow filter (any valid CSS filter value, e.g. 'drop-shadow(0 4px 8px rgba(0,0,0,0.1))' or 'none').\n * @platform web\n */\n shadow?: string;\n };\n};\n\nconst RNStack = withLayoutContext<\n ExtendedStackNavigationOptions,\n typeof NativeStackNavigator,\n StackNavigationState<ParamListBase>,\n NativeStackNavigationEventMap\n>(NativeStackNavigator);\n\ntype RNNavigationAction = Extract<CommonNavigationAction, { type: 'NAVIGATE' }>;\ntype RNPreloadAction = Extract<CommonNavigationAction, { type: 'PRELOAD' }>;\ntype ExpoNavigationAction = Omit<RNNavigationAction, 'payload'> & {\n payload: Omit<RNNavigationAction['payload'], 'params'> & {\n params: RNNavigationAction['payload']['params'] & InternalExpoRouterParams;\n };\n};\n\nfunction isStackAction(\n action: NavigationAction\n): action is StackActionType | RNPreloadAction | ExpoNavigationAction {\n return (\n action.type === 'PUSH' ||\n action.type === 'NAVIGATE' ||\n action.type === 'POP' ||\n action.type === 'POP_TO_TOP' ||\n action.type === 'REPLACE' ||\n action.type === 'PRELOAD'\n );\n}\n\nconst isPreviewAction = (action: NavigationAction): action is ExpoNavigationAction =>\n !!action.payload &&\n 'params' in action.payload &&\n typeof action.payload.params === 'object' &&\n !!getInternalExpoRouterParams(action.payload?.params ?? undefined)[\n '__internal__expo_router_is_preview_navigation'\n ];\n\n/**\n * React Navigation matches a screen by its name or a 'getID' function that uniquely identifies a screen.\n * When a screen has been uniquely identified, the Stack can only have one instance of that screen.\n *\n * Expo Router allows for a screen to be matched by name and path params, a 'getID' function or a singular id.\n *\n * Instead of reimplementing the entire StackRouter, we can override the getStateForAction method to handle the singular screen logic.\n *\n */\nexport const stackRouterOverride: NonNullable<ComponentProps<typeof RNStack>['UNSTABLE_router']> = (\n original\n) => {\n return {\n getStateForAction: (state, action, options) => {\n if (action.target && action.target !== state.key) {\n return null;\n }\n\n if (!isStackAction(action)) {\n return original.getStateForAction(state, action, options);\n }\n\n // The dynamic getId added to an action, `router.push('screen', { singular: true })`\n const actionSingularOptions =\n action.payload && 'singular' in action.payload\n ? (action.payload.singular as SingularOptions)\n : undefined;\n\n // Handle if 'getID' or 'singular' is set.\n function getIdFunction(): GetId | undefined {\n // Actions can be fired by the user, so we do need to validate their structure.\n if (\n !('payload' in action) ||\n !action.payload ||\n !('name' in action.payload) ||\n typeof action.payload.name !== 'string'\n ) {\n return;\n }\n\n const actionName = action.payload.name;\n\n return (\n // The dynamic singular added to an action, `router.push('screen', { singular: () => 'id' })`\n getActionSingularIdFn(actionSingularOptions, actionName) ||\n // The static getId added as a prop to `<Screen singular />` or `<Screen getId={} />`\n options.routeGetIdList[actionName]\n );\n }\n\n const { routeParamList } = options;\n\n switch (action.type) {\n case 'PUSH':\n case 'NAVIGATE': {\n if (!state.routeNames.includes(action.payload.name)) {\n return null;\n }\n\n // START FORK\n const getId = getIdFunction();\n // const getId = options.routeGetIdList[action.payload.name];\n // END FORK\n const id = getId?.({ params: action.payload.params });\n\n let route: Route<string> | undefined;\n\n if (id !== undefined) {\n route = state.routes.findLast(\n (route) =>\n route.name === action.payload.name && id === getId?.({ params: route.params })\n );\n } else if (action.type === 'NAVIGATE') {\n const currentRoute = state.routes[state.index];\n\n // If the route matches the current one, then navigate to it\n if (action.payload.name === currentRoute.name) {\n route = currentRoute;\n } else if (action.payload.pop) {\n route = state.routes.findLast((route) => route.name === action.payload.name);\n }\n }\n\n // START FORK\n if (isPreviewAction(action) && !route) {\n route = state.preloadedRoutes.find(\n (route) => route.name === action.payload.name && id === route.key\n );\n }\n // END FORK\n\n if (!route) {\n route = state.preloadedRoutes.find(\n (route) =>\n route.name === action.payload.name && id === getId?.({ params: route.params })\n );\n }\n\n let params;\n\n if (action.type === 'NAVIGATE' && action.payload.merge && route) {\n params =\n action.payload.params !== undefined ||\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...route.params,\n ...action.payload.params,\n }\n : route.params;\n } else {\n params =\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...action.payload.params,\n }\n : action.payload.params;\n }\n\n let routes: Route<string>[];\n\n if (route) {\n if (action.type === 'NAVIGATE' && action.payload.pop) {\n routes = [];\n\n // Get all routes until the matching one\n for (const r of state.routes) {\n if (r.key === route.key) {\n routes.push({\n ...route,\n path: action.payload.path !== undefined ? action.payload.path : route.path,\n params,\n });\n break;\n }\n\n routes.push(r);\n }\n } else {\n // START FORK\n // If there is an id, then filter out the existing route with the same id.\n // THIS ACTION IS DANGEROUS. This can cause React Native Screens to freeze\n if (id !== undefined) {\n routes = state.routes.filter((r) => r.key !== route.key);\n } else if (action.type === 'NAVIGATE' && state.routes.length > 0) {\n // The navigation action should only replace the last route if it has the same name and path params.\n const lastRoute = state.routes[state.routes.length - 1];\n if (\n getSingularId(lastRoute.name, { params: lastRoute.params }) ===\n getSingularId(route.name, { params })\n ) {\n routes = state.routes.slice(0, -1);\n } else {\n routes = [...state.routes];\n }\n } else {\n routes = [...state.routes];\n }\n\n // If the routes length is the same as the state routes length, then we are navigating to a new route.\n // Otherwise we are replacing an existing route.\n const key =\n routes.length === state.routes.length && !isPreviewAction(action)\n ? `${action.payload.name}-${nanoid()}`\n : route.key;\n\n routes.push({\n ...route,\n key,\n path:\n action.type === 'NAVIGATE' && action.payload.path !== undefined\n ? action.payload.path\n : route.path,\n params,\n });\n\n // routes = state.routes.filter((r) => r.key !== route.key);\n // routes.push({\n // ...route,\n // path:\n // action.type === 'NAVIGATE' && action.payload.path !== undefined\n // ? action.payload.path\n // : route.path,\n // params,\n // });\n // END FORK\n }\n } else {\n routes = [\n ...state.routes,\n {\n key: `${action.payload.name}-${nanoid()}`,\n name: action.payload.name,\n path: action.type === 'NAVIGATE' ? action.payload.path : undefined,\n params,\n },\n ];\n }\n\n // START FORK\n // return filterSingular(\n const result = {\n ...state,\n index: routes.length - 1,\n preloadedRoutes: state.preloadedRoutes.filter(\n (route) => routes[routes.length - 1].key !== route.key\n ),\n routes,\n };\n\n if (actionSingularOptions) {\n return filterSingular(result, getId);\n }\n\n return result;\n // return {\n // ...state,\n // index: routes.length - 1,\n // preloadedRoutes: state.preloadedRoutes.filter(\n // (route) => routes[routes.length - 1].key !== route.key\n // ),\n // routes,\n // };\n // END FORK\n }\n case 'PRELOAD': {\n // START FORK\n // This will be the case for example for protected route\n if (!state.routeNames.includes(action.payload.name)) {\n return null;\n }\n // END FORK\n const getId = options.routeGetIdList[action.payload.name];\n const id = getId?.({ params: action.payload.params });\n\n let route: Route<string> | undefined;\n\n if (id !== undefined) {\n route = state.routes.find(\n (route) =>\n route.name === action.payload.name && id === getId?.({ params: route.params })\n );\n }\n\n if (route) {\n return {\n ...state,\n routes: state.routes.map((r) => {\n if (r.key !== route?.key) {\n return r;\n }\n return {\n ...r,\n params:\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...action.payload.params,\n }\n : action.payload.params,\n };\n }),\n };\n } else {\n // START FORK\n const currentPreloadedRoute: (typeof state)['preloadedRoutes'][number] = {\n key: `${action.payload.name}-${nanoid()}`,\n name: action.payload.name,\n params:\n routeParamList[action.payload.name] !== undefined\n ? {\n ...routeParamList[action.payload.name],\n ...action.payload.params,\n }\n : action.payload.params,\n };\n // END FORK\n return {\n ...state,\n // START FORK\n // Adding the current preloaded route to the beginning of the preloadedRoutes array\n // This ensures that the preloaded route will be the next one after the visible route\n // and when navigation will happen, there will be no reshuffling\n // This is a workaround for the link preview navigation issue, when screen would freeze after navigation from native side\n // and reshuffling from react-navigation\n preloadedRoutes: [currentPreloadedRoute].concat(\n state.preloadedRoutes.filter(\n (r) => r.name !== action.payload.name || id !== getId?.({ params: r.params })\n )\n ),\n // preloadedRoutes: state.preloadedRoutes\n // .filter(\n // (r) =>\n // r.name !== action.payload.name ||\n // id !== getId?.({ params: r.params })\n // )\n // .concat({\n // key: `${action.payload.name}-${nanoid()}`,\n // name: action.payload.name,\n // params:\n // routeParamList[action.payload.name] !== undefined\n // ? {\n // ...routeParamList[action.payload.name],\n // ...action.payload.params,\n // }\n // : action.payload.params,\n // }),\n // END FORK\n };\n }\n }\n default: {\n return original.getStateForAction(state, action, options);\n }\n }\n },\n };\n};\n\nfunction getActionSingularIdFn(\n actionGetId: SingularOptions | undefined,\n name: string\n): GetId | undefined {\n if (typeof actionGetId === 'function') {\n return (options) => actionGetId(name, options.params ?? {});\n } else if (actionGetId === true) {\n return (options) => getSingularId(name, options);\n }\n\n return undefined;\n}\n\n/**\n * If there is a dynamic singular on an action, then we need to filter the state to only have singular screens.\n * As multiples may have been added before we did the singular navigation.\n */\nfunction filterSingular<\n T extends\n | StackNavigationState<ParamListBase>\n | PartialState<StackNavigationState<ParamListBase>>\n | null,\n>(state: T, getId?: GetId): T {\n if (!state) {\n return state;\n }\n\n if (!state.routes) {\n return state;\n }\n\n const currentIndex = state.index || state.routes.length - 1;\n const current = state.routes[currentIndex];\n const name = current.name;\n\n const id = getId?.({ params: current.params });\n\n if (!id) {\n return state;\n }\n\n // TypeScript needs a type assertion here for the filter to work.\n let routes = state.routes as PartialRoute<Route<string, object | undefined>>[];\n routes = routes.filter((route, index) => {\n // If the route is the current route, keep it.\n if (index === currentIndex) {\n return true;\n }\n\n // Remove all other routes with the same name and id.\n return name !== route.name || id !== getId?.({ params: route.params });\n });\n\n return {\n ...state,\n index: routes.length - 1,\n routes,\n };\n}\n\nconst Stack = Object.assign(\n (props: ComponentProps<typeof RNStack>) => {\n const { isStackAnimationDisabled } = useLinkPreviewContext();\n\n const screenOptions = useMemo(() => {\n const condition = isStackAnimationDisabled ? () => true : shouldDisableAnimationBasedOnParams;\n\n return disableAnimationInScreenOptions(props.screenOptions, condition);\n }, [props.screenOptions, isStackAnimationDisabled]);\n\n return (\n <RNStack {...props} screenOptions={screenOptions} UNSTABLE_router={stackRouterOverride} />\n );\n },\n {\n Screen: RNStack.Screen as (\n props: ComponentProps<typeof RNStack.Screen> & { singular?: boolean }\n ) => null,\n Protected,\n }\n);\n\ntype NativeStackScreenOptions = ComponentProps<typeof RNStack>['screenOptions'];\n\nfunction disableAnimationInScreenOptions(\n options: NativeStackScreenOptions | undefined,\n condition: (route: RouteProp<ParamListBase, string>) => boolean\n): NativeStackScreenOptions {\n if (options && typeof options === 'function') {\n return (props) => {\n const oldOptions = options(props);\n if (condition(props.route)) {\n return {\n ...oldOptions,\n animation: 'none',\n };\n }\n return oldOptions ?? {};\n };\n }\n return (props) => {\n if (condition(props.route)) {\n return {\n ...(options ?? {}),\n animation: 'none',\n };\n }\n return options ?? {};\n };\n}\n\nfunction shouldDisableAnimationBasedOnParams(route: RouteProp<ParamListBase, string>): boolean {\n const expoParams = getInternalExpoRouterParams(route.params);\n return !!expoParams.__internal_expo_router_no_animation;\n}\n\nexport default Stack;\n\nexport const StackRouter: typeof RNStackRouter = (options) => {\n const router = RNStackRouter(options);\n return {\n ...router,\n ...stackRouterOverride(router),\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoLink.d.ts","sourceRoot":"","sources":["../../src/link/ExpoLink.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAMxD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"ExpoLink.d.ts","sourceRoot":"","sources":["../../src/link/ExpoLink.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAmC,MAAM,OAAO,CAAC;AAMxD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAG3C,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,qBAmBxC"}
|
package/build/link/ExpoLink.js
CHANGED
|
@@ -44,6 +44,7 @@ const BaseExpoRouterLink_1 = require("./BaseExpoRouterLink");
|
|
|
44
44
|
const LinkWithPreview_1 = require("./LinkWithPreview");
|
|
45
45
|
const elements_1 = require("./elements");
|
|
46
46
|
const PreviewRouteContext_1 = require("./preview/PreviewRouteContext");
|
|
47
|
+
const url_1 = require("../utils/url");
|
|
47
48
|
function ExpoLink(props) {
|
|
48
49
|
const isPreview = (0, PreviewRouteContext_1.useIsPreview)();
|
|
49
50
|
if (process.env.EXPO_OS === 'ios' &&
|
|
@@ -60,6 +61,8 @@ function ExpoLink(props) {
|
|
|
60
61
|
return <BaseExpoRouterLink_1.BaseExpoRouterLink {...props} children={children}/>;
|
|
61
62
|
}
|
|
62
63
|
function isLinkWithPreview(props) {
|
|
63
|
-
|
|
64
|
+
const isExternal = (0, url_1.shouldLinkExternally)(String(props.href));
|
|
65
|
+
return react_1.Children.toArray(props.children).some((child) => (0, react_1.isValidElement)(child) &&
|
|
66
|
+
((!isExternal && child.type === elements_1.LinkPreview) || child.type === elements_1.LinkMenu));
|
|
64
67
|
}
|
|
65
68
|
//# sourceMappingURL=ExpoLink.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoLink.js","sourceRoot":"","sources":["../../src/link/ExpoLink.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"ExpoLink.js","sourceRoot":"","sources":["../../src/link/ExpoLink.tsx"],"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IACzC,MAAM,UAAU,GAAG,IAAA,0BAAoB,EAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5D,OAAO,gBAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC1C,CAAC,KAAK,EAAE,EAAE,CACR,IAAA,sBAAc,EAAC,KAAK,CAAC;QACrB,CAAC,CAAC,CAAC,UAAU,IAAI,KAAK,CAAC,IAAI,KAAK,sBAAW,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,mBAAQ,CAAC,CAC3E,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport Constants from 'expo-constants';\nimport React, { Children, isValidElement } from 'react';\n\nimport { BaseExpoRouterLink } from './BaseExpoRouterLink';\nimport { LinkWithPreview } from './LinkWithPreview';\nimport { LinkMenu, LinkPreview } from './elements';\nimport { useIsPreview } from './preview/PreviewRouteContext';\nimport { LinkProps } from './useLinkHooks';\nimport { shouldLinkExternally } from '../utils/url';\n\nexport function ExpoLink(props: LinkProps) {\n const isPreview = useIsPreview();\n if (\n process.env.EXPO_OS === 'ios' &&\n isLinkWithPreview(props) &&\n !isPreview &&\n Constants?.expoConfig?.newArchEnabled !== false\n ) {\n return <LinkWithPreview {...props} />;\n }\n let children = props.children;\n if (React.Children.count(props.children) > 1) {\n const arrayChildren = React.Children.toArray(props.children).filter(\n (child) => !isValidElement(child) || (child.type !== LinkPreview && child.type !== LinkMenu)\n );\n children = arrayChildren.length === 1 ? arrayChildren[0] : props.children;\n }\n\n return <BaseExpoRouterLink {...props} children={children} />;\n}\n\nfunction isLinkWithPreview(props: LinkProps): boolean {\n const isExternal = shouldLinkExternally(String(props.href));\n return Children.toArray(props.children).some(\n (child) =>\n isValidElement(child) &&\n ((!isExternal && child.type === LinkPreview) || child.type === LinkMenu)\n );\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkWithPreview.d.ts","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAON,MAAM,OAAO,CAAC;AAUf,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"LinkWithPreview.d.ts","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":"AAEA,OAAO,KAON,MAAM,OAAO,CAAC;AAUf,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK3C,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,EAAE,SAAS,qBAyH/D"}
|
|
@@ -64,14 +64,6 @@ function LinkWithPreview({ children, ...rest }) {
|
|
|
64
64
|
}, [hrefWithoutQuery]);
|
|
65
65
|
const [{ nextScreenId, tabPath }, prefetch] = (0, useNextScreenId_1.useNextScreenId)();
|
|
66
66
|
(0, react_1.useEffect)(() => {
|
|
67
|
-
if ((0, url_1.shouldLinkExternally)(String(rest.href))) {
|
|
68
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
69
|
-
throw new Error('External links previews are not supported');
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
console.warn('External links previews are not supported');
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
67
|
if (rest.replace) {
|
|
76
68
|
if (process.env.NODE_ENV !== 'production') {
|
|
77
69
|
throw new Error('Using replace links with preview is not supported');
|
|
@@ -94,27 +86,32 @@ function LinkWithPreview({ children, ...rest }) {
|
|
|
94
86
|
}
|
|
95
87
|
const trigger = react_1.default.useMemo(() => triggerElement ?? <elements_1.LinkTrigger>{children}</elements_1.LinkTrigger>, [triggerElement, children]);
|
|
96
88
|
const highlightBorderRadius = rest.style && 'borderRadius' in rest.style ? rest.style.borderRadius : undefined;
|
|
97
|
-
const preview = react_1.default.useMemo(() => previewElement
|
|
89
|
+
const preview = react_1.default.useMemo(() => ((0, url_1.shouldLinkExternally)(String(rest.href)) || !previewElement ? null : previewElement), [previewElement, rest.href]);
|
|
98
90
|
const isPreviewTapped = (0, react_1.useRef)(false);
|
|
99
91
|
const tabPathValue = (0, react_1.useMemo)(() => ({
|
|
100
92
|
path: tabPath,
|
|
101
93
|
}), [tabPath]);
|
|
102
|
-
|
|
94
|
+
const hasPreview = !!previewElement;
|
|
95
|
+
if (rest.replace) {
|
|
103
96
|
return <BaseExpoRouterLink_1.BaseExpoRouterLink children={children} {...rest}/>;
|
|
104
97
|
}
|
|
105
98
|
return (<native_1.NativeLinkPreview nextScreenId={isPad ? undefined : nextScreenId} tabPath={isPad ? undefined : tabPathValue} onWillPreviewOpen={() => {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
if (hasPreview) {
|
|
100
|
+
isPreviewTapped.current = false;
|
|
101
|
+
prefetch(rest.href);
|
|
102
|
+
setIsCurrenPreviewOpen(true);
|
|
103
|
+
}
|
|
109
104
|
}} onPreviewWillClose={() => {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
105
|
+
if (hasPreview) {
|
|
106
|
+
setIsCurrenPreviewOpen(false);
|
|
107
|
+
// When preview was not tapped, then we need to enable the screen stack animation
|
|
108
|
+
// Otherwise this will happen in StackNavigator, when new screen is opened
|
|
109
|
+
if (!isPreviewTapped.current || isPad) {
|
|
110
|
+
setOpenPreviewKey(undefined);
|
|
111
|
+
}
|
|
115
112
|
}
|
|
116
113
|
}} onPreviewDidClose={() => {
|
|
117
|
-
if (isPreviewTapped.current && isPad) {
|
|
114
|
+
if (hasPreview && isPreviewTapped.current && isPad) {
|
|
118
115
|
router.navigate(rest.href, { __internal__PreviewKey: nextScreenId });
|
|
119
116
|
}
|
|
120
117
|
}} onPreviewTapped={() => {
|
|
@@ -122,11 +119,9 @@ function LinkWithPreview({ children, ...rest }) {
|
|
|
122
119
|
if (!isPad) {
|
|
123
120
|
router.navigate(rest.href, { __internal__PreviewKey: nextScreenId });
|
|
124
121
|
}
|
|
125
|
-
}}>
|
|
122
|
+
}} style={{ borderRadius: highlightBorderRadius }}>
|
|
126
123
|
<InternalLinkPreviewContext_1.InternalLinkPreviewContext value={{ isVisible: isCurrentPreviewOpen, href: rest.href }}>
|
|
127
|
-
<
|
|
128
|
-
<BaseExpoRouterLink_1.BaseExpoRouterLink {...rest} children={trigger} ref={rest.ref}/>
|
|
129
|
-
</native_1.NativeLinkPreviewTrigger>
|
|
124
|
+
<BaseExpoRouterLink_1.BaseExpoRouterLink {...rest} children={trigger} ref={rest.ref}/>
|
|
130
125
|
{preview}
|
|
131
126
|
{menuElement}
|
|
132
127
|
</InternalLinkPreviewContext_1.InternalLinkPreviewContext>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LinkWithPreview.js","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBb,0CAwHC;AA9ID,+CAOe;AACf,+CAAwC;AAExC,oCAAqC;AACrC,6DAA0D;AAC1D,6EAA0E;AAC1E,yCAAgE;AAChE,qEAAqE;AACrE,6CAA+E;AAC/E,+DAA4D;AAE5D,sCAAoD;AAEpD,MAAM,KAAK,GAAG,uBAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,uBAAQ,CAAC,KAAK,CAAC;AAEtD,SAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAa;IAC9D,MAAM,MAAM,GAAG,IAAA,iBAAS,GAAE,CAAC;IAC3B,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAA,0CAAqB,GAAE,CAAC;IACtD,MAAM,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEvE,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,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E,CAAC;QACH,CAAC,CAAC,CACF,eAAe,CAAC,CAAC,GAAG,EAAE;YACpB,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;YAC/B,IAAI,CAAC,KAAK,EAAE,CAAC;gBACX,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,sBAAsB,EAAE,YAAY,EAAE,CAAC,CAAC;YACvE,CAAC;QACH,CAAC,CAAC,CACF;MAAA,CAAC,uDAA0B,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CACtF;QAAA,CAAC,iCAAwB,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,EAAE,qBAAqB,EAAE,CAAC,CACvE;UAAA,CAAC,uCAAkB,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EACjE;QAAA,EAAE,iCAAwB,CAC1B;QAAA,CAAC,OAAO,CACR;QAAA,CAAC,WAAW,CACd;MAAA,EAAE,uDAA0B,CAC9B;IAAA,EAAE,0BAAiB,CAAC,CACrB,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAC1B,QAA6C,EAC7C,IAAgC;IAEhC,OAAO,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC1C,CAAC,KAAK,EAAiC,EAAE,CAAC,IAAA,sBAAc,EAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CACvF,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport React, {\n isValidElement,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactElement,\n} from 'react';\nimport { Platform } from 'react-native';\n\nimport { useRouter } from '../hooks';\nimport { BaseExpoRouterLink } from './BaseExpoRouterLink';\nimport { InternalLinkPreviewContext } from './InternalLinkPreviewContext';\nimport { LinkMenu, LinkPreview, LinkTrigger } from './elements';\nimport { useLinkPreviewContext } from './preview/LinkPreviewContext';\nimport { NativeLinkPreview, NativeLinkPreviewTrigger } from './preview/native';\nimport { useNextScreenId } from './preview/useNextScreenId';\nimport { LinkProps } from './useLinkHooks';\nimport { shouldLinkExternally } from '../utils/url';\n\nconst isPad = Platform.OS === 'ios' && Platform.isPad;\n\nexport function LinkWithPreview({ children, ...rest }: LinkProps) {\n const router = useRouter();\n const { setOpenPreviewKey } = useLinkPreviewContext();\n const [isCurrentPreviewOpen, setIsCurrenPreviewOpen] = useState(false);\n\n const hrefWithoutQuery = String(rest.href).split('?')[0];\n const prevHrefWithoutQuery = useRef(hrefWithoutQuery);\n\n useEffect(() => {\n if (isCurrentPreviewOpen) {\n if (prevHrefWithoutQuery.current !== hrefWithoutQuery) {\n throw new Error(\n 'Link does not support changing the href prop after the preview has been opened. Please ensure that the href prop is stable and does not change between renders.'\n );\n }\n } else {\n prevHrefWithoutQuery.current = hrefWithoutQuery;\n }\n }, [hrefWithoutQuery]);\n\n const [{ nextScreenId, tabPath }, prefetch] = useNextScreenId();\n\n useEffect(() => {\n if (shouldLinkExternally(String(rest.href))) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('External links previews are not supported');\n } else {\n console.warn('External links previews are not supported');\n }\n }\n if (rest.replace) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Using replace links with preview is not supported');\n } else {\n console.warn('Using replace links with preview is not supported');\n }\n }\n }, [rest.href, rest.replace]);\n\n const triggerElement = React.useMemo(\n () => getFirstChildOfType(children, LinkTrigger),\n [children]\n );\n const menuElement = React.useMemo(() => getFirstChildOfType(children, LinkMenu), [children]);\n const previewElement = React.useMemo(\n () => getFirstChildOfType(children, LinkPreview),\n [children]\n );\n\n if ((previewElement || menuElement) && !triggerElement) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'When you use Link.Preview, you must use Link.Trigger to specify the trigger element.'\n );\n } else {\n console.warn(\n 'When you use Link.Preview, you must use Link.Trigger to specify the trigger element.'\n );\n }\n }\n\n const trigger = React.useMemo(\n () => triggerElement ?? <LinkTrigger>{children}</LinkTrigger>,\n [triggerElement, children]\n );\n const highlightBorderRadius =\n rest.style && 'borderRadius' in rest.style ? rest.style.borderRadius : undefined;\n\n const preview = React.useMemo(() => previewElement ?? null, [previewElement, rest.href]);\n\n const isPreviewTapped = useRef(false);\n\n const tabPathValue = useMemo(\n () => ({\n path: tabPath,\n }),\n [tabPath]\n );\n\n if (shouldLinkExternally(String(rest.href)) || rest.replace) {\n return <BaseExpoRouterLink children={children} {...rest} />;\n }\n\n return (\n <NativeLinkPreview\n nextScreenId={isPad ? undefined : nextScreenId}\n tabPath={isPad ? undefined : tabPathValue}\n onWillPreviewOpen={() => {\n isPreviewTapped.current = false;\n prefetch(rest.href);\n setIsCurrenPreviewOpen(true);\n }}\n onPreviewWillClose={() => {\n setIsCurrenPreviewOpen(false);\n // When preview was not tapped, then we need to enable the screen stack animation\n // Otherwise this will happen in StackNavigator, when new screen is opened\n if (!isPreviewTapped.current || isPad) {\n setOpenPreviewKey(undefined);\n }\n }}\n onPreviewDidClose={() => {\n if (isPreviewTapped.current && isPad) {\n router.navigate(rest.href, { __internal__PreviewKey: nextScreenId });\n }\n }}\n onPreviewTapped={() => {\n isPreviewTapped.current = true;\n if (!isPad) {\n router.navigate(rest.href, { __internal__PreviewKey: nextScreenId });\n }\n }}>\n <InternalLinkPreviewContext value={{ isVisible: isCurrentPreviewOpen, href: rest.href }}>\n <NativeLinkPreviewTrigger style={{ borderRadius: highlightBorderRadius }}>\n <BaseExpoRouterLink {...rest} children={trigger} ref={rest.ref} />\n </NativeLinkPreviewTrigger>\n {preview}\n {menuElement}\n </InternalLinkPreviewContext>\n </NativeLinkPreview>\n );\n}\n\nfunction getFirstChildOfType<PropsT>(\n children: React.ReactNode | React.ReactNode[],\n type: (props: PropsT) => unknown\n) {\n return React.Children.toArray(children).find(\n (child): child is ReactElement<PropsT> => isValidElement(child) && child.type === type\n );\n}\n"]}
|
|
1
|
+
{"version":3,"file":"LinkWithPreview.js","sourceRoot":"","sources":["../../src/link/LinkWithPreview.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBb,0CAyHC;AA/ID,+CAOe;AACf,+CAAwC;AAExC,oCAAqC;AACrC,6DAA0D;AAC1D,6EAA0E;AAC1E,yCAAgE;AAChE,qEAAqE;AACrE,6CAAqD;AACrD,+DAA4D;AAE5D,sCAAoD;AAEpD,MAAM,KAAK,GAAG,uBAAQ,CAAC,EAAE,KAAK,KAAK,IAAI,uBAAQ,CAAC,KAAK,CAAC;AAEtD,SAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAa;IAC9D,MAAM,MAAM,GAAG,IAAA,iBAAS,GAAE,CAAC;IAC3B,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAA,0CAAqB,GAAE,CAAC;IACtD,MAAM,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,GAAG,IAAA,gBAAQ,EAAC,KAAK,CAAC,CAAC;IAEvE,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,MAAM,oBAAoB,GAAG,IAAA,cAAM,EAAC,gBAAgB,CAAC,CAAC;IAEtD,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,IAAI,oBAAoB,EAAE,CAAC;YACzB,IAAI,oBAAoB,CAAC,OAAO,KAAK,gBAAgB,EAAE,CAAC;gBACtD,MAAM,IAAI,KAAK,CACb,iKAAiK,CAClK,CAAC;YACJ,CAAC;QACH,CAAC;aAAM,CAAC;YACN,oBAAoB,CAAC,OAAO,GAAG,gBAAgB,CAAC;QAClD,CAAC;IACH,CAAC,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAEvB,MAAM,CAAC,EA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AC,GAAG,CAAC,EAC/D;QAAA,CAAC,OAAO,CACR;QAAA,CAAC,WAAW,CACd;MAAA,EAAE,uDAA0B,CAC9B;IAAA,EAAE,0BAAiB,CAAC,CACrB,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB,CAC1B,QAA6C,EAC7C,IAAgC;IAEhC,OAAO,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC1C,CAAC,KAAK,EAAiC,EAAE,CAAC,IAAA,sBAAc,EAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CACvF,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport React, {\n isValidElement,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactElement,\n} from 'react';\nimport { Platform } from 'react-native';\n\nimport { useRouter } from '../hooks';\nimport { BaseExpoRouterLink } from './BaseExpoRouterLink';\nimport { InternalLinkPreviewContext } from './InternalLinkPreviewContext';\nimport { LinkMenu, LinkPreview, LinkTrigger } from './elements';\nimport { useLinkPreviewContext } from './preview/LinkPreviewContext';\nimport { NativeLinkPreview } from './preview/native';\nimport { useNextScreenId } from './preview/useNextScreenId';\nimport { LinkProps } from './useLinkHooks';\nimport { shouldLinkExternally } from '../utils/url';\n\nconst isPad = Platform.OS === 'ios' && Platform.isPad;\n\nexport function LinkWithPreview({ children, ...rest }: LinkProps) {\n const router = useRouter();\n const { setOpenPreviewKey } = useLinkPreviewContext();\n const [isCurrentPreviewOpen, setIsCurrenPreviewOpen] = useState(false);\n\n const hrefWithoutQuery = String(rest.href).split('?')[0];\n const prevHrefWithoutQuery = useRef(hrefWithoutQuery);\n\n useEffect(() => {\n if (isCurrentPreviewOpen) {\n if (prevHrefWithoutQuery.current !== hrefWithoutQuery) {\n throw new Error(\n 'Link does not support changing the href prop after the preview has been opened. Please ensure that the href prop is stable and does not change between renders.'\n );\n }\n } else {\n prevHrefWithoutQuery.current = hrefWithoutQuery;\n }\n }, [hrefWithoutQuery]);\n\n const [{ nextScreenId, tabPath }, prefetch] = useNextScreenId();\n\n useEffect(() => {\n if (rest.replace) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error('Using replace links with preview is not supported');\n } else {\n console.warn('Using replace links with preview is not supported');\n }\n }\n }, [rest.href, rest.replace]);\n\n const triggerElement = React.useMemo(\n () => getFirstChildOfType(children, LinkTrigger),\n [children]\n );\n const menuElement = React.useMemo(() => getFirstChildOfType(children, LinkMenu), [children]);\n const previewElement = React.useMemo(\n () => getFirstChildOfType(children, LinkPreview),\n [children]\n );\n\n if ((previewElement || menuElement) && !triggerElement) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n 'When you use Link.Preview, you must use Link.Trigger to specify the trigger element.'\n );\n } else {\n console.warn(\n 'When you use Link.Preview, you must use Link.Trigger to specify the trigger element.'\n );\n }\n }\n\n const trigger = React.useMemo(\n () => triggerElement ?? <LinkTrigger>{children}</LinkTrigger>,\n [triggerElement, children]\n );\n const highlightBorderRadius =\n rest.style && 'borderRadius' in rest.style ? rest.style.borderRadius : undefined;\n\n const preview = React.useMemo(\n () => (shouldLinkExternally(String(rest.href)) || !previewElement ? null : previewElement),\n [previewElement, rest.href]\n );\n\n const isPreviewTapped = useRef(false);\n\n const tabPathValue = useMemo(\n () => ({\n path: tabPath,\n }),\n [tabPath]\n );\n\n const hasPreview = !!previewElement;\n\n if (rest.replace) {\n return <BaseExpoRouterLink children={children} {...rest} />;\n }\n\n return (\n <NativeLinkPreview\n nextScreenId={isPad ? undefined : nextScreenId}\n tabPath={isPad ? undefined : tabPathValue}\n onWillPreviewOpen={() => {\n if (hasPreview) {\n isPreviewTapped.current = false;\n prefetch(rest.href);\n setIsCurrenPreviewOpen(true);\n }\n }}\n onPreviewWillClose={() => {\n if (hasPreview) {\n setIsCurrenPreviewOpen(false);\n // When preview was not tapped, then we need to enable the screen stack animation\n // Otherwise this will happen in StackNavigator, when new screen is opened\n if (!isPreviewTapped.current || isPad) {\n setOpenPreviewKey(undefined);\n }\n }\n }}\n onPreviewDidClose={() => {\n if (hasPreview && isPreviewTapped.current && isPad) {\n router.navigate(rest.href, { __internal__PreviewKey: nextScreenId });\n }\n }}\n onPreviewTapped={() => {\n isPreviewTapped.current = true;\n if (!isPad) {\n router.navigate(rest.href, { __internal__PreviewKey: nextScreenId });\n }\n }}\n style={{ borderRadius: highlightBorderRadius }}>\n <InternalLinkPreviewContext value={{ isVisible: isCurrentPreviewOpen, href: rest.href }}>\n <BaseExpoRouterLink {...rest} children={trigger} ref={rest.ref} />\n {preview}\n {menuElement}\n </InternalLinkPreviewContext>\n </NativeLinkPreview>\n );\n}\n\nfunction getFirstChildOfType<PropsT>(\n children: React.ReactNode | React.ReactNode[],\n type: (props: PropsT) => unknown\n) {\n return React.Children.toArray(children).find(\n (child): child is ReactElement<PropsT> => isValidElement(child) && child.type === type\n );\n}\n"]}
|
package/build/link/elements.d.ts
CHANGED
package/build/link/elements.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/link/elements.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDb,wCAYC;AAqHD,kCA4BC;AAuBD,kCAYC;AAtPD,+CAA8F;AAG9F,6EAA0E;AAC1E,uDAAoD;AACpD,uEAA6D;AAC7D,6CAAqF;AACrF,qCAAkC;AAuClC;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,KAA0B;IACvD,IAAI,IAAA,kCAAY,GAAE,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,IAAI,CAAC,IAAA,WAAG,EAAC,uDAA0B,CAAC,EAAE,CAAC;QACxF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC3D,OAAO,CACL,CAAC,gCAAuB,CACtB,IAAI,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AC7B,CAAC","sourcesContent":["'use client';\n\nimport React, { isValidElement, use, type PropsWithChildren, type ReactElement } from 'react';\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';\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 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 />\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 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 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: ReactElement<LinkMenuActionProps> | ReactElement<LinkMenuActionProps>[];\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 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 return (\n <NativeLinkPreviewAction\n {...props}\n title={props.title ?? ''}\n onSelected={() => {}}\n children={children}\n />\n );\n};\n\nexport interface LinkPreviewProps {\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 children?: React.ReactNode;\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.Trigger>\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 { width, height, children } = 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 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\n style={{\n /* Setting default background here, so that the preview is not transparent */\n backgroundColor: '#fff',\n }}\n preferredContentSize={contentSize}>\n {content}\n </NativeLinkPreviewContent>\n );\n}\n\nexport type LinkTriggerProps = PropsWithChildren;\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(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 return <Slot {...props} />;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"elements.js","sourceRoot":"","sources":["../../src/link/elements.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDb,wCAYC;AAqHD,kCA4BC;AAuBD,kCAYC;AAtPD,+CAA8F;AAG9F,6EAA0E;AAC1E,uDAAoD;AACpD,uEAA6D;AAC7D,6CAAqF;AACrF,qCAAkC;AAuClC;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,KAA0B;IACvD,IAAI,IAAA,kCAAY,GAAE,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,IAAI,CAAC,IAAA,WAAG,EAAC,uDAA0B,CAAC,EAAE,CAAC;QACxF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,EAAE,sBAAsB,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,KAAK,CAAC;IAC3D,OAAO,CACL,CAAC,gCAAuB,CACtB,IAAI,IAAI,CAAC,CACT,UAAU,CAAC,CAAC,OAAO,CAAC,CACpB,aAAa,CAAC,CAAC,sBAAsB,CAAC,EACtC,CACH,CAAC;AACJ,CAAC;AAkCD;;;;;;;;;;;;;;;;;GAiBG;AACI,MAAM,QAAQ,GAA4B,CAAC,KAAK,EAAE,EAAE;IACzD,IAAI,IAAA,kCAAY,GAAE,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,IAAI,CAAC,IAAA,WAAG,EAAC,uDAA0B,CAAC,EAAE,CAAC;QACxF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,QAAQ,GAAG,eAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,MAAM,CAC5D,CAAC,KAAK,EAAE,EA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3D,CAAC;IAED,OAAO,CACL,CAAC,iCAAwB,CACvB,KAAK,CAAC,CAAC;YACL,6EAA6E;YAC7E,eAAe,EAAE,MAAM;SACxB,CAAC,CACF,oBAAoB,CAAC,CAAC,WAAW,CAAC,CAClC;MAAA,CAAC,OAAO,CACV;IAAA,EAAE,iCAAwB,CAAC,CAC5B,CAAC;AACJ,CAAC;AAID;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,WAAW,CAAC,KAAuB;IACjD,IAAI,eAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,IAAA,sBAAc,EAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,CAAC;QAChF,6EAA6E;QAC7E,qGAAqG;QACrG,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,SAAS,IAAI,KAAK,EAAE,CAAC;YAC7D,MAAM,IAAI,KAAK,CACb,gHAAgH,CACjH,CAAC;QACJ,CAAC;QACD,OAAO,KAAK,CAAC,QAAQ,CAAC;IACxB,CAAC;IACD,OAAO,CAAC,WAAI,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC7B,CAAC","sourcesContent":["'use client';\n\nimport React, { isValidElement, use, type PropsWithChildren, type ReactElement } from 'react';\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';\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 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 />\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 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 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: ReactElement<LinkMenuActionProps> | ReactElement<LinkMenuActionProps>[];\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 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 return (\n <NativeLinkPreviewAction\n {...props}\n title={props.title ?? ''}\n onSelected={() => {}}\n children={children}\n />\n );\n};\n\nexport interface LinkPreviewProps {\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 children?: React.ReactNode;\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 { width, height, children } = 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 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\n style={{\n /* Setting default background here, so that the preview is not transparent */\n backgroundColor: '#fff',\n }}\n preferredContentSize={contentSize}>\n {content}\n </NativeLinkPreviewContent>\n );\n}\n\nexport type LinkTriggerProps = PropsWithChildren;\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(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 return <Slot {...props} />;\n}\n"]}
|
|
@@ -12,8 +12,6 @@ export interface NativeLinkPreviewActionProps {
|
|
|
12
12
|
onSelected: () => void;
|
|
13
13
|
}
|
|
14
14
|
export declare function NativeLinkPreviewAction(props: NativeLinkPreviewActionProps): import("react").JSX.Element | null;
|
|
15
|
-
export type NativeLinkPreviewTriggerProps = ViewProps;
|
|
16
|
-
export declare function NativeLinkPreviewTrigger(props: NativeLinkPreviewTriggerProps): import("react").JSX.Element | null;
|
|
17
15
|
export interface TabPath {
|
|
18
16
|
oldTabKey: string;
|
|
19
17
|
newTabKey: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/link/preview/native.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpE,MAAM,WAAW,4BAA4B;IAC3C,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;IAItB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;IAKf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAKD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,sCAK1E;AAID,MAAM,
|
|
1
|
+
{"version":3,"file":"native.d.ts","sourceRoot":"","sources":["../../../src/link/preview/native.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAwB,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAMpE,MAAM,WAAW,4BAA4B;IAC3C,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;IAItB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;IAKf,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAKD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,4BAA4B,sCAK1E;AAID,MAAM,WAAW,OAAO;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACvD,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,OAAO,EACH;QACE,IAAI,EAAE,OAAO,EAAE,CAAC;KACjB,GACD,SAAS,CAAC;IACd,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC9B,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,iBAAiB,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,eAAe,CAAC,EAAE,MAAM,IAAI,CAAC;IAC7B,iCAAiC,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAKD,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,sCAK9D;AAID,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,sCAW5E"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
'use client';
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.NativeLinkPreviewAction = NativeLinkPreviewAction;
|
|
5
|
-
exports.NativeLinkPreviewTrigger = NativeLinkPreviewTrigger;
|
|
6
5
|
exports.NativeLinkPreview = NativeLinkPreview;
|
|
7
6
|
exports.NativeLinkPreviewContent = NativeLinkPreviewContent;
|
|
8
7
|
const expo_1 = require("expo");
|
|
@@ -17,15 +16,6 @@ function NativeLinkPreviewAction(props) {
|
|
|
17
16
|
}
|
|
18
17
|
return <LinkPreviewNativeActionView {...props}/>;
|
|
19
18
|
}
|
|
20
|
-
const NativeLinkPreviewTriggerView = areNativeViewsAvailable
|
|
21
|
-
? (0, expo_1.requireNativeView)('ExpoRouterNativeLinkPreview', 'NativeLinkPreviewTrigger')
|
|
22
|
-
: null;
|
|
23
|
-
function NativeLinkPreviewTrigger(props) {
|
|
24
|
-
if (!NativeLinkPreviewTriggerView) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
return <NativeLinkPreviewTriggerView {...props}/>;
|
|
28
|
-
}
|
|
29
19
|
const NativeLinkPreviewView = areNativeViewsAvailable
|
|
30
20
|
? (0, expo_1.requireNativeView)('ExpoRouterNativeLinkPreview', 'NativeLinkPreviewView')
|
|
31
21
|
: null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../src/link/preview/native.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAgCb,0DAKC;
|
|
1
|
+
{"version":3,"file":"native.js","sourceRoot":"","sources":["../../../src/link/preview/native.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;AAgCb,0DAKC;AA2BD,8CAKC;AAYD,4DAWC;AA1FD,+BAAyC;AACzC,+CAAoE;AAEpE,MAAM,uBAAuB,GAC3B,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,IAAI,CAAC,uBAAQ,CAAC,IAAI,IAAI,MAAM,CAAC,aAAa,KAAK,IAAI,CAAC;AAsBnF,MAAM,2BAA2B,GAC/B,uBAAuB;IACrB,CAAC,CAAC,IAAA,wBAAiB,EAAC,6BAA6B,EAAE,6BAA6B,CAAC;IACjF,CAAC,CAAC,IAAI,CAAC;AACX,SAAgB,uBAAuB,CAAC,KAAmC;IACzE,IAAI,CAAC,2BAA2B,EAAE,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,2BAA2B,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AACpD,CAAC;AAuBD,MAAM,qBAAqB,GACzB,uBAAuB;IACrB,CAAC,CAAC,IAAA,wBAAiB,EAAC,6BAA6B,EAAE,uBAAuB,CAAC;IAC3E,CAAC,CAAC,IAAI,CAAC;AACX,SAAgB,iBAAiB,CAAC,KAA6B;IAC7D,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,qBAAqB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC9C,CAAC;AAOD,MAAM,4BAA4B,GAChC,uBAAuB;IACrB,CAAC,CAAC,IAAA,wBAAiB,EAAC,6BAA6B,EAAE,8BAA8B,CAAC;IAClF,CAAC,CAAC,IAAI,CAAC;AAEX,SAAgB,wBAAwB,CAAC,KAAoC;IAC3E,IAAI,CAAC,4BAA4B,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,KAAK,GAAG,yBAAU,CAAC,OAAO,CAAC;QAC/B,KAAK,CAAC,KAAK;QACX;YACE,QAAQ,EAAE,UAAU;SACZ;KACX,CAAC,CAAC;IACH,OAAO,CAAC,4BAA4B,CAAC,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,EAAG,CAAC;AACnE,CAAC;AACD,aAAa","sourcesContent":["'use client';\n\nimport { requireNativeView } from 'expo';\nimport { Platform, StyleSheet, type ViewProps } from 'react-native';\n\nconst areNativeViewsAvailable =\n process.env.EXPO_OS === 'ios' && !Platform.isTV && global.RN$Bridgeless === true;\n\n// #region Action View\nexport interface NativeLinkPreviewActionProps {\n title: string;\n icon?: string;\n children?: React.ReactNode;\n disabled?: boolean;\n destructive?: boolean;\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 onSelected: () => void;\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 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 } as const,\n ]);\n return <NativeLinkPreviewContentView {...props} style={style} />;\n}\n// #endregion\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/link/preview/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,KAAK,eAAe,EAGrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAS,KAAK,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEnF,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/link/preview/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAEb,KAAK,eAAe,EAGrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAS,KAAK,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEnF,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnC,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,oBAAoB,GAC9B,OAAO,EAAE,CA6BX;AAED,wBAAgB,oCAAoC,CAClD,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,oBAAoB,GAC9B,eAAe,CAAC,aAAa,EAAE,MAAM,CAAC,GAAG,SAAS,CAiCpD;AAED,wBAAgB,SAAS,CACvB,CAAC,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,SAAS,EACrC,CAAC,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,GAAG,SAAS,GACpC,OAAO,CAYT"}
|
|
@@ -6,6 +6,7 @@ exports.deepEqual = deepEqual;
|
|
|
6
6
|
const router_store_1 = require("../../global-state/router-store");
|
|
7
7
|
const routing_1 = require("../../global-state/routing");
|
|
8
8
|
const href_1 = require("../href");
|
|
9
|
+
const navigationParams_1 = require("../../navigationParams");
|
|
9
10
|
function getTabPathFromRootStateByHref(href, rootState) {
|
|
10
11
|
const hrefState = router_store_1.store.getStateForHref((0, href_1.resolveHref)(href));
|
|
11
12
|
const state = rootState;
|
|
@@ -22,6 +23,7 @@ function getTabPathFromRootStateByHref(href, rootState) {
|
|
|
22
23
|
if (route.state?.type === 'tab') {
|
|
23
24
|
const tabState = route.state;
|
|
24
25
|
const oldTabKey = tabState.routes[tabState.index].key;
|
|
26
|
+
// The next route will be either stack inside a tab or a new tab key
|
|
25
27
|
if (!arr[i + 1]) {
|
|
26
28
|
throw new Error(`New tab route is missing for ${route.key}. This is likely an internal Expo Router bug.`);
|
|
27
29
|
}
|
|
@@ -45,7 +47,8 @@ function getPreloadedRouteFromRootStateByHref(href, rootState) {
|
|
|
45
47
|
if (navigationState.type === 'stack') {
|
|
46
48
|
const stackState = navigationState;
|
|
47
49
|
const payload = (0, routing_1.getPayloadFromStateRoute)(actionStateRoute);
|
|
48
|
-
const preloadedRoute = stackState.preloadedRoutes.find((route) => route.name === actionStateRoute.name &&
|
|
50
|
+
const preloadedRoute = stackState.preloadedRoutes.find((route) => route.name === actionStateRoute.name &&
|
|
51
|
+
deepEqual((0, navigationParams_1.removeInternalExpoRouterParams)(route.params), (0, navigationParams_1.removeInternalExpoRouterParams)(payload.params)));
|
|
49
52
|
return preloadedRoute;
|
|
50
53
|
}
|
|
51
54
|
return undefined;
|
|
@@ -60,7 +63,7 @@ function deepEqual(a, b) {
|
|
|
60
63
|
if (typeof a !== 'object' || typeof b !== 'object') {
|
|
61
64
|
return false;
|
|
62
65
|
}
|
|
63
|
-
const keys = Object.keys(a)
|
|
66
|
+
const keys = Object.keys(a);
|
|
64
67
|
return keys.length === Object.keys(b).length && keys.every((key) => deepEqual(a[key], b[key]));
|
|
65
68
|
}
|
|
66
69
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/link/preview/utils.ts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OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QACnD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC5B,OAAO,IAAI,CAAC,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AACjG,CAAC","sourcesContent":["import {\n ParamListBase,\n StackNavigationState,\n type NavigationRoute,\n type NavigationState,\n type TabNavigationState,\n} from '@react-navigation/native';\n\nimport { store, type ReactNavigationState } from '../../global-state/router-store';\nimport { findDivergentState, getPayloadFromStateRoute } from '../../global-state/routing';\nimport { Href } from '../../types';\nimport { resolveHref } from '../href';\nimport { TabPath } from './native';\nimport { removeInternalExpoRouterParams } from '../../navigationParams';\n\nexport function getTabPathFromRootStateByHref(\n href: Href,\n rootState: ReactNavigationState\n): TabPath[] {\n const hrefState = store.getStateForHref(resolveHref(href));\n const state: ReactNavigationState | undefined = rootState;\n if (!hrefState || !state) {\n return [];\n }\n // Replicating the logic from `linkTo`\n const { navigationRoutes } = findDivergentState(hrefState, state as NavigationState, true);\n\n if (!navigationRoutes.length) {\n return [];\n }\n\n const tabPath: TabPath[] = [];\n navigationRoutes.forEach((route, i, arr) => {\n if (route.state?.type === 'tab') {\n const tabState = route.state as TabNavigationState<ParamListBase>;\n const oldTabKey = tabState.routes[tabState.index].key;\n // The next route will be either stack inside a tab or a new tab key\n if (!arr[i + 1]) {\n throw new Error(\n `New tab route is missing for ${route.key}. This is likely an internal Expo Router bug.`\n );\n }\n const newTabKey = arr[i + 1].key;\n tabPath.push({ oldTabKey, newTabKey });\n }\n });\n return tabPath;\n}\n\nexport function getPreloadedRouteFromRootStateByHref(\n href: Href,\n rootState: ReactNavigationState\n): NavigationRoute<ParamListBase, string> | undefined {\n const hrefState = store.getStateForHref(resolveHref(href));\n const state: ReactNavigationState | undefined = rootState;\n if (!hrefState || !state) {\n return undefined;\n }\n // Replicating the logic from `linkTo`\n const { navigationState, actionStateRoute } = findDivergentState(\n hrefState,\n state as NavigationState,\n true\n );\n\n if (!navigationState || !actionStateRoute) {\n return undefined;\n }\n\n if (navigationState.type === 'stack') {\n const stackState = navigationState as StackNavigationState<ParamListBase>;\n const payload = getPayloadFromStateRoute(actionStateRoute);\n\n const preloadedRoute = stackState.preloadedRoutes.find(\n (route) =>\n route.name === actionStateRoute.name &&\n deepEqual(\n removeInternalExpoRouterParams(route.params),\n removeInternalExpoRouterParams(payload.params)\n )\n );\n return preloadedRoute;\n }\n\n return undefined;\n}\n\nexport function deepEqual(\n a: { [key: string]: any } | undefined,\n b: { [key: string]: any } | undefined\n): boolean {\n if (a === b) {\n return true;\n }\n if (a == null || b == null) {\n return false;\n }\n if (typeof a !== 'object' || typeof b !== 'object') {\n return false;\n }\n const keys = Object.keys(a);\n return keys.length === Object.keys(b).length && keys.every((key) => deepEqual(a[key], b[key]));\n}\n"]}
|
|
@@ -102,26 +102,25 @@ function ModalStackRouteDrawer({ routeKey, options, renderScreen, onDismiss, the
|
|
|
102
102
|
// dvh is important, otherwise it will scale over the visible viewport height
|
|
103
103
|
modalStyleVars.maxHeight = '100dvh';
|
|
104
104
|
}
|
|
105
|
-
// Apply corner radius (default
|
|
106
|
-
const radiusValue = options.sheetCornerRadius ??
|
|
105
|
+
// Apply corner radius (default 24px for iOS 26)
|
|
106
|
+
const radiusValue = options.sheetCornerRadius ?? 24;
|
|
107
107
|
const radiusCss = typeof radiusValue === 'number' ? `${radiusValue}px` : radiusValue;
|
|
108
108
|
if (options.webModalStyle?.border) {
|
|
109
109
|
modalStyleVars['--expo-router-modal-border'] = options.webModalStyle.border;
|
|
110
110
|
}
|
|
111
|
+
if (options.webModalStyle?.shadow) {
|
|
112
|
+
modalStyleVars['--expo-router-modal-shadow'] = options.webModalStyle.shadow;
|
|
113
|
+
}
|
|
111
114
|
if (isSheet) {
|
|
112
115
|
// Only top corners for mobile sheet
|
|
113
116
|
modalStyleVars.borderTopLeftRadius = radiusCss;
|
|
114
117
|
modalStyleVars.borderTopRightRadius = radiusCss;
|
|
115
|
-
//
|
|
116
|
-
|
|
117
|
-
modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;
|
|
118
|
-
}
|
|
118
|
+
// Always set CSS var to ensure consistency with default iOS 26 radius
|
|
119
|
+
modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;
|
|
119
120
|
}
|
|
120
121
|
else {
|
|
121
|
-
// All corners for desktop modal
|
|
122
|
-
|
|
123
|
-
modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;
|
|
124
|
-
}
|
|
122
|
+
// All corners for desktop modal - always set CSS var for iOS 26 default
|
|
123
|
+
modalStyleVars['--expo-router-modal-border-radius'] = radiusCss;
|
|
125
124
|
}
|
|
126
125
|
// --- End Styling -----------------------------------------------------------
|
|
127
126
|
const handleOpenChange = (open) => {
|