@tanstack/react-router-devtools 0.0.1-beta.45 → 0.0.1-beta.55
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/cjs/Explorer.js +35 -43
- package/build/cjs/Explorer.js.map +1 -1
- package/build/cjs/devtools.js +49 -147
- package/build/cjs/devtools.js.map +1 -1
- package/build/cjs/styledComponents.js +0 -32
- package/build/cjs/styledComponents.js.map +1 -1
- package/build/cjs/theme.js +4 -5
- package/build/cjs/theme.js.map +1 -1
- package/build/cjs/useMediaQuery.js +3 -6
- package/build/cjs/useMediaQuery.js.map +1 -1
- package/build/cjs/utils.js +7 -51
- package/build/cjs/utils.js.map +1 -1
- package/build/esm/index.js +98 -283
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +251 -9572
- package/build/umd/index.development.js +148 -1652
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +15 -5
- package/build/umd/index.production.js.map +1 -1
- package/package.json +2 -5
- package/src/devtools.tsx +64 -64
- package/src/utils.ts +3 -13
package/build/esm/index.js
CHANGED
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
import * as React from 'react';
|
|
12
12
|
import React__default from 'react';
|
|
13
13
|
import { routerContext, invariant, useRouterStore, last } from '@tanstack/react-router';
|
|
14
|
-
import { formatDistanceStrict } from 'date-fns';
|
|
15
14
|
|
|
16
15
|
function _extends() {
|
|
17
16
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -78,11 +77,10 @@ const defaultTheme = {
|
|
|
78
77
|
warning: '#ffb200'
|
|
79
78
|
};
|
|
80
79
|
const ThemeContext = /*#__PURE__*/React__default.createContext(defaultTheme);
|
|
81
|
-
function ThemeProvider(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
} = _ref;
|
|
80
|
+
function ThemeProvider({
|
|
81
|
+
theme,
|
|
82
|
+
...rest
|
|
83
|
+
}) {
|
|
86
84
|
return /*#__PURE__*/React__default.createElement(ThemeContext.Provider, _extends({
|
|
87
85
|
value: theme
|
|
88
86
|
}, rest));
|
|
@@ -111,12 +109,9 @@ function useMediaQuery(query) {
|
|
|
111
109
|
const matcher = window.matchMedia(query);
|
|
112
110
|
|
|
113
111
|
// Create our handler
|
|
114
|
-
const onChange =
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
} = _ref;
|
|
118
|
-
return setIsMatch(matches);
|
|
119
|
-
};
|
|
112
|
+
const onChange = ({
|
|
113
|
+
matches
|
|
114
|
+
}) => setIsMatch(matches);
|
|
120
115
|
|
|
121
116
|
// Listen for changes
|
|
122
117
|
matcher.addListener(onChange);
|
|
@@ -132,31 +127,15 @@ function useMediaQuery(query) {
|
|
|
132
127
|
|
|
133
128
|
const isServer$1 = typeof window === 'undefined';
|
|
134
129
|
function getStatusColor(match, theme) {
|
|
135
|
-
return match.store.
|
|
130
|
+
return match.store.state.status === 'pending' ? theme.active : match.store.state.status === 'error' ? theme.danger : match.store.state.status === 'success' ? theme.success : theme.gray;
|
|
136
131
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
// ? 'inactive'
|
|
143
|
-
// : query.isStale()
|
|
144
|
-
// ? 'stale'
|
|
145
|
-
// : 'fresh'
|
|
146
|
-
// }
|
|
147
|
-
|
|
148
|
-
function styled(type, newStyles, queries) {
|
|
149
|
-
if (queries === void 0) {
|
|
150
|
-
queries = {};
|
|
151
|
-
}
|
|
152
|
-
return /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
|
|
153
|
-
let {
|
|
154
|
-
style,
|
|
155
|
-
...rest
|
|
156
|
-
} = _ref;
|
|
132
|
+
function styled(type, newStyles, queries = {}) {
|
|
133
|
+
return /*#__PURE__*/React__default.forwardRef(({
|
|
134
|
+
style,
|
|
135
|
+
...rest
|
|
136
|
+
}, ref) => {
|
|
157
137
|
const theme = useTheme();
|
|
158
|
-
const mediaStyles = Object.entries(queries).reduce((current,
|
|
159
|
-
let [key, value] = _ref2;
|
|
138
|
+
const mediaStyles = Object.entries(queries).reduce((current, [key, value]) => {
|
|
160
139
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
161
140
|
return useMediaQuery(key) ? {
|
|
162
141
|
...current,
|
|
@@ -223,33 +202,6 @@ function scheduleMicrotask(callback) {
|
|
|
223
202
|
throw error;
|
|
224
203
|
}));
|
|
225
204
|
}
|
|
226
|
-
function multiSortBy(arr, accessors) {
|
|
227
|
-
if (accessors === void 0) {
|
|
228
|
-
accessors = [d => d];
|
|
229
|
-
}
|
|
230
|
-
return arr.map((d, i) => [d, i]).sort((_ref3, _ref4) => {
|
|
231
|
-
let [a, ai] = _ref3;
|
|
232
|
-
let [b, bi] = _ref4;
|
|
233
|
-
for (const accessor of accessors) {
|
|
234
|
-
const ao = accessor(a);
|
|
235
|
-
const bo = accessor(b);
|
|
236
|
-
if (typeof ao === 'undefined') {
|
|
237
|
-
if (typeof bo === 'undefined') {
|
|
238
|
-
continue;
|
|
239
|
-
}
|
|
240
|
-
return 1;
|
|
241
|
-
}
|
|
242
|
-
if (ao === bo) {
|
|
243
|
-
continue;
|
|
244
|
-
}
|
|
245
|
-
return ao > bo ? 1 : -1;
|
|
246
|
-
}
|
|
247
|
-
return ai - bi;
|
|
248
|
-
}).map(_ref5 => {
|
|
249
|
-
let [d] = _ref5;
|
|
250
|
-
return d;
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
205
|
|
|
254
206
|
const Panel = styled('div', (_props, theme) => ({
|
|
255
207
|
fontSize: 'clamp(12px, 1.5vw, 14px)',
|
|
@@ -308,38 +260,6 @@ const Button = styled('button', (props, theme) => ({
|
|
|
308
260
|
const Code = styled('code', {
|
|
309
261
|
fontSize: '.9em'
|
|
310
262
|
});
|
|
311
|
-
styled('input', (_props, theme) => ({
|
|
312
|
-
backgroundColor: theme.inputBackgroundColor,
|
|
313
|
-
border: 0,
|
|
314
|
-
borderRadius: '.2em',
|
|
315
|
-
color: theme.inputTextColor,
|
|
316
|
-
fontSize: '.9em',
|
|
317
|
-
lineHeight: `1.3`,
|
|
318
|
-
padding: '.3em .4em'
|
|
319
|
-
}));
|
|
320
|
-
styled('select', (_props, theme) => ({
|
|
321
|
-
display: `inline-block`,
|
|
322
|
-
fontSize: `.9em`,
|
|
323
|
-
fontFamily: `sans-serif`,
|
|
324
|
-
fontWeight: 'normal',
|
|
325
|
-
lineHeight: `1.3`,
|
|
326
|
-
padding: `.3em 1.5em .3em .5em`,
|
|
327
|
-
height: 'auto',
|
|
328
|
-
border: 0,
|
|
329
|
-
borderRadius: `.2em`,
|
|
330
|
-
appearance: `none`,
|
|
331
|
-
WebkitAppearance: 'none',
|
|
332
|
-
backgroundColor: theme.inputBackgroundColor,
|
|
333
|
-
backgroundImage: `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>")`,
|
|
334
|
-
backgroundRepeat: `no-repeat`,
|
|
335
|
-
backgroundPosition: `right .55em center`,
|
|
336
|
-
backgroundSize: `.65em auto, 100%`,
|
|
337
|
-
color: theme.inputTextColor
|
|
338
|
-
}), {
|
|
339
|
-
'(max-width: 500px)': {
|
|
340
|
-
display: 'none'
|
|
341
|
-
}
|
|
342
|
-
});
|
|
343
263
|
|
|
344
264
|
const Entry = styled('div', {
|
|
345
265
|
fontFamily: 'Menlo, monospace',
|
|
@@ -376,20 +296,17 @@ const Info = styled('span', {
|
|
|
376
296
|
color: 'grey',
|
|
377
297
|
fontSize: '.7em'
|
|
378
298
|
});
|
|
379
|
-
const Expander =
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
}
|
|
391
|
-
}, "\u25B6");
|
|
392
|
-
};
|
|
299
|
+
const Expander = ({
|
|
300
|
+
expanded,
|
|
301
|
+
style = {}
|
|
302
|
+
}) => /*#__PURE__*/React.createElement("span", {
|
|
303
|
+
style: {
|
|
304
|
+
display: 'inline-block',
|
|
305
|
+
transition: 'all .1s ease',
|
|
306
|
+
transform: `rotate(${expanded ? 90 : 0}deg) ${style.transform || ''}`,
|
|
307
|
+
...style
|
|
308
|
+
}
|
|
309
|
+
}, "\u25B6");
|
|
393
310
|
/**
|
|
394
311
|
* Chunk elements in the array by size
|
|
395
312
|
*
|
|
@@ -409,19 +326,18 @@ function chunkArray(array, size) {
|
|
|
409
326
|
}
|
|
410
327
|
return result;
|
|
411
328
|
}
|
|
412
|
-
const DefaultRenderer =
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
} = _ref2;
|
|
329
|
+
const DefaultRenderer = ({
|
|
330
|
+
handleEntry,
|
|
331
|
+
label,
|
|
332
|
+
value,
|
|
333
|
+
subEntries = [],
|
|
334
|
+
subEntryPages = [],
|
|
335
|
+
type,
|
|
336
|
+
expanded = false,
|
|
337
|
+
toggleExpanded,
|
|
338
|
+
pageSize,
|
|
339
|
+
renderer
|
|
340
|
+
}) => {
|
|
425
341
|
const [expandedPages, setExpandedPages] = React.useState([]);
|
|
426
342
|
const [valueSnapshot, setValueSnapshot] = React.useState(undefined);
|
|
427
343
|
const refreshValueSnapshot = () => {
|
|
@@ -454,14 +370,13 @@ const DefaultRenderer = _ref2 => {
|
|
|
454
370
|
function isIterable(x) {
|
|
455
371
|
return Symbol.iterator in x;
|
|
456
372
|
}
|
|
457
|
-
function Explorer(
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
} = _ref3;
|
|
373
|
+
function Explorer({
|
|
374
|
+
value,
|
|
375
|
+
defaultExpanded,
|
|
376
|
+
renderer = DefaultRenderer,
|
|
377
|
+
pageSize = 100,
|
|
378
|
+
...rest
|
|
379
|
+
}) {
|
|
465
380
|
const [expanded, setExpanded] = React.useState(Boolean(defaultExpanded));
|
|
466
381
|
const toggleExpanded = React.useCallback(() => setExpanded(old => !old), []);
|
|
467
382
|
let type = typeof value;
|
|
@@ -469,7 +384,7 @@ function Explorer(_ref3) {
|
|
|
469
384
|
const makeProperty = sub => {
|
|
470
385
|
const subDefaultExpanded = defaultExpanded === true ? {
|
|
471
386
|
[sub.label]: true
|
|
472
|
-
} : defaultExpanded
|
|
387
|
+
} : defaultExpanded?.[sub.label];
|
|
473
388
|
return {
|
|
474
389
|
...sub,
|
|
475
390
|
defaultExpanded: subDefaultExpanded
|
|
@@ -489,13 +404,10 @@ function Explorer(_ref3) {
|
|
|
489
404
|
}));
|
|
490
405
|
} else if (typeof value === 'object' && value !== null) {
|
|
491
406
|
type = 'object';
|
|
492
|
-
subEntries = Object.entries(value).map(
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
value: val
|
|
497
|
-
});
|
|
498
|
-
});
|
|
407
|
+
subEntries = Object.entries(value).map(([key, val]) => makeProperty({
|
|
408
|
+
label: key,
|
|
409
|
+
value: val
|
|
410
|
+
}));
|
|
499
411
|
}
|
|
500
412
|
const subEntryPages = chunkArray(subEntries, pageSize);
|
|
501
413
|
return renderer({
|
|
@@ -545,16 +457,15 @@ function Logo(props) {
|
|
|
545
457
|
}
|
|
546
458
|
}, "ROUTER"));
|
|
547
459
|
}
|
|
548
|
-
function TanStackRouterDevtools(
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
} = _ref;
|
|
460
|
+
function TanStackRouterDevtools({
|
|
461
|
+
initialIsOpen,
|
|
462
|
+
panelProps = {},
|
|
463
|
+
closeButtonProps = {},
|
|
464
|
+
toggleButtonProps = {},
|
|
465
|
+
position = 'bottom-left',
|
|
466
|
+
containerElement: Container = 'footer',
|
|
467
|
+
router
|
|
468
|
+
}) {
|
|
558
469
|
const rootRef = React__default.useRef(null);
|
|
559
470
|
const panelRef = React__default.useRef(null);
|
|
560
471
|
const [isOpen, setIsOpen] = useLocalStorage('tanstackRouterDevtoolsOpen', initialIsOpen);
|
|
@@ -567,12 +478,12 @@ function TanStackRouterDevtools(_ref) {
|
|
|
567
478
|
|
|
568
479
|
setIsResizing(true);
|
|
569
480
|
const dragInfo = {
|
|
570
|
-
originalHeight:
|
|
481
|
+
originalHeight: panelElement?.getBoundingClientRect().height ?? 0,
|
|
571
482
|
pageY: startEvent.pageY
|
|
572
483
|
};
|
|
573
484
|
const run = moveEvent => {
|
|
574
485
|
const delta = dragInfo.pageY - moveEvent.pageY;
|
|
575
|
-
const newHeight =
|
|
486
|
+
const newHeight = dragInfo?.originalHeight + delta;
|
|
576
487
|
setDevtoolsHeight(newHeight);
|
|
577
488
|
if (newHeight < 70) {
|
|
578
489
|
setIsOpen(false);
|
|
@@ -618,12 +529,10 @@ function TanStackRouterDevtools(_ref) {
|
|
|
618
529
|
}, [isResolvedOpen]);
|
|
619
530
|
React__default[isServer ? 'useEffect' : 'useLayoutEffect'](() => {
|
|
620
531
|
if (isResolvedOpen) {
|
|
621
|
-
|
|
622
|
-
const previousValue = (_rootRef$current = rootRef.current) == null ? void 0 : (_rootRef$current$pare = _rootRef$current.parentElement) == null ? void 0 : _rootRef$current$pare.style.paddingBottom;
|
|
532
|
+
const previousValue = rootRef.current?.parentElement?.style.paddingBottom;
|
|
623
533
|
const run = () => {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
if ((_rootRef$current2 = rootRef.current) != null && _rootRef$current2.parentElement) {
|
|
534
|
+
const containerHeight = panelRef.current?.getBoundingClientRect().height;
|
|
535
|
+
if (rootRef.current?.parentElement) {
|
|
627
536
|
rootRef.current.parentElement.style.paddingBottom = `${containerHeight}px`;
|
|
628
537
|
}
|
|
629
538
|
};
|
|
@@ -631,9 +540,8 @@ function TanStackRouterDevtools(_ref) {
|
|
|
631
540
|
if (typeof window !== 'undefined') {
|
|
632
541
|
window.addEventListener('resize', run);
|
|
633
542
|
return () => {
|
|
634
|
-
var _rootRef$current3;
|
|
635
543
|
window.removeEventListener('resize', run);
|
|
636
|
-
if (
|
|
544
|
+
if (rootRef.current?.parentElement && typeof previousValue === 'string') {
|
|
637
545
|
rootRef.current.parentElement.style.paddingBottom = previousValue;
|
|
638
546
|
}
|
|
639
547
|
};
|
|
@@ -763,7 +671,6 @@ function TanStackRouterDevtools(_ref) {
|
|
|
763
671
|
})) : null);
|
|
764
672
|
}
|
|
765
673
|
const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(function TanStackRouterDevtoolsPanel(props, ref) {
|
|
766
|
-
var _Object$values, _Object$values$find, _router$store$current, _router$store$pending, _router$store$pending2, _last, _last2, _last3, _last4, _last5, _last6;
|
|
767
674
|
const {
|
|
768
675
|
isOpen = true,
|
|
769
676
|
setIsOpen,
|
|
@@ -772,7 +679,7 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
772
679
|
...panelProps
|
|
773
680
|
} = props;
|
|
774
681
|
const routerContextValue = React__default.useContext(routerContext);
|
|
775
|
-
const router = userRouter ??
|
|
682
|
+
const router = userRouter ?? routerContextValue?.router;
|
|
776
683
|
invariant(router, 'No router was found for the TanStack Router Devtools. Please place the devtools in the <RouterProvider> component tree or pass the router instance to the devtools manually.');
|
|
777
684
|
useRouterStore();
|
|
778
685
|
const [activeRouteId, setActiveRouteId] = useLocalStorage('tanstackRouterDevtoolsActiveRouteId', '');
|
|
@@ -780,11 +687,22 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
780
687
|
React__default.useEffect(() => {
|
|
781
688
|
setActiveMatchId('');
|
|
782
689
|
}, [activeRouteId]);
|
|
783
|
-
const
|
|
784
|
-
const
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
690
|
+
const allMatches = React__default.useMemo(() => [...Object.values(router.store.state.currentMatches), ...Object.values(router.store.state.pendingMatches ?? [])], [router.store.state.currentMatches, router.store.state.pendingMatches]);
|
|
691
|
+
const activeMatch = allMatches?.find(d => d.id === activeMatchId) || allMatches?.find(d => d.route.id === activeRouteId);
|
|
692
|
+
|
|
693
|
+
// const matchCacheValues = multiSortBy(
|
|
694
|
+
// Object.keys(router.store.state.matchCache)
|
|
695
|
+
// .filter((key) => {
|
|
696
|
+
// const cacheEntry = router.store.state.matchCache[key]!
|
|
697
|
+
// return cacheEntry.gc > Date.now()
|
|
698
|
+
// })
|
|
699
|
+
// .map((key) => router.store.state.matchCache[key]!),
|
|
700
|
+
// [
|
|
701
|
+
// (d) => (d.match.store.state.isFetching ? -1 : 1),
|
|
702
|
+
// (d) => -d.match.store.state.updatedAt!,
|
|
703
|
+
// ],
|
|
704
|
+
// )
|
|
705
|
+
|
|
788
706
|
return /*#__PURE__*/React__default.createElement(ThemeProvider, {
|
|
789
707
|
theme: defaultTheme
|
|
790
708
|
}, /*#__PURE__*/React__default.createElement(Panel, _extends({
|
|
@@ -909,12 +827,12 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
909
827
|
top: 0,
|
|
910
828
|
zIndex: 1
|
|
911
829
|
}
|
|
912
|
-
}, "Active Matches"), router.store.currentMatches.map((match, i) => {
|
|
830
|
+
}, "Active Matches"), router.store.state.currentMatches.map((match, i) => {
|
|
913
831
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
914
|
-
key: match.
|
|
832
|
+
key: match.route.id || i,
|
|
915
833
|
role: "button",
|
|
916
|
-
"aria-label": `Open match details for ${match.
|
|
917
|
-
onClick: () => setActiveRouteId(activeRouteId === match.
|
|
834
|
+
"aria-label": `Open match details for ${match.route.id}`,
|
|
835
|
+
onClick: () => setActiveRouteId(activeRouteId === match.route.id ? '' : match.route.id),
|
|
918
836
|
style: {
|
|
919
837
|
display: 'flex',
|
|
920
838
|
borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
|
|
@@ -939,8 +857,8 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
939
857
|
style: {
|
|
940
858
|
padding: '.5em'
|
|
941
859
|
}
|
|
942
|
-
}, `${match.
|
|
943
|
-
}),
|
|
860
|
+
}, `${match.id}`));
|
|
861
|
+
}), router.store.state.pendingMatches?.length ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
944
862
|
style: {
|
|
945
863
|
marginTop: '2rem',
|
|
946
864
|
padding: '.5em',
|
|
@@ -949,12 +867,12 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
949
867
|
top: 0,
|
|
950
868
|
zIndex: 1
|
|
951
869
|
}
|
|
952
|
-
}, "Pending Matches"),
|
|
870
|
+
}, "Pending Matches"), router.store.state.pendingMatches?.map((match, i) => {
|
|
953
871
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
954
|
-
key: match.
|
|
872
|
+
key: match.route.id || i,
|
|
955
873
|
role: "button",
|
|
956
|
-
"aria-label": `Open match details for ${match.
|
|
957
|
-
onClick: () => setActiveRouteId(activeRouteId === match.
|
|
874
|
+
"aria-label": `Open match details for ${match.route.id}`,
|
|
875
|
+
onClick: () => setActiveRouteId(activeRouteId === match.route.id ? '' : match.route.id),
|
|
958
876
|
style: {
|
|
959
877
|
display: 'flex',
|
|
960
878
|
borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
|
|
@@ -978,74 +896,7 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
978
896
|
style: {
|
|
979
897
|
padding: '.5em'
|
|
980
898
|
}
|
|
981
|
-
}, `${match.
|
|
982
|
-
})) : null, matchCacheValues.length ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
983
|
-
style: {
|
|
984
|
-
marginTop: '2rem',
|
|
985
|
-
padding: '.5em',
|
|
986
|
-
background: defaultTheme.backgroundAlt,
|
|
987
|
-
position: 'sticky',
|
|
988
|
-
top: 0,
|
|
989
|
-
bottom: 0,
|
|
990
|
-
zIndex: 1,
|
|
991
|
-
display: 'flex',
|
|
992
|
-
alignItems: 'center',
|
|
993
|
-
justifyContent: 'space-between'
|
|
994
|
-
}
|
|
995
|
-
}, /*#__PURE__*/React__default.createElement("div", null, "Match Cache"), /*#__PURE__*/React__default.createElement(Button, {
|
|
996
|
-
onClick: () => {
|
|
997
|
-
router.setStore(s => s.matchCache = {});
|
|
998
|
-
}
|
|
999
|
-
}, "Clear")), matchCacheValues.map((d, i) => {
|
|
1000
|
-
const {
|
|
1001
|
-
match,
|
|
1002
|
-
gc
|
|
1003
|
-
} = d;
|
|
1004
|
-
return /*#__PURE__*/React__default.createElement("div", {
|
|
1005
|
-
key: match.matchId || i,
|
|
1006
|
-
role: "button",
|
|
1007
|
-
"aria-label": `Open match details for ${match.matchId}`,
|
|
1008
|
-
onClick: () => setActiveMatchId(activeMatchId === match.matchId ? '' : match.matchId),
|
|
1009
|
-
style: {
|
|
1010
|
-
display: 'flex',
|
|
1011
|
-
borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
|
|
1012
|
-
cursor: 'pointer',
|
|
1013
|
-
background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
|
|
1014
|
-
}
|
|
1015
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1016
|
-
style: {
|
|
1017
|
-
display: 'flex',
|
|
1018
|
-
flexDirection: 'column',
|
|
1019
|
-
padding: '.5rem',
|
|
1020
|
-
gap: '.3rem'
|
|
1021
|
-
}
|
|
1022
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1023
|
-
style: {
|
|
1024
|
-
display: 'flex',
|
|
1025
|
-
alignItems: 'center',
|
|
1026
|
-
gap: '.5rem'
|
|
1027
|
-
}
|
|
1028
|
-
}, /*#__PURE__*/React__default.createElement("div", {
|
|
1029
|
-
style: {
|
|
1030
|
-
flex: '0 0 auto',
|
|
1031
|
-
width: '1.3rem',
|
|
1032
|
-
height: '1.3rem',
|
|
1033
|
-
background: getStatusColor(match, defaultTheme),
|
|
1034
|
-
alignItems: 'center',
|
|
1035
|
-
justifyContent: 'center',
|
|
1036
|
-
fontWeight: 'bold',
|
|
1037
|
-
borderRadius: '.25rem',
|
|
1038
|
-
transition: 'all .2s ease-out'
|
|
1039
|
-
}
|
|
1040
|
-
}), /*#__PURE__*/React__default.createElement(Code, null, `${match.matchId}`)), /*#__PURE__*/React__default.createElement("span", {
|
|
1041
|
-
style: {
|
|
1042
|
-
fontSize: '.7rem',
|
|
1043
|
-
opacity: '.5',
|
|
1044
|
-
lineHeight: 1
|
|
1045
|
-
}
|
|
1046
|
-
}, "Expires", ' ', formatDistanceStrict(new Date(gc), new Date(), {
|
|
1047
|
-
addSuffix: true
|
|
1048
|
-
}))));
|
|
899
|
+
}, `${match.id}`));
|
|
1049
900
|
})) : null), activeMatch ? /*#__PURE__*/React__default.createElement(ActivePanel, null, /*#__PURE__*/React__default.createElement("div", {
|
|
1050
901
|
style: {
|
|
1051
902
|
padding: '.5em',
|
|
@@ -1063,19 +914,15 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
1063
914
|
style: {
|
|
1064
915
|
lineHeight: '1.8em'
|
|
1065
916
|
}
|
|
1066
|
-
}, JSON.stringify(activeMatch.
|
|
917
|
+
}, JSON.stringify(activeMatch.id, null, 2)))), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
1067
918
|
style: {
|
|
1068
919
|
opacity: '.5'
|
|
1069
920
|
}
|
|
1070
|
-
}, "Status"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.store.status)), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
921
|
+
}, "Status"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.store.state.status)), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
1071
922
|
style: {
|
|
1072
923
|
opacity: '.5'
|
|
1073
924
|
}
|
|
1074
|
-
}, "
|
|
1075
|
-
style: {
|
|
1076
|
-
opacity: '.5'
|
|
1077
|
-
}
|
|
1078
|
-
}, "Last Updated"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.store.updatedAt ? new Date(activeMatch.store.updatedAt).toLocaleTimeString() : 'N/A'))))), /*#__PURE__*/React__default.createElement("div", {
|
|
925
|
+
}, "Last Updated"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.store.state.updatedAt ? new Date(activeMatch.store.state.updatedAt).toLocaleTimeString() : 'N/A'))))), /*#__PURE__*/React__default.createElement("div", {
|
|
1079
926
|
style: {
|
|
1080
927
|
background: defaultTheme.backgroundAlt,
|
|
1081
928
|
padding: '.5em',
|
|
@@ -1089,15 +936,6 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
1089
936
|
padding: '0.5em'
|
|
1090
937
|
}
|
|
1091
938
|
}, /*#__PURE__*/React__default.createElement(Button, {
|
|
1092
|
-
type: "button",
|
|
1093
|
-
onClick: () => {
|
|
1094
|
-
activeMatch.invalidate();
|
|
1095
|
-
},
|
|
1096
|
-
style: {
|
|
1097
|
-
background: defaultTheme.warning,
|
|
1098
|
-
color: defaultTheme.inputTextColor
|
|
1099
|
-
}
|
|
1100
|
-
}, "Invalidate"), ' ', /*#__PURE__*/React__default.createElement(Button, {
|
|
1101
939
|
type: "button",
|
|
1102
940
|
onClick: () => activeMatch.load(),
|
|
1103
941
|
style: {
|
|
@@ -1139,36 +977,13 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
1139
977
|
bottom: 0,
|
|
1140
978
|
zIndex: 1
|
|
1141
979
|
}
|
|
1142
|
-
}, "All Loader Data"), /*#__PURE__*/React__default.createElement("div", {
|
|
1143
|
-
style: {
|
|
1144
|
-
padding: '.5em'
|
|
1145
|
-
}
|
|
1146
|
-
}, Object.keys(((_last = last(router.store.currentMatches)) == null ? void 0 : _last.store.loaderData) || {}).length ? /*#__PURE__*/React__default.createElement(Explorer, {
|
|
1147
|
-
value: ((_last2 = last(router.store.currentMatches)) == null ? void 0 : _last2.store.loaderData) || {},
|
|
1148
|
-
defaultExpanded: Object.keys(((_last3 = last(router.store.currentMatches)) == null ? void 0 : _last3.store.loaderData) || {}).reduce((obj, next) => {
|
|
1149
|
-
obj[next] = {};
|
|
1150
|
-
return obj;
|
|
1151
|
-
}, {})
|
|
1152
|
-
}) : /*#__PURE__*/React__default.createElement("em", {
|
|
1153
|
-
style: {
|
|
1154
|
-
opacity: 0.5
|
|
1155
|
-
}
|
|
1156
|
-
}, '{ }')), /*#__PURE__*/React__default.createElement("div", {
|
|
1157
|
-
style: {
|
|
1158
|
-
padding: '.5em',
|
|
1159
|
-
background: defaultTheme.backgroundAlt,
|
|
1160
|
-
position: 'sticky',
|
|
1161
|
-
top: 0,
|
|
1162
|
-
bottom: 0,
|
|
1163
|
-
zIndex: 1
|
|
1164
|
-
}
|
|
1165
980
|
}, "Search Params"), /*#__PURE__*/React__default.createElement("div", {
|
|
1166
981
|
style: {
|
|
1167
982
|
padding: '.5em'
|
|
1168
983
|
}
|
|
1169
|
-
}, Object.keys(
|
|
1170
|
-
value:
|
|
1171
|
-
defaultExpanded: Object.keys(
|
|
984
|
+
}, Object.keys(last(router.store.state.currentMatches)?.store.state.search || {}).length ? /*#__PURE__*/React__default.createElement(Explorer, {
|
|
985
|
+
value: last(router.store.state.currentMatches)?.store.state.search || {},
|
|
986
|
+
defaultExpanded: Object.keys(last(router.store.state.currentMatches)?.store.state.search || {}).reduce((obj, next) => {
|
|
1172
987
|
obj[next] = {};
|
|
1173
988
|
return obj;
|
|
1174
989
|
}, {})
|