@tanstack/react-router-devtools 0.0.1-beta.36 → 0.0.1-beta.41

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.
@@ -10,7 +10,7 @@
10
10
  */
11
11
  import * as React from 'react';
12
12
  import React__default from 'react';
13
- import { routerContext, invariant, last } from '@tanstack/react-router';
13
+ import { routerContext, invariant, useRouterStore, last } from '@tanstack/react-router';
14
14
  import { formatDistanceStrict } from 'date-fns';
15
15
 
16
16
  function _extends() {
@@ -27,18 +27,6 @@ function _extends() {
27
27
  };
28
28
  return _extends.apply(this, arguments);
29
29
  }
30
- function _objectWithoutPropertiesLoose(source, excluded) {
31
- if (source == null) return {};
32
- var target = {};
33
- var sourceKeys = Object.keys(source);
34
- var key, i;
35
- for (i = 0; i < sourceKeys.length; i++) {
36
- key = sourceKeys[i];
37
- if (excluded.indexOf(key) >= 0) continue;
38
- target[key] = source[key];
39
- }
40
- return target;
41
- }
42
30
 
43
31
  const getItem = key => {
44
32
  try {
@@ -47,7 +35,7 @@ const getItem = key => {
47
35
  return JSON.parse(itemValue);
48
36
  }
49
37
  return undefined;
50
- } catch (_unused) {
38
+ } catch {
51
39
  return undefined;
52
40
  }
53
41
  };
@@ -69,14 +57,13 @@ function useLocalStorage(key, defaultValue) {
69
57
  }
70
58
  try {
71
59
  localStorage.setItem(key, JSON.stringify(newVal));
72
- } catch (_unused2) {}
60
+ } catch {}
73
61
  return newVal;
74
62
  });
75
63
  }, [key]);
76
64
  return [value, setter];
77
65
  }
78
66
 
79
- const _excluded$3 = ["theme"];
80
67
  const defaultTheme = {
81
68
  background: '#0b1521',
82
69
  backgroundAlt: '#132337',
@@ -93,9 +80,9 @@ const defaultTheme = {
93
80
  const ThemeContext = /*#__PURE__*/React__default.createContext(defaultTheme);
94
81
  function ThemeProvider(_ref) {
95
82
  let {
96
- theme
97
- } = _ref,
98
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$3);
83
+ theme,
84
+ ...rest
85
+ } = _ref;
99
86
  return /*#__PURE__*/React__default.createElement(ThemeContext.Provider, _extends({
100
87
  value: theme
101
88
  }, rest));
@@ -143,10 +130,9 @@ function useMediaQuery(query) {
143
130
  return isMatch;
144
131
  }
145
132
 
146
- const _excluded$2 = ["style"];
147
133
  const isServer$1 = typeof window === 'undefined';
148
134
  function getStatusColor(match, theme) {
149
- return match.isFetching ? theme.active : match.status === 'error' ? theme.danger : match.status === 'success' ? theme.success : theme.gray;
135
+ return match.store.isFetching ? theme.active : match.store.status === 'error' ? theme.danger : match.store.status === 'success' ? theme.success : theme.gray;
150
136
  }
151
137
 
152
138
  // export function getQueryStatusLabel(query: Query) {
@@ -165,19 +151,27 @@ function styled(type, newStyles, queries) {
165
151
  }
166
152
  return /*#__PURE__*/React__default.forwardRef((_ref, ref) => {
167
153
  let {
168
- style
169
- } = _ref,
170
- rest = _objectWithoutPropertiesLoose(_ref, _excluded$2);
154
+ style,
155
+ ...rest
156
+ } = _ref;
171
157
  const theme = useTheme();
172
158
  const mediaStyles = Object.entries(queries).reduce((current, _ref2) => {
173
159
  let [key, value] = _ref2;
174
160
  // eslint-disable-next-line react-hooks/rules-of-hooks
175
- return useMediaQuery(key) ? _extends({}, current, typeof value === 'function' ? value(rest, theme) : value) : current;
161
+ return useMediaQuery(key) ? {
162
+ ...current,
163
+ ...(typeof value === 'function' ? value(rest, theme) : value)
164
+ } : current;
176
165
  }, {});
177
- return /*#__PURE__*/React__default.createElement(type, _extends({}, rest, {
178
- style: _extends({}, typeof newStyles === 'function' ? newStyles(rest, theme) : newStyles, style, mediaStyles),
166
+ return /*#__PURE__*/React__default.createElement(type, {
167
+ ...rest,
168
+ style: {
169
+ ...(typeof newStyles === 'function' ? newStyles(rest, theme) : newStyles),
170
+ ...style,
171
+ ...mediaStyles
172
+ },
179
173
  ref
180
- }));
174
+ });
181
175
  });
182
176
  }
183
177
  function useIsMounted() {
@@ -198,7 +192,7 @@ function useIsMounted() {
198
192
  */
199
193
  const displayValue = value => {
200
194
  const name = Object.getOwnPropertyNames(Object(value));
201
- const newValue = typeof value === 'bigint' ? value.toString() + "n" : value;
195
+ const newValue = typeof value === 'bigint' ? `${value.toString()}n` : value;
202
196
  return JSON.stringify(newValue, name);
203
197
  };
204
198
 
@@ -259,7 +253,7 @@ function multiSortBy(arr, accessors) {
259
253
 
260
254
  const Panel = styled('div', (_props, theme) => ({
261
255
  fontSize: 'clamp(12px, 1.5vw, 14px)',
262
- fontFamily: "sans-serif",
256
+ fontFamily: `sans-serif`,
263
257
  display: 'flex',
264
258
  backgroundColor: theme.background,
265
259
  color: theme.foreground
@@ -281,7 +275,7 @@ const ActivePanel = styled('div', () => ({
281
275
  height: '100%'
282
276
  }), {
283
277
  '(max-width: 700px)': (_props, theme) => ({
284
- borderTop: "2px solid " + theme.gray
278
+ borderTop: `2px solid ${theme.gray}`
285
279
  })
286
280
  });
287
281
  const Button = styled('button', (props, theme) => ({
@@ -320,26 +314,26 @@ styled('input', (_props, theme) => ({
320
314
  borderRadius: '.2em',
321
315
  color: theme.inputTextColor,
322
316
  fontSize: '.9em',
323
- lineHeight: "1.3",
317
+ lineHeight: `1.3`,
324
318
  padding: '.3em .4em'
325
319
  }));
326
320
  styled('select', (_props, theme) => ({
327
- display: "inline-block",
328
- fontSize: ".9em",
329
- fontFamily: "sans-serif",
321
+ display: `inline-block`,
322
+ fontSize: `.9em`,
323
+ fontFamily: `sans-serif`,
330
324
  fontWeight: 'normal',
331
- lineHeight: "1.3",
332
- padding: ".3em 1.5em .3em .5em",
325
+ lineHeight: `1.3`,
326
+ padding: `.3em 1.5em .3em .5em`,
333
327
  height: 'auto',
334
328
  border: 0,
335
- borderRadius: ".2em",
336
- appearance: "none",
329
+ borderRadius: `.2em`,
330
+ appearance: `none`,
337
331
  WebkitAppearance: 'none',
338
332
  backgroundColor: theme.inputBackgroundColor,
339
- 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>\")",
340
- backgroundRepeat: "no-repeat",
341
- backgroundPosition: "right .55em center",
342
- backgroundSize: ".65em auto, 100%",
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%`,
343
337
  color: theme.inputTextColor
344
338
  }), {
345
339
  '(max-width: 500px)': {
@@ -347,7 +341,6 @@ styled('select', (_props, theme) => ({
347
341
  }
348
342
  });
349
343
 
350
- const _excluded$1 = ["value", "defaultExpanded", "renderer", "pageSize"];
351
344
  const Entry = styled('div', {
352
345
  fontFamily: 'Menlo, monospace',
353
346
  fontSize: '.7rem',
@@ -389,11 +382,12 @@ const Expander = _ref => {
389
382
  style = {}
390
383
  } = _ref;
391
384
  return /*#__PURE__*/React.createElement("span", {
392
- style: _extends({
385
+ style: {
393
386
  display: 'inline-block',
394
387
  transition: 'all .1s ease',
395
- transform: "rotate(" + (expanded ? 90 : 0) + "deg) " + (style.transform || '')
396
- }, style)
388
+ transform: `rotate(${expanded ? 90 : 0}deg) ${style.transform || ''}`,
389
+ ...style
390
+ }
397
391
  }, "\u25B6");
398
392
  };
399
393
  /**
@@ -437,7 +431,7 @@ const DefaultRenderer = _ref2 => {
437
431
  onClick: () => toggleExpanded()
438
432
  }, /*#__PURE__*/React.createElement(Expander, {
439
433
  expanded: expanded
440
- }), " ", label, ' ', /*#__PURE__*/React.createElement(Info, null, String(type).toLowerCase() === 'iterable' ? '(Iterable) ' : '', subEntries.length, " ", subEntries.length > 1 ? "items" : "item")), expanded ? subEntryPages.length === 1 ? /*#__PURE__*/React.createElement(SubEntries, null, subEntries.map((entry, index) => handleEntry(entry))) : /*#__PURE__*/React.createElement(SubEntries, null, subEntryPages.map((entries, index) => /*#__PURE__*/React.createElement("div", {
434
+ }), " ", label, ' ', /*#__PURE__*/React.createElement(Info, null, String(type).toLowerCase() === 'iterable' ? '(Iterable) ' : '', subEntries.length, " ", subEntries.length > 1 ? `items` : `item`)), expanded ? subEntryPages.length === 1 ? /*#__PURE__*/React.createElement(SubEntries, null, subEntries.map((entry, index) => handleEntry(entry))) : /*#__PURE__*/React.createElement(SubEntries, null, subEntryPages.map((entries, index) => /*#__PURE__*/React.createElement("div", {
441
435
  key: index
442
436
  }, /*#__PURE__*/React.createElement(Entry, null, /*#__PURE__*/React.createElement(LabelButton, {
443
437
  onClick: () => setExpandedPages(old => old.includes(index) ? old.filter(d => d !== index) : [...old, index])
@@ -462,12 +456,12 @@ function isIterable(x) {
462
456
  }
463
457
  function Explorer(_ref3) {
464
458
  let {
465
- value,
466
- defaultExpanded,
467
- renderer = DefaultRenderer,
468
- pageSize = 100
469
- } = _ref3,
470
- rest = _objectWithoutPropertiesLoose(_ref3, _excluded$1);
459
+ value,
460
+ defaultExpanded,
461
+ renderer = DefaultRenderer,
462
+ pageSize = 100,
463
+ ...rest
464
+ } = _ref3;
471
465
  const [expanded, setExpanded] = React.useState(Boolean(defaultExpanded));
472
466
  const toggleExpanded = React.useCallback(() => setExpanded(old => !old), []);
473
467
  let type = typeof value;
@@ -476,9 +470,10 @@ function Explorer(_ref3) {
476
470
  const subDefaultExpanded = defaultExpanded === true ? {
477
471
  [sub.label]: true
478
472
  } : defaultExpanded == null ? void 0 : defaultExpanded[sub.label];
479
- return _extends({}, sub, {
473
+ return {
474
+ ...sub,
480
475
  defaultExpanded: subDefaultExpanded
481
- });
476
+ };
482
477
  };
483
478
  if (Array.isArray(value)) {
484
479
  type = 'array';
@@ -503,7 +498,7 @@ function Explorer(_ref3) {
503
498
  });
504
499
  }
505
500
  const subEntryPages = chunkArray(subEntries, pageSize);
506
- return renderer(_extends({
501
+ return renderer({
507
502
  handleEntry: entry => /*#__PURE__*/React.createElement(Explorer, _extends({
508
503
  key: entry.label,
509
504
  value: value,
@@ -515,26 +510,23 @@ function Explorer(_ref3) {
515
510
  value,
516
511
  expanded,
517
512
  toggleExpanded,
518
- pageSize
519
- }, rest));
513
+ pageSize,
514
+ ...rest
515
+ });
520
516
  }
521
517
 
522
- const _excluded = ["style"],
523
- _excluded2 = ["style", "onClick"],
524
- _excluded3 = ["style", "onClick"],
525
- _excluded4 = ["isOpen", "setIsOpen", "handleDragStart", "router"];
526
518
  const isServer = typeof window === 'undefined';
527
519
  function Logo(props) {
528
- var _props$style;
529
520
  return /*#__PURE__*/React__default.createElement("div", _extends({}, props, {
530
- style: _extends({}, (_props$style = props.style) != null ? _props$style : {}, {
521
+ style: {
522
+ ...(props.style ?? {}),
531
523
  display: 'flex',
532
524
  alignItems: 'center',
533
525
  flexDirection: 'column',
534
526
  fontSize: '0.8rem',
535
527
  fontWeight: 'bolder',
536
528
  lineHeight: '1'
537
- })
529
+ }
538
530
  }), /*#__PURE__*/React__default.createElement("div", {
539
531
  style: {
540
532
  letterSpacing: '-0.05rem'
@@ -570,13 +562,12 @@ function TanStackRouterDevtools(_ref) {
570
562
  const [isResolvedOpen, setIsResolvedOpen] = useSafeState(false);
571
563
  const [isResizing, setIsResizing] = useSafeState(false);
572
564
  const isMounted = useIsMounted();
573
- const _handleDragStart = (panelElement, startEvent) => {
574
- var _panelElement$getBoun;
565
+ const handleDragStart = (panelElement, startEvent) => {
575
566
  if (startEvent.button !== 0) return; // Only allow left click for drag
576
567
 
577
568
  setIsResizing(true);
578
569
  const dragInfo = {
579
- originalHeight: (_panelElement$getBoun = panelElement == null ? void 0 : panelElement.getBoundingClientRect().height) != null ? _panelElement$getBoun : 0,
570
+ originalHeight: (panelElement == null ? void 0 : panelElement.getBoundingClientRect().height) ?? 0,
580
571
  pageY: startEvent.pageY
581
572
  };
582
573
  const run = moveEvent => {
@@ -598,7 +589,7 @@ function TanStackRouterDevtools(_ref) {
598
589
  document.addEventListener('mouseup', unsub);
599
590
  };
600
591
  React__default.useEffect(() => {
601
- setIsResolvedOpen(isOpen != null ? isOpen : false);
592
+ setIsResolvedOpen(isOpen ?? false);
602
593
  }, [isOpen, isResolvedOpen, setIsResolvedOpen]);
603
594
 
604
595
  // Toggle panel visibility before/after transition (depending on direction).
@@ -633,7 +624,7 @@ function TanStackRouterDevtools(_ref) {
633
624
  var _panelRef$current, _rootRef$current2;
634
625
  const containerHeight = (_panelRef$current = panelRef.current) == null ? void 0 : _panelRef$current.getBoundingClientRect().height;
635
626
  if ((_rootRef$current2 = rootRef.current) != null && _rootRef$current2.parentElement) {
636
- rootRef.current.parentElement.style.paddingBottom = containerHeight + "px";
627
+ rootRef.current.parentElement.style.paddingBottom = `${containerHeight}px`;
637
628
  }
638
629
  };
639
630
  run();
@@ -651,19 +642,19 @@ function TanStackRouterDevtools(_ref) {
651
642
  return;
652
643
  }, [isResolvedOpen]);
653
644
  const {
654
- style: panelStyle = {}
655
- } = panelProps,
656
- otherPanelProps = _objectWithoutPropertiesLoose(panelProps, _excluded);
645
+ style: panelStyle = {},
646
+ ...otherPanelProps
647
+ } = panelProps;
657
648
  const {
658
- style: closeButtonStyle = {},
659
- onClick: onCloseClick
660
- } = closeButtonProps,
661
- otherCloseButtonProps = _objectWithoutPropertiesLoose(closeButtonProps, _excluded2);
649
+ style: closeButtonStyle = {},
650
+ onClick: onCloseClick,
651
+ ...otherCloseButtonProps
652
+ } = closeButtonProps;
662
653
  const {
663
- style: toggleButtonStyle = {},
664
- onClick: onToggleClick
665
- } = toggleButtonProps,
666
- otherToggleButtonProps = _objectWithoutPropertiesLoose(toggleButtonProps, _excluded3);
654
+ style: toggleButtonStyle = {},
655
+ onClick: onToggleClick,
656
+ ...otherToggleButtonProps
657
+ } = toggleButtonProps;
667
658
 
668
659
  // Do not render on the server
669
660
  if (!isMounted()) return null;
@@ -676,35 +667,38 @@ function TanStackRouterDevtools(_ref) {
676
667
  ref: panelRef
677
668
  }, otherPanelProps, {
678
669
  router: router,
679
- style: _extends({
670
+ style: {
680
671
  position: 'fixed',
681
672
  bottom: '0',
682
673
  right: '0',
683
674
  zIndex: 99999,
684
675
  width: '100%',
685
- height: devtoolsHeight != null ? devtoolsHeight : 500,
676
+ height: devtoolsHeight ?? 500,
686
677
  maxHeight: '90%',
687
678
  boxShadow: '0 0 20px rgba(0,0,0,.3)',
688
- borderTop: "1px solid " + defaultTheme.gray,
679
+ borderTop: `1px solid ${defaultTheme.gray}`,
689
680
  transformOrigin: 'top',
690
681
  // visibility will be toggled after transitions, but set initial state here
691
- visibility: isOpen ? 'visible' : 'hidden'
692
- }, panelStyle, isResizing ? {
693
- transition: "none"
694
- } : {
695
- transition: "all .2s ease"
696
- }, isResolvedOpen ? {
697
- opacity: 1,
698
- pointerEvents: 'all',
699
- transform: "translateY(0) scale(1)"
700
- } : {
701
- opacity: 0,
702
- pointerEvents: 'none',
703
- transform: "translateY(15px) scale(1.02)"
704
- }),
682
+ visibility: isOpen ? 'visible' : 'hidden',
683
+ ...panelStyle,
684
+ ...(isResizing ? {
685
+ transition: `none`
686
+ } : {
687
+ transition: `all .2s ease`
688
+ }),
689
+ ...(isResolvedOpen ? {
690
+ opacity: 1,
691
+ pointerEvents: 'all',
692
+ transform: `translateY(0) scale(1)`
693
+ } : {
694
+ opacity: 0,
695
+ pointerEvents: 'none',
696
+ transform: `translateY(15px) scale(1.02)`
697
+ })
698
+ },
705
699
  isOpen: isResolvedOpen,
706
700
  setIsOpen: setIsOpen,
707
- handleDragStart: e => _handleDragStart(panelRef.current, e)
701
+ handleDragStart: e => handleDragStart(panelRef.current, e)
708
702
  })), isResolvedOpen ? /*#__PURE__*/React__default.createElement(Button, _extends({
709
703
  type: "button",
710
704
  "aria-label": "Close TanStack Router Devtools"
@@ -713,20 +707,22 @@ function TanStackRouterDevtools(_ref) {
713
707
  setIsOpen(false);
714
708
  onCloseClick && onCloseClick(e);
715
709
  },
716
- style: _extends({
710
+ style: {
717
711
  position: 'fixed',
718
712
  zIndex: 99999,
719
713
  margin: '.5em',
720
- bottom: 0
721
- }, position === 'top-right' ? {
722
- right: '0'
723
- } : position === 'top-left' ? {
724
- left: '0'
725
- } : position === 'bottom-right' ? {
726
- right: '0'
727
- } : {
728
- left: '0'
729
- }, closeButtonStyle)
714
+ bottom: 0,
715
+ ...(position === 'top-right' ? {
716
+ right: '0'
717
+ } : position === 'top-left' ? {
718
+ left: '0'
719
+ } : position === 'bottom-right' ? {
720
+ right: '0'
721
+ } : {
722
+ left: '0'
723
+ }),
724
+ ...closeButtonStyle
725
+ }
730
726
  }), "Close") : null), !isResolvedOpen ? /*#__PURE__*/React__default.createElement("button", _extends({
731
727
  type: "button"
732
728
  }, otherToggleButtonProps, {
@@ -735,7 +731,7 @@ function TanStackRouterDevtools(_ref) {
735
731
  setIsOpen(true);
736
732
  onToggleClick && onToggleClick(e);
737
733
  },
738
- style: _extends({
734
+ style: {
739
735
  appearance: 'none',
740
736
  background: 'none',
741
737
  border: 0,
@@ -746,56 +742,49 @@ function TanStackRouterDevtools(_ref) {
746
742
  fontSize: '1.5em',
747
743
  margin: '.5em',
748
744
  cursor: 'pointer',
749
- width: 'fit-content'
750
- }, position === 'top-right' ? {
751
- top: '0',
752
- right: '0'
753
- } : position === 'top-left' ? {
754
- top: '0',
755
- left: '0'
756
- } : position === 'bottom-right' ? {
757
- bottom: '0',
758
- right: '0'
759
- } : {
760
- bottom: '0',
761
- left: '0'
762
- }, toggleButtonStyle)
745
+ width: 'fit-content',
746
+ ...(position === 'top-right' ? {
747
+ top: '0',
748
+ right: '0'
749
+ } : position === 'top-left' ? {
750
+ top: '0',
751
+ left: '0'
752
+ } : position === 'bottom-right' ? {
753
+ bottom: '0',
754
+ right: '0'
755
+ } : {
756
+ bottom: '0',
757
+ left: '0'
758
+ }),
759
+ ...toggleButtonStyle
760
+ }
763
761
  }), /*#__PURE__*/React__default.createElement(Logo, {
764
762
  "aria-hidden": true
765
763
  })) : null);
766
764
  }
767
765
  const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(function TanStackRouterDevtoolsPanel(props, ref) {
768
- var _Object$values$find$m, _Object$values, _Object$values$find, _router$state$current, _router$state$pending, _router$state$pending2, _last, _last2, _last3, _last4, _last5, _last6;
766
+ var _Object$values, _Object$values$find, _router$store$current, _router$store$pending, _router$store$pending2, _last, _last2, _last3, _last4, _last5, _last6;
769
767
  const {
770
- isOpen = true,
771
- handleDragStart,
772
- router: userRouter
773
- } = props,
774
- panelProps = _objectWithoutPropertiesLoose(props, _excluded4);
768
+ isOpen = true,
769
+ setIsOpen,
770
+ handleDragStart,
771
+ router: userRouter,
772
+ ...panelProps
773
+ } = props;
775
774
  const routerContextValue = React__default.useContext(routerContext);
776
- const router = userRouter != null ? userRouter : routerContextValue == null ? void 0 : routerContextValue.router;
775
+ const router = userRouter ?? (routerContextValue == null ? void 0 : routerContextValue.router);
777
776
  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.');
778
- const rerender = React__default.useReducer(() => ({}), {})[1];
779
- React__default.useEffect(() => {
780
- let interval = setInterval(() => {
781
- router.cleanMatchCache();
782
- // router.notify()
783
- rerender();
784
- }, 250);
785
- return () => {
786
- clearInterval(interval);
787
- };
788
- }, []);
777
+ useRouterStore();
789
778
  const [activeRouteId, setActiveRouteId] = useLocalStorage('tanstackRouterDevtoolsActiveRouteId', '');
790
779
  const [activeMatchId, setActiveMatchId] = useLocalStorage('tanstackRouterDevtoolsActiveMatchId', '');
791
780
  React__default.useEffect(() => {
792
781
  setActiveMatchId('');
793
782
  }, [activeRouteId]);
794
- const activeMatch = (_Object$values$find$m = (_Object$values = Object.values(router.matchCache)) == null ? void 0 : (_Object$values$find = _Object$values.find(d => d.match.matchId === activeMatchId)) == null ? void 0 : _Object$values$find.match) != null ? _Object$values$find$m : (_router$state$current = router.state.currentMatches) == null ? void 0 : _router$state$current.find(d => d.routeId === activeRouteId);
795
- const matchCacheValues = multiSortBy(Object.keys(router.matchCache).filter(key => {
796
- const cacheEntry = router.matchCache[key];
783
+ const activeMatch = ((_Object$values = Object.values(router.store.matchCache)) == null ? void 0 : (_Object$values$find = _Object$values.find(d => d.match.matchId === activeMatchId)) == null ? void 0 : _Object$values$find.match) ?? ((_router$store$current = router.store.currentMatches) == null ? void 0 : _router$store$current.find(d => d.routeId === activeRouteId));
784
+ const matchCacheValues = multiSortBy(Object.keys(router.store.matchCache).filter(key => {
785
+ const cacheEntry = router.store.matchCache[key];
797
786
  return cacheEntry.gc > Date.now();
798
- }).map(key => router.matchCache[key]), [d => d.match.isFetching ? -1 : 1, d => -d.match.updatedAt]);
787
+ }).map(key => router.store.matchCache[key]), [d => d.match.store.isFetching ? -1 : 1, d => -d.match.store.updatedAt]);
799
788
  return /*#__PURE__*/React__default.createElement(ThemeProvider, {
800
789
  theme: defaultTheme
801
790
  }, /*#__PURE__*/React__default.createElement(Panel, _extends({
@@ -803,7 +792,49 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
803
792
  className: "TanStackRouterDevtoolsPanel"
804
793
  }, panelProps), /*#__PURE__*/React__default.createElement("style", {
805
794
  dangerouslySetInnerHTML: {
806
- __html: "\n\n .TanStackRouterDevtoolsPanel * {\n scrollbar-color: " + defaultTheme.backgroundAlt + " " + defaultTheme.gray + ";\n }\n\n .TanStackRouterDevtoolsPanel *::-webkit-scrollbar, .TanStackRouterDevtoolsPanel scrollbar {\n width: 1em;\n height: 1em;\n }\n\n .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-track, .TanStackRouterDevtoolsPanel scrollbar-track {\n background: " + defaultTheme.backgroundAlt + ";\n }\n\n .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-thumb, .TanStackRouterDevtoolsPanel scrollbar-thumb {\n background: " + defaultTheme.gray + ";\n border-radius: .5em;\n border: 3px solid " + defaultTheme.backgroundAlt + ";\n }\n\n .TanStackRouterDevtoolsPanel table {\n width: 100%;\n }\n\n .TanStackRouterDevtoolsPanel table tr {\n border-bottom: 2px dotted rgba(255, 255, 255, .2);\n }\n\n .TanStackRouterDevtoolsPanel table tr:last-child {\n border-bottom: none\n }\n\n .TanStackRouterDevtoolsPanel table td {\n padding: .25rem .5rem;\n border-right: 2px dotted rgba(255, 255, 255, .05);\n }\n\n .TanStackRouterDevtoolsPanel table td:last-child {\n border-right: none\n }\n\n "
795
+ __html: `
796
+
797
+ .TanStackRouterDevtoolsPanel * {
798
+ scrollbar-color: ${defaultTheme.backgroundAlt} ${defaultTheme.gray};
799
+ }
800
+
801
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar, .TanStackRouterDevtoolsPanel scrollbar {
802
+ width: 1em;
803
+ height: 1em;
804
+ }
805
+
806
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-track, .TanStackRouterDevtoolsPanel scrollbar-track {
807
+ background: ${defaultTheme.backgroundAlt};
808
+ }
809
+
810
+ .TanStackRouterDevtoolsPanel *::-webkit-scrollbar-thumb, .TanStackRouterDevtoolsPanel scrollbar-thumb {
811
+ background: ${defaultTheme.gray};
812
+ border-radius: .5em;
813
+ border: 3px solid ${defaultTheme.backgroundAlt};
814
+ }
815
+
816
+ .TanStackRouterDevtoolsPanel table {
817
+ width: 100%;
818
+ }
819
+
820
+ .TanStackRouterDevtoolsPanel table tr {
821
+ border-bottom: 2px dotted rgba(255, 255, 255, .2);
822
+ }
823
+
824
+ .TanStackRouterDevtoolsPanel table tr:last-child {
825
+ border-bottom: none
826
+ }
827
+
828
+ .TanStackRouterDevtoolsPanel table td {
829
+ padding: .25rem .5rem;
830
+ border-right: 2px dotted rgba(255, 255, 255, .05);
831
+ }
832
+
833
+ .TanStackRouterDevtoolsPanel table td:last-child {
834
+ border-right: none
835
+ }
836
+
837
+ `
807
838
  }
808
839
  }), /*#__PURE__*/React__default.createElement("div", {
809
840
  style: {
@@ -823,7 +854,7 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
823
854
  minHeight: '40%',
824
855
  maxHeight: '100%',
825
856
  overflow: 'auto',
826
- borderRight: "1px solid " + defaultTheme.grayAlt,
857
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
827
858
  display: 'flex',
828
859
  flexDirection: 'column'
829
860
  }
@@ -866,7 +897,7 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
866
897
  minHeight: '40%',
867
898
  maxHeight: '100%',
868
899
  overflow: 'auto',
869
- borderRight: "1px solid " + defaultTheme.grayAlt,
900
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
870
901
  display: 'flex',
871
902
  flexDirection: 'column'
872
903
  }
@@ -878,15 +909,15 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
878
909
  top: 0,
879
910
  zIndex: 1
880
911
  }
881
- }, "Active Matches"), router.state.currentMatches.map((match, i) => {
912
+ }, "Active Matches"), router.store.currentMatches.map((match, i) => {
882
913
  return /*#__PURE__*/React__default.createElement("div", {
883
914
  key: match.routeId || i,
884
915
  role: "button",
885
- "aria-label": "Open match details for " + match.routeId,
916
+ "aria-label": `Open match details for ${match.routeId}`,
886
917
  onClick: () => setActiveRouteId(activeRouteId === match.routeId ? '' : match.routeId),
887
918
  style: {
888
919
  display: 'flex',
889
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
920
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
890
921
  cursor: 'pointer',
891
922
  alignItems: 'center',
892
923
  background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
@@ -908,8 +939,8 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
908
939
  style: {
909
940
  padding: '.5em'
910
941
  }
911
- }, "" + match.matchId));
912
- }), (_router$state$pending = router.state.pendingMatches) != null && _router$state$pending.length ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
942
+ }, `${match.matchId}`));
943
+ }), (_router$store$pending = router.store.pendingMatches) != null && _router$store$pending.length ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
913
944
  style: {
914
945
  marginTop: '2rem',
915
946
  padding: '.5em',
@@ -918,15 +949,15 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
918
949
  top: 0,
919
950
  zIndex: 1
920
951
  }
921
- }, "Pending Matches"), (_router$state$pending2 = router.state.pendingMatches) == null ? void 0 : _router$state$pending2.map((match, i) => {
952
+ }, "Pending Matches"), (_router$store$pending2 = router.store.pendingMatches) == null ? void 0 : _router$store$pending2.map((match, i) => {
922
953
  return /*#__PURE__*/React__default.createElement("div", {
923
954
  key: match.routeId || i,
924
955
  role: "button",
925
- "aria-label": "Open match details for " + match.routeId,
956
+ "aria-label": `Open match details for ${match.routeId}`,
926
957
  onClick: () => setActiveRouteId(activeRouteId === match.routeId ? '' : match.routeId),
927
958
  style: {
928
959
  display: 'flex',
929
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
960
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
930
961
  cursor: 'pointer',
931
962
  background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
932
963
  }
@@ -947,7 +978,7 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
947
978
  style: {
948
979
  padding: '.5em'
949
980
  }
950
- }, "" + match.matchId));
981
+ }, `${match.matchId}`));
951
982
  })) : null, matchCacheValues.length ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
952
983
  style: {
953
984
  marginTop: '2rem',
@@ -963,8 +994,7 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
963
994
  }
964
995
  }, /*#__PURE__*/React__default.createElement("div", null, "Match Cache"), /*#__PURE__*/React__default.createElement(Button, {
965
996
  onClick: () => {
966
- router.matchCache = {};
967
- router.notify();
997
+ router.setStore(s => s.matchCache = {});
968
998
  }
969
999
  }, "Clear")), matchCacheValues.map((d, i) => {
970
1000
  const {
@@ -974,11 +1004,11 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
974
1004
  return /*#__PURE__*/React__default.createElement("div", {
975
1005
  key: match.matchId || i,
976
1006
  role: "button",
977
- "aria-label": "Open match details for " + match.matchId,
1007
+ "aria-label": `Open match details for ${match.matchId}`,
978
1008
  onClick: () => setActiveMatchId(activeMatchId === match.matchId ? '' : match.matchId),
979
1009
  style: {
980
1010
  display: 'flex',
981
- borderBottom: "solid 1px " + defaultTheme.grayAlt,
1011
+ borderBottom: `solid 1px ${defaultTheme.grayAlt}`,
982
1012
  cursor: 'pointer',
983
1013
  background: match === activeMatch ? 'rgba(255,255,255,.1)' : undefined
984
1014
  }
@@ -1007,7 +1037,7 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1007
1037
  borderRadius: '.25rem',
1008
1038
  transition: 'all .2s ease-out'
1009
1039
  }
1010
- }), /*#__PURE__*/React__default.createElement(Code, null, "" + match.matchId)), /*#__PURE__*/React__default.createElement("span", {
1040
+ }), /*#__PURE__*/React__default.createElement(Code, null, `${match.matchId}`)), /*#__PURE__*/React__default.createElement("span", {
1011
1041
  style: {
1012
1042
  fontSize: '.7rem',
1013
1043
  opacity: '.5',
@@ -1037,15 +1067,15 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1037
1067
  style: {
1038
1068
  opacity: '.5'
1039
1069
  }
1040
- }, "Status"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.status)), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
1070
+ }, "Status"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.store.status)), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
1041
1071
  style: {
1042
1072
  opacity: '.5'
1043
1073
  }
1044
- }, "Invalid"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.isInvalid.toString())), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
1074
+ }, "Invalid"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.store.isInvalid.toString())), /*#__PURE__*/React__default.createElement("tr", null, /*#__PURE__*/React__default.createElement("td", {
1045
1075
  style: {
1046
1076
  opacity: '.5'
1047
1077
  }
1048
- }, "Last Updated"), /*#__PURE__*/React__default.createElement("td", null, activeMatch.updatedAt ? new Date(activeMatch.updatedAt).toLocaleTimeString() : 'N/A'))))), /*#__PURE__*/React__default.createElement("div", {
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", {
1049
1079
  style: {
1050
1080
  background: defaultTheme.backgroundAlt,
1051
1081
  padding: '.5em',
@@ -1062,7 +1092,6 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1062
1092
  type: "button",
1063
1093
  onClick: () => {
1064
1094
  activeMatch.invalidate();
1065
- router.notify();
1066
1095
  },
1067
1096
  style: {
1068
1097
  background: defaultTheme.warning,
@@ -1097,7 +1126,7 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1097
1126
  minHeight: '40%',
1098
1127
  maxHeight: '100%',
1099
1128
  overflow: 'auto',
1100
- borderRight: "1px solid " + defaultTheme.grayAlt,
1129
+ borderRight: `1px solid ${defaultTheme.grayAlt}`,
1101
1130
  display: 'flex',
1102
1131
  flexDirection: 'column'
1103
1132
  }
@@ -1114,9 +1143,9 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1114
1143
  style: {
1115
1144
  padding: '.5em'
1116
1145
  }
1117
- }, Object.keys(((_last = last(router.state.currentMatches)) == null ? void 0 : _last.loaderData) || {}).length ? /*#__PURE__*/React__default.createElement(Explorer, {
1118
- value: ((_last2 = last(router.state.currentMatches)) == null ? void 0 : _last2.loaderData) || {},
1119
- defaultExpanded: Object.keys(((_last3 = last(router.state.currentMatches)) == null ? void 0 : _last3.loaderData) || {}).reduce((obj, next) => {
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) => {
1120
1149
  obj[next] = {};
1121
1150
  return obj;
1122
1151
  }, {})
@@ -1137,9 +1166,9 @@ const TanStackRouterDevtoolsPanel = /*#__PURE__*/React__default.forwardRef(funct
1137
1166
  style: {
1138
1167
  padding: '.5em'
1139
1168
  }
1140
- }, Object.keys(((_last4 = last(router.state.currentMatches)) == null ? void 0 : _last4.search) || {}).length ? /*#__PURE__*/React__default.createElement(Explorer, {
1141
- value: ((_last5 = last(router.state.currentMatches)) == null ? void 0 : _last5.search) || {},
1142
- defaultExpanded: Object.keys(((_last6 = last(router.state.currentMatches)) == null ? void 0 : _last6.search) || {}).reduce((obj, next) => {
1169
+ }, Object.keys(((_last4 = last(router.store.currentMatches)) == null ? void 0 : _last4.store.search) || {}).length ? /*#__PURE__*/React__default.createElement(Explorer, {
1170
+ value: ((_last5 = last(router.store.currentMatches)) == null ? void 0 : _last5.store.search) || {},
1171
+ defaultExpanded: Object.keys(((_last6 = last(router.store.currentMatches)) == null ? void 0 : _last6.store.search) || {}).reduce((obj, next) => {
1143
1172
  obj[next] = {};
1144
1173
  return obj;
1145
1174
  }, {})