@tanstack/router-devtools-core 1.132.47 → 1.132.51

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.
Files changed (79) hide show
  1. package/dist/BaseTanStackRouterDevtoolsPanel-CaAQWNvS.js +1817 -0
  2. package/dist/BaseTanStackRouterDevtoolsPanel-CaAQWNvS.js.map +1 -0
  3. package/dist/BaseTanStackRouterDevtoolsPanel-CbH9Ihs_.cjs +1833 -0
  4. package/dist/BaseTanStackRouterDevtoolsPanel-CbH9Ihs_.cjs.map +1 -0
  5. package/dist/FloatingTanStackRouterDevtools-0xtXUOcx.cjs +283 -0
  6. package/dist/FloatingTanStackRouterDevtools-0xtXUOcx.cjs.map +1 -0
  7. package/dist/FloatingTanStackRouterDevtools-DdHNTjWg.js +283 -0
  8. package/dist/FloatingTanStackRouterDevtools-DdHNTjWg.js.map +1 -0
  9. package/dist/cjs/index.cjs +6 -0
  10. package/dist/cjs/{packages/router-devtools-core/src/index.cjs.map → index.cjs.map} +1 -1
  11. package/dist/esm/index.js +6 -0
  12. package/dist/esm/{packages/router-devtools-core/src/index.js.map → index.js.map} +1 -1
  13. package/dist/index-BiZF0hsR.js +222 -0
  14. package/dist/index-BiZF0hsR.js.map +1 -0
  15. package/dist/index-CHaaetqh.cjs +221 -0
  16. package/dist/index-CHaaetqh.cjs.map +1 -0
  17. package/package.json +6 -5
  18. package/dist/cjs/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.cjs +0 -792
  19. package/dist/cjs/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.cjs.map +0 -1
  20. package/dist/cjs/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.cjs +0 -675
  21. package/dist/cjs/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.cjs.map +0 -1
  22. package/dist/cjs/packages/router-devtools-core/src/AgeTicker.cjs +0 -48
  23. package/dist/cjs/packages/router-devtools-core/src/AgeTicker.cjs.map +0 -1
  24. package/dist/cjs/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.cjs +0 -604
  25. package/dist/cjs/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.cjs.map +0 -1
  26. package/dist/cjs/packages/router-devtools-core/src/Explorer.cjs +0 -307
  27. package/dist/cjs/packages/router-devtools-core/src/Explorer.cjs.map +0 -1
  28. package/dist/cjs/packages/router-devtools-core/src/FloatingTanStackRouterDevtools.cjs +0 -201
  29. package/dist/cjs/packages/router-devtools-core/src/FloatingTanStackRouterDevtools.cjs.map +0 -1
  30. package/dist/cjs/packages/router-devtools-core/src/NavigateButton.cjs +0 -31
  31. package/dist/cjs/packages/router-devtools-core/src/NavigateButton.cjs.map +0 -1
  32. package/dist/cjs/packages/router-devtools-core/src/TanStackRouterDevtoolsCore.cjs +0 -100
  33. package/dist/cjs/packages/router-devtools-core/src/TanStackRouterDevtoolsCore.cjs.map +0 -1
  34. package/dist/cjs/packages/router-devtools-core/src/TanStackRouterDevtoolsPanelCore.cjs +0 -113
  35. package/dist/cjs/packages/router-devtools-core/src/TanStackRouterDevtoolsPanelCore.cjs.map +0 -1
  36. package/dist/cjs/packages/router-devtools-core/src/context.cjs +0 -20
  37. package/dist/cjs/packages/router-devtools-core/src/context.cjs.map +0 -1
  38. package/dist/cjs/packages/router-devtools-core/src/index.cjs +0 -7
  39. package/dist/cjs/packages/router-devtools-core/src/logo.cjs +0 -92
  40. package/dist/cjs/packages/router-devtools-core/src/logo.cjs.map +0 -1
  41. package/dist/cjs/packages/router-devtools-core/src/tokens.cjs +0 -201
  42. package/dist/cjs/packages/router-devtools-core/src/tokens.cjs.map +0 -1
  43. package/dist/cjs/packages/router-devtools-core/src/useLocalStorage.cjs +0 -42
  44. package/dist/cjs/packages/router-devtools-core/src/useLocalStorage.cjs.map +0 -1
  45. package/dist/cjs/packages/router-devtools-core/src/useStyles.cjs +0 -607
  46. package/dist/cjs/packages/router-devtools-core/src/useStyles.cjs.map +0 -1
  47. package/dist/cjs/packages/router-devtools-core/src/utils.cjs +0 -62
  48. package/dist/cjs/packages/router-devtools-core/src/utils.cjs.map +0 -1
  49. package/dist/esm/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js +0 -792
  50. package/dist/esm/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js.map +0 -1
  51. package/dist/esm/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.js +0 -676
  52. package/dist/esm/node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.js.map +0 -1
  53. package/dist/esm/packages/router-devtools-core/src/AgeTicker.js +0 -48
  54. package/dist/esm/packages/router-devtools-core/src/AgeTicker.js.map +0 -1
  55. package/dist/esm/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.js +0 -604
  56. package/dist/esm/packages/router-devtools-core/src/BaseTanStackRouterDevtoolsPanel.js.map +0 -1
  57. package/dist/esm/packages/router-devtools-core/src/Explorer.js +0 -290
  58. package/dist/esm/packages/router-devtools-core/src/Explorer.js.map +0 -1
  59. package/dist/esm/packages/router-devtools-core/src/FloatingTanStackRouterDevtools.js +0 -201
  60. package/dist/esm/packages/router-devtools-core/src/FloatingTanStackRouterDevtools.js.map +0 -1
  61. package/dist/esm/packages/router-devtools-core/src/NavigateButton.js +0 -31
  62. package/dist/esm/packages/router-devtools-core/src/NavigateButton.js.map +0 -1
  63. package/dist/esm/packages/router-devtools-core/src/TanStackRouterDevtoolsCore.js +0 -100
  64. package/dist/esm/packages/router-devtools-core/src/TanStackRouterDevtoolsCore.js.map +0 -1
  65. package/dist/esm/packages/router-devtools-core/src/TanStackRouterDevtoolsPanelCore.js +0 -113
  66. package/dist/esm/packages/router-devtools-core/src/TanStackRouterDevtoolsPanelCore.js.map +0 -1
  67. package/dist/esm/packages/router-devtools-core/src/context.js +0 -20
  68. package/dist/esm/packages/router-devtools-core/src/context.js.map +0 -1
  69. package/dist/esm/packages/router-devtools-core/src/index.js +0 -7
  70. package/dist/esm/packages/router-devtools-core/src/logo.js +0 -92
  71. package/dist/esm/packages/router-devtools-core/src/logo.js.map +0 -1
  72. package/dist/esm/packages/router-devtools-core/src/tokens.js +0 -201
  73. package/dist/esm/packages/router-devtools-core/src/tokens.js.map +0 -1
  74. package/dist/esm/packages/router-devtools-core/src/useLocalStorage.js +0 -43
  75. package/dist/esm/packages/router-devtools-core/src/useLocalStorage.js.map +0 -1
  76. package/dist/esm/packages/router-devtools-core/src/useStyles.js +0 -590
  77. package/dist/esm/packages/router-devtools-core/src/useStyles.js.map +0 -1
  78. package/dist/esm/packages/router-devtools-core/src/utils.js +0 -62
  79. package/dist/esm/packages/router-devtools-core/src/utils.js.map +0 -1
@@ -1,604 +0,0 @@
1
- import { template, spread, insert, addEventListener, className, setAttribute, delegateEvents } from "../../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/web/dist/web.js";
2
- import { clsx } from "clsx";
3
- import invariant from "tiny-invariant";
4
- import { rootRouteId, trimPath, interpolatePath } from "@tanstack/router-core";
5
- import { createMemo, mergeProps, createRenderEffect, createComponent, createSignal, onCleanup, Show } from "../../../node_modules/.pnpm/solid-js@1.9.5/node_modules/solid-js/dist/solid.js";
6
- import { useDevtoolsOnClose } from "./context.js";
7
- import { useStyles } from "./useStyles.js";
8
- import useLocalStorage from "./useLocalStorage.js";
9
- import { Explorer } from "./Explorer.js";
10
- import { multiSortBy, getStatusColor, getRouteStatusColor } from "./utils.js";
11
- import { AgeTicker } from "./AgeTicker.js";
12
- import { NavigateButton } from "./NavigateButton.js";
13
- var _tmpl$ = /* @__PURE__ */ template(`<button><div>TANSTACK</div><div>TanStack Router v1`), _tmpl$2 = /* @__PURE__ */ template(`<div><div>`), _tmpl$3 = /* @__PURE__ */ template(`<code> `), _tmpl$4 = /* @__PURE__ */ template(`<code>`), _tmpl$5 = /* @__PURE__ */ template(`<div><div role=button><div>`), _tmpl$6 = /* @__PURE__ */ template(`<div>`), _tmpl$7 = /* @__PURE__ */ template(`<div><button><svg xmlns=http://www.w3.org/2000/svg width=10 height=6 fill=none viewBox="0 0 10 6"><path stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=1.667 d="M1 1l4 4 4-4"></path></svg></button><div><div></div><div><div></div></div></div><div><div><div><span>Pathname</span></div><div><code></code></div><div><div><button type=button>Routes</button><button type=button>Matches</button></div><div><div>age / staleTime / gcTime</div></div></div><div>`), _tmpl$8 = /* @__PURE__ */ template(`<div><span>masked`), _tmpl$9 = /* @__PURE__ */ template(`<div role=button><div>`), _tmpl$0 = /* @__PURE__ */ template(`<div><div><div>Cached Matches</div><div>age / staleTime / gcTime</div></div><div>`), _tmpl$1 = /* @__PURE__ */ template(`<div><div>Match Details</div><div><div><div><div></div></div><div><div>ID:</div><div><code></code></div></div><div><div>State:</div><div></div></div><div><div>Last Updated:</div><div></div></div></div></div><div>Explorer</div><div>`), _tmpl$10 = /* @__PURE__ */ template(`<div>Loader Data`), _tmpl$11 = /* @__PURE__ */ template(`<div><div><span>Search Params</span></div><div>`), _tmpl$12 = /* @__PURE__ */ template(`<span style=margin-left:0.5rem;>`), _tmpl$13 = /* @__PURE__ */ template(`<button type=button style=cursor:pointer; aria-label="Copy value to clipboard">`);
14
- function Logo(props) {
15
- const {
16
- className: className$1,
17
- ...rest
18
- } = props;
19
- const styles = useStyles();
20
- return (() => {
21
- var _el$ = _tmpl$(), _el$2 = _el$.firstChild, _el$3 = _el$2.nextSibling;
22
- spread(_el$, mergeProps(rest, {
23
- get ["class"]() {
24
- return clsx(styles().logo, className$1 ? className$1() : "");
25
- }
26
- }), false, true);
27
- createRenderEffect((_p$) => {
28
- var _v$ = styles().tanstackLogo, _v$2 = styles().routerLogo;
29
- _v$ !== _p$.e && className(_el$2, _p$.e = _v$);
30
- _v$2 !== _p$.t && className(_el$3, _p$.t = _v$2);
31
- return _p$;
32
- }, {
33
- e: void 0,
34
- t: void 0
35
- });
36
- return _el$;
37
- })();
38
- }
39
- function NavigateLink(props) {
40
- return (() => {
41
- var _el$4 = _tmpl$2(), _el$5 = _el$4.firstChild;
42
- _el$4.style.setProperty("display", "flex");
43
- _el$4.style.setProperty("align-items", "center");
44
- _el$4.style.setProperty("width", "100%");
45
- insert(_el$4, () => props.left, _el$5);
46
- _el$5.style.setProperty("flex-grow", "1");
47
- _el$5.style.setProperty("min-width", "0");
48
- insert(_el$5, () => props.children);
49
- insert(_el$4, () => props.right, null);
50
- createRenderEffect(() => className(_el$4, props.class));
51
- return _el$4;
52
- })();
53
- }
54
- function RouteComp({
55
- routerState,
56
- router,
57
- route,
58
- isRoot,
59
- activeId,
60
- setActiveId
61
- }) {
62
- const styles = useStyles();
63
- const matches = createMemo(() => routerState().pendingMatches || routerState().matches);
64
- const match = createMemo(() => routerState().matches.find((d) => d.routeId === route.id));
65
- const param = createMemo(() => {
66
- try {
67
- if (match()?.params) {
68
- const p = match()?.params;
69
- const r = route.path || trimPath(route.id);
70
- if (r.startsWith("$")) {
71
- const trimmed = r.slice(1);
72
- if (p[trimmed]) {
73
- return `(${p[trimmed]})`;
74
- }
75
- }
76
- }
77
- return "";
78
- } catch (error) {
79
- return "";
80
- }
81
- });
82
- const navigationTarget = createMemo(() => {
83
- if (isRoot) return void 0;
84
- if (!route.path) return void 0;
85
- const allParams = Object.assign({}, ...matches().map((m) => m.params));
86
- const interpolated = interpolatePath({
87
- path: route.fullPath,
88
- params: allParams,
89
- leaveWildcards: false,
90
- leaveParams: false,
91
- decodeCharMap: router().pathParamsDecodeCharMap
92
- });
93
- return !interpolated.isMissingParams ? interpolated.interpolatedPath : void 0;
94
- });
95
- return (() => {
96
- var _el$6 = _tmpl$5(), _el$7 = _el$6.firstChild, _el$8 = _el$7.firstChild;
97
- _el$7.$$click = () => {
98
- if (match()) {
99
- setActiveId(activeId() === route.id ? "" : route.id);
100
- }
101
- };
102
- insert(_el$7, createComponent(NavigateLink, {
103
- get ["class"]() {
104
- return clsx(styles().routesRow(!!match()));
105
- },
106
- get left() {
107
- return createComponent(Show, {
108
- get when() {
109
- return navigationTarget();
110
- },
111
- children: (navigate) => createComponent(NavigateButton, {
112
- get to() {
113
- return navigate();
114
- },
115
- router
116
- })
117
- });
118
- },
119
- get right() {
120
- return createComponent(AgeTicker, {
121
- get match() {
122
- return match();
123
- },
124
- router
125
- });
126
- },
127
- get children() {
128
- return [(() => {
129
- var _el$9 = _tmpl$3(), _el$0 = _el$9.firstChild;
130
- insert(_el$9, () => isRoot ? rootRouteId : route.path || trimPath(route.id), _el$0);
131
- createRenderEffect(() => className(_el$9, styles().code));
132
- return _el$9;
133
- })(), (() => {
134
- var _el$1 = _tmpl$4();
135
- insert(_el$1, param);
136
- createRenderEffect(() => className(_el$1, styles().routeParamInfo));
137
- return _el$1;
138
- })()];
139
- }
140
- }), null);
141
- insert(_el$6, (() => {
142
- var _c$ = createMemo(() => !!route.children?.length);
143
- return () => _c$() ? (() => {
144
- var _el$10 = _tmpl$6();
145
- insert(_el$10, () => [...route.children].sort((a, b) => {
146
- return a.rank - b.rank;
147
- }).map((r) => createComponent(RouteComp, {
148
- routerState,
149
- router,
150
- route: r,
151
- activeId,
152
- setActiveId
153
- })));
154
- createRenderEffect(() => className(_el$10, styles().nestedRouteRow(!!isRoot)));
155
- return _el$10;
156
- })() : null;
157
- })(), null);
158
- createRenderEffect((_p$) => {
159
- var _v$3 = `Open match details for ${route.id}`, _v$4 = clsx(styles().routesRowContainer(route.id === activeId(), !!match())), _v$5 = clsx(styles().matchIndicator(getRouteStatusColor(matches(), route)));
160
- _v$3 !== _p$.e && setAttribute(_el$7, "aria-label", _p$.e = _v$3);
161
- _v$4 !== _p$.t && className(_el$7, _p$.t = _v$4);
162
- _v$5 !== _p$.a && className(_el$8, _p$.a = _v$5);
163
- return _p$;
164
- }, {
165
- e: void 0,
166
- t: void 0,
167
- a: void 0
168
- });
169
- return _el$6;
170
- })();
171
- }
172
- const BaseTanStackRouterDevtoolsPanel = function BaseTanStackRouterDevtoolsPanel2({
173
- ...props
174
- }) {
175
- const {
176
- isOpen = true,
177
- setIsOpen,
178
- handleDragStart,
179
- router,
180
- routerState,
181
- shadowDOMTarget,
182
- ...panelProps
183
- } = props;
184
- const {
185
- onCloseClick
186
- } = useDevtoolsOnClose();
187
- const styles = useStyles();
188
- const {
189
- className: className$1,
190
- style,
191
- ...otherPanelProps
192
- } = panelProps;
193
- 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.");
194
- const [showMatches, setShowMatches] = useLocalStorage("tanstackRouterDevtoolsShowMatches", true);
195
- const [activeId, setActiveId] = useLocalStorage("tanstackRouterDevtoolsActiveRouteId", "");
196
- const activeMatch = createMemo(() => {
197
- const matches = [...routerState().pendingMatches ?? [], ...routerState().matches, ...routerState().cachedMatches];
198
- return matches.find((d) => d.routeId === activeId() || d.id === activeId());
199
- });
200
- const hasSearch = createMemo(() => Object.keys(routerState().location.search).length);
201
- const explorerState = createMemo(() => {
202
- return {
203
- ...router(),
204
- state: routerState()
205
- };
206
- });
207
- const routerExplorerValue = createMemo(() => Object.fromEntries(multiSortBy(Object.keys(explorerState()), ["state", "routesById", "routesByPath", "flatRoutes", "options", "manifest"].map((d) => (dd) => dd !== d)).map((key) => [key, explorerState()[key]]).filter((d) => typeof d[1] !== "function" && !["__store", "basepath", "injectedHtml", "subscribers", "latestLoadPromise", "navigateTimeout", "resetNextScroll", "tempLocationKey", "latestLocation", "routeTree", "history"].includes(d[0]))));
208
- const activeMatchLoaderData = createMemo(() => activeMatch()?.loaderData);
209
- const activeMatchValue = createMemo(() => activeMatch());
210
- const locationSearchValue = createMemo(() => routerState().location.search);
211
- return (() => {
212
- var _el$11 = _tmpl$7(), _el$12 = _el$11.firstChild, _el$13 = _el$12.firstChild, _el$14 = _el$12.nextSibling, _el$15 = _el$14.firstChild, _el$16 = _el$15.nextSibling, _el$17 = _el$16.firstChild, _el$18 = _el$14.nextSibling, _el$19 = _el$18.firstChild, _el$20 = _el$19.firstChild;
213
- _el$20.firstChild;
214
- var _el$22 = _el$20.nextSibling, _el$23 = _el$22.firstChild, _el$24 = _el$22.nextSibling, _el$25 = _el$24.firstChild, _el$26 = _el$25.firstChild, _el$27 = _el$26.nextSibling, _el$28 = _el$25.nextSibling, _el$29 = _el$24.nextSibling;
215
- spread(_el$11, mergeProps({
216
- get ["class"]() {
217
- return clsx(styles().devtoolsPanel, "TanStackRouterDevtoolsPanel", className$1 ? className$1() : "");
218
- },
219
- get style() {
220
- return style ? style() : "";
221
- }
222
- }, otherPanelProps), false, true);
223
- insert(_el$11, handleDragStart ? (() => {
224
- var _el$30 = _tmpl$6();
225
- addEventListener(_el$30, "mousedown", handleDragStart, true);
226
- createRenderEffect(() => className(_el$30, styles().dragHandle));
227
- return _el$30;
228
- })() : null, _el$12);
229
- _el$12.$$click = (e) => {
230
- if (setIsOpen) {
231
- setIsOpen(false);
232
- }
233
- onCloseClick(e);
234
- };
235
- insert(_el$15, createComponent(Logo, {
236
- "aria-hidden": true,
237
- onClick: (e) => {
238
- if (setIsOpen) {
239
- setIsOpen(false);
240
- }
241
- onCloseClick(e);
242
- }
243
- }));
244
- insert(_el$17, createComponent(Explorer, {
245
- label: "Router",
246
- value: routerExplorerValue,
247
- defaultExpanded: {
248
- state: {},
249
- context: {},
250
- options: {}
251
- },
252
- filterSubEntries: (subEntries) => {
253
- return subEntries.filter((d) => typeof d.value() !== "function");
254
- }
255
- }));
256
- insert(_el$20, (() => {
257
- var _c$2 = createMemo(() => !!routerState().location.maskedLocation);
258
- return () => _c$2() ? (() => {
259
- var _el$31 = _tmpl$8(), _el$32 = _el$31.firstChild;
260
- createRenderEffect((_p$) => {
261
- var _v$22 = styles().maskedBadgeContainer, _v$23 = styles().maskedBadge;
262
- _v$22 !== _p$.e && className(_el$31, _p$.e = _v$22);
263
- _v$23 !== _p$.t && className(_el$32, _p$.t = _v$23);
264
- return _p$;
265
- }, {
266
- e: void 0,
267
- t: void 0
268
- });
269
- return _el$31;
270
- })() : null;
271
- })(), null);
272
- insert(_el$23, () => routerState().location.pathname);
273
- insert(_el$22, (() => {
274
- var _c$3 = createMemo(() => !!routerState().location.maskedLocation);
275
- return () => _c$3() ? (() => {
276
- var _el$33 = _tmpl$4();
277
- insert(_el$33, () => routerState().location.maskedLocation?.pathname);
278
- createRenderEffect(() => className(_el$33, styles().maskedLocation));
279
- return _el$33;
280
- })() : null;
281
- })(), null);
282
- _el$26.$$click = () => {
283
- setShowMatches(false);
284
- };
285
- _el$27.$$click = () => {
286
- setShowMatches(true);
287
- };
288
- insert(_el$29, (() => {
289
- var _c$4 = createMemo(() => !!!showMatches());
290
- return () => _c$4() ? createComponent(RouteComp, {
291
- routerState,
292
- router,
293
- get route() {
294
- return router().routeTree;
295
- },
296
- isRoot: true,
297
- activeId,
298
- setActiveId
299
- }) : (() => {
300
- var _el$34 = _tmpl$6();
301
- insert(_el$34, () => (routerState().pendingMatches?.length ? routerState().pendingMatches : routerState().matches)?.map((match, _i) => {
302
- return (() => {
303
- var _el$35 = _tmpl$9(), _el$36 = _el$35.firstChild;
304
- _el$35.$$click = () => setActiveId(activeId() === match.id ? "" : match.id);
305
- insert(_el$35, createComponent(NavigateLink, {
306
- get left() {
307
- return createComponent(NavigateButton, {
308
- get to() {
309
- return match.pathname;
310
- },
311
- get params() {
312
- return match.params;
313
- },
314
- get search() {
315
- return match.search;
316
- },
317
- router
318
- });
319
- },
320
- get right() {
321
- return createComponent(AgeTicker, {
322
- match,
323
- router
324
- });
325
- },
326
- get children() {
327
- var _el$37 = _tmpl$4();
328
- insert(_el$37, () => `${match.routeId === rootRouteId ? rootRouteId : match.pathname}`);
329
- createRenderEffect(() => className(_el$37, styles().matchID));
330
- return _el$37;
331
- }
332
- }), null);
333
- createRenderEffect((_p$) => {
334
- var _v$24 = `Open match details for ${match.id}`, _v$25 = clsx(styles().matchRow(match === activeMatch())), _v$26 = clsx(styles().matchIndicator(getStatusColor(match)));
335
- _v$24 !== _p$.e && setAttribute(_el$35, "aria-label", _p$.e = _v$24);
336
- _v$25 !== _p$.t && className(_el$35, _p$.t = _v$25);
337
- _v$26 !== _p$.a && className(_el$36, _p$.a = _v$26);
338
- return _p$;
339
- }, {
340
- e: void 0,
341
- t: void 0,
342
- a: void 0
343
- });
344
- return _el$35;
345
- })();
346
- }));
347
- return _el$34;
348
- })();
349
- })());
350
- insert(_el$18, (() => {
351
- var _c$5 = createMemo(() => !!routerState().cachedMatches.length);
352
- return () => _c$5() ? (() => {
353
- var _el$38 = _tmpl$0(), _el$39 = _el$38.firstChild, _el$40 = _el$39.firstChild, _el$41 = _el$40.nextSibling, _el$42 = _el$39.nextSibling;
354
- insert(_el$42, () => routerState().cachedMatches.map((match) => {
355
- return (() => {
356
- var _el$43 = _tmpl$9(), _el$44 = _el$43.firstChild;
357
- _el$43.$$click = () => setActiveId(activeId() === match.id ? "" : match.id);
358
- insert(_el$43, createComponent(NavigateLink, {
359
- get left() {
360
- return createComponent(NavigateButton, {
361
- get to() {
362
- return match.pathname;
363
- },
364
- get params() {
365
- return match.params;
366
- },
367
- get search() {
368
- return match.search;
369
- },
370
- router
371
- });
372
- },
373
- get right() {
374
- return createComponent(AgeTicker, {
375
- match,
376
- router
377
- });
378
- },
379
- get children() {
380
- var _el$45 = _tmpl$4();
381
- insert(_el$45, () => `${match.id}`);
382
- createRenderEffect(() => className(_el$45, styles().matchID));
383
- return _el$45;
384
- }
385
- }), null);
386
- createRenderEffect((_p$) => {
387
- var _v$30 = `Open match details for ${match.id}`, _v$31 = clsx(styles().matchRow(match === activeMatch())), _v$32 = clsx(styles().matchIndicator(getStatusColor(match)));
388
- _v$30 !== _p$.e && setAttribute(_el$43, "aria-label", _p$.e = _v$30);
389
- _v$31 !== _p$.t && className(_el$43, _p$.t = _v$31);
390
- _v$32 !== _p$.a && className(_el$44, _p$.a = _v$32);
391
- return _p$;
392
- }, {
393
- e: void 0,
394
- t: void 0,
395
- a: void 0
396
- });
397
- return _el$43;
398
- })();
399
- }));
400
- createRenderEffect((_p$) => {
401
- var _v$27 = styles().cachedMatchesContainer, _v$28 = styles().detailsHeader, _v$29 = styles().detailsHeaderInfo;
402
- _v$27 !== _p$.e && className(_el$38, _p$.e = _v$27);
403
- _v$28 !== _p$.t && className(_el$39, _p$.t = _v$28);
404
- _v$29 !== _p$.a && className(_el$41, _p$.a = _v$29);
405
- return _p$;
406
- }, {
407
- e: void 0,
408
- t: void 0,
409
- a: void 0
410
- });
411
- return _el$38;
412
- })() : null;
413
- })(), null);
414
- insert(_el$11, (() => {
415
- var _c$6 = createMemo(() => !!(activeMatch() && activeMatch()?.status));
416
- return () => _c$6() ? (() => {
417
- var _el$46 = _tmpl$1(), _el$47 = _el$46.firstChild, _el$48 = _el$47.nextSibling, _el$49 = _el$48.firstChild, _el$50 = _el$49.firstChild, _el$51 = _el$50.firstChild, _el$52 = _el$50.nextSibling, _el$53 = _el$52.firstChild, _el$54 = _el$53.nextSibling, _el$55 = _el$54.firstChild, _el$56 = _el$52.nextSibling, _el$57 = _el$56.firstChild, _el$58 = _el$57.nextSibling, _el$59 = _el$56.nextSibling, _el$60 = _el$59.firstChild, _el$61 = _el$60.nextSibling, _el$62 = _el$48.nextSibling, _el$63 = _el$62.nextSibling;
418
- insert(_el$51, (() => {
419
- var _c$8 = createMemo(() => !!(activeMatch()?.status === "success" && activeMatch()?.isFetching));
420
- return () => _c$8() ? "fetching" : activeMatch()?.status;
421
- })());
422
- insert(_el$55, () => activeMatch()?.id);
423
- insert(_el$58, (() => {
424
- var _c$9 = createMemo(() => !!routerState().pendingMatches?.find((d) => d.id === activeMatch()?.id));
425
- return () => _c$9() ? "Pending" : routerState().matches.find((d) => d.id === activeMatch()?.id) ? "Active" : "Cached";
426
- })());
427
- insert(_el$61, (() => {
428
- var _c$0 = createMemo(() => !!activeMatch()?.updatedAt);
429
- return () => _c$0() ? new Date(activeMatch()?.updatedAt).toLocaleTimeString() : "N/A";
430
- })());
431
- insert(_el$46, (() => {
432
- var _c$1 = createMemo(() => !!activeMatchLoaderData());
433
- return () => _c$1() ? [(() => {
434
- var _el$64 = _tmpl$10();
435
- createRenderEffect(() => className(_el$64, styles().detailsHeader));
436
- return _el$64;
437
- })(), (() => {
438
- var _el$65 = _tmpl$6();
439
- insert(_el$65, createComponent(Explorer, {
440
- label: "loaderData",
441
- value: activeMatchLoaderData,
442
- defaultExpanded: {}
443
- }));
444
- createRenderEffect(() => className(_el$65, styles().detailsContent));
445
- return _el$65;
446
- })()] : null;
447
- })(), _el$62);
448
- insert(_el$63, createComponent(Explorer, {
449
- label: "Match",
450
- value: activeMatchValue,
451
- defaultExpanded: {}
452
- }));
453
- createRenderEffect((_p$) => {
454
- var _v$33 = styles().thirdContainer, _v$34 = styles().detailsHeader, _v$35 = styles().matchDetails, _v$36 = styles().matchStatus(activeMatch()?.status, activeMatch()?.isFetching), _v$37 = styles().matchDetailsInfoLabel, _v$38 = styles().matchDetailsInfo, _v$39 = styles().matchDetailsInfoLabel, _v$40 = styles().matchDetailsInfo, _v$41 = styles().matchDetailsInfoLabel, _v$42 = styles().matchDetailsInfo, _v$43 = styles().detailsHeader, _v$44 = styles().detailsContent;
455
- _v$33 !== _p$.e && className(_el$46, _p$.e = _v$33);
456
- _v$34 !== _p$.t && className(_el$47, _p$.t = _v$34);
457
- _v$35 !== _p$.a && className(_el$49, _p$.a = _v$35);
458
- _v$36 !== _p$.o && className(_el$50, _p$.o = _v$36);
459
- _v$37 !== _p$.i && className(_el$52, _p$.i = _v$37);
460
- _v$38 !== _p$.n && className(_el$54, _p$.n = _v$38);
461
- _v$39 !== _p$.s && className(_el$56, _p$.s = _v$39);
462
- _v$40 !== _p$.h && className(_el$58, _p$.h = _v$40);
463
- _v$41 !== _p$.r && className(_el$59, _p$.r = _v$41);
464
- _v$42 !== _p$.d && className(_el$61, _p$.d = _v$42);
465
- _v$43 !== _p$.l && className(_el$62, _p$.l = _v$43);
466
- _v$44 !== _p$.u && className(_el$63, _p$.u = _v$44);
467
- return _p$;
468
- }, {
469
- e: void 0,
470
- t: void 0,
471
- a: void 0,
472
- o: void 0,
473
- i: void 0,
474
- n: void 0,
475
- s: void 0,
476
- h: void 0,
477
- r: void 0,
478
- d: void 0,
479
- l: void 0,
480
- u: void 0
481
- });
482
- return _el$46;
483
- })() : null;
484
- })(), null);
485
- insert(_el$11, (() => {
486
- var _c$7 = createMemo(() => !!hasSearch());
487
- return () => _c$7() ? (() => {
488
- var _el$66 = _tmpl$11(), _el$67 = _el$66.firstChild;
489
- _el$67.firstChild;
490
- var _el$69 = _el$67.nextSibling;
491
- insert(_el$67, typeof navigator !== "undefined" ? (() => {
492
- var _el$70 = _tmpl$12();
493
- insert(_el$70, createComponent(CopyButton, {
494
- getValue: () => {
495
- const search = routerState().location.search;
496
- return JSON.stringify(search);
497
- }
498
- }));
499
- return _el$70;
500
- })() : null, null);
501
- insert(_el$69, createComponent(Explorer, {
502
- value: locationSearchValue,
503
- get defaultExpanded() {
504
- return Object.keys(routerState().location.search).reduce((obj, next) => {
505
- obj[next] = {};
506
- return obj;
507
- }, {});
508
- }
509
- }));
510
- createRenderEffect((_p$) => {
511
- var _v$45 = styles().fourthContainer, _v$46 = styles().detailsHeader, _v$47 = styles().detailsContent;
512
- _v$45 !== _p$.e && className(_el$66, _p$.e = _v$45);
513
- _v$46 !== _p$.t && className(_el$67, _p$.t = _v$46);
514
- _v$47 !== _p$.a && className(_el$69, _p$.a = _v$47);
515
- return _p$;
516
- }, {
517
- e: void 0,
518
- t: void 0,
519
- a: void 0
520
- });
521
- return _el$66;
522
- })() : null;
523
- })(), null);
524
- createRenderEffect((_p$) => {
525
- var _v$6 = styles().panelCloseBtn, _v$7 = styles().panelCloseBtnIcon, _v$8 = styles().firstContainer, _v$9 = styles().row, _v$0 = styles().routerExplorerContainer, _v$1 = styles().routerExplorer, _v$10 = styles().secondContainer, _v$11 = styles().matchesContainer, _v$12 = styles().detailsHeader, _v$13 = styles().detailsContent, _v$14 = styles().detailsHeader, _v$15 = styles().routeMatchesToggle, _v$16 = !showMatches(), _v$17 = clsx(styles().routeMatchesToggleBtn(!showMatches(), true)), _v$18 = showMatches(), _v$19 = clsx(styles().routeMatchesToggleBtn(!!showMatches(), false)), _v$20 = styles().detailsHeaderInfo, _v$21 = clsx(styles().routesContainer);
526
- _v$6 !== _p$.e && className(_el$12, _p$.e = _v$6);
527
- _v$7 !== _p$.t && setAttribute(_el$13, "class", _p$.t = _v$7);
528
- _v$8 !== _p$.a && className(_el$14, _p$.a = _v$8);
529
- _v$9 !== _p$.o && className(_el$15, _p$.o = _v$9);
530
- _v$0 !== _p$.i && className(_el$16, _p$.i = _v$0);
531
- _v$1 !== _p$.n && className(_el$17, _p$.n = _v$1);
532
- _v$10 !== _p$.s && className(_el$18, _p$.s = _v$10);
533
- _v$11 !== _p$.h && className(_el$19, _p$.h = _v$11);
534
- _v$12 !== _p$.r && className(_el$20, _p$.r = _v$12);
535
- _v$13 !== _p$.d && className(_el$22, _p$.d = _v$13);
536
- _v$14 !== _p$.l && className(_el$24, _p$.l = _v$14);
537
- _v$15 !== _p$.u && className(_el$25, _p$.u = _v$15);
538
- _v$16 !== _p$.c && (_el$26.disabled = _p$.c = _v$16);
539
- _v$17 !== _p$.w && className(_el$26, _p$.w = _v$17);
540
- _v$18 !== _p$.m && (_el$27.disabled = _p$.m = _v$18);
541
- _v$19 !== _p$.f && className(_el$27, _p$.f = _v$19);
542
- _v$20 !== _p$.y && className(_el$28, _p$.y = _v$20);
543
- _v$21 !== _p$.g && className(_el$29, _p$.g = _v$21);
544
- return _p$;
545
- }, {
546
- e: void 0,
547
- t: void 0,
548
- a: void 0,
549
- o: void 0,
550
- i: void 0,
551
- n: void 0,
552
- s: void 0,
553
- h: void 0,
554
- r: void 0,
555
- d: void 0,
556
- l: void 0,
557
- u: void 0,
558
- c: void 0,
559
- w: void 0,
560
- m: void 0,
561
- f: void 0,
562
- y: void 0,
563
- g: void 0
564
- });
565
- return _el$11;
566
- })();
567
- };
568
- function CopyButton({
569
- getValue
570
- }) {
571
- const [copied, setCopied] = createSignal(false);
572
- let timeoutId = null;
573
- const handleCopy = async () => {
574
- if (typeof navigator === "undefined" || !navigator.clipboard?.writeText) {
575
- console.warn("TanStack Router Devtools: Clipboard API unavailable");
576
- return;
577
- }
578
- try {
579
- const value = getValue();
580
- await navigator.clipboard.writeText(value);
581
- setCopied(true);
582
- if (timeoutId) clearTimeout(timeoutId);
583
- timeoutId = setTimeout(() => setCopied(false), 2500);
584
- } catch (e) {
585
- console.error("TanStack Router Devtools: Failed to copy", e);
586
- }
587
- };
588
- onCleanup(() => {
589
- if (timeoutId) clearTimeout(timeoutId);
590
- });
591
- return (() => {
592
- var _el$71 = _tmpl$13();
593
- _el$71.$$click = handleCopy;
594
- insert(_el$71, () => copied() ? "✅" : "📋");
595
- createRenderEffect(() => setAttribute(_el$71, "title", copied() ? "Copied!" : "Copy"));
596
- return _el$71;
597
- })();
598
- }
599
- delegateEvents(["click", "mousedown"]);
600
- export {
601
- BaseTanStackRouterDevtoolsPanel,
602
- BaseTanStackRouterDevtoolsPanel as default
603
- };
604
- //# sourceMappingURL=BaseTanStackRouterDevtoolsPanel.js.map