@tanstack/router-devtools 1.111.11 → 1.112.4

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 (48) hide show
  1. package/dist/cjs/AgeTicker.cjs +58 -0
  2. package/dist/cjs/AgeTicker.cjs.map +1 -0
  3. package/dist/cjs/AgeTicker.d.cts +5 -0
  4. package/dist/cjs/BaseTanStackRouterDevtoolsPanel.cjs +421 -0
  5. package/dist/cjs/BaseTanStackRouterDevtoolsPanel.cjs.map +1 -0
  6. package/dist/cjs/BaseTanStackRouterDevtoolsPanel.d.cts +3 -0
  7. package/dist/cjs/TanStackRouterDevtools.cjs +177 -0
  8. package/dist/cjs/TanStackRouterDevtools.cjs.map +1 -0
  9. package/dist/cjs/{devtools.d.cts → TanStackRouterDevtools.d.cts} +0 -31
  10. package/dist/cjs/TanStackRouterDevtoolsPanel.cjs +21 -0
  11. package/dist/cjs/TanStackRouterDevtoolsPanel.cjs.map +1 -0
  12. package/dist/cjs/TanStackRouterDevtoolsPanel.d.cts +33 -0
  13. package/dist/cjs/index.cjs +4 -3
  14. package/dist/cjs/index.cjs.map +1 -1
  15. package/dist/cjs/index.d.cts +2 -1
  16. package/dist/cjs/useStyles.cjs +570 -0
  17. package/dist/cjs/useStyles.cjs.map +1 -0
  18. package/dist/cjs/useStyles.d.cts +52 -0
  19. package/dist/esm/AgeTicker.d.ts +5 -0
  20. package/dist/esm/AgeTicker.js +58 -0
  21. package/dist/esm/AgeTicker.js.map +1 -0
  22. package/dist/esm/BaseTanStackRouterDevtoolsPanel.d.ts +3 -0
  23. package/dist/esm/BaseTanStackRouterDevtoolsPanel.js +421 -0
  24. package/dist/esm/BaseTanStackRouterDevtoolsPanel.js.map +1 -0
  25. package/dist/esm/{devtools.d.ts → TanStackRouterDevtools.d.ts} +0 -31
  26. package/dist/esm/TanStackRouterDevtools.js +177 -0
  27. package/dist/esm/TanStackRouterDevtools.js.map +1 -0
  28. package/dist/esm/TanStackRouterDevtoolsPanel.d.ts +33 -0
  29. package/dist/esm/TanStackRouterDevtoolsPanel.js +21 -0
  30. package/dist/esm/TanStackRouterDevtoolsPanel.js.map +1 -0
  31. package/dist/esm/index.d.ts +2 -1
  32. package/dist/esm/index.js +2 -1
  33. package/dist/esm/index.js.map +1 -1
  34. package/dist/esm/useStyles.d.ts +52 -0
  35. package/dist/esm/useStyles.js +553 -0
  36. package/dist/esm/useStyles.js.map +1 -0
  37. package/package.json +2 -2
  38. package/src/AgeTicker.tsx +73 -0
  39. package/src/BaseTanStackRouterDevtoolsPanel.tsx +488 -0
  40. package/src/TanStackRouterDevtools.tsx +250 -0
  41. package/src/TanStackRouterDevtoolsPanel.tsx +54 -0
  42. package/src/index.tsx +2 -1
  43. package/src/useStyles.tsx +589 -0
  44. package/dist/cjs/devtools.cjs +0 -1212
  45. package/dist/cjs/devtools.cjs.map +0 -1
  46. package/dist/esm/devtools.js +0 -1195
  47. package/dist/esm/devtools.js.map +0 -1
  48. package/src/devtools.tsx +0 -1443
@@ -1,1212 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const React = require("react");
5
- const reactRouter = require("@tanstack/react-router");
6
- const goober = require("goober");
7
- const clsx = require("clsx");
8
- const useLocalStorage = require("./useLocalStorage.cjs");
9
- const utils = require("./utils.cjs");
10
- const Explorer = require("./Explorer.cjs");
11
- const tokens = require("./tokens.cjs");
12
- const logo = require("./logo.cjs");
13
- const context = require("./context.cjs");
14
- function _interopNamespaceDefault(e) {
15
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
16
- if (e) {
17
- for (const k in e) {
18
- if (k !== "default") {
19
- const d = Object.getOwnPropertyDescriptor(e, k);
20
- Object.defineProperty(n, k, d.get ? d : {
21
- enumerable: true,
22
- get: () => e[k]
23
- });
24
- }
25
- }
26
- }
27
- n.default = e;
28
- return Object.freeze(n);
29
- }
30
- const goober__namespace = /* @__PURE__ */ _interopNamespaceDefault(goober);
31
- function Logo(props) {
32
- const { className, ...rest } = props;
33
- const styles = useStyles();
34
- return /* @__PURE__ */ jsxRuntime.jsxs("button", { ...rest, className: clsx.clsx(styles.logo, className), children: [
35
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.tanstackLogo, children: "TANSTACK" }),
36
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.routerLogo, children: "React Router v1" })
37
- ] });
38
- }
39
- function TanStackRouterDevtools(props) {
40
- const { shadowDOMTarget } = props;
41
- return /* @__PURE__ */ jsxRuntime.jsx(context.ShadowDomTargetContext.Provider, { value: shadowDOMTarget, children: /* @__PURE__ */ jsxRuntime.jsx(FloatingTanStackRouterDevtools, { ...props }) });
42
- }
43
- function FloatingTanStackRouterDevtools({
44
- initialIsOpen,
45
- panelProps = {},
46
- closeButtonProps = {},
47
- toggleButtonProps = {},
48
- position = "bottom-left",
49
- containerElement: Container = "footer",
50
- router,
51
- shadowDOMTarget
52
- }) {
53
- const [rootEl, setRootEl] = React.useState();
54
- const panelRef = React.useRef(null);
55
- const [isOpen, setIsOpen] = useLocalStorage(
56
- "tanstackRouterDevtoolsOpen",
57
- initialIsOpen
58
- );
59
- const [devtoolsHeight, setDevtoolsHeight] = useLocalStorage(
60
- "tanstackRouterDevtoolsHeight",
61
- null
62
- );
63
- const [isResolvedOpen, setIsResolvedOpen] = utils.useSafeState(false);
64
- const [isResizing, setIsResizing] = utils.useSafeState(false);
65
- const isMounted = utils.useIsMounted();
66
- const styles = useStyles();
67
- const handleDragStart = (panelElement, startEvent) => {
68
- if (startEvent.button !== 0) return;
69
- setIsResizing(true);
70
- const dragInfo = {
71
- originalHeight: (panelElement == null ? void 0 : panelElement.getBoundingClientRect().height) ?? 0,
72
- pageY: startEvent.pageY
73
- };
74
- const run = (moveEvent) => {
75
- const delta = dragInfo.pageY - moveEvent.pageY;
76
- const newHeight = dragInfo.originalHeight + delta;
77
- setDevtoolsHeight(newHeight);
78
- if (newHeight < 70) {
79
- setIsOpen(false);
80
- } else {
81
- setIsOpen(true);
82
- }
83
- };
84
- const unsub = () => {
85
- setIsResizing(false);
86
- document.removeEventListener("mousemove", run);
87
- document.removeEventListener("mouseUp", unsub);
88
- };
89
- document.addEventListener("mousemove", run);
90
- document.addEventListener("mouseup", unsub);
91
- };
92
- const isButtonClosed = isOpen ?? false;
93
- React.useEffect(() => {
94
- setIsResolvedOpen(isOpen ?? false);
95
- }, [isOpen, isResolvedOpen, setIsResolvedOpen]);
96
- React.useEffect(() => {
97
- var _a;
98
- if (isResolvedOpen) {
99
- const previousValue = (_a = rootEl == null ? void 0 : rootEl.parentElement) == null ? void 0 : _a.style.paddingBottom;
100
- const run = () => {
101
- var _a2;
102
- const containerHeight = (_a2 = panelRef.current) == null ? void 0 : _a2.getBoundingClientRect().height;
103
- if (rootEl == null ? void 0 : rootEl.parentElement) {
104
- rootEl.parentElement.style.paddingBottom = `${containerHeight}px`;
105
- }
106
- };
107
- run();
108
- if (typeof window !== "undefined") {
109
- window.addEventListener("resize", run);
110
- return () => {
111
- window.removeEventListener("resize", run);
112
- if ((rootEl == null ? void 0 : rootEl.parentElement) && typeof previousValue === "string") {
113
- rootEl.parentElement.style.paddingBottom = previousValue;
114
- }
115
- };
116
- }
117
- }
118
- return;
119
- }, [isResolvedOpen, rootEl == null ? void 0 : rootEl.parentElement]);
120
- React.useEffect(() => {
121
- if (rootEl) {
122
- const el = rootEl;
123
- const fontSize = getComputedStyle(el).fontSize;
124
- el.style.setProperty("--tsrd-font-size", fontSize);
125
- }
126
- }, [rootEl]);
127
- const { style: panelStyle = {}, ...otherPanelProps } = panelProps;
128
- const {
129
- style: closeButtonStyle = {},
130
- onClick: onCloseClick,
131
- ...otherCloseButtonProps
132
- } = closeButtonProps;
133
- const {
134
- onClick: onToggleClick,
135
- className: toggleButtonClassName,
136
- ...otherToggleButtonProps
137
- } = toggleButtonProps;
138
- if (!isMounted) return null;
139
- const resolvedHeight = devtoolsHeight ?? 500;
140
- return /* @__PURE__ */ jsxRuntime.jsxs(Container, { ref: setRootEl, className: "TanStackRouterDevtools", children: [
141
- /* @__PURE__ */ jsxRuntime.jsx(
142
- context.DevtoolsOnCloseContext.Provider,
143
- {
144
- value: {
145
- onCloseClick: onCloseClick ?? (() => {
146
- })
147
- },
148
- children: /* @__PURE__ */ jsxRuntime.jsx(
149
- BaseTanStackRouterDevtoolsPanel,
150
- {
151
- ref: panelRef,
152
- ...otherPanelProps,
153
- router,
154
- className: clsx.clsx(
155
- styles.devtoolsPanelContainer,
156
- styles.devtoolsPanelContainerVisibility(!!isOpen),
157
- styles.devtoolsPanelContainerResizing(isResizing),
158
- styles.devtoolsPanelContainerAnimation(
159
- isResolvedOpen,
160
- resolvedHeight + 16
161
- )
162
- ),
163
- style: {
164
- height: resolvedHeight,
165
- ...panelStyle
166
- },
167
- isOpen: isResolvedOpen,
168
- setIsOpen,
169
- handleDragStart: (e) => handleDragStart(panelRef.current, e),
170
- shadowDOMTarget
171
- }
172
- )
173
- }
174
- ),
175
- /* @__PURE__ */ jsxRuntime.jsxs(
176
- "button",
177
- {
178
- type: "button",
179
- ...otherToggleButtonProps,
180
- "aria-label": "Open TanStack Router Devtools",
181
- onClick: (e) => {
182
- setIsOpen(true);
183
- onToggleClick && onToggleClick(e);
184
- },
185
- className: clsx.clsx(
186
- styles.mainCloseBtn,
187
- styles.mainCloseBtnPosition(position),
188
- styles.mainCloseBtnAnimation(!isButtonClosed),
189
- toggleButtonClassName
190
- ),
191
- children: [
192
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.mainCloseBtnIconContainer, children: [
193
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.mainCloseBtnIconOuter, children: /* @__PURE__ */ jsxRuntime.jsx(logo.TanStackLogo, {}) }),
194
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.mainCloseBtnIconInner, children: /* @__PURE__ */ jsxRuntime.jsx(logo.TanStackLogo, {}) })
195
- ] }),
196
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.mainCloseBtnDivider, children: "-" }),
197
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.routerLogoCloseButton, children: "TanStack Router" })
198
- ]
199
- }
200
- )
201
- ] });
202
- }
203
- const TanStackRouterDevtoolsPanel = React.forwardRef(function TanStackRouterDevtoolsPanel2(props, ref) {
204
- const { shadowDOMTarget } = props;
205
- return /* @__PURE__ */ jsxRuntime.jsx(context.ShadowDomTargetContext.Provider, { value: shadowDOMTarget, children: /* @__PURE__ */ jsxRuntime.jsx(
206
- context.DevtoolsOnCloseContext.Provider,
207
- {
208
- value: {
209
- onCloseClick: () => {
210
- }
211
- },
212
- children: /* @__PURE__ */ jsxRuntime.jsx(BaseTanStackRouterDevtoolsPanel, { ref, ...props })
213
- }
214
- ) });
215
- });
216
- function RouteComp({
217
- router,
218
- route,
219
- isRoot,
220
- activeId,
221
- setActiveId
222
- }) {
223
- var _a;
224
- const routerState = reactRouter.useRouterState({
225
- router
226
- });
227
- const styles = useStyles();
228
- const matches = routerState.pendingMatches || routerState.matches;
229
- const match = routerState.matches.find((d) => d.routeId === route.id);
230
- const param = React.useMemo(() => {
231
- try {
232
- if (match == null ? void 0 : match.params) {
233
- const p = match.params;
234
- const r = route.path || reactRouter.trimPath(route.id);
235
- if (r.startsWith("$")) {
236
- const trimmed = r.slice(1);
237
- if (p[trimmed]) {
238
- return `(${p[trimmed]})`;
239
- }
240
- }
241
- }
242
- return "";
243
- } catch (error) {
244
- return "";
245
- }
246
- }, [match, route]);
247
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
248
- /* @__PURE__ */ jsxRuntime.jsxs(
249
- "div",
250
- {
251
- role: "button",
252
- "aria-label": `Open match details for ${route.id}`,
253
- onClick: () => {
254
- if (match) {
255
- setActiveId(activeId === route.id ? "" : route.id);
256
- }
257
- },
258
- className: clsx.clsx(
259
- styles.routesRowContainer(route.id === activeId, !!match)
260
- ),
261
- children: [
262
- /* @__PURE__ */ jsxRuntime.jsx(
263
- "div",
264
- {
265
- className: clsx.clsx(
266
- styles.matchIndicator(utils.getRouteStatusColor(matches, route))
267
- )
268
- }
269
- ),
270
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx(styles.routesRow(!!match)), children: [
271
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
272
- /* @__PURE__ */ jsxRuntime.jsxs("code", { className: styles.code, children: [
273
- isRoot ? reactRouter.rootRouteId : route.path || reactRouter.trimPath(route.id),
274
- " "
275
- ] }),
276
- /* @__PURE__ */ jsxRuntime.jsx("code", { className: styles.routeParamInfo, children: param })
277
- ] }),
278
- /* @__PURE__ */ jsxRuntime.jsx(AgeTicker, { match, router })
279
- ] })
280
- ]
281
- }
282
- ),
283
- ((_a = route.children) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.nestedRouteRow(!!isRoot), children: [...route.children].sort((a, b) => {
284
- return a.rank - b.rank;
285
- }).map((r) => /* @__PURE__ */ jsxRuntime.jsx(
286
- RouteComp,
287
- {
288
- router,
289
- route: r,
290
- activeId,
291
- setActiveId
292
- },
293
- r.id
294
- )) }) : null
295
- ] });
296
- }
297
- const BaseTanStackRouterDevtoolsPanel = React.forwardRef(function BaseTanStackRouterDevtoolsPanel2(props, ref) {
298
- var _a, _b;
299
- const {
300
- isOpen = true,
301
- setIsOpen,
302
- handleDragStart,
303
- router: userRouter,
304
- shadowDOMTarget,
305
- ...panelProps
306
- } = props;
307
- const { onCloseClick } = context.useDevtoolsOnClose();
308
- const styles = useStyles();
309
- const { className, ...otherPanelProps } = panelProps;
310
- const contextRouter = reactRouter.useRouter({ warn: false });
311
- const router = userRouter ?? contextRouter;
312
- const routerState = reactRouter.useRouterState({
313
- router
314
- });
315
- reactRouter.invariant(
316
- router,
317
- "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."
318
- );
319
- const [showMatches, setShowMatches] = useLocalStorage(
320
- "tanstackRouterDevtoolsShowMatches",
321
- true
322
- );
323
- const [activeId, setActiveId] = useLocalStorage(
324
- "tanstackRouterDevtoolsActiveRouteId",
325
- ""
326
- );
327
- const activeMatch = React.useMemo(() => {
328
- const matches = [
329
- ...routerState.pendingMatches ?? [],
330
- ...routerState.matches,
331
- ...routerState.cachedMatches
332
- ];
333
- return matches.find((d) => d.routeId === activeId || d.id === activeId);
334
- }, [
335
- activeId,
336
- routerState.cachedMatches,
337
- routerState.matches,
338
- routerState.pendingMatches
339
- ]);
340
- const hasSearch = Object.keys(routerState.location.search).length;
341
- const explorerState = {
342
- ...router,
343
- state: router.state
344
- };
345
- return /* @__PURE__ */ jsxRuntime.jsxs(
346
- "div",
347
- {
348
- ref,
349
- className: clsx.clsx(
350
- styles.devtoolsPanel,
351
- "TanStackRouterDevtoolsPanel",
352
- className
353
- ),
354
- ...otherPanelProps,
355
- children: [
356
- handleDragStart ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.dragHandle, onMouseDown: handleDragStart }) : null,
357
- /* @__PURE__ */ jsxRuntime.jsx(
358
- "button",
359
- {
360
- className: styles.panelCloseBtn,
361
- onClick: (e) => {
362
- setIsOpen(false);
363
- onCloseClick(e);
364
- },
365
- children: /* @__PURE__ */ jsxRuntime.jsx(
366
- "svg",
367
- {
368
- xmlns: "http://www.w3.org/2000/svg",
369
- width: "10",
370
- height: "6",
371
- fill: "none",
372
- viewBox: "0 0 10 6",
373
- className: styles.panelCloseBtnIcon,
374
- children: /* @__PURE__ */ jsxRuntime.jsx(
375
- "path",
376
- {
377
- stroke: "currentColor",
378
- strokeLinecap: "round",
379
- strokeLinejoin: "round",
380
- strokeWidth: "1.667",
381
- d: "M1 1l4 4 4-4"
382
- }
383
- )
384
- }
385
- )
386
- }
387
- ),
388
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.firstContainer, children: [
389
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.row, children: /* @__PURE__ */ jsxRuntime.jsx(
390
- Logo,
391
- {
392
- "aria-hidden": true,
393
- onClick: (e) => {
394
- setIsOpen(false);
395
- onCloseClick(e);
396
- }
397
- }
398
- ) }),
399
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.routerExplorerContainer, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.routerExplorer, children: /* @__PURE__ */ jsxRuntime.jsx(
400
- Explorer.default,
401
- {
402
- label: "Router",
403
- value: Object.fromEntries(
404
- utils.multiSortBy(
405
- Object.keys(explorerState),
406
- [
407
- "state",
408
- "routesById",
409
- "routesByPath",
410
- "flatRoutes",
411
- "options",
412
- "manifest"
413
- ].map((d) => (dd) => dd !== d)
414
- ).map((key) => [key, explorerState[key]]).filter(
415
- (d) => typeof d[1] !== "function" && ![
416
- "__store",
417
- "basepath",
418
- "injectedHtml",
419
- "subscribers",
420
- "latestLoadPromise",
421
- "navigateTimeout",
422
- "resetNextScroll",
423
- "tempLocationKey",
424
- "latestLocation",
425
- "routeTree",
426
- "history"
427
- ].includes(d[0])
428
- )
429
- ),
430
- defaultExpanded: {
431
- state: {},
432
- context: {},
433
- options: {}
434
- },
435
- filterSubEntries: (subEntries) => {
436
- return subEntries.filter((d) => typeof d.value !== "function");
437
- }
438
- }
439
- ) }) })
440
- ] }),
441
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.secondContainer, children: [
442
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.matchesContainer, children: [
443
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.detailsHeader, children: [
444
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Pathname" }),
445
- routerState.location.maskedLocation ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.maskedBadgeContainer, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles.maskedBadge, children: "masked" }) }) : null
446
- ] }),
447
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.detailsContent, children: [
448
- /* @__PURE__ */ jsxRuntime.jsx("code", { children: routerState.location.pathname }),
449
- routerState.location.maskedLocation ? /* @__PURE__ */ jsxRuntime.jsx("code", { className: styles.maskedLocation, children: routerState.location.maskedLocation.pathname }) : null
450
- ] }),
451
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.detailsHeader, children: [
452
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.routeMatchesToggle, children: [
453
- /* @__PURE__ */ jsxRuntime.jsx(
454
- "button",
455
- {
456
- type: "button",
457
- onClick: () => {
458
- setShowMatches(false);
459
- },
460
- disabled: !showMatches,
461
- className: clsx.clsx(styles.routeMatchesToggleBtn(!showMatches, true)),
462
- children: "Routes"
463
- }
464
- ),
465
- /* @__PURE__ */ jsxRuntime.jsx(
466
- "button",
467
- {
468
- type: "button",
469
- onClick: () => {
470
- setShowMatches(true);
471
- },
472
- disabled: showMatches,
473
- className: clsx.clsx(
474
- styles.routeMatchesToggleBtn(!!showMatches, false)
475
- ),
476
- children: "Matches"
477
- }
478
- )
479
- ] }),
480
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsHeaderInfo, children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: "age / staleTime / gcTime" }) })
481
- ] }),
482
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx(styles.routesContainer), children: !showMatches ? /* @__PURE__ */ jsxRuntime.jsx(
483
- RouteComp,
484
- {
485
- router,
486
- route: router.routeTree,
487
- isRoot: true,
488
- activeId,
489
- setActiveId
490
- }
491
- ) : /* @__PURE__ */ jsxRuntime.jsx("div", { children: (((_a = routerState.pendingMatches) == null ? void 0 : _a.length) ? routerState.pendingMatches : routerState.matches).map((match, i) => {
492
- return /* @__PURE__ */ jsxRuntime.jsxs(
493
- "div",
494
- {
495
- role: "button",
496
- "aria-label": `Open match details for ${match.id}`,
497
- onClick: () => setActiveId(activeId === match.id ? "" : match.id),
498
- className: clsx.clsx(styles.matchRow(match === activeMatch)),
499
- children: [
500
- /* @__PURE__ */ jsxRuntime.jsx(
501
- "div",
502
- {
503
- className: clsx.clsx(
504
- styles.matchIndicator(utils.getStatusColor(match))
505
- )
506
- }
507
- ),
508
- /* @__PURE__ */ jsxRuntime.jsx(
509
- "code",
510
- {
511
- className: styles.matchID,
512
- children: `${match.routeId === reactRouter.rootRouteId ? reactRouter.rootRouteId : match.pathname}`
513
- }
514
- ),
515
- /* @__PURE__ */ jsxRuntime.jsx(AgeTicker, { match, router })
516
- ]
517
- },
518
- match.id || i
519
- );
520
- }) }) })
521
- ] }),
522
- routerState.cachedMatches.length ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.cachedMatchesContainer, children: [
523
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.detailsHeader, children: [
524
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Cached Matches" }),
525
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsHeaderInfo, children: "age / staleTime / gcTime" })
526
- ] }),
527
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: routerState.cachedMatches.map((match) => {
528
- return /* @__PURE__ */ jsxRuntime.jsxs(
529
- "div",
530
- {
531
- role: "button",
532
- "aria-label": `Open match details for ${match.id}`,
533
- onClick: () => setActiveId(activeId === match.id ? "" : match.id),
534
- className: clsx.clsx(styles.matchRow(match === activeMatch)),
535
- children: [
536
- /* @__PURE__ */ jsxRuntime.jsx(
537
- "div",
538
- {
539
- className: clsx.clsx(
540
- styles.matchIndicator(utils.getStatusColor(match))
541
- )
542
- }
543
- ),
544
- /* @__PURE__ */ jsxRuntime.jsx("code", { className: styles.matchID, children: `${match.id}` }),
545
- /* @__PURE__ */ jsxRuntime.jsx(AgeTicker, { match, router })
546
- ]
547
- },
548
- match.id
549
- );
550
- }) })
551
- ] }) : null
552
- ] }),
553
- activeMatch ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.thirdContainer, children: [
554
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsHeader, children: "Match Details" }),
555
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.matchDetails, children: [
556
- /* @__PURE__ */ jsxRuntime.jsx(
557
- "div",
558
- {
559
- className: styles.matchStatus(
560
- activeMatch.status,
561
- activeMatch.isFetching
562
- ),
563
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: activeMatch.status === "success" && activeMatch.isFetching ? "fetching" : activeMatch.status })
564
- }
565
- ),
566
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.matchDetailsInfoLabel, children: [
567
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "ID:" }),
568
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.matchDetailsInfo, children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: activeMatch.id }) })
569
- ] }),
570
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.matchDetailsInfoLabel, children: [
571
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "State:" }),
572
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.matchDetailsInfo, children: ((_b = routerState.pendingMatches) == null ? void 0 : _b.find(
573
- (d) => d.id === activeMatch.id
574
- )) ? "Pending" : routerState.matches.find((d) => d.id === activeMatch.id) ? "Active" : "Cached" })
575
- ] }),
576
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.matchDetailsInfoLabel, children: [
577
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "Last Updated:" }),
578
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.matchDetailsInfo, children: activeMatch.updatedAt ? new Date(activeMatch.updatedAt).toLocaleTimeString() : "N/A" })
579
- ] })
580
- ] }) }),
581
- activeMatch.loaderData ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
582
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsHeader, children: "Loader Data" }),
583
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsContent, children: /* @__PURE__ */ jsxRuntime.jsx(
584
- Explorer.default,
585
- {
586
- label: "loaderData",
587
- value: activeMatch.loaderData,
588
- defaultExpanded: {}
589
- }
590
- ) })
591
- ] }) : null,
592
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsHeader, children: "Explorer" }),
593
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsContent, children: /* @__PURE__ */ jsxRuntime.jsx(Explorer.default, { label: "Match", value: activeMatch, defaultExpanded: {} }) })
594
- ] }) : null,
595
- hasSearch ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.fourthContainer, children: [
596
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsHeader, children: "Search Params" }),
597
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsContent, children: /* @__PURE__ */ jsxRuntime.jsx(
598
- Explorer.default,
599
- {
600
- value: routerState.location.search,
601
- defaultExpanded: Object.keys(routerState.location.search).reduce(
602
- (obj, next) => {
603
- obj[next] = {};
604
- return obj;
605
- },
606
- {}
607
- )
608
- }
609
- ) })
610
- ] }) : null
611
- ]
612
- }
613
- );
614
- });
615
- function AgeTicker({
616
- match,
617
- router
618
- }) {
619
- const styles = useStyles();
620
- const rerender = React.useReducer(
621
- () => ({}),
622
- () => ({})
623
- )[1];
624
- React.useEffect(() => {
625
- const interval = setInterval(() => {
626
- rerender();
627
- }, 1e3);
628
- return () => {
629
- clearInterval(interval);
630
- };
631
- }, [rerender]);
632
- if (!match) {
633
- return null;
634
- }
635
- const route = router.looseRoutesById[match.routeId];
636
- if (!route.options.loader) {
637
- return null;
638
- }
639
- const age = Date.now() - match.updatedAt;
640
- const staleTime = route.options.staleTime ?? router.options.defaultStaleTime ?? 0;
641
- const gcTime = route.options.gcTime ?? router.options.defaultGcTime ?? 30 * 60 * 1e3;
642
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx(styles.ageTicker(age > staleTime)), children: [
643
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: formatTime(age) }),
644
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "/" }),
645
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: formatTime(staleTime) }),
646
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: "/" }),
647
- /* @__PURE__ */ jsxRuntime.jsx("div", { children: formatTime(gcTime) })
648
- ] });
649
- }
650
- function formatTime(ms) {
651
- const units = ["s", "min", "h", "d"];
652
- const values = [ms / 1e3, ms / 6e4, ms / 36e5, ms / 864e5];
653
- let chosenUnitIndex = 0;
654
- for (let i = 1; i < values.length; i++) {
655
- if (values[i] < 1) break;
656
- chosenUnitIndex = i;
657
- }
658
- const formatter = new Intl.NumberFormat(navigator.language, {
659
- compactDisplay: "short",
660
- notation: "compact",
661
- maximumFractionDigits: 0
662
- });
663
- return formatter.format(values[chosenUnitIndex]) + units[chosenUnitIndex];
664
- }
665
- const stylesFactory = (shadowDOMTarget) => {
666
- const { colors, font, size, alpha, border } = tokens.tokens;
667
- const { fontFamily, lineHeight, size: fontSize } = font;
668
- const css = shadowDOMTarget ? goober__namespace.css.bind({ target: shadowDOMTarget }) : goober__namespace.css;
669
- return {
670
- devtoolsPanelContainer: css`
671
- direction: ltr;
672
- position: fixed;
673
- bottom: 0;
674
- right: 0;
675
- z-index: 99999;
676
- width: 100%;
677
- max-height: 90%;
678
- border-top: 1px solid ${colors.gray[700]};
679
- transform-origin: top;
680
- `,
681
- devtoolsPanelContainerVisibility: (isOpen) => {
682
- return css`
683
- visibility: ${isOpen ? "visible" : "hidden"};
684
- `;
685
- },
686
- devtoolsPanelContainerResizing: (isResizing) => {
687
- if (isResizing) {
688
- return css`
689
- transition: none;
690
- `;
691
- }
692
- return css`
693
- transition: all 0.4s ease;
694
- `;
695
- },
696
- devtoolsPanelContainerAnimation: (isOpen, height) => {
697
- if (isOpen) {
698
- return css`
699
- pointer-events: auto;
700
- transform: translateY(0);
701
- `;
702
- }
703
- return css`
704
- pointer-events: none;
705
- transform: translateY(${height}px);
706
- `;
707
- },
708
- logo: css`
709
- cursor: pointer;
710
- display: flex;
711
- flex-direction: column;
712
- background-color: transparent;
713
- border: none;
714
- font-family: ${fontFamily.sans};
715
- gap: ${tokens.tokens.size[0.5]};
716
- padding: 0px;
717
- &:hover {
718
- opacity: 0.7;
719
- }
720
- &:focus-visible {
721
- outline-offset: 4px;
722
- border-radius: ${border.radius.xs};
723
- outline: 2px solid ${colors.blue[800]};
724
- }
725
- `,
726
- tanstackLogo: css`
727
- font-size: ${font.size.md};
728
- font-weight: ${font.weight.bold};
729
- line-height: ${font.lineHeight.xs};
730
- white-space: nowrap;
731
- color: ${colors.gray[300]};
732
- `,
733
- routerLogo: css`
734
- font-weight: ${font.weight.semibold};
735
- font-size: ${font.size.xs};
736
- background: linear-gradient(to right, #84cc16, #10b981);
737
- background-clip: text;
738
- -webkit-background-clip: text;
739
- line-height: 1;
740
- -webkit-text-fill-color: transparent;
741
- white-space: nowrap;
742
- `,
743
- devtoolsPanel: css`
744
- display: flex;
745
- font-size: ${fontSize.sm};
746
- font-family: ${fontFamily.sans};
747
- background-color: ${colors.darkGray[700]};
748
- color: ${colors.gray[300]};
749
-
750
- @media (max-width: 700px) {
751
- flex-direction: column;
752
- }
753
- @media (max-width: 600px) {
754
- font-size: ${fontSize.xs};
755
- }
756
- `,
757
- dragHandle: css`
758
- position: absolute;
759
- left: 0;
760
- top: 0;
761
- width: 100%;
762
- height: 4px;
763
- cursor: row-resize;
764
- z-index: 100000;
765
- &:hover {
766
- background-color: ${colors.purple[400]}${alpha[90]};
767
- }
768
- `,
769
- firstContainer: css`
770
- flex: 1 1 500px;
771
- min-height: 40%;
772
- max-height: 100%;
773
- overflow: auto;
774
- border-right: 1px solid ${colors.gray[700]};
775
- display: flex;
776
- flex-direction: column;
777
- `,
778
- routerExplorerContainer: css`
779
- overflow-y: auto;
780
- flex: 1;
781
- `,
782
- routerExplorer: css`
783
- padding: ${tokens.tokens.size[2]};
784
- `,
785
- row: css`
786
- display: flex;
787
- align-items: center;
788
- padding: ${tokens.tokens.size[2]} ${tokens.tokens.size[2.5]};
789
- gap: ${tokens.tokens.size[2.5]};
790
- border-bottom: ${colors.darkGray[500]} 1px solid;
791
- align-items: center;
792
- `,
793
- detailsHeader: css`
794
- font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
795
- position: sticky;
796
- top: 0;
797
- z-index: 2;
798
- background-color: ${colors.darkGray[600]};
799
- padding: 0px ${tokens.tokens.size[2]};
800
- font-weight: ${font.weight.medium};
801
- font-size: ${font.size.xs};
802
- min-height: ${tokens.tokens.size[8]};
803
- line-height: ${font.lineHeight.xs};
804
- text-align: left;
805
- display: flex;
806
- align-items: center;
807
- `,
808
- maskedBadge: css`
809
- background: ${colors.yellow[900]}${alpha[70]};
810
- color: ${colors.yellow[300]};
811
- display: inline-block;
812
- padding: ${tokens.tokens.size[0]} ${tokens.tokens.size[2.5]};
813
- border-radius: ${border.radius.full};
814
- font-size: ${font.size.xs};
815
- font-weight: ${font.weight.normal};
816
- border: 1px solid ${colors.yellow[300]};
817
- `,
818
- maskedLocation: css`
819
- color: ${colors.yellow[300]};
820
- `,
821
- detailsContent: css`
822
- padding: ${tokens.tokens.size[1.5]} ${tokens.tokens.size[2]};
823
- display: flex;
824
- align-items: center;
825
- justify-content: space-between;
826
- font-size: ${font.size.xs};
827
- `,
828
- routeMatchesToggle: css`
829
- display: flex;
830
- align-items: center;
831
- border: 1px solid ${colors.gray[500]};
832
- border-radius: ${border.radius.sm};
833
- overflow: hidden;
834
- `,
835
- routeMatchesToggleBtn: (active, showBorder) => {
836
- const base = css`
837
- appearance: none;
838
- border: none;
839
- font-size: 12px;
840
- padding: 4px 8px;
841
- background: transparent;
842
- cursor: pointer;
843
- font-family: ${fontFamily.sans};
844
- font-weight: ${font.weight.medium};
845
- `;
846
- const classes = [base];
847
- if (active) {
848
- const activeStyles = css`
849
- background: ${colors.darkGray[400]};
850
- color: ${colors.gray[300]};
851
- `;
852
- classes.push(activeStyles);
853
- } else {
854
- const inactiveStyles = css`
855
- color: ${colors.gray[500]};
856
- background: ${colors.darkGray[800]}${alpha[20]};
857
- `;
858
- classes.push(inactiveStyles);
859
- }
860
- if (showBorder) {
861
- classes.push(css`
862
- border-right: 1px solid ${tokens.tokens.colors.gray[500]};
863
- `);
864
- }
865
- return classes;
866
- },
867
- detailsHeaderInfo: css`
868
- flex: 1;
869
- justify-content: flex-end;
870
- display: flex;
871
- align-items: center;
872
- font-weight: ${font.weight.normal};
873
- color: ${colors.gray[400]};
874
- `,
875
- matchRow: (active) => {
876
- const base = css`
877
- display: flex;
878
- border-bottom: 1px solid ${colors.darkGray[400]};
879
- cursor: pointer;
880
- align-items: center;
881
- padding: ${size[1]} ${size[2]};
882
- gap: ${size[2]};
883
- font-size: ${fontSize.xs};
884
- color: ${colors.gray[300]};
885
- `;
886
- const classes = [base];
887
- if (active) {
888
- const activeStyles = css`
889
- background: ${colors.darkGray[500]};
890
- `;
891
- classes.push(activeStyles);
892
- }
893
- return classes;
894
- },
895
- matchIndicator: (color) => {
896
- const base = css`
897
- flex: 0 0 auto;
898
- width: ${size[3]};
899
- height: ${size[3]};
900
- background: ${colors[color][900]};
901
- border: 1px solid ${colors[color][500]};
902
- border-radius: ${border.radius.full};
903
- transition: all 0.25s ease-out;
904
- box-sizing: border-box;
905
- `;
906
- const classes = [base];
907
- if (color === "gray") {
908
- const grayStyles = css`
909
- background: ${colors.gray[700]};
910
- border-color: ${colors.gray[400]};
911
- `;
912
- classes.push(grayStyles);
913
- }
914
- return classes;
915
- },
916
- matchID: css`
917
- flex: 1;
918
- line-height: ${lineHeight["xs"]};
919
- `,
920
- ageTicker: (showWarning) => {
921
- const base = css`
922
- display: flex;
923
- gap: ${size[1]};
924
- font-size: ${fontSize.xs};
925
- color: ${colors.gray[400]};
926
- font-variant-numeric: tabular-nums;
927
- line-height: ${lineHeight["xs"]};
928
- `;
929
- const classes = [base];
930
- if (showWarning) {
931
- const warningStyles = css`
932
- color: ${colors.yellow[400]};
933
- `;
934
- classes.push(warningStyles);
935
- }
936
- return classes;
937
- },
938
- secondContainer: css`
939
- flex: 1 1 500px;
940
- min-height: 40%;
941
- max-height: 100%;
942
- overflow: auto;
943
- border-right: 1px solid ${colors.gray[700]};
944
- display: flex;
945
- flex-direction: column;
946
- `,
947
- thirdContainer: css`
948
- flex: 1 1 500px;
949
- overflow: auto;
950
- display: flex;
951
- flex-direction: column;
952
- height: 100%;
953
- border-right: 1px solid ${colors.gray[700]};
954
-
955
- @media (max-width: 700px) {
956
- border-top: 2px solid ${colors.gray[700]};
957
- }
958
- `,
959
- fourthContainer: css`
960
- flex: 1 1 500px;
961
- min-height: 40%;
962
- max-height: 100%;
963
- overflow: auto;
964
- display: flex;
965
- flex-direction: column;
966
- `,
967
- routesContainer: css`
968
- overflow-x: auto;
969
- overflow-y: visible;
970
- `,
971
- routesRowContainer: (active, isMatch) => {
972
- const base = css`
973
- display: flex;
974
- border-bottom: 1px solid ${colors.darkGray[400]};
975
- align-items: center;
976
- padding: ${size[1]} ${size[2]};
977
- gap: ${size[2]};
978
- font-size: ${fontSize.xs};
979
- color: ${colors.gray[300]};
980
- cursor: ${isMatch ? "pointer" : "default"};
981
- line-height: ${lineHeight["xs"]};
982
- `;
983
- const classes = [base];
984
- if (active) {
985
- const activeStyles = css`
986
- background: ${colors.darkGray[500]};
987
- `;
988
- classes.push(activeStyles);
989
- }
990
- return classes;
991
- },
992
- routesRow: (isMatch) => {
993
- const base = css`
994
- flex: 1 0 auto;
995
- display: flex;
996
- justify-content: space-between;
997
- align-items: center;
998
- font-size: ${fontSize.xs};
999
- line-height: ${lineHeight["xs"]};
1000
- `;
1001
- const classes = [base];
1002
- if (!isMatch) {
1003
- const matchStyles = css`
1004
- color: ${colors.gray[400]};
1005
- `;
1006
- classes.push(matchStyles);
1007
- }
1008
- return classes;
1009
- },
1010
- routeParamInfo: css`
1011
- color: ${colors.gray[400]};
1012
- font-size: ${fontSize.xs};
1013
- line-height: ${lineHeight["xs"]};
1014
- `,
1015
- nestedRouteRow: (isRoot) => {
1016
- const base = css`
1017
- margin-left: ${isRoot ? 0 : size[3.5]};
1018
- border-left: ${isRoot ? "" : `solid 1px ${colors.gray[700]}`};
1019
- `;
1020
- return base;
1021
- },
1022
- code: css`
1023
- font-size: ${fontSize.xs};
1024
- line-height: ${lineHeight["xs"]};
1025
- `,
1026
- matchesContainer: css`
1027
- flex: 1 1 auto;
1028
- overflow-y: auto;
1029
- `,
1030
- cachedMatchesContainer: css`
1031
- flex: 1 1 auto;
1032
- overflow-y: auto;
1033
- max-height: 50%;
1034
- `,
1035
- maskedBadgeContainer: css`
1036
- flex: 1;
1037
- justify-content: flex-end;
1038
- display: flex;
1039
- `,
1040
- matchDetails: css`
1041
- display: flex;
1042
- flex-direction: column;
1043
- padding: ${tokens.tokens.size[2]};
1044
- font-size: ${tokens.tokens.font.size.xs};
1045
- color: ${tokens.tokens.colors.gray[300]};
1046
- line-height: ${tokens.tokens.font.lineHeight.sm};
1047
- `,
1048
- matchStatus: (status, isFetching) => {
1049
- const colorMap = {
1050
- pending: "yellow",
1051
- success: "green",
1052
- error: "red",
1053
- notFound: "purple",
1054
- redirected: "gray"
1055
- };
1056
- const color = isFetching && status === "success" ? isFetching === "beforeLoad" ? "purple" : "blue" : colorMap[status];
1057
- return css`
1058
- display: flex;
1059
- justify-content: center;
1060
- align-items: center;
1061
- height: 40px;
1062
- border-radius: ${tokens.tokens.border.radius.sm};
1063
- font-weight: ${tokens.tokens.font.weight.normal};
1064
- background-color: ${tokens.tokens.colors[color][900]}${tokens.tokens.alpha[90]};
1065
- color: ${tokens.tokens.colors[color][300]};
1066
- border: 1px solid ${tokens.tokens.colors[color][600]};
1067
- margin-bottom: ${tokens.tokens.size[2]};
1068
- transition: all 0.25s ease-out;
1069
- `;
1070
- },
1071
- matchDetailsInfo: css`
1072
- display: flex;
1073
- justify-content: flex-end;
1074
- flex: 1;
1075
- `,
1076
- matchDetailsInfoLabel: css`
1077
- display: flex;
1078
- `,
1079
- mainCloseBtn: css`
1080
- background: ${colors.darkGray[700]};
1081
- padding: ${size[1]} ${size[2]} ${size[1]} ${size[1.5]};
1082
- border-radius: ${border.radius.md};
1083
- position: fixed;
1084
- z-index: 99999;
1085
- display: inline-flex;
1086
- width: fit-content;
1087
- cursor: pointer;
1088
- appearance: none;
1089
- border: 0;
1090
- gap: 8px;
1091
- align-items: center;
1092
- border: 1px solid ${colors.gray[500]};
1093
- font-size: ${font.size.xs};
1094
- cursor: pointer;
1095
- transition: all 0.25s ease-out;
1096
-
1097
- &:hover {
1098
- background: ${colors.darkGray[500]};
1099
- }
1100
- `,
1101
- mainCloseBtnPosition: (position) => {
1102
- const base = css`
1103
- ${position === "top-left" ? `top: ${size[2]}; left: ${size[2]};` : ""}
1104
- ${position === "top-right" ? `top: ${size[2]}; right: ${size[2]};` : ""}
1105
- ${position === "bottom-left" ? `bottom: ${size[2]}; left: ${size[2]};` : ""}
1106
- ${position === "bottom-right" ? `bottom: ${size[2]}; right: ${size[2]};` : ""}
1107
- `;
1108
- return base;
1109
- },
1110
- mainCloseBtnAnimation: (isOpen) => {
1111
- if (isOpen) {
1112
- return css`
1113
- opacity: 1;
1114
- pointer-events: auto;
1115
- visibility: visible;
1116
- `;
1117
- }
1118
- return css`
1119
- opacity: 0;
1120
- pointer-events: none;
1121
- visibility: hidden;
1122
- `;
1123
- },
1124
- routerLogoCloseButton: css`
1125
- font-weight: ${font.weight.semibold};
1126
- font-size: ${font.size.xs};
1127
- background: linear-gradient(to right, #98f30c, #00f4a3);
1128
- background-clip: text;
1129
- -webkit-background-clip: text;
1130
- line-height: 1;
1131
- -webkit-text-fill-color: transparent;
1132
- white-space: nowrap;
1133
- `,
1134
- mainCloseBtnDivider: css`
1135
- width: 1px;
1136
- background: ${tokens.tokens.colors.gray[600]};
1137
- height: 100%;
1138
- border-radius: 999999px;
1139
- color: transparent;
1140
- `,
1141
- mainCloseBtnIconContainer: css`
1142
- position: relative;
1143
- width: ${size[5]};
1144
- height: ${size[5]};
1145
- background: pink;
1146
- border-radius: 999999px;
1147
- overflow: hidden;
1148
- `,
1149
- mainCloseBtnIconOuter: css`
1150
- width: ${size[5]};
1151
- height: ${size[5]};
1152
- position: absolute;
1153
- top: 50%;
1154
- left: 50%;
1155
- transform: translate(-50%, -50%);
1156
- filter: blur(3px) saturate(1.8) contrast(2);
1157
- `,
1158
- mainCloseBtnIconInner: css`
1159
- width: ${size[4]};
1160
- height: ${size[4]};
1161
- position: absolute;
1162
- top: 50%;
1163
- left: 50%;
1164
- transform: translate(-50%, -50%);
1165
- `,
1166
- panelCloseBtn: css`
1167
- position: absolute;
1168
- cursor: pointer;
1169
- z-index: 100001;
1170
- display: flex;
1171
- align-items: center;
1172
- justify-content: center;
1173
- outline: none;
1174
- background-color: ${colors.darkGray[700]};
1175
- &:hover {
1176
- background-color: ${colors.darkGray[500]};
1177
- }
1178
-
1179
- top: 0;
1180
- right: ${size[2]};
1181
- transform: translate(0, -100%);
1182
- border-right: ${colors.darkGray[300]} 1px solid;
1183
- border-left: ${colors.darkGray[300]} 1px solid;
1184
- border-top: ${colors.darkGray[300]} 1px solid;
1185
- border-bottom: none;
1186
- border-radius: ${border.radius.sm} ${border.radius.sm} 0px 0px;
1187
- padding: ${size[1]} ${size[1.5]} ${size[0.5]} ${size[1.5]};
1188
-
1189
- &::after {
1190
- content: ' ';
1191
- position: absolute;
1192
- top: 100%;
1193
- left: -${size[2.5]};
1194
- height: ${size[1.5]};
1195
- width: calc(100% + ${size[5]});
1196
- }
1197
- `,
1198
- panelCloseBtnIcon: css`
1199
- color: ${colors.gray[400]};
1200
- width: ${size[2]};
1201
- height: ${size[2]};
1202
- `
1203
- };
1204
- };
1205
- function useStyles() {
1206
- const shadowDomTarget = React.useContext(context.ShadowDomTargetContext);
1207
- const [_styles] = React.useState(() => stylesFactory(shadowDomTarget));
1208
- return _styles;
1209
- }
1210
- exports.TanStackRouterDevtools = TanStackRouterDevtools;
1211
- exports.TanStackRouterDevtoolsPanel = TanStackRouterDevtoolsPanel;
1212
- //# sourceMappingURL=devtools.cjs.map