@djangocfg/devtools 2.1.635 → 2.1.637
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 +7 -7
- package/src/panel/DevtoolsButton.tsx +38 -43
- package/src/panel/DevtoolsPanel.tsx +13 -22
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/devtools",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.637",
|
|
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.
|
|
55
|
-
"@djangocfg/ui-core": "^2.1.
|
|
54
|
+
"@djangocfg/api": "^2.1.637",
|
|
55
|
+
"@djangocfg/ui-core": "^2.1.637",
|
|
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.
|
|
63
|
-
"@djangocfg/eslint-config": "^2.1.
|
|
64
|
-
"@djangocfg/typescript-config": "^2.1.
|
|
65
|
-
"@djangocfg/ui-core": "^2.1.
|
|
62
|
+
"@djangocfg/api": "^2.1.637",
|
|
63
|
+
"@djangocfg/eslint-config": "^2.1.637",
|
|
64
|
+
"@djangocfg/typescript-config": "^2.1.637",
|
|
65
|
+
"@djangocfg/ui-core": "^2.1.637",
|
|
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 {
|
|
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
|
-
<
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
>
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
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
|
|
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
|
-
<
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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
|
|