nuxt-og-image 2.2.4 → 3.0.0-beta.1
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.
- package/README.md +2 -2
- package/dist/client/200.html +8 -8
- package/dist/client/404.html +8 -8
- package/dist/client/_nuxt/IconCSS.8f429b14.css +1 -0
- package/dist/client/_nuxt/IconCSS.ac398b56.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/d1d517c3-4927-4803-bbb0-d94e9d3e9581.json +1 -0
- package/dist/client/_nuxt/entry.434c2c45.css +1 -0
- package/dist/client/_nuxt/entry.bdb8a8d5.js +137 -0
- package/dist/client/_nuxt/{error-404.407d76a3.js → error-404.f37119e7.js} +1 -1
- package/dist/client/_nuxt/{error-500.531c4147.js → error-500.74b0a30f.js} +1 -1
- package/dist/client/grid.png +0 -0
- package/dist/client/index.html +8 -8
- package/dist/module.d.mts +43 -39
- package/dist/module.d.ts +43 -39
- package/dist/module.json +1 -1
- package/dist/module.mjs +341 -667
- package/dist/runtime/cache.d.ts +4 -4
- package/dist/runtime/cache.mjs +2 -1
- package/dist/runtime/components/OgImage/Cached.mjs +1 -1
- package/dist/runtime/components/OgImage/Dynamic.mjs +1 -1
- package/dist/runtime/components/OgImage/Screenshot.mjs +1 -1
- package/dist/runtime/components/OgImage/Static.mjs +1 -1
- package/dist/runtime/components/OgImage/WithoutCache.mjs +1 -1
- package/dist/runtime/components/OgImage/index.mjs +1 -1
- package/dist/runtime/components/Templates/Community/Nuxt.vue +183 -0
- package/dist/runtime/components/Templates/Official/BrandedLogo.vue +28 -0
- package/dist/runtime/components/Templates/Official/Fallback.vue +147 -0
- package/dist/runtime/components/Templates/Official/SimpleBlog.vue +33 -0
- package/dist/runtime/components/Templates/Official/Wave.vue +33 -0
- package/dist/runtime/components/Templates/Official/WithEmoji.vue +27 -0
- package/dist/runtime/composables/defineOgImage.d.ts +10 -6
- package/dist/runtime/composables/defineOgImage.mjs +21 -9
- package/dist/runtime/core/bindings/chromium/node.d.ts +2 -0
- package/dist/runtime/{nitro/providers/browser/universal.mjs → core/bindings/chromium/node.mjs} +3 -3
- package/dist/runtime/core/bindings/resvg/node.d.ts +6 -0
- package/dist/runtime/core/bindings/resvg/node.mjs +5 -0
- package/dist/runtime/core/bindings/resvg/wasm.d.ts +40 -0
- package/dist/runtime/core/bindings/resvg/wasm.mjs +7 -0
- package/dist/runtime/core/bindings/satori/node.d.ts +6 -0
- package/dist/runtime/core/bindings/satori/node.mjs +5 -0
- package/dist/runtime/core/bindings/satori/yoga-wasm.d.ts +6 -0
- package/dist/runtime/core/bindings/satori/yoga-wasm.mjs +7 -0
- package/dist/runtime/core/bindings/sharp/node.d.ts +2 -0
- package/dist/runtime/core/bindings/sharp/node.mjs +2 -0
- package/dist/runtime/core/bindings/sharp/wasm.d.ts +2 -0
- package/dist/runtime/core/bindings/sharp/wasm.mjs +2 -0
- package/dist/runtime/core/cache/prerender.d.ts +6 -0
- package/dist/runtime/core/cache/prerender.mjs +6 -0
- package/dist/runtime/core/env/assets.d.ts +2 -0
- package/dist/runtime/core/env/assets.mjs +15 -0
- package/dist/runtime/core/font/cache.d.ts +1 -0
- package/dist/runtime/core/font/cache.mjs +1 -0
- package/dist/runtime/core/font/fetch.d.ts +3 -0
- package/dist/runtime/core/font/fetch.mjs +29 -0
- package/dist/runtime/core/html/fetch.d.ts +3 -0
- package/dist/runtime/core/html/fetch.mjs +117 -0
- package/dist/runtime/core/options/extract.d.ts +3 -0
- package/dist/runtime/{nitro/utils-pure.mjs → core/options/extract.mjs} +23 -21
- package/dist/runtime/core/options/fetch.d.ts +3 -0
- package/dist/runtime/core/options/fetch.mjs +21 -0
- package/dist/runtime/core/options/normalise.d.ts +2 -0
- package/dist/runtime/{composables/util.mjs → core/options/normalise.mjs} +9 -6
- package/dist/runtime/core/renderers/chromium/index.d.ts +3 -0
- package/dist/runtime/core/renderers/chromium/index.mjs +26 -0
- package/dist/runtime/core/renderers/chromium/screenshot.d.ts +6 -0
- package/dist/runtime/core/renderers/chromium/screenshot.mjs +47 -0
- package/dist/runtime/core/renderers/satori/fonts.d.ts +3 -0
- package/dist/runtime/core/renderers/satori/fonts.mjs +8 -0
- package/dist/runtime/core/renderers/satori/index.d.ts +5 -0
- package/dist/runtime/core/renderers/satori/index.mjs +53 -0
- package/dist/runtime/core/renderers/satori/instances.d.ts +39 -0
- package/dist/runtime/core/renderers/satori/instances.mjs +17 -0
- package/dist/runtime/{nitro → core}/renderers/satori/plugins/encoding.mjs +1 -1
- package/dist/runtime/{nitro → core}/renderers/satori/plugins/imageSrc.mjs +9 -14
- package/dist/runtime/{nitro → core}/renderers/satori/plugins/twClasses.mjs +1 -0
- package/dist/runtime/core/renderers/satori/utils.d.ts +4 -0
- package/dist/runtime/core/renderers/satori/utils.mjs +20 -0
- package/dist/runtime/core/renderers/satori/vnodes.d.ts +3 -0
- package/dist/runtime/core/renderers/satori/vnodes.mjs +21 -0
- package/dist/runtime/core/utils/resolveRendererContext.d.ts +7 -0
- package/dist/runtime/core/utils/resolveRendererContext.mjs +76 -0
- package/dist/runtime/nitro/plugins/nuxt-content.d.ts +2 -0
- package/dist/runtime/nitro/plugins/nuxt-content.mjs +50 -0
- package/dist/runtime/nitro/plugins/prerender.d.ts +2 -3
- package/dist/runtime/nitro/plugins/prerender.mjs +25 -33
- package/dist/runtime/nuxt/plugins/nuxt-content-canonical-urls.mjs +29 -0
- package/dist/runtime/nuxt/plugins/route-rule-og-image.server.d.ts +2 -0
- package/dist/runtime/nuxt/plugins/route-rule-og-image.server.mjs +72 -0
- package/dist/runtime/{nitro/routes/debug.d.ts → server/routes/__og-image__/debug.json.d.ts} +1 -1
- package/dist/runtime/{nitro/routes/debug.mjs → server/routes/__og-image__/debug.json.mjs} +3 -2
- package/dist/runtime/server/routes/__og-image__/font-[name]-[weight].[extension].mjs +30 -0
- package/dist/runtime/server/routes/__og-image__/image-[path]-og.[extension].mjs +44 -0
- package/dist/runtime/types.d.ts +29 -24
- package/dist/runtime/utilts.d.ts +2 -0
- package/dist/runtime/utilts.mjs +8 -0
- package/dist/types.d.mts +3 -2
- package/dist/types.d.ts +3 -2
- package/package.json +37 -22
- package/dist/client/_nuxt/IconCSS.4a9d43d0.css +0 -1
- package/dist/client/_nuxt/IconCSS.9c30257a.js +0 -1
- package/dist/client/_nuxt/ImageLoader.752b0c7a.js +0 -1
- package/dist/client/_nuxt/ImageLoader.7571516f.css +0 -1
- package/dist/client/_nuxt/builds/meta/bb64bb30-cf6f-4625-97ba-06e6a0d3f8d1.json +0 -1
- package/dist/client/_nuxt/entry.39e39f51.css +0 -1
- package/dist/client/_nuxt/entry.ac864471.js +0 -135
- package/dist/client/_nuxt/index.dc1538d5.js +0 -1
- package/dist/client/_nuxt/index.ffbea0a9.css +0 -1
- package/dist/client/_nuxt/options.a77f5921.js +0 -1
- package/dist/client/_nuxt/png.41e0b446.js +0 -1
- package/dist/client/_nuxt/shiki.d4e62362.js +0 -7
- package/dist/client/_nuxt/svg.b8198280.js +0 -1
- package/dist/client/_nuxt/vnodes.67720126.js +0 -1
- package/dist/client/options/index.html +0 -15
- package/dist/client/png/index.html +0 -15
- package/dist/client/svg/index.html +0 -15
- package/dist/client/vnodes/index.html +0 -15
- package/dist/runtime/browserUtil.d.ts +0 -5
- package/dist/runtime/browserUtil.mjs +0 -41
- package/dist/runtime/components/OgImageTemplate/Fallback.vue +0 -161
- package/dist/runtime/composables/util.d.ts +0 -2
- package/dist/runtime/nitro/middleware/og.png.mjs +0 -69
- package/dist/runtime/nitro/middleware/playground.d.ts +0 -2
- package/dist/runtime/nitro/middleware/playground.mjs +0 -27
- package/dist/runtime/nitro/providers/browser/lambda.d.ts +0 -1
- package/dist/runtime/nitro/providers/browser/lambda.mjs +0 -9
- package/dist/runtime/nitro/providers/browser/playwright.d.ts +0 -1
- package/dist/runtime/nitro/providers/browser/playwright.mjs +0 -22
- package/dist/runtime/nitro/providers/browser/universal.d.ts +0 -2
- package/dist/runtime/nitro/providers/png/resvg-node.d.ts +0 -4
- package/dist/runtime/nitro/providers/png/resvg-node.mjs +0 -6
- package/dist/runtime/nitro/providers/png/resvg-wasm.d.ts +0 -3
- package/dist/runtime/nitro/providers/png/resvg-wasm.mjs +0 -11
- package/dist/runtime/nitro/providers/png/svg2png.d.ts +0 -3
- package/dist/runtime/nitro/providers/png/svg2png.mjs +0 -11
- package/dist/runtime/nitro/providers/satori/default.d.ts +0 -2
- package/dist/runtime/nitro/providers/satori/default.mjs +0 -4
- package/dist/runtime/nitro/providers/satori/yoga-wasm.d.ts +0 -3
- package/dist/runtime/nitro/providers/satori/yoga-wasm.mjs +0 -10
- package/dist/runtime/nitro/renderers/browser.d.ts +0 -3
- package/dist/runtime/nitro/renderers/browser.mjs +0 -36
- package/dist/runtime/nitro/renderers/satori/index.d.ts +0 -3
- package/dist/runtime/nitro/renderers/satori/index.mjs +0 -58
- package/dist/runtime/nitro/renderers/satori/utils.d.ts +0 -4
- package/dist/runtime/nitro/renderers/satori/utils.mjs +0 -60
- package/dist/runtime/nitro/routes/font.mjs +0 -22
- package/dist/runtime/nitro/routes/html.d.ts +0 -2
- package/dist/runtime/nitro/routes/html.mjs +0 -178
- package/dist/runtime/nitro/routes/options.d.ts +0 -3
- package/dist/runtime/nitro/routes/options.mjs +0 -35
- package/dist/runtime/nitro/routes/svg.mjs +0 -19
- package/dist/runtime/nitro/routes/vnode.d.ts +0 -2
- package/dist/runtime/nitro/routes/vnode.mjs +0 -19
- package/dist/runtime/nitro/utils-pure.d.ts +0 -3
- package/dist/runtime/nitro/utils.d.ts +0 -18
- package/dist/runtime/nitro/utils.mjs +0 -108
- package/dist/runtime/public-assets-optional/resvg/resvg.wasm +0 -0
- package/dist/runtime/public-assets-optional/svg2png/svg2png.wasm +0 -0
- package/dist/runtime/public-assets-optional/yoga/yoga.wasm +0 -0
- /package/dist/runtime/{nitro/providers → core/bindings}/css-inline/mock.d.ts +0 -0
- /package/dist/runtime/{nitro/providers → core/bindings}/css-inline/mock.mjs +0 -0
- /package/dist/runtime/{nitro/providers/css-inline/css-inline.d.ts → core/bindings/css-inline/node.d.ts} +0 -0
- /package/dist/runtime/{nitro/providers/css-inline/css-inline.mjs → core/bindings/css-inline/node.mjs} +0 -0
- /package/dist/runtime/{nitro → core}/renderers/satori/plugins/emojis.d.ts +0 -0
- /package/dist/runtime/{nitro → core}/renderers/satori/plugins/emojis.mjs +0 -0
- /package/dist/runtime/{nitro → core}/renderers/satori/plugins/encoding.d.ts +0 -0
- /package/dist/runtime/{nitro → core}/renderers/satori/plugins/flex.d.ts +0 -0
- /package/dist/runtime/{nitro → core}/renderers/satori/plugins/flex.mjs +0 -0
- /package/dist/runtime/{nitro → core}/renderers/satori/plugins/imageSrc.d.ts +0 -0
- /package/dist/runtime/{nitro → core}/renderers/satori/plugins/twClasses.d.ts +0 -0
- /package/dist/runtime/{nitro/routes/font.d.ts → nuxt/plugins/nuxt-content-canonical-urls.d.ts} +0 -0
- /package/dist/runtime/{nitro/middleware/og.png.d.ts → server/routes/__og-image__/font-[name]-[weight].[extension].d.ts} +0 -0
- /package/dist/runtime/{nitro/routes/svg.d.ts → server/routes/__og-image__/image-[path]-og.[extension].d.ts} +0 -0
|
@@ -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 x,f as h}from"./entry.
|
|
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 x,f as h}from"./entry.bdb8a8d5.js";const m=t=>(x("data-v-05a2b8a3"),t=t(),h(),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=m(()=>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,v)=>{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.
|
|
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.bdb8a8d5.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}'}]}),(u,b)=>(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)])]))}},w=i(x,[["__scopeId","data-v-c967d9a9"]]);export{w as default};
|
|
Binary file
|
package/dist/client/index.html
CHANGED
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
<html >
|
|
3
3
|
<head><meta charset="utf-8">
|
|
4
4
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
|
-
<link rel="stylesheet" href="/
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/
|
|
7
|
-
<link rel="prefetch" as="style" href="/
|
|
8
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
9
|
-
<link rel="prefetch" as="style" href="/
|
|
10
|
-
<link rel="prefetch" as="script" crossorigin href="/
|
|
11
|
-
<script type="module" src="/
|
|
5
|
+
<link rel="stylesheet" href="/__nuxt-og-image/_nuxt/entry.434c2c45.css">
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-og-image/_nuxt/entry.bdb8a8d5.js">
|
|
7
|
+
<link rel="prefetch" as="style" href="/__nuxt-og-image/_nuxt/error-404.b751fa02.css">
|
|
8
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-404.f37119e7.js">
|
|
9
|
+
<link rel="prefetch" as="style" href="/__nuxt-og-image/_nuxt/error-500.69009e70.css">
|
|
10
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-500.74b0a30f.js">
|
|
11
|
+
<script type="module" src="/__nuxt-og-image/_nuxt/entry.bdb8a8d5.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"}})();
|
|
12
12
|
</script></head>
|
|
13
13
|
<body ><div id="__nuxt"></div><script type="application/json" id="__NUXT_DATA__" data-ssr="false">[{"_errors":1,"serverRendered":2,"data":3,"state":4},{},false,{},{}]</script>
|
|
14
|
-
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/
|
|
14
|
+
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body>
|
|
15
15
|
</html>
|
package/dist/module.d.mts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
2
|
import { SatoriOptions } from 'satori';
|
|
3
|
+
import { ResvgRenderOptions } from '@resvg/resvg-js';
|
|
4
|
+
import { SharpOptions } from 'sharp';
|
|
3
5
|
|
|
6
|
+
interface OgImageComponent {
|
|
7
|
+
path?: string;
|
|
8
|
+
pascalName: string;
|
|
9
|
+
kebabName: string;
|
|
10
|
+
hash: string;
|
|
11
|
+
category: 'app' | 'official' | 'community' | 'pro';
|
|
12
|
+
credits?: string;
|
|
13
|
+
}
|
|
4
14
|
interface ScreenshotOptions {
|
|
5
15
|
colorScheme?: 'dark' | 'light';
|
|
6
16
|
selector?: string;
|
|
@@ -23,41 +33,43 @@ interface ScreenshotOptions {
|
|
|
23
33
|
delay?: number;
|
|
24
34
|
}
|
|
25
35
|
interface OgImageOptions extends Partial<ScreenshotOptions> {
|
|
36
|
+
component?: string;
|
|
37
|
+
renderer?: 'chromium' | 'satori';
|
|
38
|
+
extension?: 'png' | 'jpeg' | 'jpg';
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated use renderer. Replace `browser` with `chromium`
|
|
41
|
+
*/
|
|
26
42
|
provider?: 'browser' | 'satori';
|
|
27
43
|
/**
|
|
28
44
|
* Provide a static HTML template to render the OG Image instead of a component.
|
|
29
45
|
*/
|
|
30
46
|
html?: string;
|
|
31
|
-
title?: string;
|
|
32
|
-
description?: string;
|
|
33
|
-
component?: string | null;
|
|
34
|
-
alt?: string;
|
|
35
47
|
cache?: boolean;
|
|
36
48
|
cacheKey?: string;
|
|
49
|
+
resvg?: ResvgRenderOptions;
|
|
50
|
+
satori?: SatoriOptions;
|
|
37
51
|
/**
|
|
38
52
|
* The time to live of the cache in milliseconds.
|
|
39
53
|
*/
|
|
40
54
|
cacheTtl?: number;
|
|
41
|
-
/**
|
|
42
|
-
* @deprecated Use `cache` instead
|
|
43
|
-
*/
|
|
44
|
-
static?: boolean;
|
|
45
55
|
[key: string]: any;
|
|
46
56
|
}
|
|
47
57
|
interface FontConfig {
|
|
48
58
|
name: string;
|
|
49
|
-
weight: number;
|
|
59
|
+
weight: string | number;
|
|
50
60
|
path?: string;
|
|
51
61
|
}
|
|
52
62
|
type InputFontConfig = (`${string}:${number}` | FontConfig);
|
|
53
63
|
|
|
54
64
|
interface RuntimeCompatibilitySchema {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
bindings: {
|
|
66
|
+
chromium: 'node' | false;
|
|
67
|
+
['css-inline']: 'node' | false;
|
|
68
|
+
resvg: 'node' | 'wasm' | false;
|
|
69
|
+
satori: 'node' | 'yoga-wasm' | false;
|
|
70
|
+
sharp: 'node' | 'lambda' | false;
|
|
71
|
+
};
|
|
72
|
+
wasmStrategy?: 'inline' | 'import' | 'fetch';
|
|
61
73
|
wasmImportQuery?: string;
|
|
62
74
|
}
|
|
63
75
|
|
|
@@ -87,7 +99,19 @@ interface ModuleOptions {
|
|
|
87
99
|
*
|
|
88
100
|
* @see https://github.com/vercel/satori/blob/main/src/satori.ts#L18
|
|
89
101
|
*/
|
|
90
|
-
satoriOptions
|
|
102
|
+
satoriOptions?: Partial<SatoriOptions>;
|
|
103
|
+
/**
|
|
104
|
+
* Options to pass to resvg.
|
|
105
|
+
*
|
|
106
|
+
* @see https://github.com/yisibl/resvg-js/blob/main/wasm/index.d.ts#L39
|
|
107
|
+
*/
|
|
108
|
+
resvgOptions?: Partial<ResvgRenderOptions>;
|
|
109
|
+
/**
|
|
110
|
+
* Options to pass to sharp.
|
|
111
|
+
*
|
|
112
|
+
* @see https://sharp.pixelplumbing.com/api-constructor
|
|
113
|
+
*/
|
|
114
|
+
sharpOptions?: Partial<SharpOptions>;
|
|
91
115
|
/**
|
|
92
116
|
* Should the playground at <path>/__og_image__ be enabled in development.
|
|
93
117
|
*
|
|
@@ -137,32 +161,12 @@ interface ModuleOptions {
|
|
|
137
161
|
* Manually modify the deployment compatibility.
|
|
138
162
|
*/
|
|
139
163
|
runtimeCompatibility?: Partial<RuntimeCompatibilitySchema>;
|
|
140
|
-
/**
|
|
141
|
-
* The url of your site.
|
|
142
|
-
* Used to generate absolute URLs for the og:image.
|
|
143
|
-
*
|
|
144
|
-
* Note: This is only required when prerendering your site.
|
|
145
|
-
*
|
|
146
|
-
* @deprecated Provide `url` through site config instead: `{ site: { url: <value> }}`.
|
|
147
|
-
* This is powered by the `nuxt-site-config` module.
|
|
148
|
-
* @see https://github.com/harlan-zw/nuxt-site-config
|
|
149
|
-
*/
|
|
150
|
-
host?: string;
|
|
151
|
-
/**
|
|
152
|
-
* The url of your site.
|
|
153
|
-
* Used to generate absolute URLs for the og:image.
|
|
154
|
-
*
|
|
155
|
-
* Note: This is only required when prerendering your site.
|
|
156
|
-
*
|
|
157
|
-
* @deprecated Provide `url` through site config instead: `{ site: { url: <value> }}`.
|
|
158
|
-
* This is powered by the `nuxt-site-config` module.
|
|
159
|
-
* @see https://github.com/harlan-zw/nuxt-site-config
|
|
160
|
-
*/
|
|
161
|
-
siteUrl?: string;
|
|
162
164
|
}
|
|
163
165
|
interface ModuleHooks {
|
|
166
|
+
'nuxt-og-image:components': (ctx: {
|
|
167
|
+
components: OgImageComponent[];
|
|
168
|
+
}) => Promise<void> | void;
|
|
164
169
|
'og-image:config': (config: ModuleOptions) => Promise<void> | void;
|
|
165
|
-
'og-image:prerenderScreenshots': (queue: OgImageOptions[]) => Promise<void> | void;
|
|
166
170
|
}
|
|
167
171
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
|
|
168
172
|
|
package/dist/module.d.ts
CHANGED
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import * as _nuxt_schema from '@nuxt/schema';
|
|
2
2
|
import { SatoriOptions } from 'satori';
|
|
3
|
+
import { ResvgRenderOptions } from '@resvg/resvg-js';
|
|
4
|
+
import { SharpOptions } from 'sharp';
|
|
3
5
|
|
|
6
|
+
interface OgImageComponent {
|
|
7
|
+
path?: string;
|
|
8
|
+
pascalName: string;
|
|
9
|
+
kebabName: string;
|
|
10
|
+
hash: string;
|
|
11
|
+
category: 'app' | 'official' | 'community' | 'pro';
|
|
12
|
+
credits?: string;
|
|
13
|
+
}
|
|
4
14
|
interface ScreenshotOptions {
|
|
5
15
|
colorScheme?: 'dark' | 'light';
|
|
6
16
|
selector?: string;
|
|
@@ -23,41 +33,43 @@ interface ScreenshotOptions {
|
|
|
23
33
|
delay?: number;
|
|
24
34
|
}
|
|
25
35
|
interface OgImageOptions extends Partial<ScreenshotOptions> {
|
|
36
|
+
component?: string;
|
|
37
|
+
renderer?: 'chromium' | 'satori';
|
|
38
|
+
extension?: 'png' | 'jpeg' | 'jpg';
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated use renderer. Replace `browser` with `chromium`
|
|
41
|
+
*/
|
|
26
42
|
provider?: 'browser' | 'satori';
|
|
27
43
|
/**
|
|
28
44
|
* Provide a static HTML template to render the OG Image instead of a component.
|
|
29
45
|
*/
|
|
30
46
|
html?: string;
|
|
31
|
-
title?: string;
|
|
32
|
-
description?: string;
|
|
33
|
-
component?: string | null;
|
|
34
|
-
alt?: string;
|
|
35
47
|
cache?: boolean;
|
|
36
48
|
cacheKey?: string;
|
|
49
|
+
resvg?: ResvgRenderOptions;
|
|
50
|
+
satori?: SatoriOptions;
|
|
37
51
|
/**
|
|
38
52
|
* The time to live of the cache in milliseconds.
|
|
39
53
|
*/
|
|
40
54
|
cacheTtl?: number;
|
|
41
|
-
/**
|
|
42
|
-
* @deprecated Use `cache` instead
|
|
43
|
-
*/
|
|
44
|
-
static?: boolean;
|
|
45
55
|
[key: string]: any;
|
|
46
56
|
}
|
|
47
57
|
interface FontConfig {
|
|
48
58
|
name: string;
|
|
49
|
-
weight: number;
|
|
59
|
+
weight: string | number;
|
|
50
60
|
path?: string;
|
|
51
61
|
}
|
|
52
62
|
type InputFontConfig = (`${string}:${number}` | FontConfig);
|
|
53
63
|
|
|
54
64
|
interface RuntimeCompatibilitySchema {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
bindings: {
|
|
66
|
+
chromium: 'node' | false;
|
|
67
|
+
['css-inline']: 'node' | false;
|
|
68
|
+
resvg: 'node' | 'wasm' | false;
|
|
69
|
+
satori: 'node' | 'yoga-wasm' | false;
|
|
70
|
+
sharp: 'node' | 'lambda' | false;
|
|
71
|
+
};
|
|
72
|
+
wasmStrategy?: 'inline' | 'import' | 'fetch';
|
|
61
73
|
wasmImportQuery?: string;
|
|
62
74
|
}
|
|
63
75
|
|
|
@@ -87,7 +99,19 @@ interface ModuleOptions {
|
|
|
87
99
|
*
|
|
88
100
|
* @see https://github.com/vercel/satori/blob/main/src/satori.ts#L18
|
|
89
101
|
*/
|
|
90
|
-
satoriOptions
|
|
102
|
+
satoriOptions?: Partial<SatoriOptions>;
|
|
103
|
+
/**
|
|
104
|
+
* Options to pass to resvg.
|
|
105
|
+
*
|
|
106
|
+
* @see https://github.com/yisibl/resvg-js/blob/main/wasm/index.d.ts#L39
|
|
107
|
+
*/
|
|
108
|
+
resvgOptions?: Partial<ResvgRenderOptions>;
|
|
109
|
+
/**
|
|
110
|
+
* Options to pass to sharp.
|
|
111
|
+
*
|
|
112
|
+
* @see https://sharp.pixelplumbing.com/api-constructor
|
|
113
|
+
*/
|
|
114
|
+
sharpOptions?: Partial<SharpOptions>;
|
|
91
115
|
/**
|
|
92
116
|
* Should the playground at <path>/__og_image__ be enabled in development.
|
|
93
117
|
*
|
|
@@ -137,32 +161,12 @@ interface ModuleOptions {
|
|
|
137
161
|
* Manually modify the deployment compatibility.
|
|
138
162
|
*/
|
|
139
163
|
runtimeCompatibility?: Partial<RuntimeCompatibilitySchema>;
|
|
140
|
-
/**
|
|
141
|
-
* The url of your site.
|
|
142
|
-
* Used to generate absolute URLs for the og:image.
|
|
143
|
-
*
|
|
144
|
-
* Note: This is only required when prerendering your site.
|
|
145
|
-
*
|
|
146
|
-
* @deprecated Provide `url` through site config instead: `{ site: { url: <value> }}`.
|
|
147
|
-
* This is powered by the `nuxt-site-config` module.
|
|
148
|
-
* @see https://github.com/harlan-zw/nuxt-site-config
|
|
149
|
-
*/
|
|
150
|
-
host?: string;
|
|
151
|
-
/**
|
|
152
|
-
* The url of your site.
|
|
153
|
-
* Used to generate absolute URLs for the og:image.
|
|
154
|
-
*
|
|
155
|
-
* Note: This is only required when prerendering your site.
|
|
156
|
-
*
|
|
157
|
-
* @deprecated Provide `url` through site config instead: `{ site: { url: <value> }}`.
|
|
158
|
-
* This is powered by the `nuxt-site-config` module.
|
|
159
|
-
* @see https://github.com/harlan-zw/nuxt-site-config
|
|
160
|
-
*/
|
|
161
|
-
siteUrl?: string;
|
|
162
164
|
}
|
|
163
165
|
interface ModuleHooks {
|
|
166
|
+
'nuxt-og-image:components': (ctx: {
|
|
167
|
+
components: OgImageComponent[];
|
|
168
|
+
}) => Promise<void> | void;
|
|
164
169
|
'og-image:config': (config: ModuleOptions) => Promise<void> | void;
|
|
165
|
-
'og-image:prerenderScreenshots': (queue: OgImageOptions[]) => Promise<void> | void;
|
|
166
170
|
}
|
|
167
171
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions>;
|
|
168
172
|
|
package/dist/module.json
CHANGED