fidelity-kit 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/README.md +15 -2
  2. package/dist/commands/build.d.ts.map +1 -1
  3. package/dist/commands/build.js +12 -3
  4. package/dist/commands/build.js.map +1 -1
  5. package/dist/core/compare.d.ts +1 -4
  6. package/dist/core/compare.d.ts.map +1 -1
  7. package/dist/core/compare.js +0 -8
  8. package/dist/core/compare.js.map +1 -1
  9. package/dist/core/paths.d.ts +3 -0
  10. package/dist/core/paths.d.ts.map +1 -1
  11. package/dist/core/paths.js +4 -1
  12. package/dist/core/paths.js.map +1 -1
  13. package/dist/core/process.d.ts.map +1 -1
  14. package/dist/core/process.js +12 -3
  15. package/dist/core/process.js.map +1 -1
  16. package/dist/core/process.test.js +6 -6
  17. package/dist/core/process.test.js.map +1 -1
  18. package/dist/core/schema.d.ts +1 -0
  19. package/dist/core/schema.d.ts.map +1 -1
  20. package/dist/core/schema.js +7 -0
  21. package/dist/core/schema.js.map +1 -1
  22. package/dist/core/suite.test.js +23 -1
  23. package/dist/core/suite.test.js.map +1 -1
  24. package/dist/server.test.js +22 -0
  25. package/dist/server.test.js.map +1 -1
  26. package/dist/watch.test.js +4 -4
  27. package/dist/watch.test.js.map +1 -1
  28. package/package.json +2 -1
  29. package/viewer/assets/ViewControls-CTFRFrir.js +54 -0
  30. package/viewer/assets/_-D3hbSo9M.js +1 -0
  31. package/viewer/assets/{index-DgTxNUtG.js → index-DBPzD7F6.js} +2 -2
  32. package/viewer/assets/index-bVr7mAbR.css +2 -0
  33. package/viewer/assets/routes-OgzZznNP.js +1 -0
  34. package/viewer/index.html +2 -2
  35. package/viewer/assets/ViewControls-DEU3XE_l.js +0 -54
  36. package/viewer/assets/_-C4WPVjTH.js +0 -1
  37. package/viewer/assets/index-aFK_LL0Z.css +0 -2
  38. package/viewer/assets/routes-Mb9xRfeQ.js +0 -1
@@ -0,0 +1 @@
1
+ import{a as e,b as t,c as n,d as r,g as i,l as a,o,s,t as c,u as l,v as u,w as d,x as f,y as p}from"./index-DBPzD7F6.js";import{a as m,i as h,n as g,r as _}from"./ViewControls-CTFRFrir.js";var v=d(f()),y=p(),b=i(`__root__`);function x(){let n=c.useLoaderData(),{index:i,hashes:o,scenes:d}=b.useLoaderData(),f=c.useSearch(),p=c.useParams()._splat??``,v=d.find(e=>e.path===p),x=u({from:c.fullPath});if(!v)throw t();let C=l(i,f,o),w=C.compared,T=r(i,v,C);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(m,{logo:i.config.logo,scenePath:v.path,search:f,title:i.config.title,children:(0,y.jsx)(g,{index:i,onChange:e=>void x({replace:!0,search:t=>({...t,...e})}),view:C})}),(0,y.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[1120px] flex-col gap-6 px-4 py-6 sm:px-6`,children:[(0,y.jsx)(`h1`,{className:`text-xl font-semibold`,children:v.title}),n?(0,y.jsx)(h,{children:n}):null,(0,y.jsx)(`section`,{className:`grid gap-4 md:grid-cols-4`,children:[C.ref,...w].map(e=>(0,y.jsxs)(`figure`,{children:[(0,y.jsx)(_,{alt:e,size:T,src:a(v,C,e)}),(0,y.jsxs)(`figcaption`,{className:`mt-1 text-center text-sm text-muted-foreground`,children:[C.label(e),e===C.ref?` (reference)`:``]})]},e))}),w.map(t=>(0,y.jsx)(S,{delta:C.showDeltas?e(i,v,C,t):void 0,image:a(v,C,t),label:C.label(t),metrics:s(i,v,C,t),reference:a(v,C,C.ref),refLabel:C.label(C.ref),showDelta:C.showDeltas,size:T},t))]})]})}function S({label:e,refLabel:t,reference:r,image:i,delta:a,showDelta:s,metrics:c,size:l}){let[u,d]=(0,v.useState)(50);return(0,y.jsxs)(`section`,{children:[(0,y.jsxs)(`h2`,{className:`mb-2 font-semibold`,children:[e,` vs `,t]}),(0,y.jsxs)(`div`,{className:`grid gap-4 ${s?`md:grid-cols-2`:``}`,children:[(0,y.jsxs)(`figure`,{children:[r&&i?(0,y.jsxs)(`div`,{className:`relative select-none`,children:[(0,y.jsx)(`img`,{alt:e,className:`block w-full border border-border`,decoding:`async`,loading:`lazy`,src:i}),(0,y.jsx)(`img`,{alt:t,className:`absolute inset-0 block w-full border border-border`,decoding:`async`,height:l?.height,loading:`lazy`,src:r,width:l?.width,style:{clipPath:`inset(0 ${100-u}% 0 0)`}}),(0,y.jsx)(`div`,{className:`pointer-events-none absolute inset-y-0 w-px bg-white`,style:{left:`${u}%`}}),(0,y.jsx)(`input`,{"aria-label":`Compare split for ${e}`,className:`absolute inset-0 h-full w-full cursor-ew-resize opacity-0`,max:100,min:0,onChange:e=>d(Number(e.currentTarget.value)),type:`range`,value:u})]}):(0,y.jsx)(_,{alt:`${e} comparison`,size:l}),(0,y.jsxs)(`figcaption`,{className:`mt-1 text-center text-sm text-muted-foreground`,children:[t,` (left) / `,e,` (right) — drag to swipe`]})]}),s?(0,y.jsxs)(`figure`,{children:[(0,y.jsx)(_,{alt:`${e} delta`,notApplicable:!r,size:l,src:a}),(0,y.jsxs)(`figcaption`,{className:`mt-1 text-center text-sm text-muted-foreground`,children:[e,` delta`]})]}):null]}),(0,y.jsx)(`div`,{className:`mt-3`,children:c?(0,y.jsxs)(`dl`,{className:`grid max-w-md grid-cols-2 gap-x-4 gap-y-1 p-2 font-mono text-sm ${n(c)}`,children:[(0,y.jsx)(`dt`,{children:`PSNR (dB)`}),(0,y.jsx)(`dd`,{children:o(c.psnr)})]}):(0,y.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:"No metrics yet. Run `fidelity-kit process`."})})]})}export{x as component};