@unhead/bundler 3.0.4 → 3.1.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 (66) hide show
  1. package/README.md +0 -15
  2. package/dist/devtools-ui/200.html +1 -1
  3. package/dist/devtools-ui/404.html +1 -1
  4. package/dist/devtools-ui/_nuxt/C0eBIUCY.js +1 -0
  5. package/dist/devtools-ui/_nuxt/C6FB9XR7.js +1 -0
  6. package/dist/devtools-ui/_nuxt/{0Qa6s_Dg.js → CTIDChy9.js} +1 -1
  7. package/dist/devtools-ui/_nuxt/Cl48MOdR.js +1 -0
  8. package/dist/devtools-ui/_nuxt/D0h8RKZP.js +1 -0
  9. package/dist/devtools-ui/_nuxt/D1euPyWC.js +1 -0
  10. package/dist/devtools-ui/_nuxt/DH2dVWx3.js +1 -0
  11. package/dist/devtools-ui/_nuxt/DMn5FtwN.js +1 -0
  12. package/dist/devtools-ui/_nuxt/DQzShJ2s.js +1 -0
  13. package/dist/devtools-ui/_nuxt/DevtoolsTagTable.J276FsWb.css +1 -0
  14. package/dist/devtools-ui/_nuxt/Dy309ItU.js +1 -0
  15. package/dist/devtools-ui/_nuxt/KktNLKXM.js +1 -0
  16. package/dist/devtools-ui/_nuxt/LXzUJvwE.js +184 -0
  17. package/dist/devtools-ui/_nuxt/OQB3ITYU.js +1 -0
  18. package/dist/devtools-ui/_nuxt/S60UZsZE.js +1 -0
  19. package/dist/devtools-ui/_nuxt/{Bh8c0baD.js → UEnd3JDt.js} +1 -1
  20. package/dist/devtools-ui/_nuxt/{BjpL9Tvi.js → UKe4OZRP.js} +1 -1
  21. package/dist/devtools-ui/_nuxt/builds/latest.json +1 -1
  22. package/dist/devtools-ui/_nuxt/builds/meta/74bfd4ea-28e2-442f-93ba-55b766075483.json +1 -0
  23. package/dist/devtools-ui/_nuxt/e38X2hNB.js +1 -0
  24. package/dist/devtools-ui/_nuxt/entry.C0A6_lH-.css +1 -0
  25. package/dist/devtools-ui/_nuxt/error-404.DPPgd-2E.css +1 -0
  26. package/dist/devtools-ui/_nuxt/error-500.Df2YE7Su.css +1 -0
  27. package/dist/devtools-ui/_nuxt/sJqYz6RP.js +1 -0
  28. package/dist/devtools-ui/index.html +1 -1
  29. package/dist/framework.d.mts +72 -0
  30. package/dist/framework.d.ts +72 -0
  31. package/dist/framework.mjs +102 -0
  32. package/dist/minify/esbuild.d.mts +1 -1
  33. package/dist/minify/esbuild.d.ts +1 -1
  34. package/dist/minify/lightningcss.d.mts +1 -1
  35. package/dist/minify/lightningcss.d.ts +1 -1
  36. package/dist/minify/rolldown.d.mts +1 -1
  37. package/dist/minify/rolldown.d.ts +1 -1
  38. package/dist/shared/{bundler.BgFGu6g_.mjs → bundler.D9eYJXZg.mjs} +320 -5
  39. package/dist/shared/{bundler.BwKIGaKX.d.mts → bundler.LjD9SWtb.d.mts} +17 -2
  40. package/dist/shared/{bundler.BwKIGaKX.d.ts → bundler.LjD9SWtb.d.ts} +17 -2
  41. package/dist/vite.d.mts +10 -2
  42. package/dist/vite.d.ts +10 -2
  43. package/dist/vite.mjs +9 -244
  44. package/package.json +24 -12
  45. package/dist/devtools-ui/_nuxt/B2Jv09Lm.js +0 -1
  46. package/dist/devtools-ui/_nuxt/BFZZDhfF.js +0 -1
  47. package/dist/devtools-ui/_nuxt/BJQr0rHL.js +0 -1
  48. package/dist/devtools-ui/_nuxt/Bi7iarQE.js +0 -1
  49. package/dist/devtools-ui/_nuxt/BzyzpJpe.js +0 -1
  50. package/dist/devtools-ui/_nuxt/CQCCfgfs.js +0 -1
  51. package/dist/devtools-ui/_nuxt/CjvTvDUb.js +0 -1
  52. package/dist/devtools-ui/_nuxt/CyW9BsJI.js +0 -1
  53. package/dist/devtools-ui/_nuxt/DEZb6eJV.js +0 -1
  54. package/dist/devtools-ui/_nuxt/DbNB16xc.js +0 -1
  55. package/dist/devtools-ui/_nuxt/DevtoolsTagTable.Bi_gUiSE.css +0 -1
  56. package/dist/devtools-ui/_nuxt/Dk8INXUW.js +0 -1
  57. package/dist/devtools-ui/_nuxt/MzHi9Z_M.js +0 -1
  58. package/dist/devtools-ui/_nuxt/SqzsD7Ng.js +0 -1
  59. package/dist/devtools-ui/_nuxt/builds/meta/1507f341-05d3-41bb-970d-fba6ff77a58d.json +0 -1
  60. package/dist/devtools-ui/_nuxt/entry.clcQIxBm.css +0 -1
  61. package/dist/devtools-ui/_nuxt/error-404.BD1cQo3f.css +0 -1
  62. package/dist/devtools-ui/_nuxt/error-500.C6qGqSpk.css +0 -1
  63. package/dist/devtools-ui/_nuxt/lJJLnbTf.js +0 -181
  64. package/dist/webpack.d.mts +0 -5
  65. package/dist/webpack.d.ts +0 -5
  66. package/dist/webpack.mjs +0 -31
@@ -0,0 +1 @@
1
+ import{B as ne,o as i,c as r,b as u,w as h,a as s,ap as A,L as a,J as D,ao as re,W as x,X as S,t as o,V as d,d as C,aF as oe,a8 as H,p as b,aJ as $,r as le,_ as ce}from"./LXzUJvwE.js";import{_ as ue}from"./e38X2hNB.js";import{_ as de,a as P,h as W,j as ee,i as pe,c as me,n as he,e as _e,d as fe}from"./D1euPyWC.js";import{_ as ge}from"./C0eBIUCY.js";import"./DQzShJ2s.js";const xe=/[^\w\s]/g,be=/\s+/,v={TITLE_MAX_CHARS:60,TITLE_WARN_CHARS:50,TITLE_MAX_PIXELS:580,DESC_MAX_CHARS:160,DESC_WARN_CHARS:150,DESC_MAX_PIXELS:920},te={google:{label:"Google",titleMax:60,descMax:160,icon:"i-carbon-search"},bing:{label:"Bing",titleMax:65,descMax:150,icon:"i-carbon-search-locate"},duckduckgo:{label:"DuckDuckGo",titleMax:65,descMax:150,icon:"i-carbon-search-locate-mirror"},ai:{label:"AI Search",titleMax:70,descMax:200,icon:"i-carbon-machine-learning-model"}},ve=new Set(["a","an","the","and","or","but","in","on","at","to","for","of","with","by","is","are","was","were","be","been","being","have","has","had","do","does","did","will","would","could","should","may","might","can","shall","it","its","this","that","these","those","i","we","you","he","she","they","me","us","him","her","them","my","our","your","his","their","from","not","no","so","if","as","up","out","about","into","over","after","how","all","new","more","when","who","what","where"]);function ye(T){const N=T.toLowerCase().replace(xe,"").split(be).filter(Boolean),c=new Map;for(const _ of N)_.length<2||ve.has(_)||c.set(_,(c.get(_)||0)+1);return[...c.entries()].map(([_,y])=>({word:_,count:y})).sort((_,y)=>y.count-_.count)}function ke(T,N=16){return Math.round(T.length*N*.55)}function Se(T){return T>v.TITLE_MAX_CHARS?"error":T<30?"warning":"success"}function Te(T){return T>v.DESC_MAX_CHARS?"error":T>v.DESC_WARN_CHARS||T<70?"warning":"success"}const Ae={class:"space-y-4"},Ce={class:"flex items-center justify-between"},Re={class:"flex items-center gap-2"},De={class:"flex items-center gap-1"},Me=["aria-pressed"],Le=["aria-pressed"],Ee={class:"flex justify-center"},$e={class:"serp-preview"},Ne={class:"flex items-center gap-3 mb-2"},Ie={class:"w-[26px] h-[26px] rounded-full flex items-center justify-center bg-neutral-100 dark:bg-neutral-800 overflow-hidden"},we=["src"],He={key:0,class:"serp-rich-breadcrumbs"},Pe={key:1,class:"text-xs text-neutral-600 dark:text-[#bdc1c6] leading-tight truncate"},Xe={class:"serp-preview__description"},je={key:0,class:"flex items-center gap-1.5 mt-1"},qe={class:"serp-rich-stars"},Oe={class:"text-xs serp-rich-rating-text"},Ue={key:0,class:"text-xs serp-rich-rating-text"},ze={key:1,class:"text-xs serp-rich-rating-text ml-1"},Be={key:1,class:"text-xs serp-rich-rating-text mt-1"},We={key:2,class:"flex items-center gap-2 text-xs serp-rich-detail mt-1"},Ve={key:0},Ge={key:1,class:"opacity-40"},Fe={key:2},Je={key:3,class:"flex flex-wrap items-center gap-2 text-xs serp-rich-detail mt-1"},Qe={class:"flex items-center gap-1"},Ke={key:0,class:"opacity-30"},Ye={key:4,class:"serp-rich-faq mt-2"},Ze={class:"text-xs"},et={class:"flex items-center justify-between"},tt={class:"flex items-center gap-2"},st={class:"space-y-3"},at={class:"flex items-center justify-between mb-2"},it={class:"flex items-center gap-2"},nt={class:"text-xs font-medium"},rt={class:"flex items-center gap-2"},ot=["href","aria-label"],lt={class:"serp-rich-mockup"},ct={key:0,class:"serp-rich-breadcrumbs"},ut={key:1,class:"flex items-center gap-1.5"},dt={class:"serp-rich-stars"},pt={class:"text-xs serp-rich-rating-text"},mt={key:0,class:"text-xs serp-rich-rating-text"},ht={key:1,class:"text-xs serp-rich-rating-text ml-1"},_t={key:2,class:"text-xs serp-rich-rating-text"},ft={key:3,class:"flex items-center gap-2 text-xs serp-rich-detail"},gt={key:0},xt={key:1,class:"opacity-40"},bt={key:2},vt={key:4,class:"flex items-center gap-2 mt-1"},yt={class:"serp-rich-video-thumb"},kt=["src","alt"],St={class:"serp-rich-video-play"},Tt={key:0,class:"serp-rich-video-duration"},At={key:5,class:"serp-rich-faq"},Ct={class:"text-xs"},Rt={key:0,class:"text-xs serp-rich-rating-text mt-1"},Dt={key:6,class:"flex flex-wrap items-center gap-2 text-xs serp-rich-detail"},Mt={class:"flex items-center gap-1"},Lt={key:0,class:"opacity-30"},Et={class:"grid md:grid-cols-2 gap-4"},$t={class:"flex items-center gap-2"},Nt={class:"space-y-3"},It={class:"flex items-center justify-between"},wt={class:"text-xs font-mono text-muted"},Ht=["aria-valuenow","aria-valuemax","aria-label"],Pt={class:"text-xs text-muted truncate"},Xt={class:"flex items-center gap-2"},jt={class:"space-y-3"},qt={class:"flex items-center justify-between"},Ot={class:"text-xs font-mono text-muted"},Ut=["aria-valuenow","aria-valuemax","aria-label"],zt={class:"text-xs text-muted truncate"},Bt={class:"flex items-center justify-between"},Wt={class:"flex items-center gap-2"},Vt={class:"space-y-1"},Gt={class:"text-sm font-mono"},Ft={class:"text-xs text-muted ml-auto truncate max-w-[250px]"},Jt={class:"grid md:grid-cols-2 gap-4"},Qt={class:"flex items-center gap-2"},Kt={key:0,class:"space-y-3"},Yt={class:"space-y-1"},Zt={class:"flex items-center gap-2 px-2 py-1.5 rounded-md bg-elevated"},es={class:"text-sm font-mono ml-auto truncate"},ts={class:"flex items-center gap-2 px-2 py-1.5 rounded-md"},ss={class:"text-sm font-mono ml-auto bg-elevated px-1.5 py-0.5 rounded"},as={key:0,class:"flex items-center gap-2 px-2 py-1.5 rounded-md bg-elevated"},is={class:"text-xs font-mono ml-auto truncate max-w-[200px]"},ns={class:"border-t border-default pt-2"},rs={class:"text-sm font-mono mt-1"},os={key:1,class:"text-sm text-muted"},ls={class:"flex items-center gap-2"},cs={class:"flex items-center justify-between"},us={class:"flex items-center gap-2"},ds={key:0,class:"space-y-3"},ps={class:"text-xs font-medium text-muted uppercase tracking-wide"},ms={class:"grid grid-cols-2 gap-2"},hs={class:"bg-elevated rounded-md p-2"},_s={class:"text-xs font-mono truncate"},fs={class:"bg-elevated rounded-md p-2"},gs={class:"text-xs font-mono truncate"},xs={key:1,class:"text-sm text-muted"},bs={class:"flex items-center gap-2"},vs={class:"w-full text-sm"},ys={class:"p-2"},ks={class:"flex items-center gap-1.5"},Ss={class:"p-2"},Ts={class:"flex items-center gap-1.5"},As={class:"font-mono text-xs"},Cs={class:"p-2"},Rs={class:"flex items-center gap-1.5"},Ds={class:"font-mono text-xs"},Ms={class:"flex items-center gap-2"},Ls={class:"flex flex-wrap gap-2"},Es={key:0,class:"serp-keyword-count"},$s=ne({__name:"serp",setup(T){const N=/PT(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?/,c=b(()=>$.value.seo),_=b(()=>c.value.title?.length||0),y=b(()=>c.value.description?.length||0),X=b(()=>Se(_.value)),j=b(()=>Te(y.value)),M=le("desktop"),V=b(()=>$.value.titleTemplate),q=b(()=>$.value.templateParams),se=b(()=>$.value.separator||"|"),ae=b(()=>!!V.value),O=b(()=>{const n=[];return c.value.title?_.value>v.TITLE_MAX_CHARS?n.push({label:"Title",status:"error",detail:`Too long (${_.value}/${v.TITLE_MAX_CHARS})`}):_.value<30?n.push({label:"Title",status:"warning",detail:`Too short (${_.value} chars)`}):n.push({label:"Title",status:"success",detail:`${_.value} chars`}):n.push({label:"Title",status:"error",detail:"Missing"}),c.value.description?y.value>v.DESC_MAX_CHARS?n.push({label:"Description",status:"error",detail:`Too long (${y.value}/${v.DESC_MAX_CHARS})`}):y.value<70?n.push({label:"Description",status:"warning",detail:`Too short (${y.value} chars)`}):n.push({label:"Description",status:"success",detail:`${y.value} chars`}):n.push({label:"Description",status:"error",detail:"Missing"}),c.value.canonical?n.push({label:"Canonical URL",status:"success",detail:c.value.canonical}):n.push({label:"Canonical URL",status:"warning",detail:"Not set"}),c.value.robots?c.value.robots.includes("noindex")?n.push({label:"Robots",status:"error",detail:`noindex detected: ${c.value.robots}`}):n.push({label:"Robots",status:"success",detail:c.value.robots}):n.push({label:"Robots",status:"warning",detail:"Not set (defaults to index, follow)"}),c.value.ogTitle?n.push({label:"og:title",status:"success",detail:c.value.ogTitle}):n.push({label:"og:title",status:"warning",detail:"Not set (falls back to title)"}),c.value.ogDescription?n.push({label:"og:description",status:"success",detail:c.value.ogDescription}):n.push({label:"og:description",status:"warning",detail:"Not set (falls back to description)"}),c.value.ogImage?n.push({label:"og:image",status:"success",detail:c.value.ogImage}):n.push({label:"og:image",status:"error",detail:"Missing"}),n}),I=b(()=>{const n=O.value.length;return{passed:O.value.filter(l=>l.status==="success").length,total:n}}),E=b(()=>{const n=[];return c.value.ogTitle&&c.value.title&&c.value.ogTitle!==c.value.title&&n.push({field:"Title",serp:c.value.title,og:c.value.ogTitle}),c.value.ogDescription&&c.value.description&&c.value.ogDescription!==c.value.description&&n.push({field:"Description",serp:c.value.description,og:c.value.ogDescription}),n}),G=b(()=>{const n=`${c.value.title||""} ${c.value.description||""}`;return ye(n).slice(0,10)}),ie=b(()=>Object.keys(te).map(n=>{const e=te[n],l=_.value>e.titleMax?"error":_.value<30?"warning":"success",g=y.value>e.descMax?"error":y.value<70?"warning":"success";return{key:n,...e,titleStatus:l,descStatus:g,titleLen:_.value,descLen:y.value}}));function F(n){return n==="success"?"Good":n==="warning"?"Needs work":"Too long"}function U(n){return n==="success"?"i-carbon-checkmark-filled":n==="warning"?"i-carbon-warning-filled":"i-carbon-close-filled"}function z(n){return n==="success"?"text-green-500":n==="warning"?"text-amber-400":"text-red-400"}const J=b(()=>{const n=$.value.tags.filter(e=>e.tag==="script"&&e.props?.type==="application/ld+json").flatMap(e=>{try{return[JSON.parse(e.innerHTML||"{}")]}catch{return[]}});return n.length?n.length===1?n[0]:{"@graph":n.flatMap(e=>ee(e))}:null}),B=b(()=>J.value?ee(J.value).filter(e=>pe(P(e))):[]),Q=b(()=>{const n=$.value.tags.filter(l=>l.tag==="link"&&["icon"].includes(l.props?.rel||""));return n.find(l=>l.props?.href?.includes("favicon.ico"))?.props?.href||n[0]?.props?.href||null}),R=b(()=>{const n=new Set;return B.value.map(e=>{const l=P(e),g=me(e),L=he(l),w=g.missingRequired.length>0?"ineligible":g.missingRecommended.length>0?"partial":"eligible",p={type:l,icon:fe(l),label:_e(e),features:[],eligibility:w,missingRequired:g.missingRequired,documentationUrl:L.googlePage||void 0},t=e.aggregateRating||e.reviewRating;switch(t&&(p.rating={value:Number(t.ratingValue||0),count:Number(t.ratingCount||t.reviewCount||0),max:Number(t.bestRating||5)}),l){case"Product":{const f=e.offers?.[0]||e.offers||{};f.price&&(p.price=`${f.priceCurrency||"$"}${f.price}`),f.availability&&p.features.push({icon:"i-carbon-delivery-truck",text:f.availability.replace("https://schema.org/","")});break}case"Recipe":{(e.totalTime||e.cookTime)&&p.features.push({icon:"i-carbon-time",text:K(e.totalTime||e.cookTime)}),e.recipeYield&&p.features.push({icon:"i-carbon-restaurant",text:`Serves ${e.recipeYield}`}),e.nutrition?.calories&&p.features.push({icon:"i-carbon-meter",text:e.nutrition.calories});break}case"Event":{e.startDate&&(p.eventDate=Y(e.startDate)),(e.location?.name||e.location?.address?.addressLocality)&&(p.eventLocation=e.location.name||e.location.address.addressLocality);break}case"FAQPage":{const f=W(e.mainEntity||[]);p.faqItems=f.slice(0,4).map(m=>({question:m.name||m.text||"Question"}));break}case"BreadcrumbList":{const f=W(e.itemListElement||[]).sort((m,k)=>(m.position||0)-(k.position||0));p.breadcrumbs=f.map(m=>m.name||m.item?.name||"Page").slice(0,5);break}case"VideoObject":{p.videoThumbnail=e.thumbnailUrl,e.duration&&(p.videoDuration=K(e.duration));break}case"Article":case"NewsArticle":case"BlogPosting":{e.datePublished&&p.features.push({icon:"i-carbon-calendar",text:Y(e.datePublished)}),e.author?.name&&p.features.push({icon:"i-carbon-user",text:e.author.name});break}case"JobPosting":{e.hiringOrganization?.name&&p.features.push({icon:"i-carbon-building",text:e.hiringOrganization.name}),e.baseSalary?.value&&p.features.push({icon:"i-carbon-currency",text:`${e.baseSalary.currency||""}${e.baseSalary.value}`}),e.jobLocation?.address?.addressLocality&&p.features.push({icon:"i-carbon-location",text:e.jobLocation.address.addressLocality});break}case"LocalBusiness":case"Restaurant":{(e.address?.streetAddress||e.address?.addressLocality)&&p.features.push({icon:"i-carbon-location",text:e.address.streetAddress||e.address.addressLocality}),e.telephone&&p.features.push({icon:"i-carbon-phone",text:e.telephone}),e.priceRange&&p.features.push({icon:"i-carbon-currency",text:e.priceRange});break}case"SoftwareApplication":{e.applicationCategory&&p.features.push({icon:"i-carbon-category",text:e.applicationCategory});const f=e.offers?.[0]||e.offers||{};f.price&&(p.price=f.price==="0"?"Free":`${f.priceCurrency||"$"}${f.price}`);break}case"Course":{e.provider?.name&&p.features.push({icon:"i-carbon-education",text:e.provider.name});break}case"Organization":{e.name&&p.features.push({icon:"i-carbon-building",text:e.name}),e.url&&p.features.push({icon:"i-carbon-link",text:e.url}),e.telephone&&p.features.push({icon:"i-carbon-phone",text:e.telephone});break}case"SearchAction":{e.target&&p.features.push({icon:"i-carbon-search",text:typeof e.target=="string"?e.target:e.target?.urlTemplate||"Sitelinks searchbox"});break}case"WebSite":{e.name&&p.features.push({icon:"i-carbon-globe",text:e.name}),e.url&&p.features.push({icon:"i-carbon-link",text:e.url});break}}return p}).filter(e=>{const l=`${e.type}::${e.label}::${e.features.find(g=>g.icon==="i-carbon-link")?.text||""}`;return n.has(l)?!1:(n.add(l),!0)})});function K(n){if(!n)return"";const e=n.match(N);if(!e)return n;const l=[];return e[1]&&l.push(`${e[1]}h`),e[2]&&l.push(`${e[2]}m`),e[3]&&!e[1]&&l.push(`${e[3]}s`),l.join(" ")||n}function Y(n){try{return new Date(n).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}catch{return n}}function Z(n,e=5){const l=Math.round(n);return"★".repeat(Math.min(l,e))+"☆".repeat(Math.max(0,e-l))}return(n,e)=>{const l=re,g=ue,L=oe,w=de,p=ge;return i(),r("div",Ae,[u(g,null,{header:h(()=>[s("div",Ce,[s("div",Re,[u(l,{name:"i-carbon-search",class:"text-lg"}),e[2]||(e[2]=s("span",{class:"font-medium"},"Google Search Preview",-1))]),s("div",De,[s("button",{type:"button","aria-label":"Desktop preview","aria-pressed":a(M)==="desktop",class:A(["px-2 py-1 text-xs rounded",a(M)==="desktop"?"bg-elevated font-medium":"text-muted"]),onClick:e[0]||(e[0]=t=>M.value="desktop")},[u(l,{name:"i-carbon-laptop",class:"text-sm"})],10,Me),s("button",{type:"button","aria-label":"Mobile preview","aria-pressed":a(M)==="mobile",class:A(["px-2 py-1 text-xs rounded",a(M)==="mobile"?"bg-elevated font-medium":"text-muted"]),onClick:e[1]||(e[1]=t=>M.value="mobile")},[u(l,{name:"i-carbon-mobile",class:"text-sm"})],10,Le)])])]),default:h(()=>[s("div",Ee,[s("div",{class:A(["serp-preview-container transition-all duration-300",a(M)==="mobile"?"serp-preview-container--mobile":""])},[s("div",$e,[s("div",Ne,[s("div",Ie,[a(Q)?(i(),r("img",{key:0,src:a(Q),alt:"",class:"w-3.5 h-3.5 object-contain"},null,8,we)):(i(),D(l,{key:1,name:"i-carbon-earth",class:"w-3.5 h-3.5 text-neutral-400"}))]),a(R).find(t=>t.breadcrumbs)?(i(),r("div",He,[(i(!0),r(x,null,S(a(R).find(t=>t.breadcrumbs).breadcrumbs,(t,f)=>(i(),r(x,{key:f},[s("span",null,o(t),1),f<a(R).find(m=>m.breadcrumbs).breadcrumbs.length-1?(i(),D(l,{key:0,name:"i-carbon-chevron-right",class:"text-[10px] mx-0.5 opacity-50"})):d("",!0)],64))),128))])):(i(),r("div",Pe,o(a(c).canonical||"example.com"),1))]),s("h3",{class:A(["serp-preview__title",a(M)==="mobile"?"serp-preview__title--mobile":""])},o(a(c).title||"No title found"),3),s("p",Xe,o(a(c).description||"No description found"),1),(i(!0),r(x,null,S(a(R),(t,f)=>(i(),r(x,{key:`inline-${f}`},[t.rating?(i(),r("div",je,[s("span",qe,o(Z(t.rating.value,t.rating.max)),1),s("span",Oe,o(t.rating.value)+"/"+o(t.rating.max),1),t.rating.count?(i(),r("span",Ue," ("+o(t.rating.count.toLocaleString())+" review"+o(t.rating.count!==1?"s":"")+") ",1)):d("",!0),t.price?(i(),r("span",ze,"· "+o(t.price),1)):d("",!0)])):t.price?(i(),r("div",Be,o(t.price),1)):d("",!0),t.eventDate||t.eventLocation?(i(),r("div",We,[t.eventDate?(i(),r("span",Ve,o(t.eventDate),1)):d("",!0),t.eventDate&&t.eventLocation?(i(),r("span",Ge,"·")):d("",!0),t.eventLocation?(i(),r("span",Fe,o(t.eventLocation),1)):d("",!0)])):d("",!0),t.features.length&&!t.rating?(i(),r("div",Je,[(i(!0),r(x,null,S(t.features,(m,k)=>(i(),r(x,{key:k},[s("span",Qe,[u(l,{name:m.icon,class:"text-xs opacity-60"},null,8,["name"]),C(" "+o(m.text),1)]),k<t.features.length-1?(i(),r("span",Ke,"·")):d("",!0)],64))),128))])):d("",!0),t.faqItems?.length?(i(),r("div",Ye,[(i(!0),r(x,null,S(t.faqItems,(m,k)=>(i(),r("div",{key:k,class:"serp-rich-faq-item"},[u(l,{name:"i-carbon-chevron-down",class:"text-xs shrink-0 opacity-60"}),s("span",Ze,o(m.question),1)]))),128))])):d("",!0)],64))),128))])],2)])]),_:1}),a(R).length?(i(),D(g,{key:0},{header:h(()=>[s("div",et,[s("div",tt,[u(l,{name:"i-carbon-star",class:"text-lg"}),e[3]||(e[3]=s("span",{class:"font-medium"},"Rich Results Preview",-1))]),u(L,{color:a(R).every(t=>t.eligibility==="eligible")?"success":a(R).some(t=>t.eligibility==="ineligible")?"error":"warning",variant:"subtle",size:"xs"},{default:h(()=>[C(o(a(R).filter(t=>t.eligibility==="eligible").length)+"/"+o(a(R).length)+" eligible ",1)]),_:1},8,["color"])])]),default:h(()=>[s("div",st,[(i(!0),r(x,null,S(a(R),(t,f)=>(i(),r("div",{key:f,class:"serp-rich-result"},[s("div",at,[s("div",it,[u(l,{name:t.icon,class:"text-sm"},null,8,["name"]),s("span",nt,o(t.type),1)]),s("div",rt,[u(L,{color:t.eligibility==="eligible"?"success":t.eligibility==="partial"?"warning":"error",variant:"subtle",size:"xs"},{default:h(()=>[C(o(t.eligibility==="eligible"?"Eligible":t.eligibility==="partial"?"Partial":"Missing required"),1)]),_:2},1032,["color"]),t.documentationUrl?(i(),r("a",{key:0,href:t.documentationUrl,target:"_blank",rel:"noopener noreferrer",class:"text-muted hover:text-default","aria-label":`Open ${t.type} rich result documentation`},[u(l,{name:"i-carbon-launch",class:"text-xs"})],8,ot)):d("",!0)])]),t.missingRequired.length?(i(),D(w,{key:0,variant:"error",class:"mb-2"},{default:h(()=>[e[4]||(e[4]=C(" Missing required: ",-1)),(i(!0),r(x,null,S(t.missingRequired,m=>(i(),r("code",{key:m,class:"bg-elevated px-1 py-0.5 rounded text-xs mx-0.5"},o(m),1))),128))]),_:2},1024)):d("",!0),s("div",lt,[t.breadcrumbs?(i(),r("div",ct,[(i(!0),r(x,null,S(t.breadcrumbs,(m,k)=>(i(),r(x,{key:k},[s("span",null,o(m),1),k<t.breadcrumbs.length-1?(i(),D(l,{key:0,name:"i-carbon-chevron-right",class:"text-[10px] mx-0.5 opacity-50"})):d("",!0)],64))),128))])):d("",!0),t.rating?(i(),r("div",ut,[s("span",dt,o(Z(t.rating.value,t.rating.max)),1),s("span",pt,o(t.rating.value)+"/"+o(t.rating.max),1),t.rating.count?(i(),r("span",mt," ("+o(t.rating.count.toLocaleString())+" review"+o(t.rating.count!==1?"s":"")+") ",1)):d("",!0),t.price?(i(),r("span",ht,"· "+o(t.price),1)):d("",!0)])):t.price?(i(),r("div",_t,o(t.price),1)):d("",!0),t.eventDate||t.eventLocation?(i(),r("div",ft,[t.eventDate?(i(),r("span",gt,o(t.eventDate),1)):d("",!0),t.eventDate&&t.eventLocation?(i(),r("span",xt,"·")):d("",!0),t.eventLocation?(i(),r("span",bt,o(t.eventLocation),1)):d("",!0)])):d("",!0),t.videoThumbnail?(i(),r("div",vt,[s("div",yt,[s("img",{src:t.videoThumbnail,alt:t.label,class:"w-full h-full object-cover rounded"},null,8,kt),s("div",St,[u(l,{name:"i-carbon-play-filled",class:"text-white text-sm"})]),t.videoDuration?(i(),r("span",Tt,o(t.videoDuration),1)):d("",!0)])])):d("",!0),t.faqItems?.length?(i(),r("div",At,[(i(!0),r(x,null,S(t.faqItems,(m,k)=>(i(),r("div",{key:k,class:"serp-rich-faq-item"},[u(l,{name:"i-carbon-chevron-down",class:"text-xs shrink-0 opacity-60"}),s("span",Ct,o(m.question),1)]))),128)),a(B).find(m=>a(P)(m)==="FAQPage")?.mainEntity?.length>4?(i(),r("div",Rt," + "+o(a(W)(a(B).find(m=>a(P)(m)==="FAQPage")?.mainEntity||[]).length-4)+" more questions ",1)):d("",!0)])):d("",!0),t.features.length?(i(),r("div",Dt,[(i(!0),r(x,null,S(t.features,(m,k)=>(i(),r(x,{key:k},[s("span",Mt,[u(l,{name:m.icon,class:"text-xs opacity-60"},null,8,["name"]),C(" "+o(m.text),1)]),k<t.features.length-1?(i(),r("span",Lt,"·")):d("",!0)],64))),128))])):d("",!0)])]))),128))])]),_:1})):d("",!0),s("div",Et,[u(g,null,{header:h(()=>[s("div",$t,[u(l,{name:"i-carbon-text-short-paragraph",class:"text-lg"}),e[5]||(e[5]=s("span",{class:"font-medium"},"Title",-1))])]),default:h(()=>[s("div",Nt,[s("div",It,[s("span",{class:A(["serp-length-status",`serp-length-status--${a(X)}`])},o(F(a(X))),3),s("span",wt,o(a(_))+"/"+o(a(v).TITLE_MAX_CHARS)+" chars · ~"+o(a(ke)(a(c).title||""))+"px ",1)]),s("div",{class:"serp-progress-track",role:"progressbar","aria-valuenow":a(_),"aria-valuemin":0,"aria-valuemax":a(v).TITLE_MAX_CHARS,"aria-label":`Title length: ${a(_)} of ${a(v).TITLE_MAX_CHARS} characters`},[s("div",{class:A(["serp-progress-fill",`serp-progress-fill--${a(X)}`]),style:H({width:`${Math.min(100,a(_)/a(v).TITLE_MAX_CHARS*100)}%`})},null,6),s("div",{class:"serp-progress-marker",style:H({left:`${30/a(v).TITLE_MAX_CHARS*100}%`})},null,4)],8,Ht),s("p",Pt,o(a(c).title||"Not set"),1)])]),_:1}),u(g,null,{header:h(()=>[s("div",Xt,[u(l,{name:"i-carbon-text-align-left",class:"text-lg"}),e[6]||(e[6]=s("span",{class:"font-medium"},"Description",-1))])]),default:h(()=>[s("div",jt,[s("div",qt,[s("span",{class:A(["serp-length-status",`serp-length-status--${a(j)}`])},o(F(a(j))),3),s("span",Ot,o(a(y))+"/"+o(a(v).DESC_MAX_CHARS)+" chars ",1)]),s("div",{class:"serp-progress-track",role:"progressbar","aria-valuenow":a(y),"aria-valuemin":0,"aria-valuemax":a(v).DESC_MAX_CHARS,"aria-label":`Description length: ${a(y)} of ${a(v).DESC_MAX_CHARS} characters`},[s("div",{class:A(["serp-progress-fill",`serp-progress-fill--${a(j)}`]),style:H({width:`${Math.min(100,a(y)/a(v).DESC_MAX_CHARS*100)}%`})},null,6),s("div",{class:"serp-progress-marker",style:H({left:`${a(v).DESC_WARN_CHARS/a(v).DESC_MAX_CHARS*100}%`})},null,4)],8,Ut),s("p",zt,o(a(c).description||"Not set"),1)])]),_:1})]),u(g,null,{header:h(()=>[s("div",Bt,[s("div",Wt,[u(l,{name:"i-carbon-task",class:"text-lg"}),e[7]||(e[7]=s("span",{class:"font-medium"},"SEO Checklist",-1))]),u(L,{color:a(I).passed===a(I).total?"success":"warning",variant:"subtle",size:"xs"},{default:h(()=>[C(o(a(I).passed)+"/"+o(a(I).total)+" passed ",1)]),_:1},8,["color"])])]),default:h(()=>[s("div",Vt,[(i(!0),r(x,null,S(a(O),t=>(i(),r("div",{key:t.label,class:"flex items-center gap-2 px-2 py-1.5 rounded-md hover:bg-elevated transition-colors"},[u(l,{name:U(t.status),class:A([z(t.status),"text-sm shrink-0"])},null,8,["name","class"]),s("span",Gt,o(t.label),1),s("span",Ft,o(t.detail),1)]))),128))])]),_:1}),s("div",Jt,[u(g,null,{header:h(()=>[s("div",Qt,[u(l,{name:"i-carbon-string-text",class:"text-lg"}),e[8]||(e[8]=s("span",{class:"font-medium"},"Title Template",-1))])]),default:h(()=>[a(ae)?(i(),r("div",Kt,[s("div",Yt,[s("div",Zt,[e[9]||(e[9]=s("span",{class:"text-xs text-muted shrink-0"},"Template",-1)),s("span",es,o(a(V)),1)]),s("div",ts,[e[10]||(e[10]=s("span",{class:"text-xs text-muted shrink-0"},"Separator",-1)),s("code",ss,o(a(se)),1)]),a(q)&&Object.keys(a(q)).length?(i(),r("div",as,[e[11]||(e[11]=s("span",{class:"text-xs text-muted shrink-0"},"Params",-1)),s("span",is,o(JSON.stringify(a(q))),1)])):d("",!0)]),s("div",ns,[e[12]||(e[12]=s("span",{class:"text-xs text-muted"},"Resolved title",-1)),s("p",rs,o(a(c).title||"Not set"),1)])])):(i(),r("div",os," No title template configured. The title is set directly. "))]),_:1}),u(g,null,{header:h(()=>[s("div",ls,[u(l,{name:"i-carbon-settings-adjust",class:"text-lg"}),e[13]||(e[13]=s("span",{class:"font-medium"},"Crawl Settings",-1))])]),default:h(()=>[u(p,{items:[{key:"canonical",value:a(c).canonical||void 0,copyable:!0},{key:"robots",value:a(c).robots||void 0}],striped:""},null,8,["items"]),a(c).robots?.includes("noindex")?(i(),D(w,{key:0,variant:"error",icon:"i-carbon-warning",class:"mt-3"},{default:h(()=>[...e[14]||(e[14]=[C(" This page has ",-1),s("code",{class:"bg-elevated px-1.5 py-0.5 rounded text-xs"},"noindex",-1),C(" set. It will not appear in search results. ",-1)])]),_:1})):d("",!0)]),_:1})]),a(E).length>0||a(c).ogTitle||a(c).ogDescription?(i(),D(g,{key:1},{header:h(()=>[s("div",cs,[s("div",us,[u(l,{name:"i-carbon-compare",class:"text-lg"}),e[15]||(e[15]=s("span",{class:"font-medium"},"SERP vs Open Graph",-1))]),a(E).length?(i(),D(L,{key:0,color:"info",variant:"subtle",size:"xs"},{default:h(()=>[C(o(a(E).length)+" difference"+o(a(E).length>1?"s":""),1)]),_:1})):(i(),D(L,{key:1,color:"success",variant:"subtle",size:"xs"},{default:h(()=>[...e[16]||(e[16]=[C(" Matching ",-1)])]),_:1}))])]),default:h(()=>[a(E).length?(i(),r("div",ds,[(i(!0),r(x,null,S(a(E),t=>(i(),r("div",{key:t.field,class:"space-y-1"},[s("span",ps,o(t.field),1),s("div",ms,[s("div",hs,[e[17]||(e[17]=s("span",{class:"text-[10px] text-muted uppercase tracking-wide block mb-1"},"Search",-1)),s("p",_s,o(t.serp),1)]),s("div",fs,[e[18]||(e[18]=s("span",{class:"text-[10px] text-muted uppercase tracking-wide block mb-1"},"Social",-1)),s("p",gs,o(t.og),1)])])]))),128))])):(i(),r("div",xs," Open Graph tags match your search engine metadata. Social shares will display the same content as search results. "))]),_:1})):d("",!0),u(g,null,{header:h(()=>[s("div",bs,[u(l,{name:"i-carbon-earth-americas",class:"text-lg"}),e[19]||(e[19]=s("span",{class:"font-medium"},"Search Engine Compatibility",-1))])]),default:h(()=>[s("table",vs,[e[20]||(e[20]=s("thead",{class:"sticky top-0 bg-default"},[s("tr",{class:"text-left text-muted border-b border-default"},[s("th",{class:"p-2 font-medium"}," Engine "),s("th",{class:"p-2 font-medium"}," Title "),s("th",{class:"p-2 font-medium"}," Description ")])],-1)),s("tbody",null,[(i(!0),r(x,null,S(a(ie),t=>(i(),r("tr",{key:t.key,class:"border-b border-default last:border-0 hover:bg-elevated transition-colors"},[s("td",ys,[s("div",ks,[u(l,{name:t.icon,class:"text-sm"},null,8,["name"]),s("span",null,o(t.label),1)])]),s("td",Ss,[s("div",Ts,[u(l,{name:U(t.titleStatus),class:A([z(t.titleStatus),"text-xs"])},null,8,["name","class"]),s("span",As,o(t.titleLen)+"/"+o(t.titleMax),1)])]),s("td",Cs,[s("div",Rs,[u(l,{name:U(t.descStatus),class:A([z(t.descStatus),"text-xs"])},null,8,["name","class"]),s("span",Ds,o(t.descLen)+"/"+o(t.descMax),1)])])]))),128))])])]),_:1}),a(G).length?(i(),D(g,{key:2},{header:h(()=>[s("div",Ms,[u(l,{name:"i-carbon-tag-group",class:"text-lg"}),e[21]||(e[21]=s("span",{class:"font-medium"},"Keyword Analysis",-1))])]),default:h(()=>[s("div",Ls,[(i(!0),r(x,null,S(a(G),t=>(i(),r("span",{key:t.word,class:"serp-keyword-chip"},[C(o(t.word)+" ",1),t.count>1?(i(),r("span",Es,o(t.count),1)):d("",!0)]))),128))])]),_:1})):d("",!0)])}}}),Xs=ce($s,[["__scopeId","data-v-d8951a96"]]);export{Xs as default};
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__unhead/_nuxt/entry.clcQIxBm.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__unhead/_nuxt/lJJLnbTf.js"><script type="module" src="/__unhead/_nuxt/lJJLnbTf.js" crossorigin></script><script>"use strict";(()=>{const t=window,e=document.documentElement,c=["dark","light"],n=getStorageValue("localStorage","nuxt-color-mode")||"system";let i=n==="system"?u():n;const r=e.getAttribute("data-color-mode-forced");r&&(i=r),l(i),t["__NUXT_COLOR_MODE__"]={preference:n,value:i,getColorScheme:u,addColorScheme:l,removeColorScheme:d};function l(o){const s=""+o+"",a="";e.classList?e.classList.add(s):e.className+=" "+s,a&&e.setAttribute("data-"+a,o)}function d(o){const s=""+o+"",a="";e.classList?e.classList.remove(s):e.className=e.className.replace(new RegExp(s,"g"),""),a&&e.removeAttribute("data-"+a)}function f(o){return t.matchMedia("(prefers-color-scheme"+o+")")}function u(){if(t.matchMedia&&f("").media!=="not all"){for(const o of c)if(f(":"+o).matches)return o}return"light"}})();function getStorageValue(t,e){switch(t){case"localStorage":return window.localStorage.getItem(e);case"sessionStorage":return window.sessionStorage.getItem(e);case"cookie":return getCookie(e);default:return null}}function getCookie(t){const c=("; "+window.document.cookie).split("; "+t+"=");if(c.length===2)return c.pop()?.split(";").shift()}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__unhead/",buildId:"1507f341-05d3-41bb-970d-fba6ff77a58d",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1776132851711,false]</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><link rel="stylesheet" href="/__unhead/_nuxt/entry.C0A6_lH-.css" crossorigin><link rel="modulepreload" as="script" crossorigin href="/__unhead/_nuxt/LXzUJvwE.js"><script type="module" src="/__unhead/_nuxt/LXzUJvwE.js" crossorigin></script><script>"use strict";(()=>{const t=window,e=document.documentElement,c=["dark","light"],n=getStorageValue("localStorage","nuxt-color-mode")||"system";let i=n==="system"?u():n;const r=e.getAttribute("data-color-mode-forced");r&&(i=r),l(i),t["__NUXT_COLOR_MODE__"]={preference:n,value:i,getColorScheme:u,addColorScheme:l,removeColorScheme:d};function l(o){const s=""+o+"",a="";e.classList?e.classList.add(s):e.className+=" "+s,a&&e.setAttribute("data-"+a,o)}function d(o){const s=""+o+"",a="";e.classList?e.classList.remove(s):e.className=e.className.replace(new RegExp(s,"g"),""),a&&e.removeAttribute("data-"+a)}function f(o){return t.matchMedia("(prefers-color-scheme"+o+")")}function u(){if(t.matchMedia&&f("").media!=="not all"){for(const o of c)if(f(":"+o).matches)return o}return"light"}})();function getStorageValue(t,e){switch(t){case"localStorage":return window.localStorage.getItem(e);case"sessionStorage":return window.sessionStorage.getItem(e);case"cookie":return getCookie(e);default:return null}}function getCookie(t){const c=("; "+window.document.cookie).split("; "+t+"=");if(c.length===2)return c.pop()?.split(";").shift()}</script></head><body><div id="__nuxt" class="isolate"></div><div id="teleports"></div><script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__unhead/",buildId:"74bfd4ea-28e2-442f-93ba-55b766075483",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script><script type="application/json" data-nuxt-data="nuxt-app" data-ssr="false" id="__NUXT_DATA__">[{"prerenderedAt":1,"serverRendered":2},1777251187898,false]</script></body></html>
@@ -0,0 +1,72 @@
1
+ import { UnpluginInstance } from 'unplugin';
2
+ import { Plugin } from 'vite';
3
+ import { V as VitePluginOptions } from './shared/bundler.LjD9SWtb.mjs';
4
+
5
+ /**
6
+ * Per-framework factory config. `framework` is the package name (e.g.
7
+ * `@unhead/vue`) used internally by the base bundler to import runtime
8
+ * plugins from the right path; `streamingPlugin` is the framework's
9
+ * streaming unplugin instance (as returned by `createUnplugin`).
10
+ */
11
+ interface FrameworkPluginConfig<S> {
12
+ framework: string;
13
+ streamingPlugin: UnpluginInstance<S | undefined, boolean>;
14
+ }
15
+ interface UnheadFrameworkOptions<S> extends VitePluginOptions {
16
+ /** Enable streaming SSR support. */
17
+ streaming?: true | S | false;
18
+ /**
19
+ * Inject the runtime `ValidatePlugin`. **Vite-only**: ignored by `.webpack()`,
20
+ * `.rspack()`, and `.rollup()` because injection happens via the Vite
21
+ * `CreateHeadTransform` plugin, which has no equivalent on other bundlers.
22
+ */
23
+ validate?: VitePluginOptions['validate'];
24
+ /**
25
+ * Enable the Vite Devtools integration. **Vite-only**: ignored by `.webpack()`,
26
+ * `.rspack()`, and `.rollup()` since `unheadDevtools` depends on
27
+ * `@vitejs/devtools-kit`.
28
+ */
29
+ devtools?: VitePluginOptions['devtools'];
30
+ }
31
+ /**
32
+ * Shape returned by the unified framework factory. Mirrors the subset of
33
+ * `UnpluginInstance` methods that Nuxt's `addBuildPlugin` consumes, so a
34
+ * call site can forward the factory object directly.
35
+ *
36
+ * Note: `rollup()` is provided for completeness (e.g. SSG static builds)
37
+ * but does **not** detect SSR context. `SSRStaticReplace` always sees
38
+ * `ssr=false` here because rollup has no equivalent of vite's
39
+ * `env.isSsrBuild` or webpack's `compiler.options.name === 'server'` hook;
40
+ * `head.ssr` references will always be statically rewritten to `false`.
41
+ * Use `.vite()` or `.webpack()` for SSR builds.
42
+ */
43
+ interface UnheadBundlerFactory {
44
+ vite: () => Plugin[];
45
+ webpack: () => any[];
46
+ rspack: () => any[];
47
+ rollup: () => any[];
48
+ }
49
+ /**
50
+ * Unified framework factory. Returns an object with per-bundler dispatch
51
+ * methods so consumers (e.g. Nuxt's `addBuildPlugin`) can forward it
52
+ * directly without per-bundler imports.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * // framework-side:
57
+ * export const Unhead = createFrameworkPlugin({
58
+ * framework: '@unhead/vue',
59
+ * streamingPlugin: unheadVueStreamingPlugin,
60
+ * })
61
+ *
62
+ * // consumer-side (vite):
63
+ * plugins: [...Unhead({ streaming: true }).vite()]
64
+ *
65
+ * // consumer-side (nuxt kit):
66
+ * addBuildPlugin(Unhead({ streaming: true }))
67
+ * ```
68
+ */
69
+ declare function createFrameworkPlugin<S>({ framework, streamingPlugin }: FrameworkPluginConfig<S>): (options?: UnheadFrameworkOptions<S>) => UnheadBundlerFactory;
70
+
71
+ export { createFrameworkPlugin };
72
+ export type { FrameworkPluginConfig, UnheadBundlerFactory, UnheadFrameworkOptions };
@@ -0,0 +1,72 @@
1
+ import { UnpluginInstance } from 'unplugin';
2
+ import { Plugin } from 'vite';
3
+ import { V as VitePluginOptions } from './shared/bundler.LjD9SWtb.js';
4
+
5
+ /**
6
+ * Per-framework factory config. `framework` is the package name (e.g.
7
+ * `@unhead/vue`) used internally by the base bundler to import runtime
8
+ * plugins from the right path; `streamingPlugin` is the framework's
9
+ * streaming unplugin instance (as returned by `createUnplugin`).
10
+ */
11
+ interface FrameworkPluginConfig<S> {
12
+ framework: string;
13
+ streamingPlugin: UnpluginInstance<S | undefined, boolean>;
14
+ }
15
+ interface UnheadFrameworkOptions<S> extends VitePluginOptions {
16
+ /** Enable streaming SSR support. */
17
+ streaming?: true | S | false;
18
+ /**
19
+ * Inject the runtime `ValidatePlugin`. **Vite-only**: ignored by `.webpack()`,
20
+ * `.rspack()`, and `.rollup()` because injection happens via the Vite
21
+ * `CreateHeadTransform` plugin, which has no equivalent on other bundlers.
22
+ */
23
+ validate?: VitePluginOptions['validate'];
24
+ /**
25
+ * Enable the Vite Devtools integration. **Vite-only**: ignored by `.webpack()`,
26
+ * `.rspack()`, and `.rollup()` since `unheadDevtools` depends on
27
+ * `@vitejs/devtools-kit`.
28
+ */
29
+ devtools?: VitePluginOptions['devtools'];
30
+ }
31
+ /**
32
+ * Shape returned by the unified framework factory. Mirrors the subset of
33
+ * `UnpluginInstance` methods that Nuxt's `addBuildPlugin` consumes, so a
34
+ * call site can forward the factory object directly.
35
+ *
36
+ * Note: `rollup()` is provided for completeness (e.g. SSG static builds)
37
+ * but does **not** detect SSR context. `SSRStaticReplace` always sees
38
+ * `ssr=false` here because rollup has no equivalent of vite's
39
+ * `env.isSsrBuild` or webpack's `compiler.options.name === 'server'` hook;
40
+ * `head.ssr` references will always be statically rewritten to `false`.
41
+ * Use `.vite()` or `.webpack()` for SSR builds.
42
+ */
43
+ interface UnheadBundlerFactory {
44
+ vite: () => Plugin[];
45
+ webpack: () => any[];
46
+ rspack: () => any[];
47
+ rollup: () => any[];
48
+ }
49
+ /**
50
+ * Unified framework factory. Returns an object with per-bundler dispatch
51
+ * methods so consumers (e.g. Nuxt's `addBuildPlugin`) can forward it
52
+ * directly without per-bundler imports.
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * // framework-side:
57
+ * export const Unhead = createFrameworkPlugin({
58
+ * framework: '@unhead/vue',
59
+ * streamingPlugin: unheadVueStreamingPlugin,
60
+ * })
61
+ *
62
+ * // consumer-side (vite):
63
+ * plugins: [...Unhead({ streaming: true }).vite()]
64
+ *
65
+ * // consumer-side (nuxt kit):
66
+ * addBuildPlugin(Unhead({ streaming: true }))
67
+ * ```
68
+ */
69
+ declare function createFrameworkPlugin<S>({ framework, streamingPlugin }: FrameworkPluginConfig<S>): (options?: UnheadFrameworkOptions<S>) => UnheadBundlerFactory;
70
+
71
+ export { createFrameworkPlugin };
72
+ export type { FrameworkPluginConfig, UnheadBundlerFactory, UnheadFrameworkOptions };
@@ -0,0 +1,102 @@
1
+ import { S as SSRStaticReplace, u as unheadDevtools, C as CreateHeadTransform, T as TreeshakeServerComposables, U as UseSeoMetaTransform, M as MinifyTransform, c as createHeadTransformContext } from './shared/bundler.D9eYJXZg.mjs';
2
+ import 'node:fs';
3
+ import 'node:path';
4
+ import 'node:url';
5
+ import 'magic-string';
6
+ import 'oxc-walker';
7
+ import '@vitejs/devtools-kit';
8
+ import 'oxc-parser';
9
+ import 'ufo';
10
+ import 'unplugin';
11
+ import 'node:vm';
12
+ import 'unhead/utils';
13
+
14
+ function resolveCoreDefs(options) {
15
+ const defs = [];
16
+ const common = { filter: options.filter, sourcemap: options.sourcemap };
17
+ if (options.treeshake !== false) {
18
+ const treeshakeOpts = typeof options.treeshake === "object" ? options.treeshake : {};
19
+ defs.push({ instance: TreeshakeServerComposables, options: { ...common, ...treeshakeOpts } });
20
+ }
21
+ if (options.transformSeoMeta !== false) {
22
+ const seoMetaOpts = typeof options.transformSeoMeta === "object" ? options.transformSeoMeta : {};
23
+ defs.push({ instance: UseSeoMetaTransform, options: { ...common, ...seoMetaOpts } });
24
+ }
25
+ if (options.minify !== false) {
26
+ const minifyOpts = typeof options.minify === "object" ? options.minify : options.minify === true ? { js: true, css: true } : {};
27
+ if (minifyOpts.js || minifyOpts.css) {
28
+ defs.push({ instance: MinifyTransform, options: { ...common, ...minifyOpts } });
29
+ }
30
+ }
31
+ return defs;
32
+ }
33
+ function dispatch(bundler, defs) {
34
+ const out = [];
35
+ for (const { instance, options } of defs) {
36
+ const plugin = instance[bundler](options);
37
+ if (Array.isArray(plugin))
38
+ out.push(...plugin);
39
+ else out.push(plugin);
40
+ }
41
+ return out;
42
+ }
43
+ function resolveStreamingOpts(streaming) {
44
+ return streaming && typeof streaming === "object" ? streaming : void 0;
45
+ }
46
+ function pushPlugin(out, value) {
47
+ if (Array.isArray(value))
48
+ out.push(...value);
49
+ else out.push(value);
50
+ }
51
+ function createFrameworkPlugin({ framework, streamingPlugin }) {
52
+ return (options = {}) => {
53
+ const { streaming, validate, devtools, ...coreOpts } = options;
54
+ const defs = resolveCoreDefs(coreOpts);
55
+ const streamOpts = resolveStreamingOpts(streaming);
56
+ const wantStreaming = !!streaming;
57
+ return {
58
+ vite: () => {
59
+ const plugins = dispatch("vite", defs);
60
+ const ctx = createHeadTransformContext();
61
+ if (validate !== false) {
62
+ ctx.addRuntimePlugin({
63
+ import: { name: "ValidatePlugin", source: `${framework}/plugins`, as: "__unhead_validate" },
64
+ client: "_h.use(__unhead_validate({ root: __ROOT__ }))"
65
+ });
66
+ }
67
+ if (devtools !== false) {
68
+ const devtoolsOpts = typeof devtools === "object" ? devtools : {};
69
+ plugins.push(unheadDevtools({ ...devtoolsOpts, _ctx: ctx }));
70
+ }
71
+ plugins.push(SSRStaticReplace.vite({}));
72
+ plugins.push(CreateHeadTransform(ctx));
73
+ if (wantStreaming)
74
+ pushPlugin(plugins, streamingPlugin.vite(streamOpts));
75
+ return plugins;
76
+ },
77
+ webpack: () => {
78
+ const plugins = dispatch("webpack", defs);
79
+ plugins.push(SSRStaticReplace.webpack({}));
80
+ if (wantStreaming)
81
+ pushPlugin(plugins, streamingPlugin.webpack(streamOpts));
82
+ return plugins;
83
+ },
84
+ rspack: () => {
85
+ const plugins = dispatch("rspack", defs);
86
+ plugins.push(SSRStaticReplace.rspack({}));
87
+ if (wantStreaming)
88
+ pushPlugin(plugins, streamingPlugin.rspack(streamOpts));
89
+ return plugins;
90
+ },
91
+ rollup: () => {
92
+ const plugins = dispatch("rollup", defs);
93
+ plugins.push(SSRStaticReplace.rollup({}));
94
+ if (wantStreaming)
95
+ pushPlugin(plugins, streamingPlugin.rollup(streamOpts));
96
+ return plugins;
97
+ }
98
+ };
99
+ };
100
+ }
101
+
102
+ export { createFrameworkPlugin };
@@ -1,4 +1,4 @@
1
- import { M as MinifyFn } from '../shared/bundler.BwKIGaKX.mjs';
1
+ import { M as MinifyFn } from '../shared/bundler.LjD9SWtb.mjs';
2
2
 
3
3
  declare function createJSMinifier(): MinifyFn;
4
4
 
@@ -1,4 +1,4 @@
1
- import { M as MinifyFn } from '../shared/bundler.BwKIGaKX.js';
1
+ import { M as MinifyFn } from '../shared/bundler.LjD9SWtb.js';
2
2
 
3
3
  declare function createJSMinifier(): MinifyFn;
4
4
 
@@ -1,4 +1,4 @@
1
- import { M as MinifyFn } from '../shared/bundler.BwKIGaKX.mjs';
1
+ import { M as MinifyFn } from '../shared/bundler.LjD9SWtb.mjs';
2
2
 
3
3
  declare function createCSSMinifier(): MinifyFn;
4
4
 
@@ -1,4 +1,4 @@
1
- import { M as MinifyFn } from '../shared/bundler.BwKIGaKX.js';
1
+ import { M as MinifyFn } from '../shared/bundler.LjD9SWtb.js';
2
2
 
3
3
  declare function createCSSMinifier(): MinifyFn;
4
4
 
@@ -1,4 +1,4 @@
1
- import { M as MinifyFn } from '../shared/bundler.BwKIGaKX.mjs';
1
+ import { M as MinifyFn } from '../shared/bundler.LjD9SWtb.mjs';
2
2
 
3
3
  declare function createJSMinifier(): MinifyFn;
4
4
 
@@ -1,4 +1,4 @@
1
- import { M as MinifyFn } from '../shared/bundler.BwKIGaKX.js';
1
+ import { M as MinifyFn } from '../shared/bundler.LjD9SWtb.js';
2
2
 
3
3
  declare function createJSMinifier(): MinifyFn;
4
4