@visulima/dev-toolbar 1.0.0-alpha.2 → 1.0.0-alpha.21

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 (137) hide show
  1. package/CHANGELOG.md +251 -0
  2. package/LICENSE.md +137 -5
  3. package/README.md +70 -43
  4. package/bin/mcp.js +29 -0
  5. package/dist/apps/a11y/index.d.ts +3 -2
  6. package/dist/apps/a11y/index.js +3 -3
  7. package/dist/apps/annotations/index.d.ts +4 -0
  8. package/dist/apps/annotations/index.js +18 -0
  9. package/dist/apps/assets/index.d.ts +4 -0
  10. package/dist/apps/assets/index.js +16 -0
  11. package/dist/apps/inspector/index.d.ts +4 -0
  12. package/dist/apps/inspector/index.js +30 -0
  13. package/dist/apps/module-graph/index.d.ts +3 -2
  14. package/dist/apps/module-graph/index.js +2 -2
  15. package/dist/apps/performance/index.d.ts +3 -2
  16. package/dist/apps/performance/index.js +2 -2
  17. package/dist/apps/seo/index.d.ts +3 -2
  18. package/dist/apps/seo/index.js +2 -2
  19. package/dist/apps/settings/index.d.ts +3 -2
  20. package/dist/apps/settings/index.js +2 -2
  21. package/dist/apps/tailwind/index.d.ts +4 -0
  22. package/dist/apps/tailwind/index.js +7 -0
  23. package/dist/apps/timeline/index.d.ts +3 -2
  24. package/dist/apps/timeline/index.js +2 -2
  25. package/dist/apps/vite-config/index.d.ts +3 -2
  26. package/dist/apps/vite-config/index.js +2 -2
  27. package/dist/client/overlay.d.ts +1 -1
  28. package/dist/client/overlay.js +1 -1
  29. package/dist/index.d.ts +143 -6
  30. package/dist/index.js +1 -1
  31. package/dist/mcp/server.d.ts +2 -0
  32. package/dist/mcp/server.js +1 -0
  33. package/dist/packem_chunks/inject-source.js +9 -0
  34. package/dist/packem_shared/Alert-D2CvX4fw.js +1 -0
  35. package/dist/packem_shared/Badge-BEgU04nl.js +1 -0
  36. package/dist/packem_shared/Button-Bkx66Co7.js +1 -0
  37. package/dist/packem_shared/Card-CJa4vHVc.js +1 -0
  38. package/dist/packem_shared/Icon-B6UHkC0o.js +1 -0
  39. package/dist/packem_shared/Input-Cs6aduTi.js +1 -0
  40. package/dist/packem_shared/Label-DyCng4Cp.js +1 -0
  41. package/dist/packem_shared/Popover-BtFVaZYg.js +1 -0
  42. package/dist/packem_shared/Progress-DN6zn-0l.js +1 -0
  43. package/dist/packem_shared/Select-DgQ4ss-s.js +1 -0
  44. package/dist/packem_shared/Separator-D38mKeZv.js +1 -0
  45. package/dist/packem_shared/Skeleton-Dv-tcA1P.js +1 -0
  46. package/dist/packem_shared/Switch-C3NTpeoR.js +1 -0
  47. package/dist/packem_shared/Tabs-DKWMiawt.js +1 -0
  48. package/dist/packem_shared/Textarea-Yfg3dLZi.js +1 -0
  49. package/dist/packem_shared/Tooltip-CioncSXj.js +1 -0
  50. package/dist/packem_shared/annotation-settings-Bv0TH4WI.js +1 -0
  51. package/dist/packem_shared/annotation-store-bLQRYMaI.js +1 -0
  52. package/dist/packem_shared/app.d-SmKEDxsI.d.ts +229 -0
  53. package/dist/packem_shared/clsx-wGlvpUfw.js +1 -0
  54. package/dist/packem_shared/createClientRPCContext-DgRxrllw.js +1 -0
  55. package/dist/packem_shared/createDevToolbarHook-4bZZiHPI.js +1 -0
  56. package/dist/packem_shared/createServerRPCContext-D-yZrEjs.js +1 -0
  57. package/dist/packem_shared/getTimelineStore-B1cfjWV8.js +1 -0
  58. package/dist/packem_shared/global-api.d-BLfn-OUA.d.ts +547 -0
  59. package/dist/packem_shared/{setupGlobalHook-CFuxsCyl.js → setupGlobalHook-CCf9Logv.js} +1 -1
  60. package/dist/packem_shared/sharedToolbarStylesheet-Bx1muJAh.js +2 -0
  61. package/dist/packem_shared/store-DaUtLjf3.js +1 -0
  62. package/dist/packem_shared/use-frame-state-CxrlPUM5.js +1 -0
  63. package/dist/packem_shared/use-theme-zpm4zmqP.js +1 -0
  64. package/dist/toolbar/index.d.ts +152 -56
  65. package/dist/toolbar/index.js +3 -4
  66. package/dist/ui/index.d.ts +382 -0
  67. package/dist/ui/index.js +1 -0
  68. package/dist/vite-plugin.d.ts +155 -103
  69. package/dist/vite-plugin.js +5 -2
  70. package/package.json +53 -14
  71. package/dist/apps/a11y/a11y-app.d.ts +0 -5
  72. package/dist/apps/a11y/a11y-store.d.ts +0 -46
  73. package/dist/apps/a11y/a11y-tooltip.d.ts +0 -11
  74. package/dist/apps/module-graph/module-graph-app.d.ts +0 -5
  75. package/dist/apps/more/index.d.ts +0 -3
  76. package/dist/apps/more/index.js +0 -19
  77. package/dist/apps/more/more-app.d.ts +0 -5
  78. package/dist/apps/performance/performance-app.d.ts +0 -5
  79. package/dist/apps/performance/performance-tooltip.d.ts +0 -5
  80. package/dist/apps/seo/seo-app.d.ts +0 -5
  81. package/dist/apps/settings/settings-app.d.ts +0 -5
  82. package/dist/apps/timeline/timeline-app.d.ts +0 -5
  83. package/dist/apps/vite-config/vite-config-app.d.ts +0 -5
  84. package/dist/hooks/create-hook.d.ts +0 -10
  85. package/dist/hooks/events.d.ts +0 -5
  86. package/dist/hooks/global-hook.d.ts +0 -15
  87. package/dist/hooks/index.d.ts +0 -6
  88. package/dist/packem_shared/TimelineStore-BgBrirKd.js +0 -1
  89. package/dist/packem_shared/cn-BEsR6GkP.js +0 -1
  90. package/dist/packem_shared/createClientRPCContext-DzKQpKTk.js +0 -1
  91. package/dist/packem_shared/createDevToolbarHook-DGNxqk8N.js +0 -1
  92. package/dist/packem_shared/createServerRPCContext-BVSesPXu.js +0 -1
  93. package/dist/packem_shared/icon-BUQ92HaT.js +0 -1
  94. package/dist/packem_shared/store-BxE0w51s.js +0 -1
  95. package/dist/performance/monitor.d.ts +0 -115
  96. package/dist/rpc/client.d.ts +0 -7
  97. package/dist/rpc/functions/module-graph.d.ts +0 -17
  98. package/dist/rpc/functions/open-in-editor.d.ts +0 -9
  99. package/dist/rpc/functions/vite-config.d.ts +0 -7
  100. package/dist/rpc/index.d.ts +0 -8
  101. package/dist/rpc/server.d.ts +0 -9
  102. package/dist/timeline/index.d.ts +0 -6
  103. package/dist/timeline/store.d.ts +0 -52
  104. package/dist/toolbar/app-manager.d.ts +0 -95
  105. package/dist/toolbar/components/app-button.d.ts +0 -19
  106. package/dist/toolbar/components/app-canvas.d.ts +0 -13
  107. package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -13
  108. package/dist/toolbar/components/first-visit-hint.d.ts +0 -16
  109. package/dist/toolbar/components/index.d.ts +0 -4
  110. package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -23
  111. package/dist/toolbar/components/toolbar-bar.d.ts +0 -15
  112. package/dist/toolbar/components/toolbar-container.d.ts +0 -55
  113. package/dist/toolbar/components/vite-overlay-button.d.ts +0 -15
  114. package/dist/toolbar/context/index.d.ts +0 -2
  115. package/dist/toolbar/context/toolbar-context.d.ts +0 -106
  116. package/dist/toolbar/global-api.d.ts +0 -23
  117. package/dist/toolbar/helpers.d.ts +0 -6
  118. package/dist/toolbar/hooks/index.d.ts +0 -10
  119. package/dist/toolbar/hooks/use-apps.d.ts +0 -13
  120. package/dist/toolbar/hooks/use-frame-state.d.ts +0 -94
  121. package/dist/toolbar/hooks/use-panel-visible.d.ts +0 -21
  122. package/dist/toolbar/hooks/use-position.d.ts +0 -22
  123. package/dist/toolbar/hooks/use-theme.d.ts +0 -13
  124. package/dist/toolbar/hooks/use-toolbar.d.ts +0 -14
  125. package/dist/toolbar/settings.d.ts +0 -17
  126. package/dist/toolbar/stylesheet.d.ts +0 -1
  127. package/dist/toolbar/utils/index.d.ts +0 -12
  128. package/dist/types/app.d.ts +0 -163
  129. package/dist/types/global-api.d.ts +0 -95
  130. package/dist/types/hooks.d.ts +0 -88
  131. package/dist/types/index.d.ts +0 -12
  132. package/dist/types/messaging.d.ts +0 -43
  133. package/dist/types/rpc.d.ts +0 -95
  134. package/dist/types/timeline.d.ts +0 -62
  135. package/dist/types/toolbar.d.ts +0 -56
  136. package/dist/ui/components/icon.d.ts +0 -21
  137. package/dist/utils/cn.d.ts +0 -8
@@ -0,0 +1,382 @@
1
+ import { ComponentChildren, JSX } from 'preact';
2
+ import { RefAttributes, ForwardRefExoticComponent } from 'preact/compat';
3
+ type AlertVariant = "default" | "destructive" | "info" | "success" | "warning";
4
+ interface AlertProps extends JSX.HTMLAttributes<HTMLDivElement> {
5
+ children?: ComponentChildren;
6
+ class?: string;
7
+ variant?: AlertVariant;
8
+ }
9
+ interface AlertTitleProps extends JSX.HTMLAttributes<HTMLHeadingElement> {
10
+ children?: ComponentChildren;
11
+ class?: string;
12
+ }
13
+ interface AlertDescriptionProps extends JSX.HTMLAttributes<HTMLDivElement> {
14
+ children?: ComponentChildren;
15
+ class?: string;
16
+ }
17
+ declare const Alert: ({
18
+ children,
19
+ class: className,
20
+ variant,
21
+ ...rest
22
+ }: AlertProps) => JSX.Element;
23
+ declare const AlertTitle: ({
24
+ children,
25
+ class: className,
26
+ ...rest
27
+ }: AlertTitleProps) => JSX.Element;
28
+ declare const AlertDescription: ({
29
+ children,
30
+ class: className,
31
+ ...rest
32
+ }: AlertDescriptionProps) => JSX.Element;
33
+ type BadgeVariant = "default" | "destructive" | "info" | "outline" | "secondary" | "success" | "warning";
34
+ interface BadgeProps extends JSX.HTMLAttributes<HTMLDivElement> {
35
+ children?: ComponentChildren;
36
+ class?: string;
37
+ variant?: BadgeVariant;
38
+ }
39
+ declare const Badge: ({
40
+ children,
41
+ class: className,
42
+ variant,
43
+ ...rest
44
+ }: BadgeProps) => JSX.Element;
45
+ type ButtonSize = "default" | "icon" | "lg" | "sm";
46
+ type ButtonVariant = "default" | "destructive" | "ghost" | "link" | "outline" | "secondary";
47
+ interface ButtonProps extends JSX.ButtonHTMLAttributes {
48
+ children?: ComponentChildren;
49
+ class?: string;
50
+ size?: ButtonSize;
51
+ variant?: ButtonVariant;
52
+ }
53
+ declare const Button: ({
54
+ children,
55
+ class: className,
56
+ size,
57
+ type,
58
+ variant,
59
+ ...rest
60
+ }: ButtonProps) => JSX.Element;
61
+ interface CardProps extends JSX.HTMLAttributes<HTMLDivElement> {
62
+ children?: ComponentChildren;
63
+ class?: string;
64
+ }
65
+ interface CardTitleProps extends JSX.HTMLAttributes<HTMLHeadingElement> {
66
+ children?: ComponentChildren;
67
+ class?: string;
68
+ }
69
+ declare const Card: ({
70
+ children,
71
+ class: className,
72
+ ...rest
73
+ }: CardProps) => JSX.Element;
74
+ declare const CardHeader: ({
75
+ children,
76
+ class: className,
77
+ ...rest
78
+ }: CardProps) => JSX.Element;
79
+ declare const CardTitle: ({
80
+ children,
81
+ class: className,
82
+ ...rest
83
+ }: CardTitleProps) => JSX.Element;
84
+ declare const CardDescription: ({
85
+ children,
86
+ class: className,
87
+ ...rest
88
+ }: CardProps) => JSX.Element;
89
+ declare const CardContent: ({
90
+ children,
91
+ class: className,
92
+ ...rest
93
+ }: CardProps) => JSX.Element;
94
+ declare const CardFooter: ({
95
+ children,
96
+ class: className,
97
+ ...rest
98
+ }: CardProps) => JSX.Element;
99
+ interface IconProps {
100
+ class?: string;
101
+ size?: number;
102
+ /**
103
+ * CSS data-URI from a `?data-uri&amp;encoding=css` lucide-static import.
104
+ * Uses CSS mask-image so the icon inherits currentColor from the parent.
105
+ */
106
+ src: string;
107
+ }
108
+ /**
109
+ * Renders a lucide-static icon using CSS mask-image.
110
+ * Color is driven by the parent element's `color` property (currentColor).
111
+ * @example
112
+ * import xIcon from "lucide-static/icons/x.svg?data-uri&amp;encoding=css";
113
+ * &lt;Icon src={xIcon} size={13} />
114
+ */
115
+ declare const Icon: ({
116
+ class: className,
117
+ size,
118
+ src
119
+ }: IconProps) => ComponentChildren;
120
+ interface InputProps extends JSX.InputHTMLAttributes {
121
+ class?: string;
122
+ }
123
+ declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
124
+ interface LabelProps extends JSX.LabelHTMLAttributes {
125
+ children?: ComponentChildren;
126
+ class?: string;
127
+ }
128
+ declare const Label: ({
129
+ children,
130
+ class: className,
131
+ ...rest
132
+ }: LabelProps) => JSX.Element;
133
+ interface PopoverProps {
134
+ children: ComponentChildren;
135
+ defaultOpen?: boolean;
136
+ onOpenChange?: (open: boolean) => void;
137
+ open?: boolean;
138
+ }
139
+ interface PopoverTriggerProps extends JSX.ButtonHTMLAttributes {
140
+ children: ComponentChildren;
141
+ class?: string;
142
+ }
143
+ interface PopoverContentProps extends JSX.HTMLAttributes<HTMLDivElement> {
144
+ align?: "center" | "end" | "start";
145
+ children: ComponentChildren;
146
+ class?: string;
147
+ side?: "bottom" | "left" | "right" | "top";
148
+ sideOffset?: number;
149
+ }
150
+ interface PopoverCloseProps extends JSX.ButtonHTMLAttributes {
151
+ children?: ComponentChildren;
152
+ class?: string;
153
+ }
154
+ declare const Popover: ({
155
+ children,
156
+ defaultOpen,
157
+ onOpenChange,
158
+ open
159
+ }: PopoverProps) => JSX.Element;
160
+ declare const PopoverTrigger: ({
161
+ children,
162
+ class: className,
163
+ ...rest
164
+ }: PopoverTriggerProps) => JSX.Element;
165
+ declare const PopoverContent: ({
166
+ align,
167
+ children,
168
+ class: className,
169
+ side,
170
+ sideOffset,
171
+ ...rest
172
+ }: PopoverContentProps) => JSX.Element | undefined;
173
+ declare const PopoverClose: ({
174
+ children,
175
+ class: className,
176
+ ...rest
177
+ }: PopoverCloseProps) => JSX.Element;
178
+ interface ProgressProps extends JSX.HTMLAttributes<HTMLDivElement> {
179
+ class?: string;
180
+ value?: number;
181
+ }
182
+ declare const Progress: ({
183
+ class: className,
184
+ value,
185
+ ...rest
186
+ }: ProgressProps) => JSX.Element;
187
+ interface SelectContextValue {
188
+ highlightedValue: string | null;
189
+ instanceId: string;
190
+ onSelect: (value: string) => void;
191
+ open: boolean;
192
+ search: string;
193
+ setHighlightedValue: (v: string | null) => void;
194
+ setOpen: (v: boolean) => void;
195
+ setSearch: (v: string) => void;
196
+ triggerRef: {
197
+ current: HTMLButtonElement | null;
198
+ };
199
+ value: string;
200
+ }
201
+ declare const useSelectContext: () => SelectContextValue;
202
+ interface SelectOption {
203
+ label: string;
204
+ value: string;
205
+ }
206
+ interface SelectProps {
207
+ children: ComponentChildren;
208
+ onValueChange?: (value: string) => void;
209
+ value?: string;
210
+ }
211
+ interface SelectTriggerProps extends Omit<JSX.ButtonHTMLAttributes, "children"> {
212
+ children: ComponentChildren;
213
+ class?: string;
214
+ }
215
+ interface SelectContentProps {
216
+ align?: "center" | "end" | "start";
217
+ children: ComponentChildren;
218
+ class?: string;
219
+ searchable?: boolean;
220
+ side?: "bottom" | "top";
221
+ sideOffset?: number;
222
+ }
223
+ interface SelectItemProps {
224
+ children: ComponentChildren;
225
+ class?: string;
226
+ value: string;
227
+ }
228
+ interface SelectValueProps {
229
+ class?: string;
230
+ options: SelectOption[];
231
+ placeholder?: string;
232
+ }
233
+ declare const Select: ({
234
+ children,
235
+ onValueChange,
236
+ value
237
+ }: SelectProps) => JSX.Element;
238
+ declare const SelectTrigger: ({
239
+ children,
240
+ class: className,
241
+ ...rest
242
+ }: SelectTriggerProps) => JSX.Element;
243
+ declare const SelectValue: ({
244
+ class: className,
245
+ options,
246
+ placeholder
247
+ }: SelectValueProps) => JSX.Element;
248
+ declare const SelectContent: ({
249
+ align,
250
+ children,
251
+ class: className,
252
+ searchable,
253
+ side,
254
+ sideOffset
255
+ }: SelectContentProps) => JSX.Element | undefined;
256
+ declare const SelectItem: ({
257
+ children,
258
+ class: className,
259
+ value: itemValue
260
+ }: SelectItemProps) => JSX.Element;
261
+ interface SeparatorProps extends JSX.HTMLAttributes<HTMLDivElement> {
262
+ class?: string;
263
+ decorative?: boolean;
264
+ orientation?: "horizontal" | "vertical";
265
+ }
266
+ declare const Separator: ({
267
+ class: className,
268
+ decorative,
269
+ orientation,
270
+ ...rest
271
+ }: SeparatorProps) => JSX.Element;
272
+ interface SkeletonProps extends JSX.HTMLAttributes<HTMLDivElement> {
273
+ class?: string;
274
+ }
275
+ declare const Skeleton: ({
276
+ class: className,
277
+ ...rest
278
+ }: SkeletonProps) => JSX.Element;
279
+ interface SwitchProps extends Omit<JSX.ButtonHTMLAttributes, "onChange"> {
280
+ checked?: boolean;
281
+ class?: string;
282
+ defaultChecked?: boolean;
283
+ disabled?: boolean;
284
+ id?: string;
285
+ onCheckedChange?: (checked: boolean) => void;
286
+ }
287
+ declare const Switch: ({
288
+ checked,
289
+ class: className,
290
+ defaultChecked,
291
+ disabled,
292
+ id,
293
+ onCheckedChange,
294
+ ...rest
295
+ }: SwitchProps) => JSX.Element;
296
+ interface TabsProps extends JSX.HTMLAttributes<HTMLDivElement> {
297
+ children?: ComponentChildren;
298
+ class?: string;
299
+ defaultValue?: string;
300
+ onValueChange?: (value: string) => void;
301
+ value?: string;
302
+ }
303
+ interface TabsListProps extends JSX.HTMLAttributes<HTMLDivElement> {
304
+ children?: ComponentChildren;
305
+ class?: string;
306
+ }
307
+ interface TabsTriggerProps extends JSX.ButtonHTMLAttributes {
308
+ children?: ComponentChildren;
309
+ class?: string;
310
+ disabled?: boolean;
311
+ value: string;
312
+ }
313
+ interface TabsContentProps extends JSX.HTMLAttributes<HTMLDivElement> {
314
+ children?: ComponentChildren;
315
+ class?: string;
316
+ value: string;
317
+ }
318
+ declare const Tabs: ({
319
+ children,
320
+ class: className,
321
+ defaultValue,
322
+ onValueChange,
323
+ value,
324
+ ...rest
325
+ }: TabsProps) => JSX.Element;
326
+ declare const TabsList: ({
327
+ children,
328
+ class: className,
329
+ ...rest
330
+ }: TabsListProps) => JSX.Element;
331
+ declare const TabsTrigger: ({
332
+ children,
333
+ class: className,
334
+ disabled,
335
+ value,
336
+ ...rest
337
+ }: TabsTriggerProps) => JSX.Element;
338
+ declare const TabsContent: ({
339
+ children,
340
+ class: className,
341
+ value,
342
+ ...rest
343
+ }: TabsContentProps) => JSX.Element | undefined;
344
+ interface TextareaProps extends JSX.TextareaHTMLAttributes {
345
+ class?: string;
346
+ }
347
+ declare const Textarea: ForwardRefExoticComponent<RefAttributes<HTMLTextAreaElement> & TextareaProps>;
348
+ interface TooltipProps {
349
+ children: ComponentChildren;
350
+ delayDuration?: number;
351
+ }
352
+ interface TooltipTriggerProps extends JSX.HTMLAttributes<HTMLSpanElement> {
353
+ children: ComponentChildren;
354
+ class?: string;
355
+ }
356
+ interface TooltipContentProps extends JSX.HTMLAttributes<HTMLDivElement> {
357
+ children: ComponentChildren;
358
+ class?: string;
359
+ side?: "bottom" | "left" | "right" | "top";
360
+ sideOffset?: number;
361
+ }
362
+ declare const Tooltip: ({
363
+ children,
364
+ delayDuration: _delayDuration
365
+ }: TooltipProps) => JSX.Element;
366
+ declare const TooltipTrigger: ({
367
+ children,
368
+ class: className,
369
+ ...rest
370
+ }: TooltipTriggerProps) => JSX.Element;
371
+ declare const TooltipContent: ({
372
+ children,
373
+ class: className,
374
+ side,
375
+ sideOffset,
376
+ ...rest
377
+ }: TooltipContentProps) => JSX.Element | undefined;
378
+ type ClassValue = ClassArray | ClassDictionary | string | number | bigint | null | boolean | undefined;
379
+ type ClassDictionary = Record<string, any>;
380
+ type ClassArray = ClassValue[];
381
+ declare function clsx(...inputs: ClassValue[]): string;
382
+ export { Alert, AlertDescription, AlertTitle, Badge, Button, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Icon, Input, Label, Popover, PopoverClose, PopoverContent, PopoverTrigger, Progress, Select, SelectContent, SelectItem, type SelectOption, SelectTrigger, SelectValue, Separator, Skeleton, Switch, Tabs, TabsContent, TabsList, TabsTrigger, Textarea, Tooltip, TooltipContent, TooltipTrigger, clsx, useSelectContext };
@@ -0,0 +1 @@
1
+ import{Alert as o,AlertDescription as r,AlertTitle as a}from"../packem_shared/Alert-D2CvX4fw.js";import{default as p}from"../packem_shared/Badge-BEgU04nl.js";import{default as s}from"../packem_shared/Button-Bkx66Co7.js";import{Card as d,CardContent as m,CardDescription as n,CardFooter as i,CardHeader as u,CardTitle as T}from"../packem_shared/Card-CJa4vHVc.js";import{default as c}from"../packem_shared/Icon-B6UHkC0o.js";import{default as S}from"../packem_shared/Input-Cs6aduTi.js";import{default as P}from"../packem_shared/Label-DyCng4Cp.js";import{Popover as A,PopoverClose as I,PopoverContent as B,PopoverTrigger as D}from"../packem_shared/Popover-BtFVaZYg.js";import{default as h}from"../packem_shared/Progress-DN6zn-0l.js";import{Select as w,SelectContent as F,SelectItem as H,SelectTrigger as V,SelectValue as j,useSelectContext as q}from"../packem_shared/Select-DgQ4ss-s.js";import{default as z}from"../packem_shared/Separator-D38mKeZv.js";import{default as G}from"../packem_shared/Skeleton-Dv-tcA1P.js";import{default as K}from"../packem_shared/Switch-C3NTpeoR.js";import{Tabs as N,TabsContent as O,TabsList as Q,TabsTrigger as R}from"../packem_shared/Tabs-DKWMiawt.js";import{default as W}from"../packem_shared/Textarea-Yfg3dLZi.js";import{Tooltip as Y,TooltipContent as Z,TooltipTrigger as _}from"../packem_shared/Tooltip-CioncSXj.js";import{clsx as ee}from"../packem_shared/clsx-wGlvpUfw.js";export{o as Alert,r as AlertDescription,a as AlertTitle,p as Badge,s as Button,d as Card,m as CardContent,n as CardDescription,i as CardFooter,u as CardHeader,T as CardTitle,c as Icon,S as Input,P as Label,A as Popover,I as PopoverClose,B as PopoverContent,D as PopoverTrigger,h as Progress,w as Select,F as SelectContent,H as SelectItem,V as SelectTrigger,j as SelectValue,z as Separator,G as Skeleton,K as Switch,N as Tabs,O as TabsContent,Q as TabsList,R as TabsTrigger,W as Textarea,Y as Tooltip,Z as TooltipContent,_ as TooltipTrigger,ee as clsx,q as useSelectContext};
@@ -1,106 +1,158 @@
1
- import type { Plugin } from "vite";
2
- import type { DevToolbarApp, ServerFunctions } from "./types/index.d.ts";
1
+ import { Plugin } from 'vite';
2
+ import { D as DevToolbarApp, S as ServerFunctions } from "./packem_shared/app.d-SmKEDxsI.js";
3
+ import "./packem_shared/global-api.d-BLfn-OUA.js";
4
+ import '@babel/generator';
5
+ import 'preact';
6
+ interface InjectSourceIgnore {
7
+ /** Component names or patterns to skip. */
8
+ components?: (RegExp | string)[];
9
+ /** File paths or patterns to skip. */
10
+ files?: (RegExp | string)[];
11
+ }
3
12
  /**
4
- * Dev toolbar plugin options
5
- */
6
- export interface DevToolbarOptions {
7
- /**
8
- * append an import to the module id ending with `appendTo` instead of adding a script into body
9
- * useful for projects that do not use html file as an entry
10
- *
11
- * WARNING: only set this if you know exactly what it does.
12
- * @default ''
13
- */
14
- appendTo?: string | RegExp;
15
- /**
16
- * Built-in apps to enable
17
- */
18
- apps?: {
19
- [key: string]: boolean | undefined;
20
- a11y?: boolean;
21
- moduleGraph?: boolean;
22
- performance?: boolean;
23
- seo?: boolean;
24
- settings?: boolean;
25
- timeline?: boolean;
26
- viteConfig?: boolean;
27
- };
28
- /**
29
- * Whether clicking outside the DevTools panel closes it.
30
- * @default true
31
- */
32
- closeOnOutsideClick?: boolean;
33
- /**
34
- * Custom apps to register
35
- */
36
- customApps?: DevToolbarApp[];
37
- /**
38
- * Whether toolbar is visible by default
39
- */
40
- defaultVisible?: boolean;
41
- /**
42
- * Initial panel height as a percentage of the viewport height (20–95).
43
- * @default 60
44
- */
45
- height?: number;
46
- /**
47
- * Keyboard shortcut bindings.
48
- * These are project-level defaults; users can still override them via the
49
- * Settings app (stored in localStorage).
50
- */
51
- keybindings?: {
52
- /** Close active app / panel. @default "Escape" */
53
- close?: string;
54
- /** Toggle the DevTools panel open/closed. @default "Alt+Shift+D" */
55
- toggle?: string;
56
- };
57
- /**
58
- * Auto-hide the toolbar pill after this many milliseconds of inactivity.
59
- * Set to -1 to never auto-hide.
60
- * @default 5000
61
- */
62
- minimizePanelInactive?: number;
63
- /**
64
- * Toolbar placement (coarse shorthand — sets the edge and rough horizontal
65
- * alignment of the toolbar pill).
66
- * @default "bottom-center"
67
- */
68
- placement?: "bottom-left" | "bottom-center" | "bottom-right";
69
- /**
70
- * Which edge of the viewport the toolbar pill is anchored to.
71
- * Takes precedence over the edge implied by `placement`.
72
- * @default "bottom"
73
- */
74
- position?: "bottom" | "left" | "right" | "top";
75
- /**
76
- * Reduce motion for accessibility (disables all CSS animations).
77
- * @default false
78
- */
79
- reduceMotion?: boolean;
80
- /**
81
- * Only activate the toolbar when the URL contains a specific query parameter.
82
- * Useful for staging/production environments where you want opt-in debugging.
83
- * @example requireUrlFlag: true, urlFlagName: 'debug' → toolbar only shows when URL has ?debug=true
84
- * @default false
85
- */
86
- requireUrlFlag?: boolean;
87
- /**
88
- * Custom server RPC functions
89
- */
90
- serverFunctions?: Partial<ServerFunctions>;
91
- /**
92
- * The URL query parameter name used when requireUrlFlag is true.
93
- * @default 'devtools'
94
- */
95
- urlFlagName?: string;
96
- /**
97
- * Initial panel width as a percentage of the viewport width (20–95).
98
- * Applies when position is "left" or "right".
99
- * @default 80
100
- */
101
- width?: number;
13
+ * Dev toolbar plugin options
14
+ */
15
+ interface DevToolbarOptions {
16
+ /**
17
+ * append an import to the module id ending with `appendTo` instead of adding a script into body
18
+ * useful for projects that do not use html file as an entry
19
+ *
20
+ * WARNING: only set this if you know exactly what it does.
21
+ * @default Empty string (disabled).
22
+ */
23
+ appendTo?: string | RegExp;
24
+ /**
25
+ * Built-in apps to enable. All apps are disabled by default — only
26
+ * `viteConfig`, `settings`, and the "more" drawer are shown out of the box.
27
+ * Explicitly set an app to `true` to enable it.
28
+ * @example { inspector: true, seo: true }
29
+ */
30
+ apps?: {
31
+ [key: string]: boolean | undefined;
32
+ a11y?: boolean;
33
+ annotations?: boolean;
34
+ assets?: boolean;
35
+ inspector?: boolean;
36
+ moduleGraph?: boolean;
37
+ performance?: boolean;
38
+ seo?: boolean;
39
+ settings?: boolean;
40
+ tailwind?: boolean;
41
+ timeline?: boolean;
42
+ viteConfig?: boolean;
43
+ };
44
+ /**
45
+ * Whether clicking outside the DevTools panel closes it.
46
+ * @default true
47
+ */
48
+ closeOnOutsideClick?: boolean;
49
+ /**
50
+ * Custom apps to register
51
+ */
52
+ customApps?: DevToolbarApp[];
53
+ /**
54
+ * Whether toolbar is visible by default
55
+ */
56
+ defaultVisible?: boolean;
57
+ /**
58
+ * The editor to open when clicking "Open in editor" in the inspector.
59
+ * Accepts any value supported by `launch-editor` — an editor name/alias
60
+ * (e.g. `"code"`, `"webstorm"`, `"vim"`, `"atom"`) or the full path to
61
+ * the editor executable.
62
+ *
63
+ * If omitted, `launch-editor` auto-detects the editor from the `EDITOR`
64
+ * / `VISUAL` environment variables or from the currently running IDE
65
+ * process detected on the OS process list.
66
+ * @example "webstorm"
67
+ * @example "code"
68
+ */
69
+ editor?: string;
70
+ /**
71
+ * Initial panel height as a percentage of the viewport height (20–95).
72
+ * @default 60
73
+ */
74
+ height?: number;
75
+ /**
76
+ * Inject `data-vdt-source="&lt;file>:&lt;line>:&lt;col>"` attributes into every JSX
77
+ * opening element during development. This lets the inspector jump directly
78
+ * to the source file when an element is clicked.
79
+ *
80
+ * Only active when `mode === 'development'`. Set `enabled: false` to opt out.
81
+ * Use `ignore.files` / `ignore.components` to exclude specific paths or
82
+ * component names (strings are treated as glob patterns).
83
+ * @default { enabled: true }
84
+ */
85
+ injectSource?: {
86
+ enabled?: boolean;
87
+ ignore?: InjectSourceIgnore;
88
+ };
89
+ /**
90
+ * Keyboard shortcut bindings.
91
+ * These are project-level defaults; users can still override them via the
92
+ * Settings app (stored in localStorage).
93
+ */
94
+ keybindings?: {
95
+ /** Close active app / panel. \@default "Escape" */
96
+ close?: string;
97
+ /** Toggle the DevTools panel open/closed. \@default "Alt+Shift+D" */
98
+ toggle?: string;
99
+ };
100
+ /**
101
+ * Auto-hide the toolbar pill after this many milliseconds of inactivity.
102
+ * Set to -1 to never auto-hide.
103
+ * @default 5000
104
+ */
105
+ minimizePanelInactive?: number;
106
+ /**
107
+ * Toolbar placement (coarse shorthand sets the edge and rough horizontal
108
+ * alignment of the toolbar pill).
109
+ * @default "bottom-center"
110
+ */
111
+ placement?: "bottom-left" | "bottom-center" | "bottom-right";
112
+ /**
113
+ * Which edge of the viewport the toolbar pill is anchored to.
114
+ * Takes precedence over the edge implied by `placement`.
115
+ * @default "bottom"
116
+ */
117
+ position?: "bottom" | "left" | "right" | "top";
118
+ /**
119
+ * Reduce motion for accessibility (disables all CSS animations).
120
+ * @default false
121
+ */
122
+ reduceMotion?: boolean;
123
+ /**
124
+ * Strip all \@visulima/dev-toolbar imports and virtual modules when building
125
+ * for production (i.e. when `command !== 'serve'` or `mode === 'production'`).
126
+ * This guarantees the toolbar never ends up in a production bundle even if the
127
+ * user accidentally imports our package in application code.
128
+ * @default true
129
+ */
130
+ removeDevtoolsOnBuild?: boolean;
131
+ /**
132
+ * Only activate the toolbar when the URL contains a specific query parameter.
133
+ * Useful for staging/production environments where you want opt-in debugging.
134
+ * @example requireUrlFlag: true, urlFlagName: 'debug' → toolbar only shows when URL has ?debug=true
135
+ * @default false
136
+ */
137
+ requireUrlFlag?: boolean;
138
+ /**
139
+ * Custom server RPC functions
140
+ */
141
+ serverFunctions?: Partial<ServerFunctions>;
142
+ /**
143
+ * The URL query parameter name used when requireUrlFlag is true.
144
+ * @default 'devtools'
145
+ */
146
+ urlFlagName?: string;
147
+ /**
148
+ * Initial panel width as a percentage of the viewport width (20–95).
149
+ * Applies when position is "left" or "right".
150
+ * @default 80
151
+ */
152
+ width?: number;
102
153
  }
103
154
  /**
104
- * Dev toolbar Vite plugin
105
- */
106
- export declare const devToolbar: (options?: DevToolbarOptions) => Plugin;
155
+ * Returns the Vite plugin array for the dev toolbar.
156
+ */
157
+ declare const devToolbar: (options?: DevToolbarOptions) => Plugin[];
158
+ export { DevToolbarOptions, devToolbar };
@@ -1,2 +1,5 @@
1
- var g=Object.defineProperty;var p=(e,r)=>g(e,"name",{value:r,configurable:!0});import{createRequire as b}from"node:module";import{normalizePath as $}from"vite";import{createServerRPCContext as j}from"./packem_shared/createServerRPCContext-BVSesPXu.js";const h=b(import.meta.url),s=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=p(e=>{if(typeof s<"u"&&s.versions&&s.versions.node){const[r,o]=s.versions.node.split(".").map(Number);if(r>22||r===22&&o>=3||r===20&&o>=16)return s.getBuiltinModule(e)}return h(e)},"__cjs_getBuiltinModule"),y=u("node:fs"),_=u("node:path"),{fileURLToPath:T}=u("node:url");var P=Object.defineProperty,c=p((e,r)=>P(e,"name",{value:r,configurable:!0}),"o");const F=c(()=>$(_.dirname(T(import.meta.url))),"getDevToolbarPath"),C=c(e=>e.replace(/\?.*$/,""),"removeUrlQuery"),d="?__visulima-dev-toolbar-resource",f="virtual:visulima-dev-toolbar-options",m=`\0${f}`,a="virtual:visulima-dev-toolbar-path:",x=c((e={})=>{const r=F();let o;return{apply:"serve",configResolved(t){o=t},configureServer(t){j(t,e.serverFunctions),t.ws.on("connection",()=>{t.ws.send({event:"dev-toolbar:init",type:"custom"})})},enforce:"pre",async load(t){if(t===m)return`export default ${JSON.stringify({apps:{a11y:e.apps?.a11y??!0,moduleGraph:e.apps?.moduleGraph??!0,performance:e.apps?.performance??!0,seo:e.apps?.seo??!0,settings:e.apps?.settings??!0,timeline:e.apps?.timeline??!0,viteConfig:e.apps?.viteConfig??!0},base:o.base,closeOnOutsideClick:e.closeOnOutsideClick??!0,defaultVisible:e.defaultVisible??!0,height:e.height??60,keybindings:e.keybindings??{},minimizePanelInactive:e.minimizePanelInactive??5e3,placement:e.placement??"bottom-center",position:e.position??"bottom",reduceMotion:e.reduceMotion??!1,requireUrlFlag:e.requireUrlFlag??!1,urlFlagName:e.urlFlagName??"devtools",width:e.width??80})};`;if(t.endsWith(d)){const n=C(t);return this.addWatchFile(n),await y.promises.readFile(n,"utf8")}},name:"@visulima/dev-toolbar",resolveId(t){if(t===f)return m;if(t.startsWith(a))return`${t.replace(a,`${r}/`)}${d}`},transform(t,n,v){if(v?.ssr)return;const{appendTo:i}=e,l=n.split("?",2)[0];if(i&&l&&(typeof i=="string"&&l.endsWith(i)||i instanceof RegExp&&i.test(l)))return`import '${a}client/overlay.js';
2
- ${t}`},transformIndexHtml(){return e.appendTo?void 0:{html:"",tags:[{attrs:{src:`${o.base||"/"}@id/${a}client/overlay.js`,type:"module"},injectTo:"head-prepend",tag:"script"}]}}}},"devToolbar");export{x as devToolbar};
1
+ var O=Object.defineProperty;var g=(e,r)=>O(e,"name",{value:r,configurable:!0});import{createRequire as x}from"node:module";import{normalizePath as I}from"vite";import{createServerRPCContext as k}from"./packem_shared/createServerRPCContext-D-yZrEjs.js";const F=x(import.meta.url),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=g(e=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[r,f]=d.versions.node.split(".").map(Number);if(r>22||r===22&&f>=3||r===20&&f>=16)return d.getBuiltinModule(e)}return F(e)},"__cjs_getBuiltinModule"),P=b("node:fs"),T=b("node:path"),{fileURLToPath:S}=b("node:url");var R=Object.defineProperty,m=g((e,r)=>R(e,"name",{value:r,configurable:!0}),"u");const q=m(()=>I(T.dirname(S(import.meta.url))),"getDevToolbarPath"),D=/\?.+$/,M=/\/dist\/|\/build\//,N=/\.[jt]sx$/,W=m(e=>e.replace(D,""),"removeUrlQuery"),w="?__visulima-dev-toolbar-resource",h="virtual:visulima-dev-toolbar-options",_=`\0${h}`,u="virtual:visulima-dev-toolbar-path:",j="\0__visulima-dev-toolbar-empty",E=m((e={})=>{const r=q(),f=e.removeDevtoolsOnBuild??!0,$=e.injectSource?.enabled??!0;let v;return[{apply:"serve",config(){return{server:{watch:{ignored:["**/.devtoolbar/**"]}}}},configResolved(t){if(v=t,!e.appendTo){const o=new Set(t.plugins.map(n=>n.name));(o.has("tanstack-start-core:config")||o.has("tanstack-react-start:config"))&&(e.appendTo=/router\.tsx$/)}const a=/dev-toolbar[\\/]dist[\\/]|__visulima-dev-toolbar-resource/;for(const o of t.plugins){if(!o.name.includes("babel"))continue;const n=o.transform;if(!n)continue;const i=typeof n=="function"?n:typeof n=="object"&&"handler"in n?n.handler:void 0;if(typeof i!="function")continue;const s=m(function(l,c,...p){if(!a.test(c))return i.call(this,l,c,...p)},"wrapper");typeof n=="function"?o.transform=s:n.handler=s}},configureServer(t){k(t,e.serverFunctions,{editor:e.editor}),t.ws.on("connection",()=>{t.ws.send({event:"dev-toolbar:init",type:"custom"})}),t.middlewares.use("/__devtoolbar/events",async(a,o)=>{o.writeHead(200,{"Cache-Control":"no-cache",Connection:"keep-alive","Content-Type":"text/event-stream","X-Accel-Buffering":"no"});const n=m((c,p)=>{o.write(`event: ${c}
2
+ data: ${JSON.stringify(p)}
3
+
4
+ `)},"sendEvent");n("connected",{timestamp:Date.now()});const{watch:i}=await import("node:fs"),s=T.join(t.config.root,".devtoolbar","annotations.json");let l;try{l=i(s,{persistent:!1},c=>{c==="change"&&n("annotations.changed",{timestamp:Date.now()})}),l.on("error",()=>{})}catch{const{stat:c}=await import("node:fs/promises");let p=0;const C=setInterval(async()=>{try{const y=(await c(s)).mtimeMs;y!==p&&(p=y,n("annotations.changed",{timestamp:Date.now()}))}catch{}},2e3);a.on("close",()=>{clearInterval(C)});return}a.on("close",()=>{l?.close()})})},enforce:"pre",async load(t){if(t===_){const a=(e.customApps??[]).filter(o=>!o.component&&!o.init&&o.view?.type==="iframe").map(o=>({defaultOpen:o.defaultOpen,icon:o.icon,id:o.id,name:o.name,view:o.view}));return`export default ${JSON.stringify({apps:{a11y:e.apps?.a11y??!1,annotations:e.apps?.annotations??e.apps?.inspector??!1,assets:e.apps?.assets??!1,inspector:e.apps?.inspector??!1,moduleGraph:e.apps?.moduleGraph??!1,performance:e.apps?.performance??!1,seo:e.apps?.seo??!1,settings:e.apps?.settings??!0,tailwind:e.apps?.tailwind??!1,timeline:e.apps?.timeline??!1,viteConfig:e.apps?.viteConfig??!0},base:v.base,closeOnOutsideClick:e.closeOnOutsideClick??!0,customApps:a,defaultVisible:e.defaultVisible??!0,editor:e.editor??"",height:e.height??60,keybindings:e.keybindings??{},minimizePanelInactive:e.minimizePanelInactive??5e3,placement:e.placement??"bottom-center",position:e.position??"bottom",reduceMotion:e.reduceMotion??!1,requireUrlFlag:e.requireUrlFlag??!1,urlFlagName:e.urlFlagName??"devtools",width:e.width??80})};`}if(t.endsWith(w)){const a=W(t);return this.addWatchFile(a),await P.promises.readFile(a,"utf8")}},name:"@visulima/dev-toolbar",resolveId(t){if(t===h)return _;if(t.startsWith(u))return`${t.replace(u,`${r}/`)}${w}`},transform(t,a,o){if(o?.ssr)return;const{appendTo:n}=e,i=a.split("?",2)[0];if(n&&i&&(typeof n=="string"&&i.endsWith(n)||n instanceof RegExp&&n.test(i)))return`import '${u}client/overlay.js';
5
+ ${t}`},transformIndexHtml(){return e.appendTo?void 0:{html:"",tags:[{attrs:{src:`${v.base||"/"}@id/${u}client/overlay.js`,type:"module"},injectTo:"head-prepend",tag:"script"}]}}},{enforce:"pre",name:"@visulima/dev-toolbar:inject-source",async transform(t,a){if(!$||v.mode!=="development"||a.includes("node_modules")||a.includes("?raw")||M.test(a)||!N.test(a.split("?")[0]??""))return;const{readFile:o}=await import("node:fs/promises");let n;try{const l=await o(a.split("?")[0]??a,"utf8");l!==t&&(n=l)}catch{}const{addSourceToJsx:i}=await import("./packem_chunks/inject-source.js"),s=i(t,a,e.injectSource?.ignore,n);if(s)return{code:s.code??t,map:s.map??void 0}}},{apply(t,{command:a,mode:o}){return f&&(a!=="serve"||o==="production")},load(t){if(t===j)return"export default {};"},name:"@visulima/dev-toolbar:remove-on-build",resolveId(t){if(t===h||t.startsWith(u))return j}}]},"devToolbar");export{E as devToolbar};