@visulima/dev-toolbar 1.0.0-alpha.3 → 1.0.0-alpha.4

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 (83) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/apps/a11y/a11y-store.d.ts +12 -16
  3. package/dist/apps/a11y/index.js +2 -21
  4. package/dist/apps/inspector/index.js +1 -17
  5. package/dist/apps/module-graph/index.js +1 -20
  6. package/dist/apps/more/index.js +2 -19
  7. package/dist/apps/performance/index.js +1 -17
  8. package/dist/apps/seo/index.js +1 -17
  9. package/dist/apps/settings/index.js +1 -17
  10. package/dist/apps/tailwind/index.js +6 -6
  11. package/dist/apps/timeline/index.js +1 -18
  12. package/dist/apps/vite-config/index.js +1 -16
  13. package/dist/client/overlay.js +1 -1
  14. package/dist/hooks/create-hook.d.ts +7 -5
  15. package/dist/hooks/events.d.ts +4 -2
  16. package/dist/hooks/global-hook.d.ts +6 -6
  17. package/dist/index.d.ts +2 -1
  18. package/dist/index.js +1 -1
  19. package/dist/packem_chunks/inject-source.js +1 -1
  20. package/dist/packem_shared/Popover-CLt7YhUF.js +1 -0
  21. package/dist/packem_shared/Tabs-CXERaeAp.js +1 -0
  22. package/dist/packem_shared/Tooltip-tlBN-NdK.js +1 -0
  23. package/dist/packem_shared/createClientRPCContext-DgRxrllw.js +1 -0
  24. package/dist/packem_shared/createDevToolbarHook-4bZZiHPI.js +1 -0
  25. package/dist/packem_shared/createServerRPCContext-CEm1Ymkn.js +1 -0
  26. package/dist/packem_shared/getTimelineStore-B1cfjWV8.js +1 -0
  27. package/dist/packem_shared/{setupGlobalHook-CFuxsCyl.js → setupGlobalHook-CCf9Logv.js} +1 -1
  28. package/dist/packem_shared/sharedToolbarStylesheet-DOV-Jwcm.js +2 -0
  29. package/dist/packem_shared/store-DaUtLjf3.js +1 -0
  30. package/dist/packem_shared/{use-theme-CX1gG6Sv.js → use-theme-BOw3dPpY.js} +1 -1
  31. package/dist/performance/monitor.d.ts +27 -26
  32. package/dist/rpc/client.d.ts +6 -4
  33. package/dist/rpc/functions/open-in-editor.d.ts +7 -5
  34. package/dist/rpc/functions/tailwind-config.d.ts +7 -4
  35. package/dist/rpc/functions/vite-config.d.ts +6 -4
  36. package/dist/rpc/server.d.ts +9 -6
  37. package/dist/timeline/capture.d.ts +3 -1
  38. package/dist/timeline/index.d.ts +2 -1
  39. package/dist/timeline/store.d.ts +12 -22
  40. package/dist/toolbar/app-manager.d.ts +45 -43
  41. package/dist/toolbar/components/app-canvas.d.ts +1 -1
  42. package/dist/toolbar/components/toolbar-container.d.ts +1 -1
  43. package/dist/toolbar/components/vite-overlay-button.d.ts +2 -2
  44. package/dist/toolbar/context/toolbar-context.d.ts +20 -19
  45. package/dist/toolbar/global-api.d.ts +3 -3
  46. package/dist/toolbar/helpers.d.ts +5 -3
  47. package/dist/toolbar/hooks/use-apps.d.ts +5 -3
  48. package/dist/toolbar/hooks/use-frame-state.d.ts +16 -10
  49. package/dist/toolbar/hooks/use-panel-visible.d.ts +9 -7
  50. package/dist/toolbar/hooks/use-position.d.ts +7 -5
  51. package/dist/toolbar/hooks/use-theme.d.ts +6 -4
  52. package/dist/toolbar/hooks/use-toolbar.d.ts +4 -2
  53. package/dist/toolbar/index.d.ts +8 -14
  54. package/dist/toolbar/index.js +3 -3
  55. package/dist/toolbar/settings.d.ts +7 -7
  56. package/dist/toolbar/stylesheet.d.ts +3 -1
  57. package/dist/toolbar/utils/index.d.ts +3 -3
  58. package/dist/types/global-api.d.ts +22 -33
  59. package/dist/types/hooks.d.ts +32 -34
  60. package/dist/types/messaging.d.ts +2 -2
  61. package/dist/types/rpc.d.ts +3 -6
  62. package/dist/types/timeline.d.ts +3 -3
  63. package/dist/types/toolbar.d.ts +1 -1
  64. package/dist/ui/components/icon.d.ts +3 -4
  65. package/dist/ui/components/popover.d.ts +1 -1
  66. package/dist/ui/components/tabs.d.ts +1 -1
  67. package/dist/ui/components/tooltip.d.ts +1 -1
  68. package/dist/ui/index.js +1 -1
  69. package/dist/utils/cn.d.ts +3 -3
  70. package/dist/vite/inject-source.d.ts +0 -1
  71. package/dist/vite/matcher.d.ts +2 -1
  72. package/dist/vite-plugin.d.ts +5 -5
  73. package/dist/vite-plugin.js +2 -2
  74. package/package.json +4 -3
  75. package/dist/packem_shared/Popover-o3Vkvndp.js +0 -1
  76. package/dist/packem_shared/Tabs-BBc4S-2T.js +0 -1
  77. package/dist/packem_shared/TimelineStore-BgBrirKd.js +0 -1
  78. package/dist/packem_shared/Tooltip-BwK-2I9P.js +0 -1
  79. package/dist/packem_shared/createClientRPCContext-DzKQpKTk.js +0 -1
  80. package/dist/packem_shared/createDevToolbarHook-DGNxqk8N.js +0 -1
  81. package/dist/packem_shared/createServerRPCContext-CRd6VAWp.js +0 -1
  82. package/dist/packem_shared/sharedToolbarStylesheet-DHHoFz2-.js +0 -2
  83. package/dist/packem_shared/store-BxE0w51s.js +0 -1
@@ -1,17 +1 @@
1
- var k=Object.defineProperty;var f=(t,n)=>k(t,"name",{value:n,configurable:!0});import{addHookName as C}from"preact/devtools";import{useState as x,useRef as y,useEffect as w}from"preact/hooks";import{u as F,a as E,D as c}from"../../packem_shared/use-theme-CX1gG6Sv.js";import v from"../../packem_shared/Icon-DWFLZkwW.js";import u from"../../packem_shared/cn-DWLJYh3h.js";import{jsxs as l,jsx as e}from"preact/jsx-runtime";import p from"../../packem_shared/Button-DODNCTPZ.js";const S=`<!-- @license lucide-static v0.576.0 - ISC -->
2
- <svg
3
- class="lucide lucide-settings"
4
- xmlns="http://www.w3.org/2000/svg"
5
- width="24"
6
- height="24"
7
- viewBox="0 0 24 24"
8
- fill="none"
9
- stroke="currentColor"
10
- stroke-width="2"
11
- stroke-linecap="round"
12
- stroke-linejoin="round"
13
- >
14
- <path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" />
15
- <circle cx="12" cy="12" r="3" />
16
- </svg>
17
- `,T="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-monitor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Crect%20width%3D%2220%22%20height%3D%2214%22%20x%3D%222%22%20y%3D%223%22%20rx%3D%222%22%20%2F%3E%20%3Cline%20x1%3D%228%22%20x2%3D%2216%22%20y1%3D%2221%22%20y2%3D%2221%22%20%2F%3E%20%3Cline%20x1%3D%2212%22%20x2%3D%2212%22%20y1%3D%2217%22%20y2%3D%2221%22%20%2F%3E%20%3C%2Fsvg%3E",A="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-moon%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Cpath%20d%3D%22M20.985%2012.486a9%209%200%201%201-9.473-9.472c.405-.022.617.46.402.803a6%206%200%200%200%208.268%208.268c.344-.215.825-.004.803.401%22%20%2F%3E%20%3C%2Fsvg%3E",K="data:image/svg+xml;charset=utf-8,%3Csvg%20class%3D%22lucide%20lucide-sun%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22currentColor%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%20%3E%20%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%224%22%20%2F%3E%20%3Cpath%20d%3D%22M12%202v2%22%20%2F%3E%20%3Cpath%20d%3D%22M12%2020v2%22%20%2F%3E%20%3Cpath%20d%3D%22m4.93%204.93%201.41%201.41%22%20%2F%3E%20%3Cpath%20d%3D%22m17.66%2017.66%201.41%201.41%22%20%2F%3E%20%3Cpath%20d%3D%22M2%2012h2%22%20%2F%3E%20%3Cpath%20d%3D%22M20%2012h2%22%20%2F%3E%20%3Cpath%20d%3D%22m6.34%2017.66-1.41%201.41%22%20%2F%3E%20%3Cpath%20d%3D%22m19.07%204.93-1.41%201.41%22%20%2F%3E%20%3C%2Fsvg%3E";var M=Object.defineProperty,i=f((t,n)=>M(t,"name",{value:n,configurable:!0}),"o");const d=i(({control:t,description:n,label:o})=>l("div",{class:"flex items-center justify-between gap-6 py-3.5",children:[l("div",{class:"min-w-0",children:[e("div",{class:"text-[0.8125rem] font-medium text-foreground leading-none mb-0.5",children:o}),n&&e("div",{class:"text-[0.725rem] text-muted-foreground leading-snug mt-1",children:n})]}),e("div",{class:"shrink-0",children:t})]}),"SettingRow"),g=i(({children:t,title:n})=>l("section",{children:[l("h3",{class:"text-[0.65rem] font-bold uppercase tracking-[0.1em] text-muted-foreground mb-2 px-1 flex items-center gap-1.5",children:[e("span",{"aria-hidden":"true",class:"text-primary/50",children:"//"}),n]}),e("div",{class:"rounded-none border border-border bg-card divide-y divide-border overflow-hidden border-l-2 border-l-primary/20",children:e("div",{class:"px-4",children:t})})]}),"Section"),b=i(({checked:t,onChange:n})=>e("button",{"aria-checked":t,class:u("relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-none border-2 border-transparent","transition-colors duration-200 ease-in-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",t?"bg-primary":"bg-foreground/15"),onClick:i(()=>n(!t),"onClick"),role:"switch",type:"button",children:e("span",{class:u("pointer-events-none inline-block h-4 w-4 shadow-sm","transition-all duration-200 ease-in-out",t?"translate-x-4 bg-primary-foreground":"translate-x-0 bg-white")})}),"Toggle"),j=i(({onChange:t,value:n})=>{const o=[{icon:e(v,{size:13,src:K}),label:"Light",value:"light"},{icon:e(v,{size:13,src:A}),label:"Dark",value:"dark"},{icon:e(v,{size:13,src:T}),label:"System",value:"system"}];return e("div",{class:"flex items-center gap-0.5 bg-foreground/6 p-0.5",children:o.map(s=>l("button",{"aria-pressed":n===s.value,class:u("flex items-center gap-1.5 px-2.5 py-1.5 text-[0.75rem] font-medium","transition-all duration-150 cursor-pointer border-0",n===s.value?"bg-background text-foreground shadow-sm":"bg-transparent text-muted-foreground hover:text-foreground"),onClick:i(()=>t(s.value),"onClick"),type:"button",children:[s.icon,s.label]},s.value))})},"ThemeControl"),P=[{label:"Never",value:-1},{label:"Always",value:0},{label:"2s",value:2e3},{label:"5s",value:5e3},{label:"10s",value:1e4},{label:"30s",value:3e4}],z=i(({onChange:t,value:n})=>e("select",{class:u("bg-foreground/6 border border-border","text-[0.775rem] font-medium text-foreground","px-2.5 py-1.5 cursor-pointer","focus:outline-none focus:ring-1 focus:ring-ring","transition-colors duration-150"),onChange:i(o=>t(Number(o.target.value)),"onChange"),value:String(n),children:P.map(o=>e("option",{value:String(o.value),children:o.label},o.value))}),"HideDelayControl"),R=i(t=>t.split("+"),"formatBinding"),B=i(({part:t})=>e("span",{class:"inline-flex items-center px-1.5 py-0.5 text-[0.65rem] font-mono font-medium bg-foreground/8 border border-border text-foreground",children:t}),"KeyBadge"),D=i(({onChange:t,value:n})=>{const[o,s]=C(x(!1),"capturing"),m=C(y(null),"buttonRef");return w(()=>{if(!o)return;const r=i(a=>{if(a.preventDefault(),a.stopPropagation(),["Alt","Control","Meta","Shift"].includes(a.key))return;const h=[];a.altKey&&h.push("Alt"),a.ctrlKey&&h.push("Control"),a.metaKey&&h.push("Meta"),a.shiftKey&&h.push("Shift"),h.push(a.key),t(h.join("+")),s(!1)},"handleKeyDown");return globalThis.addEventListener("keydown",r,!0),()=>globalThis.removeEventListener("keydown",r,!0)},[o,t]),l("div",{class:"flex items-center gap-2",children:[e("div",{class:"flex items-center gap-0.5",children:R(n).map((r,a)=>l("span",{class:"flex items-center gap-0.5",children:[a>0&&e("span",{class:"text-muted-foreground/40 text-[0.6rem] mx-0.5",children:"+"}),e(B,{part:r})]},a))}),e(p,{class:u("text-[0.7rem]",o?"border-primary text-primary bg-primary/8 animate-pulse":""),onClick:i(()=>s(r=>!r),"onClick"),ref:m,size:"sm",variant:"outline",children:o?"Press keys…":"Record"}),e(p,{class:"text-[0.7rem]",onClick:i(()=>{s(!1)},"onClick"),size:"sm",title:"Cancel",variant:"ghost",children:"✕"})]})},"KeyCapture"),N=i(t=>{const{state:n,updateState:o}=F(),{setTheme:s,theme:m}=E();return l("div",{class:"p-5 space-y-5 max-w-2xl",children:[l(g,{title:"Appearance",children:[e(d,{control:e(j,{onChange:s,value:m}),description:"Color scheme for the DevTools panel.",label:"Theme"}),e(d,{control:e(b,{checked:n.reduceMotion,onChange:i(r=>o({reduceMotion:r}),"onChange")}),description:"Disable animations and transitions throughout the toolbar.",label:"Reduce motion"})]}),l(g,{title:"Toolbar",children:[e(d,{control:e(z,{onChange:i(r=>o({minimizePanelInactive:r}),"onChange"),value:n.minimizePanelInactive}),description:"Collapse the toolbar pill after a period of inactivity. Set 'Never' to always keep it visible.",label:"Auto-hide when inactive"}),e(d,{control:e(b,{checked:n.preferShowFloatingPanel,onChange:i(r=>o({preferShowFloatingPanel:r}),"onChange")}),description:"Keep the toolbar pill visible even when the DevTools panel is not open.",label:"Show toolbar when panel is closed"})]}),e(g,{title:"Panel",children:e(d,{control:e(b,{checked:n.closeOnOutsideClick,onChange:i(r=>o({closeOnOutsideClick:r}),"onChange")}),description:"Close the DevTools panel when clicking outside of it.",label:"Close on outside click"})}),l(g,{title:"Keyboard Shortcuts",children:[e(d,{control:l("div",{class:"flex items-center gap-2",children:[e(D,{onChange:i(r=>o({keybindings:{...n.keybindings??c,toggle:r}}),"onChange"),value:n.keybindings?.toggle??c.toggle}),n.keybindings?.toggle!==c.toggle&&e(p,{class:"h-auto p-0 text-[0.65rem]",onClick:i(()=>o({keybindings:{...n.keybindings??c,toggle:c.toggle}}),"onClick"),variant:"link",children:"Reset"})]}),description:"Open or close the DevTools panel.",label:"Toggle toolbar"}),e(d,{control:l("div",{class:"flex items-center gap-2",children:[e(D,{onChange:i(r=>o({keybindings:{...n.keybindings??c,close:r}}),"onChange"),value:n.keybindings?.close??c.close}),n.keybindings?.close!==c.close&&e(p,{class:"h-auto p-0 text-[0.65rem]",onClick:i(()=>o({keybindings:{...n.keybindings??c,close:c.close}}),"onClick"),variant:"link",children:"Reset"})]}),description:"Dismiss the active app or close the panel.",label:"Close panel"})]})]})},"SettingsApp"),q={component:N,defaultOpen:!0,icon:S,id:"dev-toolbar:settings",name:"Settings"};export{q as default};
1
+ var x=Object.defineProperty;var v=(o,n)=>x(o,"name",{value:n,configurable:!0});import C from"lucide-static/icons/settings.svg?raw";import{addHookName as k}from"preact/devtools";import w from"lucide-static/icons/monitor.svg?data-uri&encoding=css";import S from"lucide-static/icons/moon.svg?data-uri&encoding=css";import T from"lucide-static/icons/sun.svg?data-uri&encoding=css";import{useState as D,useRef as K,useEffect as P}from"preact/hooks";import{h as z,_ as R,r as c}from"../../packem_shared/use-theme-BOw3dPpY.js";import b from"../../packem_shared/Icon-DWFLZkwW.js";import g from"../../packem_shared/cn-DWLJYh3h.js";import{jsxs as l,jsx as e}from"preact/jsx-runtime";import h from"../../packem_shared/Button-DODNCTPZ.js";var A=Object.defineProperty,i=v((o,n)=>A(o,"name",{value:n,configurable:!0}),"o");const d=i(({control:o,description:n,label:t})=>l("div",{class:"flex items-center justify-between gap-6 py-3.5",children:[l("div",{class:"min-w-0",children:[e("div",{class:"text-[0.8125rem] font-medium text-foreground leading-none mb-0.5",children:t}),n&&e("div",{class:"text-[0.725rem] text-muted-foreground leading-snug mt-1",children:n})]}),e("div",{class:"shrink-0",children:o})]}),"SettingRow"),p=i(({children:o,title:n})=>l("section",{children:[l("h3",{class:"text-[0.65rem] font-bold uppercase tracking-[0.1em] text-muted-foreground mb-2 px-1 flex items-center gap-1.5",children:[e("span",{"aria-hidden":"true",class:"text-primary/50",children:"//"}),n]}),e("div",{class:"rounded-none border border-border bg-card divide-y divide-border overflow-hidden border-l-2 border-l-primary/20",children:e("div",{class:"px-4",children:o})})]}),"Section"),f=i(({checked:o,onChange:n})=>e("button",{"aria-checked":o,class:g("relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-none border-2 border-transparent","transition-colors duration-200 ease-in-out","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",o?"bg-primary":"bg-foreground/15"),onClick:i(()=>n(!o),"onClick"),role:"switch",type:"button",children:e("span",{class:g("pointer-events-none inline-block h-4 w-4 shadow-sm","transition-all duration-200 ease-in-out",o?"translate-x-4 bg-primary-foreground":"translate-x-0 bg-white")})}),"Toggle"),O=i(({onChange:o,value:n})=>{const t=[{icon:e(b,{size:13,src:T}),label:"Light",value:"light"},{icon:e(b,{size:13,src:S}),label:"Dark",value:"dark"},{icon:e(b,{size:13,src:w}),label:"System",value:"system"}];return e("div",{class:"flex items-center gap-0.5 bg-foreground/6 p-0.5",children:t.map(a=>l("button",{"aria-pressed":n===a.value,class:g("flex items-center gap-1.5 px-2.5 py-1.5 text-[0.75rem] font-medium","transition-all duration-150 cursor-pointer border-0",n===a.value?"bg-background text-foreground shadow-sm":"bg-transparent text-muted-foreground hover:text-foreground"),onClick:i(()=>o(a.value),"onClick"),type:"button",children:[a.icon,a.label]},a.value))})},"ThemeControl"),j=[{label:"Never",value:-1},{label:"Always",value:0},{label:"2s",value:2e3},{label:"5s",value:5e3},{label:"10s",value:1e4},{label:"30s",value:3e4}],N=i(({onChange:o,value:n})=>e("select",{class:g("bg-foreground/6 border border-border","text-[0.775rem] font-medium text-foreground","px-2.5 py-1.5 cursor-pointer","focus:outline-none focus:ring-1 focus:ring-ring","transition-colors duration-150"),onChange:i(t=>o(Number(t.target.value)),"onChange"),value:String(n),children:j.map(t=>e("option",{value:String(t.value),children:t.label},t.value))}),"HideDelayControl"),E=i(o=>o.split("+"),"formatBinding"),M=i(({part:o})=>e("span",{class:"inline-flex items-center px-1.5 py-0.5 text-[0.65rem] font-mono font-medium bg-foreground/8 border border-border text-foreground",children:o}),"KeyBadge"),y=i(({onChange:o,value:n})=>{const[t,a]=k(D(!1),"capturing"),m=k(K(null),"buttonRef");return P(()=>{if(!t)return;const r=i(s=>{if(s.preventDefault(),s.stopPropagation(),["Alt","Control","Meta","Shift"].includes(s.key))return;const u=[];s.altKey&&u.push("Alt"),s.ctrlKey&&u.push("Control"),s.metaKey&&u.push("Meta"),s.shiftKey&&u.push("Shift"),u.push(s.key),o(u.join("+")),a(!1)},"handleKeyDown");return globalThis.addEventListener("keydown",r,!0),()=>globalThis.removeEventListener("keydown",r,!0)},[t,o]),l("div",{class:"flex items-center gap-2",children:[e("div",{class:"flex items-center gap-0.5",children:E(n).map((r,s)=>l("span",{class:"flex items-center gap-0.5",children:[s>0&&e("span",{class:"text-muted-foreground/40 text-[0.6rem] mx-0.5",children:"+"}),e(M,{part:r})]},s))}),e(h,{class:g("text-[0.7rem]",t?"border-primary text-primary bg-primary/8 animate-pulse":""),onClick:i(()=>a(r=>!r),"onClick"),ref:m,size:"sm",variant:"outline",children:t?"Press keys…":"Record"}),e(h,{class:"text-[0.7rem]",onClick:i(()=>{a(!1)},"onClick"),size:"sm",title:"Cancel",variant:"ghost",children:"✕"})]})},"KeyCapture"),L=i(o=>{const{state:n,updateState:t}=z(),{setTheme:a,theme:m}=R();return l("div",{class:"p-5 space-y-5 max-w-2xl",children:[l(p,{title:"Appearance",children:[e(d,{control:e(O,{onChange:a,value:m}),description:"Color scheme for the DevTools panel.",label:"Theme"}),e(d,{control:e(f,{checked:n.reduceMotion,onChange:i(r=>t({reduceMotion:r}),"onChange")}),description:"Disable animations and transitions throughout the toolbar.",label:"Reduce motion"})]}),l(p,{title:"Toolbar",children:[e(d,{control:e(N,{onChange:i(r=>t({minimizePanelInactive:r}),"onChange"),value:n.minimizePanelInactive}),description:"Collapse the toolbar pill after a period of inactivity. Set 'Never' to always keep it visible.",label:"Auto-hide when inactive"}),e(d,{control:e(f,{checked:n.preferShowFloatingPanel,onChange:i(r=>t({preferShowFloatingPanel:r}),"onChange")}),description:"Keep the toolbar pill visible even when the DevTools panel is not open.",label:"Show toolbar when panel is closed"})]}),e(p,{title:"Panel",children:e(d,{control:e(f,{checked:n.closeOnOutsideClick,onChange:i(r=>t({closeOnOutsideClick:r}),"onChange")}),description:"Close the DevTools panel when clicking outside of it.",label:"Close on outside click"})}),l(p,{title:"Keyboard Shortcuts",children:[e(d,{control:l("div",{class:"flex items-center gap-2",children:[e(y,{onChange:i(r=>t({keybindings:{...n.keybindings??c,toggle:r}}),"onChange"),value:n.keybindings?.toggle??c.toggle}),n.keybindings?.toggle!==c.toggle&&e(h,{class:"h-auto p-0 text-[0.65rem]",onClick:i(()=>t({keybindings:{...n.keybindings??c,toggle:c.toggle}}),"onClick"),variant:"link",children:"Reset"})]}),description:"Open or close the DevTools panel.",label:"Toggle toolbar"}),e(d,{control:l("div",{class:"flex items-center gap-2",children:[e(y,{onChange:i(r=>t({keybindings:{...n.keybindings??c,close:r}}),"onChange"),value:n.keybindings?.close??c.close}),n.keybindings?.close!==c.close&&e(h,{class:"h-auto p-0 text-[0.65rem]",onClick:i(()=>t({keybindings:{...n.keybindings??c,close:c.close}}),"onClick"),variant:"link",children:"Reset"})]}),description:"Dismiss the active app or close the panel.",label:"Close panel"})]})]})},"SettingsApp"),W={component:L,defaultOpen:!0,icon:C,id:"dev-toolbar:settings",name:"Settings"};export{W as default};
@@ -1,7 +1,7 @@
1
- var Y=Object.defineProperty;var q=(r,n)=>Y(r,"name",{value:n,configurable:!0});import{addHookName as y}from"preact/devtools";import{useState as k,useRef as Z,useMemo as E,useEffect as _}from"preact/hooks";import w from"../../packem_shared/cn-DWLJYh3h.js";import{jsxs as s,jsx as e,Fragment as K}from"preact/jsx-runtime";var Q=Object.defineProperty,d=q((r,n)=>Q(r,"name",{value:n,configurable:!0}),"d");const G=d((r,n)=>{for(const o of r)if(o instanceof CSSStyleRule){if(o.selectorText.split(",").some(l=>{const i=l.trim();return i===":root"||i==="html"}))for(let l=0;l<o.style.length;l++){const i=o.style[l];if(i.startsWith("--")&&!i.startsWith("--tw-")&&!i.startsWith("--brand-")){const p=o.style.getPropertyValue(i).trim();p&&n.set(i,p)}}}else"cssRules"in o&&o.cssRules instanceof CSSRuleList&&G(o.cssRules,n)},"collectVariablesFromRules"),U=d(()=>{const r=new Map;for(const n of document.styleSheets)try{G(n.cssRules,r)}catch{}return r},"scanRootVariables"),b=d(r=>r.endsWith("rem")?Number.parseFloat(r)*16:r.endsWith("px")?Number.parseFloat(r):r.endsWith("em")?Number.parseFloat(r)*16:0,"parseToPx"),ee=d(r=>{const n=[],o=[],l=[],i=[],p=[],f=[];for(const[a,h]of r)a.startsWith("--color-")?n.push({cssVar:a,name:a.slice(8),value:h}):a.startsWith("--spacing-")?o.push({cssVar:a,name:a.slice(10),numericPx:b(h),value:h}):a.startsWith("--text-")&&!a.includes("--line-height")&&!a.endsWith("--font-weight")?l.push({cssVar:a,name:a.slice(7),sizePx:b(h),value:h}):a.startsWith("--font-")?i.push({cssVar:a,name:a.slice(7),value:h}):a.startsWith("--radius-")?p.push({cssVar:a,name:a.slice(9),value:h}):(a.startsWith("--shadow-")||a.startsWith("--drop-shadow-"))&&f.push({cssVar:a,name:a.slice(2),value:h});return o.sort((a,h)=>a.numericPx-h.numericPx),l.sort((a,h)=>a.sizePx-h.sizePx),{colors:n,fontFamilies:i,fontSizes:l,radii:p,shadows:f,spacing:o}},"extractTokens"),$=d(r=>/^\w+-\d+$/.test(r),"isNumericScale"),te=d(r=>{const n=[],o=new Map;for(const l of r)if($(l.name)){const i=l.name.replace(/-\d+$/,""),p=o.get(i)??[];p.push(l),o.set(i,p)}else n.push(l);for(const l of o.values())l.sort((i,p)=>{const f=Number.parseInt(i.name.match(/-(\d+)$/)?.[1]??"0",10),a=Number.parseInt(p.name.match(/-(\d+)$/)?.[1]??"0",10);return f-a});return{scales:o,semantic:n}},"groupColors"),j=d(()=>{const[r,n]=y(k(!1),"copied"),o=y(Z(null),"timer");return{copied:r,copy:d(l=>{navigator.clipboard.writeText(l).catch(()=>{}),n(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(n,1500,!1)},"copy")}},"useCopy"),T=d(({count:r,title:n})=>s("div",{class:"flex items-center gap-2 px-3 py-1.5 bg-foreground/3 border-b border-border/40",children:[s("span",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-muted-foreground/70",children:[e("span",{class:"text-primary/50",children:"// "}),n]}),r!==void 0&&r>0&&e("span",{class:"ml-auto text-[0.58rem] font-mono text-muted-foreground/50",children:r})]}),"SectionTitle"),re=d(({token:r})=>{const{copied:n,copy:o}=j();return s("button",{class:"group flex items-center gap-2.5 w-full text-left hover:bg-foreground/4 px-3 py-1.5 transition-colors cursor-pointer bg-transparent border-0",onClick:d(()=>o(r.cssVar),"onClick"),title:`Click to copy ${r.cssVar}`,type:"button",children:[e("span",{class:"shrink-0 size-5 border border-black/10 dark:border-white/10",style:{background:`var(${r.cssVar})`}}),s("span",{class:"flex-1 min-w-0",children:[e("span",{class:"block text-[0.68rem] font-mono text-foreground truncate",children:r.name}),e("span",{class:"block text-[0.6rem] font-mono text-muted-foreground/60 truncate",children:r.value})]}),e("span",{class:w("text-[0.6rem] font-mono shrink-0 transition-opacity",n?"text-primary opacity-100":"text-muted-foreground/40 opacity-0 group-hover:opacity-100"),children:n?"copied!":"copy"})]})},"ColorItem"),oe=d(({name:r,tokens:n})=>{const{copied:o,copy:l}=j();return s("div",{class:"px-3 py-2",children:[s("div",{class:"flex items-center gap-2 mb-1.5",children:[e("span",{class:"text-[0.65rem] font-mono text-muted-foreground/70 w-16 shrink-0",children:r}),e("div",{class:"flex flex-1 gap-px overflow-hidden",children:n.map(i=>e("button",{class:"flex-1 h-5 border-0 cursor-pointer transition-transform hover:scale-110 hover:z-10",onClick:d(()=>l(i.cssVar),"onClick"),style:{background:`var(${i.cssVar})`,minWidth:0},title:`${i.name}
2
- ${i.value}
3
- Click to copy ${i.cssVar}`,type:"button"},i.cssVar))})]}),o&&e("span",{class:"text-[0.6rem] font-mono text-primary/70 pl-[72px]",children:"copied!"})]})},"ColorScaleRow"),ne=d(({colors:r})=>{const{scales:n,semantic:o}=y(E(()=>te(r),[r]),"scales");return r.length===0?s("div",{class:"flex flex-col items-center justify-center py-16 gap-3 text-center px-6",children:[e("span",{class:"text-3xl text-muted-foreground/20",children:"◫"}),e("p",{class:"text-[0.75rem] text-muted-foreground/60",children:"No color tokens found"}),s("p",{class:"text-[0.65rem] text-muted-foreground/40 leading-relaxed",children:["Color tokens are read from ",e("code",{class:"font-mono",children:"--color-*"})," CSS variables on ",e("code",{class:"font-mono",children:":root"})]})]}):s("div",{children:[o.length>0&&s("div",{class:"border-b border-border/40",children:[e(T,{count:o.length,title:"Semantic"}),e("div",{class:"py-1",children:o.map(l=>e(re,{token:l},l.cssVar))})]}),n.size>0&&s("div",{children:[e(T,{count:n.size,title:"Palette"}),e("div",{class:"py-1 divide-y divide-border/20",children:Array.from(n.entries(),([l,i])=>e(oe,{name:l,tokens:i},l))})]})]})},"ColorsTab"),se=d(({spacing:r})=>{const n=y(E(()=>Math.max(...r.map(o=>o.numericPx),1),[r]),"maxPx");return r.length===0?s("div",{class:"flex flex-col items-center justify-center py-16 gap-3 text-center px-6",children:[e("span",{class:"text-3xl text-muted-foreground/20",children:"↔"}),e("p",{class:"text-[0.75rem] text-muted-foreground/60",children:"No spacing tokens found"}),s("p",{class:"text-[0.65rem] text-muted-foreground/40 leading-relaxed",children:["Spacing tokens are read from ",e("code",{class:"font-mono",children:"--spacing-*"})," CSS variables"]})]}):e("div",{class:"p-3 space-y-1",children:r.map(o=>{const l=n>0?Math.max(o.numericPx/n*100,2):2;return s("div",{class:"flex items-center gap-2.5",children:[e("span",{class:"text-[0.62rem] font-mono text-muted-foreground/70 w-8 shrink-0 text-right",children:o.name}),e("div",{class:"flex-1 flex items-center gap-1.5",children:e("div",{class:"flex-1 h-3.5 bg-foreground/5 border border-border/30 overflow-hidden",children:e("div",{class:"h-full bg-primary/30 border-r border-primary/40",style:{width:`${l}%`}})})}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 w-14 text-right shrink-0",children:o.value})]},o.cssVar)})})},"SpacingTab"),le=d(({fontFamilies:r,fontSizes:n})=>n.length===0&&r.length===0?s("div",{class:"flex flex-col items-center justify-center py-16 gap-3 text-center px-6",children:[e("span",{class:"text-3xl text-muted-foreground/20",children:"Aa"}),e("p",{class:"text-[0.75rem] text-muted-foreground/60",children:"No typography tokens found"}),s("p",{class:"text-[0.65rem] text-muted-foreground/40 leading-relaxed",children:["Font size tokens are read from ",e("code",{class:"font-mono",children:"--text-*"})," and font family tokens from ",e("code",{class:"font-mono",children:"--font-*"})]})]}):s("div",{children:[n.length>0&&s("div",{class:"border-b border-border/40",children:[e(T,{count:n.length,title:"Font Sizes"}),e("div",{class:"p-3 space-y-1.5",children:n.map(o=>{const l=Math.min(o.sizePx||14,48);return s("div",{class:"flex items-center gap-3",children:[e("span",{class:"text-[0.6rem] font-mono text-muted-foreground/60 w-10 shrink-0 text-right",children:o.name}),e("span",{class:"text-foreground leading-none truncate flex-1",style:{fontSize:`${l}px`},children:"Ag"}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 shrink-0",children:o.value})]},o.cssVar)})})]}),r.length>0&&s("div",{children:[e(T,{count:r.length,title:"Font Families"}),e("div",{class:"p-3 space-y-2",children:r.map(o=>s("div",{class:"space-y-0.5",children:[e("div",{class:"flex items-center justify-between gap-2",children:e("code",{class:"text-[0.68rem] font-mono text-foreground",children:o.name})}),e("p",{class:"text-[0.75rem] text-foreground/70 truncate",style:{fontFamily:`var(${o.cssVar})`},children:"The quick brown fox"}),e("code",{class:"block text-[0.58rem] font-mono text-muted-foreground/50 truncate",children:o.value})]},o.cssVar))})]})]}),"TypographyTab"),ce=d(({radii:r,shadows:n})=>r.length===0&&n.length===0?s("div",{class:"flex flex-col items-center justify-center py-16 gap-3 text-center px-6",children:[e("span",{class:"text-3xl text-muted-foreground/20",children:"◻"}),e("p",{class:"text-[0.75rem] text-muted-foreground/60",children:"No effect tokens found"}),s("p",{class:"text-[0.65rem] text-muted-foreground/40 leading-relaxed",children:["Radius tokens from ",e("code",{class:"font-mono",children:"--radius-*"})," and shadow tokens from ",e("code",{class:"font-mono",children:"--shadow-*"})]})]}):s("div",{children:[r.length>0&&s("div",{class:"border-b border-border/40",children:[e(T,{count:r.length,title:"Border Radius"}),e("div",{class:"p-3 flex flex-wrap gap-3",children:r.map(o=>s("div",{class:"flex flex-col items-center gap-1.5",children:[e("div",{class:"size-10 border-2 border-primary/40 bg-primary/8",style:{borderRadius:`var(${o.cssVar})`}}),e("code",{class:"text-[0.6rem] font-mono text-muted-foreground/70",children:o.name}),e("code",{class:"text-[0.58rem] font-mono text-muted-foreground/50",children:o.value})]},o.cssVar))})]}),n.length>0&&s("div",{children:[e(T,{count:n.length,title:"Shadows"}),e("div",{class:"p-3 space-y-3",children:n.map(o=>s("div",{class:"space-y-1.5",children:[e("div",{class:"flex items-center justify-between gap-2",children:e("code",{class:"text-[0.68rem] font-mono text-foreground",children:o.name})}),e("div",{class:"h-10 bg-card border border-border/40",style:{boxShadow:`var(${o.cssVar})`}}),e("code",{class:"block text-[0.58rem] font-mono text-muted-foreground/50 truncate",children:o.value})]},o.cssVar))})]})]}),"EffectsTab"),ie=d(({name:r,tokens:n})=>{const{copied:o,copy:l}=j();return s("div",{class:"px-3 py-2",children:[s("div",{class:"flex items-center gap-2 mb-1",children:[e("span",{class:"text-[0.65rem] font-mono text-muted-foreground/70 w-16 shrink-0",children:r}),e("div",{class:"flex flex-1 gap-px overflow-hidden",children:n.map(([i,p])=>e("button",{class:"flex-1 h-5 border-0 cursor-pointer transition-transform hover:scale-110 hover:z-10",onClick:d(()=>l(i),"onClick"),style:{background:p},title:`${i}
4
- ${p}
5
- Click to copy`,type:"button"},i))})]}),o&&e("span",{class:"text-[0.6rem] font-mono text-primary/70 pl-[72px]",children:"copied!"})]})},"ConfigColorScaleRow"),H=d(({cssVar:r,isCustom:n,value:o})=>{const{copied:l,copy:i}=j(),p=r.slice(8);return s("button",{class:"group flex items-center gap-2.5 w-full text-left hover:bg-foreground/4 px-3 py-1.5 transition-colors cursor-pointer bg-transparent border-0",onClick:d(()=>i(r),"onClick"),title:`Click to copy ${r}`,type:"button",children:[e("span",{class:"shrink-0 size-5 border border-black/10",style:{background:o}}),s("span",{class:"flex-1 min-w-0",children:[s("span",{class:"flex items-center gap-1.5",children:[e("span",{class:"text-[0.68rem] font-mono text-foreground truncate",children:p}),n&&e("span",{class:"text-[0.55rem] font-bold uppercase tracking-wide text-primary/70 bg-primary/10 px-1",children:"custom"})]}),e("span",{class:"block text-[0.6rem] font-mono text-muted-foreground/60 truncate",children:o})]}),e("span",{class:w("text-[0.6rem] font-mono shrink-0 transition-opacity",l?"text-primary opacity-100":"text-muted-foreground/40 opacity-0 group-hover:opacity-100"),children:l?"copied!":"copy"})]})},"ConfigSemanticColorItem"),g=d(({children:r,count:n,defaultOpen:o=!0,title:l})=>{const[i,p]=y(k(o),"open");return s("div",{class:"border-b border-border/40",children:[s("button",{class:"w-full flex items-center gap-2 px-3 py-1.5 bg-foreground/3 hover:bg-foreground/5 transition-colors cursor-pointer border-0 text-left",onClick:d(()=>p(f=>!f),"onClick"),type:"button",children:[s("span",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-muted-foreground/70 flex-1",children:[e("span",{class:"text-primary/50",children:"// "}),l]}),e("span",{class:"text-[0.58rem] font-mono text-muted-foreground/50",children:n}),e("span",{class:w("text-muted-foreground/40 text-[0.6rem] transition-transform duration-150 ml-1",i&&"rotate-90"),children:"▶"})]}),i&&r]})},"ConfigSection"),W=d(({cssVar:r,isCustom:n,value:o})=>{const{copied:l,copy:i}=j(),p=r.replace(/^--/,"");return s("button",{class:"group flex items-center gap-2.5 w-full text-left hover:bg-foreground/4 px-3 py-1.5 transition-colors cursor-pointer bg-transparent border-0",onClick:d(()=>i(r),"onClick"),type:"button",children:[e("span",{class:"flex-1 min-w-0",children:s("span",{class:"flex items-center gap-1.5",children:[e("code",{class:"text-[0.68rem] font-mono text-foreground truncate",children:p}),n&&e("span",{class:"text-[0.55rem] font-bold uppercase tracking-wide text-primary/70 bg-primary/10 px-1 shrink-0",children:"custom"})]})}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 truncate max-w-[160px] shrink-0",children:o}),e("span",{class:w("text-[0.6rem] font-mono shrink-0 transition-opacity w-8 text-right",l?"text-primary opacity-100":"text-muted-foreground/40 opacity-0 group-hover:opacity-100"),children:l?"✓":"copy"})]})},"ConfigTokenRow"),ae=d(({configData:r,error:n,loading:o,onRetry:l})=>{const[i,p]=y(k(""),"colorSearch");if(o)return s("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[e("div",{"aria-hidden":"true",class:"flex gap-1.5 items-center",children:[0,160,320].map(t=>e("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${t}ms`}},t))}),e("span",{class:"text-[0.75rem] text-muted-foreground",children:"Loading Tailwind config…"})]});if(n||!r)return s("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 text-center",children:[e("p",{class:"text-[0.8rem] text-destructive",children:n??"No config available"}),e("button",{class:"px-3 py-1.5 text-[0.75rem] border border-border text-muted-foreground hover:text-foreground cursor-pointer bg-transparent",onClick:l,type:"button",children:"Retry"})]});const{cssFiles:f,customTheme:a,defaultTheme:h,version:u}=r,x={...h,...a},C=Object.entries(x).filter(([t])=>t.startsWith("--color-")),S=C.filter(([t])=>!$(t.slice(8))),F=C.filter(([t])=>$(t.slice(8))),m=new Map;for(const[t,c]of F){const v=t.slice(8).replace(/-\d+$/,""),V=m.get(v)??[];V.push([t,c]),m.set(v,V)}for(const t of m.values())t.sort((c,v)=>{const V=Number.parseInt(c[0].match(/-(\d+)$/)?.[1]??"0",10),X=Number.parseInt(v[0].match(/-(\d+)$/)?.[1]??"0",10);return V-X});const O=i?[...m.entries()].filter(([t])=>t.toLowerCase().includes(i.toLowerCase())):[...m.entries()],z=Object.entries(x).filter(([t])=>t.startsWith("--spacing-")).sort(([,t],[,c])=>b(t)-b(c)),R=Object.entries(x).filter(([t])=>t.startsWith("--font-")),N=Object.entries(x).filter(([t])=>t.startsWith("--text-")&&!t.includes("--line-height")&&!t.endsWith("--font-weight")).sort(([,t],[,c])=>b(t)-b(c)),P=Object.entries(x).filter(([t])=>t.startsWith("--breakpoint-")).sort(([,t],[,c])=>b(t)-b(c)),M=Object.entries(x).filter(([t])=>t.startsWith("--radius-")),D=Object.entries(x).filter(([t])=>t.startsWith("--shadow-")||t.startsWith("--drop-shadow-")),I=Object.entries(x).filter(([t])=>t.startsWith("--blur-")),A=Object.entries(x).filter(([t])=>t.startsWith("--animate-")),J=["--color-","--spacing-","--font-","--text-","--breakpoint-","--radius-","--shadow-","--drop-shadow-","--blur-","--animate-","--tw-","--brand-"],B=Object.entries(x).filter(([t])=>!J.some(c=>t.startsWith(c))),L=z.reduce((t,[,c])=>Math.max(t,b(c)),1);return s("div",{children:[s("div",{class:"flex items-center gap-2 px-3 py-2 border-b border-border/40 bg-foreground/2 shrink-0",children:[e("span",{class:w("text-[0.6rem] font-bold uppercase tracking-wide px-1.5 py-0.5 shrink-0",u==="v4"?"bg-cyan-500/10 text-cyan-600 dark:text-cyan-400 border border-cyan-500/20":u==="v3"?"bg-primary/10 text-primary border border-primary/20":"bg-foreground/8 text-muted-foreground border border-border"),children:u==="unknown"?"Tailwind":`Tailwind ${u}`}),f.length>0&&s("code",{class:"text-[0.62rem] font-mono text-muted-foreground/70 truncate flex-1",children:[f[0],f.length>1&&s("span",{class:"text-muted-foreground/40",children:[" +",f.length-1]})]}),s("span",{class:"text-[0.6rem] font-mono text-muted-foreground/50 shrink-0",children:[Object.keys(x).length," tokens"]})]}),Object.keys(a).length>0&&e(g,{count:Object.keys(a).length,title:"Custom Overrides",children:e("div",{class:"py-1",children:Object.entries(a).map(([t,c])=>t.startsWith("--color-")&&!$(t.slice(8))?e(H,{cssVar:t,isCustom:!0,value:c},t):e(W,{cssVar:t,isCustom:!0,value:c},t))})}),S.length>0&&e(g,{count:S.length,title:"Semantic Colors",children:e("div",{class:"py-1",children:S.map(([t,c])=>e(H,{cssVar:t,isCustom:t in a,value:c},t))})}),m.size>0&&s(g,{count:m.size,defaultOpen:!1,title:"Color Palette",children:[e("div",{class:"px-3 pt-2 pb-1 border-b border-border/20",children:e("input",{class:"w-full bg-foreground/4 border border-border/40 px-2 py-1 text-[0.68rem] font-mono text-foreground placeholder:text-muted-foreground/40 outline-none focus:border-primary/40",onInput:d(t=>p(t.target.value),"onInput"),placeholder:"Filter scales…",type:"text",value:i})}),s("div",{class:"py-1 divide-y divide-border/20",children:[O.map(([t,c])=>e(ie,{name:t,tokens:c},t)),O.length===0&&e("p",{class:"text-center text-[0.7rem] text-muted-foreground/50 py-4",children:"No colors match"})]})]}),z.length>0&&e(g,{count:z.length,defaultOpen:!1,title:"Spacing",children:e("div",{class:"p-3 space-y-1",children:z.map(([t,c])=>{const v=b(c),V=L>0?Math.max(v/L*100,1):1;return s("div",{class:"flex items-center gap-2.5",children:[e("span",{class:"text-[0.62rem] font-mono text-muted-foreground/70 w-10 shrink-0 text-right",children:t.slice(10)}),e("div",{class:"flex-1 h-3 bg-foreground/5 border border-border/30 overflow-hidden",children:e("div",{class:"h-full bg-primary/30 border-r border-primary/40",style:{width:`${V}%`}})}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 w-14 text-right shrink-0",children:c})]},t)})})}),P.length>0&&e(g,{count:P.length,defaultOpen:!1,title:"Breakpoints",children:e("div",{class:"p-3 space-y-1.5",children:P.map(([t,c])=>e(W,{cssVar:t,isCustom:t in a,value:c},t))})}),R.length>0&&e(g,{count:R.length,defaultOpen:!1,title:"Font Families",children:e("div",{class:"p-3 space-y-2",children:R.map(([t,c])=>s("div",{class:"space-y-0.5",children:[e("code",{class:"text-[0.68rem] font-mono text-foreground",children:t.slice(7)}),e("p",{class:"text-[0.75rem] text-foreground/70 truncate",style:{fontFamily:c.startsWith("--theme(")?"inherit":c},children:"The quick brown fox"}),e("code",{class:"block text-[0.58rem] font-mono text-muted-foreground/50 truncate",children:c})]},t))})}),N.length>0&&e(g,{count:N.length,defaultOpen:!1,title:"Font Sizes",children:e("div",{class:"p-3 space-y-1.5",children:N.map(([t,c])=>{const v=Math.min(b(c)||14,48);return s("div",{class:"flex items-center gap-3",children:[e("span",{class:"text-[0.6rem] font-mono text-muted-foreground/60 w-12 shrink-0 text-right",children:t.slice(7)}),e("span",{class:"text-foreground leading-none truncate flex-1",style:{fontSize:`${v}px`},children:"Ag"}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 shrink-0",children:c})]},t)})})}),M.length>0&&e(g,{count:M.length,defaultOpen:!1,title:"Border Radius",children:e("div",{class:"p-3 flex flex-wrap gap-3",children:M.map(([t,c])=>s("div",{class:"flex flex-col items-center gap-1.5",children:[e("div",{class:"size-10 border-2 border-primary/40 bg-primary/8",style:{borderRadius:c.startsWith("--theme(")?"4px":c}}),e("code",{class:"text-[0.6rem] font-mono text-muted-foreground/70",children:t.slice(9)}),e("code",{class:"text-[0.58rem] font-mono text-muted-foreground/50",children:c})]},t))})}),D.length>0&&e(g,{count:D.length,defaultOpen:!1,title:"Shadows",children:e("div",{class:"p-3 space-y-3",children:D.map(([t,c])=>s("div",{class:"space-y-1",children:[e("code",{class:"text-[0.68rem] font-mono text-foreground",children:t.slice(2)}),!c.startsWith("--theme(")&&e("div",{class:"h-8 bg-card border border-border/40",style:{boxShadow:c}}),e("code",{class:"block text-[0.58rem] font-mono text-muted-foreground/50 truncate",children:c})]},t))})}),I.length>0&&e(g,{count:I.length,defaultOpen:!1,title:"Blur",children:e("div",{class:"py-1",children:I.map(([t,c])=>e(W,{cssVar:t,isCustom:t in a,value:c},t))})}),A.length>0&&e(g,{count:A.length,defaultOpen:!1,title:"Animations",children:e("div",{class:"py-1",children:A.map(([t,c])=>e(W,{cssVar:t,isCustom:t in a,value:c},t))})}),B.length>0&&e(g,{count:B.length,defaultOpen:!1,title:"Other",children:e("div",{class:"py-1",children:B.map(([t,c])=>e(W,{cssVar:t,isCustom:t in a,value:c},t))})})]})},"ConfigTab"),de=d(()=>s("div",{class:"flex flex-col items-center justify-center h-full gap-4 py-16 px-8 text-center select-none",children:[e("div",{class:"size-12 border border-primary/20 bg-primary/5 flex items-center justify-center text-primary/30 text-2xl",children:"◻"}),s("div",{class:"space-y-1.5",children:[e("p",{class:"text-[0.8rem] font-medium text-foreground/70",children:"No design tokens detected"}),s("p",{class:"text-[0.7rem] text-muted-foreground leading-relaxed max-w-[240px]",children:["This app reads CSS custom properties from your page's ",e("code",{class:"font-mono text-[0.65rem]",children:":root"})," selector. Make sure your app uses Tailwind CSS v4 or defines custom properties."]})]})]}),"EmptyState"),pe=d(({helpers:r})=>{const[n,o]=y(k("colors"),"tab"),[l,i]=y(k(null),"configData"),[p,f]=y(k(!1),"configLoading"),[a,h]=y(k(null),"configError"),u=y(E(()=>{const m=U();return ee(m)},[]),"tokens"),x=d(()=>{f(!0),h(null),r.rpc.getTailwindConfig().then(m=>{i(m),f(!1)}).catch(m=>{h(m.message??"Failed to load Tailwind config"),f(!1)})},"loadConfig");_(()=>{n==="config"&&!l&&!p&&!a&&x()},[n]);const C=u.colors.length+u.spacing.length+u.fontSizes.length+u.radii.length,S={colors:u.colors.length,config:l?Object.keys(l.defaultTheme).length+Object.keys(l.customTheme).length:0,effects:u.radii.length+u.shadows.length,spacing:u.spacing.length,type:u.fontSizes.length+u.fontFamilies.length},F=[{id:"colors",label:"Colors"},{id:"spacing",label:"Spacing"},{id:"type",label:"Type"},{id:"effects",label:"Effects"},{id:"config",label:"Config"}];return s("div",{class:"flex flex-col h-full",children:[s("div",{class:"flex items-center justify-between gap-3 px-4 py-3 border-b border-border shrink-0",children:[e("span",{class:"text-[0.75rem] font-medium text-foreground",children:"Design Tokens"}),C>0&&s("span",{class:"text-[0.65rem] font-mono text-muted-foreground/60 bg-foreground/5 px-2 py-0.5 border border-border/40",children:[C," page tokens"]})]}),C===0&&n!=="config"?e(de,{}):s(K,{children:[e("div",{class:"flex border-b border-border shrink-0 overflow-x-auto",children:F.map(({id:m,label:O})=>s("button",{class:w("flex-shrink-0 px-3 py-2 text-[0.68rem] font-medium transition-colors cursor-pointer border-0 border-b-2 -mb-px",n===m?"text-primary border-primary bg-primary/4":"text-muted-foreground hover:text-foreground border-transparent bg-transparent"),onClick:d(()=>o(m),"onClick"),type:"button",children:[O,S[m]>0&&e("span",{class:w("ml-1.5 text-[0.58rem] font-mono",n===m?"text-primary/70":"text-muted-foreground/50"),children:S[m]})]},m))}),s("div",{class:"flex-1 overflow-auto devtools-content-scroll",children:[n==="colors"&&e(ne,{colors:u.colors}),n==="spacing"&&e(se,{spacing:u.spacing}),n==="type"&&e(le,{fontFamilies:u.fontFamilies,fontSizes:u.fontSizes}),n==="effects"&&e(ce,{radii:u.radii,shadows:u.shadows}),n==="config"&&e(ae,{configData:l,error:a,loading:p,onRetry:x})]})]})]})},"TailwindApp"),ue=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 54 33">
1
+ var Y=Object.defineProperty;var q=(r,n)=>Y(r,"name",{value:n,configurable:!0});import{addHookName as b}from"preact/devtools";import{useState as C,useRef as G,useMemo as J,useEffect as Z}from"preact/hooks";import S from"../../packem_shared/cn-DWLJYh3h.js";import{jsxs as s,jsx as e,Fragment as ee}from"preact/jsx-runtime";var te=Object.defineProperty,p=q((r,n)=>te(r,"name",{value:n,configurable:!0}),"p$1");const re=/^\w+-\d+$/,K=/-\d+$/,N=/-(\d+)$/,oe=/^--/,ne=p(r=>r.split(",").some(n=>{const o=n.trim();return o===":root"||o==="html"}),"isRootSelector"),se=p((r,n)=>{for(let o=0;o<r.length;o+=1){const l=r[o];if(l.startsWith("--")&&!l.startsWith("--tw-")&&!l.startsWith("--brand-")){const a=r.getPropertyValue(l).trim();a&&n.set(l,a)}}},"collectRootStyleVariables"),Q=p((r,n)=>{for(const o of r)o instanceof CSSStyleRule?ne(o.selectorText)&&se(o.style,n):"cssRules"in o&&o.cssRules instanceof CSSRuleList&&Q(o.cssRules,n)},"collectVariablesFromRules"),le=p(()=>{const r=new Map;for(const n of document.styleSheets)try{Q(n.cssRules,r)}catch{}return r},"scanRootVariables"),g=p(r=>r.endsWith("rem")?Number.parseFloat(r)*16:r.endsWith("px")?Number.parseFloat(r):r.endsWith("em")?Number.parseFloat(r)*16:0,"parseToPx"),ce=p(r=>{const n=[],o=[],l=[],a=[],m=[],h=[];for(const[d,i]of r)d.startsWith("--color-")?n.push({cssVar:d,name:d.slice(8),value:i}):d.startsWith("--spacing-")?o.push({cssVar:d,name:d.slice(10),numericPx:g(i),value:i}):d.startsWith("--text-")&&!d.includes("--line-height")&&!d.endsWith("--font-weight")?l.push({cssVar:d,name:d.slice(7),sizePx:g(i),value:i}):d.startsWith("--font-")?a.push({cssVar:d,name:d.slice(7),value:i}):d.startsWith("--radius-")?m.push({cssVar:d,name:d.slice(9),value:i}):(d.startsWith("--shadow-")||d.startsWith("--drop-shadow-"))&&h.push({cssVar:d,name:d.slice(2),value:i});const u=o.toSorted((d,i)=>d.numericPx-i.numericPx),v=l.toSorted((d,i)=>d.sizePx-i.sizePx);return{colors:n,fontFamilies:a,fontSizes:v,radii:m,shadows:h,spacing:u}},"extractTokens"),F=p(r=>re.test(r),"isNumericScale"),ie=p(r=>{const n=[],o=new Map;for(const l of r)if(F(l.name)){const a=l.name.replace(K,""),m=o.get(a)??[];m.push(l),o.set(a,m)}else n.push(l);for(const[l,a]of o)o.set(l,a.toSorted((m,h)=>{const u=Number.parseInt(m.name.match(N)?.[1]??"0",10),v=Number.parseInt(h.name.match(N)?.[1]??"0",10);return u-v}));return{scales:o,semantic:n}},"groupColors"),O=p(()=>{const[r,n]=b(C(!1),"copied"),o=b(G(null),"timer");return{copied:r,copy:p(l=>{navigator.clipboard.writeText(l).catch(()=>{}),n(!0),o.current&&clearTimeout(o.current),o.current=setTimeout(n,1500,!1)},"copy")}},"useCopy"),W=p(({count:r,title:n})=>s("div",{class:"flex items-center gap-2 px-3 py-1.5 bg-foreground/3 border-b border-border/40",children:[s("span",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-muted-foreground/70",children:[e("span",{class:"text-primary/50",children:"// "}),n]}),r!==void 0&&r>0&&e("span",{class:"ml-auto text-[0.58rem] font-mono text-muted-foreground/50",children:r})]}),"SectionTitle"),ae=p(({token:r})=>{const{copied:n,copy:o}=O();return s("button",{class:"group flex items-center gap-2.5 w-full text-left hover:bg-foreground/4 px-3 py-1.5 transition-colors cursor-pointer bg-transparent border-0",onClick:p(()=>o(r.cssVar),"onClick"),title:`Click to copy ${r.cssVar}`,type:"button",children:[e("span",{class:"shrink-0 size-5 border border-black/10 dark:border-white/10",style:{background:`var(${r.cssVar})`}}),s("span",{class:"flex-1 min-w-0",children:[e("span",{class:"block text-[0.68rem] font-mono text-foreground truncate",children:r.name}),e("span",{class:"block text-[0.6rem] font-mono text-muted-foreground/60 truncate",children:r.value})]}),e("span",{class:S("text-[0.6rem] font-mono shrink-0 transition-opacity",n?"text-primary opacity-100":"text-muted-foreground/40 opacity-0 group-hover:opacity-100"),children:n?"copied!":"copy"})]})},"ColorItem"),de=p(({name:r,tokens:n})=>{const{copied:o,copy:l}=O();return s("div",{class:"px-3 py-2",children:[s("div",{class:"flex items-center gap-2 mb-1.5",children:[e("span",{class:"text-[0.65rem] font-mono text-muted-foreground/70 w-16 shrink-0",children:r}),e("div",{class:"flex flex-1 gap-px overflow-hidden",children:n.map(a=>e("button",{class:"flex-1 h-5 border-0 cursor-pointer transition-transform hover:scale-110 hover:z-10",onClick:p(()=>l(a.cssVar),"onClick"),style:{background:`var(${a.cssVar})`,minWidth:0},title:`${a.name}
2
+ ${a.value}
3
+ Click to copy ${a.cssVar}`,type:"button"},a.cssVar))})]}),o&&e("span",{class:"text-[0.6rem] font-mono text-primary/70 pl-[72px]",children:"copied!"})]})},"ColorScaleRow"),pe=p(({colors:r})=>{const{scales:n,semantic:o}=b(J(()=>ie(r),[r]),"scales");return r.length===0?s("div",{class:"flex flex-col items-center justify-center py-16 gap-3 text-center px-6",children:[e("span",{class:"text-3xl text-muted-foreground/20",children:"◫"}),e("p",{class:"text-[0.75rem] text-muted-foreground/60",children:"No color tokens found"}),s("p",{class:"text-[0.65rem] text-muted-foreground/40 leading-relaxed",children:["Color tokens are read from ",e("code",{class:"font-mono",children:"--color-*"})," CSS variables on ",e("code",{class:"font-mono",children:":root"})]})]}):s("div",{children:[o.length>0&&s("div",{class:"border-b border-border/40",children:[e(W,{count:o.length,title:"Semantic"}),e("div",{class:"py-1",children:o.map(l=>e(ae,{token:l},l.cssVar))})]}),n.size>0&&s("div",{children:[e(W,{count:n.size,title:"Palette"}),e("div",{class:"py-1 divide-y divide-border/20",children:Array.from(n.entries(),([l,a])=>e(de,{name:l,tokens:a},l))})]})]})},"ColorsTab"),me=p(({spacing:r})=>{const n=b(J(()=>Math.max(...r.map(o=>o.numericPx),1),[r]),"maxPx");return r.length===0?s("div",{class:"flex flex-col items-center justify-center py-16 gap-3 text-center px-6",children:[e("span",{class:"text-3xl text-muted-foreground/20",children:"↔"}),e("p",{class:"text-[0.75rem] text-muted-foreground/60",children:"No spacing tokens found"}),s("p",{class:"text-[0.65rem] text-muted-foreground/40 leading-relaxed",children:["Spacing tokens are read from ",e("code",{class:"font-mono",children:"--spacing-*"})," CSS variables"]})]}):e("div",{class:"p-3 space-y-1",children:r.map(o=>{const l=n>0?Math.max(o.numericPx/n*100,2):2;return s("div",{class:"flex items-center gap-2.5",children:[e("span",{class:"text-[0.62rem] font-mono text-muted-foreground/70 w-8 shrink-0 text-right",children:o.name}),e("div",{class:"flex-1 flex items-center gap-1.5",children:e("div",{class:"flex-1 h-3.5 bg-foreground/5 border border-border/30 overflow-hidden",children:e("div",{class:"h-full bg-primary/30 border-r border-primary/40",style:{width:`${l}%`}})})}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 w-14 text-right shrink-0",children:o.value})]},o.cssVar)})})},"SpacingTab"),ue=p(({fontFamilies:r,fontSizes:n})=>n.length===0&&r.length===0?s("div",{class:"flex flex-col items-center justify-center py-16 gap-3 text-center px-6",children:[e("span",{class:"text-3xl text-muted-foreground/20",children:"Aa"}),e("p",{class:"text-[0.75rem] text-muted-foreground/60",children:"No typography tokens found"}),s("p",{class:"text-[0.65rem] text-muted-foreground/40 leading-relaxed",children:["Font size tokens are read from ",e("code",{class:"font-mono",children:"--text-*"})," and font family tokens from ",e("code",{class:"font-mono",children:"--font-*"})]})]}):s("div",{children:[n.length>0&&s("div",{class:"border-b border-border/40",children:[e(W,{count:n.length,title:"Font Sizes"}),e("div",{class:"p-3 space-y-1.5",children:n.map(o=>{const l=Math.min(o.sizePx||14,48);return s("div",{class:"flex items-center gap-3",children:[e("span",{class:"text-[0.6rem] font-mono text-muted-foreground/60 w-10 shrink-0 text-right",children:o.name}),e("span",{class:"text-foreground leading-none truncate flex-1",style:{fontSize:`${l}px`},children:"Ag"}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 shrink-0",children:o.value})]},o.cssVar)})})]}),r.length>0&&s("div",{children:[e(W,{count:r.length,title:"Font Families"}),e("div",{class:"p-3 space-y-2",children:r.map(o=>s("div",{class:"space-y-0.5",children:[e("div",{class:"flex items-center justify-between gap-2",children:e("code",{class:"text-[0.68rem] font-mono text-foreground",children:o.name})}),e("p",{class:"text-[0.75rem] text-foreground/70 truncate",style:{fontFamily:`var(${o.cssVar})`},children:"The quick brown fox"}),e("code",{class:"block text-[0.58rem] font-mono text-muted-foreground/50 truncate",children:o.value})]},o.cssVar))})]})]}),"TypographyTab"),fe=p(({radii:r,shadows:n})=>r.length===0&&n.length===0?s("div",{class:"flex flex-col items-center justify-center py-16 gap-3 text-center px-6",children:[e("span",{class:"text-3xl text-muted-foreground/20",children:"◻"}),e("p",{class:"text-[0.75rem] text-muted-foreground/60",children:"No effect tokens found"}),s("p",{class:"text-[0.65rem] text-muted-foreground/40 leading-relaxed",children:["Radius tokens from ",e("code",{class:"font-mono",children:"--radius-*"})," and shadow tokens from ",e("code",{class:"font-mono",children:"--shadow-*"})]})]}):s("div",{children:[r.length>0&&s("div",{class:"border-b border-border/40",children:[e(W,{count:r.length,title:"Border Radius"}),e("div",{class:"p-3 flex flex-wrap gap-3",children:r.map(o=>s("div",{class:"flex flex-col items-center gap-1.5",children:[e("div",{class:"size-10 border-2 border-primary/40 bg-primary/8",style:{borderRadius:`var(${o.cssVar})`}}),e("code",{class:"text-[0.6rem] font-mono text-muted-foreground/70",children:o.name}),e("code",{class:"text-[0.58rem] font-mono text-muted-foreground/50",children:o.value})]},o.cssVar))})]}),n.length>0&&s("div",{children:[e(W,{count:n.length,title:"Shadows"}),e("div",{class:"p-3 space-y-3",children:n.map(o=>s("div",{class:"space-y-1.5",children:[e("div",{class:"flex items-center justify-between gap-2",children:e("code",{class:"text-[0.68rem] font-mono text-foreground",children:o.name})}),e("div",{class:"h-10 bg-card border border-border/40",style:{boxShadow:`var(${o.cssVar})`}}),e("code",{class:"block text-[0.58rem] font-mono text-muted-foreground/50 truncate",children:o.value})]},o.cssVar))})]})]}),"EffectsTab"),he=p(({name:r,tokens:n})=>{const{copied:o,copy:l}=O();return s("div",{class:"px-3 py-2",children:[s("div",{class:"flex items-center gap-2 mb-1",children:[e("span",{class:"text-[0.65rem] font-mono text-muted-foreground/70 w-16 shrink-0",children:r}),e("div",{class:"flex flex-1 gap-px overflow-hidden",children:n.map(([a,m])=>e("button",{class:"flex-1 h-5 border-0 cursor-pointer transition-transform hover:scale-110 hover:z-10",onClick:p(()=>l(a),"onClick"),style:{background:m},title:`${a}
4
+ ${m}
5
+ Click to copy`,type:"button"},a))})]}),o&&e("span",{class:"text-[0.6rem] font-mono text-primary/70 pl-[72px]",children:"copied!"})]})},"ConfigColorScaleRow"),H=p(({cssVar:r,isCustom:n,value:o})=>{const{copied:l,copy:a}=O(),m=r.slice(8);return s("button",{class:"group flex items-center gap-2.5 w-full text-left hover:bg-foreground/4 px-3 py-1.5 transition-colors cursor-pointer bg-transparent border-0",onClick:p(()=>a(r),"onClick"),title:`Click to copy ${r}`,type:"button",children:[e("span",{class:"shrink-0 size-5 border border-black/10",style:{background:o}}),s("span",{class:"flex-1 min-w-0",children:[s("span",{class:"flex items-center gap-1.5",children:[e("span",{class:"text-[0.68rem] font-mono text-foreground truncate",children:m}),n&&e("span",{class:"text-[0.55rem] font-bold uppercase tracking-wide text-primary/70 bg-primary/10 px-1",children:"custom"})]}),e("span",{class:"block text-[0.6rem] font-mono text-muted-foreground/60 truncate",children:o})]}),e("span",{class:S("text-[0.6rem] font-mono shrink-0 transition-opacity",l?"text-primary opacity-100":"text-muted-foreground/40 opacity-0 group-hover:opacity-100"),children:l?"copied!":"copy"})]})},"ConfigSemanticColorItem"),x=p(({children:r,count:n,defaultOpen:o=!0,title:l})=>{const[a,m]=b(C(o),"open");return s("div",{class:"border-b border-border/40",children:[s("button",{class:"w-full flex items-center gap-2 px-3 py-1.5 bg-foreground/3 hover:bg-foreground/5 transition-colors cursor-pointer border-0 text-left",onClick:p(()=>m(h=>!h),"onClick"),type:"button",children:[s("span",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-muted-foreground/70 flex-1",children:[e("span",{class:"text-primary/50",children:"// "}),l]}),e("span",{class:"text-[0.58rem] font-mono text-muted-foreground/50",children:n}),e("span",{class:S("text-muted-foreground/40 text-[0.6rem] transition-transform duration-150 ml-1",a&&"rotate-90"),children:"▶"})]}),a&&r]})},"ConfigSection"),z=p(({cssVar:r,isCustom:n,value:o})=>{const{copied:l,copy:a}=O(),m=r.replace(oe,"");return s("button",{class:"group flex items-center gap-2.5 w-full text-left hover:bg-foreground/4 px-3 py-1.5 transition-colors cursor-pointer bg-transparent border-0",onClick:p(()=>a(r),"onClick"),type:"button",children:[e("span",{class:"flex-1 min-w-0",children:s("span",{class:"flex items-center gap-1.5",children:[e("code",{class:"text-[0.68rem] font-mono text-foreground truncate",children:m}),n&&e("span",{class:"text-[0.55rem] font-bold uppercase tracking-wide text-primary/70 bg-primary/10 px-1 shrink-0",children:"custom"})]})}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 truncate max-w-[160px] shrink-0",children:o}),e("span",{class:S("text-[0.6rem] font-mono shrink-0 transition-opacity w-8 text-right",l?"text-primary opacity-100":"text-muted-foreground/40 opacity-0 group-hover:opacity-100"),children:l?"✓":"copy"})]})},"ConfigTokenRow"),xe=p(({configData:r,error:n,loading:o,onRetry:l})=>{const[a,m]=b(C(""),"colorSearch");if(o)return s("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[e("div",{"aria-hidden":"true",class:"flex gap-1.5 items-center",children:[0,160,320].map(t=>e("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${t}ms`}},t))}),e("span",{class:"text-[0.75rem] text-muted-foreground",children:"Loading Tailwind config…"})]});if(n||!r)return s("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 text-center",children:[e("p",{class:"text-[0.8rem] text-destructive",children:n??"No config available"}),e("button",{class:"px-3 py-1.5 text-[0.75rem] border border-border text-muted-foreground hover:text-foreground cursor-pointer bg-transparent",onClick:l,type:"button",children:"Retry"})]});const{cssFiles:h,customTheme:u,defaultTheme:v,version:d}=r,i={...v,...u},j=Object.entries(i).filter(([t])=>t.startsWith("--color-")),w=j.filter(([t])=>!F(t.slice(8))),R=j.filter(([t])=>F(t.slice(8))),y=new Map;for(const[t,c]of R){const k=t.slice(8).replace(K,""),T=y.get(k)??[];T.push([t,c]),y.set(k,T)}for(const[t,c]of y)y.set(t,c.toSorted((k,T)=>{const _=Number.parseInt(k[0].match(N)?.[1]??"0",10),U=Number.parseInt(T[0].match(N)?.[1]??"0",10);return _-U}));const f=a?[...y.entries()].filter(([t])=>t.toLowerCase().includes(a.toLowerCase())):[...y.entries()],V=Object.entries(i).filter(([t])=>t.startsWith("--spacing-")).toSorted(([,t],[,c])=>g(t)-g(c)),P=Object.entries(i).filter(([t])=>t.startsWith("--font-")),M=Object.entries(i).filter(([t])=>t.startsWith("--text-")&&!t.includes("--line-height")&&!t.endsWith("--font-weight")).toSorted(([,t],[,c])=>g(t)-g(c)),I=Object.entries(i).filter(([t])=>t.startsWith("--breakpoint-")).toSorted(([,t],[,c])=>g(t)-g(c)),D=Object.entries(i).filter(([t])=>t.startsWith("--radius-")),A=Object.entries(i).filter(([t])=>t.startsWith("--shadow-")||t.startsWith("--drop-shadow-")),B=Object.entries(i).filter(([t])=>t.startsWith("--blur-")),E=Object.entries(i).filter(([t])=>t.startsWith("--animate-")),X=["--color-","--spacing-","--font-","--text-","--breakpoint-","--radius-","--shadow-","--drop-shadow-","--blur-","--animate-","--tw-","--brand-"],L=Object.entries(i).filter(([t])=>!X.some(c=>t.startsWith(c)));let $=1;for(const[,t]of V)$=Math.max($,g(t));return s("div",{children:[s("div",{class:"flex items-center gap-2 px-3 py-2 border-b border-border/40 bg-foreground/2 shrink-0",children:[e("span",{class:S("text-[0.6rem] font-bold uppercase tracking-wide px-1.5 py-0.5 shrink-0",d==="v4"&&"bg-cyan-500/10 text-cyan-600 dark:text-cyan-400 border border-cyan-500/20",d==="v3"&&"bg-primary/10 text-primary border border-primary/20",d==="unknown"&&"bg-foreground/8 text-muted-foreground border border-border"),children:d==="unknown"?"Tailwind":`Tailwind ${d}`}),h.length>0&&s("code",{class:"text-[0.62rem] font-mono text-muted-foreground/70 truncate flex-1",children:[h[0],h.length>1&&s("span",{class:"text-muted-foreground/40",children:[" +",h.length-1]})]}),s("span",{class:"text-[0.6rem] font-mono text-muted-foreground/50 shrink-0",children:[Object.keys(i).length," tokens"]})]}),Object.keys(u).length>0&&e(x,{count:Object.keys(u).length,title:"Custom Overrides",children:e("div",{class:"py-1",children:Object.entries(u).map(([t,c])=>t.startsWith("--color-")&&!F(t.slice(8))?e(H,{cssVar:t,isCustom:!0,value:c},t):e(z,{cssVar:t,isCustom:!0,value:c},t))})}),w.length>0&&e(x,{count:w.length,title:"Semantic Colors",children:e("div",{class:"py-1",children:w.map(([t,c])=>e(H,{cssVar:t,isCustom:t in u,value:c},t))})}),y.size>0&&s(x,{count:y.size,defaultOpen:!1,title:"Color Palette",children:[e("div",{class:"px-3 pt-2 pb-1 border-b border-border/20",children:e("input",{class:"w-full bg-foreground/4 border border-border/40 px-2 py-1 text-[0.68rem] font-mono text-foreground placeholder:text-muted-foreground/40 outline-none focus:border-primary/40",onInput:p(t=>m(t.target.value),"onInput"),placeholder:"Filter scales…",type:"text",value:a})}),s("div",{class:"py-1 divide-y divide-border/20",children:[f.map(([t,c])=>e(he,{name:t,tokens:c},t)),f.length===0&&e("p",{class:"text-center text-[0.7rem] text-muted-foreground/50 py-4",children:"No colors match"})]})]}),V.length>0&&e(x,{count:V.length,defaultOpen:!1,title:"Spacing",children:e("div",{class:"p-3 space-y-1",children:V.map(([t,c])=>{const k=g(c),T=$>0?Math.max(k/$*100,1):1;return s("div",{class:"flex items-center gap-2.5",children:[e("span",{class:"text-[0.62rem] font-mono text-muted-foreground/70 w-10 shrink-0 text-right",children:t.slice(10)}),e("div",{class:"flex-1 h-3 bg-foreground/5 border border-border/30 overflow-hidden",children:e("div",{class:"h-full bg-primary/30 border-r border-primary/40",style:{width:`${T}%`}})}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 w-14 text-right shrink-0",children:c})]},t)})})}),I.length>0&&e(x,{count:I.length,defaultOpen:!1,title:"Breakpoints",children:e("div",{class:"p-3 space-y-1.5",children:I.map(([t,c])=>e(z,{cssVar:t,isCustom:t in u,value:c},t))})}),P.length>0&&e(x,{count:P.length,defaultOpen:!1,title:"Font Families",children:e("div",{class:"p-3 space-y-2",children:P.map(([t,c])=>s("div",{class:"space-y-0.5",children:[e("code",{class:"text-[0.68rem] font-mono text-foreground",children:t.slice(7)}),e("p",{class:"text-[0.75rem] text-foreground/70 truncate",style:{fontFamily:c.startsWith("--theme(")?"inherit":c},children:"The quick brown fox"}),e("code",{class:"block text-[0.58rem] font-mono text-muted-foreground/50 truncate",children:c})]},t))})}),M.length>0&&e(x,{count:M.length,defaultOpen:!1,title:"Font Sizes",children:e("div",{class:"p-3 space-y-1.5",children:M.map(([t,c])=>{const k=Math.min(g(c)||14,48);return s("div",{class:"flex items-center gap-3",children:[e("span",{class:"text-[0.6rem] font-mono text-muted-foreground/60 w-12 shrink-0 text-right",children:t.slice(7)}),e("span",{class:"text-foreground leading-none truncate flex-1",style:{fontSize:`${k}px`},children:"Ag"}),e("code",{class:"text-[0.62rem] font-mono text-muted-foreground/60 shrink-0",children:c})]},t)})})}),D.length>0&&e(x,{count:D.length,defaultOpen:!1,title:"Border Radius",children:e("div",{class:"p-3 flex flex-wrap gap-3",children:D.map(([t,c])=>s("div",{class:"flex flex-col items-center gap-1.5",children:[e("div",{class:"size-10 border-2 border-primary/40 bg-primary/8",style:{borderRadius:c.startsWith("--theme(")?"4px":c}}),e("code",{class:"text-[0.6rem] font-mono text-muted-foreground/70",children:t.slice(9)}),e("code",{class:"text-[0.58rem] font-mono text-muted-foreground/50",children:c})]},t))})}),A.length>0&&e(x,{count:A.length,defaultOpen:!1,title:"Shadows",children:e("div",{class:"p-3 space-y-3",children:A.map(([t,c])=>s("div",{class:"space-y-1",children:[e("code",{class:"text-[0.68rem] font-mono text-foreground",children:t.slice(2)}),!c.startsWith("--theme(")&&e("div",{class:"h-8 bg-card border border-border/40",style:{boxShadow:c}}),e("code",{class:"block text-[0.58rem] font-mono text-muted-foreground/50 truncate",children:c})]},t))})}),B.length>0&&e(x,{count:B.length,defaultOpen:!1,title:"Blur",children:e("div",{class:"py-1",children:B.map(([t,c])=>e(z,{cssVar:t,isCustom:t in u,value:c},t))})}),E.length>0&&e(x,{count:E.length,defaultOpen:!1,title:"Animations",children:e("div",{class:"py-1",children:E.map(([t,c])=>e(z,{cssVar:t,isCustom:t in u,value:c},t))})}),L.length>0&&e(x,{count:L.length,defaultOpen:!1,title:"Other",children:e("div",{class:"py-1",children:L.map(([t,c])=>e(z,{cssVar:t,isCustom:t in u,value:c},t))})})]})},"ConfigTab"),ge=p(()=>s("div",{class:"flex flex-col items-center justify-center h-full gap-4 py-16 px-8 text-center select-none",children:[e("div",{class:"size-12 border border-primary/20 bg-primary/5 flex items-center justify-center text-primary/30 text-2xl",children:"◻"}),s("div",{class:"space-y-1.5",children:[e("p",{class:"text-[0.8rem] font-medium text-foreground/70",children:"No design tokens detected"}),s("p",{class:"text-[0.7rem] text-muted-foreground leading-relaxed max-w-[240px]",children:["This app reads CSS custom properties from your page's ",e("code",{class:"font-mono text-[0.65rem]",children:":root"})," selector. Make sure your app uses Tailwind CSS v4 or defines custom properties."]})]})]}),"EmptyState"),be=p(({helpers:r})=>{const[n,o]=b(C("colors"),"tab"),[l,a]=b(C(void 0),"configData"),[m,h]=b(C(!1),"configLoading"),[u,v]=b(C(void 0),"configError"),d=b(G(void 0),"tokensRef");if(!d.current){const f=le();d.current=ce(f)}const i=d.current,j=p(()=>{h(!0),v(void 0),r.rpc.getTailwindConfig().then(f=>(a(f),h(!1),f)).catch(f=>{v(f.message??"Failed to load Tailwind config"),h(!1)})},"loadConfig");Z(()=>{n==="config"&&!l&&!m&&!u&&j()},[n]);const w=i.colors.length+i.spacing.length+i.fontSizes.length+i.radii.length,R={colors:i.colors.length,config:l?Object.keys(l.defaultTheme).length+Object.keys(l.customTheme).length:0,effects:i.radii.length+i.shadows.length,spacing:i.spacing.length,type:i.fontSizes.length+i.fontFamilies.length},y=[{id:"colors",label:"Colors"},{id:"spacing",label:"Spacing"},{id:"type",label:"Type"},{id:"effects",label:"Effects"},{id:"config",label:"Config"}];return s("div",{class:"flex flex-col h-full",children:[s("div",{class:"flex items-center justify-between gap-3 px-4 py-3 border-b border-border shrink-0",children:[e("span",{class:"text-[0.75rem] font-medium text-foreground",children:"Design Tokens"}),w>0&&s("span",{class:"text-[0.65rem] font-mono text-muted-foreground/60 bg-foreground/5 px-2 py-0.5 border border-border/40",children:[w," page tokens"]})]}),w===0&&n!=="config"?e(ge,{}):s(ee,{children:[e("div",{class:"flex border-b border-border shrink-0 overflow-x-auto",children:y.map(({id:f,label:V})=>s("button",{class:S("flex-shrink-0 px-3 py-2 text-[0.68rem] font-medium transition-colors cursor-pointer border-0 border-b-2 -mb-px",n===f?"text-primary border-primary bg-primary/4":"text-muted-foreground hover:text-foreground border-transparent bg-transparent"),onClick:p(()=>o(f),"onClick"),type:"button",children:[V,R[f]>0&&e("span",{class:S("ml-1.5 text-[0.58rem] font-mono",n===f?"text-primary/70":"text-muted-foreground/50"),children:R[f]})]},f))}),s("div",{class:"flex-1 overflow-auto devtools-content-scroll",children:[n==="colors"&&e(pe,{colors:i.colors}),n==="spacing"&&e(me,{spacing:i.spacing}),n==="type"&&e(ue,{fontFamilies:i.fontFamilies,fontSizes:i.fontSizes}),n==="effects"&&e(fe,{radii:i.radii,shadows:i.shadows}),n==="config"&&e(xe,{configData:l,error:u,loading:m,onRetry:j})]})]})]})},"TailwindApp"),ye=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 54 33">
6
6
  <path fill-rule="evenodd" clip-rule="evenodd" d="M27 0c-7.2 0-11.7 3.6-13.5 10.8 2.7-3.6 5.85-4.95 9.45-4.05 2.054.513 3.522 2.004 5.147 3.653C30.744 13.09 33.808 16.2 40.5 16.2c7.2 0 11.7-3.6 13.5-10.8-2.7 3.6-5.85 4.95-9.45 4.05-2.054-.513-3.522-2.004-5.147-3.653C36.756 3.11 33.692 0 27 0zM13.5 16.2C6.3 16.2 1.8 19.8 0 27c2.7-3.6 5.85-4.95 9.45-4.05 2.054.514 3.522 2.004 5.147 3.653C17.244 29.29 20.308 32.4 27 32.4c7.2 0 11.7-3.6 13.5-10.8-2.7 3.6-5.85 4.95-9.45 4.05-2.054-.513-3.522-2.004-5.147-3.653C23.256 19.31 20.192 16.2 13.5 16.2z" fill="#06B6D4"/>
7
- </svg>`,be={component:pe,icon:ue,id:"dev-toolbar:tailwind",name:"Design Tokens"};export{be as default};
7
+ </svg>`,Ve={component:be,icon:ye,id:"dev-toolbar:tailwind",name:"Design Tokens"};export{Ve as default};
@@ -1,18 +1 @@
1
- var U=Object.defineProperty;var b=(e,t)=>U(e,"name",{value:t,configurable:!0});import{g as k,D as L}from"../../packem_shared/store-BxE0w51s.js";import{addHookName as g}from"preact/devtools";import{useState as x,useRef as z,useEffect as I}from"preact/hooks";import C from"../../packem_shared/cn-DWLJYh3h.js";import{jsx as n,jsxs as l}from"preact/jsx-runtime";import A from"../../packem_shared/Badge-C30mDKKG.js";import D from"../../packem_shared/Button-DODNCTPZ.js";var N=Object.defineProperty,y=b((e,t)=>N(e,"name",{value:t,configurable:!0}),"d");const j="__visulima_timeline_capture__",f=y(e=>`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`,"generateId"),O=y(e=>e.startsWith("/@")||e.includes("/__vite")||e.includes("__visulima-dev-toolbar")||e.startsWith("data:")||e.startsWith("blob:"),"isViteInternalUrl"),P=y(()=>{if(globalThis[j])return;globalThis[j]=!0;const e=k();if(import.meta.hot&&(import.meta.hot.on("vite:beforeUpdate",t=>{const o=t,i=o.updates?.map(h=>h.path).join(", ")??"";e.addEvent("hmr",{data:{updates:o.updates},id:f("hmr"),level:"info",subtitle:i||void 0,time:Date.now(),title:"HMR Update"})}),import.meta.hot.on("vite:beforeFullReload",t=>{const o=t;e.addEvent("hmr",{id:f("hmr-reload"),level:"warning",subtitle:o.path??void 0,time:Date.now(),title:"Full Reload"})}),import.meta.hot.on("vite:error",t=>{const o=t,{err:i}=o;e.addEvent("errors",{data:i?{loc:i.loc,message:i.message,plugin:i.plugin,stack:i.stack}:void 0,id:f("vite-err"),level:"error",subtitle:i?.message??"Unknown error",time:Date.now(),title:"Vite Error"})})),globalThis.window!==void 0&&typeof globalThis.fetch=="function"){const t=globalThis.fetch.bind(globalThis);globalThis.fetch=async(...o)=>{const i=o[0],h=o[1],s=typeof i=="string"?i:i instanceof URL?i.href:i.url,d=(h?.method??(i instanceof Request?i.method:"GET")).toUpperCase();if(O(s))return t(...o);const u=Date.now();try{const a=await t(...o),p=Date.now()-u;return e.addEvent("network",{data:{method:d,status:a.status,statusText:a.statusText,url:s},duration:p,id:f("net"),level:a.ok?"info":"warning",subtitle:`${a.status} ${a.statusText}`,time:u,title:`${d} ${s}`}),a}catch(a){const p=Date.now()-u,v=a instanceof Error?a.message:"Network error";throw e.addEvent("network",{data:{error:v,method:d,url:s},duration:p,id:f("net-err"),level:"error",subtitle:v,time:u,title:`${d} ${s}`}),a}}}globalThis.window!==void 0&&(globalThis.addEventListener("error",t=>{t.filename?.includes("visulima-dev-toolbar")||e.addEvent("errors",{data:{colno:t.colno,filename:t.filename,lineno:t.lineno,message:t.message},id:f("err"),level:"error",subtitle:t.filename?`${t.filename}:${t.lineno}:${t.colno}`:void 0,time:Date.now(),title:t.message||"JavaScript Error"})}),globalThis.addEventListener("unhandledrejection",t=>{const{reason:o}=t,i=o instanceof Error?o.message:String(o??"Unhandled promise rejection");e.addEvent("errors",{data:{reason:String(o)},id:f("rej"),level:"error",subtitle:i,time:Date.now(),title:"Unhandled Promise Rejection"})}))},"startTimelineCapture"),B=`<!-- @license lucide-static v0.576.0 - ISC -->
2
- <svg
3
- class="lucide lucide-gantt-chart"
4
- xmlns="http://www.w3.org/2000/svg"
5
- width="24"
6
- height="24"
7
- viewBox="0 0 24 24"
8
- fill="none"
9
- stroke="currentColor"
10
- stroke-width="2"
11
- stroke-linecap="round"
12
- stroke-linejoin="round"
13
- >
14
- <path d="M6 5h12" />
15
- <path d="M4 12h10" />
16
- <path d="M12 19h8" />
17
- </svg>
18
- `;var F=Object.defineProperty,c=b((e,t)=>F(e,"name",{value:t,configurable:!0}),"o");const G=500,w="all",S=c(e=>new Date(e).toLocaleTimeString("en-US",{fractionalSecondDigits:3,hour:"2-digit",hour12:!1,minute:"2-digit",second:"2-digit"}),"formatTime"),H={error:"destructive",info:"info",warning:"warning"},$=c(({level:e})=>e?n(A,{class:"text-[0.6rem] uppercase tracking-wider",variant:H[e]??"info",children:e}):null,"LevelBadge"),W=c(({event:e,onClose:t})=>l("div",{class:"border-l border-border bg-background h-full flex flex-col min-w-0 w-80 shrink-0",children:[l("div",{class:"flex items-center justify-between gap-2 px-4 py-3 border-b border-border shrink-0",children:[n("span",{class:"text-[0.75rem] font-semibold text-foreground truncate",children:e.title}),n(D,{"aria-label":"Close detail",class:"h-5 w-5 shrink-0",onClick:t,size:"icon",variant:"ghost",children:"✕"})]}),l("div",{class:"flex-1 overflow-auto p-4 space-y-3",children:[l("div",{class:"space-y-1",children:[n("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Time"}),n("div",{class:"text-[0.8rem] font-mono text-foreground",children:S(e.time)})]}),e.subtitle&&l("div",{class:"space-y-1",children:[n("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Subtitle"}),n("div",{class:"text-[0.8rem] text-foreground",children:e.subtitle})]}),e.duration!==void 0&&l("div",{class:"space-y-1",children:[n("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Duration"}),l("div",{class:"text-[0.8rem] font-mono text-foreground",children:[e.duration,"ms"]})]}),e.level&&l("div",{class:"space-y-1",children:[n("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Level"}),n($,{level:e.level})]}),e.data&&Object.keys(e.data).length>0&&l("div",{class:"space-y-1",children:[n("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Data"}),n("pre",{class:"text-[0.7rem] font-mono text-foreground/80 bg-foreground/4 p-3 overflow-auto border border-border/50 whitespace-pre-wrap break-all",children:JSON.stringify(e.data,null,2)})]})]})]}),"EventDetail"),q=c(e=>{const[t,o]=g(x(w),"activeTab"),[i,h]=g(x([]),"groups"),[s,d]=g(x(null),"selectedEvent"),u=g(z(null),"intervalRef"),a=c(()=>{const r=k();h(r.getGroups().map(m=>({...m,events:[...m.events]})))},"refresh");I(()=>(a(),u.current=setInterval(a,G),()=>{u.current!==null&&clearInterval(u.current)}),[]);const p=new Map(L.map(r=>[r.id,r.color])),v=[{color:void 0,id:w,label:"All"},...i.map(r=>({color:p.get(r.id)??r.color,id:r.id,label:r.label}))],T=t===w?i.flatMap(r=>r.events).sort((r,m)=>r.time-m.time):i.find(r=>r.id===t)?.events??[],M=c(()=>{k().clearAll(),d(null),a()},"clearAll");return l("div",{class:"flex flex-col h-full",children:[l("div",{class:"flex items-center justify-between gap-2 px-4 py-2 border-b border-border shrink-0",children:[n("div",{class:"flex items-center gap-0 overflow-x-auto",children:v.map(r=>l("button",{class:C("px-3 py-1.5 text-[0.75rem] font-medium whitespace-nowrap border-0 cursor-pointer transition-colors duration-150",t===r.id?"text-foreground border-b-2 border-primary bg-transparent":"text-muted-foreground bg-transparent hover:text-foreground"),onClick:c(()=>{o(r.id),d(null)},"onClick"),type:"button",children:[r.color&&n("span",{class:"inline-block size-2 rounded-full mr-1.5 align-middle",style:{backgroundColor:r.color}}),r.label]},r.id))}),n(D,{onClick:M,size:"sm",title:"Clear all events",variant:"outline",children:"Clear"})]}),l("div",{class:"flex flex-1 min-h-0 overflow-hidden",children:[n("div",{class:"flex-1 overflow-auto",children:T.length===0?l("div",{class:"flex flex-col items-center justify-center h-full gap-4 p-8 text-center select-none",children:[n("div",{class:"size-12 border border-border/50 bg-foreground/2 flex items-center justify-center",children:n("svg",{"aria-hidden":"true",class:"size-5 text-muted-foreground/40",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",children:n("path",{d:"M12 6v6h4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z","stroke-linecap":"round","stroke-linejoin":"round"})})}),l("div",{class:"space-y-1",children:[n("p",{class:"text-[0.8rem] font-medium text-foreground/60",children:"No events recorded yet"}),n("p",{class:"text-[0.7rem] text-muted-foreground",children:"Events appear here as your app runs"}),n("p",{class:"text-[0.65rem] text-muted-foreground/50 mt-2 max-w-[240px] leading-relaxed",children:"HMR updates, network requests, and custom events are captured automatically"})]})]}):n("div",{class:"divide-y divide-border/50",children:T.map(r=>{const m=i.find(_=>_.events.some(R=>R.id===r.id)),E=p.get(m?.id??"")??m?.color;return l("button",{class:C("w-full flex items-start gap-3 px-4 py-3 text-left border-0 bg-transparent cursor-pointer","hover:bg-foreground/4 transition-colors duration-100",s?.id===r.id&&"bg-primary/6"),onClick:c(()=>d(s?.id===r.id?null:r),"onClick"),type:"button",children:[E&&n("span",{class:"mt-1 size-1.5 rounded-full shrink-0",style:{backgroundColor:E}}),l("div",{class:"flex-1 min-w-0",children:[l("div",{class:"flex items-center gap-2 flex-wrap",children:[n("span",{class:"text-[0.8rem] font-medium text-foreground truncate",children:r.title}),n($,{level:r.level})]}),r.subtitle&&n("div",{class:"text-[0.725rem] text-muted-foreground truncate mt-0.5",children:r.subtitle})]}),n("span",{class:"text-[0.65rem] font-mono text-muted-foreground/70 shrink-0 mt-0.5",children:S(r.time)})]},r.id)})})}),s&&n(W,{event:s,onClose:c(()=>d(null),"onClose")})]})]})},"TimelineApp");P();const te={component:q,icon:B,id:"dev-toolbar:timeline",name:"Timeline"};export{te as default};
1
+ var M=Object.defineProperty;var x=(e,t)=>M(e,"name",{value:t,configurable:!0});import L from"lucide-static/icons/gantt-chart.svg?raw";import{m as y,D as z}from"../../packem_shared/store-DaUtLjf3.js";import{addHookName as b}from"preact/devtools";import{useState as w,useRef as A,useEffect as I}from"preact/hooks";import C from"../../packem_shared/cn-DWLJYh3h.js";import{jsx as i,jsxs as l}from"preact/jsx-runtime";import N from"../../packem_shared/Badge-C30mDKKG.js";import $ from"../../packem_shared/Button-DODNCTPZ.js";var O=Object.defineProperty,T=x((e,t)=>O(e,"name",{value:t,configurable:!0}),"d");const D="__visulima_timeline_capture__",f=T(e=>`${e}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,7)}`,"generateId"),P=T(e=>e.startsWith("/@")||e.includes("/__vite")||e.includes("__visulima-dev-toolbar")||e.startsWith("data:")||e.startsWith("blob:"),"isViteInternalUrl"),F=T(()=>{if(globalThis[D])return;globalThis[D]=!0;const e=y();if(import.meta.hot&&(import.meta.hot.on("vite:beforeUpdate",t=>{const n=t,o=n.updates?.map(p=>p.path).join(", ")??"";e.addEvent("hmr",{data:{updates:n.updates},id:f("hmr"),level:"info",subtitle:o||void 0,time:Date.now(),title:"HMR Update"})}),import.meta.hot.on("vite:beforeFullReload",t=>{const n=t;e.addEvent("hmr",{id:f("hmr-reload"),level:"warning",subtitle:n.path??void 0,time:Date.now(),title:"Full Reload"})}),import.meta.hot.on("vite:error",t=>{const n=t,{err:o}=n;e.addEvent("errors",{data:o?{loc:o.loc,message:o.message,plugin:o.plugin,stack:o.stack}:void 0,id:f("vite-err"),level:"error",subtitle:o?.message??"Unknown error",time:Date.now(),title:"Vite Error"})})),globalThis.window!==void 0&&typeof globalThis.fetch=="function"){const t=globalThis.fetch.bind(globalThis);globalThis.fetch=async(...n)=>{const o=n[0],p=n[1],v=o instanceof URL?o.href:o.url,s=typeof o=="string"?o:v,c=(p?.method??(o instanceof Request?o.method:"GET")).toUpperCase();if(P(s))return t(...n);const u=Date.now();try{const a=await t(...n),h=Date.now()-u;return e.addEvent("network",{data:{method:c,status:a.status,statusText:a.statusText,url:s},duration:h,id:f("net"),level:a.ok?"info":"warning",subtitle:`${a.status} ${a.statusText}`,time:u,title:`${c} ${s}`}),a}catch(a){const h=Date.now()-u,g=a instanceof Error?a.message:"Network error";throw e.addEvent("network",{data:{error:g,method:c,url:s},duration:h,id:f("net-err"),level:"error",subtitle:g,time:u,title:`${c} ${s}`}),a}}}globalThis.window!==void 0&&(globalThis.addEventListener("error",t=>{t.filename?.includes("visulima-dev-toolbar")||e.addEvent("errors",{data:{colno:t.colno,filename:t.filename,lineno:t.lineno,message:t.message},id:f("err"),level:"error",subtitle:t.filename?`${t.filename}:${t.lineno}:${t.colno}`:void 0,time:Date.now(),title:t.message||"JavaScript Error"})}),globalThis.addEventListener("unhandledrejection",t=>{const{reason:n}=t,o=n instanceof Error?n.message:String(n??"Unhandled promise rejection");e.addEvent("errors",{data:{reason:String(n)},id:f("rej"),level:"error",subtitle:o,time:Date.now(),title:"Unhandled Promise Rejection"})}))},"startTimelineCapture");var G=Object.defineProperty,d=x((e,t)=>G(e,"name",{value:t,configurable:!0}),"i");const H=500,k="all",j=d(e=>new Date(e).toLocaleTimeString("en-US",{fractionalSecondDigits:3,hour:"2-digit",hour12:!1,minute:"2-digit",second:"2-digit"}),"formatTime"),W={error:"destructive",info:"info",warning:"warning"},S=d(({level:e})=>{if(e)return i(N,{class:"text-[0.6rem] uppercase tracking-wider",variant:W[e]??"info",children:e})},"LevelBadge"),q=d(({event:e,onClose:t})=>l("div",{class:"border-l border-border bg-background h-full flex flex-col min-w-0 w-80 shrink-0",children:[l("div",{class:"flex items-center justify-between gap-2 px-4 py-3 border-b border-border shrink-0",children:[i("span",{class:"text-[0.75rem] font-semibold text-foreground truncate",children:e.title}),i($,{"aria-label":"Close detail",class:"h-5 w-5 shrink-0",onClick:t,size:"icon",variant:"ghost",children:"✕"})]}),l("div",{class:"flex-1 overflow-auto p-4 space-y-3",children:[l("div",{class:"space-y-1",children:[i("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Time"}),i("div",{class:"text-[0.8rem] font-mono text-foreground",children:j(e.time)})]}),e.subtitle&&l("div",{class:"space-y-1",children:[i("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Subtitle"}),i("div",{class:"text-[0.8rem] text-foreground",children:e.subtitle})]}),e.duration!==void 0&&l("div",{class:"space-y-1",children:[i("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Duration"}),l("div",{class:"text-[0.8rem] font-mono text-foreground",children:[e.duration,"ms"]})]}),e.level&&l("div",{class:"space-y-1",children:[i("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Level"}),i(S,{level:e.level})]}),e.data&&Object.keys(e.data).length>0&&l("div",{class:"space-y-1",children:[i("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Data"}),i("pre",{class:"text-[0.7rem] font-mono text-foreground/80 bg-foreground/4 p-3 overflow-auto border border-border/50 whitespace-pre-wrap break-all",children:JSON.stringify(e.data,void 0,2)})]})]})]}),"EventDetail"),B=d(e=>{const[t,n]=b(w(k),"activeTab"),[o,p]=b(w([]),"groups"),[v,s]=b(w(void 0),"selectedEvent"),c=b(A(void 0),"intervalRef"),u=d(()=>{const r=y();p(r.getGroups().map(m=>({...m,events:[...m.events]})))},"refresh");I(()=>(u(),c.current=setInterval(u,H),()=>{c.current!==void 0&&clearInterval(c.current)}),[]);const a=new Map(z.map(r=>[r.id,r.color])),h=[{color:void 0,id:k,label:"All"},...o.map(r=>({color:a.get(r.id)??r.color,id:r.id,label:r.label}))],g=t===k?o.flatMap(r=>r.events).toSorted((r,m)=>r.time-m.time):o.find(r=>r.id===t)?.events??[],_=d(()=>{y().clearAll(),s(void 0),u()},"clearAll");return l("div",{class:"flex flex-col h-full",children:[l("div",{class:"flex items-center justify-between gap-2 px-4 py-2 border-b border-border shrink-0",children:[i("div",{class:"flex items-center gap-0 overflow-x-auto",children:h.map(r=>l("button",{class:C("px-3 py-1.5 text-[0.75rem] font-medium whitespace-nowrap border-0 cursor-pointer transition-colors duration-150",t===r.id?"text-foreground border-b-2 border-primary bg-transparent":"text-muted-foreground bg-transparent hover:text-foreground"),onClick:d(()=>{n(r.id),s(void 0)},"onClick"),type:"button",children:[r.color&&i("span",{class:"inline-block size-2 rounded-full mr-1.5 align-middle",style:{backgroundColor:r.color}}),r.label]},r.id))}),i($,{onClick:_,size:"sm",title:"Clear all events",variant:"outline",children:"Clear"})]}),l("div",{class:"flex flex-1 min-h-0 overflow-hidden",children:[i("div",{class:"flex-1 overflow-auto",children:g.length===0?l("div",{class:"flex flex-col items-center justify-center h-full gap-4 p-8 text-center select-none",children:[i("div",{class:"size-12 border border-border/50 bg-foreground/2 flex items-center justify-center",children:i("svg",{"aria-hidden":"true",class:"size-5 text-muted-foreground/40",fill:"none",stroke:"currentColor","stroke-width":"1.5",viewBox:"0 0 24 24",children:i("path",{d:"M12 6v6h4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z","stroke-linecap":"round","stroke-linejoin":"round"})})}),l("div",{class:"space-y-1",children:[i("p",{class:"text-[0.8rem] font-medium text-foreground/60",children:"No events recorded yet"}),i("p",{class:"text-[0.7rem] text-muted-foreground",children:"Events appear here as your app runs"}),i("p",{class:"text-[0.65rem] text-muted-foreground/50 mt-2 max-w-[240px] leading-relaxed",children:"HMR updates, network requests, and custom events are captured automatically"})]})]}):i("div",{class:"divide-y divide-border/50",children:g.map(r=>{const m=o.find(U=>U.events.some(R=>R.id===r.id)),E=a.get(m?.id??"")??m?.color;return l("button",{class:C("w-full flex items-start gap-3 px-4 py-3 text-left border-0 bg-transparent cursor-pointer","hover:bg-foreground/4 transition-colors duration-100",v?.id===r.id&&"bg-primary/6"),onClick:d(()=>s(v?.id===r.id?void 0:r),"onClick"),type:"button",children:[E&&i("span",{class:"mt-1 size-1.5 rounded-full shrink-0",style:{backgroundColor:E}}),l("div",{class:"flex-1 min-w-0",children:[l("div",{class:"flex items-center gap-2 flex-wrap",children:[i("span",{class:"text-[0.8rem] font-medium text-foreground truncate",children:r.title}),i(S,{level:r.level})]}),r.subtitle&&i("div",{class:"text-[0.725rem] text-muted-foreground truncate mt-0.5",children:r.subtitle})]}),i("span",{class:"text-[0.65rem] font-mono text-muted-foreground/70 shrink-0 mt-0.5",children:j(r.time)})]},r.id)})})}),v&&i(q,{event:v,onClose:d(()=>s(void 0),"onClose")})]})]})},"TimelineApp");F();const re={component:B,icon:L,id:"dev-toolbar:timeline",name:"Timeline"};export{re as default};
@@ -1,16 +1 @@
1
- var h=Object.defineProperty;var b=(t,e)=>h(t,"name",{value:e,configurable:!0});import{addHookName as d}from"preact/devtools";import{useState as c,useEffect as v}from"preact/hooks";import x from"../../packem_shared/cn-DWLJYh3h.js";import{jsx as r,jsxs as o}from"preact/jsx-runtime";import g from"../../packem_shared/Button-DODNCTPZ.js";import y from"../../packem_shared/Badge-C30mDKKG.js";const w=`<!-- @license lucide-static v0.576.0 - ISC -->
2
- <svg
3
- class="lucide lucide-zap"
4
- xmlns="http://www.w3.org/2000/svg"
5
- width="24"
6
- height="24"
7
- viewBox="0 0 24 24"
8
- fill="none"
9
- stroke="currentColor"
10
- stroke-width="2"
11
- stroke-linecap="round"
12
- stroke-linejoin="round"
13
- >
14
- <path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z" />
15
- </svg>
16
- `;var C=Object.defineProperty,a=b((t,e)=>C(t,"name",{value:e,configurable:!0}),"i");const k=a(({text:t})=>{const[e,i]=d(c(!1),"copied"),n=a(()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(i,1500,!1)}).catch(()=>{})},"copy");return r(g,{class:x(e?"border-primary/40 text-primary bg-primary/8":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30","text-[0.65rem]"),onClick:n,size:"sm",title:"Copy to clipboard",variant:"outline",children:e?"Copied!":"Copy"})},"CopyButton"),m=a(({data:t,defaultOpen:e=!0,title:i})=>{const[n,u]=d(c(e),"open"),p=JSON.stringify(t,null,2);return o("section",{class:"border border-border",children:[o("button",{class:"w-full flex items-center justify-between gap-2 px-4 py-3 bg-foreground/3 hover:bg-foreground/6 transition-colors cursor-pointer border-0 text-left",onClick:a(()=>u(s=>!s),"onClick"),type:"button",children:[r("span",{class:"text-[0.75rem] font-semibold text-foreground uppercase tracking-wide",children:i}),o("div",{class:"flex items-center gap-2",children:[r(k,{text:p}),r("span",{class:x("text-muted-foreground text-[0.7rem] transition-transform duration-200",n&&"rotate-90"),children:"▶"})]})]}),n&&r("pre",{class:"text-[0.7rem] font-mono text-foreground/80 bg-transparent p-4 overflow-auto whitespace-pre-wrap break-all border-t border-border",children:p})]})},"Section"),j=a(({helpers:t})=>{const[e,i]=d(c(null),"config"),[n,u]=d(c(null),"error"),[p,s]=d(c(!0),"loading"),f=a(()=>{s(!0),u(null),t.rpc.getViteConfig().then(l=>{i(l),s(!1)}).catch(l=>{u(l.message??"Failed to load Vite config"),s(!1)})},"load");return v(()=>{f()},[]),p?o("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[r("div",{"aria-hidden":"true",class:"flex gap-1.5 items-center",children:[0,160,320].map(l=>r("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${l}ms`}},l))}),r("span",{class:"text-[0.75rem] text-muted-foreground",children:"Loading Vite config…"})]}):n||!e?o("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 text-center",children:[r("p",{class:"text-[0.8rem] text-destructive",children:n??"No config available"}),r(g,{onClick:f,size:"sm",variant:"outline",children:"Retry"})]}):o("div",{class:"p-5 space-y-4",children:[o("div",{class:"flex items-center gap-2 flex-wrap",children:[e.mode&&r(y,{class:"uppercase tracking-wider",variant:"default",children:e.mode}),e.root&&r("code",{class:"text-[0.7rem] font-mono text-muted-foreground bg-foreground/5 px-2 py-1 border border-border/50",children:e.root}),e.base&&e.base!=="/"&&o("code",{class:"text-[0.7rem] font-mono text-muted-foreground bg-foreground/5 px-2 py-1 border border-border/50",children:["base: ",e.base]}),r(g,{class:"ml-auto",onClick:f,size:"sm",variant:"outline",children:"Refresh"})]}),e.server&&r(m,{data:e.server,defaultOpen:!0,title:"Server"}),e.build&&r(m,{data:e.build,defaultOpen:!1,title:"Build"}),e.resolve&&r(m,{data:e.resolve,defaultOpen:!1,title:"Resolve / Alias"})]})},"ViteConfigApp"),R={component:j,icon:w,id:"dev-toolbar:vite-config",name:"Vite Config"};export{R as default};
1
+ var h=Object.defineProperty;var b=(t,e)=>h(t,"name",{value:e,configurable:!0});import v from"lucide-static/icons/zap.svg?raw";import{addHookName as d}from"preact/devtools";import{useState as c,useEffect as y}from"preact/hooks";import x from"../../packem_shared/cn-DWLJYh3h.js";import{jsx as r,jsxs as o}from"preact/jsx-runtime";import g from"../../packem_shared/Button-DODNCTPZ.js";import C from"../../packem_shared/Badge-C30mDKKG.js";var k=Object.defineProperty,l=b((t,e)=>k(t,"name",{value:e,configurable:!0}),"i");const w=l(({text:t})=>{const[e,n]=d(c(!1),"copied"),i=l(()=>{navigator.clipboard.writeText(t).then(()=>{n(!0),setTimeout(n,1500,!1)}).catch(()=>{})},"copy");return r(g,{class:x(e?"border-primary/40 text-primary bg-primary/8":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30","text-[0.65rem]"),onClick:i,size:"sm",title:"Copy to clipboard",variant:"outline",children:e?"Copied!":"Copy"})},"CopyButton"),m=l(({data:t,defaultOpen:e=!0,title:n})=>{const[i,f]=d(c(e),"open"),p=JSON.stringify(t,void 0,2);return o("section",{class:"border border-border",children:[o("button",{class:"w-full flex items-center justify-between gap-2 px-4 py-3 bg-foreground/3 hover:bg-foreground/6 transition-colors cursor-pointer border-0 text-left",onClick:l(()=>f(s=>!s),"onClick"),type:"button",children:[r("span",{class:"text-[0.75rem] font-semibold text-foreground uppercase tracking-wide",children:n}),o("div",{class:"flex items-center gap-2",children:[r(w,{text:p}),r("span",{class:x("text-muted-foreground text-[0.7rem] transition-transform duration-200",i&&"rotate-90"),children:"▶"})]})]}),i&&r("pre",{class:"text-[0.7rem] font-mono text-foreground/80 bg-transparent p-4 overflow-auto whitespace-pre-wrap break-all border-t border-border",children:p})]})},"Section"),j=l(({helpers:t})=>{const[e,n]=d(c(void 0),"config"),[i,f]=d(c(void 0),"error"),[p,s]=d(c(!0),"loading"),u=l(()=>{s(!0),f(void 0),t.rpc.getViteConfig().then(a=>{n(a),s(!1)}).catch(a=>{f(a.message??"Failed to load Vite config"),s(!1)})},"load");return y(()=>{u()},[]),p?o("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[r("div",{"aria-hidden":"true",class:"flex gap-1.5 items-center",children:[0,160,320].map(a=>r("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${a}ms`}},a))}),r("span",{class:"text-[0.75rem] text-muted-foreground",children:"Loading Vite config…"})]}):i||!e?o("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 text-center",children:[r("p",{class:"text-[0.8rem] text-destructive",children:i??"No config available"}),r(g,{onClick:u,size:"sm",variant:"outline",children:"Retry"})]}):o("div",{class:"p-5 space-y-4",children:[o("div",{class:"flex items-center gap-2 flex-wrap",children:[e.mode&&r(C,{class:"uppercase tracking-wider",variant:"default",children:e.mode}),e.root&&r("code",{class:"text-[0.7rem] font-mono text-muted-foreground bg-foreground/5 px-2 py-1 border border-border/50",children:e.root}),e.base&&e.base!=="/"&&o("code",{class:"text-[0.7rem] font-mono text-muted-foreground bg-foreground/5 px-2 py-1 border border-border/50",children:["base: ",e.base]}),r(g,{class:"ml-auto",onClick:u,size:"sm",variant:"outline",children:"Refresh"})]}),e.server&&r(m,{data:e.server,defaultOpen:!0,title:"Server"}),e.build&&r(m,{data:e.build,defaultOpen:!1,title:"Build"}),e.resolve&&r(m,{data:e.resolve,defaultOpen:!1,title:"Resolve / Alias"})]})},"ViteConfigApp"),T={component:j,icon:v,id:"dev-toolbar:vite-config",name:"Vite Config"};export{T as default};
@@ -1 +1 @@
1
- var I=Object.defineProperty;var _=(e,t)=>I(e,"name",{value:t,configurable:!0});import r from"virtual:visulima-dev-toolbar-options";var f=Object.defineProperty,c=_((e,t)=>f(e,"name",{value:t,configurable:!0}),"r");globalThis.__VISULIMA_DEV_TOOLBAR_OPTIONS__=r;const A=c(()=>{if(!r.requireUrlFlag)return!0;const e=r.urlFlagName??"devtools";return new URLSearchParams(globalThis.window?.location.search).get(e)==="true"},"isUrlFlagPresent"),l=c(async()=>{if(globalThis.window===void 0||!A()||globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__)return;globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__=!0;let e=null;try{await import("virtual:visulima-dev-toolbar-path:toolbar/index.js");const{apps:t}=r,[o,i,a,n,u,p,s,d,m,g]=await Promise.all([t.settings?import("virtual:visulima-dev-toolbar-path:apps/settings/index.js"):null,t.timeline?import("virtual:visulima-dev-toolbar-path:apps/timeline/index.js"):null,t.viteConfig?import("virtual:visulima-dev-toolbar-path:apps/vite-config/index.js"):null,t.moduleGraph?import("virtual:visulima-dev-toolbar-path:apps/module-graph/index.js"):null,t.seo?import("virtual:visulima-dev-toolbar-path:apps/seo/index.js"):null,t.performance?import("virtual:visulima-dev-toolbar-path:apps/performance/index.js"):null,t.a11y?import("virtual:visulima-dev-toolbar-path:apps/a11y/index.js"):null,t.inspector?import("virtual:visulima-dev-toolbar-path:apps/inspector/index.js"):null,t.tailwind?import("virtual:visulima-dev-toolbar-path:apps/tailwind/index.js"):null,import("virtual:visulima-dev-toolbar-path:apps/more/index.js")]);e=document.createElement("dev-toolbar"),document.body.append(e),e.registerApp&&(i&&e.registerApp(i.default,!0),a&&e.registerApp(a.default,!0),n&&e.registerApp(n.default,!0),u&&e.registerApp(u.default,!0),p&&e.registerApp(p.default,!0),s&&e.registerApp(s.default,!0),d&&e.registerApp(d.default,!0),m&&e.registerApp(m.default,!0),o&&e.registerApp(o.default,!0),e.registerApp(g.default,!0)),e.init&&e.init(),console.log("[dev-toolbar] Initialized successfully")}catch(t){e?.isConnected&&e.remove(),globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__=!1,console.error("[dev-toolbar] Failed to initialize:",t)}},"initToolbar");typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",l):l());import.meta.hot&&import.meta.hot.on("dev-toolbar:init",()=>{const e=document.querySelector("dev-toolbar");e&&e.remove(),globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__=!1,l()});
1
+ var T=Object.defineProperty;var n=(o,t)=>T(o,"name",{value:t,configurable:!0});import i from"virtual:visulima-dev-toolbar-options";var f=Object.defineProperty,r=n((o,t)=>f(o,"name",{value:t,configurable:!0}),"t");globalThis.__VISULIMA_DEV_TOOLBAR_OPTIONS__=i;const A=r(()=>{if(!i.requireUrlFlag)return!0;const o=i.urlFlagName??"devtools";return new URLSearchParams(globalThis.window?.location.search).get(o)==="true"},"isUrlFlagPresent"),L=r(o=>Promise.all([o.settings?import("virtual:visulima-dev-toolbar-path:apps/settings/index.js"):void 0,o.timeline?import("virtual:visulima-dev-toolbar-path:apps/timeline/index.js"):void 0,o.viteConfig?import("virtual:visulima-dev-toolbar-path:apps/vite-config/index.js"):void 0,o.moduleGraph?import("virtual:visulima-dev-toolbar-path:apps/module-graph/index.js"):void 0,o.seo?import("virtual:visulima-dev-toolbar-path:apps/seo/index.js"):void 0,o.performance?import("virtual:visulima-dev-toolbar-path:apps/performance/index.js"):void 0,o.a11y?import("virtual:visulima-dev-toolbar-path:apps/a11y/index.js"):void 0,o.inspector?import("virtual:visulima-dev-toolbar-path:apps/inspector/index.js"):void 0,o.tailwind?import("virtual:visulima-dev-toolbar-path:apps/tailwind/index.js"):void 0,import("virtual:visulima-dev-toolbar-path:apps/more/index.js")]),"loadAppModules"),b=r((o,t)=>{const[e,d,s,p,c,m,_,u,I,v]=t;if(!o.registerApp)return;const g=[d,s,p,c,m,_,u,I];for(const l of g)l&&o.registerApp(l.default,!0);e&&o.registerApp(e.default,!0),o.registerApp(v.default,!0)},"registerApps"),a=r(async()=>{if(globalThis.window===void 0||!A()||globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__)return;globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__=!0;let o;try{await import("virtual:visulima-dev-toolbar-path:toolbar/index.js");const{apps:t}=i,e=await L(t);o=document.createElement("dev-toolbar"),document.body.append(o),b(o,e),o.init&&o.init(),console.log("[dev-toolbar] Initialized successfully")}catch(t){o?.isConnected&&o.remove(),globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__=!1,console.error("[dev-toolbar] Failed to initialize:",t)}},"initToolbar");typeof document<"u"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",a):a().catch(()=>{}));import.meta.hot&&import.meta.hot.on("dev-toolbar:init",()=>{const o=document.querySelector("dev-toolbar");o&&o.remove(),globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__=!1,a().catch(()=>{})});
@@ -2,9 +2,11 @@ import type { DevToolbarApp } from "../types/app.d.ts";
2
2
  import type { DevToolbarHook } from "../types/hooks.d.ts";
3
3
  import type { TimelineEvent } from "../types/timeline.d.ts";
4
4
  /**
5
- * Creates a dev toolbar hook instance
6
- * @param onRegisterApp Callback when app is registered
7
- * @param onTimelineEvent Callback when timeline event is added
8
- * @returns Hook instance
5
+ * Creates a dev toolbar hook instance.
6
+ * @param onRegisterApp Callback when app is registered.
7
+ * @param onTimelineEvent Callback when timeline event is added.
8
+ * @returns Hook instance.
9
9
  */
10
- export declare const createDevToolbarHook: (onRegisterApp?: (app: DevToolbarApp) => void, onTimelineEvent?: (groupId: string, event: TimelineEvent) => void) => DevToolbarHook;
10
+ declare const createDevToolbarHook: (onRegisterApp?: (app: DevToolbarApp) => void, onTimelineEvent?: (groupId: string, event: TimelineEvent) => void) => DevToolbarHook;
11
+ export { createDevToolbarHook };
12
+ export default createDevToolbarHook;
@@ -1,5 +1,7 @@
1
1
  import type { HookEvents } from "../types/hooks.d.ts";
2
2
  /**
3
- * Hook event names
3
+ * Hook event names.
4
4
  */
5
- export declare const HOOK_EVENT_NAMES: (keyof HookEvents)[];
5
+ declare const HOOK_EVENT_NAMES: (keyof HookEvents)[];
6
+ export { HOOK_EVENT_NAMES };
7
+ export default HOOK_EVENT_NAMES;
@@ -2,14 +2,14 @@ import type { DevToolbarApp } from "../types/app.d.ts";
2
2
  import type { DevToolbarHook } from "../types/hooks.d.ts";
3
3
  import type { TimelineEvent } from "../types/timeline.d.ts";
4
4
  /**
5
- * Setup global hook on window object
6
- * @param onRegisterApp Callback when app is registered
7
- * @param onTimelineEvent Callback when timeline event is added
8
- * @returns Hook instance
5
+ * Setup global hook on window object.
6
+ * @param onRegisterApp Callback when app is registered.
7
+ * @param onTimelineEvent Callback when timeline event is added.
8
+ * @returns Hook instance.
9
9
  */
10
10
  export declare const setupGlobalHook: (onRegisterApp?: (app: DevToolbarApp) => void, onTimelineEvent?: (groupId: string, event: TimelineEvent) => void) => DevToolbarHook;
11
11
  /**
12
- * Get the global hook instance
13
- * @returns Hook instance or undefined
12
+ * Get the global hook instance.
13
+ * @returns Hook instance or undefined.
14
14
  */
15
15
  export declare const getGlobalHook: () => DevToolbarHook | undefined;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
1
  export { createDevToolbarHook, getGlobalHook, setupGlobalHook } from "./hooks/index.d.ts";
2
2
  export { createClientRPCContext } from "./rpc/client.d.ts";
3
3
  export { createServerRPCContext } from "./rpc/server.d.ts";
4
- export { getTimelineStore, TimelineStore } from "./timeline/index.d.ts";
4
+ export type { TimelineStore } from "./timeline/index.d.ts";
5
+ export { getTimelineStore } from "./timeline/index.d.ts";
5
6
  export { DevToolbar } from "./toolbar/index.d.ts";
6
7
  export { loadSettings, saveSettings, updateSettings } from "./toolbar/settings.d.ts";
7
8
  export type * from "./types/index.d.ts";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{createClientRPCContext as t}from"./packem_shared/createClientRPCContext-DzKQpKTk.js";import{createServerRPCContext as a}from"./packem_shared/createServerRPCContext-CRd6VAWp.js";import{DevToolbar as m}from"./toolbar/index.js";import{loadSettings as x,saveSettings as i,updateSettings as n}from"./packem_shared/loadSettings-hvjR4fcS.js";import{T as s,g}from"./packem_shared/store-BxE0w51s.js";import{createDevToolbarHook as C}from"./packem_shared/createDevToolbarHook-DGNxqk8N.js";import{getGlobalHook as b,setupGlobalHook as v}from"./packem_shared/setupGlobalHook-CFuxsCyl.js";export{m as DevToolbar,s as TimelineStore,t as createClientRPCContext,C as createDevToolbarHook,a as createServerRPCContext,b as getGlobalHook,g as getTimelineStore,x as loadSettings,i as saveSettings,v as setupGlobalHook,n as updateSettings};
1
+ import{createClientRPCContext as t}from"./packem_shared/createClientRPCContext-DgRxrllw.js";import{createServerRPCContext as a}from"./packem_shared/createServerRPCContext-CEm1Ymkn.js";import{DevToolbar as m}from"./toolbar/index.js";import{loadSettings as x,saveSettings as f,updateSettings as n}from"./packem_shared/loadSettings-hvjR4fcS.js";import{createDevToolbarHook as s}from"./packem_shared/createDevToolbarHook-4bZZiHPI.js";import{getGlobalHook as C,setupGlobalHook as S}from"./packem_shared/setupGlobalHook-CCf9Logv.js";import{m as v}from"./packem_shared/store-DaUtLjf3.js";export{m as DevToolbar,t as createClientRPCContext,s as createDevToolbarHook,a as createServerRPCContext,C as getGlobalHook,v as getTimelineStore,x as loadSettings,f as saveSettings,S as setupGlobalHook,n as updateSettings};
@@ -1 +1 @@
1
- var X=Object.defineProperty;var f=(e,t)=>X(e,"name",{value:t,configurable:!0});import x from"@babel/generator";import{parse as S}from"@babel/parser";import E from"@babel/traverse";import*as g from"@babel/types";import{normalizePath as j}from"vite";var w=Object.defineProperty,y=f((e,t)=>w(e,"name",{value:t,configurable:!0}),"s");const A=y(e=>e.replaceAll(/[.+^${}()|[\]\\]/g,String.raw`\$&`),"escapeRegExp"),O=y(e=>{const t=e.split("**").map(o=>o.split("*").map(A).join("[^/]*")).join(".*");return new RegExp(t)},"globToRegex"),F=y((e,t)=>e.some(o=>o instanceof RegExp?o.test(t):O(o).test(t)),"matcher");var h=Object.defineProperty,m=f((e,t)=>h(e,"name",{value:t,configurable:!0}),"c");const v=E.default??E,P=x.default??x,b="data-vdt-source",l=m(e=>{let t=null;const o=m(a=>{const r=a[0];r&&(r.type==="Identifier"&&(t=r.name),r.type==="ObjectPattern"&&r.properties.forEach(i=>{i.type==="RestElement"&&i.argument.type==="Identifier"&&(t=i.argument.name)}))},"extractFromParams");return e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"||e.type==="FunctionDeclaration"?(o(e.params),t):(e.type==="VariableDeclarator"&&(e.init?.type==="ArrowFunctionExpression"||e.init?.type==="FunctionExpression")&&o(e.init.params),t)},"getPropsNameFromFunctionDeclaration"),d=m(e=>e.type==="JSXIdentifier"?e.name:e.type==="JSXMemberExpression"?`${d(e.object)}.${d(e.property)}`:`${e.namespace.name}:${e.name.name}`,"getNameOfElement"),R=m(e=>{const t=new Map,o=new Map;try{const a=S(e,{plugins:["jsx","typescript"],sourceType:"module"});v(a,{JSXOpeningElement(r){const i=d(r.node.name),s=o.get(i)??0;o.set(i,s+1),r.node.loc&&t.set(`${i}:${s}`,{col:r.node.loc.start.column,line:r.node.loc.start.line})}})}catch{}return t},"buildPositionMap"),M=m((e,t,o,a,r,i)=>{const{loc:s}=e.node;if(!s)return;const n=d(e.node.name);let p;if(r&&i){const c=i.get(n)??0;i.set(n,c+1),p=r.get(`${n}:${c}`)}if(n==="Fragment"||n==="React.Fragment"||n==="html"||n==="head"||n==="body"||F(a,n))return;const u=e.node.attributes.some(c=>c.type==="JSXAttribute"&&c.name.type==="JSXIdentifier"&&c.name.name===b);if(e.node.attributes.some(c=>c.type==="JSXSpreadAttribute"&&c.argument.type==="Identifier"&&c.argument.name===t)||u)return;const J=p?.line??s.start.line,$=p?.col??s.start.column;return e.node.attributes.push(g.jsxAttribute(g.jsxIdentifier(b),g.stringLiteral(`${o}:${J}:${$+1}`))),!0},"transformJSX"),T=m((e,t,o,a)=>{let r=!1;const i=a?new Map:void 0,s=m(n=>p=>{M(p,n,t,o,a,i)&&(r=!0)},"visitJSX");return v(e,{ArrowFunctionExpression(n){n.traverse({JSXOpeningElement:s(l(n.node))})},FunctionDeclaration(n){n.traverse({JSXOpeningElement:s(l(n.node))})},FunctionExpression(n){n.traverse({JSXOpeningElement:s(l(n.node))})},VariableDeclaration(n){const p=n.node.declarations.find(u=>u.init?.type==="ArrowFunctionExpression"||u.init?.type==="FunctionExpression");p&&n.traverse({JSXOpeningElement:s(l(p))})}}),r},"transform"),z=m((e,t,o={},a)=>{const[r]=t.split("?"),i=r.replace(`${j(process.cwd())}/`,"");if(!F(o.files??[],i))try{const s=S(e,{plugins:["jsx","typescript"],sourceType:"module"}),n=a&&a!==e?R(a):void 0;return T(s,i,o.components??[],n)?P(s,{filename:t,retainLines:!0,sourceFileName:r,sourceMaps:!0}):void 0}catch{return}},"addSourceToJsx");export{b as SOURCE_ATTR,z as addSourceToJsx};
1
+ var $=Object.defineProperty;var f=(e,t)=>$(e,"name",{value:t,configurable:!0});import x from"@babel/generator";import{parse as S}from"@babel/parser";import E from"@babel/traverse";import*as g from"@babel/types";import{normalizePath as j}from"vite";var w=Object.defineProperty,y=f((e,t)=>w(e,"name",{value:t,configurable:!0}),"r");const A=/[.+^${}()|[\]\\]/g,O=y(e=>e.replaceAll(A,String.raw`\$&`),"escapeRegExp"),h=y(e=>{const t=e.split("**").map(o=>o.split("*").map(a=>O(a)).join("[^/]*")).join(".*");return new RegExp(t)},"globToRegex"),F=y((e,t)=>e.some(o=>o instanceof RegExp?o.test(t):h(o).test(t)),"matcher");var P=Object.defineProperty,m=f((e,t)=>P(e,"name",{value:t,configurable:!0}),"c");const v=E.default??E,R=x.default??x,b="data-vdt-source",u=m(e=>{let t;const o=m(a=>{const r=a[0];r&&(r.type==="Identifier"&&(t=r.name),r.type==="ObjectPattern"&&r.properties.forEach(i=>{i.type==="RestElement"&&i.argument.type==="Identifier"&&(t=i.argument.name)}))},"extractFromParams");return e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"||e.type==="FunctionDeclaration"?(o(e.params),t):(e.type==="VariableDeclarator"&&(e.init?.type==="ArrowFunctionExpression"||e.init?.type==="FunctionExpression")&&o(e.init.params),t)},"getPropsNameFromFunctionDeclaration"),d=m(e=>e.type==="JSXIdentifier"?e.name:e.type==="JSXMemberExpression"?`${d(e.object)}.${d(e.property)}`:`${e.namespace.name}:${e.name.name}`,"getNameOfElement"),M=m(e=>{const t=new Map,o=new Map;try{const a=S(e,{plugins:["jsx","typescript"],sourceType:"module"});v(a,{JSXOpeningElement(r){const i=d(r.node.name),s=o.get(i)??0;o.set(i,s+1),r.node.loc&&t.set(`${i}:${s}`,{col:r.node.loc.start.column,line:r.node.loc.start.line})}})}catch{}return t},"buildPositionMap"),T=m((e,t,o,a,r,i)=>{const{loc:s}=e.node;if(!s)return!1;const n=d(e.node.name);let p;if(r&&i){const c=i.get(n)??0;i.set(n,c+1),p=r.get(`${n}:${c}`)}if(n==="Fragment"||n==="React.Fragment"||n==="html"||n==="head"||n==="body"||F(a,n))return!1;const l=e.node.attributes.some(c=>c.type==="JSXAttribute"&&c.name.type==="JSXIdentifier"&&c.name.name===b);if(e.node.attributes.some(c=>c.type==="JSXSpreadAttribute"&&c.argument.type==="Identifier"&&c.argument.name===t)||l)return!1;const J=p?.line??s.start.line,X=p?.col??s.start.column;return e.node.attributes.push(g.jsxAttribute(g.jsxIdentifier(b),g.stringLiteral(`${o}:${J}:${X+1}`))),!0},"transformJSX"),I=m((e,t,o,a)=>{let r=!1;const i=a?new Map:void 0,s=m(n=>p=>{T(p,n,t,o,a,i)&&(r=!0)},"visitJSX");return v(e,{ArrowFunctionExpression(n){n.traverse({JSXOpeningElement:s(u(n.node))})},FunctionDeclaration(n){n.traverse({JSXOpeningElement:s(u(n.node))})},FunctionExpression(n){n.traverse({JSXOpeningElement:s(u(n.node))})},VariableDeclaration(n){const p=n.node.declarations.find(l=>l.init?.type==="ArrowFunctionExpression"||l.init?.type==="FunctionExpression");p&&n.traverse({JSXOpeningElement:s(u(p))})}}),r},"transform"),C=m((e,t,o={},a)=>{const[r]=t.split("?"),i=r.replace(`${j(process.cwd())}/`,"");if(!F(o.files??[],i))try{const s=S(e,{plugins:["jsx","typescript"],sourceType:"module"}),n=a&&a!==e?M(a):void 0;return I(s,i,o.components??[],n)?R(s,{filename:t,retainLines:!0,sourceFileName:r,sourceMaps:!0}):void 0}catch{return}},"addSourceToJsx");export{b as SOURCE_ATTR,C as addSourceToJsx};
@@ -0,0 +1 @@
1
+ var R=Object.defineProperty;var P=(e,n)=>R(e,"name",{value:n,configurable:!0});import{addHookName as v}from"preact/devtools";import{computePosition as k,offset as E,flip as $,shift as L}from"@floating-ui/dom";import{createContext as T}from"preact";import{useState as b,useRef as y,useEffect as C,useContext as j}from"preact/hooks";import g from"./cn-DWLJYh3h.js";import{jsx as f}from"preact/jsx-runtime";var z=Object.defineProperty,r=P((e,n)=>z(e,"name",{value:n,configurable:!0}),"t");const O=T(void 0),h=r(()=>{const e=j(O);if(!e)throw new Error("Popover subcomponent must be used within <Popover>");return e},"usePopoverContext"),X=r(({children:e,defaultOpen:n,onOpenChange:i,open:o})=>{const s=o!==void 0,[u,t]=v(b(n??!1),"internalOpen"),a=s?o:u,c=v(y(null),"triggerRef"),p=r(d=>{s||t(d),i?.(d)},"setOpen");return f(O.Provider,{value:{open:a,setOpen:p,triggerRef:c},children:f("span",{style:{display:"contents"},children:e})})},"Popover"),q=r(({children:e,class:n,...i})=>{const{open:o,setOpen:s,triggerRef:u}=h(),t=r(a=>{u.current=a},"handleRef");return f("button",{"aria-expanded":o,class:g("",n),onClick:r(()=>{i.disabled||s(!o)},"onClick"),ref:t,type:"button",...i,children:e})},"PopoverTrigger"),A=r(({align:e="center",children:n,class:i,side:o="bottom",sideOffset:s=4,...u})=>{const{open:t,setOpen:a,triggerRef:c}=h(),p=v(y(null),"contentRef"),[d,w]=v(b({x:0,y:0}),"position");if(C(()=>{if(!t||!c.current||!p.current)return;const m=e==="center"?o:`${o}-${e}`;k(c.current,p.current,{middleware:[E(s),$(),L({padding:4})],placement:m}).then(l=>(w({x:l.x,y:l.y}),l)).catch(()=>{})},[t,o,s,e,c]),C(()=>{if(!t)return;const m=r(l=>{if(p.current&&!p.current.contains(l.target)){const x=c.current;if(x&&x.contains(l.target))return;a(!1)}},"handleMouseDown");return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[t,a,c]),!!t)return f("div",{class:g("z-50 w-72 rounded-none border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95",i),ref:p,role:"dialog",style:{left:`${d.x}px`,position:"fixed",top:`${d.y}px`},...u,children:n})},"PopoverContent"),F=r(({children:e,class:n,...i})=>{const{setOpen:o}=h();return f("button",{class:g("",n),onClick:r(()=>o(!1),"onClick"),type:"button",...i,children:e})},"PopoverClose");export{X as Popover,F as PopoverClose,A as PopoverContent,q as PopoverTrigger};
@@ -0,0 +1 @@
1
+ var p=Object.defineProperty;var b=(e,n)=>p(e,"name",{value:n,configurable:!0});import{addHookName as T}from"preact/devtools";import{createContext as x}from"preact";import{useState as C,useContext as k}from"preact/hooks";import u from"./cn-DWLJYh3h.js";import{jsx as a}from"preact/jsx-runtime";var V=Object.defineProperty,t=b((e,n)=>V(e,"name",{value:n,configurable:!0}),"s");const f=x(void 0),g=t(()=>{const e=k(f);if(!e)throw new Error("Tabs subcomponent must be used within <Tabs>");return e},"useTabsContext"),S=t(({children:e,class:n,defaultValue:i,onValueChange:s,value:r,...c})=>{const l=r!==void 0,[o,v]=T(C(i??""),"internalValue"),m=l?r:o,h=t(d=>{l||v(d),s?.(d)},"handleValueChange");return a(f.Provider,{value:{onValueChange:h,value:m},children:a("div",{class:u("",n),...c,children:e})})},"Tabs"),H=t(({children:e,class:n,...i})=>a("div",{class:u("inline-flex h-9 items-center justify-center rounded-none bg-muted p-1 text-muted-foreground",n),role:"tablist",...i,children:e}),"TabsList"),N=t(({children:e,class:n,disabled:i,value:s,...r})=>{const{onValueChange:c,value:l}=g(),o=l===s;return a("button",{"aria-selected":o,class:u("inline-flex items-center justify-center whitespace-nowrap rounded-none px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",o?"bg-background text-foreground shadow":"hover:bg-background/50",n),"data-state":o?"active":"inactive",disabled:i,onClick:t(()=>!i&&c(s),"onClick"),role:"tab",type:"button",...r,children:e})},"TabsTrigger"),O=t(({children:e,class:n,value:i,...s})=>{const{value:r}=g();if(r===i)return a("div",{class:u("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),role:"tabpanel",...s,children:e})},"TabsContent");export{S as Tabs,O as TabsContent,H as TabsList,N as TabsTrigger};
@@ -0,0 +1 @@
1
+ var T=Object.defineProperty;var d=(e,t)=>T(e,"name",{value:t,configurable:!0});import{addHookName as l}from"preact/devtools";import{computePosition as v,offset as R,flip as b,shift as C}from"@floating-ui/dom";import{createContext as w}from"preact";import{useState as m,useRef as g,useEffect as E,useContext as M}from"preact/hooks";import O from"./cn-DWLJYh3h.js";import{jsx as p}from"preact/jsx-runtime";var L=Object.defineProperty,r=d((e,t)=>L(e,"name",{value:t,configurable:!0}),"t");const x=w(void 0),h=r(()=>{const e=M(x);if(!e)throw new Error("Tooltip subcomponent must be used within <Tooltip>");return e},"useTooltipContext"),D=r(({children:e,delayDuration:t=0})=>{const[n,o]=l(m(!1),"open"),i=l(g(null),"triggerRef");return p(x.Provider,{value:{open:n,setOpen:o,triggerRef:i},children:p("span",{style:{display:"contents"},children:e})})},"Tooltip"),N=r(({children:e,class:t,...n})=>{const{setOpen:o,triggerRef:i}=h();return p("span",{class:t,onMouseEnter:r(()=>o(!0),"onMouseEnter"),onMouseLeave:r(()=>o(!1),"onMouseLeave"),ref:r(s=>{i.current=s},"handleRef"),...n,children:e})},"TooltipTrigger"),q=r(({children:e,class:t,side:n="top",sideOffset:o=4,...i})=>{const{open:s,triggerRef:a}=h(),c=l(g(null),"contentRef"),[u,y]=l(m({x:0,y:0}),"position");if(E(()=>{!s||!a.current||!c.current||v(a.current,c.current,{middleware:[R(o),b(),C({padding:4})],placement:n}).then(f=>(y({x:f.x,y:f.y}),f)).catch(()=>{})},[s,n,o,a]),!!s)return p("div",{class:O("z-50 rounded-none bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95",t),ref:c,role:"tooltip",style:{left:`${u.x}px`,position:"fixed",top:`${u.y}px`},...i,children:e})},"TooltipContent");export{D as Tooltip,q as TooltipContent,N as TooltipTrigger};
@@ -0,0 +1 @@
1
+ var s=Object.defineProperty;var c=(a,n)=>s(a,"name",{value:n,configurable:!0});var m=Object.defineProperty,d=c((a,n)=>m(a,"name",{value:n,configurable:!0}),"o");const p=d(a=>{const n={onConfigChange:d(()=>{},"onConfigChange"),onHMRUpdate:d(()=>{},"onHMRUpdate"),onModuleUpdate:d(()=>{},"onModuleUpdate"),...a},o=new Map;return globalThis.window!==void 0&&import.meta.hot&&(import.meta.hot.on("dev-toolbar:rpc:response",e=>{const t=o.get(e.id);t&&(o.delete(e.id),t.resolve(e.result))}),import.meta.hot.on("dev-toolbar:rpc:error",e=>{const t=o.get(e.id);t&&(o.delete(e.id),t.reject(new Error(e.error)))}),import.meta.hot.on("dev-toolbar:client",e=>{const{args:t,method:r}=e,i=n[r];if(i)try{i(...t)}catch(l){console.error(`[dev-toolbar] Error calling client function ${r}:`,l)}})),{async callServer(e,...t){if(globalThis.window===void 0||!import.meta.hot)throw new Error("RPC calls can only be made in browser environment with HMR");const r=`${Date.now()}-${Math.random().toString(36).slice(7)}`;return new Promise((i,l)=>{o.set(r,{reject:l,resolve:i}),setTimeout(()=>{o.has(r)&&(o.delete(r),l(new Error(`RPC call timeout: ${e}`)))},3e4),import.meta.hot.send("dev-toolbar:rpc",{args:t,id:r,method:e})})},registerFunction(e,t){n[e]=t}}},"createClientRPCContext");export{p as createClientRPCContext,p as default};
@@ -0,0 +1 @@
1
+ var d=Object.defineProperty;var l=(n,a)=>d(n,"name",{value:a,configurable:!0});var f=Object.defineProperty,s=l((n,a)=>f(n,"name",{value:a,configurable:!0}),"d");const g=s((n,a)=>{const r=new Map;return{addTimelineEvent(e,t){a&&a(e,t),this.emit("timeline:event",t)},emit(e,...t){const o=r.get(e);if(o)for(const i of o)try{i(...t)}catch(c){console.error(`[dev-toolbar] Error in hook handler for ${String(e)}:`,c)}},off(e,t){const o=r.get(e);o&&(t?(o.delete(t),o.size===0&&r.delete(e)):r.delete(e))},on(e,t){return r.has(e)||r.set(e,new Set),r.get(e).add(t),()=>{const o=r.get(e);o&&(o.delete(t),o.size===0&&r.delete(e))}},once(e,t){const o=s(((...i)=>{t(...i),this.off(e,o)}),"onceHandler");this.on(e,o)},registerApp(e){n&&n(e)}}},"createDevToolbarHook");export{g as createDevToolbarHook,g as default};
@@ -0,0 +1 @@
1
+ var j=Object.defineProperty;var u=(e,t)=>j(e,"name",{value:t,configurable:!0});import{createRequire as C}from"node:module";const T=C(import.meta.url),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,y=u(e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[t,r]=g.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return g.getBuiltinModule(e)}return T(e)},"__cjs_getBuiltinModule"),v=y("node:path"),p=y("node:fs/promises"),{createRequire:_}=y("node:module");var $=Object.defineProperty,F=u((e,t)=>$(e,"name",{value:t,configurable:!0}),"u$1");const x=F(async e=>{const{moduleGraph:t}=e,r=[];return t.idToModuleMap.forEach(n=>{const i=[];n.importers.forEach(o=>{const c=o.url??o.id;c&&i.push(c)});const s=n.id??n.url,a=n.url??n.id;!s||!a||r.push({id:s,importerCount:n.importers.size,importerUrls:i,url:a})}),r},"getModuleGraph");var O=Object.defineProperty,P=u((e,t)=>O(e,"name",{value:t,configurable:!0}),"n");const S=P(async(e,t,r,n,i)=>{const s=t.startsWith("/")?t:v.join(e.config.root,t),a=n===void 0?"":`:${n}`,o=r===void 0?"":`:${r}${a}`,c=`${s}${o}`,{default:l}=await import("launch-editor");l(c,i)},"openInEditor");var M=Object.defineProperty,m=u((e,t)=>M(e,"name",{value:t,configurable:!0}),"f$1");const k=/\/\*[\s\S]*?\*\//g,E=/\s+/g,w=/@theme\s+default[^{]*\{[\s\S]*?\}/g,h=/(--[\w-]+)\s*:\s*([\s\S]*?);/g,b=m(e=>{const t={},r=e.replaceAll(k,"");let n=0;for(;n<r.length;){const i=r.indexOf("@theme",n);if(i===-1)break;const s=r.indexOf("{",i);if(s===-1)break;let a=1,o=s+1;for(;o<r.length&&a>0;)r[o]==="{"?a+=1:r[o]==="}"&&(a-=1),o+=1;const c=r.slice(s+1,o-1);h.lastIndex=0;let l=h.exec(c);for(;l!==null;){const d=l[2].replaceAll(E," ").trim();d&&!t[l[1]]&&(t[l[1]]=d),l=h.exec(c)}n=o}return t},"parseThemeVariables"),R=m(async e=>{const t=[],r=m(async(n,i)=>{if(i>4)return;let s;try{s=await p.readdir(n,{encoding:"utf8",withFileTypes:!0})}catch{return}for(const a of s){const o=v.join(n,a.name);if(a.isDirectory()){if(a.name==="node_modules"||a.name===".git"||a.name==="dist")continue;await r(o,i+1)}else if(a.name.endsWith(".css"))try{const c=await p.readFile(o,"utf8");c.includes("@import")&&(c.includes('"tailwindcss"')||c.includes("'tailwindcss'"))&&t.push(o)}catch{}}},"walk");return await r(e,0),t},"findTailwindCSSFiles"),G=m(async e=>{const t={};for(const r of e)try{const n=await p.readFile(r,"utf8");w.lastIndex=0;const i=n.replaceAll(w,""),s=b(i);Object.assign(t,s)}catch{}return t},"extractUserTheme"),I=m(async e=>{const{root:t}=e.config;let r="unknown",n={};const i=["tailwind.config.js","tailwind.config.ts","tailwind.config.mjs","tailwind.config.cjs"];for(const o of i)try{await p.access(v.join(t,o)),r="v3";break}catch{}try{const o=_(import.meta.url).resolve("tailwindcss/theme.css"),c=await p.readFile(o,"utf8");n=b(c),Object.keys(n).length>0&&r!=="v3"&&(r="v4")}catch{}const s=await R(t),a=await G(s);return{cssFiles:s.map(o=>v.relative(t,o)),customTheme:a,defaultTheme:n,version:r}},"getTailwindConfig");var q=Object.defineProperty,D=u((e,t)=>q(e,"name",{value:t,configurable:!0}),"t");const V=D(async e=>({base:e.config.base,build:{outDir:e.config.build?.outDir},mode:e.config.mode,resolve:{alias:e.config.resolve.alias},root:e.config.root,server:{host:e.config.server?.host,https:e.config.server?.https,port:e.config.server?.port}}),"getViteConfig");var A=Object.defineProperty,f=u((e,t)=>A(e,"name",{value:t,configurable:!0}),"e");const U=f((e,t={})=>({getModuleGraph:f(async()=>x(e),"getModuleGraph"),getTailwindConfig:f(async()=>I(e),"getTailwindConfig"),getViteConfig:f(async()=>V(e),"getViteConfig"),openInEditor:f(async(r,n,i)=>S(e,r,n,i,t.editor),"openInEditor"),readFile:f(async r=>{const{readFile:n}=await import("node:fs/promises"),i=r.startsWith("/")?r:`${e.config.root}/${r}`;return n(i,"utf8")},"readFile")}),"createDefaultServerFunctions"),z=f((e,t,r={})=>{const n={...U(e,r),...t};return e.ws.on("dev-toolbar:rpc",async(i,s)=>{const{args:a,id:o,method:c}=i,l=n[c];if(!l){s.send("dev-toolbar:rpc:error",{error:`Unknown RPC method: ${c}`,id:o});return}try{const d=await l(...a);s.send("dev-toolbar:rpc:response",{id:o,result:d})}catch(d){s.send("dev-toolbar:rpc:error",{error:d instanceof Error?d.message:String(d),id:o})}}),{callClient(i,...s){e.ws.send({data:{args:s,method:i},event:"dev-toolbar:client",type:"custom"})},registerFunction(i,s){n[i]=s},server:e}},"createServerRPCContext");export{z as createServerRPCContext,z as default};
@@ -0,0 +1 @@
1
+ import{l as m,m as o}from"./store-DaUtLjf3.js";export{m as TimelineStore,o as getTimelineStore};
@@ -1 +1 @@
1
- var r=Object.defineProperty;var _=(o,l)=>r(o,"name",{value:l,configurable:!0});import{createDevToolbarHook as t}from"./createDevToolbarHook-DGNxqk8N.js";var O=Object.defineProperty,a=_((o,l)=>O(o,"name",{value:l,configurable:!0}),"n");let e;const n=a((o,l)=>e||(e=t(o,l),globalThis.window!==void 0&&(globalThis.__DEV_TOOLBAR_HOOK__=e),e),"setupGlobalHook"),s=a(()=>{const o=globalThis;return globalThis.window!==void 0&&o.__DEV_TOOLBAR_HOOK__?o.__DEV_TOOLBAR_HOOK__:e},"getGlobalHook");export{s as getGlobalHook,n as setupGlobalHook};
1
+ var r=Object.defineProperty;var _=(o,l)=>r(o,"name",{value:l,configurable:!0});import{createDevToolbarHook as t}from"./createDevToolbarHook-4bZZiHPI.js";var O=Object.defineProperty,a=_((o,l)=>O(o,"name",{value:l,configurable:!0}),"n");let e;const n=a((o,l)=>e||(e=t(o,l),globalThis.window!==void 0&&(globalThis.__DEV_TOOLBAR_HOOK__=e),e),"setupGlobalHook"),s=a(()=>{const o=globalThis;return globalThis.window!==void 0&&o.__DEV_TOOLBAR_HOOK__?o.__DEV_TOOLBAR_HOOK__:e},"getGlobalHook");export{s as getGlobalHook,n as setupGlobalHook};