nuxt-og-image 2.0.0-beta.4 → 2.0.0-beta.41

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 (88) hide show
  1. package/README.md +245 -47
  2. package/dist/client/200.html +2 -2
  3. package/dist/client/404.html +2 -2
  4. package/dist/client/_nuxt/IconCSS.8bbd2aa2.css +1 -0
  5. package/dist/client/_nuxt/IconCSS.db300c72.js +1 -0
  6. package/dist/client/_nuxt/ImageLoader.7571516f.css +1 -0
  7. package/dist/client/_nuxt/ImageLoader.9ee91833.js +1 -0
  8. package/dist/client/_nuxt/entry.f180d9dc.js +5 -0
  9. package/dist/client/_nuxt/entry.f4586a2b.css +1 -0
  10. package/dist/client/_nuxt/{error-404.1ff52902.js → error-404.7ee6d3e0.js} +1 -1
  11. package/dist/client/_nuxt/{error-500.f7d30da5.js → error-500.d9b74ae7.js} +1 -1
  12. package/dist/client/_nuxt/error-component.0102aa4e.js +3 -0
  13. package/dist/client/_nuxt/index.18957a6a.js +1 -0
  14. package/dist/client/_nuxt/index.403133d8.css +1 -0
  15. package/dist/client/_nuxt/{options.56a3e5f9.js → options.a1a5b6d3.js} +1 -1
  16. package/dist/client/_nuxt/{png.37f3e77b.js → png.e401832b.js} +1 -1
  17. package/dist/client/_nuxt/{shiki.3a930bb8.js → shiki.df675964.js} +1 -1
  18. package/dist/client/_nuxt/{svg.186c6bd1.js → svg.a65813fd.js} +1 -1
  19. package/dist/client/_nuxt/{vnodes.a799f183.js → vnodes.6e14ce87.js} +1 -1
  20. package/dist/client/index.html +2 -2
  21. package/dist/client/options/index.html +2 -2
  22. package/dist/client/png/index.html +2 -2
  23. package/dist/client/svg/index.html +2 -2
  24. package/dist/client/vnodes/index.html +2 -2
  25. package/dist/module.d.ts +21 -7
  26. package/dist/module.json +1 -1
  27. package/dist/module.mjs +285 -114
  28. package/dist/runtime/browserUtil.d.ts +1 -0
  29. package/dist/runtime/browserUtil.mjs +10 -5
  30. package/dist/runtime/components/OgImageDynamic.d.ts +1 -1
  31. package/dist/runtime/components/OgImageScreenshot.d.ts +1 -1
  32. package/dist/runtime/components/OgImageStatic.d.ts +1 -1
  33. package/dist/runtime/composables/defineOgImage.mjs +15 -12
  34. package/dist/runtime/nitro/middleware/og.png.mjs +51 -7
  35. package/dist/runtime/nitro/middleware/playground.mjs +4 -3
  36. package/dist/runtime/nitro/plugins/prerender.d.ts +3 -0
  37. package/dist/runtime/nitro/plugins/prerender.mjs +26 -0
  38. package/dist/runtime/nitro/providers/browser/lambda.d.ts +1 -1
  39. package/dist/runtime/nitro/providers/browser/lambda.mjs +3 -3
  40. package/dist/runtime/nitro/providers/browser/{node.mjs → playwright.mjs} +0 -9
  41. package/dist/runtime/nitro/providers/browser/universal.d.ts +1 -0
  42. package/dist/runtime/nitro/providers/browser/universal.mjs +33 -0
  43. package/dist/runtime/nitro/providers/png/resvg-node.d.ts +5 -0
  44. package/dist/runtime/nitro/providers/png/resvg-node.mjs +6 -0
  45. package/dist/runtime/nitro/providers/png/resvg-wasm.d.ts +4 -0
  46. package/dist/runtime/nitro/providers/png/resvg-wasm.mjs +11 -0
  47. package/dist/runtime/nitro/providers/png/svg2png.mjs +11 -0
  48. package/dist/runtime/nitro/providers/satori/{webworker.mjs → yoga-wasm.mjs} +4 -5
  49. package/dist/runtime/nitro/renderers/browser.d.ts +2 -2
  50. package/dist/runtime/nitro/renderers/browser.mjs +14 -7
  51. package/dist/runtime/nitro/renderers/satori/index.d.ts +2 -2
  52. package/dist/runtime/nitro/renderers/satori/index.mjs +22 -15
  53. package/dist/runtime/nitro/renderers/satori/plugins/encoding.mjs +2 -1
  54. package/dist/runtime/nitro/renderers/satori/plugins/imageSrc.mjs +25 -3
  55. package/dist/runtime/nitro/renderers/satori/utils.d.ts +2 -2
  56. package/dist/runtime/nitro/renderers/satori/utils.mjs +25 -12
  57. package/dist/runtime/nitro/routes/debug.d.ts +4 -0
  58. package/dist/runtime/nitro/routes/debug.mjs +9 -0
  59. package/dist/runtime/nitro/routes/html.mjs +52 -14
  60. package/dist/runtime/nitro/routes/options.mjs +20 -22
  61. package/dist/runtime/nitro/routes/svg.mjs +3 -1
  62. package/dist/runtime/nitro/routes/vnode.mjs +3 -1
  63. package/dist/runtime/nitro/util-hostname.d.ts +2 -0
  64. package/dist/runtime/nitro/util-hostname.mjs +15 -0
  65. package/dist/runtime/nitro/utils-pure.d.ts +3 -2
  66. package/dist/runtime/nitro/utils-pure.mjs +9 -8
  67. package/dist/runtime/nitro/utils.d.ts +6 -8
  68. package/dist/runtime/nitro/utils.mjs +50 -47
  69. package/dist/runtime/public-assets/__nuxt_og_image__/browser-provider-not-supported.png +0 -0
  70. package/dist/runtime/public-assets-optional/resvg/resvg.wasm +0 -0
  71. package/dist/types.d.ts +6 -0
  72. package/package.json +33 -23
  73. package/dist/client/_nuxt/IconCSS.a041aca0.js +0 -1
  74. package/dist/client/_nuxt/ImageLoader.9bf39d71.js +0 -1
  75. package/dist/client/_nuxt/entry.74018bda.js +0 -5
  76. package/dist/client/_nuxt/entry.7a8c1ab2.css +0 -1
  77. package/dist/client/_nuxt/error-component.cf7543e5.js +0 -3
  78. package/dist/client/_nuxt/index.3f356409.js +0 -1
  79. package/dist/runtime/nitro/providers/svg2png/universal.mjs +0 -9
  80. /package/dist/runtime/nitro/providers/browser/{node.d.ts → playwright.d.ts} +0 -0
  81. /package/dist/runtime/nitro/providers/{svg2png/universal.d.ts → png/svg2png.d.ts} +0 -0
  82. /package/dist/runtime/nitro/providers/satori/{node.d.ts → default.d.ts} +0 -0
  83. /package/dist/runtime/nitro/providers/satori/{node.mjs → default.mjs} +0 -0
  84. /package/dist/runtime/nitro/providers/satori/{webworker.d.ts → yoga-wasm.d.ts} +0 -0
  85. /package/dist/runtime/{public-assets → public-assets-optional/inter-font}/inter-latin-ext-400-normal.woff +0 -0
  86. /package/dist/runtime/{public-assets → public-assets-optional/inter-font}/inter-latin-ext-700-normal.woff +0 -0
  87. /package/dist/runtime/{public-assets → public-assets-optional/svg2png}/svg2png.wasm +0 -0
  88. /package/dist/runtime/{public-assets → public-assets-optional/yoga}/yoga.wasm +0 -0
@@ -1,3 +0,0 @@
1
- import{o as m,c as p,n as _,g as E,u as t,d as n,_ as o}from"./entry.74018bda.js";const f={__name:"nuxt-error-page",props:{error:Object},setup(r){(r.error.stack||"").split(`
2
- `).splice(1).map(e=>({text:e.replace("webpack:/","").replace(".vue",".js").trim(),internal:e.includes("node_modules")&&!e.includes(".cache")||e.includes("internal")||e.includes("new Promise")})).map(e=>`<span class="stack${e.internal?" internal":""}">${e.text}</span>`).join(`
3
- `);const s=Number(r.error.statusCode||500),a=s===404,c=r.error.statusMessage??(a?"Page Not Found":"Internal Server Error"),u=r.error.message||r.error.toString(),i=void 0,d=a?n(()=>o(()=>import("./error-404.1ff52902.js"),["./error-404.1ff52902.js","./entry.74018bda.js","./entry.7a8c1ab2.css","./error-404.1469f10f.css"],import.meta.url).then(e=>e.default||e)):n(()=>o(()=>import("./error-500.f7d30da5.js"),["./error-500.f7d30da5.js","./entry.74018bda.js","./entry.7a8c1ab2.css","./error-500.92b94fae.css"],import.meta.url).then(e=>e.default||e));return(e,l)=>(m(),p(t(d),_(E({statusCode:t(s),statusMessage:t(c),description:t(u),stack:t(i)})),null,16))}},v=f;export{v as default};
@@ -1 +0,0 @@
1
- import{a as x,r as u,k as y,l as S,m as $,w as p,p as R,q as k,f as C,s as H,o as v,h as g,t as B,i as D,j as M,v as W,x as b,u as i,y as z,z as A,A as F,B as I,C as L}from"./entry.74018bda.js";const N={class:"w-full mx-auto max-w-1200px h-full max-h-630px justify-center flex",style:{"max-height":"630px"}},T=x({__name:"IFrameLoader",props:{src:String,aspectRatio:Number,description:String},setup(l){const t=l,s=u(t.src),a=y(),c=u(),n=u(0),o=S(()=>{let e=c.value;e||(e=document.querySelector("#iframe-loader"));const r=Date.now();e.src="";const d=e.offsetHeight,f=e.offsetWidth,h=d>630?1:d/630,_=f>1200?1:f/1200,w=_>h?h:_;n.value=0,e.style.opacity="0",e.onload=()=>{e.style.opacity="1",n.value=Date.now()-r},e.src=`${s.value}&scale=${w}&mode=${a.value}`},200);$(()=>{p(()=>t.src,e=>{s.value=e,o()},{immediate:!0}),p([()=>R.value,a],()=>{o()})}),k({bodyAttrs:{onresize:()=>{o()}}});const m=C(()=>t.description.replace("%s",n.value.toString()));return p(m,e=>{H.value=e}),(e,r)=>(v(),g("div",N,[B("iframe",{id:"iframe-loader",ref_key:"iframe",ref:c,class:"max-h-full",style:D({aspectRatio:l.aspectRatio}),width:"1200",height:"630"},null,4)]))}}),j=M(T,[["__scopeId","data-v-85f41f36"]]),q={class:"flex h-full w-full"},E=x({__name:"index",async setup(l){let t,s;const a=([t,s]=W(()=>z.useServerConfig()),t=await t,s(),t),c=a.value?.height||630,o=(a.value?.width||1200)/c;return(m,e)=>{const r=j;return v(),g("div",q,[b(r,{src:`${i(A)}/api/og-image-html?path=${i(F)}&timestamp=${i(I)}`,"aspect-ratio":o,description:"[HTML] Generated in %sms.",class:"max-h-full",onRefresh:i(L)},null,8,["src","onRefresh"])])}}});export{E as default};
@@ -1,9 +0,0 @@
1
- import { initialize, svg2png } from "svg2png-wasm";
2
- import { wasmLoader } from "../../utils.mjs";
3
- export default async function(svg, options) {
4
- const loader = wasmLoader("/* NUXT_OG_IMAGE_SVG2PNG_WASM */", "/svg2png.wasm", options.baseUrl);
5
- if (!await loader.loaded())
6
- await initialize(await loader.load()).catch(() => {
7
- });
8
- return await svg2png(svg, options);
9
- }