@vibeflow-tools/cli 0.1.0 → 0.1.1
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/README.md +1 -1
- package/dist/cli/index.js +18 -18
- package/dist/client/overlay-browser.js +1 -1
- package/dist/index.js +18 -18
- package/package.json +1 -1
|
@@ -1558,7 +1558,7 @@ Error generating stack: `+n.message+`
|
|
|
1558
1558
|
---
|
|
1559
1559
|
**Console logs** (${Nt.length} entr${Nt.length===1?"y":"ies"})
|
|
1560
1560
|
${e.join(`
|
|
1561
|
-
`)}`}var D=I(M(),1),Yc=null,Ur=null;function fx(e=2200){let t=document.head,a=t.querySelector('link[rel*="icon"]'),r=(a==null?void 0:a.href)??"";a&&a.remove();let o=document.createElement("link");o.rel="icon",o.type="image/svg+xml";let n='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" fill="none"><rect width="18" height="18" rx="4" fill="#2563eb"/><rect x="2.5" y="5" width="2" height="8" rx="1" fill="white" opacity=".7"><animate attributeName="height" values="3;13;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0s"/><animate attributeName="y" values="7.5;2.5;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0s"/></rect><rect x="6.5" y="2" width="2" height="14" rx="1" fill="white"><animate attributeName="height" values="3;15;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.15s"/><animate attributeName="y" values="7.5;1.5;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.15s"/></rect><rect x="10.5" y="6" width="2" height="6" rx="1" fill="white" opacity=".7"><animate attributeName="height" values="3;12;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.3s"/><animate attributeName="y" values="7.5;3;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.3s"/></rect><rect x="14.5" y="4" width="2" height="10" rx="1" fill="white" opacity=".85"><animate attributeName="height" values="3;13;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.45s"/><animate attributeName="y" values="7.5;2.5;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.45s"/></rect></svg>';o.href=`data:image/svg+xml,${encodeURIComponent(n)}`,t.appendChild(o),window.setTimeout(()=>{if(o.remove(),r){let l=document.createElement("link");l.rel="icon",l.type="image/svg+xml",l.href=r,t.appendChild(l)}},e)}function Qc(){Ur==null||Ur()}function cx({onClick:e,flashing:t}){let a=(0,D.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[(0,D.jsx)("rect",{x:"2.5",y:"5",width:"2",height:"8",rx:"1",fill:"currentColor",opacity:"0.7"}),(0,D.jsx)("rect",{x:"6.5",y:"2",width:"2",height:"14",rx:"1",fill:"currentColor"}),(0,D.jsx)("rect",{x:"10.5",y:"6",width:"2",height:"6",rx:"1",fill:"currentColor",opacity:"0.7"}),(0,D.jsx)("rect",{x:"14.5",y:"4",width:"2",height:"10",rx:"1",fill:"currentColor",opacity:"0.85"})]}),[r,o]=Q.default.useState(null),[n,l]=Q.default.useState(!1),[i,s]=Q.default.useState(!1),u=Q.default.useRef(null),c=Q.default.useRef(null),p=Q.default.useRef(!1),x=Q.default.useRef(null),v=Q.default.useRef(null);v.current=r;function h(w){let k=w.getBoundingClientRect();return{x:k.left,y:k.top}}function y(w){let k=w.currentTarget,P=w.pointerId,F=w.clientX,A=w.clientY;p.current=!1,c.current=window.setTimeout(()=>{s(!0);let G=v.current??h(k);u.current={mouseX:F,mouseY:A,posX:G.x,posY:G.y},k.setPointerCapture(P)},300)}function E(w){if(!u.current)return;let k=w.clientX-u.current.mouseX,P=w.clientY-u.current.mouseY;!n&&(Math.abs(k)>3||Math.abs(P)>3)&&l(!0),p.current=!0;let F=window.innerWidth,A=window.innerHeight,G=Math.max(8,Math.min(F-64,u.current.posX+k)),ie=Math.max(8,Math.min(A-64,u.current.posY+P));o({x:G,y:ie})}function f(w){c.current!==null&&(window.clearTimeout(c.current),c.current=null);let k=p.current;u.current=null,l(!1),s(!1),p.current=!1,k||e()}function d(){c.current!==null&&(window.clearTimeout(c.current),c.current=null),u.current=null,l(!1),s(!1),p.current=!1}let m=r!==null?{position:"fixed",left:r.x,top:r.y,bottom:"auto",right:"auto"}:{},L=["vibeflow-corner-trigger",t?"saved-flash":"",i?"trigger-holding":"",n?"trigger-dragging":""].filter(Boolean).join(" ");return(0,D.jsx)("button",{ref:x,className:L,title:n?"Drag to reposition":i?"Drag to reposition \xB7 Release to open":"Open Kanban board \xB7 Hold to drag",style:m,onPointerDown:y,onPointerMove:E,onPointerUp:f,onPointerCancel:d,"data-vibeflow-ignore":"true",children:a})}var px=["backlog","todo","in-progress","review","done"],mx={backlog:{background:"rgba(100,116,139,0.2)",borderColor:"rgba(100,116,139,0.5)",color:"#94a3b8"},todo:{background:"rgba(245,158,11,0.15)",borderColor:"rgba(245,158,11,0.4)",color:"#fcd34d"},"in-progress":{background:"rgba(59,130,246,0.15)",borderColor:"rgba(59,130,246,0.4)",color:"#93c5fd"},review:{background:"rgba(139,92,246,0.15)",borderColor:"rgba(139,92,246,0.4)",color:"#c4b5fd"},done:{background:"rgba(52,211,153,0.12)",borderColor:"rgba(52,211,153,0.4)",color:"#6ee7b7"}};function gx({opts:e,onClose:t,onSubmit:a}){let[r,o]=Q.default.useState(e.initialTitle??""),[n,l]=Q.default.useState(e.initialDescription??""),[i,s]=Q.default.useState("todo"),[u,c]=Q.default.useState("Task"),[p,x]=Q.default.useState(!1),v=Q.default.useRef(null),[h,y]=Q.default.useState(null),[E,f]=Q.default.useState(!1),d=Q.default.useRef(null);function m(T){if(T.target.closest("button, input, select, textarea, a"))return;T.currentTarget.setPointerCapture(T.pointerId);let q=(h==null?void 0:h.x)??window.innerWidth/2-270,se=(h==null?void 0:h.y)??window.innerHeight/2-200;d.current={mouseX:T.clientX,mouseY:T.clientY,posX:q,posY:se},f(!0)}function L(T){if(!d.current)return;let q=T.clientX-d.current.mouseX,se=T.clientY-d.current.mouseY;y({x:d.current.posX+q,y:d.current.posY+se})}function C(){d.current=null,f(!1)}Q.default.useEffect(()=>{setTimeout(()=>{var T;return(T=v.current)==null?void 0:T.focus()},50)},[]);function w(T){T.target===T.currentTarget&&t()}function k(T){T.key==="Escape"&&t(),(T.ctrlKey||T.metaKey)&&T.key==="Enter"&&P()}function P(){var se;let T=r.trim();if(!T){(se=v.current)==null||se.focus();return}let q=n.trim()||T;if(u==="Bug"){let ct=Tn();ct&&(q+=ct)}a(e.selector??location.pathname,e.cssSelector??location.pathname,T,q,i,u,{file:e.file,line:e.line,col:e.col,component:e.component}),t()}let F={padding:"2px 8px",borderRadius:4,fontSize:11,cursor:"pointer",border:"1px solid var(--vibeflow-border-strong)",background:"transparent",color:"var(--vibeflow-text-muted)",fontFamily:"inherit",fontWeight:500,transition:"all .12s"},A=h!==null?{position:"fixed",left:h.x,top:h.y,margin:0}:{};return(0,D.jsx)("div",{className:"vibeflow-modal-backdrop",onClick:w,onKeyDown:k,children:(0,D.jsxs)("div",{className:"vibeflow-modal overlay-add-modal",role:"dialog","aria-modal":"true",style:A,children:[(0,D.jsxs)("div",{className:"modal-header overlay-modal-header",style:{cursor:E?"grabbing":"grab",userSelect:"none"},onPointerDown:m,onPointerMove:L,onPointerUp:C,children:[(0,D.jsx)("span",{title:"Drag to move",style:{display:"flex",alignItems:"center",color:"var(--vibeflow-text-muted)",opacity:.5,flexShrink:0,pointerEvents:"none"},children:(0,D.jsxs)("svg",{width:"12",height:"16",viewBox:"0 0 12 16",fill:"currentColor","aria-hidden":"true",children:[(0,D.jsx)("circle",{cx:"3",cy:"3",r:"1.5"}),(0,D.jsx)("circle",{cx:"9",cy:"3",r:"1.5"}),(0,D.jsx)("circle",{cx:"3",cy:"8",r:"1.5"}),(0,D.jsx)("circle",{cx:"9",cy:"8",r:"1.5"}),(0,D.jsx)("circle",{cx:"3",cy:"13",r:"1.5"}),(0,D.jsx)("circle",{cx:"9",cy:"13",r:"1.5"})]})}),(0,D.jsx)(Ht,{value:u,onChange:c}),(0,D.jsx)("input",{ref:v,type:"text",placeholder:"Task title\u2026",value:r,onChange:T=>o(T.target.value),style:{flex:1,fontSize:14,fontWeight:600,padding:"4px 8px",border:"1px solid transparent",borderRadius:6,background:"transparent",color:"var(--vibeflow-text-primary)",fontFamily:"inherit",outline:"none",cursor:"text"},onFocus:T=>{T.currentTarget.style.borderColor="var(--vibeflow-accent-strong)",T.currentTarget.style.background="var(--vibeflow-surface-elevated)"},onBlur:T=>{T.currentTarget.style.borderColor="transparent",T.currentTarget.style.background="transparent"},onKeyDown:T=>{T.key==="Enter"&&P(),T.key==="Escape"&&t()}}),(0,D.jsx)("button",{type:"button",onClick:t,style:{width:26,height:26,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"none",background:"transparent",color:"var(--vibeflow-text-muted)",cursor:"pointer"},onMouseOver:T=>{T.currentTarget.style.background="var(--vibeflow-surface-hover)",T.currentTarget.style.color="var(--vibeflow-text-secondary)"},onMouseOut:T=>{T.currentTarget.style.background="transparent",T.currentTarget.style.color="var(--vibeflow-text-muted)"},"aria-label":"Close",children:"\u2715"})]}),(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 16px",borderBottom:"1px solid var(--vibeflow-border-strong)"},children:[(0,D.jsx)("span",{style:{fontSize:10,color:"var(--vibeflow-text-muted)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.04em",flexShrink:0},children:"Status"}),px.map(T=>(0,D.jsx)("button",{type:"button",style:{...F,...T===i?mx[T]:{}},onClick:()=>s(T),onMouseOver:q=>{T!==i&&(q.currentTarget.style.background="var(--vibeflow-surface-hover)",q.currentTarget.style.color="var(--vibeflow-text-secondary)")},onMouseOut:q=>{T!==i&&(q.currentTarget.style.background="transparent",q.currentTarget.style.color="var(--vibeflow-text-muted)")},children:T},T))]}),(e.file||e.component)&&(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 16px",background:"var(--vibeflow-surface-elevated)",borderBottom:"1px solid var(--vibeflow-border-subtle)",fontSize:11,color:"var(--vibeflow-text-muted)"},children:[e.file&&(0,D.jsxs)("a",{href:`vscode://file${e.file}${e.line!=null?`:${e.line}`:""}`,target:"_blank",rel:"noreferrer",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 6px",borderRadius:4,background:"var(--vibeflow-accent-soft)",border:"1px solid var(--vibeflow-accent-border)",color:"var(--vibeflow-accent-strong)",textDecoration:"none",fontSize:11},children:["\u{1F5CE} ",e.file.split("/").slice(-2).join("/"),e.line!=null?`:${e.line}`:""]}),e.component&&(0,D.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 6px",borderRadius:4,background:"rgba(139,92,246,0.08)",border:"1px solid rgba(139,92,246,0.25)",color:"#8b5cf6",fontSize:11},children:["\u2B21 ",e.component]})]}),(0,D.jsxs)("div",{className:"modal-tabs",children:[(0,D.jsx)("div",{className:`modal-tab${p?"":" active"}`,onClick:()=>x(!1),children:"Edit"}),(0,D.jsx)("div",{className:`modal-tab${p?" active":""}`,onClick:()=>x(!0),children:"Preview"})]}),(0,D.jsx)("div",{className:"modal-body",children:p?(0,D.jsx)(tt,{markdown:n,className:"modal-preview-pane"}):(0,D.jsx)("div",{className:"modal-editor-pane",children:(0,D.jsx)(ta,{className:"dp-textarea",placeholder:"Description (markdown supported)\u2026",value:n,onChange:l,baseRows:5,maxRows:14})})}),u==="Bug"&&(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 16px",background:"rgba(239,68,68,0.06)",borderTop:"1px solid rgba(239,68,68,0.18)",fontSize:11,color:"rgba(239,68,68,0.75)"},children:[(0,D.jsx)("span",{children:"\u{1F534}"}),(0,D.jsx)("span",{children:"Console errors & warnings will be attached to this report"})]}),(0,D.jsxs)("div",{className:"modal-footer",children:[(0,D.jsxs)("div",{className:"modal-footer-left",children:[(0,D.jsx)("button",{type:"button",className:"btn-primary",onClick:P,children:"Add Task"}),(0,D.jsx)("button",{type:"button",className:"btn-ghost",onClick:t,children:"Cancel"})]}),(0,D.jsx)("div",{className:"modal-footer-center"})]})]})})}function Zc({onOpenKanban:e,onSubmitTask:t}){let[a,r]=Q.default.useState(null),[o,n]=Q.default.useState(!1);Q.default.useEffect(()=>(Yc=i=>r(i),Ur=()=>{n(!0),window.setTimeout(()=>n(!1),1500),fx()},()=>{Yc=null,Ur=null}),[]);let l=typeof document<"u"&&document.body.hasAttribute("data-vibeflow-cli-kanban");return(0,D.jsxs)(D.Fragment,{children:[!l&&(0,D.jsx)(cx,{onClick:e,flashing:o}),a!==null&&(0,D.jsx)(gx,{opts:a,onClose:()=>r(null),onSubmit:(i,s,u,c,p,x,v)=>{t(i,s,u,c,p,x,v),r(null)}})]})}function Pn(e="Task"){let t=e,a=ve,r=()=>a.find(s=>s.value===t)??a[0],o=b("div",{className:"type-picker"}),n=b("button",{className:"type-picker-trigger",type:"button"}),l=b("div",{className:"type-picker-dropdown"}),i=()=>{let s=r();n.title=(s==null?void 0:s.tooltip)??"",n.replaceChildren(b("span",{className:"type-picker-icon"},(s==null?void 0:s.icon)??""),b("span",{className:"type-picker-label"},(s==null?void 0:s.label)??"")),l.replaceChildren();for(let u of a){let c=b("button",{className:u.value===t?"type-picker-option type-picker-option--active":"type-picker-option",type:"button",title:u.tooltip},b("span",{className:"type-picker-icon"},u.icon),b("span",{className:"type-picker-label"},u.label));c.addEventListener("click",p=>{p.preventDefault(),p.stopPropagation(),t=u.value,i(),l.classList.remove("open")}),l.appendChild(c)}};return n.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),l.classList.toggle("open")}),i(),o.append(n,l),{el:o,getValue:()=>t,setValue:s=>{t=s,i()}}}function hx(e){return e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/^### (.+)$/gm,"<h3>$1</h3>").replace(/^## (.+)$/gm,"<h2>$1</h2>").replace(/^# (.+)$/gm,"<h1>$1</h1>").replace(/[*][*](.+?)[*][*]/g,"<strong>$1</strong>").replace(/__(.+?)__/g,"<strong>$1</strong>").replace(/[*](.+?)[*]/g,"<em>$1</em>").replace(/_([^_]+?)_/g,"<em>$1</em>").replace(new RegExp("`(.+?)`","g"),"<code>$1</code>").replace(/^[-*] (.+)$/gm,"<li>$1</li>").replace(/^---$/gm,"<hr>").replace(/(<li>[\s\S]*?<\/li>\n?)+/g,a=>`<ul>${a}</ul>`).replace(/^(?!<[a-z]|$).+$/gm,a=>`<p>${a}</p>`):'<span class="modal-preview-empty">No description yet</span>'}function os(e){if(!g.root)return;g.editModal&&(g.editModal.remove(),g.editModal=null);let t=b("input",{type:"text",placeholder:"Task title..."});t.value=e.title??"";let a=b("select");for(let C of["backlog","todo","in-progress","review","done"]){let w=b("option",{value:C},C);C===e.status&&(w.selected=!0),a.appendChild(w)}let r=Pn(e.type??"Task"),o=b("div",{className:"modal-header"},t,r.el,a),n=b("div",{className:"modal-tab active"},"Edit"),l=b("div",{className:"modal-tab"},"Preview"),i=b("div",{className:"modal-tabs"},n,l),s=b("textarea",{placeholder:"Description (markdown supported)..."});s.value=e.description??"";let u=b("div",{className:"modal-editor-pane"},s),c=b("div",{className:"modal-preview-pane"});c.style.display="none";let p=()=>{c.innerHTML=hx(s.value)},x=b("div",{className:"modal-body"},u,c);n.addEventListener("click",()=>{n.classList.add("active"),l.classList.remove("active"),u.style.display="",c.style.display="none"}),l.addEventListener("click",C=>{C.isTrusted&&(l.classList.add("active"),n.classList.remove("active"),u.style.display="none",c.style.display="",p())});let v=b("button",{className:"btn-primary"},"Save"),h=b("button",{className:"btn-ghost"},"Cancel"),y=b("div",{className:"modal-footer-left"},v,h),E=b("div",{className:"modal-footer-right"}),f=vx({file:e.file,line:e.line,col:e.col,component:e.component}),d=b("div",{className:"modal-footer"},y,f,E),m=b("div",{className:"vibeflow-modal"},o,i,x,d),L=b("div",{className:"vibeflow-modal-backdrop"},m);g.editModal=L,g.root.appendChild(L),t.focus(),L.addEventListener("click",C=>{C.target===L&&(L.remove(),g.editModal=null)}),v.addEventListener("click",()=>{let C=t.value.trim();if(!C)return;let w=PROTO_CONFIG.boardId?`${PROTO_CONFIG.apiUrl}/${e.id}?boardId=${encodeURIComponent(PROTO_CONFIG.boardId)}`:`${PROTO_CONFIG.apiUrl}/${e.id}`;fetch(w,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:C,status:a.value,type:r.getValue(),description:s.value.trim()})}).then(k=>k.json()).then(k=>{k.success&&xx()}).catch(k=>console.error("[Vibeflow Studio]",k)),L.remove(),g.editModal=null}),h.addEventListener("click",()=>{L.remove(),g.editModal=null}),document.addEventListener("keydown",function C(w){if(!g.editModal){document.removeEventListener("keydown",C);return}w.key==="Escape"&&(L.remove(),g.editModal=null,document.removeEventListener("keydown",C)),(w.ctrlKey||w.metaKey)&&w.key==="Enter"&&(v.click(),document.removeEventListener("keydown",C))})}function xx(){pt()}function vx(e){let t=b("div",{className:"modal-source-row"});if(!e.file&&!e.component)return t;let a="";e.file?(a=e.file.replace(/\\/g,"/").split("/").slice(-2).join("/"),e.line!=null&&(a+=`:${e.line}`),e.col!=null&&(a+=`:${e.col}`)):e.component&&(a=`\u2B21 ${e.component}`),e.component&&e.file&&(a+=` \xB7 \u2B21 ${e.component}`);let r=b("span",{className:"modal-source-label",title:e.file??""},a);if(e.file&&e.line!=null){let o=b("a",{className:"modal-source-link",title:"Open in editor",href:`vscode://file${e.file}:${e.line}`,target:"_blank"},"\u2197");t.append(r,o)}else t.append(r);return t}function Jc(e,t){if(!g.root)return;g.editModal&&(g.editModal.remove(),g.editModal=null);let a=Oa(e),r=e.tagName.toLowerCase(),o=e.getAttribute("id"),n=Array.from(e.classList).filter(h=>!h.startsWith("vibeflow-")),l=Array.from(e.attributes).filter(h=>h.name.startsWith("data-")&&!h.name.startsWith("data-proto")).map(h=>({name:h.name,value:h.value})),i=b("div",{className:"inspect-heading"},b("span",{className:"inspect-tag"},`<${r}>`),b("span",{className:"inspect-title"},"Element Inspector")),s=b("button",{className:"inspect-close"},"\u2715");function u(h,y,E=!0){let f=b("div",{className:"inspect-row"}),d=b("span",{className:"inspect-row-label"},h),m=b("code",{className:"inspect-row-value"},y||"\u2014");if(f.append(d,m),E&&y){let L=b("button",{className:"inspect-copy-btn",title:"Copy"},"\u2398");L.addEventListener("click",()=>{var C;(C=navigator.clipboard)==null||C.writeText(y).catch(()=>{}),L.textContent="\u2713",setTimeout(()=>{L.textContent="\u2398"},1200)}),f.appendChild(L)}return f}let c=b("div",{className:"inspect-rows"});if(c.appendChild(u("Selector",t.selector)),a!==t.selector&&c.appendChild(u("CSS selector",a)),t.test_id&&c.appendChild(u("Test ID",t.test_id)),o&&c.appendChild(u("id",o)),n.length>0&&c.appendChild(u("Classes",n.join(" "))),t.file){let h=t.file+(t.line!=null?`:${t.line}`:"")+(t.col!=null?`:${t.col}`:""),y=u("Source file",h);if(t.line!=null){let E=b("a",{className:"inspect-copy-btn",title:"Open in VS Code",href:`vscode://file${t.file}:${t.line}`,target:"_blank"},"\u2197");y.appendChild(E)}c.appendChild(y)}t.component&&c.appendChild(u("Component",t.component));for(let h of l)c.appendChild(u(h.name,h.value));let p=b("button",{className:"inspect-copy-all-btn"},"\u2398 Copy all");p.addEventListener("click",()=>{var y;let h=[];t.file&&h.push(`Source: ${t.file}${t.line!=null?`:${t.line}`:""}${t.col!=null?`:${t.col}`:""}`),t.component&&h.push(`Component: ${t.component}`),t.test_id&&h.push(`TestID: ${t.test_id}`),h.push(`Selector: ${t.selector}`),a!==t.selector&&h.push(`CSS selector: ${a}`),o&&h.push(`id: ${o}`),n.length>0&&h.push(`Classes: ${n.join(" ")}`),(y=navigator.clipboard)==null||y.writeText(h.join(`
|
|
1561
|
+
`)}`}var D=I(M(),1),Yc=null,Ur=null;function fx(e=2200){let t=document.head,a=t.querySelector('link[rel*="icon"]'),r=(a==null?void 0:a.href)??"";a&&a.remove();let o=document.createElement("link");o.rel="icon",o.type="image/svg+xml";let n='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 18 18" fill="none"><rect width="18" height="18" rx="4" fill="#2563eb"/><rect x="2.5" y="5" width="2" height="8" rx="1" fill="white" opacity=".7"><animate attributeName="height" values="3;13;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0s"/><animate attributeName="y" values="7.5;2.5;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0s"/></rect><rect x="6.5" y="2" width="2" height="14" rx="1" fill="white"><animate attributeName="height" values="3;15;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.15s"/><animate attributeName="y" values="7.5;1.5;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.15s"/></rect><rect x="10.5" y="6" width="2" height="6" rx="1" fill="white" opacity=".7"><animate attributeName="height" values="3;12;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.3s"/><animate attributeName="y" values="7.5;3;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.3s"/></rect><rect x="14.5" y="4" width="2" height="10" rx="1" fill="white" opacity=".85"><animate attributeName="height" values="3;13;3" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.45s"/><animate attributeName="y" values="7.5;2.5;7.5" dur="0.8s" repeatCount="3" calcMode="spline" keySplines=".4 0 .2 1;.4 0 .2 1" begin="0.45s"/></rect></svg>';o.href=`data:image/svg+xml,${encodeURIComponent(n)}`,t.appendChild(o),window.setTimeout(()=>{if(o.remove(),r){let l=document.createElement("link");l.rel="icon",l.type="image/svg+xml",l.href=r,t.appendChild(l)}},e)}function Qc(){Ur==null||Ur()}function cx({onClick:e,flashing:t}){let a=(0,D.jsxs)("svg",{width:"20",height:"20",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[(0,D.jsx)("rect",{x:"2.5",y:"5",width:"2",height:"8",rx:"1",fill:"currentColor",opacity:"0.7"}),(0,D.jsx)("rect",{x:"6.5",y:"2",width:"2",height:"14",rx:"1",fill:"currentColor"}),(0,D.jsx)("rect",{x:"10.5",y:"6",width:"2",height:"6",rx:"1",fill:"currentColor",opacity:"0.7"}),(0,D.jsx)("rect",{x:"14.5",y:"4",width:"2",height:"10",rx:"1",fill:"currentColor",opacity:"0.85"})]}),[r,o]=Q.default.useState(null),[n,l]=Q.default.useState(!1),[i,s]=Q.default.useState(!1),u=Q.default.useRef(null),c=Q.default.useRef(null),p=Q.default.useRef(!1),x=Q.default.useRef(null),v=Q.default.useRef(null);v.current=r;function h(w){let k=w.getBoundingClientRect();return{x:k.left,y:k.top}}function y(w){let k=w.currentTarget,P=w.pointerId,F=w.clientX,A=w.clientY;p.current=!1,c.current=window.setTimeout(()=>{s(!0);let G=v.current??h(k);u.current={mouseX:F,mouseY:A,posX:G.x,posY:G.y},k.setPointerCapture(P)},300)}function E(w){if(!u.current)return;let k=w.clientX-u.current.mouseX,P=w.clientY-u.current.mouseY;!n&&(Math.abs(k)>3||Math.abs(P)>3)&&l(!0),p.current=!0;let F=window.innerWidth,A=window.innerHeight,G=Math.max(8,Math.min(F-64,u.current.posX+k)),ie=Math.max(8,Math.min(A-64,u.current.posY+P));o({x:G,y:ie})}function f(w){c.current!==null&&(window.clearTimeout(c.current),c.current=null);let k=p.current;u.current=null,l(!1),s(!1),p.current=!1,k||e()}function d(){c.current!==null&&(window.clearTimeout(c.current),c.current=null),u.current=null,l(!1),s(!1),p.current=!1}let m=r!==null?{position:"fixed",left:r.x,top:r.y,bottom:"auto",right:"auto"}:{},L=["vibeflow-corner-trigger",t?"saved-flash":"",i?"trigger-holding":"",n?"trigger-dragging":""].filter(Boolean).join(" ");return(0,D.jsx)("button",{ref:x,className:L,title:n?"Drag to reposition":i?"Drag to reposition \xB7 Release to open":"Open Kanban board \xB7 Hold to drag",style:m,onPointerDown:y,onPointerMove:E,onPointerUp:f,onPointerCancel:d,"data-vibeflow-ignore":"true",children:a})}var px=["backlog","todo","in-progress","review","done"],mx={backlog:{background:"rgba(100,116,139,0.2)",borderColor:"rgba(100,116,139,0.5)",color:"#94a3b8"},todo:{background:"rgba(245,158,11,0.15)",borderColor:"rgba(245,158,11,0.4)",color:"#fcd34d"},"in-progress":{background:"rgba(59,130,246,0.15)",borderColor:"rgba(59,130,246,0.4)",color:"#93c5fd"},review:{background:"rgba(139,92,246,0.15)",borderColor:"rgba(139,92,246,0.4)",color:"#c4b5fd"},done:{background:"rgba(52,211,153,0.12)",borderColor:"rgba(52,211,153,0.4)",color:"#6ee7b7"}};function gx({opts:e,onClose:t,onSubmit:a}){let[r,o]=Q.default.useState(e.initialTitle??""),[n,l]=Q.default.useState(e.initialDescription??""),[i,s]=Q.default.useState("todo"),[u,c]=Q.default.useState("Task"),[p,x]=Q.default.useState(!1),v=Q.default.useRef(null),[h,y]=Q.default.useState(null),[E,f]=Q.default.useState(!1),d=Q.default.useRef(null);function m(T){if(T.target.closest("button, input, select, textarea, a"))return;T.currentTarget.setPointerCapture(T.pointerId);let q=(h==null?void 0:h.x)??window.innerWidth/2-270,se=(h==null?void 0:h.y)??window.innerHeight/2-200;d.current={mouseX:T.clientX,mouseY:T.clientY,posX:q,posY:se},f(!0)}function L(T){if(!d.current)return;let q=T.clientX-d.current.mouseX,se=T.clientY-d.current.mouseY;y({x:d.current.posX+q,y:d.current.posY+se})}function C(){d.current=null,f(!1)}Q.default.useEffect(()=>{setTimeout(()=>{var T;return(T=v.current)==null?void 0:T.focus()},50)},[]);function w(T){T.target===T.currentTarget&&t()}function k(T){T.key==="Escape"&&t(),(T.ctrlKey||T.metaKey)&&T.key==="Enter"&&P()}function P(){var se;let T=r.trim();if(!T){(se=v.current)==null||se.focus();return}let q=n.trim()||T;if(u==="Bug"){let ct=Tn();ct&&(q+=ct)}a(e.selector??location.pathname,e.cssSelector??location.pathname,T,q,i,u,{file:e.file,line:e.line,col:e.col,component:e.component}),t()}let F={padding:"2px 8px",borderRadius:4,fontSize:11,cursor:"pointer",border:"1px solid var(--vibeflow-border-strong)",background:"transparent",color:"var(--vibeflow-text-muted)",fontFamily:"inherit",fontWeight:500,transition:"all .12s"},A=h!==null?{position:"fixed",left:h.x,top:h.y,margin:0}:{};return(0,D.jsx)("div",{className:"vibeflow-modal-backdrop",onClick:w,onKeyDown:k,children:(0,D.jsxs)("div",{className:"vibeflow-modal overlay-add-modal",role:"dialog","aria-modal":"true",style:A,children:[(0,D.jsxs)("div",{className:"modal-header overlay-modal-header",style:{cursor:E?"grabbing":"grab",userSelect:"none"},onPointerDown:m,onPointerMove:L,onPointerUp:C,children:[(0,D.jsx)("span",{title:"Drag to move",style:{display:"flex",alignItems:"center",color:"var(--vibeflow-text-muted)",opacity:.5,flexShrink:0,pointerEvents:"none"},children:(0,D.jsxs)("svg",{width:"12",height:"16",viewBox:"0 0 12 16",fill:"currentColor","aria-hidden":"true",children:[(0,D.jsx)("circle",{cx:"3",cy:"3",r:"1.5"}),(0,D.jsx)("circle",{cx:"9",cy:"3",r:"1.5"}),(0,D.jsx)("circle",{cx:"3",cy:"8",r:"1.5"}),(0,D.jsx)("circle",{cx:"9",cy:"8",r:"1.5"}),(0,D.jsx)("circle",{cx:"3",cy:"13",r:"1.5"}),(0,D.jsx)("circle",{cx:"9",cy:"13",r:"1.5"})]})}),(0,D.jsx)(Ht,{value:u,onChange:c}),(0,D.jsx)("input",{ref:v,type:"text",placeholder:"Task title\u2026",value:r,onChange:T=>o(T.target.value),style:{flex:1,fontSize:14,fontWeight:600,padding:"4px 8px",border:"1px solid transparent",borderRadius:6,background:"transparent",color:"var(--vibeflow-text-primary)",fontFamily:"inherit",outline:"none",cursor:"text"},onFocus:T=>{T.currentTarget.style.borderColor="var(--vibeflow-accent-strong)",T.currentTarget.style.background="var(--vibeflow-surface-elevated)"},onBlur:T=>{T.currentTarget.style.borderColor="transparent",T.currentTarget.style.background="transparent"},onKeyDown:T=>{T.key==="Enter"&&P(),T.key==="Escape"&&t()}}),(0,D.jsx)("button",{type:"button",onClick:t,style:{width:26,height:26,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",borderRadius:6,border:"none",background:"transparent",color:"var(--vibeflow-text-muted)",cursor:"pointer"},onMouseOver:T=>{T.currentTarget.style.background="var(--vibeflow-surface-hover)",T.currentTarget.style.color="var(--vibeflow-text-secondary)"},onMouseOut:T=>{T.currentTarget.style.background="transparent",T.currentTarget.style.color="var(--vibeflow-text-muted)"},"aria-label":"Close",children:"\u2715"})]}),(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"8px 16px",borderBottom:"1px solid var(--vibeflow-border-strong)"},children:[(0,D.jsx)("span",{style:{fontSize:10,color:"var(--vibeflow-text-muted)",fontWeight:500,textTransform:"uppercase",letterSpacing:"0.04em",flexShrink:0},children:"Status"}),px.map(T=>(0,D.jsx)("button",{type:"button",style:{...F,...T===i?mx[T]:{}},onClick:()=>s(T),onMouseOver:q=>{T!==i&&(q.currentTarget.style.background="var(--vibeflow-surface-hover)",q.currentTarget.style.color="var(--vibeflow-text-secondary)")},onMouseOut:q=>{T!==i&&(q.currentTarget.style.background="transparent",q.currentTarget.style.color="var(--vibeflow-text-muted)")},children:T},T))]}),(e.file||e.component)&&(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"6px 16px",background:"var(--vibeflow-surface-elevated)",borderBottom:"1px solid var(--vibeflow-border-subtle)",fontSize:11,color:"var(--vibeflow-text-muted)"},children:[e.file&&(0,D.jsxs)("a",{href:`vscode://file${e.file}${e.line!=null?`:${e.line}`:""}`,target:"_blank",rel:"noreferrer",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 6px",borderRadius:4,background:"var(--vibeflow-accent-soft)",border:"1px solid var(--vibeflow-accent-border)",color:"var(--vibeflow-accent-strong)",textDecoration:"none",fontSize:11},children:["\u{1F5CE} ",e.file.split("/").slice(-2).join("/"),e.line!=null?`:${e.line}`:""]}),e.component&&(0,D.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 6px",borderRadius:4,background:"rgba(139,92,246,0.08)",border:"1px solid rgba(139,92,246,0.25)",color:"#8b5cf6",fontSize:11},children:["\u2B21 ",e.component]})]}),(0,D.jsxs)("div",{className:"modal-tabs",children:[(0,D.jsx)("div",{className:`modal-tab${p?"":" active"}`,onClick:()=>x(!1),children:"Edit"}),(0,D.jsx)("div",{className:`modal-tab${p?" active":""}`,onClick:()=>x(!0),children:"Preview"})]}),(0,D.jsx)("div",{className:"modal-body",children:p?(0,D.jsx)(tt,{markdown:n,className:"modal-preview-pane"}):(0,D.jsx)("div",{className:"modal-editor-pane",children:(0,D.jsx)(ta,{className:"dp-textarea",placeholder:"Description (markdown supported)\u2026",value:n,onChange:l,baseRows:5,maxRows:14})})}),u==="Bug"&&(0,D.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,padding:"6px 16px",background:"rgba(239,68,68,0.06)",borderTop:"1px solid rgba(239,68,68,0.18)",fontSize:11,color:"rgba(239,68,68,0.75)"},children:[(0,D.jsx)("span",{children:"\u{1F534}"}),(0,D.jsx)("span",{children:"Console errors & warnings will be attached to this report"})]}),(0,D.jsxs)("div",{className:"modal-footer",children:[(0,D.jsxs)("div",{className:"modal-footer-left",children:[(0,D.jsx)("button",{type:"button",className:"btn-primary",onClick:P,children:"Add Task"}),(0,D.jsx)("button",{type:"button",className:"btn-ghost",onClick:t,children:"Cancel"})]}),(0,D.jsx)("div",{className:"modal-footer-center"})]})]})})}function Zc({onOpenKanban:e,onSubmitTask:t}){let[a,r]=Q.default.useState(null),[o,n]=Q.default.useState(!1);Q.default.useEffect(()=>(Yc=i=>r(i),Ur=()=>{n(!0),window.setTimeout(()=>n(!1),1500),fx()},()=>{Yc=null,Ur=null}),[]);let l=typeof document<"u"&&document.body.hasAttribute("data-vibeflow-cli-kanban");return(0,D.jsxs)(D.Fragment,{children:[!l&&(0,D.jsx)(cx,{onClick:e,flashing:o}),a!==null&&(0,D.jsx)(gx,{opts:a,onClose:()=>r(null),onSubmit:(i,s,u,c,p,x,v)=>{t(i,s,u,c,p,x,v),r(null)}})]})}function Pn(e="Task"){let t=e,a=ve,r=()=>a.find(s=>s.value===t)??a[0],o=b("div",{className:"type-picker"}),n=b("button",{className:"type-picker-trigger",type:"button"}),l=b("div",{className:"type-picker-dropdown"}),i=()=>{let s=r();n.title=(s==null?void 0:s.tooltip)??"",n.replaceChildren(b("span",{className:"type-picker-icon"},(s==null?void 0:s.icon)??""),b("span",{className:"type-picker-label"},(s==null?void 0:s.label)??"")),l.replaceChildren();for(let u of a){let c=b("button",{className:u.value===t?"type-picker-option type-picker-option--active":"type-picker-option",type:"button",title:u.tooltip},b("span",{className:"type-picker-icon"},u.icon),b("span",{className:"type-picker-label"},u.label));c.addEventListener("click",p=>{p.preventDefault(),p.stopPropagation(),t=u.value,i(),l.classList.remove("open")}),l.appendChild(c)}};return n.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),l.classList.toggle("open")}),i(),o.append(n,l),{el:o,getValue:()=>t,setValue:s=>{t=s,i()}}}function hx(e){return e?e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/^### (.+)$/gm,"<h3>$1</h3>").replace(/^## (.+)$/gm,"<h2>$1</h2>").replace(/^# (.+)$/gm,"<h1>$1</h1>").replace(/[*][*](.+?)[*][*]/g,"<strong>$1</strong>").replace(/__(.+?)__/g,"<strong>$1</strong>").replace(/[*](.+?)[*]/g,"<em>$1</em>").replace(/_([^_]+?)_/g,"<em>$1</em>").replace(/`(.+?)`/g,"<code>$1</code>").replace(/^[-*] (.+)$/gm,"<li>$1</li>").replace(/^---$/gm,"<hr>").replace(/(<li>[\s\S]*?<\/li>\n?)+/g,a=>`<ul>${a}</ul>`).replace(/^(?!<[a-z]|$).+$/gm,a=>`<p>${a}</p>`):'<span class="modal-preview-empty">No description yet</span>'}function os(e){if(!g.root)return;g.editModal&&(g.editModal.remove(),g.editModal=null);let t=b("input",{type:"text",placeholder:"Task title..."});t.value=e.title??"";let a=b("select");for(let C of["backlog","todo","in-progress","review","done"]){let w=b("option",{value:C},C);C===e.status&&(w.selected=!0),a.appendChild(w)}let r=Pn(e.type??"Task"),o=b("div",{className:"modal-header"},t,r.el,a),n=b("div",{className:"modal-tab active"},"Edit"),l=b("div",{className:"modal-tab"},"Preview"),i=b("div",{className:"modal-tabs"},n,l),s=b("textarea",{placeholder:"Description (markdown supported)..."});s.value=e.description??"";let u=b("div",{className:"modal-editor-pane"},s),c=b("div",{className:"modal-preview-pane"});c.style.display="none";let p=()=>{c.innerHTML=hx(s.value)},x=b("div",{className:"modal-body"},u,c);n.addEventListener("click",()=>{n.classList.add("active"),l.classList.remove("active"),u.style.display="",c.style.display="none"}),l.addEventListener("click",C=>{C.isTrusted&&(l.classList.add("active"),n.classList.remove("active"),u.style.display="none",c.style.display="",p())});let v=b("button",{className:"btn-primary"},"Save"),h=b("button",{className:"btn-ghost"},"Cancel"),y=b("div",{className:"modal-footer-left"},v,h),E=b("div",{className:"modal-footer-right"}),f=vx({file:e.file,line:e.line,col:e.col,component:e.component}),d=b("div",{className:"modal-footer"},y,f,E),m=b("div",{className:"vibeflow-modal"},o,i,x,d),L=b("div",{className:"vibeflow-modal-backdrop"},m);g.editModal=L,g.root.appendChild(L),t.focus(),L.addEventListener("click",C=>{C.target===L&&(L.remove(),g.editModal=null)}),v.addEventListener("click",()=>{let C=t.value.trim();if(!C)return;let w=PROTO_CONFIG.boardId?`${PROTO_CONFIG.apiUrl}/${e.id}?boardId=${encodeURIComponent(PROTO_CONFIG.boardId)}`:`${PROTO_CONFIG.apiUrl}/${e.id}`;fetch(w,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:C,status:a.value,type:r.getValue(),description:s.value.trim()})}).then(k=>k.json()).then(k=>{k.success&&xx()}).catch(k=>console.error("[Vibeflow Studio]",k)),L.remove(),g.editModal=null}),h.addEventListener("click",()=>{L.remove(),g.editModal=null}),document.addEventListener("keydown",function C(w){if(!g.editModal){document.removeEventListener("keydown",C);return}w.key==="Escape"&&(L.remove(),g.editModal=null,document.removeEventListener("keydown",C)),(w.ctrlKey||w.metaKey)&&w.key==="Enter"&&(v.click(),document.removeEventListener("keydown",C))})}function xx(){pt()}function vx(e){let t=b("div",{className:"modal-source-row"});if(!e.file&&!e.component)return t;let a="";e.file?(a=e.file.replace(/\\/g,"/").split("/").slice(-2).join("/"),e.line!=null&&(a+=`:${e.line}`),e.col!=null&&(a+=`:${e.col}`)):e.component&&(a=`\u2B21 ${e.component}`),e.component&&e.file&&(a+=` \xB7 \u2B21 ${e.component}`);let r=b("span",{className:"modal-source-label",title:e.file??""},a);if(e.file&&e.line!=null){let o=b("a",{className:"modal-source-link",title:"Open in editor",href:`vscode://file${e.file}:${e.line}`,target:"_blank"},"\u2197");t.append(r,o)}else t.append(r);return t}function Jc(e,t){if(!g.root)return;g.editModal&&(g.editModal.remove(),g.editModal=null);let a=Oa(e),r=e.tagName.toLowerCase(),o=e.getAttribute("id"),n=Array.from(e.classList).filter(h=>!h.startsWith("vibeflow-")),l=Array.from(e.attributes).filter(h=>h.name.startsWith("data-")&&!h.name.startsWith("data-proto")).map(h=>({name:h.name,value:h.value})),i=b("div",{className:"inspect-heading"},b("span",{className:"inspect-tag"},`<${r}>`),b("span",{className:"inspect-title"},"Element Inspector")),s=b("button",{className:"inspect-close"},"\u2715");function u(h,y,E=!0){let f=b("div",{className:"inspect-row"}),d=b("span",{className:"inspect-row-label"},h),m=b("code",{className:"inspect-row-value"},y||"\u2014");if(f.append(d,m),E&&y){let L=b("button",{className:"inspect-copy-btn",title:"Copy"},"\u2398");L.addEventListener("click",()=>{var C;(C=navigator.clipboard)==null||C.writeText(y).catch(()=>{}),L.textContent="\u2713",setTimeout(()=>{L.textContent="\u2398"},1200)}),f.appendChild(L)}return f}let c=b("div",{className:"inspect-rows"});if(c.appendChild(u("Selector",t.selector)),a!==t.selector&&c.appendChild(u("CSS selector",a)),t.test_id&&c.appendChild(u("Test ID",t.test_id)),o&&c.appendChild(u("id",o)),n.length>0&&c.appendChild(u("Classes",n.join(" "))),t.file){let h=t.file+(t.line!=null?`:${t.line}`:"")+(t.col!=null?`:${t.col}`:""),y=u("Source file",h);if(t.line!=null){let E=b("a",{className:"inspect-copy-btn",title:"Open in VS Code",href:`vscode://file${t.file}:${t.line}`,target:"_blank"},"\u2197");y.appendChild(E)}c.appendChild(y)}t.component&&c.appendChild(u("Component",t.component));for(let h of l)c.appendChild(u(h.name,h.value));let p=b("button",{className:"inspect-copy-all-btn"},"\u2398 Copy all");p.addEventListener("click",()=>{var y;let h=[];t.file&&h.push(`Source: ${t.file}${t.line!=null?`:${t.line}`:""}${t.col!=null?`:${t.col}`:""}`),t.component&&h.push(`Component: ${t.component}`),t.test_id&&h.push(`TestID: ${t.test_id}`),h.push(`Selector: ${t.selector}`),a!==t.selector&&h.push(`CSS selector: ${a}`),o&&h.push(`id: ${o}`),n.length>0&&h.push(`Classes: ${n.join(" ")}`),(y=navigator.clipboard)==null||y.writeText(h.join(`
|
|
1562
1562
|
`)).catch(()=>{}),p.textContent="\u2713 Copied!",setTimeout(()=>{p.textContent="\u2398 Copy all"},1500)});let x=b("div",{className:"vibeflow-inspect-modal"},b("div",{className:"inspect-header"},i,s),c,b("div",{className:"inspect-footer"},p)),v=b("div",{className:"vibeflow-modal-backdrop"},x);g.editModal=v,g.root.appendChild(v),s.addEventListener("click",()=>{v.remove(),g.editModal=null}),v.addEventListener("click",h=>{h.target===v&&(v.remove(),g.editModal=null)}),document.addEventListener("keydown",function h(y){if(!g.editModal){document.removeEventListener("keydown",h);return}y.key==="Escape"&&(v.remove(),g.editModal=null,document.removeEventListener("keydown",h))})}function yx(e){var t;return((t=ve.find(a=>a.value===(e??"Task")))==null?void 0:t.tooltip)??""}function ep(e,t){let{currentPath:a,onOpen:r,onDone:o,onDelete:n,showSelector:l=!0,showDescription:i=!0,showActions:s=!1}=t,u=b("span",{className:`status-badge status-${e.status.replace(" ","-")}`},e.status),c=e.type??"Task",p=b("span",{className:`type-badge type-badge-${c.toLowerCase()}`,title:yx(c)},c),x=b("div",{className:"task-card-header"},u,p);e.status==="in-progress"&&x.appendChild(b("span",{className:"task-spinner"})),e.url&&e.url!==a&&x.appendChild(b("span",{className:"task-url-badge"},e.url));let v=$a(e.type),h=b("div",{className:e.status==="in-progress"?"task-card in-progress":"task-card"},b("span",{className:"task-watermark",title:`Type: ${e.type??"Task"}`},v),x,b("div",{className:"task-title"},e.title??"Untitled"));if(l&&h.appendChild(b("div",{className:"task-selector"},e.selector)),i&&e.description&&h.appendChild(b("div",{className:"task-description"},e.description)),h.addEventListener("click",y=>{var E,f;(f=(E=y.target).closest)!=null&&f.call(E,".task-actions")||r(e)}),s){let y=b("div",{className:"task-actions"});if(e.status!=="done"&&o){let E=b("button",{className:"done-btn"},"\u2713 Done");E.addEventListener("click",f=>{f.stopPropagation(),o(e)}),y.appendChild(E)}if(n){let E=b("button",{className:"delete-btn"},"\u2715");E.addEventListener("click",f=>{f.stopPropagation(),n(e)}),y.appendChild(E)}h.appendChild(y)}return h}function qr(){if(!g.indicatorContainer||(g.indicatorContainer.replaceChildren(),Fa(),!g.indicatorsVisible||g.tasks.length===0))return;let e=location.pathname,t=g.tasks.filter(n=>!n.url||n.url===e);if(t.length===0)return;let a={};for(let n of t){let l=n.cssSelector||n.selector;a[l]||(a[l]=[]),a[l].push(n)}let r=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;for(let n of Object.keys(a)){let l=a[n],i;try{i=document.querySelector(n)}catch{continue}if(!i)continue;let s=i.getBoundingClientRect();if(s.width===0&&s.height===0||s.bottom<0||s.top>o||s.right<0||s.left>r)continue;let u=l.filter(h=>h.status!=="done"),c=u.length===0;if(c&&!g.sidebarShowDone)continue;let p=b("div",{className:"vibeflow-task-indicator"+(c?" all-done":"")});p.textContent=c?"\u2713":String(u.length),p.style.left=`${s.right-10}px`,p.style.top=`${s.top-10}px`;let x=l,v=c;p.addEventListener("mouseenter",()=>{g.tooltipPinned||ap(p,x)}),p.addEventListener("mouseleave",h=>{if(g.tooltipPinned)return;let y=h.relatedTarget;g.activeTooltip&&y&&(y===g.activeTooltip||g.activeTooltip.contains(y))||ns()}),p.addEventListener("click",h=>{h.stopPropagation(),x.length===1?(Fa(),os(x[0])):(Fa(),ap(p,x),g.tooltipPinned=!0)}),g.indicatorContainer.appendChild(p)}}function tp(){g.indicatorRafId||(g.indicatorRafId=requestAnimationFrame(()=>{g.indicatorRafId=null,qr()}))}function ns(){g.tooltipPinned||g.activeTooltip&&(g.activeTooltip.remove(),g.activeTooltip=null)}function Fa(){g.tooltipPinned=!1,g.activeTooltip&&(g.activeTooltip.remove(),g.activeTooltip=null)}function ap(e,t){if(!g.root)return;ns();let a=b("div",{className:"vibeflow-task-tooltip"}),r=b("button",{className:"tooltip-close-btn"},"\u2715");r.addEventListener("click",n=>{n.stopPropagation(),Fa()}),a.appendChild(r);for(let n of t){let l=ep(n,{currentPath:location.pathname,showSelector:!1,showDescription:!0,showActions:!1,onOpen:i=>{Fa(),os(i)}});a.appendChild(l)}let o=e.getBoundingClientRect();a.style.left=`${Math.min(o.right+6,window.innerWidth-330)}px`,a.style.top=`${Math.max(4,Math.min(o.top-8,window.innerHeight-420))}px`,a.addEventListener("mouseleave",ns),g.root.appendChild(a),g.activeTooltip=a}function rp(){window.addEventListener("scroll",tp,!0),window.addEventListener("resize",tp)}function op(e){let t=null;function a(r){r.composedPath().indexOf(e)===-1&&(t&&clearTimeout(t),t=setTimeout(()=>{t=null,qr()},150))}document.addEventListener("click",a,!0),document.addEventListener("keyup",a,!0)}function np(e){document.addEventListener("click",t=>{!g.tooltipPinned||!g.activeTooltip||(t.composedPath?t.composedPath():[t.target]).includes(e)||Fa()},!0)}function lp(e=document){let t=Array.from(e.querySelectorAll("*")).slice(0,50),a=!1,r=!1,o=!1;for(let n of t){for(let l of Object.keys(n)){if(!l.startsWith("__reactFiber$")&&!l.startsWith("__reactInternalInstance"))continue;a=!0;let i=n[l];if(i!=null&&i._debugSource){r=!0;break}if(i!=null&&i._debugStack){r=!0;break}i!=null&&i._debugOwner&&(o=!0)}if(r)break}return a?r?"full":o?"partial":"none":"not-react"}var sp="vibeflow-react-quality-shown";function up(){try{return!!localStorage.getItem(sp)}catch{return!1}}function is(){try{localStorage.setItem(sp,"1")}catch{}}function ss(e){if(!g.root)return;bx(),is();let a=[{icon:"\u{1F7E2}",label:"Full context",color:"#4ade80",desc:"React dev mode + source maps. Component name + source file + line.",active:e==="full"},{icon:"\u{1F7E1}",label:"Partial",color:"#fbbf24",desc:"React dev mode, but no debug stack found. Component name only.",active:e==="partial"},{icon:"\u{1F534}",label:"No context",color:"#f87171",desc:"Production build. DOM selectors only \u2014 no component or source info.",active:e==="none"}].map(y=>{let E=b("div",{className:"rq-level"+(y.active?" rq-level--active":"")});return E.appendChild(b("div",{className:"rq-level-icon"},y.icon)),E.appendChild(Object.assign(b("div",{className:"rq-level-label"},y.label),{style:`color:${y.color}`})),E.appendChild(b("div",{className:"rq-level-desc"},y.desc)),E}),r=b("div",{className:"rq-levels"},...a),n=b("div",{className:"rq-heading"},{full:"You have full context",partial:"You have partial context",none:"No React context available","not-react":"React not detected"}[e]??"React context"),l=Lx(e),i=b("div",{className:"rq-header"},n,r),s=b("div",{className:"rq-body"},...l),u=b("button",{className:"rq-close",title:"Close","aria-label":"Close"},"\u2715"),c=b("button",{className:"rq-btn rq-btn-secondary"},"Continue annotating"),p=b("div",{className:"rq-footer"},c),x=b("div",{className:"vibeflow-rq-modal",id:"vibeflow-rq-modal"},u,i,s,p),v=b("div",{className:"vibeflow-rq-overlay",id:"vibeflow-rq-overlay"},x);function h(){v.remove()}u.addEventListener("click",h),c.addEventListener("click",h),v.addEventListener("click",y=>{y.target===v&&h()}),g.root.appendChild(v)}function bx(){var e,t;(t=(e=g.root)==null?void 0:e.querySelector("#vibeflow-rq-overlay"))==null||t.remove()}function aa(e,t,a){let r=b("div",{className:"rq-feature"});r.appendChild(b("span",{className:"rq-feature-icon"},e));let o=b("div",{className:"rq-feature-text"});return o.appendChild(b("strong",null,t)),o.appendChild(b("span",null," \u2014 "+a)),r.appendChild(o),r}function ip(e){let t=b("pre",{className:"rq-codeblock"});return t.appendChild(b("code",null,e)),t}function ls(e){return b("div",{className:"rq-section-title"},e)}function Lx(e){let t=[];return t.push(ls("What is captured now")),t.push(aa("\u2705","CSS selector","always available \u2014 stable element targeting")),e==="full"?(t.push(aa("\u2705","Component name","from React fiber (_debugOwner)")),t.push(aa("\u2705","Source file + line","resolved via source maps (React 18.3+ _debugStack or legacy _debugSource)")),t.push(b("div",{className:"rq-note rq-note--success"},"You have the best possible context. Your agent receives component name, source file, and line number for each annotation.")),t):(e==="partial"&&(t.push(aa("\u2705","Component name","from React fiber (_debugOwner)")),t.push(aa("\u274C","Source file + line","no debug stack found on React fibers")),t.push(ls("How to get source file + line")),t.push(b("div",{className:"rq-note rq-note--amber"},"Source file resolution requires React dev mode with debug stacks (_debugStack / _debugSource) and source maps served by your bundler. Both are enabled by default when running in development mode.")),t.push(ip(`# Next.js
|
|
1563
1563
|
next dev (or: npm run dev)
|
|
1564
1564
|
|