@tanstack/router-devtools 1.17.0 → 1.17.1
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/dist/cjs/Explorer.cjs +19 -13
- package/dist/cjs/Explorer.cjs.map +1 -1
- package/dist/cjs/devtools.cjs +95 -83
- package/dist/cjs/devtools.cjs.map +1 -1
- package/dist/esm/Explorer.js +19 -13
- package/dist/esm/Explorer.js.map +1 -1
- package/dist/esm/devtools.js +95 -83
- package/dist/esm/devtools.js.map +1 -1
- package/package.json +3 -2
- package/src/Explorer.tsx +21 -14
- package/src/devtools.tsx +93 -84
package/dist/esm/devtools.js
CHANGED
|
@@ -8,12 +8,11 @@ import { clsx } from "clsx";
|
|
|
8
8
|
import Explorer from "./Explorer.js";
|
|
9
9
|
import { tokens } from "./tokens.js";
|
|
10
10
|
import { TanStackLogo } from "./logo.js";
|
|
11
|
-
const isServer = typeof window === "undefined";
|
|
12
11
|
function Logo(props) {
|
|
13
12
|
const { className, ...rest } = props;
|
|
14
|
-
return /* @__PURE__ */ jsxs("button", { ...rest, className: clsx(
|
|
15
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
16
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
13
|
+
return /* @__PURE__ */ jsxs("button", { ...rest, className: clsx(getStyles().logo, className), children: [
|
|
14
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().tanstackLogo, children: "TANSTACK" }),
|
|
15
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().routerLogo, children: "React Router v1" })
|
|
17
16
|
] });
|
|
18
17
|
}
|
|
19
18
|
const DevtoolsOnCloseContext = React__default.createContext(void 0);
|
|
@@ -35,7 +34,7 @@ function TanStackRouterDevtools({
|
|
|
35
34
|
containerElement: Container = "footer",
|
|
36
35
|
router
|
|
37
36
|
}) {
|
|
38
|
-
const
|
|
37
|
+
const [rootEl, setRootEl] = React__default.useState(null);
|
|
39
38
|
const panelRef = React__default.useRef(null);
|
|
40
39
|
const [isOpen, setIsOpen] = useLocalStorage(
|
|
41
40
|
"tanstackRouterDevtoolsOpen",
|
|
@@ -78,38 +77,37 @@ function TanStackRouterDevtools({
|
|
|
78
77
|
React__default.useEffect(() => {
|
|
79
78
|
setIsResolvedOpen(isOpen ?? false);
|
|
80
79
|
}, [isOpen, isResolvedOpen, setIsResolvedOpen]);
|
|
81
|
-
React__default
|
|
82
|
-
var _a
|
|
80
|
+
React__default.useEffect(() => {
|
|
81
|
+
var _a;
|
|
83
82
|
if (isResolvedOpen) {
|
|
84
|
-
const previousValue = (
|
|
83
|
+
const previousValue = (_a = rootEl == null ? void 0 : rootEl.parentElement) == null ? void 0 : _a.style.paddingBottom;
|
|
85
84
|
const run = () => {
|
|
86
|
-
var _a2
|
|
85
|
+
var _a2;
|
|
87
86
|
const containerHeight = (_a2 = panelRef.current) == null ? void 0 : _a2.getBoundingClientRect().height;
|
|
88
|
-
if (
|
|
89
|
-
|
|
87
|
+
if (rootEl == null ? void 0 : rootEl.parentElement) {
|
|
88
|
+
rootEl.parentElement.style.paddingBottom = `${containerHeight}px`;
|
|
90
89
|
}
|
|
91
90
|
};
|
|
92
91
|
run();
|
|
93
92
|
if (typeof window !== "undefined") {
|
|
94
93
|
window.addEventListener("resize", run);
|
|
95
94
|
return () => {
|
|
96
|
-
var _a2;
|
|
97
95
|
window.removeEventListener("resize", run);
|
|
98
|
-
if ((
|
|
99
|
-
|
|
96
|
+
if ((rootEl == null ? void 0 : rootEl.parentElement) && typeof previousValue === "string") {
|
|
97
|
+
rootEl.parentElement.style.paddingBottom = previousValue;
|
|
100
98
|
}
|
|
101
99
|
};
|
|
102
100
|
}
|
|
103
101
|
}
|
|
104
102
|
return;
|
|
105
103
|
}, [isResolvedOpen]);
|
|
106
|
-
React__default
|
|
107
|
-
if (
|
|
108
|
-
const el =
|
|
104
|
+
React__default.useEffect(() => {
|
|
105
|
+
if (rootEl) {
|
|
106
|
+
const el = rootEl;
|
|
109
107
|
const fontSize = getComputedStyle(el).fontSize;
|
|
110
108
|
el.style.setProperty("--tsrd-font-size", fontSize);
|
|
111
109
|
}
|
|
112
|
-
}, [
|
|
110
|
+
}, [rootEl]);
|
|
113
111
|
const { style: panelStyle = {}, ...otherPanelProps } = panelProps;
|
|
114
112
|
const {
|
|
115
113
|
style: closeButtonStyle = {},
|
|
@@ -124,7 +122,7 @@ function TanStackRouterDevtools({
|
|
|
124
122
|
if (!isMounted())
|
|
125
123
|
return null;
|
|
126
124
|
const resolvedHeight = devtoolsHeight ?? 500;
|
|
127
|
-
return /* @__PURE__ */ jsxs(Container, { ref:
|
|
125
|
+
return /* @__PURE__ */ jsxs(Container, { ref: setRootEl, className: "TanStackRouterDevtools", children: [
|
|
128
126
|
/* @__PURE__ */ jsx(
|
|
129
127
|
DevtoolsOnCloseContext.Provider,
|
|
130
128
|
{
|
|
@@ -139,10 +137,10 @@ function TanStackRouterDevtools({
|
|
|
139
137
|
...otherPanelProps,
|
|
140
138
|
router,
|
|
141
139
|
className: clsx(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
getStyles().devtoolsPanelContainer,
|
|
141
|
+
getStyles().devtoolsPanelContainerVisibility(!!isOpen),
|
|
142
|
+
getStyles().devtoolsPanelContainerResizing(isResizing),
|
|
143
|
+
getStyles().devtoolsPanelContainerAnimation(
|
|
146
144
|
isResolvedOpen,
|
|
147
145
|
resolvedHeight + 16
|
|
148
146
|
)
|
|
@@ -169,17 +167,17 @@ function TanStackRouterDevtools({
|
|
|
169
167
|
onToggleClick && onToggleClick(e);
|
|
170
168
|
},
|
|
171
169
|
className: clsx(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
170
|
+
getStyles().mainCloseBtn,
|
|
171
|
+
getStyles().mainCloseBtnPosition(position),
|
|
172
|
+
getStyles().mainCloseBtnAnimation(!isButtonClosed)
|
|
175
173
|
),
|
|
176
174
|
children: [
|
|
177
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
178
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
179
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
175
|
+
/* @__PURE__ */ jsxs("div", { className: getStyles().mainCloseBtnIconContainer, children: [
|
|
176
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().mainCloseBtnIconOuter, children: /* @__PURE__ */ jsx(TanStackLogo, {}) }),
|
|
177
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().mainCloseBtnIconInner, children: /* @__PURE__ */ jsx(TanStackLogo, {}) })
|
|
180
178
|
] }),
|
|
181
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
182
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
179
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().mainCloseBtnDivider, children: "-" }),
|
|
180
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().routerLogoCloseButton, children: "React Router" })
|
|
183
181
|
]
|
|
184
182
|
}
|
|
185
183
|
)
|
|
@@ -224,31 +222,31 @@ function RouteComp({
|
|
|
224
222
|
}
|
|
225
223
|
},
|
|
226
224
|
className: clsx(
|
|
227
|
-
|
|
225
|
+
getStyles().routesRowContainer(route.id === activeId, !!match)
|
|
228
226
|
),
|
|
229
227
|
children: [
|
|
230
228
|
/* @__PURE__ */ jsx(
|
|
231
229
|
"div",
|
|
232
230
|
{
|
|
233
231
|
className: clsx(
|
|
234
|
-
|
|
232
|
+
getStyles().matchIndicator(getRouteStatusColor(matches, route))
|
|
235
233
|
)
|
|
236
234
|
}
|
|
237
235
|
),
|
|
238
|
-
/* @__PURE__ */ jsxs("div", { className: clsx(
|
|
236
|
+
/* @__PURE__ */ jsxs("div", { className: clsx(getStyles().routesRow(!!match)), children: [
|
|
239
237
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
240
|
-
/* @__PURE__ */ jsxs("code", { className:
|
|
238
|
+
/* @__PURE__ */ jsxs("code", { className: getStyles().code, children: [
|
|
241
239
|
isRoot ? "__root__" : route.path || trimPath(route.id),
|
|
242
240
|
" "
|
|
243
241
|
] }),
|
|
244
|
-
/* @__PURE__ */ jsx("code", { className:
|
|
242
|
+
/* @__PURE__ */ jsx("code", { className: getStyles().routeParamInfo, children: param })
|
|
245
243
|
] }),
|
|
246
244
|
/* @__PURE__ */ jsx(AgeTicker, { match })
|
|
247
245
|
] })
|
|
248
246
|
]
|
|
249
247
|
}
|
|
250
248
|
),
|
|
251
|
-
((_a = route.children) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsx("div", { className:
|
|
249
|
+
((_a = route.children) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsx("div", { className: getStyles().nestedRouteRow(!!isRoot), children: [...route.children].sort((a, b) => {
|
|
252
250
|
return a.rank - b.rank;
|
|
253
251
|
}).map((r) => /* @__PURE__ */ jsx(
|
|
254
252
|
RouteComp,
|
|
@@ -308,17 +306,23 @@ const TanStackRouterDevtoolsPanel = React__default.forwardRef(function TanStackR
|
|
|
308
306
|
{
|
|
309
307
|
ref,
|
|
310
308
|
className: clsx(
|
|
311
|
-
|
|
309
|
+
getStyles().devtoolsPanel,
|
|
312
310
|
"TanStackRouterDevtoolsPanel",
|
|
313
311
|
className
|
|
314
312
|
),
|
|
315
313
|
...otherPanelProps,
|
|
316
314
|
children: [
|
|
317
|
-
handleDragStart ? /* @__PURE__ */ jsx(
|
|
315
|
+
handleDragStart ? /* @__PURE__ */ jsx(
|
|
316
|
+
"div",
|
|
317
|
+
{
|
|
318
|
+
className: getStyles().dragHandle,
|
|
319
|
+
onMouseDown: handleDragStart
|
|
320
|
+
}
|
|
321
|
+
) : null,
|
|
318
322
|
/* @__PURE__ */ jsx(
|
|
319
323
|
"button",
|
|
320
324
|
{
|
|
321
|
-
className:
|
|
325
|
+
className: getStyles().panelCloseBtn,
|
|
322
326
|
onClick: (e) => {
|
|
323
327
|
setIsOpen(false);
|
|
324
328
|
onCloseClick(e);
|
|
@@ -331,7 +335,7 @@ const TanStackRouterDevtoolsPanel = React__default.forwardRef(function TanStackR
|
|
|
331
335
|
height: "6",
|
|
332
336
|
fill: "none",
|
|
333
337
|
viewBox: "0 0 10 6",
|
|
334
|
-
className:
|
|
338
|
+
className: getStyles().panelCloseBtnIcon,
|
|
335
339
|
children: /* @__PURE__ */ jsx(
|
|
336
340
|
"path",
|
|
337
341
|
{
|
|
@@ -346,8 +350,8 @@ const TanStackRouterDevtoolsPanel = React__default.forwardRef(function TanStackR
|
|
|
346
350
|
)
|
|
347
351
|
}
|
|
348
352
|
),
|
|
349
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
350
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
353
|
+
/* @__PURE__ */ jsxs("div", { className: getStyles().firstContainer, children: [
|
|
354
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().row, children: /* @__PURE__ */ jsx(
|
|
351
355
|
Logo,
|
|
352
356
|
{
|
|
353
357
|
"aria-hidden": true,
|
|
@@ -357,7 +361,7 @@ const TanStackRouterDevtoolsPanel = React__default.forwardRef(function TanStackR
|
|
|
357
361
|
}
|
|
358
362
|
}
|
|
359
363
|
) }),
|
|
360
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
364
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().routerExplorerContainer, children: /* @__PURE__ */ jsx("div", { className: getStyles().routerExplorer, children: /* @__PURE__ */ jsx(
|
|
361
365
|
Explorer,
|
|
362
366
|
{
|
|
363
367
|
label: "Router",
|
|
@@ -398,18 +402,18 @@ const TanStackRouterDevtoolsPanel = React__default.forwardRef(function TanStackR
|
|
|
398
402
|
}
|
|
399
403
|
) }) })
|
|
400
404
|
] }),
|
|
401
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
402
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
403
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
405
|
+
/* @__PURE__ */ jsxs("div", { className: getStyles().secondContainer, children: [
|
|
406
|
+
/* @__PURE__ */ jsxs("div", { className: getStyles().matchesContainer, children: [
|
|
407
|
+
/* @__PURE__ */ jsxs("div", { className: getStyles().detailsHeader, children: [
|
|
404
408
|
/* @__PURE__ */ jsx("span", { children: "Pathname" }),
|
|
405
|
-
routerState.location.maskedLocation ? /* @__PURE__ */ jsx("div", { className:
|
|
409
|
+
routerState.location.maskedLocation ? /* @__PURE__ */ jsx("div", { className: getStyles().maskedBadgeContainer, children: /* @__PURE__ */ jsx("span", { className: getStyles().maskedBadge, children: "masked" }) }) : null
|
|
406
410
|
] }),
|
|
407
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
411
|
+
/* @__PURE__ */ jsxs("div", { className: getStyles().detailsContent, children: [
|
|
408
412
|
/* @__PURE__ */ jsx("code", { children: routerState.location.pathname }),
|
|
409
|
-
routerState.location.maskedLocation ? /* @__PURE__ */ jsx("code", { className:
|
|
413
|
+
routerState.location.maskedLocation ? /* @__PURE__ */ jsx("code", { className: getStyles().maskedLocation, children: routerState.location.maskedLocation.pathname }) : null
|
|
410
414
|
] }),
|
|
411
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
412
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
415
|
+
/* @__PURE__ */ jsxs("div", { className: getStyles().detailsHeader, children: [
|
|
416
|
+
/* @__PURE__ */ jsxs("div", { className: getStyles().routeMatchesToggle, children: [
|
|
413
417
|
/* @__PURE__ */ jsx(
|
|
414
418
|
"button",
|
|
415
419
|
{
|
|
@@ -418,7 +422,9 @@ const TanStackRouterDevtoolsPanel = React__default.forwardRef(function TanStackR
|
|
|
418
422
|
setShowMatches(false);
|
|
419
423
|
},
|
|
420
424
|
disabled: !showMatches,
|
|
421
|
-
className: clsx(
|
|
425
|
+
className: clsx(
|
|
426
|
+
getStyles().routeMatchesToggleBtn(!showMatches, true)
|
|
427
|
+
),
|
|
422
428
|
children: "Routes"
|
|
423
429
|
}
|
|
424
430
|
),
|
|
@@ -431,13 +437,13 @@ const TanStackRouterDevtoolsPanel = React__default.forwardRef(function TanStackR
|
|
|
431
437
|
},
|
|
432
438
|
disabled: showMatches,
|
|
433
439
|
className: clsx(
|
|
434
|
-
|
|
440
|
+
getStyles().routeMatchesToggleBtn(!!showMatches, false)
|
|
435
441
|
),
|
|
436
442
|
children: "Matches"
|
|
437
443
|
}
|
|
438
444
|
)
|
|
439
445
|
] }),
|
|
440
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
446
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().detailsHeaderInfo, children: /* @__PURE__ */ jsx("div", { children: "age / staleTime / gcTime" }) })
|
|
441
447
|
] }),
|
|
442
448
|
!showMatches ? /* @__PURE__ */ jsx(
|
|
443
449
|
RouteComp,
|
|
@@ -454,20 +460,20 @@ const TanStackRouterDevtoolsPanel = React__default.forwardRef(function TanStackR
|
|
|
454
460
|
role: "button",
|
|
455
461
|
"aria-label": `Open match details for ${match.id}`,
|
|
456
462
|
onClick: () => setActiveId(activeId === match.id ? "" : match.id),
|
|
457
|
-
className: clsx(
|
|
463
|
+
className: clsx(getStyles().matchRow(match === activeMatch)),
|
|
458
464
|
children: [
|
|
459
465
|
/* @__PURE__ */ jsx(
|
|
460
466
|
"div",
|
|
461
467
|
{
|
|
462
468
|
className: clsx(
|
|
463
|
-
|
|
469
|
+
getStyles().matchIndicator(getStatusColor(match))
|
|
464
470
|
)
|
|
465
471
|
}
|
|
466
472
|
),
|
|
467
473
|
/* @__PURE__ */ jsx(
|
|
468
474
|
"code",
|
|
469
475
|
{
|
|
470
|
-
className:
|
|
476
|
+
className: getStyles().matchID,
|
|
471
477
|
children: `${match.routeId === "__root__" ? "__root__" : match.pathname}`
|
|
472
478
|
}
|
|
473
479
|
),
|
|
@@ -478,10 +484,10 @@ const TanStackRouterDevtoolsPanel = React__default.forwardRef(function TanStackR
|
|
|
478
484
|
);
|
|
479
485
|
}) })
|
|
480
486
|
] }),
|
|
481
|
-
((_a = routerState.cachedMatches) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsxs("div", { className:
|
|
482
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
487
|
+
((_a = routerState.cachedMatches) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsxs("div", { className: getStyles().cachedMatchesContainer, children: [
|
|
488
|
+
/* @__PURE__ */ jsxs("div", { className: getStyles().detailsHeader, children: [
|
|
483
489
|
/* @__PURE__ */ jsx("div", { children: "Cached Matches" }),
|
|
484
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
490
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().detailsHeaderInfo, children: "age / staleTime / gcTime" })
|
|
485
491
|
] }),
|
|
486
492
|
/* @__PURE__ */ jsx("div", { children: routerState.cachedMatches.map((match) => {
|
|
487
493
|
return /* @__PURE__ */ jsxs(
|
|
@@ -490,17 +496,17 @@ const TanStackRouterDevtoolsPanel = React__default.forwardRef(function TanStackR
|
|
|
490
496
|
role: "button",
|
|
491
497
|
"aria-label": `Open match details for ${match.id}`,
|
|
492
498
|
onClick: () => setActiveId(activeId === match.id ? "" : match.id),
|
|
493
|
-
className: clsx(
|
|
499
|
+
className: clsx(getStyles().matchRow(match === activeMatch)),
|
|
494
500
|
children: [
|
|
495
501
|
/* @__PURE__ */ jsx(
|
|
496
502
|
"div",
|
|
497
503
|
{
|
|
498
504
|
className: clsx(
|
|
499
|
-
|
|
505
|
+
getStyles().matchIndicator(getStatusColor(match))
|
|
500
506
|
)
|
|
501
507
|
}
|
|
502
508
|
),
|
|
503
|
-
/* @__PURE__ */ jsx("code", { className:
|
|
509
|
+
/* @__PURE__ */ jsx("code", { className: getStyles().matchID, children: `${match.id}` }),
|
|
504
510
|
/* @__PURE__ */ jsx(AgeTicker, { match })
|
|
505
511
|
]
|
|
506
512
|
},
|
|
@@ -509,39 +515,39 @@ const TanStackRouterDevtoolsPanel = React__default.forwardRef(function TanStackR
|
|
|
509
515
|
}) })
|
|
510
516
|
] }) : null
|
|
511
517
|
] }),
|
|
512
|
-
activeMatch ? /* @__PURE__ */ jsxs("div", { className:
|
|
513
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
514
|
-
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { className:
|
|
518
|
+
activeMatch ? /* @__PURE__ */ jsxs("div", { className: getStyles().thirdContainer, children: [
|
|
519
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().detailsHeader, children: "Match Details" }),
|
|
520
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("div", { className: getStyles().matchDetails, children: [
|
|
515
521
|
/* @__PURE__ */ jsx(
|
|
516
522
|
"div",
|
|
517
523
|
{
|
|
518
|
-
className:
|
|
524
|
+
className: getStyles().matchStatus(
|
|
519
525
|
activeMatch.status,
|
|
520
526
|
activeMatch.isFetching
|
|
521
527
|
),
|
|
522
528
|
children: /* @__PURE__ */ jsx("div", { children: activeMatch.status === "success" && activeMatch.isFetching ? "fetching" : activeMatch.status })
|
|
523
529
|
}
|
|
524
530
|
),
|
|
525
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
531
|
+
/* @__PURE__ */ jsxs("div", { className: getStyles().matchDetailsInfoLabel, children: [
|
|
526
532
|
/* @__PURE__ */ jsx("div", { children: "ID:" }),
|
|
527
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
533
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().matchDetailsInfo, children: /* @__PURE__ */ jsx("code", { children: activeMatch.id }) })
|
|
528
534
|
] }),
|
|
529
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
535
|
+
/* @__PURE__ */ jsxs("div", { className: getStyles().matchDetailsInfoLabel, children: [
|
|
530
536
|
/* @__PURE__ */ jsx("div", { children: "State:" }),
|
|
531
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
537
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().matchDetailsInfo, children: ((_b = routerState.pendingMatches) == null ? void 0 : _b.find(
|
|
532
538
|
(d) => d.id === activeMatch.id
|
|
533
539
|
)) ? "Pending" : ((_c = routerState.matches) == null ? void 0 : _c.find((d) => d.id === activeMatch.id)) ? "Active" : "Cached" })
|
|
534
540
|
] }),
|
|
535
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
541
|
+
/* @__PURE__ */ jsxs("div", { className: getStyles().matchDetailsInfoLabel, children: [
|
|
536
542
|
/* @__PURE__ */ jsx("div", { children: "Last Updated:" }),
|
|
537
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
543
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().matchDetailsInfo, children: activeMatch.updatedAt ? new Date(
|
|
538
544
|
activeMatch.updatedAt
|
|
539
545
|
).toLocaleTimeString() : "N/A" })
|
|
540
546
|
] })
|
|
541
547
|
] }) }),
|
|
542
548
|
activeMatch.loaderData ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
543
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
544
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
549
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().detailsHeader, children: "Loader Data" }),
|
|
550
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().detailsContent, children: /* @__PURE__ */ jsx(
|
|
545
551
|
Explorer,
|
|
546
552
|
{
|
|
547
553
|
label: "loaderData",
|
|
@@ -550,12 +556,12 @@ const TanStackRouterDevtoolsPanel = React__default.forwardRef(function TanStackR
|
|
|
550
556
|
}
|
|
551
557
|
) })
|
|
552
558
|
] }) : null,
|
|
553
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
554
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
559
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().detailsHeader, children: "Explorer" }),
|
|
560
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().detailsContent, children: /* @__PURE__ */ jsx(Explorer, { label: "Match", value: activeMatch, defaultExpanded: {} }) })
|
|
555
561
|
] }) : null,
|
|
556
|
-
hasSearch ? /* @__PURE__ */ jsxs("div", { className:
|
|
557
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
558
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
562
|
+
hasSearch ? /* @__PURE__ */ jsxs("div", { className: getStyles().fourthContainer, children: [
|
|
563
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().detailsHeader, children: "Search Params" }),
|
|
564
|
+
/* @__PURE__ */ jsx("div", { className: getStyles().detailsContent, children: /* @__PURE__ */ jsx(
|
|
559
565
|
Explorer,
|
|
560
566
|
{
|
|
561
567
|
value: routerState.location.search || {},
|
|
@@ -596,7 +602,7 @@ function AgeTicker({ match }) {
|
|
|
596
602
|
const age = Date.now() - (match == null ? void 0 : match.updatedAt);
|
|
597
603
|
const staleTime = route.options.staleTime ?? router.options.defaultStaleTime ?? 0;
|
|
598
604
|
const gcTime = route.options.gcTime ?? router.options.defaultGcTime ?? 30 * 60 * 1e3;
|
|
599
|
-
return /* @__PURE__ */ jsxs("div", { className: clsx(
|
|
605
|
+
return /* @__PURE__ */ jsxs("div", { className: clsx(getStyles().ageTicker(age > staleTime)), children: [
|
|
600
606
|
/* @__PURE__ */ jsx("div", { children: formatTime(age) }),
|
|
601
607
|
/* @__PURE__ */ jsx("div", { children: "/" }),
|
|
602
608
|
/* @__PURE__ */ jsx("div", { children: formatTime(staleTime) }),
|
|
@@ -1153,7 +1159,13 @@ const stylesFactory = () => {
|
|
|
1153
1159
|
`
|
|
1154
1160
|
};
|
|
1155
1161
|
};
|
|
1156
|
-
|
|
1162
|
+
let _styles = null;
|
|
1163
|
+
function getStyles() {
|
|
1164
|
+
if (_styles)
|
|
1165
|
+
return _styles;
|
|
1166
|
+
_styles = stylesFactory();
|
|
1167
|
+
return _styles;
|
|
1168
|
+
}
|
|
1157
1169
|
export {
|
|
1158
1170
|
TanStackRouterDevtools,
|
|
1159
1171
|
TanStackRouterDevtoolsPanel
|