@wcag-checkr/ci 1.0.0-rc.279 → 1.0.0-rc.280
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.
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/scheduled-audit-runner-BqTcRkAP.js","assets/diff-DA41zYPc.js","assets/crash-reporter-Dc5lvxvY.js","assets/ai-usage-log-C-jq4cW3.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import"./modulepreload-polyfill-B5Qt9EMX.js";import{j as e,r as c,c as L,R as M}from"./styles-DToZ04ht.js";import{u,l as B,E as G,A as H}from"./ErrorBoundary-CkIda2Fr.js";import{_ as O}from"./diff-DA41zYPc.js";import{s as N,i as q}from"./crash-reporter-Dc5lvxvY.js";import{B as A}from"./ai-usage-log-C-jq4cW3.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./scheduled-audit-runner-BqTcRkAP.js";import"./design-system-audit-DpxJrxnb.js";function $({initialUrl:t,isRunning:r,onCrawl:l,onVerifyFixes:i,onAuditThisPage:s}){const[a,n]=c.useState(t),[v,h]=c.useState(25),[m,f]=c.useState(""),[y,x]=c.useState(""),[o,b]=c.useState(!1),[k,D]=c.useState(A),[P,E]=c.useState(A[0].id),[U,W]=c.useState(null);c.useEffect(()=>{t&&!a&&n(t)},[t]),c.useEffect(()=>{let d=!1;return Promise.all([N({type:"SETTINGS_GET",key:"matrixPresets"}),N({type:"SETTINGS_GET",key:"activePresetId"})]).then(([p,g])=>{if(d)return;const I=Array.isArray(p.data)?p.data:null;D(I&&I.length>0?I:A),typeof g.data=="string"&&E(g.data)}),()=>{d=!0}},[]);function F(d){const p=k.find(g=>g.id===d);p&&(E(d),N({type:"SETTINGS_SET",key:"activePresetId",value:d}),N({type:"SETTINGS_SET",key:"stateMatrix",value:p.matrix}))}function V(){W(null);for(const[d,p]of[["Include",m.trim()],["Exclude",y.trim()]])if(p)try{new RegExp(p)}catch(g){return W(`${d} regex invalid: ${g instanceof Error?g.message:String(g)}`),!1}return!0}function z(d){if(!V())return;const p={startUrl:a.trim(),maxPages:v,includeRegex:m.trim(),excludeRegex:y.trim()};d&&i?i(p):l(p)}return e.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--v2-pad-3)",textAlign:"left"},children:[e.jsx(j,{label:"Start URL",children:e.jsx("input",{type:"url",value:a,onChange:d=>n(d.target.value),placeholder:"https://yoursite.com",disabled:r,className:"v2-mono",style:w})}),e.jsx(j,{label:"Max pages",hint:"1–200. Each page runs the full pipeline you configured.",children:e.jsx("input",{type:"number",min:1,max:200,value:v,onChange:d=>h(Math.min(200,Math.max(1,parseInt(d.target.value,10)||25))),disabled:r,className:"v2-mono",style:{...w,maxWidth:100}})}),e.jsx(j,{label:"Audit depth",hint:"State matrix preset applied to every crawled page.",children:e.jsx("select",{value:P,onChange:d=>F(d.target.value),disabled:r,style:w,children:k.map(d=>e.jsx("option",{value:d.id,children:d.name},d.id))})}),e.jsx("button",{type:"button",onClick:()=>b(d=>!d),className:"v2-eyebrow",style:{background:"none",border:"none",padding:0,cursor:"pointer",color:"var(--v2-ink-secondary)",textAlign:"left",alignSelf:"flex-start"},children:o?"− hide advanced filters":"+ show URL filters (include / exclude)"}),o&&e.jsxs(e.Fragment,{children:[e.jsx(j,{label:"Include only URLs matching",hint:"Optional regex. Empty = no filter.",children:e.jsx("input",{type:"text",value:m,onChange:d=>f(d.target.value),placeholder:"^https://example\\.com/products/",disabled:r,className:"v2-mono",style:w})}),e.jsx(j,{label:"Exclude URLs matching",hint:"Optional regex. Useful for /admin or /login while logged in.",children:e.jsx("input",{type:"text",value:y,onChange:d=>x(d.target.value),placeholder:"/admin|/dashboard|/login",disabled:r,className:"v2-mono",style:w})})]}),U&&e.jsx("p",{role:"alert",style:{color:"var(--v2-critical)",fontSize:12,margin:0,padding:"var(--v2-pad-2) var(--v2-pad-3)",border:"1px solid var(--v2-critical)",borderRadius:4,background:"rgba(207, 44, 44, 0.06)"},children:U}),e.jsxs("div",{style:{display:"flex",gap:"var(--v2-pad-2)",flexWrap:"wrap",marginTop:"var(--v2-pad-2)"},children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary",disabled:r||!a.trim(),onClick:()=>z(!1),children:r?"Crawling…":"Crawl whole site"}),i&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",disabled:r||!a.trim(),onClick:()=>z(!0),title:"Skip walkthroughs that previously passed or were human-verified",children:"Verify fixes only"}),s&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",disabled:r,onClick:s,title:"Single-page audit on the active tab (no crawl)",children:"Just this page"})]})]})}function J(){const t=u(s=>s.siteCrawlProgress),r=u(s=>s.siteCrawlStatus);function l(){N({type:"CANCEL_SITE_CRAWL"})}if(r!=="running")return null;const i=t?Math.min(100,Math.max(0,t.current/Math.max(1,t.total)*100)):0;return e.jsxs("div",{role:"status","aria-live":"polite",style:{background:"var(--v2-bg-elev)",border:"1px solid var(--v2-border)",borderRadius:6,padding:"var(--v2-pad-4)",display:"flex",flexDirection:"column",gap:"var(--v2-pad-3)"},children:[e.jsxs("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--v2-pad-3)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,color:"var(--v2-action)"},children:"crawling…"}),e.jsx("p",{className:"v2-mono",style:{margin:0,fontSize:12,fontWeight:600,color:"var(--v2-ink-primary)",fontVariantNumeric:"tabular-nums"},children:t?`${t.current} / ${t.total}`:"…"})]}),e.jsx("div",{role:"progressbar","aria-valuenow":(t==null?void 0:t.current)??0,"aria-valuemin":0,"aria-valuemax":(t==null?void 0:t.total)??1,"aria-label":"Crawl progress",style:{height:8,background:"var(--v2-bg-elev-2)",borderRadius:4,overflow:"hidden"},children:e.jsx("div",{style:{height:"100%",width:`${i}%`,background:"var(--v2-action)",transition:"width 240ms ease"}})}),(t==null?void 0:t.url)&&e.jsxs("div",{children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:4},children:"current page"}),e.jsx("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-secondary)",wordBreak:"break-all"},children:t.url})]}),(t==null?void 0:t.lastViolations)!==void 0&&t.lastViolations>0&&e.jsxs("p",{className:"v2-mono",style:{margin:0,fontSize:11,color:"var(--v2-ink-tertiary)",fontVariantNumeric:"tabular-nums"},children:["last page: ",t.lastViolations," axe violation",t.lastViolations===1?"":"s"]}),e.jsx("div",{children:e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:l,children:"Cancel crawl"})})]})}function j({label:t,hint:r,children:l}){return e.jsxs("label",{style:{display:"flex",flexDirection:"column",gap:4},children:[e.jsx("span",{className:"v2-eyebrow",style:{color:"var(--v2-ink-secondary)"},children:t}),l,r&&e.jsx("span",{style:{fontSize:11,color:"var(--v2-ink-tertiary)",lineHeight:1.4},children:r})]})}const w={fontFamily:"var(--v2-body)",fontSize:12,padding:"8px 10px",background:"var(--v2-bg)",color:"var(--v2-ink-primary)",border:"1px solid var(--v2-border-strong)",borderRadius:4,outline:"none"};function K(){const t=u(o=>o.siteCrawlReport),r=u(o=>o.siteCrawlStatus),l=u(o=>o.status),i=r==="running"||l==="running",[s,a]=c.useState(null);c.useEffect(()=>{let o=!1;return chrome.tabs.query({active:!0,currentWindow:!0}).then(b=>{var k;o||a(((k=b[0])==null?void 0:k.url)??null)}),()=>{o=!0}},[]);const[n,v]=c.useState(!1);function h(o,b=!1){o.startUrl&&(u.getState().setSiteCrawlStatus("running"),u.getState().setSiteCrawlReport(null),u.getState().setSiteCrawlError(null),B({type:"START_SITE_CRAWL",startUrl:o.startUrl,maxPages:o.maxPages,...o.includeRegex?{includeRegex:o.includeRegex}:{},...o.excludeRegex?{excludeRegex:o.excludeRegex}:{},...b?{verifyFixesOnly:!0}:{}}))}function m(){B({type:"START_AUDIT",mode:"full-page"}),u.getState().startNewScan()}if(i)return e.jsx("section",{"aria-label":"Audit in progress",style:{padding:"var(--v2-pad-5) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)"},children:e.jsx(J,{})});if(!t)return e.jsxs("section",{"aria-label":"No audit yet",style:{padding:"var(--v2-pad-6) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)",maxWidth:640,margin:"0 auto"},children:[e.jsx("p",{className:"v2-eyebrow",style:{marginBottom:"var(--v2-pad-2)"},children:"new audit"}),e.jsx("h1",{className:"v2-display",style:{fontSize:28,fontWeight:500,letterSpacing:"-0.02em",color:"var(--v2-ink-primary)",margin:0,marginBottom:"var(--v2-pad-2)"},children:"Configure your crawl."}),e.jsx("p",{style:{color:"var(--v2-ink-secondary)",margin:0,marginBottom:"var(--v2-pad-5)",maxWidth:520},children:"The crawler follows internal links from the start URL, same-origin only. Each page runs your full audit pipeline (axe + DOM analyzers + AI walkthroughs). Findings appear below as a single unified list."}),e.jsx($,{initialUrl:s??"",isRunning:i,onCrawl:o=>h(o,!1),onAuditThisPage:m})]});const f=(t.totalWalkthroughFindings??0)+t.totalUniqueViolations,y=(t.walkthroughAcknowledgements??[]).length,x=t.totalNeedsReview;return e.jsxs("section",{"aria-label":"Audit summary",style:{padding:"var(--v2-pad-6) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)"},children:[e.jsxs("div",{style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"var(--v2-pad-6)"},children:[e.jsx(Y,{grade:t.siteGrade}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"var(--v2-pad-3)"},children:[e.jsxs("p",{className:"v2-eyebrow",style:{margin:0},children:["site grade · ",t.pagesAudited," page",t.pagesAudited===1?"":"s"]}),e.jsx("h1",{className:"v2-display",style:{fontSize:22,fontWeight:500,letterSpacing:"-0.01em",color:"var(--v2-ink-primary)",margin:0,lineHeight:1.25},children:f===0&&x===0?"All clear — nothing open.":`${f+x} finding${f+x===1?"":"s"} to address.`}),e.jsx(Q,{openCount:f,reviewCount:x,verifiedCount:y,axeCount:t.totalUniqueViolations,walkthroughCount:t.totalWalkthroughFindings??0}),e.jsxs("div",{style:{display:"flex",gap:"var(--v2-pad-2)",marginTop:"var(--v2-pad-2)",flexWrap:"wrap"},children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary",onClick:()=>h({startUrl:t.startUrl,maxPages:25,includeRegex:"",excludeRegex:""},!1),title:`Re-crawl ${t.startUrl} (same options)`,children:"Re-crawl"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:()=>h({startUrl:t.startUrl,maxPages:25,includeRegex:"",excludeRegex:""},!0),title:"Skip walkthroughs that previously passed or were human-verified",children:"Verify fixes only"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",onClick:()=>v(o=>!o),"aria-expanded":n,children:n?"Hide options":"Adjust options"})]})]})]}),n&&e.jsx("div",{style:{marginTop:"var(--v2-pad-5)",paddingTop:"var(--v2-pad-4)",borderTop:"1px solid var(--v2-border)",maxWidth:640},children:e.jsx($,{initialUrl:t.startUrl,isRunning:i,onCrawl:o=>h(o,!1),onVerifyFixes:o=>h(o,!0),onAuditThisPage:m})})]})}function Y({grade:t}){const r={A:"var(--v2-grade-a)",B:"var(--v2-grade-b)",C:"var(--v2-grade-c)",D:"var(--v2-grade-d)",F:"var(--v2-grade-f)"};return e.jsx("div",{"aria-label":`Grade ${t}`,role:"img",style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:140},children:e.jsx("span",{className:"v2-display",style:{fontSize:132,lineHeight:1,fontWeight:500,color:r[t],letterSpacing:"-0.04em",fontVariationSettings:'"opsz" 144'},children:t})})}function Q({openCount:t,reviewCount:r,verifiedCount:l,axeCount:i,walkthroughCount:s}){return e.jsxs("dl",{style:{display:"flex",gap:"var(--v2-pad-4)",flexWrap:"wrap",margin:0,color:"var(--v2-ink-secondary)",fontSize:12},children:[e.jsx(S,{term:"open",value:t,tone:t>0?"attention":"neutral"}),e.jsx(S,{term:"review",value:r,tone:r>0?"review":"neutral"}),e.jsx(S,{term:"verified",value:l,tone:l>0?"positive":"neutral"}),e.jsx("span",{style:{color:"var(--v2-ink-faint)"},children:"·"}),e.jsx(S,{term:"axe",value:i,tone:"neutral"}),e.jsx(S,{term:"walkthrough",value:s,tone:"neutral"})]})}function S({term:t,value:r,tone:l}){const i={attention:"var(--v2-critical)",review:"var(--v2-needs-review)",positive:"var(--v2-verified)",neutral:"var(--v2-ink-secondary)"};return e.jsxs("div",{style:{display:"inline-flex",alignItems:"baseline",gap:6},children:[e.jsx("dt",{className:"v2-eyebrow",style:{display:"inline",margin:0,color:"var(--v2-ink-tertiary)"},children:t}),e.jsx("dd",{className:"v2-mono",style:{margin:0,fontWeight:600,fontSize:13,color:i[l],fontVariantNumeric:"tabular-nums"},children:r})]})}function X({row:t}){return e.jsxs("details",{style:{background:"var(--v2-bg-elev)",border:"1px solid var(--v2-border)",borderRadius:6,overflow:"hidden"},children:[e.jsxs("summary",{style:{cursor:"pointer",padding:"var(--v2-pad-3) var(--v2-pad-4)",listStyle:"none",display:"flex",alignItems:"flex-start",gap:"var(--v2-pad-3)"},children:[e.jsx(Z,{row:t}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx(ee,{row:t}),e.jsx(te,{row:t})]}),e.jsx(re,{})]}),e.jsx("div",{style:{padding:"0 var(--v2-pad-4) var(--v2-pad-4)",borderTop:"1px solid var(--v2-border)"},children:e.jsx(ae,{row:t})})]})}function Z({row:t}){if(t.kind==="walkthrough-ack")return e.jsx("span",{className:"v2-chip v2-chip-verified","aria-label":"Status: human verified",children:"verified"});if(t.kind==="needs-review")return e.jsx("span",{className:"v2-chip v2-chip-review","aria-label":"Status: needs human review",children:"review"});if(t.kind==="walkthrough-fail")return e.jsx("span",{className:t.verdict==="fail"?"v2-chip v2-chip-serious":"v2-chip v2-chip-moderate","aria-label":`Severity: ${t.verdict}`,children:t.verdict});const r={critical:"v2-chip-critical",serious:"v2-chip-serious",moderate:"v2-chip-moderate",minor:"v2-chip-minor"};return e.jsx("span",{className:`v2-chip ${r[t.impact]}`,"aria-label":`Severity: ${t.impact}`,children:t.impact})}function ee({row:t}){const r=t.kind==="walkthrough-fail"||t.kind==="walkthrough-ack"||t.kind==="needs-review"||t.kind==="axe"?t.criterion:null,l=t.kind==="walkthrough-fail"?`AI walkthrough ${t.verdict} on this criterion.`:t.kind==="walkthrough-ack"?"Human-verified by an auditor.":(t.kind==="needs-review",t.description);return e.jsxs("p",{style:{margin:0,marginBottom:4,color:"var(--v2-ink-primary)",fontSize:13,fontWeight:500,lineHeight:1.4},children:[r&&e.jsxs("span",{className:"v2-mono",style:{fontSize:11,fontWeight:600,color:"var(--v2-ink-tertiary)",marginRight:8},children:["WCAG ",r]}),l]})}function te({row:t}){const r=t.kind==="axe"||t.kind==="needs-review"?t.pages.length:1,l=t.kind==="axe"||t.kind==="needs-review"?t.selector:null,i=t.kind==="walkthrough-fail"||t.kind==="walkthrough-ack"?t.pageUrl:null;return e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--v2-pad-2)",flexWrap:"wrap"},children:[l&&e.jsx("code",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",background:"var(--v2-bg-elev-2)",padding:"2px 6px",borderRadius:2,wordBreak:"break-all"},children:l}),i&&e.jsx("span",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-tertiary)",wordBreak:"break-all"},children:i}),r>1&&e.jsxs("span",{className:"v2-eyebrow",style:{marginLeft:"auto"},children:["on ",r," pages"]})]})}function re(){return e.jsx("span",{"aria-hidden":"true",style:{color:"var(--v2-ink-tertiary)",fontFamily:"var(--v2-mono)",fontSize:12,marginLeft:8,marginTop:2},children:"⏵"})}function ae({row:t}){return t.kind==="walkthrough-fail"?e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[e.jsx(C,{label:"AI reasoning",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6},children:t.reasoning})}),e.jsxs(T,{children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",disabled:!0,children:"Re-run walkthrough"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",disabled:!0,children:"Mark verified manually"})]}),e.jsx(ne,{children:"Inline ack flow + re-run wiring lands in the next rc — for now, open the v1 UI (the toggle in Settings) to ack this finding."})]}):t.kind==="walkthrough-ack"?e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[e.jsx(C,{label:"What the human verified",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6},children:t.reasoning})}),e.jsxs("p",{style:{color:"var(--v2-ink-tertiary)",fontSize:11,margin:0,marginTop:"var(--v2-pad-2)"},children:["Original AI verdict: ",e.jsx("strong",{children:t.verdict}),". Now treated as pass for conformance."]})]}):t.kind==="needs-review"?e.jsx(ie,{row:t}):e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[e.jsx(C,{label:"Affected",children:e.jsxs("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:4},children:[t.pages.slice(0,8).map(r=>e.jsx("li",{children:e.jsx("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",textDecoration:"underline",textDecorationColor:"var(--v2-ink-faint)",textUnderlineOffset:2},children:r.url})},r.url)),t.pages.length>8&&e.jsxs("li",{className:"v2-eyebrow",children:["+ ",t.pages.length-8," more"]})]})}),e.jsxs(T,{children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",disabled:!0,children:"Show fix recipe"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",disabled:!0,children:"Mark verified manually"})]})]})}function ie({row:t}){const[r,l]=c.useState(!1);return e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[t.failureSummary&&e.jsx(C,{label:"AI assessment",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6,whiteSpace:"pre-wrap"},children:t.failureSummary})}),e.jsx(C,{label:"Affected",children:e.jsx("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:4},children:t.pages.slice(0,8).map(i=>e.jsx("li",{children:e.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",textDecoration:"underline",textDecorationColor:"var(--v2-ink-faint)",textUnderlineOffset:2},children:i.url})},i.url))})}),e.jsx(T,{children:e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:()=>l(i=>!i),children:r?"Cancel":"Mark verified manually"})}),r&&e.jsxs("div",{style:{marginTop:"var(--v2-pad-3)",padding:"var(--v2-pad-3)",border:"1px solid var(--v2-border-strong)",borderRadius:4,background:"var(--v2-bg)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:"var(--v2-pad-2)"},children:"verification note · required"}),e.jsx("p",{style:{color:"var(--v2-ink-tertiary)",fontSize:11,margin:0,marginBottom:"var(--v2-pad-2)"},children:"Ack wiring on this surface lands in the next rc; for now use the existing v1 ack flow on the Crawl tab."})]})]})}function C({label:t,children:r}){return e.jsxs("div",{style:{marginBottom:"var(--v2-pad-3)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:6},children:t}),r]})}function T({children:t}){return e.jsx("div",{style:{display:"flex",gap:"var(--v2-pad-2)",flexWrap:"wrap",marginTop:"var(--v2-pad-2)"},children:t})}function ne({children:t}){return e.jsx("p",{style:{color:"var(--v2-ink-tertiary)",fontSize:11,margin:0,marginTop:"var(--v2-pad-2)",fontStyle:"italic"},children:t})}function le(){const t=u(n=>n.siteCrawlReport),[r,l]=c.useState("open"),i=c.useMemo(()=>t?de(t.pages,t.findingGroups??[]):[],[t]),s=c.useMemo(()=>r==="all"?i:i.filter(n=>r==="verified"?n.kind==="walkthrough-ack":r==="review"?n.kind==="needs-review":r==="open"?n.kind==="axe"||n.kind==="walkthrough-fail":!0),[i,r]);if(!t)return null;const a={all:i.length,open:i.filter(n=>n.kind==="axe"||n.kind==="walkthrough-fail").length,review:i.filter(n=>n.kind==="needs-review").length,verified:i.filter(n=>n.kind==="walkthrough-ack").length};return e.jsxs("section",{"aria-labelledby":"findings-heading",style:{padding:"var(--v2-pad-5) var(--v2-pad-5) var(--v2-pad-7)"},children:[e.jsxs("header",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--v2-pad-3)",marginBottom:"var(--v2-pad-4)",flexWrap:"wrap"},children:[e.jsx("h2",{id:"findings-heading",className:"v2-display",style:{fontSize:20,fontWeight:500,letterSpacing:"-0.01em",color:"var(--v2-ink-primary)",margin:0},children:"Findings"}),e.jsx(se,{filter:r,setFilter:l,counts:a})]}),s.length===0?e.jsx(oe,{filter:r}):e.jsx("ul",{"aria-label":`${r} findings, ${s.length} items`,style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"var(--v2-pad-2)"},children:s.map((n,v)=>e.jsx("li",{style:{animation:`v2-row-in 240ms ease ${Math.min(v,12)*30}ms both`},children:e.jsx(X,{row:n})},n.key))})]})}function se({filter:t,setFilter:r,counts:l}){const i=[{id:"open",label:"Open"},{id:"review",label:"Review"},{id:"verified",label:"Verified"},{id:"all",label:"All"}];return e.jsx("div",{role:"tablist","aria-label":"Filter findings",style:{display:"inline-flex",gap:4,background:"var(--v2-bg-elev)",padding:3,borderRadius:6,border:"1px solid var(--v2-border)"},children:i.map(s=>{const a=t===s.id;return e.jsxs("button",{type:"button",role:"tab","aria-selected":a,onClick:()=>r(s.id),style:{fontFamily:"var(--v2-body)",fontSize:11,padding:"5px 10px",borderRadius:4,border:"none",cursor:"pointer",background:a?"var(--v2-bg-elev-2)":"transparent",color:a?"var(--v2-ink-primary)":"var(--v2-ink-secondary)",fontWeight:a?600:500,transition:"background 120ms ease, color 120ms ease",display:"inline-flex",alignItems:"baseline",gap:5},children:[s.label,e.jsx("span",{className:"v2-mono",style:{fontSize:10,color:"var(--v2-ink-tertiary)",fontVariantNumeric:"tabular-nums"},children:l[s.id]})]},s.id)})})}function oe({filter:t}){const l={open:{headline:"Nothing open.",sub:"No axe violations or AI walkthrough failures across the audited pages. Switch to All to see everything, or to Verified for a record of acknowledged items."},review:{headline:"No items awaiting review.",sub:"AI walkthroughs returned definitive verdicts (or human verifications) for every criterion that needed judgment."},verified:{headline:"No human verifications recorded.",sub:"When you mark a walkthrough finding as manually verified, it appears here with your note + timestamp."},all:{headline:"Nothing to show.",sub:"No audit data yet — run a scan to begin."}}[t];return e.jsxs("div",{role:"status","aria-live":"polite",style:{padding:"var(--v2-pad-6) var(--v2-pad-4)",textAlign:"center",border:"1px dashed var(--v2-border)",borderRadius:6},children:[e.jsx("p",{className:"v2-display",style:{fontSize:18,fontWeight:500,color:"var(--v2-ink-primary)",margin:0,marginBottom:"var(--v2-pad-2)"},children:l.headline}),e.jsx("p",{style:{color:"var(--v2-ink-secondary)",margin:0,maxWidth:440,marginInline:"auto"},children:l.sub})]})}function de(t,r){const l=[];for(const a of r)a.needsReview?l.push({kind:"needs-review",key:`nr::${a.ruleId}::${a.representativeSelector}`,criterion:a.wcagCriterion,ruleId:a.ruleId,description:a.axeDescription,selector:a.representativeSelector,failureSummary:a.failureSummary,pages:a.pages,group:a}):l.push({kind:"axe",key:`axe::${a.ruleId}::${a.representativeSelector}`,criterion:a.wcagCriterion,ruleId:a.ruleId,impact:a.impact,description:a.axeDescription,selector:a.representativeSelector,pages:a.pages,isShared:a.isShared});const i=new Set;for(const a of t){for(const n of a.walkthroughFindings??[]){const v=`wt-fail::${n.criterionId}::${n.pageUrl}`;i.has(v)||(i.add(v),l.push({kind:"walkthrough-fail",key:v,criterion:n.criterionId,verdict:n.verdict,impact:n.impact,reasoning:n.reasoning,pageUrl:n.pageUrl}))}for(const n of a.walkthroughAcknowledgements??[]){const v=`wt-ack::${n.criterionId}::${n.pageUrl}`;i.has(v)||(i.add(v),l.push({kind:"walkthrough-ack",key:v,criterion:n.criterionId,verdict:n.verdict,reasoning:n.reasoning,pageUrl:n.pageUrl}))}}const s={critical:0,serious:1,moderate:2,minor:3,"needs-review":4,ack:5};return l.sort((a,n)=>{const v=a.kind==="walkthrough-ack"?s.ack:a.kind==="needs-review"?s["needs-review"]:s[a.impact],h=n.kind==="walkthrough-ack"?s.ack:n.kind==="needs-review"?s["needs-review"]:s[n.impact];return(v??99)-(h??99)}),l}function ce(){var i,s;const t=u(a=>a.siteCrawlReport),r=u(a=>a.results),l=(t==null?void 0:t.startUrl)??((i=r[0])==null?void 0:i.pageUrl)??((s=r[0])==null?void 0:s.scope)??null;return e.jsxs("header",{role:"banner",style:{display:"flex",alignItems:"center",gap:"var(--v2-pad-4)",padding:"var(--v2-pad-3) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)",background:"var(--v2-bg)",minHeight:44},children:[e.jsx("a",{href:"#main-content",className:"v2-skip-link",style:{position:"absolute",left:-9999},onFocus:a=>{a.currentTarget.style.left="var(--v2-pad-4)",a.currentTarget.style.top="var(--v2-pad-4)"},onBlur:a=>{a.currentTarget.style.left="-9999px"},children:"Skip to main content"}),e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--v2-pad-2)"},children:[e.jsx("span",{className:"v2-display",style:{fontSize:18,fontWeight:600,letterSpacing:"-0.01em",color:"var(--v2-ink-primary)"},children:"wcagcheckr"}),e.jsx("span",{className:"v2-eyebrow",children:"v2"})]}),l&&e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--v2-pad-2)",marginLeft:"var(--v2-pad-4)",minWidth:0,flex:1},children:[e.jsx("span",{className:"v2-eyebrow",children:"scope"}),e.jsx("span",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},title:l,children:l})]}),e.jsxs("nav",{"aria-label":"Application",style:{display:"flex",gap:"var(--v2-pad-1)",marginLeft:"auto"},children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:()=>{chrome.storage.local.set({v2UiEnabled:!1})},"aria-label":"Switch back to the classic UI",title:"Switch back to the classic v1 UI",children:"Use v1"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm","aria-label":"Settings",title:"Settings (coming soon)",children:"Settings"})]})]})}function ve(){const t=u(r=>r.setSiteCrawlReport);return c.useEffect(()=>{let r=!1;return O(async()=>{const{loadSiteCrawlReport:l}=await import("./scheduled-audit-runner-BqTcRkAP.js").then(i=>i.aG);return{loadSiteCrawlReport:l}},__vite__mapDeps([0,1,2,3])).then(({loadSiteCrawlReport:l})=>{l().then(i=>{r||i&&u.setState({siteCrawlReport:i})}).catch(()=>{})}),()=>{r=!0}},[t]),e.jsxs("div",{className:"v2-root",children:[e.jsx(ce,{}),e.jsxs("main",{id:"main-content","aria-label":"wcagcheckr findings",children:[e.jsx(K,{}),e.jsx(le,{})]})]})}q("side-panel");const R="v2UiEnabled";function ue(){const[t,r]=c.useState(null);return c.useEffect(()=>{let l=!1;chrome.storage.local.get(R).then(s=>{l||r(!!s[R])}).catch(()=>r(!1));const i=(s,a)=>{var n;a==="local"&&R in s&&r(!!((n=s[R])!=null&&n.newValue))};return chrome.storage.onChanged.addListener(i),()=>{l=!0,chrome.storage.onChanged.removeListener(i)}},[]),t===null?null:t?e.jsx(ve,{}):e.jsx(H,{})}const _=document.getElementById("root");if(!_)throw new Error("side-panel: #root not found");L(_).render(e.jsx(M.StrictMode,{children:e.jsx(G,{children:e.jsx(ue,{})})}));
|
package/dist/manifest.json
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"name": "wcagcheckr",
|
|
4
4
|
"description": "Audit components across hover, focus, dark mode, forced colors, RTL — every state your users actually encounter. Per-component baselines surface only NEW violations.",
|
|
5
|
-
"version": "1.0.0.
|
|
6
|
-
"version_name": "1.0.0-rc.
|
|
5
|
+
"version": "1.0.0.280",
|
|
6
|
+
"version_name": "1.0.0-rc.280",
|
|
7
7
|
"author": "Locustware",
|
|
8
8
|
"homepage_url": "https://wcagcheckr.com",
|
|
9
9
|
"icons": {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>WCAG Component Auditor</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/side-panel-
|
|
7
|
+
<script type="module" crossorigin src="/assets/side-panel-4XQ0zqhs.js"></script>
|
|
8
8
|
<link rel="modulepreload" crossorigin href="/assets/modulepreload-polyfill-B5Qt9EMX.js">
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/_commonjsHelpers-Cpj98o6Y.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/crash-reporter-Dc5lvxvY.js">
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wcag-checkr/ci",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.280",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Headless wcagcheckr accessibility audit runner for CI/CD pipelines. Drives the wcagcheckr Chrome extension via Playwright, runs full-page audits across the state matrix (108 combinations: hover, focus, dark mode, RTL, breakpoints), outputs JSON / SARIF / JUnit, exits with severity-aware codes.",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/scheduled-audit-runner-BqTcRkAP.js","assets/diff-DA41zYPc.js","assets/crash-reporter-Dc5lvxvY.js","assets/ai-usage-log-C-jq4cW3.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import"./modulepreload-polyfill-B5Qt9EMX.js";import{r as v,j as e,c as S,R as N}from"./styles-DToZ04ht.js";import{u as d,l as k,E as C,A as R}from"./ErrorBoundary-CkIda2Fr.js";import{_ as A}from"./diff-DA41zYPc.js";import{i as I}from"./crash-reporter-Dc5lvxvY.js";import"./_commonjsHelpers-Cpj98o6Y.js";import"./ai-usage-log-C-jq4cW3.js";import"./scheduled-audit-runner-BqTcRkAP.js";import"./design-system-audit-DpxJrxnb.js";function W(){const r=d(c=>c.siteCrawlReport),t=d(c=>c.siteCrawlStatus),s=d(c=>c.status),i=d(c=>c.siteCrawlProgress),l=t==="running"||s==="running",[a,n]=v.useState(null);v.useEffect(()=>{let c=!1;return chrome.tabs.query({active:!0,currentWindow:!0}).then(f=>{var b;c||n(((b=f[0])==null?void 0:b.url)??null)}),()=>{c=!0}},[]);function o(){k({type:"START_AUDIT",mode:"full-page"}),d.getState().startNewScan()}function p(c=!1){const f=(r==null?void 0:r.startUrl)??a;f&&(d.getState().setSiteCrawlStatus("running"),d.getState().setSiteCrawlReport(null),d.getState().setSiteCrawlError(null),k({type:"START_SITE_CRAWL",startUrl:f,maxPages:25,...c?{verifyFixesOnly:!0}:{}}))}if(!r)return e.jsxs("section",{"aria-label":"No audit yet",style:{padding:"var(--v2-pad-7) var(--v2-pad-5)",textAlign:"center",borderBottom:"1px solid var(--v2-border)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{marginBottom:"var(--v2-pad-2)"},children:l?"audit in progress":"waiting for audit"}),e.jsx("h1",{className:"v2-display",style:{fontSize:32,fontWeight:500,letterSpacing:"-0.02em",color:"var(--v2-ink-primary)",margin:0,marginBottom:"var(--v2-pad-3)"},children:l?"Running…":"Run an audit to begin."}),e.jsx("p",{style:{color:"var(--v2-ink-secondary)",maxWidth:480,margin:"0 auto",marginBottom:"var(--v2-pad-5)"},children:l&&i?`Page ${i.current} of ${i.total} — ${i.url}`:"Crawl a site or audit the active tab. Findings appear here as a single list — axe violations, AI walkthrough verdicts, and items needing human review use the same row shape with the same actions."}),e.jsxs("div",{style:{display:"inline-flex",gap:"var(--v2-pad-2)"},children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary",disabled:l,onClick:o,children:l?"Auditing…":"Audit this page"}),a&&e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",disabled:l,onClick:()=>p(!1),title:"Crawl up to 25 pages from this URL (same origin)",children:"Crawl whole site"})]})]});const g=(r.totalWalkthroughFindings??0)+r.totalUniqueViolations,w=(r.walkthroughAcknowledgements??[]).length,m=r.totalNeedsReview;return e.jsxs("section",{"aria-label":"Audit summary",style:{display:"grid",gridTemplateColumns:"auto 1fr",gap:"var(--v2-pad-6)",padding:"var(--v2-pad-6) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)",background:"var(--v2-bg)"},children:[e.jsx(U,{grade:r.siteGrade}),e.jsxs("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",gap:"var(--v2-pad-3)"},children:[e.jsxs("p",{className:"v2-eyebrow",style:{margin:0},children:["site grade · ",r.pagesAudited," page",r.pagesAudited===1?"":"s"]}),e.jsx("h1",{className:"v2-display",style:{fontSize:22,fontWeight:500,letterSpacing:"-0.01em",color:"var(--v2-ink-primary)",margin:0,lineHeight:1.25},children:g===0&&m===0?"All clear — nothing open.":`${g+m} finding${g+m===1?"":"s"} to address.`}),e.jsx(T,{openCount:g,reviewCount:m,verifiedCount:w,axeCount:r.totalUniqueViolations,walkthroughCount:r.totalWalkthroughFindings??0}),e.jsxs("div",{style:{display:"flex",gap:"var(--v2-pad-2)",marginTop:"var(--v2-pad-2)"},children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary",disabled:l,onClick:()=>p(!1),title:`Re-crawl ${r.startUrl} (up to 25 pages, same origin)`,children:l?"Re-crawling…":"Re-crawl"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost",disabled:l,onClick:()=>p(!0),title:"Re-run audit but skip walkthroughs that already passed or were human-verified",children:l?"Verifying…":"Verify fixes only"})]}),l&&i&&e.jsxs("p",{className:"v2-eyebrow",style:{marginTop:"var(--v2-pad-2)",color:"var(--v2-ink-secondary)"},children:["page ",i.current," of ",i.total," · ",i.url]})]})]})}function U({grade:r}){const t={A:"var(--v2-grade-a)",B:"var(--v2-grade-b)",C:"var(--v2-grade-c)",D:"var(--v2-grade-d)",F:"var(--v2-grade-f)"};return e.jsx("div",{"aria-label":`Grade ${r}`,role:"img",style:{display:"flex",alignItems:"center",justifyContent:"center",minWidth:140},children:e.jsx("span",{className:"v2-display",style:{fontSize:132,lineHeight:1,fontWeight:500,color:t[r],letterSpacing:"-0.04em",fontVariationSettings:'"opsz" 144'},children:r})})}function T({openCount:r,reviewCount:t,verifiedCount:s,axeCount:i,walkthroughCount:l}){return e.jsxs("dl",{style:{display:"flex",gap:"var(--v2-pad-4)",flexWrap:"wrap",margin:0,color:"var(--v2-ink-secondary)",fontSize:12},children:[e.jsx(u,{term:"open",value:r,tone:r>0?"attention":"neutral"}),e.jsx(u,{term:"review",value:t,tone:t>0?"review":"neutral"}),e.jsx(u,{term:"verified",value:s,tone:s>0?"positive":"neutral"}),e.jsx("span",{style:{color:"var(--v2-ink-faint)"},children:"·"}),e.jsx(u,{term:"axe",value:i,tone:"neutral"}),e.jsx(u,{term:"walkthrough",value:l,tone:"neutral"})]})}function u({term:r,value:t,tone:s}){const i={attention:"var(--v2-critical)",review:"var(--v2-needs-review)",positive:"var(--v2-verified)",neutral:"var(--v2-ink-secondary)"};return e.jsxs("div",{style:{display:"inline-flex",alignItems:"baseline",gap:6},children:[e.jsx("dt",{className:"v2-eyebrow",style:{display:"inline",margin:0,color:"var(--v2-ink-tertiary)"},children:r}),e.jsx("dd",{className:"v2-mono",style:{margin:0,fontWeight:600,fontSize:13,color:i[s],fontVariantNumeric:"tabular-nums"},children:t})]})}function z({row:r}){return e.jsxs("details",{style:{background:"var(--v2-bg-elev)",border:"1px solid var(--v2-border)",borderRadius:6,overflow:"hidden"},children:[e.jsxs("summary",{style:{cursor:"pointer",padding:"var(--v2-pad-3) var(--v2-pad-4)",listStyle:"none",display:"flex",alignItems:"flex-start",gap:"var(--v2-pad-3)"},children:[e.jsx($,{row:r}),e.jsxs("div",{style:{flex:1,minWidth:0},children:[e.jsx(B,{row:r}),e.jsx(E,{row:r})]}),e.jsx(D,{})]}),e.jsx("div",{style:{padding:"0 var(--v2-pad-4) var(--v2-pad-4)",borderTop:"1px solid var(--v2-border)"},children:e.jsx(F,{row:r})})]})}function $({row:r}){if(r.kind==="walkthrough-ack")return e.jsx("span",{className:"v2-chip v2-chip-verified","aria-label":"Status: human verified",children:"verified"});if(r.kind==="needs-review")return e.jsx("span",{className:"v2-chip v2-chip-review","aria-label":"Status: needs human review",children:"review"});if(r.kind==="walkthrough-fail")return e.jsx("span",{className:r.verdict==="fail"?"v2-chip v2-chip-serious":"v2-chip v2-chip-moderate","aria-label":`Severity: ${r.verdict}`,children:r.verdict});const t={critical:"v2-chip-critical",serious:"v2-chip-serious",moderate:"v2-chip-moderate",minor:"v2-chip-minor"};return e.jsx("span",{className:`v2-chip ${t[r.impact]}`,"aria-label":`Severity: ${r.impact}`,children:r.impact})}function B({row:r}){const t=r.kind==="walkthrough-fail"||r.kind==="walkthrough-ack"||r.kind==="needs-review"||r.kind==="axe"?r.criterion:null,s=r.kind==="walkthrough-fail"?`AI walkthrough ${r.verdict} on this criterion.`:r.kind==="walkthrough-ack"?"Human-verified by an auditor.":(r.kind==="needs-review",r.description);return e.jsxs("p",{style:{margin:0,marginBottom:4,color:"var(--v2-ink-primary)",fontSize:13,fontWeight:500,lineHeight:1.4},children:[t&&e.jsxs("span",{className:"v2-mono",style:{fontSize:11,fontWeight:600,color:"var(--v2-ink-tertiary)",marginRight:8},children:["WCAG ",t]}),s]})}function E({row:r}){const t=r.kind==="axe"||r.kind==="needs-review"?r.pages.length:1,s=r.kind==="axe"||r.kind==="needs-review"?r.selector:null,i=r.kind==="walkthrough-fail"||r.kind==="walkthrough-ack"?r.pageUrl:null;return e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--v2-pad-2)",flexWrap:"wrap"},children:[s&&e.jsx("code",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",background:"var(--v2-bg-elev-2)",padding:"2px 6px",borderRadius:2,wordBreak:"break-all"},children:s}),i&&e.jsx("span",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-tertiary)",wordBreak:"break-all"},children:i}),t>1&&e.jsxs("span",{className:"v2-eyebrow",style:{marginLeft:"auto"},children:["on ",t," pages"]})]})}function D(){return e.jsx("span",{"aria-hidden":"true",style:{color:"var(--v2-ink-tertiary)",fontFamily:"var(--v2-mono)",fontSize:12,marginLeft:8,marginTop:2},children:"⏵"})}function F({row:r}){return r.kind==="walkthrough-fail"?e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[e.jsx(h,{label:"AI reasoning",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6},children:r.reasoning})}),e.jsxs(x,{children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",disabled:!0,children:"Re-run walkthrough"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",disabled:!0,children:"Mark verified manually"})]}),e.jsx(V,{children:"Inline ack flow + re-run wiring lands in the next rc — for now, open the v1 UI (the toggle in Settings) to ack this finding."})]}):r.kind==="walkthrough-ack"?e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[e.jsx(h,{label:"What the human verified",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6},children:r.reasoning})}),e.jsxs("p",{style:{color:"var(--v2-ink-tertiary)",fontSize:11,margin:0,marginTop:"var(--v2-pad-2)"},children:["Original AI verdict: ",e.jsx("strong",{children:r.verdict}),". Now treated as pass for conformance."]})]}):r.kind==="needs-review"?e.jsx(_,{row:r}):e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[e.jsx(h,{label:"Affected",children:e.jsxs("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:4},children:[r.pages.slice(0,8).map(t=>e.jsx("li",{children:e.jsx("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",textDecoration:"underline",textDecorationColor:"var(--v2-ink-faint)",textUnderlineOffset:2},children:t.url})},t.url)),r.pages.length>8&&e.jsxs("li",{className:"v2-eyebrow",children:["+ ",r.pages.length-8," more"]})]})}),e.jsxs(x,{children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",disabled:!0,children:"Show fix recipe"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",disabled:!0,children:"Mark verified manually"})]})]})}function _({row:r}){const[t,s]=v.useState(!1);return e.jsxs("div",{style:{paddingTop:"var(--v2-pad-3)"},children:[r.failureSummary&&e.jsx(h,{label:"AI assessment",children:e.jsx("p",{style:{margin:0,color:"var(--v2-ink-secondary)",fontSize:12,lineHeight:1.6,whiteSpace:"pre-wrap"},children:r.failureSummary})}),e.jsx(h,{label:"Affected",children:e.jsx("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:4},children:r.pages.slice(0,8).map(i=>e.jsx("li",{children:e.jsx("a",{href:i.url,target:"_blank",rel:"noopener noreferrer",className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",textDecoration:"underline",textDecorationColor:"var(--v2-ink-faint)",textUnderlineOffset:2},children:i.url})},i.url))})}),e.jsx(x,{children:e.jsx("button",{type:"button",className:"v2-btn v2-btn-primary v2-btn-sm",onClick:()=>s(i=>!i),children:t?"Cancel":"Mark verified manually"})}),t&&e.jsxs("div",{style:{marginTop:"var(--v2-pad-3)",padding:"var(--v2-pad-3)",border:"1px solid var(--v2-border-strong)",borderRadius:4,background:"var(--v2-bg)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:"var(--v2-pad-2)"},children:"verification note · required"}),e.jsx("p",{style:{color:"var(--v2-ink-tertiary)",fontSize:11,margin:0,marginBottom:"var(--v2-pad-2)"},children:"Ack wiring on this surface lands in the next rc; for now use the existing v1 ack flow on the Crawl tab."})]})]})}function h({label:r,children:t}){return e.jsxs("div",{style:{marginBottom:"var(--v2-pad-3)"},children:[e.jsx("p",{className:"v2-eyebrow",style:{margin:0,marginBottom:6},children:r}),t]})}function x({children:r}){return e.jsx("div",{style:{display:"flex",gap:"var(--v2-pad-2)",flexWrap:"wrap",marginTop:"var(--v2-pad-2)"},children:r})}function V({children:r}){return e.jsx("p",{style:{color:"var(--v2-ink-tertiary)",fontSize:11,margin:0,marginTop:"var(--v2-pad-2)",fontStyle:"italic"},children:r})}function H(){const r=d(n=>n.siteCrawlReport),[t,s]=v.useState("open"),i=v.useMemo(()=>r?O(r.pages,r.findingGroups??[]):[],[r]),l=v.useMemo(()=>t==="all"?i:i.filter(n=>t==="verified"?n.kind==="walkthrough-ack":t==="review"?n.kind==="needs-review":t==="open"?n.kind==="axe"||n.kind==="walkthrough-fail":!0),[i,t]);if(!r)return null;const a={all:i.length,open:i.filter(n=>n.kind==="axe"||n.kind==="walkthrough-fail").length,review:i.filter(n=>n.kind==="needs-review").length,verified:i.filter(n=>n.kind==="walkthrough-ack").length};return e.jsxs("section",{"aria-labelledby":"findings-heading",style:{padding:"var(--v2-pad-5) var(--v2-pad-5) var(--v2-pad-7)"},children:[e.jsxs("header",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:"var(--v2-pad-3)",marginBottom:"var(--v2-pad-4)",flexWrap:"wrap"},children:[e.jsx("h2",{id:"findings-heading",className:"v2-display",style:{fontSize:20,fontWeight:500,letterSpacing:"-0.01em",color:"var(--v2-ink-primary)",margin:0},children:"Findings"}),e.jsx(L,{filter:t,setFilter:s,counts:a})]}),l.length===0?e.jsx(G,{filter:t}):e.jsx("ul",{"aria-label":`${t} findings, ${l.length} items`,style:{listStyle:"none",padding:0,margin:0,display:"flex",flexDirection:"column",gap:"var(--v2-pad-2)"},children:l.map((n,o)=>e.jsx("li",{style:{animation:`v2-row-in 240ms ease ${Math.min(o,12)*30}ms both`},children:e.jsx(z,{row:n})},n.key))})]})}function L({filter:r,setFilter:t,counts:s}){const i=[{id:"open",label:"Open"},{id:"review",label:"Review"},{id:"verified",label:"Verified"},{id:"all",label:"All"}];return e.jsx("div",{role:"tablist","aria-label":"Filter findings",style:{display:"inline-flex",gap:4,background:"var(--v2-bg-elev)",padding:3,borderRadius:6,border:"1px solid var(--v2-border)"},children:i.map(l=>{const a=r===l.id;return e.jsxs("button",{type:"button",role:"tab","aria-selected":a,onClick:()=>t(l.id),style:{fontFamily:"var(--v2-body)",fontSize:11,padding:"5px 10px",borderRadius:4,border:"none",cursor:"pointer",background:a?"var(--v2-bg-elev-2)":"transparent",color:a?"var(--v2-ink-primary)":"var(--v2-ink-secondary)",fontWeight:a?600:500,transition:"background 120ms ease, color 120ms ease",display:"inline-flex",alignItems:"baseline",gap:5},children:[l.label,e.jsx("span",{className:"v2-mono",style:{fontSize:10,color:"var(--v2-ink-tertiary)",fontVariantNumeric:"tabular-nums"},children:s[l.id]})]},l.id)})})}function G({filter:r}){const s={open:{headline:"Nothing open.",sub:"No axe violations or AI walkthrough failures across the audited pages. Switch to All to see everything, or to Verified for a record of acknowledged items."},review:{headline:"No items awaiting review.",sub:"AI walkthroughs returned definitive verdicts (or human verifications) for every criterion that needed judgment."},verified:{headline:"No human verifications recorded.",sub:"When you mark a walkthrough finding as manually verified, it appears here with your note + timestamp."},all:{headline:"Nothing to show.",sub:"No audit data yet — run a scan to begin."}}[r];return e.jsxs("div",{role:"status","aria-live":"polite",style:{padding:"var(--v2-pad-6) var(--v2-pad-4)",textAlign:"center",border:"1px dashed var(--v2-border)",borderRadius:6},children:[e.jsx("p",{className:"v2-display",style:{fontSize:18,fontWeight:500,color:"var(--v2-ink-primary)",margin:0,marginBottom:"var(--v2-pad-2)"},children:s.headline}),e.jsx("p",{style:{color:"var(--v2-ink-secondary)",margin:0,maxWidth:440,marginInline:"auto"},children:s.sub})]})}function O(r,t){const s=[];for(const a of t)a.needsReview?s.push({kind:"needs-review",key:`nr::${a.ruleId}::${a.representativeSelector}`,criterion:a.wcagCriterion,ruleId:a.ruleId,description:a.axeDescription,selector:a.representativeSelector,failureSummary:a.failureSummary,pages:a.pages,group:a}):s.push({kind:"axe",key:`axe::${a.ruleId}::${a.representativeSelector}`,criterion:a.wcagCriterion,ruleId:a.ruleId,impact:a.impact,description:a.axeDescription,selector:a.representativeSelector,pages:a.pages,isShared:a.isShared});const i=new Set;for(const a of r){for(const n of a.walkthroughFindings??[]){const o=`wt-fail::${n.criterionId}::${n.pageUrl}`;i.has(o)||(i.add(o),s.push({kind:"walkthrough-fail",key:o,criterion:n.criterionId,verdict:n.verdict,impact:n.impact,reasoning:n.reasoning,pageUrl:n.pageUrl}))}for(const n of a.walkthroughAcknowledgements??[]){const o=`wt-ack::${n.criterionId}::${n.pageUrl}`;i.has(o)||(i.add(o),s.push({kind:"walkthrough-ack",key:o,criterion:n.criterionId,verdict:n.verdict,reasoning:n.reasoning,pageUrl:n.pageUrl}))}}const l={critical:0,serious:1,moderate:2,minor:3,"needs-review":4,ack:5};return s.sort((a,n)=>{const o=a.kind==="walkthrough-ack"?l.ack:a.kind==="needs-review"?l["needs-review"]:l[a.impact],p=n.kind==="walkthrough-ack"?l.ack:n.kind==="needs-review"?l["needs-review"]:l[n.impact];return(o??99)-(p??99)}),s}function M(){var i,l;const r=d(a=>a.siteCrawlReport),t=d(a=>a.results),s=(r==null?void 0:r.startUrl)??((i=t[0])==null?void 0:i.pageUrl)??((l=t[0])==null?void 0:l.scope)??null;return e.jsxs("header",{role:"banner",style:{display:"flex",alignItems:"center",gap:"var(--v2-pad-4)",padding:"var(--v2-pad-3) var(--v2-pad-5)",borderBottom:"1px solid var(--v2-border)",background:"var(--v2-bg)",minHeight:44},children:[e.jsx("a",{href:"#main-content",className:"v2-skip-link",style:{position:"absolute",left:-9999},onFocus:a=>{a.currentTarget.style.left="var(--v2-pad-4)",a.currentTarget.style.top="var(--v2-pad-4)"},onBlur:a=>{a.currentTarget.style.left="-9999px"},children:"Skip to main content"}),e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--v2-pad-2)"},children:[e.jsx("span",{className:"v2-display",style:{fontSize:18,fontWeight:600,letterSpacing:"-0.01em",color:"var(--v2-ink-primary)"},children:"wcagcheckr"}),e.jsx("span",{className:"v2-eyebrow",children:"v2"})]}),s&&e.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:"var(--v2-pad-2)",marginLeft:"var(--v2-pad-4)",minWidth:0,flex:1},children:[e.jsx("span",{className:"v2-eyebrow",children:"scope"}),e.jsx("span",{className:"v2-mono",style:{fontSize:11,color:"var(--v2-ink-secondary)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",minWidth:0},title:s,children:s})]}),e.jsxs("nav",{"aria-label":"Application",style:{display:"flex",gap:"var(--v2-pad-1)",marginLeft:"auto"},children:[e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm",onClick:()=>{chrome.storage.local.set({v2UiEnabled:!1})},"aria-label":"Switch back to the classic UI",title:"Switch back to the classic v1 UI",children:"Use v1"}),e.jsx("button",{type:"button",className:"v2-btn v2-btn-ghost v2-btn-sm","aria-label":"Settings",title:"Settings (coming soon)",children:"Settings"})]})]})}function P(){const r=d(t=>t.setSiteCrawlReport);return v.useEffect(()=>{let t=!1;return A(async()=>{const{loadSiteCrawlReport:s}=await import("./scheduled-audit-runner-BqTcRkAP.js").then(i=>i.aG);return{loadSiteCrawlReport:s}},__vite__mapDeps([0,1,2,3])).then(({loadSiteCrawlReport:s})=>{s().then(i=>{t||i&&d.setState({siteCrawlReport:i})}).catch(()=>{})}),()=>{t=!0}},[r]),e.jsxs("div",{className:"v2-root",children:[e.jsx(M,{}),e.jsxs("main",{id:"main-content","aria-label":"wcagcheckr findings",children:[e.jsx(W,{}),e.jsx(H,{})]})]})}I("side-panel");const y="v2UiEnabled";function q(){const[r,t]=v.useState(null);return v.useEffect(()=>{let s=!1;chrome.storage.local.get(y).then(l=>{s||t(!!l[y])}).catch(()=>t(!1));const i=(l,a)=>{var n;a==="local"&&y in l&&t(!!((n=l[y])!=null&&n.newValue))};return chrome.storage.onChanged.addListener(i),()=>{s=!0,chrome.storage.onChanged.removeListener(i)}},[]),r===null?null:r?e.jsx(P,{}):e.jsx(R,{})}const j=document.getElementById("root");if(!j)throw new Error("side-panel: #root not found");S(j).render(e.jsx(N.StrictMode,{children:e.jsx(C,{children:e.jsx(q,{})})}));
|