nuxt-og-image 3.0.0-rc.25 → 3.0.0-rc.27

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.
@@ -1 +1 @@
1
- import{_ as a,u as n,o as r,c as l,a as e,t as s,b as d,w as c,d as p,e as f,p as h,f as m}from"./entry.KVHLBCv-.js";const x=t=>(h("data-v-05a2b8a3"),t=t(),m(),t),u={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},g=x(()=>e("div",{class:"fixed left-0 right-0 spotlight z-10"},null,-1)),b={class:"max-w-520px text-center z-20"},_=["textContent"],w=["textContent"],y={class:"w-full flex items-center justify-center"},S={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:404},statusMessage:{type:String,default:"Not Found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(t){const o=t;return n({title:`${o.statusCode} - ${o.statusMessage} | ${o.appName}`,script:[],style:[{children:'*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e0e0}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}a{color:inherit;text-decoration:inherit}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}'}]}),(k,N)=>{const i=f;return r(),l("div",u,[g,e("div",b,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:s(t.statusCode)},null,8,_),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:s(t.description)},null,8,w),e("div",y,[d(i,{to:"/",class:"gradient-border text-md sm:text-xl py-2 px-4 sm:py-3 sm:px-6 cursor-pointer"},{default:c(()=>[p(s(t.backHome),1)]),_:1})])])])}}},z=a(S,[["__scopeId","data-v-05a2b8a3"]]);export{z as default};
1
+ import{_ as a,u as n,o as r,c as l,a as e,t as s,b as d,w as c,d as p,e as f,p as h,f as m}from"./entry.PB77ihTr.js";const x=t=>(h("data-v-05a2b8a3"),t=t(),m(),t),u={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},g=x(()=>e("div",{class:"fixed left-0 right-0 spotlight z-10"},null,-1)),b={class:"max-w-520px text-center z-20"},_=["textContent"],w=["textContent"],y={class:"w-full flex items-center justify-center"},S={__name:"error-404",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:404},statusMessage:{type:String,default:"Not Found"},description:{type:String,default:"Sorry, the page you are looking for could not be found."},backHome:{type:String,default:"Go back home"}},setup(t){const o=t;return n({title:`${o.statusCode} - ${o.statusMessage} | ${o.appName}`,script:[],style:[{children:'*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e0e0}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}a{color:inherit;text-decoration:inherit}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}'}]}),(k,N)=>{const i=f;return r(),l("div",u,[g,e("div",b,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:s(t.statusCode)},null,8,_),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:s(t.description)},null,8,w),e("div",y,[d(i,{to:"/",class:"gradient-border text-md sm:text-xl py-2 px-4 sm:py-3 sm:px-6 cursor-pointer"},{default:c(()=>[p(s(t.backHome),1)]),_:1})])])])}}},z=a(S,[["__scopeId","data-v-05a2b8a3"]]);export{z as default};
@@ -1 +1 @@
1
- import{_ as i,u as a,o as r,c as n,a as e,t as s,p as l,f as d}from"./entry.KVHLBCv-.js";const c=t=>(l("data-v-c967d9a9"),t=t(),d(),t),p={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},h=c(()=>e("div",{class:"fixed -bottom-1/2 left-0 right-0 h-1/2 spotlight"},null,-1)),f={class:"max-w-520px text-center"},g=["textContent"],m=["textContent"],x={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const o=t;return a({title:`${o.statusCode} - ${o.statusMessage} | ${o.appName}`,script:[],style:[{children:'*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e0e0}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}'}]}),(b,u)=>(r(),n("div",p,[h,e("div",f,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:s(t.statusCode)},null,8,g),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:s(t.description)},null,8,m)])]))}},_=i(x,[["__scopeId","data-v-c967d9a9"]]);export{_ as default};
1
+ import{_ as i,u as a,o as r,c as n,a as e,t as s,p as l,f as d}from"./entry.PB77ihTr.js";const c=t=>(l("data-v-c967d9a9"),t=t(),d(),t),p={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},h=c(()=>e("div",{class:"fixed -bottom-1/2 left-0 right-0 h-1/2 spotlight"},null,-1)),f={class:"max-w-520px text-center"},g=["textContent"],m=["textContent"],x={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const o=t;return a({title:`${o.statusCode} - ${o.statusMessage} | ${o.appName}`,script:[],style:[{children:'*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e0e0}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}'}]}),(b,u)=>(r(),n("div",p,[h,e("div",f,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:s(t.statusCode)},null,8,g),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:s(t.description)},null,8,m)])]))}},_=i(x,[["__scopeId","data-v-c967d9a9"]]);export{_ as default};
@@ -1,12 +1,12 @@
1
1
  <!DOCTYPE html><html><head><meta charset="utf-8">
2
2
  <meta name="viewport" content="width=device-width, initial-scale=1">
3
- <link rel="stylesheet" href="/__nuxt-og-image/_nuxt/entry.4NCgbL5v.css">
4
- <link rel="modulepreload" as="script" crossorigin href="/__nuxt-og-image/_nuxt/entry.KVHLBCv-.js">
3
+ <link rel="stylesheet" href="/__nuxt-og-image/_nuxt/entry.Cr1VFkjV.css">
4
+ <link rel="modulepreload" as="script" crossorigin href="/__nuxt-og-image/_nuxt/entry.PB77ihTr.js">
5
5
  <link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/vanilla-picker-NKbIFE8h.vtyeXros.js">
6
6
  <link rel="prefetch" as="style" href="/__nuxt-og-image/_nuxt/error-404.DkXpI38i.css">
7
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-404.IuTb1ahA.js">
7
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-404.Pv_QKbXi.js">
8
8
  <link rel="prefetch" as="style" href="/__nuxt-og-image/_nuxt/error-500.SLhS9LVu.css">
9
- <link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-500.m_eeqiB3.js">
10
- <script type="module" src="/__nuxt-og-image/_nuxt/entry.KVHLBCv-.js" crossorigin></script><script>"use strict";(()=>{const a=window,e=document.documentElement,m=["dark","light"],c=window&&window.localStorage&&window.localStorage.getItem&&window.localStorage.getItem("nuxt-color-mode")||"system";let n=c==="system"?d():c;const l=e.getAttribute("data-color-mode-forced");l&&(n=l),i(n),a["__NUXT_COLOR_MODE__"]={preference:c,value:n,getColorScheme:d,addColorScheme:i,removeColorScheme:f};function i(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function f(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function r(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function d(){if(a.matchMedia&&r("").media!=="not all"){for(const o of m)if(r(":"+o).matches)return o}return"light"}})();
9
+ <link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-500.dbftAlXB.js">
10
+ <script type="module" src="/__nuxt-og-image/_nuxt/entry.PB77ihTr.js" crossorigin></script><script>"use strict";(()=>{const a=window,e=document.documentElement,m=["dark","light"],c=window&&window.localStorage&&window.localStorage.getItem&&window.localStorage.getItem("nuxt-color-mode")||"system";let n=c==="system"?d():c;const l=e.getAttribute("data-color-mode-forced");l&&(n=l),i(n),a["__NUXT_COLOR_MODE__"]={preference:c,value:n,getColorScheme:d,addColorScheme:i,removeColorScheme:f};function i(o){const t=""+o+"",s="";e.classList?e.classList.add(t):e.className+=" "+t,s&&e.setAttribute("data-"+s,o)}function f(o){const t=""+o+"",s="";e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp(t,"g"),""),s&&e.removeAttribute("data-"+s)}function r(o){return a.matchMedia("(prefers-color-scheme"+o+")")}function d(){if(a.matchMedia&&r("").media!=="not all"){for(const o of m)if(r(":"+o).matches)return o}return"light"}})();
11
11
  </script></head><body><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4,"once":5},{},false,{},{},["Set"]]</script>
12
12
  <script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body></html>
package/dist/module.d.mts CHANGED
@@ -126,7 +126,7 @@ interface ModuleOptions {
126
126
  /**
127
127
  * Fonts to use when rendering the og:image.
128
128
  *
129
- * @example ['Roboto:400,700', { path: 'path/to/font.ttf', weight: 400, name: 'MyFont' }]
129
+ * @example ['Roboto:400', 'Roboto:700', { path: 'path/to/font.ttf', weight: 400, name: 'MyFont' }]
130
130
  */
131
131
  fonts: InputFontConfig[];
132
132
  /**
package/dist/module.d.ts CHANGED
@@ -126,7 +126,7 @@ interface ModuleOptions {
126
126
  /**
127
127
  * Fonts to use when rendering the og:image.
128
128
  *
129
- * @example ['Roboto:400,700', { path: 'path/to/font.ttf', weight: 400, name: 'MyFont' }]
129
+ * @example ['Roboto:400', 'Roboto:700', { path: 'path/to/font.ttf', weight: 400, name: 'MyFont' }]
130
130
  */
131
131
  fonts: InputFontConfig[];
132
132
  /**
package/dist/module.json CHANGED
@@ -5,5 +5,5 @@
5
5
  "bridge": false
6
6
  },
7
7
  "configKey": "ogImage",
8
- "version": "3.0.0-rc.24"
8
+ "version": "3.0.0-rc.26"
9
9
  }
package/dist/module.mjs CHANGED
@@ -95,7 +95,8 @@ const RuntimeCompatibility = {
95
95
  }
96
96
  },
97
97
  "cloudflare-pages": cloudflare,
98
- "cloudflare": cloudflare
98
+ "cloudflare": cloudflare,
99
+ "cloudflare-module": cloudflare
99
100
  };
100
101
  function detectTarget(options = {}) {
101
102
  return options?.static ? autodetectableStaticProviders[provider] : autodetectableProviders[provider];
@@ -331,15 +332,15 @@ async function setupBuildHandler(config, resolve, nuxt = useNuxt()) {
331
332
  return;
332
333
  const configuredEntry = nitro.options.rollupConfig?.output.entryFileNames;
333
334
  let serverEntry = resolve(_nitro.options.output.serverDir, typeof configuredEntry === "string" ? configuredEntry : "index.mjs");
334
- const isCloudflarePages = target === "cloudflare-pages";
335
- if (isCloudflarePages)
335
+ const isCloudflarePagesOrModule = target === "cloudflare-pages" || target === "cloudflare-module";
336
+ if (isCloudflarePagesOrModule)
336
337
  serverEntry = resolve(dirname(serverEntry), "./chunks/wasm.mjs");
337
338
  const contents = await readFile(serverEntry, "utf-8");
338
339
  const resvgHash = sha1(await readFile(await resolvePath("@resvg/resvg-wasm/index_bg.wasm")));
339
340
  const yogaHash = sha1(await readFile(await resolvePath("yoga-wasm-web/dist/yoga.wasm")));
340
341
  const cssInlineHash = sha1(await readFile(await resolvePath("@css-inline/css-inline-wasm/index_bg.wasm")));
341
342
  const postfix = target === "vercel-edge" ? "?module" : "";
342
- const path = isCloudflarePages ? `../wasm/` : `./wasm/`;
343
+ const path = isCloudflarePagesOrModule ? `../wasm/` : `./wasm/`;
343
344
  await writeFile(serverEntry, contents.replaceAll('"@resvg/resvg-wasm/index_bg.wasm"', `"${path}index_bg-${resvgHash}.wasm${postfix}"`).replaceAll('"@css-inline/css-inline-wasm/index_bg.wasm"', `"${path}index_bg-${cssInlineHash}.wasm${postfix}"`).replaceAll('"yoga-wasm-web/dist/yoga.wasm"', `"${path}yoga-${yogaHash}.wasm${postfix}"`), { encoding: "utf-8" });
344
345
  });
345
346
  });
@@ -493,7 +494,7 @@ const module = defineNuxtModule({
493
494
  addServerPlugin(resolve("./runtime/nitro/plugins/nuxt-content"));
494
495
  if (!config.fonts.length)
495
496
  config.fonts = ["Inter:400", "Inter:700"];
496
- if (preset === "cloudflare") {
497
+ if (preset === "cloudflare" || preset === "cloudflare-module") {
497
498
  config.fonts = config.fonts.filter((f) => {
498
499
  if (typeof f !== "string" && f.path) {
499
500
  logger.warn(`The ${f.name}:${f.weight} font was skipped because remote fonts are not available in Cloudflare Workers, please use a Google font.`);
@@ -667,7 +668,7 @@ ${componentImports}
667
668
  nuxt.options.nitro.prerender.routes = nuxt.options.nitro.prerender.routes || [];
668
669
  normalisedFonts.filter((f) => !f.path && !f.key).forEach((entry, key) => {
669
670
  const { name: name2, weight } = entry;
670
- if (preset !== "cloudflare") {
671
+ if (preset !== "cloudflare" && preset !== "cloudflare-module") {
671
672
  entry.path = `/__og-image__/font/${name2}/${weight}.ttf`;
672
673
  nuxt.options.nitro.prerender.routes.unshift(entry.path);
673
674
  }
@@ -8,55 +8,54 @@ import { useNitroOrigin } from "#imports";
8
8
  export default defineSatoriTransformer([
9
9
  // fix <img src="">
10
10
  {
11
- filter: (node) => node.type === "img",
11
+ filter: (node) => node.type === "img" && node.props?.src,
12
12
  transform: async (node, { e }) => {
13
- const src = node.props?.src;
14
- const isRelative = src?.startsWith("/");
15
- if (src) {
16
- let updated = false;
17
- let dimensions;
18
- let imageBuffer;
19
- let valid = true;
13
+ const src = node.props.src;
14
+ const isRelative = src.startsWith("/");
15
+ let dimensions;
16
+ let imageBuffer;
17
+ if (isRelative) {
20
18
  if (import.meta.prerender || import.meta.dev) {
21
19
  const key = `root:public${src.replace("./", ":").replace("/", ":")}`;
22
- if (await useStorage().hasItem(key)) {
20
+ if (await useStorage().hasItem(key))
23
21
  imageBuffer = await useStorage().getItemRaw(key);
24
- updated = !!imageBuffer;
25
- }
26
- }
27
- if (!import.meta.prerender && !updated) {
22
+ } else {
28
23
  imageBuffer = await e.$fetch(src, {
29
24
  baseURL: useNitroOrigin(e),
30
25
  responseType: "arrayBuffer"
31
26
  }).catch(() => {
32
- valid = false;
33
27
  });
34
- valid = !!imageBuffer;
35
28
  }
36
- if (valid) {
37
- node.props.src = toBase64Image(src, imageBuffer);
38
- try {
39
- const imageSize = sizeOf(Buffer.from(imageBuffer));
40
- dimensions = { width: imageSize.width, height: imageSize.height };
41
- } catch (e2) {
42
- }
43
- updated = true;
44
- }
45
- if (dimensions?.width && dimensions?.height) {
46
- const naturalAspectRatio = dimensions.width / dimensions.height;
47
- if (node.props.width && !node.props.height) {
48
- node.props.height = Math.round(node.props.width / naturalAspectRatio);
49
- } else if (node.props.height && !node.props.width) {
50
- node.props.width = Math.round(node.props.height * naturalAspectRatio);
51
- } else if (!node.props.width && !node.props.height) {
52
- node.props.width = dimensions.width;
53
- node.props.height = dimensions.height;
54
- }
29
+ } else {
30
+ imageBuffer = await $fetch(src, {
31
+ responseType: "arrayBuffer"
32
+ }).catch(() => {
33
+ });
34
+ }
35
+ if (imageBuffer)
36
+ imageBuffer = Buffer.from(imageBuffer);
37
+ if (imageBuffer) {
38
+ node.props.src = toBase64Image(src, imageBuffer);
39
+ try {
40
+ const imageSize = sizeOf(imageBuffer);
41
+ dimensions = { width: imageSize.width, height: imageSize.height };
42
+ } catch (e2) {
55
43
  }
56
- if (!updated && isRelative) {
57
- node.props.src = `${withBase(src, `${useNitroOrigin(e)}`)}?${Date.now()}`;
44
+ }
45
+ if (dimensions?.width && dimensions?.height) {
46
+ const naturalAspectRatio = dimensions.width / dimensions.height;
47
+ if (node.props.width && !node.props.height) {
48
+ node.props.height = Math.round(node.props.width / naturalAspectRatio);
49
+ } else if (node.props.height && !node.props.width) {
50
+ node.props.width = Math.round(node.props.height * naturalAspectRatio);
51
+ } else if (!node.props.width && !node.props.height) {
52
+ node.props.width = dimensions.width;
53
+ node.props.height = dimensions.height;
58
54
  }
59
55
  }
56
+ if (node.props.src.startsWith("/")) {
57
+ node.props.src = `${withBase(src, `${useNitroOrigin(e)}`)}?${Date.now()}`;
58
+ }
60
59
  }
61
60
  },
62
61
  // fix style="background-image: url('')"
@@ -64,11 +63,21 @@ export default defineSatoriTransformer([
64
63
  filter: (node) => node.props?.style?.backgroundImage?.includes("url("),
65
64
  transform: async (node, { e }) => {
66
65
  const backgroundImage = node.props.style.backgroundImage;
67
- if (backgroundImage) {
68
- const src = backgroundImage.replace(/^url\(['"]?/, "").replace(/['"]?\)$/, "");
69
- const isRelative = src?.startsWith("/");
70
- if (isRelative)
66
+ const src = backgroundImage.replace(/^url\(['"]?/, "").replace(/['"]?\)$/, "");
67
+ const isRelative = src?.startsWith("/");
68
+ if (isRelative) {
69
+ if (import.meta.prerender || import.meta.dev) {
70
+ const key = `root:public${src.replace("./", ":").replace("/", ":")}`;
71
+ if (await useStorage().hasItem(key)) {
72
+ const imageBuffer = await useStorage().getItemRaw(key);
73
+ if (imageBuffer) {
74
+ const base64 = toBase64Image(src, Buffer.from(imageBuffer));
75
+ node.props.style.backgroundImage = `url(${base64})`;
76
+ }
77
+ }
78
+ } else {
71
79
  node.props.style.backgroundImage = `url(${withBase(src, `${useNitroOrigin(e)}`)}?${Date.now()})`;
80
+ }
72
81
  }
73
82
  }
74
83
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "nuxt-og-image",
3
3
  "type": "module",
4
- "version": "3.0.0-rc.25",
5
- "packageManager": "pnpm@8.14.0",
4
+ "version": "3.0.0-rc.27",
5
+ "packageManager": "pnpm@8.14.1",
6
6
  "description": "Enlightened OG Image generation for Nuxt.",
7
7
  "author": {
8
8
  "website": "https://harlanzw.com",
@@ -36,24 +36,24 @@
36
36
  "@css-inline/css-inline": "^0.12.1",
37
37
  "@css-inline/css-inline-wasm": "^0.12.1",
38
38
  "@iconify-json/noto": "^1.1.18",
39
- "@nuxt/devtools-kit": "^1.0.6",
39
+ "@nuxt/devtools-kit": "^1.0.8",
40
40
  "@nuxt/kit": "^3.9.1",
41
41
  "@resvg/resvg-js": "^2.6.0",
42
42
  "@resvg/resvg-wasm": "^2.6.0",
43
43
  "@unocss/core": "^0.58.3",
44
44
  "@unocss/preset-wind": "^0.58.3",
45
- "@vueuse/core": "^10.7.1",
45
+ "@vueuse/core": "^10.7.2",
46
46
  "chrome-launcher": "^1.1.0",
47
47
  "defu": "^6.1.4",
48
48
  "execa": "^8.0.1",
49
- "floating-vue": "2.0.0-beta.24",
49
+ "floating-vue": "5.1.0",
50
50
  "image-size": "^1.1.1",
51
51
  "nuxt-site-config": "^2.2.5",
52
52
  "nuxt-site-config-kit": "^2.2.5",
53
53
  "nypm": "^0.3.4",
54
54
  "ofetch": "^1.3.3",
55
55
  "ohash": "^1.1.3",
56
- "pathe": "^1.1.1",
56
+ "pathe": "^1.1.2",
57
57
  "pkg-types": "^1.0.3",
58
58
  "playwright-core": "^1.40.1",
59
59
  "radix3": "^1.1.0",
@@ -66,16 +66,16 @@
66
66
  "yoga-wasm-web": "^0.3.3"
67
67
  },
68
68
  "devDependencies": {
69
- "@antfu/eslint-config": "2.6.1",
70
- "@img/sharp-linux-x64": "0.33.1",
69
+ "@antfu/eslint-config": "2.6.2",
70
+ "@img/sharp-linux-x64": "0.33.2",
71
71
  "@nuxt/content": "^2.10.0",
72
- "@nuxt/devtools": "1.0.6",
72
+ "@nuxt/devtools": "1.0.8",
73
73
  "@nuxt/module-builder": "^0.5.5",
74
74
  "@nuxt/test-utils": "3.9.0",
75
- "@nuxt/ui": "^2.11.1",
75
+ "@nuxt/ui": "^2.12.0",
76
76
  "@nuxtjs/eslint-config-typescript": "^12.1.0",
77
77
  "@nuxtjs/i18n": "8.0.0",
78
- "@nuxtjs/tailwindcss": "^6.10.3",
78
+ "@nuxtjs/tailwindcss": "^6.10.4",
79
79
  "@unocss/nuxt": "^0.58.3",
80
80
  "bumpp": "^9.2.1",
81
81
  "eslint": "8.56.0",
@@ -84,9 +84,9 @@
84
84
  "nuxt-icon": "0.6.8",
85
85
  "playwright": "^1.40.1",
86
86
  "sass": "^1.69.7",
87
- "sharp": "^0.33.1",
87
+ "sharp": "^0.33.2",
88
88
  "typescript": "^5.3.3",
89
- "vitest": "^1.1.3"
89
+ "vitest": "^1.2.0"
90
90
  },
91
91
  "build": {
92
92
  "externals": [
@@ -1 +0,0 @@
1
- {"id":"aac5bb72-74f1-4acd-aaa7-48bf4267d65a","timestamp":1704690100932,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}