@visulima/dev-toolbar 1.0.0-alpha.2 → 1.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +249 -0
- package/LICENSE.md +137 -5
- package/README.md +70 -43
- package/bin/mcp.js +29 -0
- package/dist/apps/a11y/index.d.ts +3 -2
- package/dist/apps/a11y/index.js +3 -3
- package/dist/apps/annotations/index.d.ts +4 -0
- package/dist/apps/annotations/index.js +18 -0
- package/dist/apps/assets/index.d.ts +4 -0
- package/dist/apps/assets/index.js +16 -0
- package/dist/apps/inspector/index.d.ts +4 -0
- package/dist/apps/inspector/index.js +30 -0
- package/dist/apps/module-graph/index.d.ts +3 -2
- package/dist/apps/module-graph/index.js +2 -2
- package/dist/apps/performance/index.d.ts +3 -2
- package/dist/apps/performance/index.js +2 -2
- package/dist/apps/seo/index.d.ts +3 -2
- package/dist/apps/seo/index.js +2 -2
- package/dist/apps/settings/index.d.ts +3 -2
- package/dist/apps/settings/index.js +2 -2
- package/dist/apps/tailwind/index.d.ts +4 -0
- package/dist/apps/tailwind/index.js +7 -0
- package/dist/apps/timeline/index.d.ts +3 -2
- package/dist/apps/timeline/index.js +2 -2
- package/dist/apps/vite-config/index.d.ts +3 -2
- package/dist/apps/vite-config/index.js +2 -2
- package/dist/client/overlay.d.ts +1 -1
- package/dist/client/overlay.js +1 -1
- package/dist/index.d.ts +143 -6
- package/dist/index.js +1 -1
- package/dist/mcp/server.d.ts +2 -0
- package/dist/mcp/server.js +1 -0
- package/dist/packem_chunks/inject-source.js +9 -0
- package/dist/packem_shared/Alert-D2CvX4fw.js +1 -0
- package/dist/packem_shared/Badge-BEgU04nl.js +1 -0
- package/dist/packem_shared/Button-Bkx66Co7.js +1 -0
- package/dist/packem_shared/Card-CJa4vHVc.js +1 -0
- package/dist/packem_shared/Icon-B6UHkC0o.js +1 -0
- package/dist/packem_shared/Input-Cs6aduTi.js +1 -0
- package/dist/packem_shared/Label-DyCng4Cp.js +1 -0
- package/dist/packem_shared/Popover-BtFVaZYg.js +1 -0
- package/dist/packem_shared/Progress-DN6zn-0l.js +1 -0
- package/dist/packem_shared/Select-DgQ4ss-s.js +1 -0
- package/dist/packem_shared/Separator-D38mKeZv.js +1 -0
- package/dist/packem_shared/Skeleton-Dv-tcA1P.js +1 -0
- package/dist/packem_shared/Switch-C3NTpeoR.js +1 -0
- package/dist/packem_shared/Tabs-DKWMiawt.js +1 -0
- package/dist/packem_shared/Textarea-Yfg3dLZi.js +1 -0
- package/dist/packem_shared/Tooltip-CioncSXj.js +1 -0
- package/dist/packem_shared/annotation-settings-Bv0TH4WI.js +1 -0
- package/dist/packem_shared/annotation-store-bLQRYMaI.js +1 -0
- package/dist/packem_shared/app.d-SmKEDxsI.d.ts +229 -0
- package/dist/packem_shared/clsx-wGlvpUfw.js +1 -0
- package/dist/packem_shared/createClientRPCContext-DgRxrllw.js +1 -0
- package/dist/packem_shared/createDevToolbarHook-4bZZiHPI.js +1 -0
- package/dist/packem_shared/createServerRPCContext-D-yZrEjs.js +1 -0
- package/dist/packem_shared/getTimelineStore-B1cfjWV8.js +1 -0
- package/dist/packem_shared/global-api.d-BLfn-OUA.d.ts +547 -0
- package/dist/packem_shared/{setupGlobalHook-CFuxsCyl.js → setupGlobalHook-CCf9Logv.js} +1 -1
- package/dist/packem_shared/sharedToolbarStylesheet-Bx1muJAh.js +2 -0
- package/dist/packem_shared/store-DaUtLjf3.js +1 -0
- package/dist/packem_shared/use-frame-state-CxrlPUM5.js +1 -0
- package/dist/packem_shared/use-theme-zpm4zmqP.js +1 -0
- package/dist/toolbar/index.d.ts +152 -56
- package/dist/toolbar/index.js +3 -4
- package/dist/ui/index.d.ts +382 -0
- package/dist/ui/index.js +1 -0
- package/dist/vite-plugin.d.ts +155 -103
- package/dist/vite-plugin.js +5 -2
- package/package.json +53 -14
- package/dist/apps/a11y/a11y-app.d.ts +0 -5
- package/dist/apps/a11y/a11y-store.d.ts +0 -46
- package/dist/apps/a11y/a11y-tooltip.d.ts +0 -11
- package/dist/apps/module-graph/module-graph-app.d.ts +0 -5
- package/dist/apps/more/index.d.ts +0 -3
- package/dist/apps/more/index.js +0 -19
- package/dist/apps/more/more-app.d.ts +0 -5
- package/dist/apps/performance/performance-app.d.ts +0 -5
- package/dist/apps/performance/performance-tooltip.d.ts +0 -5
- package/dist/apps/seo/seo-app.d.ts +0 -5
- package/dist/apps/settings/settings-app.d.ts +0 -5
- package/dist/apps/timeline/timeline-app.d.ts +0 -5
- package/dist/apps/vite-config/vite-config-app.d.ts +0 -5
- package/dist/hooks/create-hook.d.ts +0 -10
- package/dist/hooks/events.d.ts +0 -5
- package/dist/hooks/global-hook.d.ts +0 -15
- package/dist/hooks/index.d.ts +0 -6
- package/dist/packem_shared/TimelineStore-BgBrirKd.js +0 -1
- package/dist/packem_shared/cn-BEsR6GkP.js +0 -1
- package/dist/packem_shared/createClientRPCContext-DzKQpKTk.js +0 -1
- package/dist/packem_shared/createDevToolbarHook-DGNxqk8N.js +0 -1
- package/dist/packem_shared/createServerRPCContext-BVSesPXu.js +0 -1
- package/dist/packem_shared/icon-BUQ92HaT.js +0 -1
- package/dist/packem_shared/store-BxE0w51s.js +0 -1
- package/dist/performance/monitor.d.ts +0 -115
- package/dist/rpc/client.d.ts +0 -7
- package/dist/rpc/functions/module-graph.d.ts +0 -17
- package/dist/rpc/functions/open-in-editor.d.ts +0 -9
- package/dist/rpc/functions/vite-config.d.ts +0 -7
- package/dist/rpc/index.d.ts +0 -8
- package/dist/rpc/server.d.ts +0 -9
- package/dist/timeline/index.d.ts +0 -6
- package/dist/timeline/store.d.ts +0 -52
- package/dist/toolbar/app-manager.d.ts +0 -95
- package/dist/toolbar/components/app-button.d.ts +0 -19
- package/dist/toolbar/components/app-canvas.d.ts +0 -13
- package/dist/toolbar/components/app-tooltip-overlay.d.ts +0 -13
- package/dist/toolbar/components/first-visit-hint.d.ts +0 -16
- package/dist/toolbar/components/index.d.ts +0 -4
- package/dist/toolbar/components/pinned-tooltip-card.d.ts +0 -23
- package/dist/toolbar/components/toolbar-bar.d.ts +0 -15
- package/dist/toolbar/components/toolbar-container.d.ts +0 -55
- package/dist/toolbar/components/vite-overlay-button.d.ts +0 -15
- package/dist/toolbar/context/index.d.ts +0 -2
- package/dist/toolbar/context/toolbar-context.d.ts +0 -106
- package/dist/toolbar/global-api.d.ts +0 -23
- package/dist/toolbar/helpers.d.ts +0 -6
- package/dist/toolbar/hooks/index.d.ts +0 -10
- package/dist/toolbar/hooks/use-apps.d.ts +0 -13
- package/dist/toolbar/hooks/use-frame-state.d.ts +0 -94
- package/dist/toolbar/hooks/use-panel-visible.d.ts +0 -21
- package/dist/toolbar/hooks/use-position.d.ts +0 -22
- package/dist/toolbar/hooks/use-theme.d.ts +0 -13
- package/dist/toolbar/hooks/use-toolbar.d.ts +0 -14
- package/dist/toolbar/settings.d.ts +0 -17
- package/dist/toolbar/stylesheet.d.ts +0 -1
- package/dist/toolbar/utils/index.d.ts +0 -12
- package/dist/types/app.d.ts +0 -163
- package/dist/types/global-api.d.ts +0 -95
- package/dist/types/hooks.d.ts +0 -88
- package/dist/types/index.d.ts +0 -12
- package/dist/types/messaging.d.ts +0 -43
- package/dist/types/rpc.d.ts +0 -95
- package/dist/types/timeline.d.ts +0 -62
- package/dist/types/toolbar.d.ts +0 -56
- package/dist/ui/components/icon.d.ts +0 -21
- package/dist/utils/cn.d.ts +0 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var n=(e,r)=>c(e,"name",{value:r,configurable:!0});import{clsx as s}from"./clsx-wGlvpUfw.js";import{jsx as l}from"preact/jsx-runtime";var d=Object.defineProperty,i=n((e,r)=>d(e,"name",{value:r,configurable:!0}),"s");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{clsx as s}from"./clsx-wGlvpUfw.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{clsx as s}from"./clsx-wGlvpUfw.js";import{jsx as a}from"preact/jsx-runtime";var c=Object.defineProperty,l=t((e,r)=>c(e,"name",{value:r,configurable:!0}),"r");const g={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"},x=l(({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",g[i],f[o],r),type:n,...u,children:e}),"Button");export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=Object.defineProperty;var l=(e,r)=>i(e,"name",{value:r,configurable:!0});import{clsx as d}from"./clsx-wGlvpUfw.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"),f=c(({children:e,class:r,...a})=>s("h3",{class:d("font-semibold leading-none tracking-tight",r),...a,children:e}),"CardTitle"),m=c(({children:e,class:r,...a})=>s("div",{class:d("text-sm text-muted-foreground",r),...a,children:e}),"CardDescription"),x=c(({children:e,class:r,...a})=>s("div",{class:d("p-6 pt-0",r),...a,children:e}),"CardContent"),v=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,x as CardContent,m as CardDescription,v as CardFooter,p as CardHeader,f as CardTitle};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=Object.defineProperty;var t=(a,e)=>o(a,"name",{value:e,configurable:!0});import{clsx as s}from"./clsx-wGlvpUfw.js";import{jsx as i}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})=>i("span",{class:s("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{clsx as s}from"./clsx-wGlvpUfw.js";import{forwardRef as i}from"preact/compat";import{jsx as l}from"preact/jsx-runtime";const n=i(({class:o,type:e="text",...r},t)=>l("input",{class:s("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}));n.displayName="Input";export{n as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=Object.defineProperty;var l=(e,a)=>o(e,"name",{value:a,configurable:!0});import{clsx as t}from"./clsx-wGlvpUfw.js";import{jsx as s}from"preact/jsx-runtime";var d=Object.defineProperty,i=l((e,a)=>d(e,"name",{value:a,configurable:!0}),"l");const p=i(({children:e,class:a,...r})=>s("label",{class:t("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",a),...r,children:e}),"Label");export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var R=Object.defineProperty;var P=(e,o)=>R(e,"name",{value:o,configurable:!0});import{addHookName as v}from"preact/devtools";import{computePosition as k,offset as E,flip as $,shift as j}from"@floating-ui/dom";import{clsx as g}from"./clsx-wGlvpUfw.js";import{createContext as z}from"preact";import{useState as b,useRef as y,useEffect as C,useContext as H}from"preact/hooks";import{jsx as f}from"preact/jsx-runtime";var L=Object.defineProperty,r=P((e,o)=>L(e,"name",{value:o,configurable:!0}),"o");const O=z(void 0),h=r(()=>{const e=H(O);if(!e)throw new Error("Popover subcomponent must be used within <Popover>");return e},"usePopoverContext"),q=r(({children:e,defaultOpen:o,onOpenChange:i,open:n})=>{const s=n!==void 0,[u,t]=v(b(o??!1),"internalOpen"),a=s?n:u,c=v(y(null),"triggerRef"),p=r(d=>{s||t(d),i?.(d)},"setOpen");return f(O.Provider,{value:{open:a,setOpen:p,triggerRef:c},children:f("span",{style:{display:"contents"},children:e})})},"Popover"),A=r(({children:e,class:o,...i})=>{const{open:n,setOpen:s,triggerRef:u}=h(),t=r(a=>{u.current=a},"handleRef");return f("button",{"aria-expanded":n,class:g("",o),onClick:r(()=>{i.disabled||s(!n)},"onClick"),ref:t,type:"button",...i,children:e})},"PopoverTrigger"),B=r(({align:e="center",children:o,class:i,side:n="bottom",sideOffset:s=4,...u})=>{const{open:t,setOpen:a,triggerRef:c}=h(),p=v(y(null),"contentRef"),[d,w]=v(b({x:0,y:0}),"position");if(C(()=>{if(!t||!c.current||!p.current)return;const m=e==="center"?n:`${n}-${e}`;k(c.current,p.current,{middleware:[E(s),$(),j({padding:4})],placement:m}).then(l=>(w({x:l.x,y:l.y}),l)).catch(()=>{})},[t,n,s,e,c]),C(()=>{if(!t)return;const m=r(l=>{if(p.current&&!p.current.contains(l.target)){const x=c.current;if(x&&x.contains(l.target))return;a(!1)}},"handleMouseDown");return document.addEventListener("mousedown",m),()=>{document.removeEventListener("mousedown",m)}},[t,a,c]),!!t)return f("div",{class:g("z-50 w-72 rounded-none border bg-popover p-4 text-popover-foreground shadow-md outline-none animate-in fade-in-0 zoom-in-95",i),ref:p,role:"dialog",style:{left:`${d.x}px`,position:"fixed",top:`${d.y}px`},...u,children:o})},"PopoverContent"),F=r(({children:e,class:o,...i})=>{const{setOpen:n}=h();return f("button",{class:g("",o),onClick:r(()=>{n(!1)},"onClick"),type:"button",...i,children:e})},"PopoverClose");export{q as Popover,F as PopoverClose,B as PopoverContent,A as PopoverTrigger};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=Object.defineProperty;var e=(a,r)=>i(a,"name",{value:r,configurable:!0});import{clsx as o}from"./clsx-wGlvpUfw.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 m=n(({class:a,value:r,...s})=>l("div",{"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":r??0,class:o("relative h-2 w-full overflow-hidden rounded-none bg-primary/20",a),role:"progressbar",...s,children:l("div",{class:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(r??0)}%)`}})}),"Progress");export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var X=Object.defineProperty;var q=(e,l)=>X(e,"name",{value:l,configurable:!0});import{addHookName as u}from"preact/devtools";import{computePosition as F,offset as G,flip as Q,shift as Y}from"@floating-ui/dom";import{clsx as k}from"./clsx-wGlvpUfw.js";import{createContext as Z}from"preact";import{useState as w,useRef as S,useCallback as _,useEffect as C,useMemo as ee,useContext as te}from"preact/hooks";import{jsx as f,jsxs as T}from"preact/jsx-runtime";var re=Object.defineProperty,n=q((e,l)=>re(e,"name",{value:l,configurable:!0}),"r");const U=Z(void 0),D=n(()=>{const e=te(U);if(!e)throw new Error("Select subcomponent must be used within <Select>");return e},"useSelectContext");let K=0;const de=n(({children:e,onValueChange:l,value:o=""})=>{const[t,a]=u(w(!1),"open"),[d,c]=u(w(""),"search"),[g,r]=u(w(null),"highlightedValue"),x=u(S(null),"triggerRef"),[m]=u(w(()=>(K+=1,`select-${K}`)),"instanceId"),v=_(i=>{l?.(i),a(!1),c("")},[l]);C(()=>{t||(c(""),r(null))},[t]);const R=u(ee(()=>({highlightedValue:g,instanceId:m,onSelect:v,open:t,search:d,setHighlightedValue:r,setOpen:a,setSearch:c,triggerRef:x,value:o}),[g,m,v,t,d,o]),"contextValue");return f(U.Provider,{value:R,children:f("span",{style:{display:"contents"},children:e})})},"Select"),fe=n(({children:e,class:l,...o})=>{const{open:t,setOpen:a,triggerRef:d}=D();return T("button",{"aria-expanded":t,"aria-haspopup":"listbox",class:k("inline-flex items-center justify-between gap-2","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",l),onClick:n(()=>{a(!t)},"onClick"),ref:n(c=>{d.current=c},"ref"),type:"button",...o,children:[e,f("svg",{"aria-hidden":"true",class:k("h-3 w-3 shrink-0 opacity-60 transition-transform duration-150",t&&"rotate-180"),fill:"none",stroke:"currentColor","stroke-width":"2",viewBox:"0 0 24 24",children:f("path",{d:"m6 9 6 6 6-6"})})]})},"SelectTrigger"),pe=n(({class:e,options:l,placeholder:o="Select…"})=>{const{value:t}=D(),a=l.find(d=>d.value===t);return f("span",{class:k("truncate",!a&&"text-muted-foreground",e),children:a?a.label:o})},"SelectValue"),ne=n(e=>[...e.querySelectorAll("[role='option']:not([aria-disabled='true'])")],"getOptionElements"),N=n(e=>e.dataset.value??null,"getOptionValue"),he=n(({align:e="start",children:l,class:o,searchable:t=!1,side:a="bottom",sideOffset:d=4})=>{const{highlightedValue:c,instanceId:g,open:r,search:x,setHighlightedValue:m,setOpen:v,setSearch:R,triggerRef:i}=D(),y=u(S(null),"contentRef"),O=u(S(null),"searchInputRef"),I=u(S(null),"listRef"),[j,J]=u(w({x:0,y:0}),"position"),[W,L]=u(w(!1),"ready"),A=u(S(c),"highlightedRef");if(A.current=c,C(()=>{if(!r||!i.current||!y.current){L(!1);return}let p=!1;const s=e==="center"?a:`${a}-${e}`;return F(i.current,y.current,{middleware:[G(d),Q(),Y({padding:4})],placement:s}).then(h=>(p||(J({x:h.x,y:h.y}),L(!0)),h)).catch(()=>{}),()=>{p=!0}},[r,a,d,e,i]),C(()=>{r&&(t&&O.current?O.current.focus():I.current&&I.current.focus())},[r,t]),C(()=>{if(!r)return;const p=n(s=>{if(y.current&&!y.current.contains(s.target)){const h=i.current;if(h&&h.contains(s.target))return;v(!1)}},"handleMouseDown");return document.addEventListener("mousedown",p),()=>{document.removeEventListener("mousedown",p)}},[r,v,i]),C(()=>{if(!r)return;const p=n(s=>{const h=I.current;if(!h)return;const E=ne(h),V=E.length;if(V===0){s.key==="Escape"&&(s.preventDefault(),v(!1),i.current?.focus());return}const z=A.current,b=z===null?-1:E.findIndex(M=>N(M)===z),$=n(M=>{const H=E[M];if(H){const P=N(H);P!==null&&m(P),H.scrollIntoView?.({block:"nearest"})}},"highlightByIndex");switch(s.key){case"ArrowDown":{s.preventDefault(),$(b<V-1?b+1:0);break}case"ArrowUp":{s.preventDefault(),$(b>0?b-1:V-1);break}case"End":{s.preventDefault(),$(V-1);break}case"Enter":{s.preventDefault(),b>=0&&E[b]?.click();break}case"Escape":case"Tab":{s.preventDefault(),v(!1),i.current?.focus();break}case"Home":{s.preventDefault(),$(0);break}}},"handleKeyDown");return document.addEventListener("keydown",p),()=>{document.removeEventListener("keydown",p)}},[r,m,v,i]),!r)return;const B=c===null?void 0:`${g}-option-${c}`;return T("div",{class:k("z-50 min-w-[8rem] overflow-hidden border border-border bg-popover text-popover-foreground shadow-md","animate-in fade-in-0 zoom-in-95",!W&&"invisible",o),ref:y,style:{left:`${j.x}px`,position:"fixed",top:`${j.y}px`,width:i.current?`${Math.max(i.current.offsetWidth,128)}px`:void 0},children:[t&&f("div",{class:"border-b border-border p-1.5",children:f("input",{"aria-activedescendant":B,"aria-controls":`${g}-listbox`,"aria-label":"Search options",class:k("w-full bg-transparent text-[0.75rem] text-foreground placeholder:text-muted-foreground","px-1.5 py-1 border-0 outline-none"),onInput:n(p=>{R(p.currentTarget.value),m(null)},"onInput"),placeholder:"Search…",ref:O,role:"combobox",type:"text",value:x})}),f("div",{...!t&&{"aria-activedescendant":B,tabIndex:0},class:"max-h-[min(300px,var(--available-height,300px))] overflow-y-auto scrollbar-thin-border p-1",id:`${g}-listbox`,ref:I,role:"listbox",children:l})]})},"SelectContent"),ge=n(({children:e,class:l,value:o})=>{const{highlightedValue:t,instanceId:a,onSelect:d,setHighlightedValue:c,value:g}=D(),r=g===o,x=t===o,m=`${a}-option-${o}`;return T("div",{"aria-selected":r,class:k("relative flex cursor-pointer select-none items-center gap-2","text-[0.775rem] py-1.5 px-2","transition-colors duration-75",x&&"bg-accent text-accent-foreground",r&&"font-medium",!x&&!r&&"text-foreground",!x&&"hover:bg-accent/50",l),"data-value":o,id:m,onClick:n(()=>{d(o)},"onClick"),onMouseEnter:n(()=>{c(o)},"onMouseEnter"),role:"option",children:[f("span",{class:"flex-1 truncate",children:e}),r&&f("svg",{"aria-hidden":"true",class:"h-3.5 w-3.5 shrink-0",fill:"none",stroke:"currentColor","stroke-width":"2.5",viewBox:"0 0 24 24",children:f("path",{d:"M20 6 9 17l-5-5"})})]})},"SelectItem");export{de as Select,he as SelectContent,ge as SelectItem,fe as SelectTrigger,pe as SelectValue,D as useSelectContext};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=Object.defineProperty;var a=(r,o)=>i(r,"name",{value:o,configurable:!0});import{clsx as l}from"./clsx-wGlvpUfw.js";import{jsx as s}from"preact/jsx-runtime";var p=Object.defineProperty,c=a((r,o)=>p(r,"name",{value:o,configurable:!0}),"a");const h=c(({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{h as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o=Object.defineProperty;var a=(e,r)=>o(e,"name",{value:r,configurable:!0});import{clsx as s}from"./clsx-wGlvpUfw.js";import{jsx as t}from"preact/jsx-runtime";var l=Object.defineProperty,n=a((e,r)=>l(e,"name",{value:r,configurable:!0}),"s");const p=n(({class:e,...r})=>t("div",{class:s("animate-pulse rounded-none bg-primary/10",e),...r}),"Skeleton");export{p 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{clsx as s}from"./clsx-wGlvpUfw.js";import{useState as v}from"preact/hooks";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{clsx as u}from"./clsx-wGlvpUfw.js";import{createContext as x}from"preact";import{useState as C,useContext as k}from"preact/hooks";import{jsx as a}from"preact/jsx-runtime";var V=Object.defineProperty,s=b((e,n)=>V(e,"name",{value:n,configurable:!0}),"s");const f=x(void 0),g=s(()=>{const e=k(f);if(!e)throw new Error("Tabs subcomponent must be used within <Tabs>");return e},"useTabsContext"),E=s(({children:e,class:n,defaultValue:i,onValueChange:t,value:r,...c})=>{const l=r!==void 0,[o,v]=T(C(i??""),"internalValue"),m=l?r:o,h=s(d=>{l||v(d),t?.(d)},"handleValueChange");return a(f.Provider,{value:{onValueChange:h,value:m},children:a("div",{class:u("",n),...c,children:e})})},"Tabs"),H=s(({children:e,class:n,...i})=>a("div",{class:u("inline-flex h-9 items-center justify-center rounded-none bg-muted p-1 text-muted-foreground",n),role:"tablist",...i,children:e}),"TabsList"),J=s(({children:e,class:n,disabled:i,value:t,...r})=>{const{onValueChange:c,value:l}=g(),o=l===t;return a("button",{"aria-selected":o,class:u("inline-flex items-center justify-center whitespace-nowrap rounded-none px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",o?"bg-background text-foreground shadow":"hover:bg-background/50",n),"data-state":o?"active":"inactive",disabled:i,onClick:s(()=>!i&&c(t),"onClick"),role:"tab",type:"button",...r,children:e})},"TabsTrigger"),N=s(({children:e,class:n,value:i,...t})=>{const{value:r}=g();if(r===i)return a("div",{class:u("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),role:"tabpanel",...t,children:e})},"TabsContent");export{E as Tabs,N as TabsContent,H as TabsList,J as TabsTrigger};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{clsx as s}from"./clsx-wGlvpUfw.js";import{forwardRef as t}from"preact/compat";import{jsx as a}from"preact/jsx-runtime";const i=t(({class:e,...r},o)=>a("textarea",{class:s("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{clsx as w}from"./clsx-wGlvpUfw.js";import{createContext as E}from"preact";import{useState as m,useRef as x,useEffect as M,useContext as O}from"preact/hooks";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 g=E(void 0),h=r(()=>{const e=O(g);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(x(null),"triggerRef");return p(g.Provider,{value:{open:n,setOpen:o,triggerRef:i},children:p("span",{style:{display:"contents"},children:e})})},"Tooltip"),N=r(({children:e,class:t,...n})=>{const{setOpen:o,triggerRef:i}=h();return p("span",{class:t,onMouseEnter:r(()=>{o(!0)},"onMouseEnter"),onMouseLeave:r(()=>{o(!1)},"onMouseLeave"),ref:r(s=>{i.current=s},"handleRef"),...n,children:e})},"TooltipTrigger"),q=r(({children:e,class:t,side:n="top",sideOffset:o=4,...i})=>{const{open:s,triggerRef:a}=h(),c=l(x(null),"contentRef"),[u,y]=l(m({x:0,y:0}),"position");if(M(()=>{!s||!a.current||!c.current||v(a.current,c.current,{middleware:[R(o),b(),C({padding:4})],placement:n}).then(f=>(y({x:f.x,y:f.y}),f)).catch(()=>{})},[s,n,o,a]),!!s)return p("div",{class:w("z-50 rounded-none bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95",t),ref:c,role:"tooltip",style:{left:`${u.x}px`,position:"fixed",top:`${u.y}px`},...i,children:e})},"TooltipContent");export{D as Tooltip,q as TooltipContent,N as TooltipTrigger};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var i=Object.defineProperty;var t=(e,a)=>i(e,"name",{value:a,configurable:!0});var f=Object.defineProperty,g=t((e,a)=>f(e,"name",{value:a,configurable:!0}),"a");const o="__vdt_annotation_settings",l=[{bg:"#6366f1",border:"#4f46e5",fg:"#fff",highlightBg:"rgba(99,102,241,0.12)",label:"Indigo",name:"indigo"},{bg:"#3b82f6",border:"#2563eb",fg:"#fff",highlightBg:"rgba(59,130,246,0.12)",label:"Blue",name:"blue"},{bg:"#06b6d4",border:"#0891b2",fg:"#fff",highlightBg:"rgba(6,182,212,0.12)",label:"Cyan",name:"cyan"},{bg:"#22c55e",border:"#16a34a",fg:"#fff",highlightBg:"rgba(34,197,94,0.12)",label:"Green",name:"green"},{bg:"#eab308",border:"#ca8a04",fg:"#1a1a1a",highlightBg:"rgba(234,179,8,0.12)",label:"Yellow",name:"yellow"},{bg:"#f97316",border:"#ea580c",fg:"#fff",highlightBg:"rgba(249,115,22,0.12)",label:"Orange",name:"orange"},{bg:"#ef4444",border:"#dc2626",fg:"#fff",highlightBg:"rgba(239,68,68,0.12)",label:"Red",name:"red"}],n={blockInteractions:!0,markerClickBehavior:"detail",markerColorName:"indigo",outputDetail:"standard"};let r;const h=g(()=>{if(r)return r;try{const e=localStorage.getItem(o);if(e){const a=JSON.parse(e);return r={...n,...a},r}}catch{}return r={...n},r},"loadSettings"),c=g(e=>{r=e;try{localStorage.setItem(o,JSON.stringify(e))}catch{}},"saveSettings"),d=g(e=>{const a=e??h();return l.find(b=>b.name===a.markerColorName)??l[0]},"getMarkerColor");export{l as M,d as g,h as l,c as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var h=Object.defineProperty;var l=(s,e)=>h(s,"name",{value:e,configurable:!0});import{createRequire as p}from"node:module";const y=p(import.meta.url),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=l(s=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[e,t]=i.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return i.getBuiltinModule(s)}return y(s)},"__cjs_getBuiltinModule"),a=d("node:fs/promises"),o=d("node:path");var _=Object.defineProperty,r=l((s,e)=>_(s,"name",{value:e,configurable:!0}),"e");const v=".devtoolbar",w="annotations.json",f="screenshots",c=r(s=>{const e=o.join(s,v);return{annotationsFile:o.join(e,w),base:e,screenshotsDir:o.join(e,f)}},"resolvePaths"),m=r((s,e)=>{const t=o.resolve(s),n=o.resolve(e);return t.startsWith(n+o.sep)||t===n},"isPathInsideBase"),g=r(s=>s.replaceAll(/[^a-z0-9-]/gi,""),"sanitizeId"),S=r(async s=>{const{screenshotsDir:e}=c(s);await a.mkdir(e,{recursive:!0})},"ensureStoreDir");let u=Promise.resolve();const A=r(async s=>{const e=u;let t;u=new Promise(n=>{t=n}),await e;try{return await s()}finally{t()}},"withLock"),F=r(async s=>{const{annotationsFile:e}=c(s);try{const t=await a.readFile(e,"utf8"),n=JSON.parse(t);return Array.isArray(n)?n:[]}catch{return[]}},"readAnnotations"),I=r(async(s,e)=>{await S(s);const{annotationsFile:t}=c(s);await a.writeFile(t,JSON.stringify(e,void 0,2),"utf8")},"writeAnnotations"),P=r(async(s,e)=>{if(!e.startsWith(`${f}/`))return;const{base:t}=c(s),n=o.join(t,e);if(m(n,t))try{await a.unlink(n)}catch{}},"deleteScreenshotFile");export{f as S,c as a,I as b,P as d,S as e,m as i,F as r,g as s,A as w};
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { ComponentType } from 'preact';
|
|
2
|
+
/**
|
|
3
|
+
* Toolbar placement options (for backward compatibility)
|
|
4
|
+
*/
|
|
5
|
+
type ToolbarPlacement = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
6
|
+
/**
|
|
7
|
+
* Notification levels
|
|
8
|
+
*/
|
|
9
|
+
type NotificationLevel = "info" | "warning" | "error";
|
|
10
|
+
/**
|
|
11
|
+
* Position anchor (which edge the toolbar is attached to)
|
|
12
|
+
* Matches Vue DevTools positioning
|
|
13
|
+
*/
|
|
14
|
+
type PositionAnchor = "top" | "bottom" | "left" | "right";
|
|
15
|
+
/**
|
|
16
|
+
* Frame state - matches Vue DevTools DevToolsFrameState
|
|
17
|
+
* @see https://github.com/vuejs/devtools/blob/main/packages/overlay/src/composables/state.ts
|
|
18
|
+
*/
|
|
19
|
+
interface FrameState {
|
|
20
|
+
/**
|
|
21
|
+
* Horizontal position as percentage (0-100)
|
|
22
|
+
*/
|
|
23
|
+
left: number;
|
|
24
|
+
/**
|
|
25
|
+
* Whether panel is open
|
|
26
|
+
*/
|
|
27
|
+
open: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Which edge the toolbar is anchored to
|
|
30
|
+
*/
|
|
31
|
+
position: PositionAnchor;
|
|
32
|
+
/**
|
|
33
|
+
* Vertical position as percentage (0-100)
|
|
34
|
+
*/
|
|
35
|
+
top: number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Configuration options controlling the toolbar's initial appearance.
|
|
39
|
+
*/
|
|
40
|
+
interface ToolbarSettings {
|
|
41
|
+
/**
|
|
42
|
+
* Whether toolbar is visible by default
|
|
43
|
+
*/
|
|
44
|
+
defaultVisible: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Toolbar placement on screen
|
|
47
|
+
*/
|
|
48
|
+
placement: ToolbarPlacement;
|
|
49
|
+
/**
|
|
50
|
+
* Whether to show notifications
|
|
51
|
+
*/
|
|
52
|
+
showNotifications: boolean;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Default toolbar settings
|
|
56
|
+
*/
|
|
57
|
+
declare const DEFAULT_TOOLBAR_SETTINGS: ToolbarSettings;
|
|
58
|
+
/**
|
|
59
|
+
* Server helpers available to apps
|
|
60
|
+
*/
|
|
61
|
+
interface ServerHelpers {
|
|
62
|
+
/**
|
|
63
|
+
* RPC client for calling server functions
|
|
64
|
+
*/
|
|
65
|
+
rpc: { [K in keyof ServerFunctions]: ServerFunctions[K] };
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Props passed to app tooltip (hover mini-canvas) components.
|
|
69
|
+
* Keep compact — tooltip components should be lightweight.
|
|
70
|
+
*/
|
|
71
|
+
interface AppTooltipProps {
|
|
72
|
+
/**
|
|
73
|
+
* Server helpers (RPC, etc.)
|
|
74
|
+
*/
|
|
75
|
+
helpers: ServerHelpers;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Event target for app communication
|
|
79
|
+
*/
|
|
80
|
+
interface ToolbarAppEventTarget extends EventTarget {
|
|
81
|
+
/**
|
|
82
|
+
* Dispatch a custom event
|
|
83
|
+
*/
|
|
84
|
+
dispatchEvent: (event: Event) => boolean;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* App view configuration
|
|
88
|
+
*/
|
|
89
|
+
type AppView = {
|
|
90
|
+
/**
|
|
91
|
+
* Render app inline in shadow DOM (default)
|
|
92
|
+
*/
|
|
93
|
+
type: "inline";
|
|
94
|
+
} | {
|
|
95
|
+
/**
|
|
96
|
+
* URL to load in iframe
|
|
97
|
+
*/
|
|
98
|
+
src: string;
|
|
99
|
+
/**
|
|
100
|
+
* Render app in iframe for isolation
|
|
101
|
+
*/
|
|
102
|
+
type: "iframe";
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Props passed to Preact component apps
|
|
106
|
+
*/
|
|
107
|
+
interface AppComponentProps {
|
|
108
|
+
/**
|
|
109
|
+
* Event target for app communication
|
|
110
|
+
*/
|
|
111
|
+
eventTarget: ToolbarAppEventTarget;
|
|
112
|
+
/**
|
|
113
|
+
* Server helpers (RPC, etc.)
|
|
114
|
+
*/
|
|
115
|
+
helpers: ServerHelpers;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Dev toolbar app definition
|
|
119
|
+
*/
|
|
120
|
+
interface DevToolbarApp {
|
|
121
|
+
/**
|
|
122
|
+
* Called before app is toggled off
|
|
123
|
+
* Return false to prevent closing
|
|
124
|
+
* @param canvas Shadow root of the app
|
|
125
|
+
* @returns Whether to allow closing
|
|
126
|
+
*/
|
|
127
|
+
beforeTogglingOff?: (canvas: ShadowRoot) => boolean | Promise<boolean>;
|
|
128
|
+
/**
|
|
129
|
+
* Preact component for rendering (alternative to init)
|
|
130
|
+
* If provided, this will be used instead of init
|
|
131
|
+
*/
|
|
132
|
+
component?: ComponentType<AppComponentProps>;
|
|
133
|
+
/**
|
|
134
|
+
* When true, this app is automatically activated when the toolbar opens for
|
|
135
|
+
* the first time (or when no other app has been activated yet).
|
|
136
|
+
* Only the first registered app with defaultOpen: true is used.
|
|
137
|
+
* @default false
|
|
138
|
+
*/
|
|
139
|
+
defaultOpen?: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* Called when the app is unregistered / removed from the toolbar.
|
|
142
|
+
* Use this for final cleanup (event listeners, timers, subscriptions).
|
|
143
|
+
* @param canvas Shadow root of the app
|
|
144
|
+
*/
|
|
145
|
+
destroy?: (canvas: ShadowRoot) => Promise<void> | void;
|
|
146
|
+
/**
|
|
147
|
+
* Icon HTML string (SVG)
|
|
148
|
+
*/
|
|
149
|
+
icon: string;
|
|
150
|
+
/**
|
|
151
|
+
* Unique identifier for the app
|
|
152
|
+
*/
|
|
153
|
+
id: string;
|
|
154
|
+
/**
|
|
155
|
+
* Initialize the app when opened (vanilla JS/CSS/HTML)
|
|
156
|
+
* @param canvas Shadow root to render into
|
|
157
|
+
* @param eventTarget Event target for app communication
|
|
158
|
+
* @param helpers Server helpers (RPC, etc.)
|
|
159
|
+
*/
|
|
160
|
+
init?: (canvas: ShadowRoot, eventTarget: ToolbarAppEventTarget, helpers: ServerHelpers) => void | Promise<void>;
|
|
161
|
+
/**
|
|
162
|
+
* Display name of the app
|
|
163
|
+
*/
|
|
164
|
+
name: string;
|
|
165
|
+
/**
|
|
166
|
+
* Action button callback — called when the button is activated (active: false → true).
|
|
167
|
+
* When present, clicking the toolbar button will NOT open a panel.
|
|
168
|
+
* Instead the button toggles its active state and calls onClick (activate)
|
|
169
|
+
* or onDeactivate (deactivate).
|
|
170
|
+
*/
|
|
171
|
+
onClick?: () => Promise<void> | void;
|
|
172
|
+
/**
|
|
173
|
+
* Called when the action button is deactivated (active: true → false).
|
|
174
|
+
* Only meaningful when onClick is also provided.
|
|
175
|
+
*/
|
|
176
|
+
onDeactivate?: () => Promise<void> | void;
|
|
177
|
+
/**
|
|
178
|
+
* Optional hover tooltip component — renders a compact live preview when the
|
|
179
|
+
* user hovers over this app's button in the toolbar pill.
|
|
180
|
+
* The component should be small (≤280px wide) and self-contained.
|
|
181
|
+
* If omitted, hovering shows the native title tooltip only.
|
|
182
|
+
*/
|
|
183
|
+
tooltip?: ComponentType<AppTooltipProps>;
|
|
184
|
+
/**
|
|
185
|
+
* App rendering mode
|
|
186
|
+
*/
|
|
187
|
+
view?: AppView;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Internal app state (extends DevToolbarApp)
|
|
191
|
+
*/
|
|
192
|
+
interface DevToolbarAppState extends DevToolbarApp {
|
|
193
|
+
/**
|
|
194
|
+
* Whether the app is currently active/open
|
|
195
|
+
*/
|
|
196
|
+
active: boolean;
|
|
197
|
+
/**
|
|
198
|
+
* Whether this is a built-in app
|
|
199
|
+
*/
|
|
200
|
+
builtIn: boolean;
|
|
201
|
+
/**
|
|
202
|
+
* Event target for this app
|
|
203
|
+
*/
|
|
204
|
+
eventTarget: ToolbarAppEventTarget;
|
|
205
|
+
/**
|
|
206
|
+
* Notification state
|
|
207
|
+
*/
|
|
208
|
+
notification: {
|
|
209
|
+
/**
|
|
210
|
+
* Notification level
|
|
211
|
+
*/
|
|
212
|
+
level?: NotificationLevel;
|
|
213
|
+
/**
|
|
214
|
+
* Whether notification is active
|
|
215
|
+
*/
|
|
216
|
+
state: boolean;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* App initialization status
|
|
220
|
+
*/
|
|
221
|
+
status: "ready" | "loading" | "pending" | "error";
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Placeholder for ServerFunctions (defined in rpc.ts)
|
|
225
|
+
*/
|
|
226
|
+
interface ServerFunctions {
|
|
227
|
+
[key: string]: (...args: any[]) => Promise<any>;
|
|
228
|
+
}
|
|
229
|
+
export { AppView as A, DevToolbarApp as D, FrameState as F, NotificationLevel as N, PositionAnchor as P, ServerFunctions as S, ToolbarSettings as T, DevToolbarAppState as a, DEFAULT_TOOLBAR_SETTINGS as b, ServerHelpers as c, ToolbarAppEventTarget as d, ToolbarPlacement as e };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var u=Object.defineProperty;var n=(e,t)=>u(e,"name",{value:t,configurable:!0});var l=Object.defineProperty,i=n((e,t)=>l(e,"name",{value:t,configurable:!0}),"a");function o(e){var t,a,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var f=e.length;for(t=0;t<f;t++)e[t]&&(a=o(e[t]))&&(r&&(r+=" "),r+=a)}else for(a in e)e[a]&&(r&&(r+=" "),r+=a);return r}n(o,"e");i(o,"r");function s(){for(var e,t,a=0,r="",f=arguments.length;a<f;a++)(e=arguments[a])&&(t=o(e))&&(r&&(r+=" "),r+=t);return r}n(s,"clsx");i(s,"clsx");export{s as clsx,s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s=Object.defineProperty;var c=(a,n)=>s(a,"name",{value:n,configurable:!0});var m=Object.defineProperty,d=c((a,n)=>m(a,"name",{value:n,configurable:!0}),"o");const p=d(a=>{const n={onConfigChange:d(()=>{},"onConfigChange"),onHMRUpdate:d(()=>{},"onHMRUpdate"),onModuleUpdate:d(()=>{},"onModuleUpdate"),...a},o=new Map;return globalThis.window!==void 0&&import.meta.hot&&(import.meta.hot.on("dev-toolbar:rpc:response",e=>{const t=o.get(e.id);t&&(o.delete(e.id),t.resolve(e.result))}),import.meta.hot.on("dev-toolbar:rpc:error",e=>{const t=o.get(e.id);t&&(o.delete(e.id),t.reject(new Error(e.error)))}),import.meta.hot.on("dev-toolbar:client",e=>{const{args:t,method:r}=e,i=n[r];if(i)try{i(...t)}catch(l){console.error(`[dev-toolbar] Error calling client function ${r}:`,l)}})),{async callServer(e,...t){if(globalThis.window===void 0||!import.meta.hot)throw new Error("RPC calls can only be made in browser environment with HMR");const r=`${Date.now()}-${Math.random().toString(36).slice(7)}`;return new Promise((i,l)=>{o.set(r,{reject:l,resolve:i}),setTimeout(()=>{o.has(r)&&(o.delete(r),l(new Error(`RPC call timeout: ${e}`)))},3e4),import.meta.hot.send("dev-toolbar:rpc",{args:t,id:r,method:e})})},registerFunction(e,t){n[e]=t}}},"createClientRPCContext");export{p as createClientRPCContext,p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=Object.defineProperty;var l=(n,a)=>d(n,"name",{value:a,configurable:!0});var f=Object.defineProperty,s=l((n,a)=>f(n,"name",{value:a,configurable:!0}),"d");const g=s((n,a)=>{const r=new Map;return{addTimelineEvent(e,t){a&&a(e,t),this.emit("timeline:event",t)},emit(e,...t){const o=r.get(e);if(o)for(const i of o)try{i(...t)}catch(c){console.error(`[dev-toolbar] Error in hook handler for ${String(e)}:`,c)}},off(e,t){const o=r.get(e);o&&(t?(o.delete(t),o.size===0&&r.delete(e)):r.delete(e))},on(e,t){return r.has(e)||r.set(e,new Set),r.get(e).add(t),()=>{const o=r.get(e);o&&(o.delete(t),o.size===0&&r.delete(e))}},once(e,t){const o=s(((...i)=>{t(...i),this.off(e,o)}),"onceHandler");this.on(e,o)},registerApp(e){n&&n(e)}}},"createDevToolbarHook");export{g as createDevToolbarHook,g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var B=Object.defineProperty;var f=(r,e)=>B(r,"name",{value:e,configurable:!0});import{createRequire as _}from"node:module";import{r as b,w as j,b as A,d as F,e as R,a as E,s as W,i as I,S as O}from"./annotation-store-bLQRYMaI.js";import{normalizePath as $}from"vite";const L=_(import.meta.url),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=f(r=>{if(typeof v<"u"&&v.versions&&v.versions.node){const[e,t]=v.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return v.getBuiltinModule(r)}return L(r)},"__cjs_getBuiltinModule"),p=x("node:fs/promises"),m=x("node:path"),{createRequire:U}=x("node:module");var q=Object.defineProperty,h=f((r,e)=>q(r,"name",{value:e,configurable:!0}),"l");const G=h(async r=>b(r.config.root),"getAnnotations"),N=h(async(r,e)=>j(async()=>{const{root:t}=r.config,s=new Date().toISOString(),a={accessibility:e.accessibility,boundingBox:e.boundingBox,comment:e.comment,computedStyles:e.computedStyles,createdAt:s,cssClasses:e.cssClasses,elementBoundingBoxes:e.elementBoundingBoxes,elementLabel:e.elementLabel,elementPath:e.elementPath,elementTag:e.elementTag,frameworkContext:e.frameworkContext,fullPath:e.fullPath,id:crypto.randomUUID(),intent:e.intent,isFixed:e.isFixed,isMultiSelect:e.isMultiSelect,nearbyElements:e.nearbyElements,nearbyText:e.nearbyText,screenshot:e.screenshot,selectedText:e.selectedText,severity:e.severity,source:e.source,status:"pending",updatedAt:s,url:e.url,x:e.x,y:e.y},n=await b(t);return n.push(a),await A(t,n),a}),"createAnnotation"),V=h(async(r,e,t)=>j(async()=>{const{root:s}=r.config,a=await b(s),n=a.findIndex(c=>c.id===e);if(n===-1)return null;const i=a[n],o=new Date().toISOString();return t.comment!==void 0&&(i.comment=t.comment),t.intent!==void 0&&(i.intent=t.intent),t.severity!==void 0&&(i.severity=t.severity),t.status!==void 0&&(i.status=t.status,(t.status==="resolved"||t.status==="dismissed")&&(i.resolvedBy=t.resolvedBy??"human",i.resolvedAt=o,i.screenshot&&(await F(s,i.screenshot),i.screenshot=void 0))),t.threadMessage&&(i.thread||(i.thread=[]),i.thread.push({...t.threadMessage,id:crypto.randomUUID(),timestamp:o})),i.updatedAt=o,a[n]=i,await A(s,a),i}),"updateAnnotation"),H=h(async(r,e)=>j(async()=>{const{root:t}=r.config,s=await b(t),a=s.findIndex(i=>i.id===e);if(a===-1)return!1;const n=s[a];return n.screenshot&&await F(t,n.screenshot),s.splice(a,1),await A(t,s),!0}),"deleteAnnotation"),J=h(async(r,e,t)=>{const{root:s}=r.config;await R(s);const{base:a,screenshotsDir:n}=E(s),i=W(e);if(!i)throw new Error("Invalid annotation ID");let o,c;if(t.startsWith("data:image/png;base64,"))o="png",c=Buffer.from(t.slice(22),"base64");else if(t.startsWith("data:image/jpeg;base64,"))o="jpg",c=Buffer.from(t.slice(23),"base64");else if(t.startsWith("data:image/webp;base64,"))o="webp",c=Buffer.from(t.slice(23),"base64");else throw new Error("Unsupported screenshot format. Expected PNG, JPEG, or WebP data URL.");const l=`${i}.${o}`,d=m.join(n,l);if(!I(d,a))throw new Error("Invalid screenshot path");return await p.writeFile(d,c),`${O}/${l}`},"saveScreenshot"),X=h(async(r,e)=>{const{root:t}=r.config,s=(await b(t)).find(i=>i.id===e);if(!s?.screenshot||!s.screenshot.startsWith(`${O}/`))return null;const{base:a}=E(t),n=m.join(a,s.screenshot);if(!I(n,a))return null;try{const i=await p.readFile(n),o=m.extname(n).slice(1);return o==="svg"?`data:image/svg+xml,${encodeURIComponent(i.toString("utf8"))}`:`data:${o==="jpg"?"image/jpeg":`image/${o}`};base64,${i.toString("base64")}`}catch{return null}},"getScreenshot");var K=Object.defineProperty,g=f((r,e)=>K(r,"name",{value:e,configurable:!0}),"r");const Q=new Set(["apng","avif","bmp","gif","ico","jpeg","jpg","png","svg","tiff","webp"]),Y=new Set(["avi","mkv","mov","mp4","ogv","webm"]),Z=new Set(["aac","flac","m4a","mp3","ogg","opus","wav"]),ee=new Set(["eot","otf","ttf","woff","woff2"]),te=new Set(["css","csv","html","js","json","md","txt","xml"]),w=5e3,D=g(r=>{const e=r.toLowerCase();return Q.has(e)?"image":Y.has(e)?"video":Z.has(e)?"audio":ee.has(e)?"font":te.has(e)?"text":"other"},"classifyExtension"),re=g(r=>{let e=0;const t=[];return{acquire:g(()=>new Promise(s=>{e<r?(e+=1,s()):t.push(()=>{e+=1,s()})}),"acquire"),release:g(()=>{e-=1,t.shift()?.()},"release")}},"createSemaphore"),T=g(async(r,e,t,s)=>{if(s.length>=w)return;let a;await t.acquire();try{a=await p.readdir(r,{withFileTypes:!0})}catch{return}finally{t.release()}await Promise.all(a.map(async n=>{if(s.length>=w)return;const i=m.join(r,n.name);if(n.isDirectory())await T(i,e,t,s);else if(n.isFile()||n.isSymbolicLink()){await t.acquire();try{const o=await p.lstat(i);if(o.isSymbolicLink()){let c;try{c=await p.realpath(i)}catch{return}if(!c.startsWith(e+m.sep)&&c!==e)return;const l=await p.stat(i),d=m.relative(e,i),M=`/${$(d)}`,z=m.extname(n.name).slice(1);s.length<w&&s.push({mtime:l.mtimeMs,publicPath:M,size:l.size,type:D(z)})}else if(o.isFile()){const c=m.relative(e,i),l=`/${$(c)}`,d=m.extname(n.name).slice(1);s.length<w&&s.push({mtime:o.mtimeMs,publicPath:l,size:o.size,type:D(d)})}}catch{}finally{t.release()}}}))},"walkDirectory"),se=g(async r=>{const{publicDir:e}=r.config;if(!e)return[];let t;try{t=await p.realpath(e)}catch{return[]}const s=[],a=re(20);return await T(t,t,a,s),s.sort((n,i)=>n.publicPath.localeCompare(i.publicPath)),s},"getStaticAssets");var ne=Object.defineProperty,ie=f((r,e)=>ne(r,"name",{value:e,configurable:!0}),"u$1");const ae=ie(async r=>{const{moduleGraph:e}=r,t=[];return e.idToModuleMap.forEach(s=>{const a=[];s.importers.forEach(o=>{const c=o.url??o.id;c&&a.push(c)});const n=s.id??s.url,i=s.url??s.id;!n||!i||t.push({id:n,importerCount:s.importers.size,importerUrls:a,url:i})}),t},"getModuleGraph");var oe=Object.defineProperty,ce=f((r,e)=>oe(r,"name",{value:e,configurable:!0}),"n");const le=ce(async(r,e,t,s,a)=>{const n=e.startsWith("/")?e:m.join(r.config.root,e),i=s===void 0?"":`:${s}`,o=t===void 0?"":`:${t}${i}`,c=`${n}${o}`,{default:l}=await import("launch-editor");l(c,a)},"openInEditor");var de=Object.defineProperty,y=f((r,e)=>de(r,"name",{value:e,configurable:!0}),"f$1");const ue=/\/\*[\s\S]*?\*\//g,me=/\s+/g,C=/@theme\s+default[^{]*\{[\s\S]*?\}/g,S=/(--[\w-]+)\s*:\s*([\s\S]*?);/g,k=y(r=>{const e={},t=r.replaceAll(ue,"");let s=0;for(;s<t.length;){const a=t.indexOf("@theme",s);if(a===-1)break;const n=t.indexOf("{",a);if(n===-1)break;let i=1,o=n+1;for(;o<t.length&&i>0;)t[o]==="{"?i+=1:t[o]==="}"&&(i-=1),o+=1;const c=t.slice(n+1,o-1);S.lastIndex=0;let l=S.exec(c);for(;l!==null;){const d=l[2].replaceAll(me," ").trim();d&&!e[l[1]]&&(e[l[1]]=d),l=S.exec(c)}s=o}return e},"parseThemeVariables"),pe=y(async r=>{const e=[],t=y(async(s,a)=>{if(a>4)return;let n;try{n=await p.readdir(s,{encoding:"utf8",withFileTypes:!0})}catch{return}for(const i of n){const o=m.join(s,i.name);if(i.isDirectory()){if(i.name==="node_modules"||i.name===".git"||i.name==="dist")continue;await t(o,a+1)}else if(i.name.endsWith(".css"))try{const c=await p.readFile(o,"utf8");c.includes("@import")&&(c.includes('"tailwindcss"')||c.includes("'tailwindcss'"))&&e.push(o)}catch{}}},"walk");return await t(r,0),e},"findTailwindCSSFiles"),fe=y(async r=>{const e={};for(const t of r)try{const s=await p.readFile(t,"utf8");C.lastIndex=0;const a=s.replaceAll(C,""),n=k(a);Object.assign(e,n)}catch{}return e},"extractUserTheme"),ge=y(async r=>{const{root:e}=r.config;let t="unknown",s={};const a=["tailwind.config.js","tailwind.config.ts","tailwind.config.mjs","tailwind.config.cjs"];for(const o of a)try{await p.access(m.join(e,o)),t="v3";break}catch{}try{const o=U(import.meta.url).resolve("tailwindcss/theme.css"),c=await p.readFile(o,"utf8");s=k(c),Object.keys(s).length>0&&t!=="v3"&&(t="v4")}catch{}const n=await pe(e),i=await fe(n);return{cssFiles:n.map(o=>m.relative(e,o)),customTheme:i,defaultTheme:s,version:t}},"getTailwindConfig");var he=Object.defineProperty,P=f((r,e)=>he(r,"name",{value:e,configurable:!0}),"s");const ve=P(r=>{if(Array.isArray(r))return r.filter(e=>e!=null&&(e.find!==void 0||e.replacement!==void 0)).map(e=>({find:e.find instanceof RegExp?e.find.toString():String(e.find??""),replacement:String(e.replacement??"")}));if(r!=null&&typeof r=="object")return Object.fromEntries(Object.entries(r).map(([e,t])=>[e,String(t)]))},"normalizeAlias"),ye=P(r=>{if(typeof r=="boolean"||Array.isArray(r))return r},"normalizeSsrNoExternal"),be=P(async r=>{const{config:e}=r,t=[];for(const l of e.plugins.filter(d=>!!d?.name))t.push({enforce:l?.enforce,name:l.name});const s=ve(e.resolve?.alias),a=e.server?.proxy?Object.keys(e.server.proxy):void 0,n=e.server?.hmr,i=n!==!1,o=typeof n=="object"&&n!==null?n.port:void 0,c=ye(e.ssr?.noExternal);return{base:e.base,build:{assetsDir:e.build?.assetsDir,assetsInlineLimit:typeof e.build?.assetsInlineLimit=="number"?e.build.assetsInlineLimit:void 0,chunkSizeWarningLimit:e.build?.chunkSizeWarningLimit,cssCodeSplit:e.build?.cssCodeSplit,emptyOutDir:e.build?.emptyOutDir,minify:e.build?.minify,outDir:e.build?.outDir,reportCompressedSize:e.build?.reportCompressedSize,sourcemap:e.build?.sourcemap,target:e.build?.target},cacheDir:e.cacheDir,css:{devSourcemap:e.css?.devSourcemap,preprocessors:e.css?.preprocessorOptions?Object.keys(e.css.preprocessorOptions):[]},define:e.define,env:e.env,envDir:typeof e.envDir=="string"?e.envDir:void 0,envPrefix:e.envPrefix,esbuild:e.esbuild?{jsx:e.esbuild.jsx,jsxFactory:e.esbuild.jsxFactory,jsxFragment:e.esbuild.jsxFragment,jsxImportSource:e.esbuild.jsxImportSource,target:e.esbuild.target}:void 0,mode:e.mode,optimizeDeps:{exclude:e.optimizeDeps?.exclude,include:e.optimizeDeps?.include},plugins:t,publicDir:e.publicDir,resolve:{alias:s,conditions:e.resolve?.conditions,dedupe:e.resolve?.dedupe,extensions:e.resolve?.extensions,mainFields:e.resolve?.mainFields,preserveSymlinks:e.resolve?.preserveSymlinks},root:e.root,server:{cors:e.server?.cors===void 0?void 0:!!e.server.cors,hmrEnabled:i,hmrPort:o,host:e.server?.host,https:e.server?.https!==void 0,middlewareMode:(()=>{if(e.server?.middlewareMode!==void 0)return typeof e.server.middlewareMode=="object"?!0:!!e.server.middlewareMode})(),open:e.server?.open,origin:e.server?.origin,port:e.server?.port,proxy:a,strictPort:e.server?.strictPort},ssr:e.ssr===void 0?void 0:{external:Array.isArray(e.ssr?.external)?e.ssr.external:void 0,noExternal:c,target:e.ssr?.target}}},"getViteConfig");var we=Object.defineProperty,u=f((r,e)=>we(r,"name",{value:e,configurable:!0}),"e");const Se=u((r,e={})=>({createAnnotation:u(async t=>N(r,t),"createAnnotation"),deleteAnnotation:u(async t=>H(r,t),"deleteAnnotation"),getAnnotations:u(async()=>G(r),"getAnnotations"),getModuleGraph:u(async()=>ae(r),"getModuleGraph"),getScreenshot:u(async t=>X(r,t),"getScreenshot"),getStaticAssets:u(async()=>se(r),"getStaticAssets"),getTailwindConfig:u(async()=>ge(r),"getTailwindConfig"),getViteConfig:u(async()=>be(r),"getViteConfig"),openInEditor:u(async(t,s,a,n)=>le(r,t,s,a,n||e.editor),"openInEditor"),readFile:u(async t=>{const{readFile:s}=await import("node:fs/promises"),a=t.startsWith("/")?t:`${r.config.root}/${t}`;return s(a,"utf8")},"readFile"),saveScreenshot:u(async(t,s)=>J(r,t,s),"saveScreenshot"),updateAnnotation:u(async(t,s)=>V(r,t,s),"updateAnnotation")}),"createDefaultServerFunctions"),$e=u((r,e,t={})=>{const s={...Se(r,t),...e};return r.ws.on("dev-toolbar:rpc",async(a,n)=>{const{args:i,id:o,method:c}=a,l=s[c];if(!l){n.send("dev-toolbar:rpc:error",{error:`Unknown RPC method: ${c}`,id:o});return}try{const d=await l(...i);n.send("dev-toolbar:rpc:response",{id:o,result:d})}catch(d){n.send("dev-toolbar:rpc:error",{error:d instanceof Error?d.message:String(d),id:o})}}),{callClient(a,...n){r.ws.send({data:{args:n,method:a},event:"dev-toolbar:client",type:"custom"})},registerFunction(a,n){s[a]=n},server:r}},"createServerRPCContext");export{$e as createServerRPCContext,$e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as m,m as o}from"./store-DaUtLjf3.js";export{m as TimelineStore,o as getTimelineStore};
|