@tanstack/router-devtools 0.0.1-beta.140 → 0.0.1-beta.142

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tanstack/router-devtools",
3
3
  "author": "Tanner Linsley",
4
- "version": "0.0.1-beta.140",
4
+ "version": "0.0.1-beta.142",
5
5
  "license": "MIT",
6
6
  "repository": "tanstack/router",
7
7
  "homepage": "https://tanstack.com/router/",
@@ -42,7 +42,7 @@
42
42
  "dependencies": {
43
43
  "@babel/runtime": "^7.16.7",
44
44
  "date-fns": "^2.29.1",
45
- "@tanstack/router": "0.0.1-beta.140"
45
+ "@tanstack/router": "0.0.1-beta.142"
46
46
  },
47
47
  "scripts": {
48
48
  "build": "rollup --config rollup.config.js"
package/src/devtools.tsx CHANGED
@@ -422,7 +422,7 @@ function RouteComp({
422
422
  activeRouteId: string | undefined
423
423
  setActiveRouteId: (id: string) => void
424
424
  }) {
425
- const isActive = matches.find((d) => d.routeId === route.id)
425
+ const match = matches.find((d) => d.routeId === route.id)
426
426
 
427
427
  return (
428
428
  <div>
@@ -430,13 +430,13 @@ function RouteComp({
430
430
  role="button"
431
431
  aria-label={`Open match details for ${route.id}`}
432
432
  onClick={() => {
433
- if (isActive)
433
+ if (match)
434
434
  setActiveRouteId(activeRouteId === route.id ? '' : route.id)
435
435
  }}
436
436
  style={{
437
437
  display: 'flex',
438
438
  borderBottom: `solid 1px ${theme.grayAlt}`,
439
- cursor: isActive ? 'pointer' : 'default',
439
+ cursor: match ? 'pointer' : 'default',
440
440
  alignItems: 'center',
441
441
  background:
442
442
  route.id === activeRouteId ? 'rgba(255,255,255,.1)' : undefined,
@@ -455,17 +455,23 @@ function RouteComp({
455
455
  borderRadius: '100%',
456
456
  transition: 'all .2s ease-out',
457
457
  background: getRouteStatusColor(matches, route, theme),
458
- opacity: isActive ? 1 : 0.3,
458
+ opacity: match ? 1 : 0.3,
459
459
  }}
460
460
  />
461
461
  )}
462
462
  <Code
463
463
  style={{
464
- padding: '.25rem 0',
464
+ flex: '1 0 auto',
465
+ display: 'flex',
466
+ justifyContent: 'space-between',
467
+ padding: '.25rem .5rem .25rem 0',
465
468
  paddingLeft: isRoot ? '.5rem' : 0,
466
- opacity: isActive ? 1 : 0.7,
469
+ opacity: match ? 1 : 0.7,
467
470
  }}
468
- >{`${route.path || trimPath(route.id)}`}</Code>
471
+ >
472
+ <span>{route.path || trimPath(route.id)} </span>
473
+ {match ? <span style={{ opacity: 0.3 }}>{match.id}</span> : null}
474
+ </Code>
469
475
  </div>
470
476
  {(route.children as Route[])?.length ? (
471
477
  <div