@djangocfg/devtools 2.1.635 → 2.1.636

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@djangocfg/devtools",
3
- "version": "2.1.635",
3
+ "version": "2.1.636",
4
4
  "description": "Frontend devtools for django-cfg apps: error/console capture with backend ingest, plus a floating debug panel. One package, one event stream.",
5
5
  "keywords": [
6
6
  "django",
@@ -51,18 +51,18 @@
51
51
  "test:watch": "vitest"
52
52
  },
53
53
  "peerDependencies": {
54
- "@djangocfg/api": "^2.1.635",
55
- "@djangocfg/ui-core": "^2.1.635",
54
+ "@djangocfg/api": "^2.1.636",
55
+ "@djangocfg/ui-core": "^2.1.636",
56
56
  "lucide-react": ">=0.400.0",
57
57
  "react": "^19.0.0",
58
58
  "react-dom": "^19.0.0",
59
59
  "zustand": "^5.0.0"
60
60
  },
61
61
  "devDependencies": {
62
- "@djangocfg/api": "^2.1.635",
63
- "@djangocfg/eslint-config": "^2.1.635",
64
- "@djangocfg/typescript-config": "^2.1.635",
65
- "@djangocfg/ui-core": "^2.1.635",
62
+ "@djangocfg/api": "^2.1.636",
63
+ "@djangocfg/eslint-config": "^2.1.636",
64
+ "@djangocfg/typescript-config": "^2.1.636",
65
+ "@djangocfg/ui-core": "^2.1.636",
66
66
  "@storybook/react-vite": "^10.6.5",
67
67
  "@types/node": "^25.9.5",
68
68
  "@types/react": "19.3.0",
@@ -3,7 +3,7 @@
3
3
  import React, { useCallback, useEffect, useRef } from 'react'
4
4
  import { useStore } from 'zustand'
5
5
 
6
- import { Tooltip, TooltipContent, TooltipTrigger } from '@djangocfg/ui-core/components'
6
+ import { TooltipHint } from '@djangocfg/ui-core/components'
7
7
  import { useHotkey } from '@djangocfg/ui-core/hooks'
8
8
  import { cn } from '@djangocfg/ui-core/lib'
9
9
  import { Bug } from 'lucide-react'
@@ -94,48 +94,43 @@ export function DevtoolsButton({ className, panel = {}, enabled }: DevtoolsButto
94
94
  // always in the consumer app's content scan. `left: 64px` in dev
95
95
  // clears the Next.js dev indicator.
96
96
  <div className="fixed z-[99999]" style={{ bottom: 20, left: isDevelopment ? 64 : 20 }}>
97
- <Tooltip>
98
- <TooltipTrigger asChild>
99
- <button
100
- type="button"
101
- className={cn(
102
- 'relative flex h-9 w-9 items-center justify-center rounded-full',
103
- 'bg-black/80 backdrop-blur-xl',
104
- 'shadow-[0_0_0_1px_#171717,inset_0_0_0_1px_hsla(0,0%,100%,0.14),0px_16px_32px_-8px_rgba(0,0,0,0.24)]',
105
- 'transition-all duration-150 hover:scale-105',
106
- 'focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50',
107
- // This button deliberately sits OUTSIDE the app's theme: it
108
- // mimics the Next.js dev indicator it sits beside (hence
109
- // `bg-black/80` and the hardcoded `#171717` ring above), and
110
- // must look the same in light and dark. `bg-destructive`
111
- // would follow the host's palette and stop matching its
112
- // neighbour.
113
- // eslint-disable-next-line no-restricted-syntax
114
- errorCount > 0 && 'bg-red-600/90',
115
- className,
116
- )}
117
- onClick={togglePanel}
118
- >
119
- <Bug className={cn('h-4 w-4', errorCount > 0 ? 'text-white' : 'text-white/80')} />
120
- {errorCount > 0 && (
121
- // Same reason as the button fill: this badge is part of the
122
- // off-theme dev-indicator styling, and its red must match the
123
- // fill above.
124
- <span
125
- className={
126
- // eslint-disable-next-line no-restricted-syntax
127
- 'absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-white text-[10px] font-semibold text-red-600 shadow-sm'
128
- }
129
- >
130
- {errorCount}
131
- </span>
132
- )}
133
- </button>
134
- </TooltipTrigger>
135
- <TooltipContent side="right">
136
- Devtools <kbd className="ml-1 text-[10px] opacity-60">⌘D</kbd>
137
- </TooltipContent>
138
- </Tooltip>
97
+ <TooltipHint tooltip={{ content: 'Devtools', hotkey: 'mod+d', side: 'right' }}>
98
+ <button
99
+ type="button"
100
+ className={cn(
101
+ 'relative flex h-9 w-9 items-center justify-center rounded-full',
102
+ 'bg-black/80 backdrop-blur-xl',
103
+ 'shadow-[0_0_0_1px_#171717,inset_0_0_0_1px_hsla(0,0%,100%,0.14),0px_16px_32px_-8px_rgba(0,0,0,0.24)]',
104
+ 'transition-all duration-150 hover:scale-105',
105
+ 'focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50',
106
+ // This button deliberately sits OUTSIDE the app's theme: it
107
+ // mimics the Next.js dev indicator it sits beside (hence
108
+ // `bg-black/80` and the hardcoded `#171717` ring above), and
109
+ // must look the same in light and dark. `bg-destructive`
110
+ // would follow the host's palette and stop matching its
111
+ // neighbour.
112
+ // eslint-disable-next-line no-restricted-syntax
113
+ errorCount > 0 && 'bg-red-600/90',
114
+ className,
115
+ )}
116
+ onClick={togglePanel}
117
+ >
118
+ <Bug className={cn('h-4 w-4', errorCount > 0 ? 'text-white' : 'text-white/80')} />
119
+ {errorCount > 0 && (
120
+ // Same reason as the button fill: this badge is part of the
121
+ // off-theme dev-indicator styling, and its red must match the
122
+ // fill above.
123
+ <span
124
+ className={
125
+ // eslint-disable-next-line no-restricted-syntax
126
+ 'absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-full bg-white text-[10px] font-semibold text-red-600 shadow-sm'
127
+ }
128
+ >
129
+ {errorCount}
130
+ </span>
131
+ )}
132
+ </button>
133
+ </TooltipHint>
139
134
  </div>
140
135
  )}
141
136
  <DevtoolsPanel {...panel} />
@@ -3,7 +3,7 @@
3
3
  import React, { useMemo, useState } from 'react'
4
4
  import { useStore } from 'zustand'
5
5
 
6
- import { Badge, Button, Tooltip, TooltipContent, TooltipTrigger } from '@djangocfg/ui-core/components'
6
+ import { Badge, Button } from '@djangocfg/ui-core/components'
7
7
  import { cn } from '@djangocfg/ui-core/lib'
8
8
  import { Bug, Maximize2, Minimize2, ScrollText, X } from 'lucide-react'
9
9
 
@@ -99,27 +99,18 @@ export function DevtoolsPanel({
99
99
  )}
100
100
 
101
101
  <div className="ml-auto flex items-center gap-1">
102
- <Tooltip>
103
- <TooltipTrigger asChild>
104
- <Button
105
- variant="ghost"
106
- size="icon"
107
- className="h-6 w-6"
108
- onClick={() => setIsMinimized((v) => !v)}
109
- >
110
- {isMinimized ? <Maximize2 className="h-3.5 w-3.5" /> : <Minimize2 className="h-3.5 w-3.5" />}
111
- </Button>
112
- </TooltipTrigger>
113
- <TooltipContent>{isMinimized ? 'Expand' : 'Minimize'}</TooltipContent>
114
- </Tooltip>
115
- <Tooltip>
116
- <TooltipTrigger asChild>
117
- <Button variant="ghost" size="icon" className="h-6 w-6" onClick={closePanel}>
118
- <X className="h-3.5 w-3.5" />
119
- </Button>
120
- </TooltipTrigger>
121
- <TooltipContent>Close</TooltipContent>
122
- </Tooltip>
102
+ <Button
103
+ variant="ghost"
104
+ size="icon"
105
+ className="h-6 w-6"
106
+ tooltip={isMinimized ? 'Expand' : 'Minimize'}
107
+ onClick={() => setIsMinimized((v) => !v)}
108
+ >
109
+ {isMinimized ? <Maximize2 className="h-3.5 w-3.5" /> : <Minimize2 className="h-3.5 w-3.5" />}
110
+ </Button>
111
+ <Button variant="ghost" size="icon" className="h-6 w-6" tooltip="Close" onClick={closePanel}>
112
+ <X className="h-3.5 w-3.5" />
113
+ </Button>
123
114
  </div>
124
115
  </div>
125
116