expo-router 5.2.0-canary-20250613-b29d676-2 → 5.2.0-canary-20250701-6a945c5
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/build/ExpoRoot.d.ts.map +1 -1
- package/build/ExpoRoot.js +13 -7
- package/build/ExpoRoot.js.map +1 -1
- package/build/exports.d.ts +2 -0
- package/build/exports.d.ts.map +1 -1
- package/build/exports.js +5 -1
- package/build/exports.js.map +1 -1
- package/build/fork/getStateFromPath-forks.d.ts.map +1 -1
- package/build/fork/getStateFromPath-forks.js +4 -1
- package/build/fork/getStateFromPath-forks.js.map +1 -1
- package/build/getRoutes.d.ts +1 -1
- package/build/getRoutes.d.ts.map +1 -1
- package/build/getRoutes.js +14 -6
- package/build/getRoutes.js.map +1 -1
- package/build/getRoutesCore.d.ts +7 -2
- package/build/getRoutesCore.d.ts.map +1 -1
- package/build/getRoutesCore.js +86 -58
- package/build/getRoutesCore.js.map +1 -1
- package/build/getRoutesRedirects.d.ts +2 -2
- package/build/getRoutesRedirects.d.ts.map +1 -1
- package/build/getRoutesRedirects.js +18 -24
- package/build/getRoutesRedirects.js.map +1 -1
- package/build/getRoutesSSR.d.ts +1 -1
- package/build/getRoutesSSR.d.ts.map +1 -1
- package/build/getRoutesSSR.js +2 -3
- package/build/getRoutesSSR.js.map +1 -1
- package/build/global-state/router-store.d.ts +52 -1
- package/build/global-state/router-store.d.ts.map +1 -1
- package/build/global-state/router-store.js +22 -1
- package/build/global-state/router-store.js.map +1 -1
- package/build/global-state/routing.d.ts +1 -0
- package/build/global-state/routing.d.ts.map +1 -1
- package/build/global-state/routing.js +3 -2
- package/build/global-state/routing.js.map +1 -1
- package/build/global-state/storeContext.d.ts +50 -0
- package/build/global-state/storeContext.d.ts.map +1 -1
- package/build/hooks.d.ts.map +1 -1
- package/build/hooks.js +33 -1
- package/build/hooks.js.map +1 -1
- package/build/layouts/StackClient.d.ts.map +1 -1
- package/build/layouts/StackClient.js +39 -2
- package/build/layouts/StackClient.js.map +1 -1
- package/build/link/BaseExpoRouterLink.d.ts +3 -0
- package/build/link/BaseExpoRouterLink.d.ts.map +1 -0
- package/build/link/BaseExpoRouterLink.js +63 -0
- package/build/link/BaseExpoRouterLink.js.map +1 -0
- package/build/link/ExpoLink.d.ts +3 -0
- package/build/link/ExpoLink.d.ts.map +1 -0
- package/build/link/ExpoLink.js +23 -0
- package/build/link/ExpoLink.js.map +1 -0
- package/build/link/Link.d.ts +63 -78
- package/build/link/Link.d.ts.map +1 -1
- package/build/link/Link.js +81 -99
- package/build/link/Link.js.map +1 -1
- package/build/link/LinkWithPreview.d.ts +36 -0
- package/build/link/LinkWithPreview.d.ts.map +1 -0
- package/build/link/LinkWithPreview.js +192 -0
- package/build/link/LinkWithPreview.js.map +1 -0
- package/build/link/Redirect.d.ts +58 -0
- package/build/link/Redirect.d.ts.map +1 -0
- package/build/link/Redirect.js +46 -0
- package/build/link/Redirect.js.map +1 -0
- package/build/link/preview/HrefPreview.d.ts +5 -0
- package/build/link/preview/HrefPreview.d.ts.map +1 -0
- package/build/link/preview/HrefPreview.js +99 -0
- package/build/link/preview/HrefPreview.js.map +1 -0
- package/build/link/preview/LinkPreviewContext.d.ts +7 -0
- package/build/link/preview/LinkPreviewContext.d.ts.map +1 -0
- package/build/link/preview/LinkPreviewContext.js +21 -0
- package/build/link/preview/LinkPreviewContext.js.map +1 -0
- package/build/link/preview/PreviewRouteContext.d.ts +22 -0
- package/build/link/preview/PreviewRouteContext.d.ts.map +1 -0
- package/build/link/preview/PreviewRouteContext.js +28 -0
- package/build/link/preview/PreviewRouteContext.js.map +1 -0
- package/build/link/preview/native.d.ts +31 -0
- package/build/link/preview/native.d.ts.map +1 -0
- package/build/link/preview/native.js +53 -0
- package/build/link/preview/native.js.map +1 -0
- package/build/link/preview/useNextScreenId.d.ts +3 -0
- package/build/link/preview/useNextScreenId.d.ts.map +1 -0
- package/build/link/preview/useNextScreenId.js +42 -0
- package/build/link/preview/useNextScreenId.js.map +1 -0
- package/build/link/useLinkHooks.d.ts +3 -2
- package/build/link/useLinkHooks.d.ts.map +1 -1
- package/build/link/useLinkHooks.js +1 -0
- package/build/link/useLinkHooks.js.map +1 -1
- package/build/modal/Modal.d.ts +82 -0
- package/build/modal/Modal.d.ts.map +1 -0
- package/build/modal/Modal.js +82 -0
- package/build/modal/Modal.js.map +1 -0
- package/build/modal/ModalComponent.d.ts +7 -0
- package/build/modal/ModalComponent.d.ts.map +1 -0
- package/build/modal/ModalComponent.js +10 -0
- package/build/modal/ModalComponent.js.map +1 -0
- package/build/modal/ModalContext.d.ts +22 -0
- package/build/modal/ModalContext.d.ts.map +1 -0
- package/build/modal/ModalContext.js +150 -0
- package/build/modal/ModalContext.js.map +1 -0
- package/build/typed-routes/generate.js +1 -1
- package/build/typed-routes/generate.js.map +1 -1
- package/build/useFocusEffect.d.ts.map +1 -1
- package/build/useFocusEffect.js +5 -3
- package/build/useFocusEffect.js.map +1 -1
- package/build/useScreens.js +1 -1
- package/build/useScreens.js.map +1 -1
- package/build/utils/stack.d.ts +5 -0
- package/build/utils/stack.d.ts.map +1 -0
- package/build/utils/stack.js +10 -0
- package/build/utils/stack.js.map +1 -0
- package/build/views/Screen.d.ts.map +1 -1
- package/build/views/Screen.js +13 -40
- package/build/views/Screen.js.map +1 -1
- package/build/views/Unmatched.d.ts.map +1 -1
- package/build/views/Unmatched.js +9 -3
- package/build/views/Unmatched.js.map +1 -1
- package/build/views/useSafeLayoutEffect.d.ts +3 -0
- package/build/views/useSafeLayoutEffect.d.ts.map +1 -0
- package/build/views/useSafeLayoutEffect.js +6 -0
- package/build/views/useSafeLayoutEffect.js.map +1 -0
- package/expo-module.config.json +1 -1
- package/ios/ExpoHead.podspec +1 -1
- package/ios/LinkPreview/LinkPreviewNativeActionView.swift +12 -0
- package/ios/LinkPreview/LinkPreviewNativeModule.swift +50 -0
- package/ios/LinkPreview/LinkPreviewNativeNavigation.h +18 -0
- package/ios/LinkPreview/LinkPreviewNativeNavigation.mm +108 -0
- package/ios/LinkPreview/LinkPreviewNativePreviewView.swift +15 -0
- package/ios/LinkPreview/LinkPreviewNativeTriggerView.swift +9 -0
- package/ios/LinkPreview/LinkPreviewNativeView.swift +193 -0
- package/package.json +6 -6
- package/plugin/options.json +29 -1
|
@@ -5,7 +5,9 @@ exports.StackRouter = exports.stackRouterOverride = void 0;
|
|
|
5
5
|
const native_1 = require("@react-navigation/native");
|
|
6
6
|
const native_stack_1 = require("@react-navigation/native-stack");
|
|
7
7
|
const non_secure_1 = require("nanoid/non-secure");
|
|
8
|
+
const react_1 = require("react");
|
|
8
9
|
const withLayoutContext_1 = require("./withLayoutContext");
|
|
10
|
+
const LinkPreviewContext_1 = require("../link/preview/LinkPreviewContext");
|
|
9
11
|
const useScreens_1 = require("../useScreens");
|
|
10
12
|
const Protected_1 = require("../views/Protected");
|
|
11
13
|
const NativeStackNavigator = (0, native_stack_1.createNativeStackNavigator)().Navigator;
|
|
@@ -17,6 +19,7 @@ function isStackAction(action) {
|
|
|
17
19
|
action.type === 'POP_TO_TOP' ||
|
|
18
20
|
action.type === 'REPLACE');
|
|
19
21
|
}
|
|
22
|
+
const isPreviewAction = (action) => !!action.payload && 'previewKey' in action.payload && !!action.payload.previewKey;
|
|
20
23
|
/**
|
|
21
24
|
* React Navigation matches a screen by its name or a 'getID' function that uniquely identifies a screen.
|
|
22
25
|
* When a screen has been uniquely identified, the Stack can only have one instance of that screen.
|
|
@@ -81,6 +84,11 @@ const stackRouterOverride = (original) => {
|
|
|
81
84
|
route = state.routes.findLast((route) => route.name === action.payload.name);
|
|
82
85
|
}
|
|
83
86
|
}
|
|
87
|
+
// START FORK
|
|
88
|
+
if (isPreviewAction(action)) {
|
|
89
|
+
route = state.preloadedRoutes.find((route) => route.name === action.payload.name && id === route.key);
|
|
90
|
+
}
|
|
91
|
+
// END FORK
|
|
84
92
|
if (!route) {
|
|
85
93
|
route = state.preloadedRoutes.find((route) => route.name === action.payload.name && id === getId?.({ params: route.params }));
|
|
86
94
|
}
|
|
@@ -145,7 +153,7 @@ const stackRouterOverride = (original) => {
|
|
|
145
153
|
}
|
|
146
154
|
// If the routes length is the same as the state routes length, then we are navigating to a new route.
|
|
147
155
|
// Otherwise we are replacing an existing route.
|
|
148
|
-
const key = routes.length === state.routes.length
|
|
156
|
+
const key = routes.length === state.routes.length && !isPreviewAction(action)
|
|
149
157
|
? `${action.payload.name}-${(0, non_secure_1.nanoid)()}`
|
|
150
158
|
: route.key;
|
|
151
159
|
routes.push({
|
|
@@ -253,11 +261,40 @@ function filterSingular(state, getId) {
|
|
|
253
261
|
};
|
|
254
262
|
}
|
|
255
263
|
const Stack = Object.assign((props) => {
|
|
256
|
-
|
|
264
|
+
const { isPreviewOpen } = (0, LinkPreviewContext_1.useLinkPreviewContext)();
|
|
265
|
+
const screenOptions = (0, react_1.useMemo)(() => {
|
|
266
|
+
if (isPreviewOpen) {
|
|
267
|
+
return disableAnimationInScreenOptions(props.screenOptions);
|
|
268
|
+
}
|
|
269
|
+
return props.screenOptions;
|
|
270
|
+
}, [props.screenOptions, isPreviewOpen]);
|
|
271
|
+
return (<RNStack {...props} screenOptions={screenOptions} UNSTABLE_router={exports.stackRouterOverride}/>);
|
|
257
272
|
}, {
|
|
258
273
|
Screen: RNStack.Screen,
|
|
259
274
|
Protected: Protected_1.Protected,
|
|
260
275
|
});
|
|
276
|
+
function disableAnimationInScreenOptions(options) {
|
|
277
|
+
const animationNone = 'none';
|
|
278
|
+
if (options) {
|
|
279
|
+
if (typeof options === 'function') {
|
|
280
|
+
const newOptions = (...args) => {
|
|
281
|
+
const oldResult = options(...args);
|
|
282
|
+
return {
|
|
283
|
+
...oldResult,
|
|
284
|
+
animation: animationNone,
|
|
285
|
+
};
|
|
286
|
+
};
|
|
287
|
+
return newOptions;
|
|
288
|
+
}
|
|
289
|
+
return {
|
|
290
|
+
...options,
|
|
291
|
+
animation: animationNone,
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
return {
|
|
295
|
+
animation: animationNone,
|
|
296
|
+
};
|
|
297
|
+
}
|
|
261
298
|
exports.default = Stack;
|
|
262
299
|
const StackRouter = (options) => {
|
|
263
300
|
const router = (0, native_1.StackRouter)(options);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StackClient.js","sourceRoot":"","sources":["../../src/layouts/StackClient.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;AACb,qDAWkC;AAClC,iEAIwC;AACxC,kDAA2C;AAG3C,2DAAwD;AACxD,8CAA+D;AAC/D,kDAA+C;AAI/C,MAAM,oBAAoB,GAAG,IAAA,yCAA0B,GAAE,CAAC,SAAS,CAAC;AAEpE,MAAM,OAAO,GAAG,IAAA,qCAAiB,EAK/B,oBAAoB,CAAC,CAAC;AAExB,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,CAC1B,CAAC;AACJ,CAAC;AAED;;;;;;;;GAQG;AACI,MAAM,mBAAmB,GAAmE,CACjG,QAAQ,EACR,EAAE;IACF,OAAO;QACL,iBAAiB,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE;YAC5C,IAAI,MAAM,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK,CAAC,GAAG,EAAE,CAAC;gBACjD,OAAO,IAAI,CAAC;YACd,CAAC;YAED,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;gBAC3B,OAAO,QAAQ,CAAC,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YAC5D,CAAC;YAED,oFAAoF;YACpF,MAAM,qBAAqB,GACzB,MAAM,CAAC,OAAO,IAAI,UAAU,I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O,KAAK,CAAC;IACf,CAAC;IAED,iEAAiE;IACjE,IAAI,MAAM,GAAG,KAAK,CAAC,MAA2D,CAAC;IAC/E,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,KAAK,EAAE,EAAE;QACtC,8CAA8C;QAC9C,IAAI,KAAK,KAAK,YAAY,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC;QACd,CAAC;QAED,qDAAqD;QACrD,OAAO,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,EAAE,KAAK,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;IACzE,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,GAAG,KAAK;QACR,KAAK,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC;QACxB,MAAM;KACP,CAAC;AACJ,CAAC;AAED,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CACzB,CAAC,KAAqC,EAAE,EAAE;IACxC,OAAO,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC,CAAC,eAAe,CAAC,CAAC,2BAAmB,CAAC,EAAG,CAAC;AACtE,CAAC,EACD;IACE,MAAM,EAAE,OAAO,CAAC,MAEP;IACT,SAAS,EAAT,qBAAS;CACV,CACF,CAAC;AAEF,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} from '@react-navigation/native';\nimport {\n NativeStackNavigationEventMap,\n NativeStackNavigationOptions,\n createNativeStackNavigator,\n} from '@react-navigation/native-stack';\nimport { nanoid } from 'nanoid/non-secure';\nimport { ComponentProps } from 'react';\n\nimport { withLayoutContext } from './withLayoutContext';\nimport { SingularOptions, getSingularId } from '../useScreens';\nimport { Protected } from '../views/Protected';\n\ntype GetId = NonNullable<RouterConfigOptions['routeGetIdList'][string]>;\n\nconst NativeStackNavigator = createNativeStackNavigator().Navigator;\n\nconst RNStack = withLayoutContext<\n NativeStackNavigationOptions,\n typeof NativeStackNavigator,\n StackNavigationState<ParamListBase>,\n NativeStackNavigationEventMap\n>(NativeStackNavigator);\n\nfunction isStackAction(\n action: NavigationAction\n): action is StackActionType | Extract<CommonNavigationAction, { type: 'NAVIGATE' }> {\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 );\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 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\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 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 return <RNStack {...props} UNSTABLE_router={stackRouterOverride} />;\n },\n {\n Screen: RNStack.Screen as (\n props: ComponentProps<typeof RNStack.Screen> & { singular?: boolean }\n ) => null,\n Protected,\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,qDAWkC;AAClC,iEAIwC;AACxC,kDAA2C;AAC3C,iCAAgD;AAGhD,2DAAwD;AACxD,2EAA2E;AAC3E,8CAA+D;AAC/D,kDAA+C;AAI/C,MAAM,oBAAoB,GAAG,IAAA,yCAA0B,GAAE,CAAC,SAAS,CAAC;AAEpE,MAAM,OAAO,GAAG,IAAA,qCAAiB,EAK/B,oBAAoB,CAAC,CAAC;AASxB,SAAS,aAAa,CA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AC;IAClD,IAAI,OAAO,EAAE,CAAC;QACZ,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;YAClC,MAAM,UAAU,GAAmB,CAAC,GAAG,IAAI,EAAE,EAAE;gBAC7C,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;gBACnC,OAAO;oBACL,GAAG,SAAS;oBACZ,SAAS,EAAE,aAAa;iBACzB,CAAC;YACJ,CAAC,CAAC;YACF,OAAO,UAAU,CAAC;QACpB,CAAC;QACD,OAAO;YACL,GAAG,OAAO;YACV,SAAS,EAAE,aAAa;SACzB,CAAC;IACJ,CAAC;IACD,OAAO;QACL,SAAS,EAAE,aAAa;KACzB,CAAC;AACJ,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} from '@react-navigation/native';\nimport {\n NativeStackNavigationEventMap,\n NativeStackNavigationOptions,\n createNativeStackNavigator,\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 { 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\nconst RNStack = withLayoutContext<\n NativeStackNavigationOptions,\n typeof NativeStackNavigator,\n StackNavigationState<ParamListBase>,\n NativeStackNavigationEventMap\n>(NativeStackNavigator);\n\ntype RNNavigationAction = Extract<CommonNavigationAction, { type: 'NAVIGATE' }>;\ntype ExpoNavigationAction = Omit<RNNavigationAction, 'payload'> & {\n payload: RNNavigationAction['payload'] & {\n previewKey?: string;\n };\n};\n\nfunction isStackAction(action: NavigationAction): action is StackActionType | 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 );\n}\n\nconst isPreviewAction = (action: NavigationAction): action is ExpoNavigationAction =>\n !!action.payload && 'previewKey' in action.payload && !!action.payload.previewKey;\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 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 { isPreviewOpen } = useLinkPreviewContext();\n const screenOptions = useMemo(() => {\n if (isPreviewOpen) {\n return disableAnimationInScreenOptions(props.screenOptions);\n }\n return props.screenOptions;\n }, [props.screenOptions, isPreviewOpen]);\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"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { LinkProps } from './useLinkHooks';
|
|
2
|
+
export declare function BaseExpoRouterLink({ href, replace, push, dismissTo, relativeToDirectory, asChild, rel, target, download, withAnchor, dangerouslySingular: singular, prefetch, ...rest }: LinkProps): import("react").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=BaseExpoRouterLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseExpoRouterLink.d.ts","sourceRoot":"","sources":["../../src/link/BaseExpoRouterLink.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAqC,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAK9E,wBAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,SAAS,EAET,mBAAmB,EACnB,OAAO,EACP,GAAG,EACH,MAAM,EACN,QAAQ,EACR,UAAU,EACV,mBAAmB,EAAE,QAAQ,EAC7B,QAAQ,EACR,GAAG,IAAI,EACR,EAAE,SAAS,+BA4DX"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.BaseExpoRouterLink = BaseExpoRouterLink;
|
|
8
|
+
// Fork of @react-navigation/native Link.tsx with `href` and `replace` support added and
|
|
9
|
+
// `to` / `action` support removed.
|
|
10
|
+
const react_1 = require("react");
|
|
11
|
+
const react_native_1 = require("react-native");
|
|
12
|
+
const href_1 = require("./href");
|
|
13
|
+
const useLinkHooks_1 = require("./useLinkHooks");
|
|
14
|
+
const useLinkToPathProps_1 = __importDefault(require("./useLinkToPathProps"));
|
|
15
|
+
const Prefetch_1 = require("../Prefetch");
|
|
16
|
+
const Slot_1 = require("../ui/Slot");
|
|
17
|
+
function BaseExpoRouterLink({ href, replace, push, dismissTo,
|
|
18
|
+
// TODO: This does not prevent default on the anchor tag.
|
|
19
|
+
relativeToDirectory, asChild, rel, target, download, withAnchor, dangerouslySingular: singular, prefetch, ...rest }) {
|
|
20
|
+
// Mutate the style prop to add the className on web.
|
|
21
|
+
const style = (0, useLinkHooks_1.useInteropClassName)(rest);
|
|
22
|
+
// If not passing asChild, we need to forward the props to the anchor tag using React Native Web's `hrefAttrs`.
|
|
23
|
+
const hrefAttrs = (0, useLinkHooks_1.useHrefAttrs)({ asChild, rel, target, download });
|
|
24
|
+
const resolvedHref = (0, react_1.useMemo)(() => {
|
|
25
|
+
if (href == null) {
|
|
26
|
+
throw new Error('Link: href is required');
|
|
27
|
+
}
|
|
28
|
+
return (0, href_1.resolveHref)(href);
|
|
29
|
+
}, [href]);
|
|
30
|
+
let event;
|
|
31
|
+
if (push)
|
|
32
|
+
event = 'PUSH';
|
|
33
|
+
if (replace)
|
|
34
|
+
event = 'REPLACE';
|
|
35
|
+
if (dismissTo)
|
|
36
|
+
event = 'POP_TO';
|
|
37
|
+
const props = (0, useLinkToPathProps_1.default)({
|
|
38
|
+
href: resolvedHref,
|
|
39
|
+
event,
|
|
40
|
+
relativeToDirectory,
|
|
41
|
+
withAnchor,
|
|
42
|
+
dangerouslySingular: singular,
|
|
43
|
+
});
|
|
44
|
+
const onPress = (e) => {
|
|
45
|
+
if ('onPress' in rest) {
|
|
46
|
+
rest.onPress?.(e);
|
|
47
|
+
}
|
|
48
|
+
props.onPress(e);
|
|
49
|
+
};
|
|
50
|
+
const Component = asChild ? Slot_1.Slot : react_native_1.Text;
|
|
51
|
+
// Avoid using createElement directly, favoring JSX, to allow tools like NativeWind to perform custom JSX handling on native.
|
|
52
|
+
const element = (<Component {...props} {...hrefAttrs} {...rest} style={style} {...react_native_1.Platform.select({
|
|
53
|
+
web: {
|
|
54
|
+
onClick: onPress,
|
|
55
|
+
},
|
|
56
|
+
default: { onPress },
|
|
57
|
+
})}/>);
|
|
58
|
+
return prefetch ? (<>
|
|
59
|
+
<Prefetch_1.Prefetch href={href}/>
|
|
60
|
+
{element}
|
|
61
|
+
</>) : (element);
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=BaseExpoRouterLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BaseExpoRouterLink.js","sourceRoot":"","sources":["../../src/link/BaseExpoRouterLink.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;AAYb,gDA2EC;AAtFD,wFAAwF;AACxF,mCAAmC;AACnC,iCAA4C;AAC5C,+CAAqE;AAErE,iCAAqC;AACrC,iDAA8E;AAC9E,8EAAsD;AACtD,0CAAuC;AACvC,qCAAkC;AAElC,SAAgB,kBAAkB,CAAC,EACjC,IAAI,EACJ,OAAO,EACP,IAAI,EACJ,SAAS;AACT,yDAAyD;AACzD,mBAAmB,EACnB,OAAO,EACP,GAAG,EACH,MAAM,EACN,QAAQ,EACR,UAAU,EACV,mBAAmB,EAAE,QAAQ,EAC7B,QAAQ,EACR,GAAG,IAAI,EACG;IACV,qDAAqD;IACrD,MAAM,KAAK,GAAG,IAAA,kCAAmB,EAAC,IAAI,CAAC,CAAC;IAExC,+GAA+G;IAC/G,MAAM,SAAS,GAAG,IAAA,2BAAY,EAAC,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAEnE,MAAM,YAAY,GAAG,IAAA,eAAO,EAAC,GAAG,EAAE;QAChC,IAAI,IAAI,IAAI,IAAI,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAC5C,CAAC;QACD,OAAO,IAAA,kBAAW,EAAC,IAAI,CAAC,CAAC;IAC3B,CAAC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replace` support added and\n// `to` / `action` support removed.\nimport { useMemo, MouseEvent } from 'react';\nimport { Text, GestureResponderEvent, Platform } from 'react-native';\n\nimport { resolveHref } from './href';\nimport { useInteropClassName, useHrefAttrs, LinkProps } from './useLinkHooks';\nimport useLinkToPathProps from './useLinkToPathProps';\nimport { Prefetch } from '../Prefetch';\nimport { Slot } from '../ui/Slot';\n\nexport function BaseExpoRouterLink({\n href,\n replace,\n push,\n dismissTo,\n // TODO: This does not prevent default on the anchor tag.\n relativeToDirectory,\n asChild,\n rel,\n target,\n download,\n withAnchor,\n dangerouslySingular: singular,\n prefetch,\n ...rest\n}: LinkProps) {\n // Mutate the style prop to add the className on web.\n const style = useInteropClassName(rest);\n\n // If not passing asChild, we need to forward the props to the anchor tag using React Native Web's `hrefAttrs`.\n const hrefAttrs = useHrefAttrs({ asChild, rel, target, download });\n\n const resolvedHref = useMemo(() => {\n if (href == null) {\n throw new Error('Link: href is required');\n }\n return resolveHref(href);\n }, [href]);\n\n let event;\n if (push) event = 'PUSH';\n if (replace) event = 'REPLACE';\n if (dismissTo) event = 'POP_TO';\n\n const props = useLinkToPathProps({\n href: resolvedHref,\n event,\n relativeToDirectory,\n withAnchor,\n dangerouslySingular: singular,\n });\n\n const onPress = (e: MouseEvent<HTMLAnchorElement> | GestureResponderEvent) => {\n if ('onPress' in rest) {\n rest.onPress?.(e);\n }\n props.onPress(e);\n };\n\n const Component = asChild ? Slot : Text;\n\n // Avoid using createElement directly, favoring JSX, to allow tools like NativeWind to perform custom JSX handling on native.\n const element = (\n <Component\n {...props}\n {...hrefAttrs}\n {...rest}\n style={style}\n {...Platform.select({\n web: {\n onClick: onPress,\n } as any,\n default: { onPress },\n })}\n />\n );\n\n return prefetch ? (\n <>\n <Prefetch href={href} />\n {element}\n </>\n ) : (\n element\n );\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoLink.d.ts","sourceRoot":"","sources":["../../src/link/ExpoLink.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,+BAMxC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
'use client';
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ExpoLink = ExpoLink;
|
|
8
|
+
const expo_constants_1 = __importDefault(require("expo-constants"));
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const BaseExpoRouterLink_1 = require("./BaseExpoRouterLink");
|
|
11
|
+
const LinkWithPreview_1 = require("./LinkWithPreview");
|
|
12
|
+
const PreviewRouteContext_1 = require("./preview/PreviewRouteContext");
|
|
13
|
+
function ExpoLink(props) {
|
|
14
|
+
const isPreview = (0, PreviewRouteContext_1.useIsPreview)();
|
|
15
|
+
if (isLinkWithPreview(props) && !isPreview && expo_constants_1.default?.expoConfig?.newArchEnabled !== false) {
|
|
16
|
+
return <LinkWithPreview_1.LinkWithPreview {...props}/>;
|
|
17
|
+
}
|
|
18
|
+
return <BaseExpoRouterLink_1.BaseExpoRouterLink {...props}/>;
|
|
19
|
+
}
|
|
20
|
+
function isLinkWithPreview(props) {
|
|
21
|
+
return react_1.Children.toArray(props.children).some((child) => (0, react_1.isValidElement)(child) && child.type === LinkWithPreview_1.LinkPreview);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=ExpoLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExpoLink.js","sourceRoot":"","sources":["../../src/link/ExpoLink.tsx"],"names":[],"mappings":";AAAA,YAAY,CAAC;;;;;AAUb,4BAMC;AAdD,oEAAuC;AACvC,iCAAiD;AAEjD,6DAA0D;AAC1D,uDAAiE;AACjE,uEAA6D;AAG7D,SAAgB,QAAQ,CAAC,KAAgB;IACvC,MAAM,SAAS,GAAG,IAAA,kCAAY,GAAE,CAAC;IACjC,IAAI,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,wBAAS,EAAE,UAAU,EAAE,cAAc,KAAK,KAAK,EAAE,CAAC;QAC9F,OAAO,CAAC,iCAAe,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;IACxC,CAAC;IACD,OAAO,CAAC,uCAAkB,CAAC,IAAI,KAAK,CAAC,EAAG,CAAC;AAC3C,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAgB;IACzC,OAAO,gBAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAC1C,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,sBAAc,EAAC,KAAK,CAAC,IAAI,KAAK,CAAC,IAAI,KAAK,6BAAW,CAC/D,CAAC;AACJ,CAAC","sourcesContent":["'use client';\n\nimport Constants from 'expo-constants';\nimport { Children, isValidElement } from 'react';\n\nimport { BaseExpoRouterLink } from './BaseExpoRouterLink';\nimport { LinkPreview, LinkWithPreview } from './LinkWithPreview';\nimport { useIsPreview } from './preview/PreviewRouteContext';\nimport { LinkProps } from './useLinkHooks';\n\nexport function ExpoLink(props: LinkProps) {\n const isPreview = useIsPreview();\n if (isLinkWithPreview(props) && !isPreview && Constants?.expoConfig?.newArchEnabled !== false) {\n return <LinkWithPreview {...props} />;\n }\n return <BaseExpoRouterLink {...props} />;\n}\n\nfunction isLinkWithPreview(props: LinkProps): boolean {\n return Children.toArray(props.children).some(\n (child) => isValidElement(child) && child.type === LinkPreview\n );\n}\n"]}
|
package/build/link/Link.d.ts
CHANGED
|
@@ -1,93 +1,78 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Href } from '../types';
|
|
1
|
+
import { LinkMenu, LinkMenuAction, LinkPreview, LinkTrigger } from './LinkWithPreview';
|
|
3
2
|
import { LinkProps, WebAnchorProps } from './useLinkHooks';
|
|
4
|
-
export
|
|
5
|
-
(
|
|
6
|
-
/** Helper method to resolve an Href object into a string. */
|
|
7
|
-
resolveHref: (href: Href) => string;
|
|
8
|
-
}
|
|
9
|
-
export type RedirectProps = {
|
|
3
|
+
export declare const Link: ((props: LinkProps) => import("react").JSX.Element) & {
|
|
4
|
+
resolveHref: (href: import("..").Href) => string;
|
|
10
5
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* params can be an object of key-value pairs.
|
|
6
|
+
* A component used to group context menu actions for a link.
|
|
7
|
+
*
|
|
8
|
+
* If multiple `Link.Menu` components are used within a single `Link`, only the first one will be rendered.
|
|
9
|
+
* Only `Link.MenuAction` components are allowed as children of `Link.Menu`.
|
|
16
10
|
*
|
|
17
11
|
* @example
|
|
18
|
-
* ```tsx
|
|
19
|
-
*
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <Link.Menu>
|
|
14
|
+
* <Link.MenuAction title="Action 1" onPress={()=>{}} />
|
|
15
|
+
* <Link.MenuAction title="Action 2" onPress={()=>{}} />
|
|
16
|
+
* </Link.Menu>
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @platform ios
|
|
20
|
+
*/
|
|
21
|
+
Menu: typeof LinkMenu;
|
|
22
|
+
/**
|
|
23
|
+
* A component used as a link trigger. The content of this component will be rendered in the base link.
|
|
20
24
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
25
|
+
* If multiple `Link.Trigger` components are used within a single `Link`, only the first one will be rendered.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* <Link href="/about">
|
|
30
|
+
* <Link.Trigger>
|
|
31
|
+
* Trigger
|
|
32
|
+
* </Link.Trigger>
|
|
33
|
+
* </Link>
|
|
26
34
|
* ```
|
|
35
|
+
*
|
|
36
|
+
* @platform ios
|
|
27
37
|
*/
|
|
28
|
-
|
|
38
|
+
Trigger: typeof LinkTrigger;
|
|
29
39
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
40
|
+
* A component used to render and customize the link preview.
|
|
41
|
+
*
|
|
42
|
+
* If `Link.Preview` is used without any props, it will render a preview of the `href` passed to the `Link`.
|
|
32
43
|
*
|
|
33
|
-
*
|
|
44
|
+
* If multiple `Link.Preview` components are used within a single `Link`, only the first one will be rendered.
|
|
45
|
+
*
|
|
46
|
+
* To customize the preview, you can pass custom content as children.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```tsx
|
|
50
|
+
* <Link href="/about">
|
|
51
|
+
* <Link.Preview>
|
|
52
|
+
* <Text>Custom Preview Content</Text>
|
|
53
|
+
* </Link.Trigger>
|
|
54
|
+
* </Link>
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```tsx
|
|
59
|
+
* <Link href="/about">
|
|
60
|
+
* <Link.Preview />
|
|
61
|
+
* </Link>
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @platform ios
|
|
34
65
|
*/
|
|
35
|
-
|
|
66
|
+
Preview: typeof LinkPreview;
|
|
36
67
|
/**
|
|
37
|
-
*
|
|
68
|
+
* A component used to render a context menu action for a link.
|
|
69
|
+
* This component should only be used as a child of `Link.Menu`.
|
|
70
|
+
*
|
|
71
|
+
* @platform ios
|
|
38
72
|
*/
|
|
39
|
-
|
|
73
|
+
MenuAction: typeof LinkMenuAction;
|
|
40
74
|
};
|
|
41
|
-
|
|
42
|
-
* Redirects to the `href` as soon as the component is mounted.
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* ```tsx
|
|
46
|
-
* import { View, Text } from 'react-native';
|
|
47
|
-
* import { Redirect } from 'expo-router';
|
|
48
|
-
*
|
|
49
|
-
* export default function Page() {
|
|
50
|
-
* const { user } = useAuth();
|
|
51
|
-
*
|
|
52
|
-
* if (!user) {
|
|
53
|
-
* return <Redirect href="/login" />;
|
|
54
|
-
* }
|
|
55
|
-
*
|
|
56
|
-
* return (
|
|
57
|
-
* <View>
|
|
58
|
-
* <Text>Welcome Back!</Text>
|
|
59
|
-
* </View>
|
|
60
|
-
* );
|
|
61
|
-
* }
|
|
62
|
-
* ```
|
|
63
|
-
*/
|
|
64
|
-
export declare function Redirect({ href, relativeToDirectory, withAnchor }: RedirectProps): null;
|
|
65
|
-
/**
|
|
66
|
-
* Component that renders a link using [`href`](#href) to another route.
|
|
67
|
-
* By default, it accepts children and wraps them in a `<Text>` component.
|
|
68
|
-
*
|
|
69
|
-
* Uses an anchor tag (`<a>`) on web and performs a client-side navigation to preserve
|
|
70
|
-
* the state of the website and navigate faster. The web-only attributes such as `target`,
|
|
71
|
-
* `rel`, and `download` are supported and passed to the anchor tag on web. See
|
|
72
|
-
* [`WebAnchorProps`](#webanchorprops) for more details.
|
|
73
|
-
*
|
|
74
|
-
* > **Note**: Client-side navigation works with both single-page apps,
|
|
75
|
-
* and [static-rendering](/router/reference/static-rendering/).
|
|
76
|
-
*
|
|
77
|
-
* @example
|
|
78
|
-
* ```tsx
|
|
79
|
-
* import { Link } from 'expo-router';
|
|
80
|
-
* import { View } from 'react-native';
|
|
81
|
-
*
|
|
82
|
-
* export default function Route() {
|
|
83
|
-
* return (
|
|
84
|
-
* <View>
|
|
85
|
-
* <Link href="/about">About</Link>
|
|
86
|
-
* </View>
|
|
87
|
-
* );
|
|
88
|
-
*}
|
|
89
|
-
* ```
|
|
90
|
-
*/
|
|
91
|
-
export declare const Link: LinkComponent;
|
|
75
|
+
export type LinkComponent = typeof Link;
|
|
92
76
|
export { LinkProps, WebAnchorProps };
|
|
77
|
+
export { Redirect, RedirectProps } from './Redirect';
|
|
93
78
|
//# sourceMappingURL=Link.d.ts.map
|
package/build/link/Link.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/link/Link.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEvF,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE3D,eAAO,MAAM,IAAI,WA2BM,SAAS;;IAM5B;;;;;;;;;;;;;;;OAeG;;IAEH;;;;;;;;;;;;;;;OAeG;;IAEH;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;;IAEH;;;;;OAKG;;CAGN,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,OAAO,IAAI,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|