@tanstack/router-devtools 1.35.6 → 1.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Explorer.cjs +51 -43
- package/dist/cjs/Explorer.cjs.map +1 -1
- package/dist/cjs/context.cjs +18 -0
- package/dist/cjs/context.cjs.map +1 -0
- package/dist/cjs/context.d.cts +9 -0
- package/dist/cjs/devtools.cjs +172 -159
- package/dist/cjs/devtools.cjs.map +1 -1
- package/dist/cjs/devtools.d.cts +9 -1
- package/dist/esm/Explorer.js +41 -34
- package/dist/esm/Explorer.js.map +1 -1
- package/dist/esm/context.d.ts +9 -0
- package/dist/esm/context.js +18 -0
- package/dist/esm/context.js.map +1 -0
- package/dist/esm/devtools.d.ts +9 -1
- package/dist/esm/devtools.js +93 -97
- package/dist/esm/devtools.js.map +1 -1
- package/package.json +1 -1
- package/src/Explorer.tsx +43 -34
- package/src/context.ts +22 -0
- package/src/devtools.tsx +120 -103
package/dist/cjs/devtools.cjs
CHANGED
|
@@ -10,31 +10,45 @@ const utils = require("./utils.cjs");
|
|
|
10
10
|
const Explorer = require("./Explorer.cjs");
|
|
11
11
|
const tokens = require("./tokens.cjs");
|
|
12
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);
|
|
13
31
|
function Logo(props) {
|
|
14
32
|
const { className, ...rest } = props;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
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" })
|
|
18
37
|
] });
|
|
19
38
|
}
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"useDevtoolsOnClose must be used within a TanStackRouterDevtools component"
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
return context;
|
|
29
|
-
};
|
|
30
|
-
function TanStackRouterDevtools({
|
|
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({
|
|
31
44
|
initialIsOpen,
|
|
32
45
|
panelProps = {},
|
|
33
46
|
closeButtonProps = {},
|
|
34
47
|
toggleButtonProps = {},
|
|
35
48
|
position = "bottom-left",
|
|
36
49
|
containerElement: Container = "footer",
|
|
37
|
-
router
|
|
50
|
+
router,
|
|
51
|
+
shadowDOMTarget
|
|
38
52
|
}) {
|
|
39
53
|
const [rootEl, setRootEl] = React.useState();
|
|
40
54
|
const panelRef = React.useRef(null);
|
|
@@ -49,6 +63,7 @@ function TanStackRouterDevtools({
|
|
|
49
63
|
const [isResolvedOpen, setIsResolvedOpen] = utils.useSafeState(false);
|
|
50
64
|
const [isResizing, setIsResizing] = utils.useSafeState(false);
|
|
51
65
|
const isMounted = utils.useIsMounted();
|
|
66
|
+
const styles = useStyles();
|
|
52
67
|
const handleDragStart = (panelElement, startEvent) => {
|
|
53
68
|
if (startEvent.button !== 0)
|
|
54
69
|
return;
|
|
@@ -126,7 +141,7 @@ function TanStackRouterDevtools({
|
|
|
126
141
|
const resolvedHeight = devtoolsHeight ?? 500;
|
|
127
142
|
return /* @__PURE__ */ jsxRuntime.jsxs(Container, { ref: setRootEl, className: "TanStackRouterDevtools", children: [
|
|
128
143
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
129
|
-
DevtoolsOnCloseContext.Provider,
|
|
144
|
+
context.DevtoolsOnCloseContext.Provider,
|
|
130
145
|
{
|
|
131
146
|
value: {
|
|
132
147
|
onCloseClick: onCloseClick ?? (() => {
|
|
@@ -139,10 +154,10 @@ function TanStackRouterDevtools({
|
|
|
139
154
|
...otherPanelProps,
|
|
140
155
|
router,
|
|
141
156
|
className: clsx.clsx(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
157
|
+
styles.devtoolsPanelContainer,
|
|
158
|
+
styles.devtoolsPanelContainerVisibility(!!isOpen),
|
|
159
|
+
styles.devtoolsPanelContainerResizing(isResizing),
|
|
160
|
+
styles.devtoolsPanelContainerAnimation(
|
|
146
161
|
isResolvedOpen,
|
|
147
162
|
resolvedHeight + 16
|
|
148
163
|
)
|
|
@@ -153,7 +168,8 @@ function TanStackRouterDevtools({
|
|
|
153
168
|
},
|
|
154
169
|
isOpen: isResolvedOpen,
|
|
155
170
|
setIsOpen,
|
|
156
|
-
handleDragStart: (e) => handleDragStart(panelRef.current, e)
|
|
171
|
+
handleDragStart: (e) => handleDragStart(panelRef.current, e),
|
|
172
|
+
shadowDOMTarget
|
|
157
173
|
}
|
|
158
174
|
)
|
|
159
175
|
}
|
|
@@ -169,26 +185,27 @@ function TanStackRouterDevtools({
|
|
|
169
185
|
onToggleClick && onToggleClick(e);
|
|
170
186
|
},
|
|
171
187
|
className: clsx.clsx(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
188
|
+
styles.mainCloseBtn,
|
|
189
|
+
styles.mainCloseBtnPosition(position),
|
|
190
|
+
styles.mainCloseBtnAnimation(!isButtonClosed),
|
|
175
191
|
toggleButtonClassName
|
|
176
192
|
),
|
|
177
193
|
children: [
|
|
178
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
179
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
180
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
194
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.mainCloseBtnIconContainer, children: [
|
|
195
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.mainCloseBtnIconOuter, children: /* @__PURE__ */ jsxRuntime.jsx(logo.TanStackLogo, {}) }),
|
|
196
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.mainCloseBtnIconInner, children: /* @__PURE__ */ jsxRuntime.jsx(logo.TanStackLogo, {}) })
|
|
181
197
|
] }),
|
|
182
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
183
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
198
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.mainCloseBtnDivider, children: "-" }),
|
|
199
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.routerLogoCloseButton, children: "TanStack Router" })
|
|
184
200
|
]
|
|
185
201
|
}
|
|
186
202
|
)
|
|
187
203
|
] });
|
|
188
204
|
}
|
|
189
205
|
const TanStackRouterDevtoolsPanel = React.forwardRef(function TanStackRouterDevtoolsPanel2(props, ref) {
|
|
190
|
-
|
|
191
|
-
|
|
206
|
+
const { shadowDOMTarget } = props;
|
|
207
|
+
return /* @__PURE__ */ jsxRuntime.jsx(context.ShadowDomTargetContext.Provider, { value: shadowDOMTarget, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
208
|
+
context.DevtoolsOnCloseContext.Provider,
|
|
192
209
|
{
|
|
193
210
|
value: {
|
|
194
211
|
onCloseClick: () => {
|
|
@@ -196,7 +213,7 @@ const TanStackRouterDevtoolsPanel = React.forwardRef(function TanStackRouterDevt
|
|
|
196
213
|
},
|
|
197
214
|
children: /* @__PURE__ */ jsxRuntime.jsx(BaseTanStackRouterDevtoolsPanel, { ref, ...props })
|
|
198
215
|
}
|
|
199
|
-
);
|
|
216
|
+
) });
|
|
200
217
|
});
|
|
201
218
|
function RouteComp({
|
|
202
219
|
router,
|
|
@@ -209,6 +226,7 @@ function RouteComp({
|
|
|
209
226
|
const routerState = reactRouter.useRouterState({
|
|
210
227
|
router
|
|
211
228
|
});
|
|
229
|
+
const styles = useStyles();
|
|
212
230
|
const matches = routerState.pendingMatches || routerState.matches;
|
|
213
231
|
const match = routerState.matches.find((d) => d.routeId === route.id);
|
|
214
232
|
const param = React.useMemo(() => {
|
|
@@ -240,31 +258,31 @@ function RouteComp({
|
|
|
240
258
|
}
|
|
241
259
|
},
|
|
242
260
|
className: clsx.clsx(
|
|
243
|
-
|
|
261
|
+
styles.routesRowContainer(route.id === activeId, !!match)
|
|
244
262
|
),
|
|
245
263
|
children: [
|
|
246
264
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
247
265
|
"div",
|
|
248
266
|
{
|
|
249
267
|
className: clsx.clsx(
|
|
250
|
-
|
|
268
|
+
styles.matchIndicator(utils.getRouteStatusColor(matches, route))
|
|
251
269
|
)
|
|
252
270
|
}
|
|
253
271
|
),
|
|
254
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx(
|
|
272
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx(styles.routesRow(!!match)), children: [
|
|
255
273
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
|
|
256
|
-
/* @__PURE__ */ jsxRuntime.jsxs("code", { className:
|
|
274
|
+
/* @__PURE__ */ jsxRuntime.jsxs("code", { className: styles.code, children: [
|
|
257
275
|
isRoot ? reactRouter.rootRouteId : route.path || reactRouter.trimPath(route.id),
|
|
258
276
|
" "
|
|
259
277
|
] }),
|
|
260
|
-
/* @__PURE__ */ jsxRuntime.jsx("code", { className:
|
|
278
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { className: styles.routeParamInfo, children: param })
|
|
261
279
|
] }),
|
|
262
280
|
/* @__PURE__ */ jsxRuntime.jsx(AgeTicker, { match, router })
|
|
263
281
|
] })
|
|
264
282
|
]
|
|
265
283
|
}
|
|
266
284
|
),
|
|
267
|
-
((_a = route.children) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
285
|
+
((_a = route.children) == null ? void 0 : _a.length) ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.nestedRouteRow(!!isRoot), children: [...route.children].sort((a, b) => {
|
|
268
286
|
return a.rank - b.rank;
|
|
269
287
|
}).map((r) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
270
288
|
RouteComp,
|
|
@@ -285,9 +303,11 @@ const BaseTanStackRouterDevtoolsPanel = React.forwardRef(function BaseTanStackRo
|
|
|
285
303
|
setIsOpen,
|
|
286
304
|
handleDragStart,
|
|
287
305
|
router: userRouter,
|
|
306
|
+
shadowDOMTarget,
|
|
288
307
|
...panelProps
|
|
289
308
|
} = props;
|
|
290
|
-
const { onCloseClick } = useDevtoolsOnClose();
|
|
309
|
+
const { onCloseClick } = context.useDevtoolsOnClose();
|
|
310
|
+
const styles = useStyles();
|
|
291
311
|
const { className, ...otherPanelProps } = panelProps;
|
|
292
312
|
const contextRouter = reactRouter.useRouter({ warn: false });
|
|
293
313
|
const router = userRouter ?? contextRouter;
|
|
@@ -329,23 +349,17 @@ const BaseTanStackRouterDevtoolsPanel = React.forwardRef(function BaseTanStackRo
|
|
|
329
349
|
{
|
|
330
350
|
ref,
|
|
331
351
|
className: clsx.clsx(
|
|
332
|
-
|
|
352
|
+
styles.devtoolsPanel,
|
|
333
353
|
"TanStackRouterDevtoolsPanel",
|
|
334
354
|
className
|
|
335
355
|
),
|
|
336
356
|
...otherPanelProps,
|
|
337
357
|
children: [
|
|
338
|
-
handleDragStart ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
339
|
-
"div",
|
|
340
|
-
{
|
|
341
|
-
className: getStyles().dragHandle,
|
|
342
|
-
onMouseDown: handleDragStart
|
|
343
|
-
}
|
|
344
|
-
) : null,
|
|
358
|
+
handleDragStart ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.dragHandle, onMouseDown: handleDragStart }) : null,
|
|
345
359
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
346
360
|
"button",
|
|
347
361
|
{
|
|
348
|
-
className:
|
|
362
|
+
className: styles.panelCloseBtn,
|
|
349
363
|
onClick: (e) => {
|
|
350
364
|
setIsOpen(false);
|
|
351
365
|
onCloseClick(e);
|
|
@@ -358,7 +372,7 @@ const BaseTanStackRouterDevtoolsPanel = React.forwardRef(function BaseTanStackRo
|
|
|
358
372
|
height: "6",
|
|
359
373
|
fill: "none",
|
|
360
374
|
viewBox: "0 0 10 6",
|
|
361
|
-
className:
|
|
375
|
+
className: styles.panelCloseBtnIcon,
|
|
362
376
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
363
377
|
"path",
|
|
364
378
|
{
|
|
@@ -373,8 +387,8 @@ const BaseTanStackRouterDevtoolsPanel = React.forwardRef(function BaseTanStackRo
|
|
|
373
387
|
)
|
|
374
388
|
}
|
|
375
389
|
),
|
|
376
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
377
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
390
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.firstContainer, children: [
|
|
391
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.row, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
378
392
|
Logo,
|
|
379
393
|
{
|
|
380
394
|
"aria-hidden": true,
|
|
@@ -384,7 +398,7 @@ const BaseTanStackRouterDevtoolsPanel = React.forwardRef(function BaseTanStackRo
|
|
|
384
398
|
}
|
|
385
399
|
}
|
|
386
400
|
) }),
|
|
387
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
401
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.routerExplorerContainer, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.routerExplorer, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
388
402
|
Explorer.default,
|
|
389
403
|
{
|
|
390
404
|
label: "Router",
|
|
@@ -426,18 +440,18 @@ const BaseTanStackRouterDevtoolsPanel = React.forwardRef(function BaseTanStackRo
|
|
|
426
440
|
}
|
|
427
441
|
) }) })
|
|
428
442
|
] }),
|
|
429
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
430
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
431
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
443
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.secondContainer, children: [
|
|
444
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.matchesContainer, children: [
|
|
445
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.detailsHeader, children: [
|
|
432
446
|
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Pathname" }),
|
|
433
|
-
routerState.location.maskedLocation ? /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
447
|
+
routerState.location.maskedLocation ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.maskedBadgeContainer, children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: styles.maskedBadge, children: "masked" }) }) : null
|
|
434
448
|
] }),
|
|
435
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
449
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.detailsContent, children: [
|
|
436
450
|
/* @__PURE__ */ jsxRuntime.jsx("code", { children: routerState.location.pathname }),
|
|
437
|
-
routerState.location.maskedLocation ? /* @__PURE__ */ jsxRuntime.jsx("code", { className:
|
|
451
|
+
routerState.location.maskedLocation ? /* @__PURE__ */ jsxRuntime.jsx("code", { className: styles.maskedLocation, children: routerState.location.maskedLocation.pathname }) : null
|
|
438
452
|
] }),
|
|
439
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
440
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
453
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.detailsHeader, children: [
|
|
454
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.routeMatchesToggle, children: [
|
|
441
455
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
442
456
|
"button",
|
|
443
457
|
{
|
|
@@ -446,9 +460,7 @@ const BaseTanStackRouterDevtoolsPanel = React.forwardRef(function BaseTanStackRo
|
|
|
446
460
|
setShowMatches(false);
|
|
447
461
|
},
|
|
448
462
|
disabled: !showMatches,
|
|
449
|
-
className: clsx.clsx(
|
|
450
|
-
getStyles().routeMatchesToggleBtn(!showMatches, true)
|
|
451
|
-
),
|
|
463
|
+
className: clsx.clsx(styles.routeMatchesToggleBtn(!showMatches, true)),
|
|
452
464
|
children: "Routes"
|
|
453
465
|
}
|
|
454
466
|
),
|
|
@@ -461,15 +473,15 @@ const BaseTanStackRouterDevtoolsPanel = React.forwardRef(function BaseTanStackRo
|
|
|
461
473
|
},
|
|
462
474
|
disabled: showMatches,
|
|
463
475
|
className: clsx.clsx(
|
|
464
|
-
|
|
476
|
+
styles.routeMatchesToggleBtn(!!showMatches, false)
|
|
465
477
|
),
|
|
466
478
|
children: "Matches"
|
|
467
479
|
}
|
|
468
480
|
)
|
|
469
481
|
] }),
|
|
470
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
482
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsHeaderInfo, children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: "age / staleTime / gcTime" }) })
|
|
471
483
|
] }),
|
|
472
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx(
|
|
484
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: clsx.clsx(styles.routesContainer), children: !showMatches ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
473
485
|
RouteComp,
|
|
474
486
|
{
|
|
475
487
|
router,
|
|
@@ -486,22 +498,20 @@ const BaseTanStackRouterDevtoolsPanel = React.forwardRef(function BaseTanStackRo
|
|
|
486
498
|
role: "button",
|
|
487
499
|
"aria-label": `Open match details for ${match.id}`,
|
|
488
500
|
onClick: () => setActiveId(activeId === match.id ? "" : match.id),
|
|
489
|
-
className: clsx.clsx(
|
|
490
|
-
getStyles().matchRow(match === activeMatch)
|
|
491
|
-
),
|
|
501
|
+
className: clsx.clsx(styles.matchRow(match === activeMatch)),
|
|
492
502
|
children: [
|
|
493
503
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
494
504
|
"div",
|
|
495
505
|
{
|
|
496
506
|
className: clsx.clsx(
|
|
497
|
-
|
|
507
|
+
styles.matchIndicator(utils.getStatusColor(match))
|
|
498
508
|
)
|
|
499
509
|
}
|
|
500
510
|
),
|
|
501
511
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
502
512
|
"code",
|
|
503
513
|
{
|
|
504
|
-
className:
|
|
514
|
+
className: styles.matchID,
|
|
505
515
|
children: `${match.routeId === reactRouter.rootRouteId ? reactRouter.rootRouteId : match.pathname}`
|
|
506
516
|
}
|
|
507
517
|
),
|
|
@@ -513,10 +523,10 @@ const BaseTanStackRouterDevtoolsPanel = React.forwardRef(function BaseTanStackRo
|
|
|
513
523
|
}
|
|
514
524
|
) }) })
|
|
515
525
|
] }),
|
|
516
|
-
routerState.cachedMatches.length ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
517
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
526
|
+
routerState.cachedMatches.length ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.cachedMatchesContainer, children: [
|
|
527
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.detailsHeader, children: [
|
|
518
528
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: "Cached Matches" }),
|
|
519
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
529
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsHeaderInfo, children: "age / staleTime / gcTime" })
|
|
520
530
|
] }),
|
|
521
531
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: routerState.cachedMatches.map((match) => {
|
|
522
532
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -525,17 +535,17 @@ const BaseTanStackRouterDevtoolsPanel = React.forwardRef(function BaseTanStackRo
|
|
|
525
535
|
role: "button",
|
|
526
536
|
"aria-label": `Open match details for ${match.id}`,
|
|
527
537
|
onClick: () => setActiveId(activeId === match.id ? "" : match.id),
|
|
528
|
-
className: clsx.clsx(
|
|
538
|
+
className: clsx.clsx(styles.matchRow(match === activeMatch)),
|
|
529
539
|
children: [
|
|
530
540
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
531
541
|
"div",
|
|
532
542
|
{
|
|
533
543
|
className: clsx.clsx(
|
|
534
|
-
|
|
544
|
+
styles.matchIndicator(utils.getStatusColor(match))
|
|
535
545
|
)
|
|
536
546
|
}
|
|
537
547
|
),
|
|
538
|
-
/* @__PURE__ */ jsxRuntime.jsx("code", { className:
|
|
548
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { className: styles.matchID, children: `${match.id}` }),
|
|
539
549
|
/* @__PURE__ */ jsxRuntime.jsx(AgeTicker, { match, router })
|
|
540
550
|
]
|
|
541
551
|
},
|
|
@@ -544,37 +554,37 @@ const BaseTanStackRouterDevtoolsPanel = React.forwardRef(function BaseTanStackRo
|
|
|
544
554
|
}) })
|
|
545
555
|
] }) : null
|
|
546
556
|
] }),
|
|
547
|
-
activeMatch ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
548
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
549
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
557
|
+
activeMatch ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.thirdContainer, children: [
|
|
558
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsHeader, children: "Match Details" }),
|
|
559
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.matchDetails, children: [
|
|
550
560
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
551
561
|
"div",
|
|
552
562
|
{
|
|
553
|
-
className:
|
|
563
|
+
className: styles.matchStatus(
|
|
554
564
|
activeMatch.status,
|
|
555
565
|
activeMatch.isFetching
|
|
556
566
|
),
|
|
557
567
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { children: activeMatch.status === "success" && activeMatch.isFetching ? "fetching" : activeMatch.status })
|
|
558
568
|
}
|
|
559
569
|
),
|
|
560
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
570
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.matchDetailsInfoLabel, children: [
|
|
561
571
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: "ID:" }),
|
|
562
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
572
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.matchDetailsInfo, children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: activeMatch.id }) })
|
|
563
573
|
] }),
|
|
564
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
574
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.matchDetailsInfoLabel, children: [
|
|
565
575
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: "State:" }),
|
|
566
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
576
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.matchDetailsInfo, children: ((_a = routerState.pendingMatches) == null ? void 0 : _a.find(
|
|
567
577
|
(d) => d.id === activeMatch.id
|
|
568
578
|
)) ? "Pending" : routerState.matches.find((d) => d.id === activeMatch.id) ? "Active" : "Cached" })
|
|
569
579
|
] }),
|
|
570
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
580
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.matchDetailsInfoLabel, children: [
|
|
571
581
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: "Last Updated:" }),
|
|
572
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
582
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.matchDetailsInfo, children: activeMatch.updatedAt ? new Date(activeMatch.updatedAt).toLocaleTimeString() : "N/A" })
|
|
573
583
|
] })
|
|
574
584
|
] }) }),
|
|
575
585
|
activeMatch.loaderData ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
576
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
577
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
586
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsHeader, children: "Loader Data" }),
|
|
587
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsContent, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
578
588
|
Explorer.default,
|
|
579
589
|
{
|
|
580
590
|
label: "loaderData",
|
|
@@ -583,12 +593,12 @@ const BaseTanStackRouterDevtoolsPanel = React.forwardRef(function BaseTanStackRo
|
|
|
583
593
|
}
|
|
584
594
|
) })
|
|
585
595
|
] }) : null,
|
|
586
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
587
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
596
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsHeader, children: "Explorer" }),
|
|
597
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsContent, children: /* @__PURE__ */ jsxRuntime.jsx(Explorer.default, { label: "Match", value: activeMatch, defaultExpanded: {} }) })
|
|
588
598
|
] }) : null,
|
|
589
|
-
hasSearch ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
590
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
591
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
599
|
+
hasSearch ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: styles.fourthContainer, children: [
|
|
600
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsHeader, children: "Search Params" }),
|
|
601
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: styles.detailsContent, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
592
602
|
Explorer.default,
|
|
593
603
|
{
|
|
594
604
|
value: routerState.location.search,
|
|
@@ -610,6 +620,7 @@ function AgeTicker({
|
|
|
610
620
|
match,
|
|
611
621
|
router
|
|
612
622
|
}) {
|
|
623
|
+
const styles = useStyles();
|
|
613
624
|
const rerender = React.useReducer(
|
|
614
625
|
() => ({}),
|
|
615
626
|
() => ({})
|
|
@@ -632,7 +643,7 @@ function AgeTicker({
|
|
|
632
643
|
const age = Date.now() - match.updatedAt;
|
|
633
644
|
const staleTime = route.options.staleTime ?? router.options.defaultStaleTime ?? 0;
|
|
634
645
|
const gcTime = route.options.gcTime ?? router.options.defaultGcTime ?? 30 * 60 * 1e3;
|
|
635
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx(
|
|
646
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: clsx.clsx(styles.ageTicker(age > staleTime)), children: [
|
|
636
647
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: formatTime(age) }),
|
|
637
648
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: "/" }),
|
|
638
649
|
/* @__PURE__ */ jsxRuntime.jsx("div", { children: formatTime(staleTime) }),
|
|
@@ -656,11 +667,12 @@ function formatTime(ms) {
|
|
|
656
667
|
});
|
|
657
668
|
return formatter.format(values[chosenUnitIndex]) + units[chosenUnitIndex];
|
|
658
669
|
}
|
|
659
|
-
const stylesFactory = () => {
|
|
670
|
+
const stylesFactory = (shadowDOMTarget) => {
|
|
660
671
|
const { colors, font, size, alpha, shadow, border } = tokens.tokens;
|
|
661
672
|
const { fontFamily, lineHeight, size: fontSize } = font;
|
|
673
|
+
const css = shadowDOMTarget ? goober__namespace.css.bind({ target: shadowDOMTarget }) : goober__namespace.css;
|
|
662
674
|
return {
|
|
663
|
-
devtoolsPanelContainer:
|
|
675
|
+
devtoolsPanelContainer: css`
|
|
664
676
|
direction: ltr;
|
|
665
677
|
position: fixed;
|
|
666
678
|
bottom: 0;
|
|
@@ -672,33 +684,33 @@ const stylesFactory = () => {
|
|
|
672
684
|
transform-origin: top;
|
|
673
685
|
`,
|
|
674
686
|
devtoolsPanelContainerVisibility: (isOpen) => {
|
|
675
|
-
return
|
|
687
|
+
return css`
|
|
676
688
|
visibility: ${isOpen ? "visible" : "hidden"};
|
|
677
689
|
`;
|
|
678
690
|
},
|
|
679
691
|
devtoolsPanelContainerResizing: (isResizing) => {
|
|
680
692
|
if (isResizing) {
|
|
681
|
-
return
|
|
693
|
+
return css`
|
|
682
694
|
transition: none;
|
|
683
695
|
`;
|
|
684
696
|
}
|
|
685
|
-
return
|
|
697
|
+
return css`
|
|
686
698
|
transition: all 0.4s ease;
|
|
687
699
|
`;
|
|
688
700
|
},
|
|
689
701
|
devtoolsPanelContainerAnimation: (isOpen, height) => {
|
|
690
702
|
if (isOpen) {
|
|
691
|
-
return
|
|
703
|
+
return css`
|
|
692
704
|
pointer-events: auto;
|
|
693
705
|
transform: translateY(0);
|
|
694
706
|
`;
|
|
695
707
|
}
|
|
696
|
-
return
|
|
708
|
+
return css`
|
|
697
709
|
pointer-events: none;
|
|
698
710
|
transform: translateY(${height}px);
|
|
699
711
|
`;
|
|
700
712
|
},
|
|
701
|
-
logo:
|
|
713
|
+
logo: css`
|
|
702
714
|
cursor: pointer;
|
|
703
715
|
display: flex;
|
|
704
716
|
flex-direction: column;
|
|
@@ -716,14 +728,14 @@ const stylesFactory = () => {
|
|
|
716
728
|
outline: 2px solid ${colors.blue[800]};
|
|
717
729
|
}
|
|
718
730
|
`,
|
|
719
|
-
tanstackLogo:
|
|
731
|
+
tanstackLogo: css`
|
|
720
732
|
font-size: ${font.size.md};
|
|
721
733
|
font-weight: ${font.weight.bold};
|
|
722
734
|
line-height: ${font.lineHeight.xs};
|
|
723
735
|
white-space: nowrap;
|
|
724
736
|
color: ${colors.gray[300]};
|
|
725
737
|
`,
|
|
726
|
-
routerLogo:
|
|
738
|
+
routerLogo: css`
|
|
727
739
|
font-weight: ${font.weight.semibold};
|
|
728
740
|
font-size: ${font.size.xs};
|
|
729
741
|
background: linear-gradient(to right, #84cc16, #10b981);
|
|
@@ -733,7 +745,7 @@ const stylesFactory = () => {
|
|
|
733
745
|
-webkit-text-fill-color: transparent;
|
|
734
746
|
white-space: nowrap;
|
|
735
747
|
`,
|
|
736
|
-
devtoolsPanel:
|
|
748
|
+
devtoolsPanel: css`
|
|
737
749
|
display: flex;
|
|
738
750
|
font-size: ${fontSize.sm};
|
|
739
751
|
font-family: ${fontFamily.sans};
|
|
@@ -747,7 +759,7 @@ const stylesFactory = () => {
|
|
|
747
759
|
font-size: ${fontSize.xs};
|
|
748
760
|
}
|
|
749
761
|
`,
|
|
750
|
-
dragHandle:
|
|
762
|
+
dragHandle: css`
|
|
751
763
|
position: absolute;
|
|
752
764
|
left: 0;
|
|
753
765
|
top: 0;
|
|
@@ -759,7 +771,7 @@ const stylesFactory = () => {
|
|
|
759
771
|
background-color: ${colors.purple[400]}${alpha[90]};
|
|
760
772
|
}
|
|
761
773
|
`,
|
|
762
|
-
firstContainer:
|
|
774
|
+
firstContainer: css`
|
|
763
775
|
flex: 1 1 500px;
|
|
764
776
|
min-height: 40%;
|
|
765
777
|
max-height: 100%;
|
|
@@ -768,14 +780,14 @@ const stylesFactory = () => {
|
|
|
768
780
|
display: flex;
|
|
769
781
|
flex-direction: column;
|
|
770
782
|
`,
|
|
771
|
-
routerExplorerContainer:
|
|
783
|
+
routerExplorerContainer: css`
|
|
772
784
|
overflow-y: auto;
|
|
773
785
|
flex: 1;
|
|
774
786
|
`,
|
|
775
|
-
routerExplorer:
|
|
787
|
+
routerExplorer: css`
|
|
776
788
|
padding: ${tokens.tokens.size[2]};
|
|
777
789
|
`,
|
|
778
|
-
row:
|
|
790
|
+
row: css`
|
|
779
791
|
display: flex;
|
|
780
792
|
align-items: center;
|
|
781
793
|
padding: ${tokens.tokens.size[2]} ${tokens.tokens.size[2.5]};
|
|
@@ -783,7 +795,7 @@ const stylesFactory = () => {
|
|
|
783
795
|
border-bottom: ${colors.darkGray[500]} 1px solid;
|
|
784
796
|
align-items: center;
|
|
785
797
|
`,
|
|
786
|
-
detailsHeader:
|
|
798
|
+
detailsHeader: css`
|
|
787
799
|
font-family: ui-sans-serif, Inter, system-ui, sans-serif, sans-serif;
|
|
788
800
|
position: sticky;
|
|
789
801
|
top: 0;
|
|
@@ -798,7 +810,7 @@ const stylesFactory = () => {
|
|
|
798
810
|
display: flex;
|
|
799
811
|
align-items: center;
|
|
800
812
|
`,
|
|
801
|
-
maskedBadge:
|
|
813
|
+
maskedBadge: css`
|
|
802
814
|
background: ${colors.yellow[900]}${alpha[70]};
|
|
803
815
|
color: ${colors.yellow[300]};
|
|
804
816
|
display: inline-block;
|
|
@@ -808,16 +820,16 @@ const stylesFactory = () => {
|
|
|
808
820
|
font-weight: ${font.weight.normal};
|
|
809
821
|
border: 1px solid ${colors.yellow[300]};
|
|
810
822
|
`,
|
|
811
|
-
maskedLocation:
|
|
823
|
+
maskedLocation: css`
|
|
812
824
|
color: ${colors.yellow[300]};
|
|
813
825
|
`,
|
|
814
|
-
detailsContent:
|
|
826
|
+
detailsContent: css`
|
|
815
827
|
padding: ${tokens.tokens.size[1.5]} ${tokens.tokens.size[2]};
|
|
816
828
|
display: flex;
|
|
817
829
|
align-items: center;
|
|
818
830
|
font-size: ${font.size.xs};
|
|
819
831
|
`,
|
|
820
|
-
routeMatchesToggle:
|
|
832
|
+
routeMatchesToggle: css`
|
|
821
833
|
display: flex;
|
|
822
834
|
align-items: center;
|
|
823
835
|
border: 1px solid ${colors.gray[500]};
|
|
@@ -825,7 +837,7 @@ const stylesFactory = () => {
|
|
|
825
837
|
overflow: hidden;
|
|
826
838
|
`,
|
|
827
839
|
routeMatchesToggleBtn: (active, showBorder) => {
|
|
828
|
-
const base =
|
|
840
|
+
const base = css`
|
|
829
841
|
appearance: none;
|
|
830
842
|
border: none;
|
|
831
843
|
font-size: 12px;
|
|
@@ -837,26 +849,26 @@ const stylesFactory = () => {
|
|
|
837
849
|
`;
|
|
838
850
|
const classes = [base];
|
|
839
851
|
if (active) {
|
|
840
|
-
const activeStyles =
|
|
852
|
+
const activeStyles = css`
|
|
841
853
|
background: ${colors.darkGray[400]};
|
|
842
854
|
color: ${colors.gray[300]};
|
|
843
855
|
`;
|
|
844
856
|
classes.push(activeStyles);
|
|
845
857
|
} else {
|
|
846
|
-
const inactiveStyles =
|
|
858
|
+
const inactiveStyles = css`
|
|
847
859
|
color: ${colors.gray[500]};
|
|
848
860
|
background: ${colors.darkGray[800]}${alpha[20]};
|
|
849
861
|
`;
|
|
850
862
|
classes.push(inactiveStyles);
|
|
851
863
|
}
|
|
852
864
|
if (showBorder) {
|
|
853
|
-
classes.push(
|
|
865
|
+
classes.push(css`
|
|
854
866
|
border-right: 1px solid ${tokens.tokens.colors.gray[500]};
|
|
855
867
|
`);
|
|
856
868
|
}
|
|
857
869
|
return classes;
|
|
858
870
|
},
|
|
859
|
-
detailsHeaderInfo:
|
|
871
|
+
detailsHeaderInfo: css`
|
|
860
872
|
flex: 1;
|
|
861
873
|
justify-content: flex-end;
|
|
862
874
|
display: flex;
|
|
@@ -865,7 +877,7 @@ const stylesFactory = () => {
|
|
|
865
877
|
color: ${colors.gray[400]};
|
|
866
878
|
`,
|
|
867
879
|
matchRow: (active) => {
|
|
868
|
-
const base =
|
|
880
|
+
const base = css`
|
|
869
881
|
display: flex;
|
|
870
882
|
border-bottom: 1px solid ${colors.darkGray[400]};
|
|
871
883
|
cursor: pointer;
|
|
@@ -877,7 +889,7 @@ const stylesFactory = () => {
|
|
|
877
889
|
`;
|
|
878
890
|
const classes = [base];
|
|
879
891
|
if (active) {
|
|
880
|
-
const activeStyles =
|
|
892
|
+
const activeStyles = css`
|
|
881
893
|
background: ${colors.darkGray[500]};
|
|
882
894
|
`;
|
|
883
895
|
classes.push(activeStyles);
|
|
@@ -885,7 +897,7 @@ const stylesFactory = () => {
|
|
|
885
897
|
return classes;
|
|
886
898
|
},
|
|
887
899
|
matchIndicator: (color) => {
|
|
888
|
-
const base =
|
|
900
|
+
const base = css`
|
|
889
901
|
flex: 0 0 auto;
|
|
890
902
|
width: ${size[3]};
|
|
891
903
|
height: ${size[3]};
|
|
@@ -897,7 +909,7 @@ const stylesFactory = () => {
|
|
|
897
909
|
`;
|
|
898
910
|
const classes = [base];
|
|
899
911
|
if (color === "gray") {
|
|
900
|
-
const grayStyles =
|
|
912
|
+
const grayStyles = css`
|
|
901
913
|
background: ${colors.gray[700]};
|
|
902
914
|
border-color: ${colors.gray[400]};
|
|
903
915
|
`;
|
|
@@ -905,12 +917,12 @@ const stylesFactory = () => {
|
|
|
905
917
|
}
|
|
906
918
|
return classes;
|
|
907
919
|
},
|
|
908
|
-
matchID:
|
|
920
|
+
matchID: css`
|
|
909
921
|
flex: 1;
|
|
910
922
|
line-height: ${lineHeight["xs"]};
|
|
911
923
|
`,
|
|
912
924
|
ageTicker: (showWarning) => {
|
|
913
|
-
const base =
|
|
925
|
+
const base = css`
|
|
914
926
|
display: flex;
|
|
915
927
|
gap: ${size[1]};
|
|
916
928
|
font-size: ${fontSize.xs};
|
|
@@ -920,14 +932,14 @@ const stylesFactory = () => {
|
|
|
920
932
|
`;
|
|
921
933
|
const classes = [base];
|
|
922
934
|
if (showWarning) {
|
|
923
|
-
const warningStyles =
|
|
935
|
+
const warningStyles = css`
|
|
924
936
|
color: ${colors.yellow[400]};
|
|
925
937
|
`;
|
|
926
938
|
classes.push(warningStyles);
|
|
927
939
|
}
|
|
928
940
|
return classes;
|
|
929
941
|
},
|
|
930
|
-
secondContainer:
|
|
942
|
+
secondContainer: css`
|
|
931
943
|
flex: 1 1 500px;
|
|
932
944
|
min-height: 40%;
|
|
933
945
|
max-height: 100%;
|
|
@@ -936,7 +948,7 @@ const stylesFactory = () => {
|
|
|
936
948
|
display: flex;
|
|
937
949
|
flex-direction: column;
|
|
938
950
|
`,
|
|
939
|
-
thirdContainer:
|
|
951
|
+
thirdContainer: css`
|
|
940
952
|
flex: 1 1 500px;
|
|
941
953
|
overflow: auto;
|
|
942
954
|
display: flex;
|
|
@@ -948,7 +960,7 @@ const stylesFactory = () => {
|
|
|
948
960
|
border-top: 2px solid ${colors.gray[700]};
|
|
949
961
|
}
|
|
950
962
|
`,
|
|
951
|
-
fourthContainer:
|
|
963
|
+
fourthContainer: css`
|
|
952
964
|
flex: 1 1 500px;
|
|
953
965
|
min-height: 40%;
|
|
954
966
|
max-height: 100%;
|
|
@@ -956,12 +968,12 @@ const stylesFactory = () => {
|
|
|
956
968
|
display: flex;
|
|
957
969
|
flex-direction: column;
|
|
958
970
|
`,
|
|
959
|
-
routesContainer:
|
|
971
|
+
routesContainer: css`
|
|
960
972
|
overflow-x: auto;
|
|
961
973
|
overflow-y: visible;
|
|
962
974
|
`,
|
|
963
975
|
routesRowContainer: (active, isMatch) => {
|
|
964
|
-
const base =
|
|
976
|
+
const base = css`
|
|
965
977
|
display: flex;
|
|
966
978
|
border-bottom: 1px solid ${colors.darkGray[400]};
|
|
967
979
|
align-items: center;
|
|
@@ -974,7 +986,7 @@ const stylesFactory = () => {
|
|
|
974
986
|
`;
|
|
975
987
|
const classes = [base];
|
|
976
988
|
if (active) {
|
|
977
|
-
const activeStyles =
|
|
989
|
+
const activeStyles = css`
|
|
978
990
|
background: ${colors.darkGray[500]};
|
|
979
991
|
`;
|
|
980
992
|
classes.push(activeStyles);
|
|
@@ -982,7 +994,7 @@ const stylesFactory = () => {
|
|
|
982
994
|
return classes;
|
|
983
995
|
},
|
|
984
996
|
routesRow: (isMatch) => {
|
|
985
|
-
const base =
|
|
997
|
+
const base = css`
|
|
986
998
|
flex: 1 0 auto;
|
|
987
999
|
display: flex;
|
|
988
1000
|
justify-content: space-between;
|
|
@@ -992,44 +1004,44 @@ const stylesFactory = () => {
|
|
|
992
1004
|
`;
|
|
993
1005
|
const classes = [base];
|
|
994
1006
|
if (!isMatch) {
|
|
995
|
-
const matchStyles =
|
|
1007
|
+
const matchStyles = css`
|
|
996
1008
|
color: ${colors.gray[400]};
|
|
997
1009
|
`;
|
|
998
1010
|
classes.push(matchStyles);
|
|
999
1011
|
}
|
|
1000
1012
|
return classes;
|
|
1001
1013
|
},
|
|
1002
|
-
routeParamInfo:
|
|
1014
|
+
routeParamInfo: css`
|
|
1003
1015
|
color: ${colors.gray[400]};
|
|
1004
1016
|
font-size: ${fontSize.xs};
|
|
1005
1017
|
line-height: ${lineHeight["xs"]};
|
|
1006
1018
|
`,
|
|
1007
1019
|
nestedRouteRow: (isRoot) => {
|
|
1008
|
-
const base =
|
|
1020
|
+
const base = css`
|
|
1009
1021
|
margin-left: ${isRoot ? 0 : size[3.5]};
|
|
1010
1022
|
border-left: ${isRoot ? "" : `solid 1px ${colors.gray[700]}`};
|
|
1011
1023
|
`;
|
|
1012
1024
|
return base;
|
|
1013
1025
|
},
|
|
1014
|
-
code:
|
|
1026
|
+
code: css`
|
|
1015
1027
|
font-size: ${fontSize.xs};
|
|
1016
1028
|
line-height: ${lineHeight["xs"]};
|
|
1017
1029
|
`,
|
|
1018
|
-
matchesContainer:
|
|
1030
|
+
matchesContainer: css`
|
|
1019
1031
|
flex: 1 1 auto;
|
|
1020
1032
|
overflow-y: auto;
|
|
1021
1033
|
`,
|
|
1022
|
-
cachedMatchesContainer:
|
|
1034
|
+
cachedMatchesContainer: css`
|
|
1023
1035
|
flex: 1 1 auto;
|
|
1024
1036
|
overflow-y: auto;
|
|
1025
1037
|
max-height: 50%;
|
|
1026
1038
|
`,
|
|
1027
|
-
maskedBadgeContainer:
|
|
1039
|
+
maskedBadgeContainer: css`
|
|
1028
1040
|
flex: 1;
|
|
1029
1041
|
justify-content: flex-end;
|
|
1030
1042
|
display: flex;
|
|
1031
1043
|
`,
|
|
1032
|
-
matchDetails:
|
|
1044
|
+
matchDetails: css`
|
|
1033
1045
|
display: flex;
|
|
1034
1046
|
flex-direction: column;
|
|
1035
1047
|
padding: ${tokens.tokens.size[2]};
|
|
@@ -1046,7 +1058,7 @@ const stylesFactory = () => {
|
|
|
1046
1058
|
redirected: "gray"
|
|
1047
1059
|
};
|
|
1048
1060
|
const color = isFetching && status === "success" ? isFetching === "beforeLoad" ? "purple" : "blue" : colorMap[status];
|
|
1049
|
-
return
|
|
1061
|
+
return css`
|
|
1050
1062
|
display: flex;
|
|
1051
1063
|
justify-content: center;
|
|
1052
1064
|
align-items: center;
|
|
@@ -1060,15 +1072,15 @@ const stylesFactory = () => {
|
|
|
1060
1072
|
transition: all 0.25s ease-out;
|
|
1061
1073
|
`;
|
|
1062
1074
|
},
|
|
1063
|
-
matchDetailsInfo:
|
|
1075
|
+
matchDetailsInfo: css`
|
|
1064
1076
|
display: flex;
|
|
1065
1077
|
justify-content: flex-end;
|
|
1066
1078
|
flex: 1;
|
|
1067
1079
|
`,
|
|
1068
|
-
matchDetailsInfoLabel:
|
|
1080
|
+
matchDetailsInfoLabel: css`
|
|
1069
1081
|
display: flex;
|
|
1070
1082
|
`,
|
|
1071
|
-
mainCloseBtn:
|
|
1083
|
+
mainCloseBtn: css`
|
|
1072
1084
|
background: ${colors.darkGray[700]};
|
|
1073
1085
|
padding: ${size[1]} ${size[2]} ${size[1]} ${size[1.5]};
|
|
1074
1086
|
border-radius: ${border.radius.md};
|
|
@@ -1091,7 +1103,7 @@ const stylesFactory = () => {
|
|
|
1091
1103
|
}
|
|
1092
1104
|
`,
|
|
1093
1105
|
mainCloseBtnPosition: (position) => {
|
|
1094
|
-
const base =
|
|
1106
|
+
const base = css`
|
|
1095
1107
|
${position === "top-left" ? `top: ${size[2]}; left: ${size[2]};` : ""}
|
|
1096
1108
|
${position === "top-right" ? `top: ${size[2]}; right: ${size[2]};` : ""}
|
|
1097
1109
|
${position === "bottom-left" ? `bottom: ${size[2]}; left: ${size[2]};` : ""}
|
|
@@ -1101,19 +1113,19 @@ const stylesFactory = () => {
|
|
|
1101
1113
|
},
|
|
1102
1114
|
mainCloseBtnAnimation: (isOpen) => {
|
|
1103
1115
|
if (isOpen) {
|
|
1104
|
-
return
|
|
1116
|
+
return css`
|
|
1105
1117
|
opacity: 1;
|
|
1106
1118
|
pointer-events: auto;
|
|
1107
1119
|
visibility: visible;
|
|
1108
1120
|
`;
|
|
1109
1121
|
}
|
|
1110
|
-
return
|
|
1122
|
+
return css`
|
|
1111
1123
|
opacity: 0;
|
|
1112
1124
|
pointer-events: none;
|
|
1113
1125
|
visibility: hidden;
|
|
1114
1126
|
`;
|
|
1115
1127
|
},
|
|
1116
|
-
routerLogoCloseButton:
|
|
1128
|
+
routerLogoCloseButton: css`
|
|
1117
1129
|
font-weight: ${font.weight.semibold};
|
|
1118
1130
|
font-size: ${font.size.xs};
|
|
1119
1131
|
background: linear-gradient(to right, #98f30c, #00f4a3);
|
|
@@ -1123,14 +1135,14 @@ const stylesFactory = () => {
|
|
|
1123
1135
|
-webkit-text-fill-color: transparent;
|
|
1124
1136
|
white-space: nowrap;
|
|
1125
1137
|
`,
|
|
1126
|
-
mainCloseBtnDivider:
|
|
1138
|
+
mainCloseBtnDivider: css`
|
|
1127
1139
|
width: 1px;
|
|
1128
1140
|
background: ${tokens.tokens.colors.gray[600]};
|
|
1129
1141
|
height: 100%;
|
|
1130
1142
|
border-radius: 999999px;
|
|
1131
1143
|
color: transparent;
|
|
1132
1144
|
`,
|
|
1133
|
-
mainCloseBtnIconContainer:
|
|
1145
|
+
mainCloseBtnIconContainer: css`
|
|
1134
1146
|
position: relative;
|
|
1135
1147
|
width: ${size[5]};
|
|
1136
1148
|
height: ${size[5]};
|
|
@@ -1138,7 +1150,7 @@ const stylesFactory = () => {
|
|
|
1138
1150
|
border-radius: 999999px;
|
|
1139
1151
|
overflow: hidden;
|
|
1140
1152
|
`,
|
|
1141
|
-
mainCloseBtnIconOuter:
|
|
1153
|
+
mainCloseBtnIconOuter: css`
|
|
1142
1154
|
width: ${size[5]};
|
|
1143
1155
|
height: ${size[5]};
|
|
1144
1156
|
position: absolute;
|
|
@@ -1147,7 +1159,7 @@ const stylesFactory = () => {
|
|
|
1147
1159
|
transform: translate(-50%, -50%);
|
|
1148
1160
|
filter: blur(3px) saturate(1.8) contrast(2);
|
|
1149
1161
|
`,
|
|
1150
|
-
mainCloseBtnIconInner:
|
|
1162
|
+
mainCloseBtnIconInner: css`
|
|
1151
1163
|
width: ${size[4]};
|
|
1152
1164
|
height: ${size[4]};
|
|
1153
1165
|
position: absolute;
|
|
@@ -1155,7 +1167,7 @@ const stylesFactory = () => {
|
|
|
1155
1167
|
left: 50%;
|
|
1156
1168
|
transform: translate(-50%, -50%);
|
|
1157
1169
|
`,
|
|
1158
|
-
panelCloseBtn:
|
|
1170
|
+
panelCloseBtn: css`
|
|
1159
1171
|
position: absolute;
|
|
1160
1172
|
cursor: pointer;
|
|
1161
1173
|
z-index: 100001;
|
|
@@ -1187,7 +1199,7 @@ const stylesFactory = () => {
|
|
|
1187
1199
|
width: calc(100% + ${size[5]});
|
|
1188
1200
|
}
|
|
1189
1201
|
`,
|
|
1190
|
-
panelCloseBtnIcon:
|
|
1202
|
+
panelCloseBtnIcon: css`
|
|
1191
1203
|
color: ${colors.gray[400]};
|
|
1192
1204
|
width: ${size[2]};
|
|
1193
1205
|
height: ${size[2]};
|
|
@@ -1195,10 +1207,11 @@ const stylesFactory = () => {
|
|
|
1195
1207
|
};
|
|
1196
1208
|
};
|
|
1197
1209
|
let _styles = null;
|
|
1198
|
-
function
|
|
1210
|
+
function useStyles() {
|
|
1211
|
+
const shadowDomTarget = React.useContext(context.ShadowDomTargetContext);
|
|
1199
1212
|
if (_styles)
|
|
1200
1213
|
return _styles;
|
|
1201
|
-
_styles = stylesFactory();
|
|
1214
|
+
_styles = stylesFactory(shadowDomTarget);
|
|
1202
1215
|
return _styles;
|
|
1203
1216
|
}
|
|
1204
1217
|
exports.TanStackRouterDevtools = TanStackRouterDevtools;
|