@tanstack/react-router-devtools 0.0.1-beta.41 → 0.0.1-beta.49
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/LICENSE +21 -0
- package/build/cjs/Explorer.js +35 -43
- package/build/cjs/Explorer.js.map +1 -1
- package/build/cjs/devtools.js +46 -51
- 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 +10 -23
- package/build/cjs/utils.js.map +1 -1
- package/build/esm/index.js +98 -160
- package/build/esm/index.js.map +1 -1
- package/build/stats-html.html +1 -1
- package/build/stats-react.json +5057 -4480
- package/build/umd/index.development.js +3663 -762
- package/build/umd/index.development.js.map +1 -1
- package/build/umd/index.production.js +3 -3
- package/build/umd/index.production.js.map +1 -1
- package/package.json +3 -3
- package/src/devtools.tsx +44 -38
- package/src/utils.ts +3 -3
package/build/esm/index.js
CHANGED
|
@@ -78,11 +78,10 @@ const defaultTheme = {
|
|
|
78
78
|
warning: '#ffb200'
|
|
79
79
|
};
|
|
80
80
|
const ThemeContext = /*#__PURE__*/React__default.createContext(defaultTheme);
|
|
81
|
-
function ThemeProvider(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
} = _ref;
|
|
81
|
+
function ThemeProvider({
|
|
82
|
+
theme,
|
|
83
|
+
...rest
|
|
84
|
+
}) {
|
|
86
85
|
return /*#__PURE__*/React__default.createElement(ThemeContext.Provider, _extends({
|
|
87
86
|
value: theme
|
|
88
87
|
}, rest));
|
|
@@ -111,12 +110,9 @@ function useMediaQuery(query) {
|
|
|
111
110
|
const matcher = window.matchMedia(query);
|
|
112
111
|
|
|
113
112
|
// Create our handler
|
|
114
|
-
const onChange =
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
} = _ref;
|
|
118
|
-
return setIsMatch(matches);
|
|
119
|
-
};
|
|
113
|
+
const onChange = ({
|
|
114
|
+
matches
|
|
115
|
+
}) => setIsMatch(matches);
|
|
120
116
|
|
|
121
117
|
// Listen for changes
|
|
122
118
|
matcher.addListener(onChange);
|
|
@@ -132,7 +128,7 @@ function useMediaQuery(query) {
|
|
|
132
128
|
|
|
133
129
|
const isServer$1 = typeof window === 'undefined';
|
|
134
130
|
function getStatusColor(match, theme) {
|
|
135
|
-
return match.store.isFetching ? theme.active : match.store.status === 'error' ? theme.danger : match.store.status === 'success' ? theme.success : theme.gray;
|
|
131
|
+
return match.store.state.isFetching ? theme.active : match.store.state.status === 'error' ? theme.danger : match.store.state.status === 'success' ? theme.success : theme.gray;
|
|
136
132
|
}
|
|
137
133
|
|
|
138
134
|
// export function getQueryStatusLabel(query: Query) {
|
|
@@ -145,18 +141,13 @@ function getStatusColor(match, theme) {
|
|
|
145
141
|
// : 'fresh'
|
|
146
142
|
// }
|
|
147
143
|
|
|
148
|
-
function styled(type, newStyles, queries) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
let {
|
|
154
|
-
style,
|
|
155
|
-
...rest
|
|
156
|
-
} = _ref;
|
|
144
|
+
function styled(type, newStyles, queries = {}) {
|
|
145
|
+
return /*#__PURE__*/React__default.forwardRef(({
|
|
146
|
+
style,
|
|
147
|
+
...rest
|
|
148
|
+
}, ref) => {
|
|
157
149
|
const theme = useTheme();
|
|
158
|
-
const mediaStyles = Object.entries(queries).reduce((current,
|
|
159
|
-
let [key, value] = _ref2;
|
|
150
|
+
const mediaStyles = Object.entries(queries).reduce((current, [key, value]) => {
|
|
160
151
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
161
152
|
return useMediaQuery(key) ? {
|
|
162
153
|
...current,
|
|
@@ -223,13 +214,8 @@ function scheduleMicrotask(callback) {
|
|
|
223
214
|
throw error;
|
|
224
215
|
}));
|
|
225
216
|
}
|
|
226
|
-
function multiSortBy(arr, accessors) {
|
|
227
|
-
|
|
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;
|
|
217
|
+
function multiSortBy(arr, accessors = [d => d]) {
|
|
218
|
+
return arr.map((d, i) => [d, i]).sort(([a, ai], [b, bi]) => {
|
|
233
219
|
for (const accessor of accessors) {
|
|
234
220
|
const ao = accessor(a);
|
|
235
221
|
const bo = accessor(b);
|
|
@@ -245,10 +231,7 @@ function multiSortBy(arr, accessors) {
|
|
|
245
231
|
return ao > bo ? 1 : -1;
|
|
246
232
|
}
|
|
247
233
|
return ai - bi;
|
|
248
|
-
}).map(
|
|
249
|
-
let [d] = _ref5;
|
|
250
|
-
return d;
|
|
251
|
-
});
|
|
234
|
+
}).map(([d]) => d);
|
|
252
235
|
}
|
|
253
236
|
|
|
254
237
|
const Panel = styled('div', (_props, theme) => ({
|
|
@@ -308,38 +291,6 @@ const Button = styled('button', (props, theme) => ({
|
|
|
308
291
|
const Code = styled('code', {
|
|
309
292
|
fontSize: '.9em'
|
|
310
293
|
});
|
|
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
294
|
|
|
344
295
|
const Entry = styled('div', {
|
|
345
296
|
fontFamily: 'Menlo, monospace',
|
|
@@ -376,20 +327,17 @@ const Info = styled('span', {
|
|
|
376
327
|
color: 'grey',
|
|
377
328
|
fontSize: '.7em'
|
|
378
329
|
});
|
|
379
|
-
const Expander =
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
}
|
|
391
|
-
}, "\u25B6");
|
|
392
|
-
};
|
|
330
|
+
const Expander = ({
|
|
331
|
+
expanded,
|
|
332
|
+
style = {}
|
|
333
|
+
}) => /*#__PURE__*/React.createElement("span", {
|
|
334
|
+
style: {
|
|
335
|
+
display: 'inline-block',
|
|
336
|
+
transition: 'all .1s ease',
|
|
337
|
+
transform: `rotate(${expanded ? 90 : 0}deg) ${style.transform || ''}`,
|
|
338
|
+
...style
|
|
339
|
+
}
|
|
340
|
+
}, "\u25B6");
|
|
393
341
|
/**
|
|
394
342
|
* Chunk elements in the array by size
|
|
395
343
|
*
|
|
@@ -409,19 +357,18 @@ function chunkArray(array, size) {
|
|
|
409
357
|
}
|
|
410
358
|
return result;
|
|
411
359
|
}
|
|
412
|
-
const DefaultRenderer =
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
} = _ref2;
|
|
360
|
+
const DefaultRenderer = ({
|
|
361
|
+
handleEntry,
|
|
362
|
+
label,
|
|
363
|
+
value,
|
|
364
|
+
subEntries = [],
|
|
365
|
+
subEntryPages = [],
|
|
366
|
+
type,
|
|
367
|
+
expanded = false,
|
|
368
|
+
toggleExpanded,
|
|
369
|
+
pageSize,
|
|
370
|
+
renderer
|
|
371
|
+
}) => {
|
|
425
372
|
const [expandedPages, setExpandedPages] = React.useState([]);
|
|
426
373
|
const [valueSnapshot, setValueSnapshot] = React.useState(undefined);
|
|
427
374
|
const refreshValueSnapshot = () => {
|
|
@@ -454,14 +401,13 @@ const DefaultRenderer = _ref2 => {
|
|
|
454
401
|
function isIterable(x) {
|
|
455
402
|
return Symbol.iterator in x;
|
|
456
403
|
}
|
|
457
|
-
function Explorer(
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
} = _ref3;
|
|
404
|
+
function Explorer({
|
|
405
|
+
value,
|
|
406
|
+
defaultExpanded,
|
|
407
|
+
renderer = DefaultRenderer,
|
|
408
|
+
pageSize = 100,
|
|
409
|
+
...rest
|
|
410
|
+
}) {
|
|
465
411
|
const [expanded, setExpanded] = React.useState(Boolean(defaultExpanded));
|
|
466
412
|
const toggleExpanded = React.useCallback(() => setExpanded(old => !old), []);
|
|
467
413
|
let type = typeof value;
|
|
@@ -469,7 +415,7 @@ function Explorer(_ref3) {
|
|
|
469
415
|
const makeProperty = sub => {
|
|
470
416
|
const subDefaultExpanded = defaultExpanded === true ? {
|
|
471
417
|
[sub.label]: true
|
|
472
|
-
} : defaultExpanded
|
|
418
|
+
} : defaultExpanded?.[sub.label];
|
|
473
419
|
return {
|
|
474
420
|
...sub,
|
|
475
421
|
defaultExpanded: subDefaultExpanded
|
|
@@ -489,13 +435,10 @@ function Explorer(_ref3) {
|
|
|
489
435
|
}));
|
|
490
436
|
} else if (typeof value === 'object' && value !== null) {
|
|
491
437
|
type = 'object';
|
|
492
|
-
subEntries = Object.entries(value).map(
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
value: val
|
|
497
|
-
});
|
|
498
|
-
});
|
|
438
|
+
subEntries = Object.entries(value).map(([key, val]) => makeProperty({
|
|
439
|
+
label: key,
|
|
440
|
+
value: val
|
|
441
|
+
}));
|
|
499
442
|
}
|
|
500
443
|
const subEntryPages = chunkArray(subEntries, pageSize);
|
|
501
444
|
return renderer({
|
|
@@ -545,16 +488,15 @@ function Logo(props) {
|
|
|
545
488
|
}
|
|
546
489
|
}, "ROUTER"));
|
|
547
490
|
}
|
|
548
|
-
function TanStackRouterDevtools(
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
} = _ref;
|
|
491
|
+
function TanStackRouterDevtools({
|
|
492
|
+
initialIsOpen,
|
|
493
|
+
panelProps = {},
|
|
494
|
+
closeButtonProps = {},
|
|
495
|
+
toggleButtonProps = {},
|
|
496
|
+
position = 'bottom-left',
|
|
497
|
+
containerElement: Container = 'footer',
|
|
498
|
+
router
|
|
499
|
+
}) {
|
|
558
500
|
const rootRef = React__default.useRef(null);
|
|
559
501
|
const panelRef = React__default.useRef(null);
|
|
560
502
|
const [isOpen, setIsOpen] = useLocalStorage('tanstackRouterDevtoolsOpen', initialIsOpen);
|
|
@@ -567,12 +509,12 @@ function TanStackRouterDevtools(_ref) {
|
|
|
567
509
|
|
|
568
510
|
setIsResizing(true);
|
|
569
511
|
const dragInfo = {
|
|
570
|
-
originalHeight:
|
|
512
|
+
originalHeight: panelElement?.getBoundingClientRect().height ?? 0,
|
|
571
513
|
pageY: startEvent.pageY
|
|
572
514
|
};
|
|
573
515
|
const run = moveEvent => {
|
|
574
516
|
const delta = dragInfo.pageY - moveEvent.pageY;
|
|
575
|
-
const newHeight =
|
|
517
|
+
const newHeight = dragInfo?.originalHeight + delta;
|
|
576
518
|
setDevtoolsHeight(newHeight);
|
|
577
519
|
if (newHeight < 70) {
|
|
578
520
|
setIsOpen(false);
|
|
@@ -618,12 +560,10 @@ function TanStackRouterDevtools(_ref) {
|
|
|
618
560
|
}, [isResolvedOpen]);
|
|
619
561
|
React__default[isServer ? 'useEffect' : 'useLayoutEffect'](() => {
|
|
620
562
|
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;
|
|
563
|
+
const previousValue = rootRef.current?.parentElement?.style.paddingBottom;
|
|
623
564
|
const run = () => {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
if ((_rootRef$current2 = rootRef.current) != null && _rootRef$current2.parentElement) {
|
|
565
|
+
const containerHeight = panelRef.current?.getBoundingClientRect().height;
|
|
566
|
+
if (rootRef.current?.parentElement) {
|
|
627
567
|
rootRef.current.parentElement.style.paddingBottom = `${containerHeight}px`;
|
|
628
568
|
}
|
|
629
569
|
};
|
|
@@ -631,9 +571,8 @@ function TanStackRouterDevtools(_ref) {
|
|
|
631
571
|
if (typeof window !== 'undefined') {
|
|
632
572
|
window.addEventListener('resize', run);
|
|
633
573
|
return () => {
|
|
634
|
-
var _rootRef$current3;
|
|
635
574
|
window.removeEventListener('resize', run);
|
|
636
|
-
if (
|
|
575
|
+
if (rootRef.current?.parentElement && typeof previousValue === 'string') {
|
|
637
576
|
rootRef.current.parentElement.style.paddingBottom = previousValue;
|
|
638
577
|
}
|
|
639
578
|
};
|
|
@@ -763,7 +702,6 @@ function TanStackRouterDevtools(_ref) {
|
|
|
763
702
|
})) : null);
|
|
764
703
|
}
|
|
765
704
|
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
705
|
const {
|
|
768
706
|
isOpen = true,
|
|
769
707
|
setIsOpen,
|
|
@@ -772,7 +710,7 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
772
710
|
...panelProps
|
|
773
711
|
} = props;
|
|
774
712
|
const routerContextValue = React__default.useContext(routerContext);
|
|
775
|
-
const router = userRouter ??
|
|
713
|
+
const router = userRouter ?? routerContextValue?.router;
|
|
776
714
|
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
715
|
useRouterStore();
|
|
778
716
|
const [activeRouteId, setActiveRouteId] = useLocalStorage('tanstackRouterDevtoolsActiveRouteId', '');
|
|
@@ -780,11 +718,11 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
780
718
|
React__default.useEffect(() => {
|
|
781
719
|
setActiveMatchId('');
|
|
782
720
|
}, [activeRouteId]);
|
|
783
|
-
const activeMatch =
|
|
784
|
-
const matchCacheValues = multiSortBy(Object.keys(router.store.matchCache).filter(key => {
|
|
785
|
-
const cacheEntry = router.store.matchCache[key];
|
|
721
|
+
const activeMatch = Object.values(router.store.state.matchCache)?.find(d => d.match.id === activeMatchId)?.match ?? router.store.state.currentMatches?.find(d => d.route.id === activeRouteId);
|
|
722
|
+
const matchCacheValues = multiSortBy(Object.keys(router.store.state.matchCache).filter(key => {
|
|
723
|
+
const cacheEntry = router.store.state.matchCache[key];
|
|
786
724
|
return cacheEntry.gc > Date.now();
|
|
787
|
-
}).map(key => router.store.matchCache[key]), [d => d.match.store.isFetching ? -1 : 1, d => -d.match.store.updatedAt]);
|
|
725
|
+
}).map(key => router.store.state.matchCache[key]), [d => d.match.store.state.isFetching ? -1 : 1, d => -d.match.store.state.updatedAt]);
|
|
788
726
|
return /*#__PURE__*/React__default.createElement(ThemeProvider, {
|
|
789
727
|
theme: defaultTheme
|
|
790
728
|
}, /*#__PURE__*/React__default.createElement(Panel, _extends({
|
|
@@ -909,12 +847,12 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
909
847
|
top: 0,
|
|
910
848
|
zIndex: 1
|
|
911
849
|
}
|
|
912
|
-
}, "Active Matches"), router.store.currentMatches.map((match, i) => {
|
|
850
|
+
}, "Active Matches"), router.store.state.currentMatches.map((match, i) => {
|
|
913
851
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
914
|
-
key: match.
|
|
852
|
+
key: match.route.id || i,
|
|
915
853
|
role: "button",
|
|
916
|
-
"aria-label": `Open match details for ${match.
|
|
917
|
-
onClick: () => setActiveRouteId(activeRouteId === match.
|
|
854
|
+
"aria-label": `Open match details for ${match.route.id}`,
|
|
855
|
+
onClick: () => setActiveRouteId(activeRouteId === match.route.id ? '' : match.route.id),
|
|
918
856
|
style: {
|
|
919
857
|
display: 'flex',
|
|
920
858
|
borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
|
|
@@ -939,8 +877,8 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
939
877
|
style: {
|
|
940
878
|
padding: '.5em'
|
|
941
879
|
}
|
|
942
|
-
}, `${match.
|
|
943
|
-
}),
|
|
880
|
+
}, `${match.id}`));
|
|
881
|
+
}), router.store.state.pendingMatches?.length ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
944
882
|
style: {
|
|
945
883
|
marginTop: '2rem',
|
|
946
884
|
padding: '.5em',
|
|
@@ -949,12 +887,12 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
949
887
|
top: 0,
|
|
950
888
|
zIndex: 1
|
|
951
889
|
}
|
|
952
|
-
}, "Pending Matches"),
|
|
890
|
+
}, "Pending Matches"), router.store.state.pendingMatches?.map((match, i) => {
|
|
953
891
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
954
|
-
key: match.
|
|
892
|
+
key: match.route.id || i,
|
|
955
893
|
role: "button",
|
|
956
|
-
"aria-label": `Open match details for ${match.
|
|
957
|
-
onClick: () => setActiveRouteId(activeRouteId === match.
|
|
894
|
+
"aria-label": `Open match details for ${match.route.id}`,
|
|
895
|
+
onClick: () => setActiveRouteId(activeRouteId === match.route.id ? '' : match.route.id),
|
|
958
896
|
style: {
|
|
959
897
|
display: 'flex',
|
|
960
898
|
borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
|
|
@@ -978,7 +916,7 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
978
916
|
style: {
|
|
979
917
|
padding: '.5em'
|
|
980
918
|
}
|
|
981
|
-
}, `${match.
|
|
919
|
+
}, `${match.id}`));
|
|
982
920
|
})) : null, matchCacheValues.length ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
|
|
983
921
|
style: {
|
|
984
922
|
marginTop: '2rem',
|
|
@@ -994,7 +932,7 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
994
932
|
}
|
|
995
933
|
}, /*#__PURE__*/React__default.createElement("div", null, "Match Cache"), /*#__PURE__*/React__default.createElement(Button, {
|
|
996
934
|
onClick: () => {
|
|
997
|
-
router.
|
|
935
|
+
router.store.setState(s => s.matchCache = {});
|
|
998
936
|
}
|
|
999
937
|
}, "Clear")), matchCacheValues.map((d, i) => {
|
|
1000
938
|
const {
|
|
@@ -1002,10 +940,10 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
1002
940
|
gc
|
|
1003
941
|
} = d;
|
|
1004
942
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
1005
|
-
key: match.
|
|
943
|
+
key: match.id || i,
|
|
1006
944
|
role: "button",
|
|
1007
|
-
"aria-label": `Open match details for ${match.
|
|
1008
|
-
onClick: () => setActiveMatchId(activeMatchId === match.
|
|
945
|
+
"aria-label": `Open match details for ${match.id}`,
|
|
946
|
+
onClick: () => setActiveMatchId(activeMatchId === match.id ? '' : match.id),
|
|
1009
947
|
style: {
|
|
1010
948
|
display: 'flex',
|
|
1011
949
|
borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
|
|
@@ -1037,7 +975,7 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
1037
975
|
borderRadius: '.25rem',
|
|
1038
976
|
transition: 'all .2s ease-out'
|
|
1039
977
|
}
|
|
1040
|
-
}), /*#__PURE__*/React__default.createElement(Code, null, `${match.
|
|
978
|
+
}), /*#__PURE__*/React__default.createElement(Code, null, `${match.id}`)), /*#__PURE__*/React__default.createElement("span", {
|
|
1041
979
|
style: {
|
|
1042
980
|
fontSize: '.7rem',
|
|
1043
981
|
opacity: '.5',
|
|
@@ -1063,19 +1001,19 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
1063
1001
|
style: {
|
|
1064
1002
|
lineHeight: '1.8em'
|
|
1065
1003
|
}
|
|
1066
|
-
}, JSON.stringify(activeMatch.
|
|
1004
|
+
}, JSON.stringify(activeMatch.id, null, 2)))), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
1067
1005
|
style: {
|
|
1068
1006
|
opacity: '.5'
|
|
1069
1007
|
}
|
|
1070
|
-
}, "Status"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.store.status)), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
1008
|
+
}, "Status"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.store.state.status)), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
1071
1009
|
style: {
|
|
1072
1010
|
opacity: '.5'
|
|
1073
1011
|
}
|
|
1074
|
-
}, "Invalid"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.
|
|
1012
|
+
}, "Invalid"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.getIsInvalid().toString())), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
|
|
1075
1013
|
style: {
|
|
1076
1014
|
opacity: '.5'
|
|
1077
1015
|
}
|
|
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", {
|
|
1016
|
+
}, "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
1017
|
style: {
|
|
1080
1018
|
background: defaultTheme.backgroundAlt,
|
|
1081
1019
|
padding: '.5em',
|
|
@@ -1143,9 +1081,9 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
1143
1081
|
style: {
|
|
1144
1082
|
padding: '.5em'
|
|
1145
1083
|
}
|
|
1146
|
-
}, Object.keys(
|
|
1147
|
-
value:
|
|
1148
|
-
defaultExpanded: Object.keys(
|
|
1084
|
+
}, Object.keys(last(router.store.state.currentMatches)?.store.state.loaderData || {}).length ? /*#__PURE__*/React__default.createElement(Explorer, {
|
|
1085
|
+
value: last(router.store.state.currentMatches)?.store.state.loaderData || {},
|
|
1086
|
+
defaultExpanded: Object.keys(last(router.store.state.currentMatches)?.store.state.loaderData || {}).reduce((obj, next) => {
|
|
1149
1087
|
obj[next] = {};
|
|
1150
1088
|
return obj;
|
|
1151
1089
|
}, {})
|
|
@@ -1166,9 +1104,9 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
|
|
|
1166
1104
|
style: {
|
|
1167
1105
|
padding: '.5em'
|
|
1168
1106
|
}
|
|
1169
|
-
}, Object.keys(
|
|
1170
|
-
value:
|
|
1171
|
-
defaultExpanded: Object.keys(
|
|
1107
|
+
}, Object.keys(last(router.store.state.currentMatches)?.store.state.search || {}).length ? /*#__PURE__*/React__default.createElement(Explorer, {
|
|
1108
|
+
value: last(router.store.state.currentMatches)?.store.state.search || {},
|
|
1109
|
+
defaultExpanded: Object.keys(last(router.store.state.currentMatches)?.store.state.search || {}).reduce((obj, next) => {
|
|
1172
1110
|
obj[next] = {};
|
|
1173
1111
|
return obj;
|
|
1174
1112
|
}, {})
|