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

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 (93) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/README.md +59 -42
  3. package/dist/apps/a11y/a11y-store.d.ts +1 -1
  4. package/dist/apps/a11y/a11y-tooltip.d.ts +1 -1
  5. package/dist/apps/a11y/index.js +3 -3
  6. package/dist/apps/inspector/index.d.ts +3 -0
  7. package/dist/apps/inspector/index.js +17 -0
  8. package/dist/apps/inspector/inspector-app.d.ts +12 -0
  9. package/dist/apps/module-graph/index.js +2 -2
  10. package/dist/apps/more/index.js +2 -2
  11. package/dist/apps/performance/index.js +2 -2
  12. package/dist/apps/seo/index.js +2 -2
  13. package/dist/apps/settings/index.js +2 -2
  14. package/dist/apps/settings/settings-app.d.ts +0 -1
  15. package/dist/apps/tailwind/index.d.ts +3 -0
  16. package/dist/apps/tailwind/index.js +7 -0
  17. package/dist/apps/tailwind/tailwind-app.d.ts +5 -0
  18. package/dist/apps/timeline/index.js +2 -2
  19. package/dist/apps/vite-config/index.js +2 -2
  20. package/dist/client/overlay.js +1 -1
  21. package/dist/index.d.ts +2 -1
  22. package/dist/index.js +1 -1
  23. package/dist/packem_chunks/inject-source.js +1 -0
  24. package/dist/packem_shared/Alert-H-x1JuZ0.js +1 -0
  25. package/dist/packem_shared/Badge-C30mDKKG.js +1 -0
  26. package/dist/packem_shared/Button-DODNCTPZ.js +1 -0
  27. package/dist/packem_shared/Card-DdI7Wn3t.js +1 -0
  28. package/dist/packem_shared/Icon-DWFLZkwW.js +1 -0
  29. package/dist/packem_shared/Input-GfbOwAkK.js +1 -0
  30. package/dist/packem_shared/Label-Bzi47aUf.js +1 -0
  31. package/dist/packem_shared/Popover-o3Vkvndp.js +1 -0
  32. package/dist/packem_shared/Progress-vGfFpxRn.js +1 -0
  33. package/dist/packem_shared/Separator-DQGeJPQg.js +1 -0
  34. package/dist/packem_shared/Skeleton-BYXau6jM.js +1 -0
  35. package/dist/packem_shared/Switch-BeC78S_T.js +1 -0
  36. package/dist/packem_shared/Tabs-BBc4S-2T.js +1 -0
  37. package/dist/packem_shared/Textarea-DvbSX13V.js +1 -0
  38. package/dist/packem_shared/Tooltip-BwK-2I9P.js +1 -0
  39. package/dist/packem_shared/cn-DWLJYh3h.js +1 -0
  40. package/dist/packem_shared/createServerRPCContext-CRd6VAWp.js +1 -0
  41. package/dist/packem_shared/sharedToolbarStylesheet-DHHoFz2-.js +2 -0
  42. package/dist/packem_shared/use-theme-CX1gG6Sv.js +1 -0
  43. package/dist/rpc/functions/module-graph.d.ts +2 -2
  44. package/dist/rpc/functions/open-in-editor.d.ts +8 -3
  45. package/dist/rpc/functions/tailwind-config.d.ts +12 -0
  46. package/dist/rpc/server.d.ts +4 -1
  47. package/dist/timeline/capture.d.ts +6 -0
  48. package/dist/timeline/index.d.ts +1 -0
  49. package/dist/toolbar/app-manager.d.ts +7 -0
  50. package/dist/toolbar/components/app-button.d.ts +2 -2
  51. package/dist/toolbar/components/app-canvas.d.ts +0 -1
  52. package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -1
  53. package/dist/toolbar/components/first-visit-hint.d.ts +3 -3
  54. package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -1
  55. package/dist/toolbar/components/toolbar-bar.d.ts +0 -1
  56. package/dist/toolbar/components/vite-overlay-button.d.ts +0 -1
  57. package/dist/toolbar/context/index.d.ts +1 -1
  58. package/dist/toolbar/context/toolbar-context.d.ts +35 -35
  59. package/dist/toolbar/global-api.d.ts +1 -0
  60. package/dist/toolbar/hooks/index.d.ts +4 -4
  61. package/dist/toolbar/hooks/use-frame-state.d.ts +6 -6
  62. package/dist/toolbar/hooks/use-position.d.ts +1 -1
  63. package/dist/toolbar/index.d.ts +1 -2
  64. package/dist/toolbar/index.js +3 -4
  65. package/dist/types/app.d.ts +26 -14
  66. package/dist/types/global-api.d.ts +8 -1
  67. package/dist/types/rpc.d.ts +5 -0
  68. package/dist/ui/components/alert.d.ts +20 -0
  69. package/dist/ui/components/badge.d.ts +10 -0
  70. package/dist/ui/components/button.d.ts +12 -0
  71. package/dist/ui/components/card.d.ts +17 -0
  72. package/dist/ui/components/icon.d.ts +3 -3
  73. package/dist/ui/components/input.d.ts +8 -0
  74. package/dist/ui/components/label.d.ts +8 -0
  75. package/dist/ui/components/popover.d.ts +27 -0
  76. package/dist/ui/components/progress.d.ts +8 -0
  77. package/dist/ui/components/separator.d.ts +9 -0
  78. package/dist/ui/components/skeleton.d.ts +7 -0
  79. package/dist/ui/components/switch.d.ts +12 -0
  80. package/dist/ui/components/tabs.d.ts +29 -0
  81. package/dist/ui/components/textarea.d.ts +8 -0
  82. package/dist/ui/components/tooltip.d.ts +19 -0
  83. package/dist/ui/index.d.ts +17 -0
  84. package/dist/ui/index.js +1 -0
  85. package/dist/vite/inject-source.d.ts +25 -0
  86. package/dist/vite/matcher.d.ts +5 -0
  87. package/dist/vite-plugin.d.ts +39 -1
  88. package/dist/vite-plugin.js +2 -2
  89. package/package.json +20 -3
  90. package/dist/packem_shared/cn-BEsR6GkP.js +0 -1
  91. package/dist/packem_shared/createServerRPCContext-BVSesPXu.js +0 -1
  92. package/dist/packem_shared/icon-BUQ92HaT.js +0 -1
  93. package/dist/rpc/index.d.ts +0 -8
@@ -1,4 +1,4 @@
1
- var y=Object.defineProperty;var u=(r,e)=>y(r,"name",{value:e,configurable:!0});import{addHookName as m}from"preact/devtools";import{useState as p,useEffect as f}from"preact/hooks";import{m as g}from"../../packem_shared/cn-BEsR6GkP.js";import{jsxs as a,jsx as t}from"preact/jsx-runtime";const v=`<!-- @license lucide-static v0.575.0 - ISC -->
1
+ var C=Object.defineProperty;var w=(i,t)=>C(i,"name",{value:t,configurable:!0});import{addHookName as u}from"preact/devtools";import{useState as h,useRef as S,useEffect as D}from"preact/hooks";import b from"../../packem_shared/cn-DWLJYh3h.js";import{jsxs as r,jsx as e,Fragment as I}from"preact/jsx-runtime";import k from"../../packem_shared/Button-DODNCTPZ.js";import T from"../../packem_shared/Badge-C30mDKKG.js";const j=`<!-- @license lucide-static v0.576.0 - ISC -->
2
2
  <svg
3
3
  class="lucide lucide-search"
4
4
  xmlns="http://www.w3.org/2000/svg"
@@ -14,4 +14,4 @@ var y=Object.defineProperty;var u=(r,e)=>y(r,"name",{value:e,configurable:!0});i
14
14
  <path d="m21 21-4.34-4.34" />
15
15
  <circle cx="11" cy="11" r="8" />
16
16
  </svg>
17
- `;var w=Object.defineProperty,s=u((r,e)=>w(r,"name",{value:e,configurable:!0}),"a");const x=s(()=>{const r=s(n=>document.querySelector(`meta[name="${n}"]`)?.content??"","getMeta"),e=s(n=>document.querySelector(`meta[property="og:${n}"]`)?.content??"","getOg"),l=s(n=>document.querySelector(`meta[name="twitter:${n}"]`)?.content??document.querySelector(`meta[property="twitter:${n}"]`)?.content??"","getTwitter");return{title:document.title??"",description:r("description"),canonical:document.querySelector('link[rel="canonical"]')?.href??"",ogTitle:e("title"),ogDescription:e("description"),ogImage:e("image"),ogUrl:e("url"),ogType:e("type"),twitterCard:l("card"),twitterTitle:l("title"),twitterDescription:l("description"),twitterImage:l("image"),twitterSite:l("site")}},"readMetaTags"),h=[{id:"facebook",name:"Facebook",accentClass:"border-blue-500/30",titleKey:"ogTitle",descKey:"ogDescription",imageKey:"ogImage",urlKey:"ogUrl",requiredKeys:["ogTitle","ogDescription","ogImage"]},{id:"twitter",name:"X / Twitter",accentClass:"border-foreground/20",titleKey:"twitterTitle",descKey:"twitterDescription",imageKey:"twitterImage",urlKey:"ogUrl",requiredKeys:["twitterTitle","twitterDescription","twitterImage","twitterCard"]},{id:"linkedin",name:"LinkedIn",accentClass:"border-blue-600/30",titleKey:"ogTitle",descKey:"ogDescription",imageKey:"ogImage",urlKey:"ogUrl",requiredKeys:["ogTitle","ogDescription","ogImage"]},{id:"discord",name:"Discord",accentClass:"border-indigo-500/30",titleKey:"ogTitle",descKey:"ogDescription",imageKey:"ogImage",urlKey:"ogUrl",requiredKeys:["ogTitle","ogDescription"]},{id:"slack",name:"Slack",accentClass:"border-green-500/30",titleKey:"ogTitle",descKey:"ogDescription",imageKey:"ogImage",urlKey:"ogUrl",requiredKeys:["ogTitle","ogDescription"]},{id:"mastodon",name:"Mastodon",accentClass:"border-purple-500/30",titleKey:"ogTitle",descKey:"ogDescription",imageKey:"ogImage",urlKey:"ogUrl",requiredKeys:["ogTitle","ogDescription"]},{id:"bluesky",name:"Bluesky",accentClass:"border-sky-500/30",titleKey:"ogTitle",descKey:"ogDescription",imageKey:"ogImage",urlKey:"ogUrl",requiredKeys:["ogTitle","ogDescription"]}],K=s(({platform:r,meta:e})=>{const l=e[r.titleKey]||e.title||"No title",n=e[r.descKey]||e.description||"",c=e[r.imageKey]||"",d=e[r.urlKey]||e.canonical||"",i=r.requiredKeys.filter(b=>!e[b]);return a("div",{class:g("border bg-card overflow-hidden",r.accentClass),children:[a("div",{class:"flex items-center justify-between gap-2 px-3 py-2 border-b border-border/50 bg-foreground/2",children:[t("span",{class:"text-[0.65rem] font-bold uppercase tracking-wider text-muted-foreground",children:r.name}),i.length>0&&a("span",{class:"text-[0.6rem] px-1.5 py-0.5 bg-warning/10 text-warning border border-warning/20 font-medium",children:["Missing: ",i.join(", ")]})]}),a("div",{class:"p-3",children:[t("div",{class:"w-full aspect-[1200/630] bg-foreground/6 border border-border/50 mb-2.5 overflow-hidden relative",children:c?t("img",{alt:"OG image preview",class:"w-full h-full object-cover",loading:"lazy",src:c}):t("div",{class:"absolute inset-0 flex items-center justify-center",children:t("span",{class:"text-[0.65rem] text-muted-foreground/40 uppercase tracking-wider",children:"No image"})})}),d&&t("div",{class:"text-[0.6rem] text-muted-foreground/60 uppercase tracking-wider truncate mb-1",children:d}),t("div",{class:"text-[0.8rem] font-semibold text-foreground line-clamp-1",children:l}),n&&t("div",{class:"text-[0.7rem] text-muted-foreground line-clamp-2 mt-0.5",children:n})]})]})},"SocialPreview"),o=s(({label:r,value:e,required:l=!1})=>a("div",{class:"flex items-start gap-3 py-2 border-b border-border/30 last:border-0",children:[t("div",{class:"w-36 shrink-0",children:t("span",{class:"text-[0.7rem] font-mono text-muted-foreground",children:r})}),t("div",{class:"flex-1 min-w-0",children:e?t("span",{class:"text-[0.75rem] text-foreground break-all",children:e}):t("span",{class:g("text-[0.7rem]",l?"text-warning":"text-muted-foreground/40"),children:l?"⚠ Missing":"—"})})]}),"MetaRow"),T=s(r=>{const[e,l]=m(p(null),"meta"),[n,c]=m(p("preview"),"activeTab"),d=s(()=>{l(x())},"refresh");return f(()=>{d()},[]),e?a("div",{class:"flex flex-col h-full",children:[a("div",{class:"flex items-center justify-between gap-3 px-4 py-2.5 border-b border-border shrink-0",children:[t("div",{class:"flex items-center gap-0",children:["preview","tags"].map(i=>t("button",{class:g("px-3 py-1.5 text-[0.75rem] font-medium border-0 cursor-pointer transition-colors capitalize",n===i?"text-foreground border-b-2 border-primary bg-transparent":"text-muted-foreground bg-transparent hover:text-foreground"),onClick:s(()=>c(i),"onClick"),type:"button",children:i==="preview"?"Social Previews":"Meta Tags"},i))}),t("button",{class:"px-2.5 py-1 text-[0.725rem] border border-border text-muted-foreground hover:text-foreground cursor-pointer bg-transparent transition-colors",onClick:d,type:"button",children:"Refresh"})]}),t("div",{class:"flex-1 overflow-auto",children:n==="preview"?t("div",{class:"p-4 grid grid-cols-2 gap-4",children:h.map(i=>t(K,{meta:e,platform:i},i.id))}):t("div",{class:"p-5",children:t("div",{class:"border border-border bg-card divide-y divide-border/30",children:a("div",{class:"px-4",children:[t(o,{label:"title",value:e.title,required:!0}),t(o,{label:"description",value:e.description,required:!0}),t(o,{label:"canonical",value:e.canonical}),t(o,{label:"og:title",value:e.ogTitle,required:!0}),t(o,{label:"og:description",value:e.ogDescription,required:!0}),t(o,{label:"og:image",value:e.ogImage,required:!0}),t(o,{label:"og:url",value:e.ogUrl}),t(o,{label:"og:type",value:e.ogType}),t(o,{label:"twitter:card",value:e.twitterCard,required:!0}),t(o,{label:"twitter:title",value:e.twitterTitle}),t(o,{label:"twitter:description",value:e.twitterDescription}),t(o,{label:"twitter:image",value:e.twitterImage}),t(o,{label:"twitter:site",value:e.twitterSite})]})})})})]}):a("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[t("div",{class:"flex gap-1.5 items-center","aria-hidden":"true",children:[0,160,320].map(i=>t("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${i}ms`}},i))}),t("span",{class:"text-[0.75rem] text-muted-foreground",children:"Reading meta tags…"})]})},"SeoApp"),S={component:T,icon:v,id:"dev-toolbar:seo",name:"SEO"};export{S as default};
17
+ `;var _=Object.defineProperty,s=w((i,t)=>_(i,"name",{value:t,configurable:!0}),"c");const A=s(()=>{const i=s(c=>document.querySelector(`meta[name="${c}"]`)?.content??"","getMeta"),t=s(c=>document.querySelector(`meta[property="og:${c}"]`)?.content??"","getOg"),l=s(c=>document.querySelector(`meta[name="twitter:${c}"]`)?.content??document.querySelector(`meta[property="twitter:${c}"]`)?.content??"","getTwitter"),n=s(c=>document.querySelector(`meta[property="article:${c}"]`)?.content??"","getArticle");return{articleAuthor:n("author"),articleModifiedTime:n("modified_time"),articlePublishedTime:n("published_time"),articleSection:n("section"),canonical:document.querySelector('link[rel="canonical"]')?.href??"",description:i("description"),ogDescription:t("description"),ogImage:t("image"),ogImageAlt:t("image:alt"),ogLocale:t("locale"),ogSiteName:t("site_name"),ogTitle:t("title"),ogType:t("type"),ogUrl:t("url"),title:document.title??"",twitterCard:l("card"),twitterCreator:l("creator"),twitterDescription:l("description"),twitterImage:l("image"),twitterImageAlt:l("image:alt"),twitterSite:l("site"),twitterTitle:l("title")}},"readMetaTags"),v=[{description:"Page title shown in browser tabs and search engine results",key:"title",label:"title",priority:"required",snippet:"<title>Your Page Title</title>"},{description:"Title shown when your page is shared on social media",key:"ogTitle",label:"og:title",priority:"required",snippet:'<meta property="og:title" content="Your Page Title" />'},{description:"Description shown when sharing on social media (max 200 chars)",key:"ogDescription",label:"og:description",priority:"required",snippet:'<meta property="og:description" content="Your page description" />'},{description:"Image shown when sharing (recommended: 1200 × 630 px)",key:"ogImage",label:"og:image",priority:"required",snippet:'<meta property="og:image" content="https://yoursite.com/og-image.jpg" />'},{description:"Twitter card format — controls how link previews appear on X / Twitter",key:"twitterCard",label:"twitter:card",priority:"required",snippet:'<meta name="twitter:card" content="summary_large_image" />'},{description:"Meta description used by search engines (max 160 chars)",key:"description",label:"description",priority:"recommended",snippet:'<meta name="description" content="Your page description" />'},{description:"Canonical URL to prevent duplicate content issues with search engines",key:"canonical",label:"canonical",priority:"recommended",snippet:'<link rel="canonical" href="https://yoursite.com/page" />'},{description:"Canonical page URL for Open Graph — should match the canonical link tag",key:"ogUrl",label:"og:url",priority:"recommended",snippet:'<meta property="og:url" content="https://yoursite.com/page" />'},{description:"Type of content: website, article, product, video.movie, etc.",key:"ogType",label:"og:type",priority:"recommended",snippet:'<meta property="og:type" content="website" />'},{description:"Your website name — shown for consistent branding on social platforms",key:"ogSiteName",label:"og:site_name",priority:"recommended",snippet:'<meta property="og:site_name" content="Your Site Name" />'},{description:"Language and territory of page content (e.g. en_US, de_DE, fr_FR)",key:"ogLocale",label:"og:locale",priority:"recommended",snippet:'<meta property="og:locale" content="en_US" />'},{description:"Alt text for the OG image — important for accessibility on social platforms",key:"ogImageAlt",label:"og:image:alt",priority:"recommended",snippet:'<meta property="og:image:alt" content="Description of the shared image" />'},{description:"Override title specifically for X / Twitter cards (falls back to og:title)",key:"twitterTitle",label:"twitter:title",priority:"recommended",snippet:'<meta name="twitter:title" content="Your Page Title" />'},{description:"Override description for X / Twitter cards (falls back to og:description)",key:"twitterDescription",label:"twitter:description",priority:"recommended",snippet:'<meta name="twitter:description" content="Your page description" />'},{description:"Override image for X / Twitter cards (falls back to og:image)",key:"twitterImage",label:"twitter:image",priority:"recommended",snippet:'<meta name="twitter:image" content="https://yoursite.com/twitter-card.jpg" />'},{description:"X / Twitter handle of the website owner (e.g. @yourhandle)",key:"twitterSite",label:"twitter:site",priority:"recommended",snippet:'<meta name="twitter:site" content="@yourhandle" />'}],U=[{accentClass:"border-blue-500/30",descKey:"ogDescription",id:"facebook",imageKey:"ogImage",name:"Facebook",requiredKeys:["ogTitle","ogDescription","ogImage"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-foreground/20",descKey:"twitterDescription",id:"twitter",imageKey:"twitterImage",name:"X / Twitter",requiredKeys:["twitterTitle","twitterDescription","twitterImage","twitterCard"],titleKey:"twitterTitle",urlKey:"ogUrl"},{accentClass:"border-blue-600/30",descKey:"ogDescription",id:"linkedin",imageKey:"ogImage",name:"LinkedIn",requiredKeys:["ogTitle","ogDescription","ogImage"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-indigo-500/30",descKey:"ogDescription",id:"discord",imageKey:"ogImage",name:"Discord",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-green-500/30",descKey:"ogDescription",id:"slack",imageKey:"ogImage",name:"Slack",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-purple-500/30",descKey:"ogDescription",id:"mastodon",imageKey:"ogImage",name:"Mastodon",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"},{accentClass:"border-sky-500/30",descKey:"ogDescription",id:"bluesky",imageKey:"ogImage",name:"Bluesky",requiredKeys:["ogTitle","ogDescription"],titleKey:"ogTitle",urlKey:"ogUrl"}],M=s(({meta:i,platform:t})=>{const l=i[t.titleKey]||i.title||"No title",n=i[t.descKey]||i.description||"",c=i[t.imageKey]||"",g=i[t.urlKey]||i.canonical||"",d=t.requiredKeys.filter(p=>!i[p]);return r("div",{class:b("border bg-card overflow-hidden",t.accentClass),children:[r("div",{class:"flex items-center justify-between gap-2 px-3 py-2 border-b border-border/50 bg-foreground/2",children:[e("span",{class:"text-[0.65rem] font-bold uppercase tracking-wider text-muted-foreground",children:t.name}),d.length>0&&r("span",{class:"text-[0.6rem] px-1.5 py-0.5 bg-warning/10 text-warning border border-warning/20 font-medium",children:["Missing: ",d.join(", ")]})]}),r("div",{class:"p-3",children:[e("div",{class:"w-full aspect-[1200/630] bg-foreground/6 border border-border/50 mb-2.5 overflow-hidden relative",children:c?e("img",{alt:"OG image preview",class:"w-full h-full object-cover",loading:"lazy",src:c}):e("div",{class:"absolute inset-0 flex items-center justify-center",children:e("span",{class:"text-[0.65rem] text-muted-foreground/40 uppercase tracking-wider",children:"No image"})})}),g&&e("div",{class:"text-[0.6rem] text-muted-foreground/60 uppercase tracking-wider truncate mb-1",children:g}),e("div",{class:"text-[0.8rem] font-semibold text-foreground line-clamp-1",children:l}),n&&e("div",{class:"text-[0.7rem] text-muted-foreground line-clamp-2 mt-0.5",children:n})]})]})},"SocialPreview"),a=s(({label:i,required:t=!1,value:l})=>r("div",{class:"flex items-start gap-3 py-2 border-b border-border/30 last:border-0",children:[e("div",{class:"w-44 shrink-0",children:e("span",{class:"text-[0.7rem] font-mono text-muted-foreground",children:i})}),e("div",{class:"flex-1 min-w-0",children:l?e("span",{class:"text-[0.75rem] text-foreground break-all",children:l}):e("span",{class:b("text-[0.7rem]",t?"text-warning":"text-muted-foreground/40"),children:t?"⚠ Missing":"—"})})]}),"MetaRow"),m=s(({children:i})=>r("p",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-muted-foreground/60 mb-2",children:[e("span",{class:"text-primary/50",children:"// "}),i]}),"SectionHeading"),O=s(({text:i})=>{const[t,l]=u(h(!1),"copied"),n=u(S(null),"timerRef"),c=s(()=>{navigator.clipboard.writeText(i).then(()=>{l(!0),n.current&&clearTimeout(n.current),n.current=setTimeout(l,2e3,!1)}).catch(console.error)},"handleCopy");return e(k,{class:b("text-[0.6rem] font-mono shrink-0",t?"border-success/40 text-success bg-success/8":""),onClick:c,size:"sm",variant:"outline",children:t?"Copied!":"Copy"})},"CopyButton"),x=s(({def:i})=>r("div",{class:"border border-border/60 bg-card p-3 space-y-2",children:[r("div",{class:"flex items-start justify-between gap-3",children:[e("code",{class:"text-[0.7rem] font-mono font-bold text-foreground",children:i.label}),e(T,{class:"text-[0.58rem] uppercase tracking-wide shrink-0",variant:i.priority==="required"?"destructive":"warning",children:i.priority})]}),e("p",{class:"text-[0.7rem] text-muted-foreground leading-relaxed",children:i.description}),r("div",{class:"flex items-center gap-2",children:[e("code",{class:"flex-1 min-w-0 text-[0.65rem] font-mono text-muted-foreground bg-foreground/4 border border-border/40 px-2 py-1 overflow-x-auto whitespace-nowrap block",children:i.snippet}),e(O,{text:i.snippet})]})]}),"MissingTagCard"),P=s(i=>{const[t,l]=u(h(null),"meta"),[n,c]=u(h("preview"),"activeTab"),g=s(()=>{l(A())},"refresh");if(D(()=>{g()},[]),!t)return r("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(o=>e("span",{class:"size-1.5 bg-primary/50 rounded-full animate-pulse",style:{animationDelay:`${o}ms`}},o))}),e("span",{class:"text-[0.75rem] text-muted-foreground",children:"Reading meta tags…"})]});const d=v.filter(o=>o.priority==="required"&&!t[o.key]),p=v.filter(o=>o.priority==="recommended"&&!t[o.key]),y=d.length+p.length,K=t.ogType==="article"||!!(t.articleAuthor||t.articlePublishedTime||t.articleModifiedTime||t.articleSection);return r("div",{class:"flex flex-col h-full",children:[r("div",{class:"flex items-center justify-between gap-3 px-4 py-2.5 border-b border-border shrink-0",children:[e("div",{class:"flex items-center gap-0",children:["preview","tags","missing"].map(o=>{const q=o==="preview"?"Social Previews":o==="tags"?"Meta Tags":"Missing",f=o==="missing"&&y>0?y:null;return r("button",{class:b("flex items-center gap-1.5 px-3 py-1.5 text-[0.75rem] font-medium border-0 cursor-pointer transition-colors capitalize",n===o?"text-foreground border-b-2 border-primary bg-transparent":"text-muted-foreground bg-transparent hover:text-foreground"),onClick:s(()=>c(o),"onClick"),type:"button",children:[q,f!==null&&e(T,{class:"text-[0.58rem] min-w-[1.1rem] text-center",variant:d.length>0?"destructive":"warning",children:f})]},o)})}),e(k,{onClick:g,size:"sm",variant:"outline",children:"Refresh"})]}),r("div",{class:"flex-1 overflow-auto",children:[n==="preview"&&e("div",{class:"p-4 grid grid-cols-2 gap-4",children:U.map(o=>e(M,{meta:t,platform:o},o.id))}),n==="tags"&&r("div",{class:"p-5 space-y-5",children:[r("div",{children:[e(m,{children:"Basic"}),e("div",{class:"border border-border bg-card",children:r("div",{class:"px-4",children:[e(a,{label:"title",required:!0,value:t.title}),e(a,{label:"description",required:!0,value:t.description}),e(a,{label:"canonical",value:t.canonical})]})})]}),r("div",{children:[e(m,{children:"Open Graph"}),e("div",{class:"border border-border bg-card",children:r("div",{class:"px-4",children:[e(a,{label:"og:title",required:!0,value:t.ogTitle}),e(a,{label:"og:description",required:!0,value:t.ogDescription}),e(a,{label:"og:image",required:!0,value:t.ogImage}),e(a,{label:"og:image:alt",value:t.ogImageAlt}),e(a,{label:"og:url",value:t.ogUrl}),e(a,{label:"og:type",value:t.ogType}),e(a,{label:"og:site_name",value:t.ogSiteName}),e(a,{label:"og:locale",value:t.ogLocale})]})})]}),K&&r("div",{children:[e(m,{children:"Article"}),e("div",{class:"border border-border bg-card",children:r("div",{class:"px-4",children:[e(a,{label:"article:author",value:t.articleAuthor}),e(a,{label:"article:published_time",value:t.articlePublishedTime}),e(a,{label:"article:modified_time",value:t.articleModifiedTime}),e(a,{label:"article:section",value:t.articleSection})]})})]}),r("div",{children:[e(m,{children:"X / Twitter"}),e("div",{class:"border border-border bg-card",children:r("div",{class:"px-4",children:[e(a,{label:"twitter:card",required:!0,value:t.twitterCard}),e(a,{label:"twitter:title",value:t.twitterTitle}),e(a,{label:"twitter:description",value:t.twitterDescription}),e(a,{label:"twitter:image",value:t.twitterImage}),e(a,{label:"twitter:image:alt",value:t.twitterImageAlt}),e(a,{label:"twitter:site",value:t.twitterSite}),e(a,{label:"twitter:creator",value:t.twitterCreator})]})})]})]}),n==="missing"&&e("div",{class:"p-5 space-y-5",children:y===0?r("div",{class:"flex flex-col items-center justify-center py-12 gap-3",children:[e("div",{class:"size-10 border border-success/30 bg-success/8 flex items-center justify-center text-success text-lg select-none",children:"✓"}),e("p",{class:"text-[0.8rem] font-medium text-foreground/70",children:"All recommended tags are present"}),e("p",{class:"text-[0.7rem] text-muted-foreground",children:"Your page has all required and recommended meta tags."})]}):r(I,{children:[d.length>0&&r("div",{children:[r("p",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-destructive/80 mb-2 flex items-center gap-1.5",children:[e("span",{children:"Required"}),e("span",{class:"bg-destructive/10 border border-destructive/25 text-destructive px-1 font-bold",children:d.length})]}),e("div",{class:"space-y-2",children:d.map(o=>e(x,{def:o},o.key))})]}),p.length>0&&r("div",{children:[r("p",{class:"text-[0.58rem] font-bold uppercase tracking-[0.12em] text-warning/80 mb-2 flex items-center gap-1.5",children:[e("span",{children:"Recommended"}),e("span",{class:"bg-warning/10 border border-warning/25 text-warning px-1 font-bold",children:p.length})]}),e("div",{class:"space-y-2",children:p.map(o=>e(x,{def:o},o.key))})]})]})})]})]})},"SeoApp"),B={component:P,icon:j,id:"dev-toolbar:seo",name:"SEO"};export{B as default};
@@ -1,4 +1,4 @@
1
- var C=Object.defineProperty;var v=(t,n)=>C(t,"name",{value:n,configurable:!0});import{addHookName as f}from"preact/devtools";import{useState as D,useRef as k,useEffect as y}from"preact/hooks";import{i as m,u as w,a as F,D as c}from"../../packem_shared/icon-BUQ92HaT.js";import{m as g}from"../../packem_shared/cn-BEsR6GkP.js";import{jsxs as l,jsx as e}from"preact/jsx-runtime";const E=`<!-- @license lucide-static v0.575.0 - ISC -->
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
2
  <svg
3
3
  class="lucide lucide-settings"
4
4
  xmlns="http://www.w3.org/2000/svg"
@@ -14,4 +14,4 @@ var C=Object.defineProperty;var v=(t,n)=>C(t,"name",{value:n,configurable:!0});i
14
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
15
  <circle cx="12" cy="12" r="3" />
16
16
  </svg>
17
- `,S="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",T="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",A="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 K=Object.defineProperty,r=v((t,n)=>K(t,"name",{value:n,configurable:!0}),"o");const d=r(({label:t,description:n,control: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: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"),h=r(({title:t,children: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:"//"}),t]}),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:n})})]}),"Section"),b=r(({checked:t,onChange:n})=>e("button",{"aria-checked":t,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",t?"bg-primary":"bg-foreground/15"),onClick:r(()=>n(!t),"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",t?"translate-x-4 bg-primary-foreground":"translate-x-0 bg-white")})}),"Toggle"),M=r(({value:t,onChange:n})=>{const o=[{label:"Light",value:"light",icon:e(m,{size:13,src:A})},{label:"Dark",value:"dark",icon:e(m,{size:13,src:T})},{label:"System",value:"system",icon:e(m,{size:13,src:S})}];return e("div",{class:"flex items-center gap-0.5 bg-foreground/6 p-0.5",children:o.map(s=>l("button",{"aria-pressed":t===s.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",t===s.value?"bg-background text-foreground shadow-sm":"bg-transparent text-muted-foreground hover:text-foreground"),onClick:r(()=>n(s.value),"onClick"),type:"button",children:[s.icon,s.label]},s.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}],P=r(({value:t,onChange: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:r(o=>n(Number(o.target.value)),"onChange"),value:String(t),children:j.map(o=>e("option",{value:String(o.value),children:o.label},o.value))}),"HideDelayControl"),R=r(t=>t.split("+"),"formatBinding"),B=r(({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"),x=r(({value:t,onChange:n})=>{const[o,s]=f(D(!1),"capturing"),p=f(k(null),"buttonRef");return y(()=>{if(!o)return;const i=r(a=>{if(a.preventDefault(),a.stopPropagation(),["Alt","Shift","Control","Meta"].includes(a.key))return;const u=[];a.altKey&&u.push("Alt"),a.ctrlKey&&u.push("Control"),a.metaKey&&u.push("Meta"),a.shiftKey&&u.push("Shift"),u.push(a.key),n(u.join("+")),s(!1)},"handleKeyDown");return window.addEventListener("keydown",i,!0),()=>window.removeEventListener("keydown",i,!0)},[o,n]),l("div",{class:"flex items-center gap-2",children:[e("div",{class:"flex items-center gap-0.5",children:R(t).map((i,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:i})]},a))}),e("button",{ref:p,class:g("px-2 py-0.5 text-[0.7rem] font-medium border cursor-pointer transition-colors",o?"border-primary text-primary bg-primary/8 animate-pulse":"border-border text-muted-foreground hover:text-foreground bg-transparent"),onClick:r(()=>s(i=>!i),"onClick"),type:"button",children:o?"Press keys…":"Record"}),e("button",{class:"px-2 py-0.5 text-[0.7rem] font-medium border border-border/50 text-muted-foreground/60 hover:text-foreground bg-transparent cursor-pointer transition-colors",onClick:r(()=>{s(!1)},"onClick"),title:"Cancel",type:"button",children:"✕"})]})},"KeyCapture"),N=r(t=>{const{state:n,updateState:o}=w(),{theme:s,setTheme:p}=F();return l("div",{class:"p-5 space-y-5 max-w-2xl",children:[l(h,{title:"Appearance",children:[e(d,{label:"Theme",description:"Color scheme for the DevTools panel.",control:e(M,{value:s,onChange:p})}),e(d,{label:"Reduce motion",description:"Disable animations and transitions throughout the toolbar.",control:e(b,{checked:n.reduceMotion,onChange:r(i=>o({reduceMotion:i}),"onChange")})})]}),l(h,{title:"Toolbar",children:[e(d,{label:"Auto-hide when inactive",description:"Collapse the toolbar pill after a period of inactivity. Set 'Never' to always keep it visible.",control:e(P,{value:n.minimizePanelInactive,onChange:r(i=>o({minimizePanelInactive:i}),"onChange")})}),e(d,{label:"Show toolbar when panel is closed",description:"Keep the toolbar pill visible even when the DevTools panel is not open.",control:e(b,{checked:n.preferShowFloatingPanel,onChange:r(i=>o({preferShowFloatingPanel:i}),"onChange")})})]}),e(h,{title:"Panel",children:e(d,{label:"Close on outside click",description:"Close the DevTools panel when clicking outside of it.",control:e(b,{checked:n.closeOnOutsideClick,onChange:r(i=>o({closeOnOutsideClick:i}),"onChange")})})}),l(h,{title:"Keyboard Shortcuts",children:[e(d,{label:"Toggle toolbar",description:"Open or close the DevTools panel.",control:l("div",{class:"flex items-center gap-2",children:[e(x,{value:n.keybindings?.toggle??c.toggle,onChange:r(i=>o({keybindings:{...n.keybindings??c,toggle:i}}),"onChange")}),n.keybindings?.toggle!==c.toggle&&e("button",{class:"text-[0.65rem] text-muted-foreground/50 hover:text-foreground underline cursor-pointer border-0 bg-transparent",onClick:r(()=>o({keybindings:{...n.keybindings??c,toggle:c.toggle}}),"onClick"),type:"button",children:"Reset"})]})}),e(d,{label:"Close panel",description:"Dismiss the active app or close the panel.",control:l("div",{class:"flex items-center gap-2",children:[e(x,{value:n.keybindings?.close??c.close,onChange:r(i=>o({keybindings:{...n.keybindings??c,close:i}}),"onChange")}),n.keybindings?.close!==c.close&&e("button",{class:"text-[0.65rem] text-muted-foreground/50 hover:text-foreground underline cursor-pointer border-0 bg-transparent",onClick:r(()=>o({keybindings:{...n.keybindings??c,close:c.close}}),"onClick"),type:"button",children:"Reset"})]})})]})]})},"SettingsApp"),U={component:N,defaultOpen:!0,icon:E,id:"dev-toolbar:settings",name:"Settings"};export{U as default};
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,4 +1,3 @@
1
- /** @jsxImportSource preact */
2
1
  import type { ComponentChildren } from "preact";
3
2
  import type { AppComponentProps } from "../../types/app.d.ts";
4
3
  declare const SettingsApp: (_props: AppComponentProps) => ComponentChildren;
@@ -0,0 +1,3 @@
1
+ import type { DevToolbarApp } from "../../types/app.d.ts";
2
+ declare const tailwindApp: DevToolbarApp;
3
+ export default tailwindApp;
@@ -0,0 +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">
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};
@@ -0,0 +1,5 @@
1
+ /** @jsxImportSource preact */
2
+ import type { ComponentChildren } from "preact";
3
+ import type { AppComponentProps } from "../../types/app.d.ts";
4
+ declare const TailwindApp: ({ helpers }: AppComponentProps) => ComponentChildren;
5
+ export default TailwindApp;
@@ -1,4 +1,4 @@
1
- var D=Object.defineProperty;var b=(t,o)=>D(t,"name",{value:o,configurable:!0});import{addHookName as c}from"preact/devtools";import{useState as p,useRef as I,useEffect as L}from"preact/hooks";import{g as w,D as z}from"../../packem_shared/store-BxE0w51s.js";import{m as u}from"../../packem_shared/cn-BEsR6GkP.js";import{jsx as r,jsxs as n}from"preact/jsx-runtime";const A=`<!-- @license lucide-static v0.575.0 - ISC -->
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
2
  <svg
3
3
  class="lucide lucide-gantt-chart"
4
4
  xmlns="http://www.w3.org/2000/svg"
@@ -15,4 +15,4 @@ var D=Object.defineProperty;var b=(t,o)=>D(t,"name",{value:o,configurable:!0});i
15
15
  <path d="M4 12h10" />
16
16
  <path d="M12 19h8" />
17
17
  </svg>
18
- `;var N=Object.defineProperty,l=b((t,o)=>N(t,"name",{value:o,configurable:!0}),"i");const O=500,g="all",k=l(t=>new Date(t).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}),"formatTime"),y=l(({level:t})=>{if(!t)return null;const o={error:"bg-destructive/15 text-destructive border-destructive/30",info:"bg-info/15 text-info border-info/30",warning:"bg-warning/15 text-warning border-warning/30"};return r("span",{class:u("inline-flex items-center px-1.5 py-0.5 text-[0.6rem] font-bold uppercase tracking-wider border",o[t]??o.info),children:t})},"LevelBadge"),R=l(({event:t,onClose:o})=>n("div",{class:"border-l border-border bg-background h-full flex flex-col min-w-0 w-80 shrink-0",children:[n("div",{class:"flex items-center justify-between gap-2 px-4 py-3 border-b border-border shrink-0",children:[r("span",{class:"text-[0.75rem] font-semibold text-foreground truncate",children:t.title}),r("button",{"aria-label":"Close detail",class:"size-5 flex items-center justify-center text-muted-foreground hover:text-foreground cursor-pointer border-0 bg-transparent shrink-0",onClick:o,type:"button",children:"✕"})]}),n("div",{class:"flex-1 overflow-auto p-4 space-y-3",children:[n("div",{class:"space-y-1",children:[r("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Time"}),r("div",{class:"text-[0.8rem] font-mono text-foreground",children:k(t.time)})]}),t.subtitle&&n("div",{class:"space-y-1",children:[r("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Subtitle"}),r("div",{class:"text-[0.8rem] text-foreground",children:t.subtitle})]}),t.duration!==void 0&&n("div",{class:"space-y-1",children:[r("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Duration"}),n("div",{class:"text-[0.8rem] font-mono text-foreground",children:[t.duration,"ms"]})]}),t.level&&n("div",{class:"space-y-1",children:[r("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Level"}),r(y,{level:t.level})]}),t.data&&Object.keys(t.data).length>0&&n("div",{class:"space-y-1",children:[r("div",{class:"text-[0.65rem] uppercase tracking-wider text-muted-foreground font-medium",children:"Data"}),r("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(t.data,null,2)})]})]})]}),"EventDetail"),B=l(t=>{const[o,C]=c(p(g),"activeTab"),[d,j]=c(p([]),"groups"),[s,a]=c(p(null),"selectedEvent"),m=c(I(null),"intervalRef"),f=l(()=>{const e=w();j(e.getGroups().map(i=>({...i,events:[...i.events]})))},"refresh");L(()=>(f(),m.current=setInterval(f,O),()=>{m.current!==null&&clearInterval(m.current)}),[]);const x=new Map(z.map(e=>[e.id,e.color])),M=[{id:g,label:"All",color:void 0},...d.map(e=>({id:e.id,label:e.label,color:x.get(e.id)??e.color}))],h=o===g?d.flatMap(e=>e.events).sort((e,i)=>e.time-i.time):d.find(e=>e.id===o)?.events??[],T=l(()=>{w().clearAll(),a(null),f()},"clearAll");return n("div",{class:"flex flex-col h-full",children:[n("div",{class:"flex items-center justify-between gap-2 px-4 py-2 border-b border-border shrink-0",children:[r("div",{class:"flex items-center gap-0 overflow-x-auto",children:M.map(e=>n("button",{class:u("px-3 py-1.5 text-[0.75rem] font-medium whitespace-nowrap border-0 cursor-pointer transition-colors duration-150",o===e.id?"text-foreground border-b-2 border-primary bg-transparent":"text-muted-foreground bg-transparent hover:text-foreground"),onClick:l(()=>{C(e.id),a(null)},"onClick"),type:"button",children:[e.color&&r("span",{class:"inline-block size-2 rounded-full mr-1.5 align-middle",style:{backgroundColor:e.color}}),e.label]},e.id))}),r("button",{class:u("px-2.5 py-1 text-[0.725rem] font-medium border border-border","text-muted-foreground hover:text-foreground hover:border-foreground/30","cursor-pointer bg-transparent transition-colors duration-150"),onClick:T,title:"Clear all events",type:"button",children:"Clear"})]}),n("div",{class:"flex flex-1 min-h-0 overflow-hidden",children:[r("div",{class:"flex-1 overflow-auto",children:h.length===0?n("div",{class:"flex flex-col items-center justify-center h-full gap-4 p-8 text-center select-none",children:[r("div",{class:"size-12 border border-border/50 bg-foreground/2 flex items-center justify-center",children:r("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:r("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"})})}),n("div",{class:"space-y-1",children:[r("p",{class:"text-[0.8rem] font-medium text-foreground/60",children:"No events recorded yet"}),r("p",{class:"text-[0.7rem] text-muted-foreground",children:"Events appear here as your app runs"}),r("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"})]})]}):r("div",{class:"divide-y divide-border/50",children:h.map(e=>{const i=d.find(S=>S.events.some(E=>E.id===e.id)),v=x.get(i?.id??"")??i?.color;return n("button",{class:u("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===e.id&&"bg-primary/6"),onClick:l(()=>a(s?.id===e.id?null:e),"onClick"),type:"button",children:[v&&r("span",{class:"mt-1 size-1.5 rounded-full shrink-0",style:{backgroundColor:v}}),n("div",{class:"flex-1 min-w-0",children:[n("div",{class:"flex items-center gap-2 flex-wrap",children:[r("span",{class:"text-[0.8rem] font-medium text-foreground truncate",children:e.title}),r(y,{level:e.level})]}),e.subtitle&&r("div",{class:"text-[0.725rem] text-muted-foreground truncate mt-0.5",children:e.subtitle})]}),r("span",{class:"text-[0.65rem] font-mono text-muted-foreground/70 shrink-0 mt-0.5",children:k(e.time)})]},e.id)})})}),s&&r(R,{event:s,onClose:l(()=>a(null),"onClose")})]})]})},"TimelineApp"),F={component:B,icon:A,id:"dev-toolbar:timeline",name:"Timeline"};export{F as default};
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,4 +1,4 @@
1
- var x=Object.defineProperty;var b=(t,e)=>x(t,"name",{value:e,configurable:!0});import{addHookName as d}from"preact/devtools";import{useState as c,useEffect as h}from"preact/hooks";import{m as g}from"../../packem_shared/cn-BEsR6GkP.js";import{jsx as r,jsxs as o}from"preact/jsx-runtime";const y=`<!-- @license lucide-static v0.575.0 - ISC -->
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
2
  <svg
3
3
  class="lucide lucide-zap"
4
4
  xmlns="http://www.w3.org/2000/svg"
@@ -13,4 +13,4 @@ var x=Object.defineProperty;var b=(t,e)=>x(t,"name",{value:e,configurable:!0});i
13
13
  >
14
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
15
  </svg>
16
- `;var v=Object.defineProperty,a=b((t,e)=>v(t,"name",{value:e,configurable:!0}),"s");const w=a(({text:t})=>{const[e,i]=d(c(!1),"copied"),n=a(()=>{navigator.clipboard.writeText(t).then(()=>{i(!0),setTimeout(()=>i(!1),1500)}).catch(()=>{})},"copy");return r("button",{class:g("px-2 py-0.5 text-[0.65rem] font-medium border cursor-pointer transition-colors duration-150",e?"border-primary/40 text-primary bg-primary/8":"border-border text-muted-foreground hover:text-foreground hover:border-foreground/30 bg-transparent"),onClick:n,title:"Copy to clipboard",type:"button",children:e?"Copied!":"Copy"})},"CopyButton"),m=a(({title:t,data:e,defaultOpen:i=!0})=>{const[n,p]=d(c(i),"open"),u=JSON.stringify(e,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(()=>p(s=>!s),"onClick"),type:"button",children:[r("span",{class:"text-[0.75rem] font-semibold text-foreground uppercase tracking-wide",children:t}),o("div",{class:"flex items-center gap-2",children:[r(w,{text:u}),r("span",{class:g("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:u})]})},"Section"),C=a(({helpers:t})=>{const[e,i]=d(c(null),"config"),[n,p]=d(c(null),"error"),[u,s]=d(c(!0),"loading"),f=a(()=>{s(!0),p(null),t.rpc.getViteConfig().then(l=>{i(l),s(!1)}).catch(l=>{p(l.message??"Failed to load Vite config"),s(!1)})},"load");return h(()=>{f()},[]),u?o("div",{class:"flex flex-col items-center justify-center h-full gap-3 p-8 select-none",children:[r("div",{class:"flex gap-1.5 items-center","aria-hidden":"true",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("button",{class:"px-3 py-1.5 text-[0.75rem] border border-border text-muted-foreground hover:text-foreground cursor-pointer bg-transparent",onClick:f,type:"button",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("span",{class:"inline-flex items-center px-2.5 py-1 text-[0.7rem] font-bold uppercase tracking-wider bg-primary/10 text-primary border border-primary/20",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("button",{class:"ml-auto px-2.5 py-1 text-[0.725rem] border border-border text-muted-foreground hover:text-foreground cursor-pointer bg-transparent transition-colors",onClick:f,type:"button",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"),A={component:C,icon:y,id:"dev-toolbar:vite-config",name:"Vite Config"};export{A as default};
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 +1 @@
1
- var I=Object.defineProperty;var d=(e,t)=>I(e,"name",{value:t,configurable:!0});import r from"virtual:visulima-dev-toolbar-options";var c=Object.defineProperty,m=d((e,t)=>c(e,"name",{value:t,configurable:!0}),"r");globalThis.__VISULIMA_DEV_TOOLBAR_OPTIONS__=r;const g=m(()=>{if(!r.requireUrlFlag)return!0;const e=r.urlFlagName??"devtools";return new URLSearchParams(globalThis.window?.location.search).get(e)==="true"},"isUrlFlagPresent"),o=m(async()=>{if(globalThis.window===void 0||!g()||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,[l,i,a,n,u,s,p,_]=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,import("virtual:visulima-dev-toolbar-path:apps/more/index.js")]);e=document.createElement("dev-toolbar"),document.body.append(e),e.registerApp&&(l&&e.registerApp(l.default,!0),i&&e.registerApp(i.default,!0),a&&e.registerApp(a.default,!0),n&&e.registerApp(n.default,!0),u&&e.registerApp(u.default,!0),s&&e.registerApp(s.default,!0),p&&e.registerApp(p.default,!0),e.registerApp(_.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",o):o());import.meta.hot&&import.meta.hot.on("dev-toolbar:init",()=>{const e=document.querySelector("dev-toolbar");e&&e.remove(),globalThis.__VISULIMA_DEVTOOLS_INITIALIZED__=!1,o()});
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()});
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { createDevToolbarHook, getGlobalHook, setupGlobalHook } from "./hooks/index.d.ts";
2
- export { createClientRPCContext, createServerRPCContext } from "./rpc/index.d.ts";
2
+ export { createClientRPCContext } from "./rpc/client.d.ts";
3
+ export { createServerRPCContext } from "./rpc/server.d.ts";
3
4
  export { getTimelineStore, TimelineStore } from "./timeline/index.d.ts";
4
5
  export { DevToolbar } from "./toolbar/index.d.ts";
5
6
  export { loadSettings, saveSettings, updateSettings } from "./toolbar/settings.d.ts";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{DevToolbar as t}from"./toolbar/index.js";import{loadSettings as a,saveSettings as l,updateSettings as m}from"./packem_shared/loadSettings-hvjR4fcS.js";import{T as x,g as i}from"./packem_shared/store-BxE0w51s.js";import{createClientRPCContext as f}from"./packem_shared/createClientRPCContext-DzKQpKTk.js";import{createDevToolbarHook as g}from"./packem_shared/createDevToolbarHook-DGNxqk8N.js";import{createServerRPCContext as C}from"./packem_shared/createServerRPCContext-BVSesPXu.js";import{getGlobalHook as b,setupGlobalHook as v}from"./packem_shared/setupGlobalHook-CFuxsCyl.js";export{t as DevToolbar,x as TimelineStore,f as createClientRPCContext,g as createDevToolbarHook,C as createServerRPCContext,b as getGlobalHook,i as getTimelineStore,a as loadSettings,l as saveSettings,v as setupGlobalHook,m as updateSettings};
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};
@@ -0,0 +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};
@@ -0,0 +1 @@
1
+ var c=Object.defineProperty;var n=(e,r)=>c(e,"name",{value:r,configurable:!0});import s from"./cn-DWLJYh3h.js";import{jsx as l}from"preact/jsx-runtime";var d=Object.defineProperty,i=n((e,r)=>d(e,"name",{value:r,configurable:!0}),"n");const o={default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive",info:"border-info/50 text-info",success:"border-success/50 text-success",warning:"border-warning/50 text-warning"},f=i(({children:e,class:r,variant:t="default",...a})=>l("div",{class:s("relative w-full rounded-none border p-4 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg~*]:pl-7",o[t],r),role:"alert",...a,children:e}),"Alert"),p=i(({children:e,class:r,...t})=>l("h5",{class:s("mb-1 font-medium leading-none tracking-tight",r),...t,children:e}),"AlertTitle"),b=i(({children:e,class:r,...t})=>l("div",{class:s("text-sm [&_p]:leading-relaxed",r),...t,children:e}),"AlertDescription");export{f as Alert,b as AlertDescription,p as AlertTitle};
@@ -0,0 +1 @@
1
+ var a=Object.defineProperty;var t=(r,e)=>a(r,"name",{value:e,configurable:!0});import s from"./cn-DWLJYh3h.js";import{jsx as d}from"preact/jsx-runtime";var i=Object.defineProperty,c=t((r,e)=>i(r,"name",{value:e,configurable:!0}),"t");const u={default:"border-transparent bg-primary text-primary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",info:"border-transparent bg-info text-info-foreground",outline:"text-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",success:"border-transparent bg-success text-success-foreground",warning:"border-transparent bg-warning text-warning-foreground"},l=c(({children:r,class:e,variant:n="default",...o})=>d("div",{class:s("inline-flex items-center rounded-none border px-2.5 py-0.5 text-xs font-semibold transition-colors",u[n],e),...o,children:r}),"Badge");export{l as default};
@@ -0,0 +1 @@
1
+ var d=Object.defineProperty;var t=(e,r)=>d(e,"name",{value:r,configurable:!0});import s from"./cn-DWLJYh3h.js";import{jsx as a}from"preact/jsx-runtime";var c=Object.defineProperty,g=t((e,r)=>c(e,"name",{value:r,configurable:!0}),"r");const l={default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",ghost:"text-muted-foreground hover:bg-foreground/8 hover:text-foreground",link:"text-primary underline-offset-4 hover:underline",outline:"border border-input bg-background text-foreground hover:bg-foreground/8",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80"},f={default:"h-9 px-4 py-2",icon:"h-9 w-9",lg:"h-10 px-8",sm:"h-8 px-3 text-xs"},m=g(({children:e,class:r,size:o="default",type:n="button",variant:i="default",...u})=>a("button",{class:s("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-none text-sm font-medium cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",l[i],f[o],r),type:n,...u,children:e}),"Button");export{m as default};
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var l=(e,r)=>i(e,"name",{value:r,configurable:!0});import d from"./cn-DWLJYh3h.js";import{jsx as s}from"preact/jsx-runtime";var n=Object.defineProperty,c=l((e,r)=>n(e,"name",{value:r,configurable:!0}),"t");const C=c(({children:e,class:r,...a})=>s("div",{class:d("bg-card text-card-foreground rounded-none border shadow",r),...a,children:e}),"Card"),p=c(({children:e,class:r,...a})=>s("div",{class:d("flex flex-col space-y-1.5 p-6",r),...a,children:e}),"CardHeader"),m=c(({children:e,class:r,...a})=>s("h3",{class:d("font-semibold leading-none tracking-tight",r),...a,children:e}),"CardTitle"),f=c(({children:e,class:r,...a})=>s("div",{class:d("text-sm text-muted-foreground",r),...a,children:e}),"CardDescription"),v=c(({children:e,class:r,...a})=>s("div",{class:d("p-6 pt-0",r),...a,children:e}),"CardContent"),x=c(({children:e,class:r,...a})=>s("div",{class:d("flex items-center p-6 pt-0",r),...a,children:e}),"CardFooter");export{C as Card,v as CardContent,f as CardDescription,x as CardFooter,p as CardHeader,m as CardTitle};
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var t=(a,e)=>i(a,"name",{value:e,configurable:!0});import o from"./cn-DWLJYh3h.js";import{jsx as s}from"preact/jsx-runtime";var n=Object.defineProperty,c=t((a,e)=>n(a,"name",{value:e,configurable:!0}),"r");const p=c(({class:a,size:e=13,src:r})=>s("span",{class:o("inline-block shrink-0",a),style:{backgroundColor:"currentColor",height:e,maskImage:`url(${r})`,maskRepeat:"no-repeat",maskSize:"contain",WebkitMaskImage:`url(${r})`,WebkitMaskRepeat:"no-repeat",WebkitMaskSize:"contain",width:e}}),"Icon");export{p as default};
@@ -0,0 +1 @@
1
+ import{forwardRef as s}from"preact/compat";import i from"./cn-DWLJYh3h.js";import{jsx as n}from"preact/jsx-runtime";const l=s(({class:o,type:e="text",...r},t)=>n("input",{class:i("flex h-9 w-full rounded-none border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",o),ref:t,type:e,...r}));l.displayName="Input";export{l as default};
@@ -0,0 +1 @@
1
+ var o=Object.defineProperty;var r=(e,a)=>o(e,"name",{value:a,configurable:!0});import t from"./cn-DWLJYh3h.js";import{jsx as n}from"preact/jsx-runtime";var d=Object.defineProperty,i=r((e,a)=>d(e,"name",{value:a,configurable:!0}),"l");const p=i(({children:e,class:a,...l})=>n("label",{class:t("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",a),...l,children:e}),"Label");export{p as default};
@@ -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,o=P((e,n)=>z(e,"name",{value:n,configurable:!0}),"t");const O=T(null),h=o(()=>{const e=j(O);if(!e)throw new Error("Popover subcomponent must be used within <Popover>");return e},"usePopoverContext"),X=o(({children:e,defaultOpen:n,onOpenChange:i,open:r})=>{const s=r!==void 0,[a,t]=v(b(n??!1),"internalOpen"),p=s?r:a,c=v(y(null),"triggerRef"),l=o(u=>{s||t(u),i?.(u)},"setOpen");return f(O.Provider,{value:{open:p,setOpen:l,triggerRef:c},children:f("span",{style:{display:"contents"},children:e})})},"Popover"),q=o(({children:e,class:n,...i})=>{const{open:r,setOpen:s,triggerRef:a}=h(),t=o(p=>{a.current=p},"handleRef");return f("button",{"aria-expanded":r,class:g("",n),onClick:o(()=>{i.disabled||s(!r)},"onClick"),ref:t,type:"button",...i,children:e})},"PopoverTrigger"),A=o(({align:e="center",children:n,class:i,side:r="bottom",sideOffset:s=4,...a})=>{const{open:t,setOpen:p,triggerRef:c}=h(),l=v(y(null),"contentRef"),[u,w]=v(b({x:0,y:0}),"position");return C(()=>{if(!t||!c.current||!l.current)return;const m=e==="center"?r:`${r}-${e}`;k(c.current,l.current,{middleware:[E(s),$(),L({padding:4})],placement:m}).then(d=>{w({x:d.x,y:d.y})}).catch(()=>{})},[t,r,s,e,c]),C(()=>{if(!t)return;const m=o(d=>{if(l.current&&!l.current.contains(d.target)){const x=c.current;if(x&&x.contains(d.target))return;p(!1)}},"handleMouseDown");return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[t,p,c]),t?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:l,role:"dialog",style:{left:`${u.x}px`,position:"fixed",top:`${u.y}px`},...a,children:n}):null},"PopoverContent"),F=o(({children:e,class:n,...i})=>{const{setOpen:r}=h();return f("button",{class:g("",n),onClick:o(()=>r(!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 o=Object.defineProperty;var e=(a,r)=>o(a,"name",{value:r,configurable:!0});import s from"./cn-DWLJYh3h.js";import{jsx as l}from"preact/jsx-runtime";var t=Object.defineProperty,n=e((a,r)=>t(a,"name",{value:r,configurable:!0}),"s");const v=n(({class:a,value:r,...i})=>l("div",{"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":r??0,class:s("relative h-2 w-full overflow-hidden rounded-none bg-primary/20",a),role:"progressbar",...i,children:l("div",{class:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(r??0)}%)`}})}),"Progress");export{v as default};
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var a=(r,o)=>i(r,"name",{value:o,configurable:!0});import l from"./cn-DWLJYh3h.js";import{jsx as s}from"preact/jsx-runtime";var p=Object.defineProperty,u=a((r,o)=>p(r,"name",{value:o,configurable:!0}),"a");const d=u(({class:r,decorative:o=!0,orientation:e="horizontal",...t})=>{const n=o?{role:"none"}:{"aria-orientation":e,role:"separator"};return s("div",{class:l("shrink-0 bg-border",e==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",r),...n,...t})},"Separator");export{d as default};
@@ -0,0 +1 @@
1
+ var o=Object.defineProperty;var a=(e,r)=>o(e,"name",{value:r,configurable:!0});import t from"./cn-DWLJYh3h.js";import{jsx as n}from"preact/jsx-runtime";var s=Object.defineProperty,m=a((e,r)=>s(e,"name",{value:r,configurable:!0}),"r");const u=m(({class:e,...r})=>n("div",{class:t("animate-pulse rounded-none bg-primary/10",e),...r}),"Skeleton");export{u as default};
@@ -0,0 +1 @@
1
+ var m=Object.defineProperty;var a=(e,r)=>m(e,"name",{value:r,configurable:!0});import{addHookName as g}from"preact/devtools";import{useState as v}from"preact/hooks";import s from"./cn-DWLJYh3h.js";import{jsx as c}from"preact/jsx-runtime";var C=Object.defineProperty,d=a((e,r)=>C(e,"name",{value:r,configurable:!0}),"o");const H=d(({checked:e,class:r,defaultChecked:l,disabled:o,id:u,onCheckedChange:b,...f})=>{const t=e!==void 0,[h,k]=g(v(l??!1),"internalChecked"),n=t?e:h,p=d(()=>{if(o)return;const i=!n;t||k(i),b?.(i)},"handleClick");return c("button",{"aria-checked":n,class:s("inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-none border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",n?"bg-primary":"bg-input",r),"data-state":n?"checked":"unchecked",disabled:o,id:u,onClick:p,role:"switch",type:"button",...f,children:c("span",{class:s("pointer-events-none block h-4 w-4 rounded-none bg-background shadow-lg ring-0 transition-transform",n?"translate-x-4":"translate-x-0"),"data-state":n?"checked":"unchecked"})})},"Switch");export{H as default};
@@ -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 o}from"preact/jsx-runtime";var V=Object.defineProperty,s=b((e,n)=>V(e,"name",{value:n,configurable:!0}),"s");const f=x(null),g=s(()=>{const e=k(f);if(!e)throw new Error("Tabs subcomponent must be used within <Tabs>");return e},"useTabsContext"),S=s(({children:e,class:n,defaultValue:t,onValueChange:i,value:r,...c})=>{const l=r!==void 0,[a,v]=T(C(t??""),"internalValue"),m=l?r:a,h=s(d=>{l||v(d),i?.(d)},"handleValueChange");return o(f.Provider,{value:{onValueChange:h,value:m},children:o("div",{class:u("",n),...c,children:e})})},"Tabs"),H=s(({children:e,class:n,...t})=>o("div",{class:u("inline-flex h-9 items-center justify-center rounded-none bg-muted p-1 text-muted-foreground",n),role:"tablist",...t,children:e}),"TabsList"),N=s(({children:e,class:n,disabled:t,value:i,...r})=>{const{onValueChange:c,value:l}=g(),a=l===i;return o("button",{"aria-selected":a,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",a?"bg-background text-foreground shadow":"hover:bg-background/50",n),"data-state":a?"active":"inactive",disabled:t,onClick:s(()=>!t&&c(i),"onClick"),role:"tab",type:"button",...r,children:e})},"TabsTrigger"),O=s(({children:e,class:n,value:t,...i})=>{const{value:r}=g();return r!==t?null:o("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",...i,children:e})},"TabsContent");export{S as Tabs,O as TabsContent,H as TabsList,N as TabsTrigger};
@@ -0,0 +1 @@
1
+ import{forwardRef as s}from"preact/compat";import t from"./cn-DWLJYh3h.js";import{jsx as a}from"preact/jsx-runtime";const i=s(({class:e,...r},o)=>a("textarea",{class:t("flex min-h-[60px] w-full rounded-none border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),ref:o,...r}));i.displayName="Textarea";export{i as default};
@@ -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(null),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(),u=l(g(null),"contentRef"),[c,y]=l(m({x:0,y:0}),"position");return E(()=>{!s||!a.current||!u.current||v(a.current,u.current,{middleware:[R(o),b(),C({padding:4})],placement:n}).then(f=>{y({x:f.x,y:f.y})}).catch(()=>{})},[s,n,o,a]),s?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:u,role:"tooltip",style:{left:`${c.x}px`,position:"fixed",top:`${c.y}px`},...i,children:e}):null},"TooltipContent");export{D as Tooltip,q as TooltipContent,N as TooltipTrigger};
@@ -0,0 +1 @@
1
+ var o=Object.defineProperty;var t=(e,r)=>o(e,"name",{value:r,configurable:!0});import{clsx as a}from"clsx";import{twMerge as m}from"tailwind-merge";var c=Object.defineProperty,f=t((e,r)=>c(e,"name",{value:r,configurable:!0}),"t");const p=f((...e)=>m(a(e)),"cn");export{p as default};
@@ -0,0 +1 @@
1
+ var b=Object.defineProperty;var d=(e,t)=>b(e,"name",{value:t,configurable:!0});import{createRequire as j}from"node:module";const C=j(import.meta.url),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=d(e=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[t,r]=f.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return f.getBuiltinModule(e)}return C(e)},"__cjs_getBuiltinModule"),v=h("node:path"),g=h("node:fs/promises"),{createRequire:T}=h("node:module");var _=Object.defineProperty,F=d((e,t)=>_(e,"name",{value:t,configurable:!0}),"u");const $=F(async e=>{const{moduleGraph:t}=e,r=[];return t.idToModuleMap.forEach(o=>{const i=[];o.importers.forEach(n=>{const c=n.url??n.id;c&&i.push(c)});const s=o.id??o.url,a=o.url??o.id;!s||!a||r.push({id:s,importerCount:o.importers.size,importerUrls:i,url:a})}),r},"getModuleGraph");var O=Object.defineProperty,P=d((e,t)=>O(e,"name",{value:t,configurable:!0}),"n");const S=P(async(e,t,r,o,i)=>{const s=t.startsWith("/")?t:v.join(e.config.root,t),a=r===void 0?"":`:${r}${o===void 0?"":`:${o}`}`,n=`${s}${a}`,{default:c}=await import("launch-editor");c(n,i)},"openInEditor");var M=Object.defineProperty,p=d((e,t)=>M(e,"name",{value:t,configurable:!0}),"l");const w=p(e=>{const t={},r=e.replaceAll(/\/\*[\s\S]*?\*\//g,"");let o=0;for(;o<r.length;){const i=r.indexOf("@theme",o);if(i===-1)break;const s=r.indexOf("{",i);if(s===-1)break;let a=1,n=s+1;for(;n<r.length&&a>0;)r[n]==="{"?a++:r[n]==="}"&&a--,n++;const c=r.slice(s+1,n-1),m=/(--[\w-]+)\s*:\s*([\s\S]*?);/g;let l;for(;(l=m.exec(c))!==null;){const y=l[2].replaceAll(/\s+/g," ").trim();y&&!t[l[1]]&&(t[l[1]]=y)}o=n}return t},"parseThemeVariables"),k=p(async e=>{const t=[],r=p(async(o,i)=>{if(i>4)return;let s;try{s=await g.readdir(o,{encoding:"utf8",withFileTypes:!0})}catch{return}for(const a of s){const n=v.join(o,a.name);if(a.isDirectory()){if(a.name==="node_modules"||a.name===".git"||a.name==="dist")continue;await r(n,i+1)}else if(a.name.endsWith(".css"))try{const c=await g.readFile(n,"utf8");c.includes("@import")&&(c.includes('"tailwindcss"')||c.includes("'tailwindcss'"))&&t.push(n)}catch{}}},"walk");return await r(e,0),t},"findTailwindCSSFiles"),x=p(async e=>{const t={};for(const r of e)try{const o=(await g.readFile(r,"utf8")).replaceAll(/@theme\s+default[^{]*\{[\s\S]*?\}/g,""),i=w(o);Object.assign(t,i)}catch{}return t},"extractUserTheme"),E=p(async e=>{const{root:t}=e.config;let r="unknown",o={};const i=["tailwind.config.js","tailwind.config.ts","tailwind.config.mjs","tailwind.config.cjs"];for(const n of i)try{await g.access(v.join(t,n)),r="v3";break}catch{}try{const n=T(import.meta.url).resolve("tailwindcss/theme.css"),c=await g.readFile(n,"utf8");o=w(c),Object.keys(o).length>0&&r!=="v3"&&(r="v4")}catch{}const s=await k(t),a=await x(s);return{cssFiles:s.map(n=>v.relative(t,n)),customTheme:a,defaultTheme:o,version:r}},"getTailwindConfig");var R=Object.defineProperty,G=d((e,t)=>R(e,"name",{value:t,configurable:!0}),"t");const V=G(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 q=Object.defineProperty,u=d((e,t)=>q(e,"name",{value:t,configurable:!0}),"e");const D=u((e,t={})=>({getModuleGraph:u(async()=>$(e),"getModuleGraph"),getTailwindConfig:u(async()=>E(e),"getTailwindConfig"),getViteConfig:u(async()=>V(e),"getViteConfig"),openInEditor:u(async(r,o,i)=>S(e,r,o,i,t.editor),"openInEditor"),readFile:u(async r=>{const{readFile:o}=await import("node:fs/promises"),i=r.startsWith("/")?r:`${e.config.root}/${r}`;return o(i,"utf-8")},"readFile")}),"createDefaultServerFunctions"),U=u((e,t,r={})=>{const o={...D(e,r),...t};return e.ws.on("dev-toolbar:rpc",async(i,s)=>{const{args:a,id:n,method:c}=i,m=o[c];if(!m){s.send("dev-toolbar:rpc:error",{error:`Unknown RPC method: ${c}`,id:n});return}try{const l=await m(...a);s.send("dev-toolbar:rpc:response",{id:n,result:l})}catch(l){s.send("dev-toolbar:rpc:error",{error:l instanceof Error?l.message:String(l),id:n})}}),{callClient(i,...s){e.ws.send({data:{args:s,method:i},event:"dev-toolbar:client",type:"custom"})},registerFunction(i,s){o[i]=s},server:e}},"createServerRPCContext");export{U as createServerRPCContext};