@tanstack/react-router 0.0.1-beta.3 → 0.0.1-beta.30

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.
@@ -16,31 +16,26 @@ function _extends() {
16
16
  _extends = Object.assign ? Object.assign.bind() : function (target) {
17
17
  for (var i = 1; i < arguments.length; i++) {
18
18
  var source = arguments[i];
19
-
20
19
  for (var key in source) {
21
20
  if (Object.prototype.hasOwnProperty.call(source, key)) {
22
21
  target[key] = source[key];
23
22
  }
24
23
  }
25
24
  }
26
-
27
25
  return target;
28
26
  };
29
27
  return _extends.apply(this, arguments);
30
28
  }
31
-
32
29
  function _objectWithoutPropertiesLoose(source, excluded) {
33
30
  if (source == null) return {};
34
31
  var target = {};
35
32
  var sourceKeys = Object.keys(source);
36
33
  var key, i;
37
-
38
34
  for (i = 0; i < sourceKeys.length; i++) {
39
35
  key = sourceKeys[i];
40
36
  if (excluded.indexOf(key) >= 0) continue;
41
37
  target[key] = source[key];
42
38
  }
43
-
44
39
  return target;
45
40
  }
46
41
 
@@ -1 +1 @@
1
- {"version":3,"file":"_rollupPluginBabelHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"_rollupPluginBabelHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,447 @@
1
+ /**
2
+ * react-router
3
+ *
4
+ * Copyright (c) TanStack
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */
11
+ 'use strict';
12
+
13
+ Object.defineProperty(exports, '__esModule', { value: true });
14
+
15
+ var _rollupPluginBabelHelpers = require('./_virtual/_rollupPluginBabelHelpers.js');
16
+ var React = require('react');
17
+ var shim = require('use-sync-external-store/shim');
18
+ var routerCore = require('@tanstack/router-core');
19
+
20
+ function _interopNamespace(e) {
21
+ if (e && e.__esModule) return e;
22
+ var n = Object.create(null);
23
+ if (e) {
24
+ Object.keys(e).forEach(function (k) {
25
+ if (k !== 'default') {
26
+ var d = Object.getOwnPropertyDescriptor(e, k);
27
+ Object.defineProperty(n, k, d.get ? d : {
28
+ enumerable: true,
29
+ get: function () { return e[k]; }
30
+ });
31
+ }
32
+ });
33
+ }
34
+ n["default"] = e;
35
+ return Object.freeze(n);
36
+ }
37
+
38
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
39
+
40
+ const _excluded = ["type", "children", "target", "activeProps", "inactiveProps", "activeOptions", "disabled", "hash", "search", "params", "to", "preload", "preloadDelay", "preloadMaxAge", "replace", "style", "className", "onClick", "onFocus", "onMouseEnter", "onMouseLeave", "onTouchStart", "onTouchEnd"],
41
+ _excluded2 = ["pending", "caseSensitive", "children"],
42
+ _excluded3 = ["router"];
43
+ function lazy(importer) {
44
+ const lazyComp = /*#__PURE__*/React__namespace.lazy(importer);
45
+ let promise;
46
+ let resolvedComp;
47
+ const forwardedComp = /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
48
+ const resolvedCompRef = React__namespace.useRef(resolvedComp || lazyComp);
49
+ return /*#__PURE__*/React__namespace.createElement(resolvedCompRef.current, _rollupPluginBabelHelpers["extends"]({}, ref ? {
50
+ ref
51
+ } : {}, props));
52
+ });
53
+ const finalComp = forwardedComp;
54
+ finalComp.preload = () => {
55
+ if (!promise) {
56
+ promise = importer().then(module => {
57
+ resolvedComp = module.default;
58
+ return resolvedComp;
59
+ });
60
+ }
61
+ return promise;
62
+ };
63
+ return finalComp;
64
+ }
65
+ //
66
+
67
+ function Link(props) {
68
+ const router = useRouter();
69
+ return /*#__PURE__*/React__namespace.createElement(router.Link, props);
70
+ }
71
+ const matchesContext = /*#__PURE__*/React__namespace.createContext(null);
72
+ const routerContext = /*#__PURE__*/React__namespace.createContext(null);
73
+ function MatchesProvider(props) {
74
+ return /*#__PURE__*/React__namespace.createElement(matchesContext.Provider, props);
75
+ }
76
+ const useRouterSubscription = router => {
77
+ shim.useSyncExternalStore(cb => router.subscribe(() => cb()), () => router.state, () => router.state);
78
+ };
79
+ function createReactRouter(opts) {
80
+ const makeRouteExt = (route, router) => {
81
+ return {
82
+ useRoute: function useRoute(subRouteId) {
83
+ if (subRouteId === void 0) {
84
+ subRouteId = '.';
85
+ }
86
+ const resolvedRouteId = router.resolvePath(route.routeId, subRouteId);
87
+ const resolvedRoute = router.getRoute(resolvedRouteId);
88
+ useRouterSubscription(router);
89
+ routerCore.invariant(resolvedRoute, "Could not find a route for route \"" + resolvedRouteId + "\"! Did you forget to add it to your route config?");
90
+ return resolvedRoute;
91
+ },
92
+ linkProps: options => {
93
+ var _functionalUpdate, _functionalUpdate2;
94
+ const {
95
+ // custom props
96
+
97
+ target,
98
+ activeProps = () => ({
99
+ className: 'active'
100
+ }),
101
+ inactiveProps = () => ({}),
102
+ disabled,
103
+ // element props
104
+ style,
105
+ className,
106
+ onClick,
107
+ onFocus,
108
+ onMouseEnter,
109
+ onMouseLeave
110
+ } = options,
111
+ rest = _rollupPluginBabelHelpers.objectWithoutPropertiesLoose(options, _excluded);
112
+ const linkInfo = route.buildLink(options);
113
+ if (linkInfo.type === 'external') {
114
+ const {
115
+ href
116
+ } = linkInfo;
117
+ return {
118
+ href
119
+ };
120
+ }
121
+ const {
122
+ handleClick,
123
+ handleFocus,
124
+ handleEnter,
125
+ handleLeave,
126
+ isActive,
127
+ next
128
+ } = linkInfo;
129
+ const reactHandleClick = e => {
130
+ if (React__namespace.startTransition)
131
+ // This is a hack for react < 18
132
+ React__namespace.startTransition(() => {
133
+ handleClick(e);
134
+ });else handleClick(e);
135
+ };
136
+ const composeHandlers = handlers => e => {
137
+ e.persist();
138
+ handlers.forEach(handler => {
139
+ if (handler) handler(e);
140
+ });
141
+ };
142
+
143
+ // Get the active props
144
+ const resolvedActiveProps = isActive ? (_functionalUpdate = routerCore.functionalUpdate(activeProps, {})) != null ? _functionalUpdate : {} : {};
145
+
146
+ // Get the inactive props
147
+ const resolvedInactiveProps = isActive ? {} : (_functionalUpdate2 = routerCore.functionalUpdate(inactiveProps, {})) != null ? _functionalUpdate2 : {};
148
+ return _rollupPluginBabelHelpers["extends"]({}, resolvedActiveProps, resolvedInactiveProps, rest, {
149
+ href: disabled ? undefined : next.href,
150
+ onClick: composeHandlers([reactHandleClick, onClick]),
151
+ onFocus: composeHandlers([handleFocus, onFocus]),
152
+ onMouseEnter: composeHandlers([handleEnter, onMouseEnter]),
153
+ onMouseLeave: composeHandlers([handleLeave, onMouseLeave]),
154
+ target,
155
+ style: _rollupPluginBabelHelpers["extends"]({}, style, resolvedActiveProps.style, resolvedInactiveProps.style),
156
+ className: [className, resolvedActiveProps.className, resolvedInactiveProps.className].filter(Boolean).join(' ') || undefined
157
+ }, disabled ? {
158
+ role: 'link',
159
+ 'aria-disabled': true
160
+ } : undefined, {
161
+ ['data-status']: isActive ? 'active' : undefined
162
+ });
163
+ },
164
+ Link: /*#__PURE__*/React__namespace.forwardRef((props, ref) => {
165
+ const linkProps = route.linkProps(props);
166
+ useRouterSubscription(router);
167
+ return /*#__PURE__*/React__namespace.createElement("a", _rollupPluginBabelHelpers["extends"]({
168
+ ref: ref
169
+ }, linkProps, {
170
+ children: typeof props.children === 'function' ? props.children({
171
+ isActive: linkProps['data-status'] === 'active'
172
+ }) : props.children
173
+ }));
174
+ }),
175
+ MatchRoute: opts => {
176
+ const {
177
+ pending,
178
+ caseSensitive
179
+ } = opts,
180
+ rest = _rollupPluginBabelHelpers.objectWithoutPropertiesLoose(opts, _excluded2);
181
+ const params = route.matchRoute(rest, {
182
+ pending,
183
+ caseSensitive
184
+ });
185
+ if (!params) {
186
+ return null;
187
+ }
188
+ return typeof opts.children === 'function' ? opts.children(params) : opts.children;
189
+ }
190
+ };
191
+ };
192
+ const coreRouter = routerCore.createRouter(_rollupPluginBabelHelpers["extends"]({}, opts, {
193
+ createRouter: router => {
194
+ const routerExt = {
195
+ useState: () => {
196
+ useRouterSubscription(router);
197
+ return router.state;
198
+ },
199
+ useMatch: (routeId, opts) => {
200
+ var _opts$strict;
201
+ useRouterSubscription(router);
202
+ routerCore.invariant(routeId !== routerCore.rootRouteId, "\"" + routerCore.rootRouteId + "\" cannot be used with useMatch! Did you mean to useRoute(\"" + routerCore.rootRouteId + "\")?");
203
+ const nearestMatch = useNearestMatch();
204
+ const match = router.state.matches.find(d => d.routeId === routeId);
205
+ if ((_opts$strict = opts == null ? void 0 : opts.strict) != null ? _opts$strict : true) {
206
+ routerCore.invariant(match, "Could not find an active match for \"" + routeId + "\"!");
207
+ routerCore.invariant(nearestMatch.routeId == (match == null ? void 0 : match.routeId), "useMatch(\"" + (match == null ? void 0 : match.routeId) + "\") is being called in a component that is meant to render the '" + nearestMatch.routeId + "' route. Did you mean to 'useMatch(\"" + (match == null ? void 0 : match.routeId) + "\", { strict: false })' or 'useRoute(\"" + (match == null ? void 0 : match.routeId) + "\")' instead?");
208
+ }
209
+ return match;
210
+ }
211
+ };
212
+ const routeExt = makeRouteExt(router.getRoute(routerCore.rootRouteId), router);
213
+ Object.assign(router, routerExt, routeExt);
214
+ },
215
+ createRoute: _ref => {
216
+ let {
217
+ router,
218
+ route
219
+ } = _ref;
220
+ const routeExt = makeRouteExt(route, router);
221
+ Object.assign(route, routeExt);
222
+ },
223
+ loadComponent: async component => {
224
+ if (component.preload && typeof document !== 'undefined') {
225
+ component.preload();
226
+ // return await component.preload()
227
+ }
228
+
229
+ return component;
230
+ }
231
+ }));
232
+ return coreRouter;
233
+ }
234
+ function RouterProvider(_ref2) {
235
+ let {
236
+ router
237
+ } = _ref2,
238
+ rest = _rollupPluginBabelHelpers.objectWithoutPropertiesLoose(_ref2, _excluded3);
239
+ router.update(rest);
240
+ useRouterSubscription(router);
241
+ React__namespace.useEffect(() => {
242
+ return router.mount();
243
+ }, [router]);
244
+ return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(routerContext.Provider, {
245
+ value: {
246
+ router: router
247
+ }
248
+ }, /*#__PURE__*/React__namespace.createElement(MatchesProvider, {
249
+ value: [undefined, ...router.state.matches]
250
+ }, /*#__PURE__*/React__namespace.createElement(Outlet, null))));
251
+ }
252
+ function useRouter() {
253
+ const value = React__namespace.useContext(routerContext);
254
+ routerCore.warning(!value, 'useRouter must be used inside a <Router> component!');
255
+ useRouterSubscription(value.router);
256
+ return value.router;
257
+ }
258
+ function useMatches() {
259
+ return React__namespace.useContext(matchesContext);
260
+ }
261
+ function useMatch(routeId, opts) {
262
+ const router = useRouter();
263
+ return router.useMatch(routeId, opts);
264
+ }
265
+ function useNearestMatch() {
266
+ const runtimeMatch = useMatches()[0];
267
+ routerCore.invariant(runtimeMatch, "Could not find a nearest match!");
268
+ return runtimeMatch;
269
+ }
270
+ function useRoute(routeId) {
271
+ const router = useRouter();
272
+ return router.useRoute(routeId);
273
+ }
274
+ function useSearch(_routeId) {
275
+ return useRouter().state.location.search;
276
+ }
277
+ function linkProps(props) {
278
+ const router = useRouter();
279
+ return router.linkProps(props);
280
+ }
281
+ function MatchRoute(props) {
282
+ const router = useRouter();
283
+ return /*#__PURE__*/React__namespace.createElement(router.MatchRoute, props);
284
+ }
285
+ function Outlet() {
286
+ var _ref3, _match$__$pendingComp, _match$__$errorCompon;
287
+ const router = useRouter();
288
+ const matches = useMatches().slice(1);
289
+ const match = matches[0];
290
+ const defaultPending = React__namespace.useCallback(() => null, []);
291
+ if (!match) {
292
+ return null;
293
+ }
294
+ const PendingComponent = (_ref3 = (_match$__$pendingComp = match.__.pendingComponent) != null ? _match$__$pendingComp : router.options.defaultPendingComponent) != null ? _ref3 : defaultPending;
295
+ const errorComponent = (_match$__$errorCompon = match.__.errorComponent) != null ? _match$__$errorCompon : router.options.defaultErrorComponent;
296
+ return /*#__PURE__*/React__namespace.createElement(MatchesProvider, {
297
+ value: matches
298
+ }, /*#__PURE__*/React__namespace.createElement(React__namespace.Suspense, {
299
+ fallback: /*#__PURE__*/React__namespace.createElement(PendingComponent, null)
300
+ }, /*#__PURE__*/React__namespace.createElement(CatchBoundary, {
301
+ key: match.routeId,
302
+ errorComponent: errorComponent,
303
+ match: match
304
+ }, (() => {
305
+ if (match.status === 'error') {
306
+ throw match.error;
307
+ }
308
+ if (match.status === 'success') {
309
+ var _ref4, _ref5;
310
+ return /*#__PURE__*/React__namespace.createElement((_ref4 = (_ref5 = match.__.component) != null ? _ref5 : router.options.defaultComponent) != null ? _ref4 : Outlet);
311
+ }
312
+ throw match.__.loadPromise;
313
+ })())));
314
+ }
315
+ class CatchBoundary extends React__namespace.Component {
316
+ constructor() {
317
+ super(...arguments);
318
+ this.state = {
319
+ error: false,
320
+ info: undefined
321
+ };
322
+ }
323
+ componentDidCatch(error, info) {
324
+ console.error("Error in route match: " + this.props.match.matchId);
325
+ console.error(error);
326
+ this.setState({
327
+ error,
328
+ info
329
+ });
330
+ }
331
+ render() {
332
+ return /*#__PURE__*/React__namespace.createElement(CatchBoundaryInner, _rollupPluginBabelHelpers["extends"]({}, this.props, {
333
+ errorState: this.state,
334
+ reset: () => this.setState({})
335
+ }));
336
+ }
337
+ }
338
+
339
+ // This is the messiest thing ever... I'm either seriously tired (likely) or
340
+ // there has to be a better way to reset error boundaries when the
341
+ // router's location key changes.
342
+ function CatchBoundaryInner(props) {
343
+ var _props$errorComponent;
344
+ const [activeErrorState, setActiveErrorState] = React__namespace.useState(props.errorState);
345
+ const router = useRouter();
346
+ const errorComponent = (_props$errorComponent = props.errorComponent) != null ? _props$errorComponent : DefaultErrorBoundary;
347
+ React__namespace.useEffect(() => {
348
+ if (activeErrorState) {
349
+ let prevKey = router.state.location.key;
350
+ return router.subscribe(() => {
351
+ if (router.state.location.key !== prevKey) {
352
+ prevKey = router.state.location.key;
353
+ setActiveErrorState({});
354
+ }
355
+ });
356
+ }
357
+ return;
358
+ }, [activeErrorState]);
359
+ React__namespace.useEffect(() => {
360
+ if (props.errorState.error) {
361
+ setActiveErrorState(props.errorState);
362
+ }
363
+ props.reset();
364
+ }, [props.errorState.error]);
365
+ if (activeErrorState.error) {
366
+ return /*#__PURE__*/React__namespace.createElement(errorComponent, activeErrorState);
367
+ }
368
+ return props.children;
369
+ }
370
+ function DefaultErrorBoundary(_ref6) {
371
+ let {
372
+ error
373
+ } = _ref6;
374
+ return /*#__PURE__*/React__namespace.createElement("div", {
375
+ style: {
376
+ padding: '.5rem',
377
+ maxWidth: '100%'
378
+ }
379
+ }, /*#__PURE__*/React__namespace.createElement("strong", {
380
+ style: {
381
+ fontSize: '1.2rem'
382
+ }
383
+ }, "Something went wrong!"), /*#__PURE__*/React__namespace.createElement("div", {
384
+ style: {
385
+ height: '.5rem'
386
+ }
387
+ }), /*#__PURE__*/React__namespace.createElement("div", null, /*#__PURE__*/React__namespace.createElement("pre", null, error.message ? /*#__PURE__*/React__namespace.createElement("code", {
388
+ style: {
389
+ fontSize: '.7em',
390
+ border: '1px solid red',
391
+ borderRadius: '.25rem',
392
+ padding: '.5rem',
393
+ color: 'red'
394
+ }
395
+ }, error.message) : null)));
396
+ }
397
+ function usePrompt(message, when) {
398
+ const router = useRouter();
399
+ React__namespace.useEffect(() => {
400
+ if (!when) return;
401
+ let unblock = router.history.block(transition => {
402
+ if (window.confirm(message)) {
403
+ unblock();
404
+ transition.retry();
405
+ } else {
406
+ router.location.pathname = window.location.pathname;
407
+ }
408
+ });
409
+ return unblock;
410
+ }, [when, location, message]);
411
+ }
412
+ function Prompt(_ref7) {
413
+ let {
414
+ message,
415
+ when,
416
+ children
417
+ } = _ref7;
418
+ usePrompt(message, when != null ? when : true);
419
+ return children != null ? children : null;
420
+ }
421
+
422
+ exports.DefaultErrorBoundary = DefaultErrorBoundary;
423
+ exports.Link = Link;
424
+ exports.MatchRoute = MatchRoute;
425
+ exports.MatchesProvider = MatchesProvider;
426
+ exports.Outlet = Outlet;
427
+ exports.Prompt = Prompt;
428
+ exports.RouterProvider = RouterProvider;
429
+ exports.createReactRouter = createReactRouter;
430
+ exports.lazy = lazy;
431
+ exports.linkProps = linkProps;
432
+ exports.matchesContext = matchesContext;
433
+ exports.routerContext = routerContext;
434
+ exports.useMatch = useMatch;
435
+ exports.useMatches = useMatches;
436
+ exports.useNearestMatch = useNearestMatch;
437
+ exports.usePrompt = usePrompt;
438
+ exports.useRoute = useRoute;
439
+ exports.useRouter = useRouter;
440
+ exports.useSearch = useSearch;
441
+ Object.keys(routerCore).forEach(function (k) {
442
+ if (k !== 'default' && !exports.hasOwnProperty(k)) Object.defineProperty(exports, k, {
443
+ enumerable: true,
444
+ get: function () { return routerCore[k]; }
445
+ });
446
+ });
447
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":["../../src/index.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { useSyncExternalStore } from 'use-sync-external-store/shim'\n\nimport {\n AnyRoute,\n CheckId,\n rootRouteId,\n Route,\n RegisteredAllRouteInfo,\n RegisteredRouter,\n RouterState,\n ToIdOption,\n} from '@tanstack/router-core'\nimport {\n warning,\n RouterOptions,\n RouteMatch,\n MatchRouteOptions,\n RouteConfig,\n AnyRouteConfig,\n AnyAllRouteInfo,\n DefaultAllRouteInfo,\n functionalUpdate,\n createRouter,\n AnyRouteInfo,\n AllRouteInfo,\n RouteInfo,\n ValidFromPath,\n LinkOptions,\n RouteInfoByPath,\n ResolveRelativePath,\n NoInfer,\n ToOptions,\n invariant,\n Router,\n} from '@tanstack/router-core'\n\nexport * from '@tanstack/router-core'\n\nexport type SyncRouteComponent<TProps = {}> = (\n props: TProps,\n) => JSX.Element | React.ReactNode\n\nexport type RouteComponent<TProps = {}> = SyncRouteComponent<TProps> & {\n preload?: () => Promise<SyncRouteComponent<TProps>>\n}\n\nexport function lazy(\n importer: () => Promise<{ default: SyncRouteComponent }>,\n): RouteComponent {\n const lazyComp = React.lazy(importer as any)\n let promise: Promise<SyncRouteComponent>\n let resolvedComp: SyncRouteComponent\n\n const forwardedComp = React.forwardRef((props, ref) => {\n const resolvedCompRef = React.useRef(resolvedComp || lazyComp)\n return React.createElement(\n resolvedCompRef.current as any,\n { ...(ref ? { ref } : {}), ...props } as any,\n )\n })\n\n const finalComp = forwardedComp as unknown as RouteComponent\n\n finalComp.preload = () => {\n if (!promise) {\n promise = importer().then((module) => {\n resolvedComp = module.default\n return resolvedComp\n })\n }\n\n return promise\n }\n\n return finalComp\n}\n\ntype LinkPropsOptions<\n TAllRouteInfo extends AnyAllRouteInfo,\n TFrom extends ValidFromPath<TAllRouteInfo>,\n TTo extends string,\n> = LinkOptions<TAllRouteInfo, TFrom, TTo> & {\n // A function that returns additional props for the `active` state of this link. These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n activeProps?:\n | React.AnchorHTMLAttributes<HTMLAnchorElement>\n | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>)\n // A function that returns additional props for the `inactive` state of this link. These props override other props passed to the link (`style`'s are merged, `className`'s are concatenated)\n inactiveProps?:\n | React.AnchorHTMLAttributes<HTMLAnchorElement>\n | (() => React.AnchorHTMLAttributes<HTMLAnchorElement>)\n}\n\ntype MakeMatchRouteOptions<\n TAllRouteInfo extends AnyAllRouteInfo,\n TFrom extends ValidFromPath<TAllRouteInfo>,\n TTo extends string,\n> = ToOptions<TAllRouteInfo, TFrom, TTo> &\n MatchRouteOptions & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | React.ReactNode\n | ((\n params: RouteInfoByPath<\n TAllRouteInfo,\n ResolveRelativePath<TFrom, NoInfer<TTo>>\n >['allParams'],\n ) => React.ReactNode)\n }\n\ntype MakeLinkPropsOptions<\n TAllRouteInfo extends AnyAllRouteInfo,\n TFrom extends ValidFromPath<TAllRouteInfo>,\n TTo extends string,\n> = LinkPropsOptions<TAllRouteInfo, TFrom, TTo> &\n React.AnchorHTMLAttributes<HTMLAnchorElement>\n\ntype MakeLinkOptions<\n TAllRouteInfo extends AnyAllRouteInfo,\n TFrom extends ValidFromPath<TAllRouteInfo>,\n TTo extends string,\n> = LinkPropsOptions<TAllRouteInfo, TFrom, TTo> &\n React.AnchorHTMLAttributes<HTMLAnchorElement> &\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'children'> & {\n // If a function is passed as a child, it will be given the `isActive` boolean to aid in further styling on the element it returns\n children?:\n | React.ReactNode\n | ((state: { isActive: boolean }) => React.ReactNode)\n }\n\ndeclare module '@tanstack/router-core' {\n interface FrameworkGenerics {\n Component: RouteComponent\n ErrorComponent: RouteComponent<{\n error: unknown\n info: { componentStack: string }\n }>\n }\n\n interface RouterOptions<TRouteConfig, TRouterContext> {\n // ssrFooter?: () => JSX.Element | React.ReactNode\n }\n\n interface Router<\n TRouteConfig extends AnyRouteConfig = RouteConfig,\n TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>,\n > {\n useState: () => RouterState\n useRoute: <TId extends keyof TAllRouteInfo['routeInfoById']>(\n routeId: TId,\n ) => Route<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TId]>\n useNearestMatch: () => RouteMatch<TAllRouteInfo, RouteInfo>\n useMatch: <\n TId extends keyof TAllRouteInfo['routeInfoById'],\n TStrict extends boolean = true,\n >(\n routeId: TId,\n opts?: { strict?: TStrict },\n ) => TStrict extends true\n ? RouteMatch<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TId]>\n :\n | RouteMatch<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TId]>\n | undefined\n linkProps: <TTo extends string = '.'>(\n props: MakeLinkPropsOptions<TAllRouteInfo, '/', TTo>,\n ) => React.AnchorHTMLAttributes<HTMLAnchorElement>\n Link: <TTo extends string = '.'>(\n props: MakeLinkOptions<TAllRouteInfo, '/', TTo>,\n ) => JSX.Element\n MatchRoute: <TTo extends string = '.'>(\n props: MakeMatchRouteOptions<TAllRouteInfo, '/', TTo>,\n ) => JSX.Element\n }\n\n interface Route<\n TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo,\n TRouteInfo extends AnyRouteInfo = RouteInfo,\n > {\n useRoute: <\n TTo extends string = '.',\n TResolved extends string = ResolveRelativePath<\n TRouteInfo['id'],\n NoInfer<TTo>\n >,\n >(\n routeId: CheckId<\n TAllRouteInfo,\n TResolved,\n ToIdOption<TAllRouteInfo, TRouteInfo['id'], TTo>\n >,\n opts?: { strict?: boolean },\n ) => Route<TAllRouteInfo, TAllRouteInfo['routeInfoById'][TResolved]>\n linkProps: <TTo extends string = '.'>(\n props: MakeLinkPropsOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo>,\n ) => React.AnchorHTMLAttributes<HTMLAnchorElement>\n Link: <TTo extends string = '.'>(\n props: MakeLinkOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo>,\n ) => JSX.Element\n MatchRoute: <TTo extends string = '.'>(\n props: MakeMatchRouteOptions<TAllRouteInfo, TRouteInfo['fullPath'], TTo>,\n ) => JSX.Element\n }\n}\n\nexport type PromptProps = {\n message: string\n when?: boolean | any\n children?: React.ReactNode\n}\n\n//\n\nexport function Link<TTo extends string = '.'>(\n props: MakeLinkOptions<RegisteredAllRouteInfo, '/', TTo>,\n): JSX.Element {\n const router = useRouter()\n return <router.Link {...(props as any)} />\n}\n\ntype MatchesContextValue = RouteMatch[]\n\nexport const matchesContext = React.createContext<MatchesContextValue>(null!)\nexport const routerContext = React.createContext<{ router: RegisteredRouter }>(\n null!,\n)\n\nexport type MatchesProviderProps = {\n value: MatchesContextValue\n children: React.ReactNode\n}\n\nexport function MatchesProvider(props: MatchesProviderProps) {\n return <matchesContext.Provider {...props} />\n}\n\nconst useRouterSubscription = (router: Router<any, any, any>) => {\n useSyncExternalStore(\n (cb) => router.subscribe(() => cb()),\n () => router.state,\n () => router.state,\n )\n}\n\nexport function createReactRouter<\n TRouteConfig extends AnyRouteConfig = RouteConfig,\n TAllRouteInfo extends AnyAllRouteInfo = AllRouteInfo<TRouteConfig>,\n TRouterContext = unknown,\n>(\n opts: RouterOptions<TRouteConfig, TRouterContext>,\n): Router<TRouteConfig, TAllRouteInfo, TRouterContext> {\n const makeRouteExt = (\n route: AnyRoute,\n router: Router<any, any, any>,\n ): Pick<AnyRoute, 'useRoute' | 'linkProps' | 'Link' | 'MatchRoute'> => {\n return {\n useRoute: (subRouteId = '.' as any) => {\n const resolvedRouteId = router.resolvePath(\n route.routeId,\n subRouteId as string,\n )\n const resolvedRoute = router.getRoute(resolvedRouteId)\n useRouterSubscription(router)\n invariant(\n resolvedRoute,\n `Could not find a route for route \"${\n resolvedRouteId as string\n }\"! Did you forget to add it to your route config?`,\n )\n return resolvedRoute\n },\n linkProps: (options) => {\n const {\n // custom props\n type,\n children,\n target,\n activeProps = () => ({ className: 'active' }),\n inactiveProps = () => ({}),\n activeOptions,\n disabled,\n // fromCurrent,\n hash,\n search,\n params,\n to,\n preload,\n preloadDelay,\n preloadMaxAge,\n replace,\n // element props\n style,\n className,\n onClick,\n onFocus,\n onMouseEnter,\n onMouseLeave,\n onTouchStart,\n onTouchEnd,\n ...rest\n } = options\n\n const linkInfo = route.buildLink(options as any)\n\n if (linkInfo.type === 'external') {\n const { href } = linkInfo\n return { href }\n }\n\n const {\n handleClick,\n handleFocus,\n handleEnter,\n handleLeave,\n isActive,\n next,\n } = linkInfo\n\n const reactHandleClick = (e: Event) => {\n if (React.startTransition)\n // This is a hack for react < 18\n React.startTransition(() => {\n handleClick(e)\n })\n else handleClick(e)\n }\n\n const composeHandlers =\n (handlers: (undefined | ((e: any) => void))[]) =>\n (e: React.SyntheticEvent) => {\n e.persist()\n handlers.forEach((handler) => {\n if (handler) handler(e)\n })\n }\n\n // Get the active props\n const resolvedActiveProps: React.HTMLAttributes<HTMLAnchorElement> =\n isActive ? functionalUpdate(activeProps, {}) ?? {} : {}\n\n // Get the inactive props\n const resolvedInactiveProps: React.HTMLAttributes<HTMLAnchorElement> =\n isActive ? {} : functionalUpdate(inactiveProps, {}) ?? {}\n\n return {\n ...resolvedActiveProps,\n ...resolvedInactiveProps,\n ...rest,\n href: disabled ? undefined : next.href,\n onClick: composeHandlers([reactHandleClick, onClick]),\n onFocus: composeHandlers([handleFocus, onFocus]),\n onMouseEnter: composeHandlers([handleEnter, onMouseEnter]),\n onMouseLeave: composeHandlers([handleLeave, onMouseLeave]),\n target,\n style: {\n ...style,\n ...resolvedActiveProps.style,\n ...resolvedInactiveProps.style,\n },\n className:\n [\n className,\n resolvedActiveProps.className,\n resolvedInactiveProps.className,\n ]\n .filter(Boolean)\n .join(' ') || undefined,\n ...(disabled\n ? {\n role: 'link',\n 'aria-disabled': true,\n }\n : undefined),\n ['data-status']: isActive ? 'active' : undefined,\n }\n },\n Link: React.forwardRef((props: any, ref) => {\n const linkProps = route.linkProps(props)\n\n useRouterSubscription(router)\n\n return (\n <a\n {...{\n ref: ref as any,\n ...linkProps,\n children:\n typeof props.children === 'function'\n ? props.children({\n isActive: (linkProps as any)['data-status'] === 'active',\n })\n : props.children,\n }}\n />\n )\n }) as any,\n MatchRoute: (opts) => {\n const { pending, caseSensitive, children, ...rest } = opts\n\n const params = route.matchRoute(rest as any, {\n pending,\n caseSensitive,\n })\n\n if (!params) {\n return null\n }\n\n return typeof opts.children === 'function'\n ? opts.children(params as any)\n : (opts.children as any)\n },\n }\n }\n\n const coreRouter = createRouter<TRouteConfig>({\n ...opts,\n createRouter: (router) => {\n const routerExt: Pick<Router<any, any, any>, 'useMatch' | 'useState'> = {\n useState: () => {\n useRouterSubscription(router)\n return router.state\n },\n useMatch: (routeId, opts) => {\n useRouterSubscription(router)\n\n invariant(\n routeId !== rootRouteId,\n `\"${rootRouteId}\" cannot be used with useMatch! Did you mean to useRoute(\"${rootRouteId}\")?`,\n )\n\n const nearestMatch = useNearestMatch()\n const match = router.state.matches.find((d) => d.routeId === routeId)\n\n if (opts?.strict ?? true) {\n invariant(\n match,\n `Could not find an active match for \"${routeId as string}\"!`,\n )\n\n invariant(\n nearestMatch.routeId == match?.routeId,\n `useMatch(\"${\n match?.routeId as string\n }\") is being called in a component that is meant to render the '${\n nearestMatch.routeId\n }' route. Did you mean to 'useMatch(\"${\n match?.routeId as string\n }\", { strict: false })' or 'useRoute(\"${\n match?.routeId as string\n }\")' instead?`,\n )\n }\n\n return match as any\n },\n }\n\n const routeExt = makeRouteExt(router.getRoute(rootRouteId), router)\n\n Object.assign(router, routerExt, routeExt)\n },\n createRoute: ({ router, route }) => {\n const routeExt = makeRouteExt(route, router)\n\n Object.assign(route, routeExt)\n },\n loadComponent: async (component) => {\n if (component.preload && typeof document !== 'undefined') {\n component.preload()\n // return await component.preload()\n }\n\n return component as any\n },\n })\n\n return coreRouter as any\n}\n\nexport type RouterProps<\n TRouteConfig extends AnyRouteConfig = RouteConfig,\n TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo,\n TRouterContext = unknown,\n> = RouterOptions<TRouteConfig, TRouterContext> & {\n router: Router<TRouteConfig, TAllRouteInfo, TRouterContext>\n}\n\nexport function RouterProvider<\n TRouteConfig extends AnyRouteConfig = RouteConfig,\n TAllRouteInfo extends AnyAllRouteInfo = DefaultAllRouteInfo,\n TRouterContext = unknown,\n>({\n router,\n ...rest\n}: RouterProps<TRouteConfig, TAllRouteInfo, TRouterContext>) {\n router.update(rest)\n\n useRouterSubscription(router)\n React.useEffect(() => {\n return router.mount()\n }, [router])\n\n return (\n <>\n <routerContext.Provider value={{ router: router as any }}>\n <MatchesProvider value={[undefined!, ...router.state.matches]}>\n <Outlet />\n </MatchesProvider>\n </routerContext.Provider>\n </>\n )\n}\n\nexport function useRouter(): RegisteredRouter {\n const value = React.useContext(routerContext)\n warning(!value, 'useRouter must be used inside a <Router> component!')\n\n useRouterSubscription(value.router)\n\n return value.router\n}\n\nexport function useMatches(): RouteMatch[] {\n return React.useContext(matchesContext)\n}\n\nexport function useMatch<\n TId extends keyof RegisteredAllRouteInfo['routeInfoById'],\n TStrict extends boolean = true,\n>(\n routeId: TId,\n opts?: { strict?: TStrict },\n): TStrict extends true\n ? RouteMatch<\n RegisteredAllRouteInfo,\n RegisteredAllRouteInfo['routeInfoById'][TId]\n >\n :\n | RouteMatch<\n RegisteredAllRouteInfo,\n RegisteredAllRouteInfo['routeInfoById'][TId]\n >\n | undefined {\n const router = useRouter()\n return router.useMatch(routeId as any, opts) as any\n}\n\nexport function useNearestMatch(): RouteMatch<\n RegisteredAllRouteInfo,\n RouteInfo\n> {\n const runtimeMatch = useMatches()[0]\n\n invariant(runtimeMatch, `Could not find a nearest match!`)\n\n return runtimeMatch as any\n}\n\nexport function useRoute<\n TId extends keyof RegisteredAllRouteInfo['routeInfoById'],\n>(\n routeId: TId,\n): Route<RegisteredAllRouteInfo, RegisteredAllRouteInfo['routeInfoById'][TId]> {\n const router = useRouter()\n return router.useRoute(routeId as any) as any\n}\n\nexport function useSearch<\n TId extends keyof RegisteredAllRouteInfo['routeInfoById'] = keyof RegisteredAllRouteInfo['routeInfoById'],\n>(_routeId?: TId): RegisteredAllRouteInfo['fullSearchSchema'] {\n return useRouter().state.location.search\n}\n\nexport function linkProps<TTo extends string = '.'>(\n props: MakeLinkPropsOptions<RegisteredAllRouteInfo, '/', TTo>,\n): React.AnchorHTMLAttributes<HTMLAnchorElement> {\n const router = useRouter()\n return router.linkProps(props as any)\n}\n\nexport function MatchRoute<TTo extends string = '.'>(\n props: MakeMatchRouteOptions<RegisteredAllRouteInfo, '/', TTo>,\n): JSX.Element {\n const router = useRouter()\n return React.createElement(router.MatchRoute, props as any)\n}\n\nexport function Outlet() {\n const router = useRouter()\n const matches = useMatches().slice(1)\n const match = matches[0]\n\n const defaultPending = React.useCallback(() => null, [])\n\n if (!match) {\n return null\n }\n\n const PendingComponent = (match.__.pendingComponent ??\n router.options.defaultPendingComponent ??\n defaultPending) as any\n\n const errorComponent =\n match.__.errorComponent ?? router.options.defaultErrorComponent\n\n return (\n <MatchesProvider value={matches}>\n <React.Suspense fallback={<PendingComponent />}>\n <CatchBoundary\n key={match.routeId}\n errorComponent={errorComponent}\n match={match as any}\n >\n {\n ((): React.ReactNode => {\n if (match.status === 'error') {\n throw match.error\n }\n\n if (match.status === 'success') {\n return React.createElement(\n (match.__.component as any) ??\n router.options.defaultComponent ??\n Outlet,\n )\n }\n throw match.__.loadPromise\n })() as JSX.Element\n }\n </CatchBoundary>\n </React.Suspense>\n {/* Provide a suffix suspense boundary to make sure the router is\n ready to be dehydrated on the server */}\n {/* {router.options.ssrFooter && match.matchId === rootRouteId ? (\n <React.Suspense fallback={null}>\n {(() => {\n if (router.state.pending) {\n throw router.navigationPromise\n }\n\n return router.options.ssrFooter()\n })()}\n </React.Suspense>\n ) : null} */}\n </MatchesProvider>\n )\n}\n\nclass CatchBoundary extends React.Component<{\n children: any\n errorComponent: any\n match: RouteMatch\n}> {\n state = {\n error: false,\n info: undefined,\n }\n\n componentDidCatch(error: any, info: any) {\n console.error(`Error in route match: ${this.props.match.matchId}`)\n console.error(error)\n\n this.setState({\n error,\n info,\n })\n }\n\n render() {\n return (\n <CatchBoundaryInner\n {...this.props}\n errorState={this.state}\n reset={() => this.setState({})}\n />\n )\n }\n}\n\n// This is the messiest thing ever... I'm either seriously tired (likely) or\n// there has to be a better way to reset error boundaries when the\n// router's location key changes.\nfunction CatchBoundaryInner(props: {\n children: any\n errorComponent: any\n errorState: { error: unknown; info: any }\n reset: () => void\n}) {\n const [activeErrorState, setActiveErrorState] = React.useState(\n props.errorState,\n )\n const router = useRouter()\n const errorComponent = props.errorComponent ?? DefaultErrorBoundary\n\n React.useEffect(() => {\n if (activeErrorState) {\n let prevKey = router.state.location.key\n return router.subscribe(() => {\n if (router.state.location.key !== prevKey) {\n prevKey = router.state.location.key\n setActiveErrorState({} as any)\n }\n })\n }\n\n return\n }, [activeErrorState])\n\n React.useEffect(() => {\n if (props.errorState.error) {\n setActiveErrorState(props.errorState)\n }\n props.reset()\n }, [props.errorState.error])\n\n if (activeErrorState.error) {\n return React.createElement(errorComponent, activeErrorState)\n }\n\n return props.children\n}\n\nexport function DefaultErrorBoundary({ error }: { error: any }) {\n return (\n <div style={{ padding: '.5rem', maxWidth: '100%' }}>\n <strong style={{ fontSize: '1.2rem' }}>Something went wrong!</strong>\n <div style={{ height: '.5rem' }} />\n <div>\n <pre>\n {error.message ? (\n <code\n style={{\n fontSize: '.7em',\n border: '1px solid red',\n borderRadius: '.25rem',\n padding: '.5rem',\n color: 'red',\n }}\n >\n {error.message}\n </code>\n ) : null}\n </pre>\n </div>\n </div>\n )\n}\n\nexport function usePrompt(message: string, when: boolean | any): void {\n const router = useRouter()\n\n React.useEffect(() => {\n if (!when) return\n\n let unblock = router.history.block((transition) => {\n if (window.confirm(message)) {\n unblock()\n transition.retry()\n } else {\n router.location.pathname = window.location.pathname\n }\n })\n\n return unblock\n }, [when, location, message])\n}\n\nexport function Prompt({ message, when, children }: PromptProps) {\n usePrompt(message, when ?? true)\n return (children ?? null) as React.ReactNode\n}\n"],"names":["lazy","importer","lazyComp","React","promise","resolvedComp","forwardedComp","forwardRef","props","ref","resolvedCompRef","useRef","createElement","current","finalComp","preload","then","module","default","Link","router","useRouter","matchesContext","createContext","routerContext","MatchesProvider","useRouterSubscription","useSyncExternalStore","cb","subscribe","state","createReactRouter","opts","makeRouteExt","route","useRoute","subRouteId","resolvedRouteId","resolvePath","routeId","resolvedRoute","getRoute","invariant","linkProps","options","target","activeProps","className","inactiveProps","disabled","style","onClick","onFocus","onMouseEnter","onMouseLeave","rest","linkInfo","buildLink","type","href","handleClick","handleFocus","handleEnter","handleLeave","isActive","next","reactHandleClick","e","startTransition","composeHandlers","handlers","persist","forEach","handler","resolvedActiveProps","functionalUpdate","resolvedInactiveProps","_extends","undefined","filter","Boolean","join","role","children","MatchRoute","pending","caseSensitive","params","matchRoute","coreRouter","createRouter","routerExt","useState","useMatch","rootRouteId","nearestMatch","useNearestMatch","match","matches","find","d","strict","routeExt","Object","assign","createRoute","loadComponent","component","document","RouterProvider","_objectWithoutPropertiesLoose","update","useEffect","mount","value","useContext","warning","useMatches","runtimeMatch","useSearch","_routeId","location","search","Outlet","slice","defaultPending","useCallback","PendingComponent","__","pendingComponent","defaultPendingComponent","errorComponent","defaultErrorComponent","status","error","defaultComponent","loadPromise","CatchBoundary","Component","info","componentDidCatch","console","matchId","setState","render","CatchBoundaryInner","activeErrorState","setActiveErrorState","errorState","DefaultErrorBoundary","prevKey","key","reset","padding","maxWidth","fontSize","height","message","border","borderRadius","color","usePrompt","when","unblock","history","block","transition","window","confirm","retry","pathname","Prompt"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgDO,SAASA,IAAI,CAClBC,QAAwD,EACxC;AAChB,EAAA,MAAMC,QAAQ,gBAAGC,gBAAK,CAACH,IAAI,CAACC,QAAQ,CAAQ,CAAA;AAC5C,EAAA,IAAIG,OAAoC,CAAA;AACxC,EAAA,IAAIC,YAAgC,CAAA;EAEpC,MAAMC,aAAa,gBAAGH,gBAAK,CAACI,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;IACrD,MAAMC,eAAe,GAAGP,gBAAK,CAACQ,MAAM,CAACN,YAAY,IAAIH,QAAQ,CAAC,CAAA;IAC9D,oBAAOC,gBAAK,CAACS,aAAa,CACxBF,eAAe,CAACG,OAAO,EACjBJ,oCAAAA,CAAAA,EAAAA,EAAAA,GAAG,GAAG;AAAEA,MAAAA,GAAAA;AAAI,KAAC,GAAG,EAAE,EAAMD,KAAK,CACpC,CAAA,CAAA;AACH,GAAC,CAAC,CAAA;EAEF,MAAMM,SAAS,GAAGR,aAA0C,CAAA;EAE5DQ,SAAS,CAACC,OAAO,GAAG,MAAM;IACxB,IAAI,CAACX,OAAO,EAAE;AACZA,MAAAA,OAAO,GAAGH,QAAQ,EAAE,CAACe,IAAI,CAAEC,MAAM,IAAK;QACpCZ,YAAY,GAAGY,MAAM,CAACC,OAAO,CAAA;AAC7B,QAAA,OAAOb,YAAY,CAAA;AACrB,OAAC,CAAC,CAAA;AACJ,KAAA;AAEA,IAAA,OAAOD,OAAO,CAAA;GACf,CAAA;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