nuxt-og-image 3.0.0-beta.30 → 3.0.0-beta.33
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/dist/client/200.html +4 -4
- package/dist/client/404.html +4 -4
- package/dist/client/_nuxt/{IconCSS.157c2ef5.js → IconCSS.097c7251.js} +1 -1
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/604ade75-02af-4204-a79e-6b976b1bce82.json +1 -0
- package/dist/client/_nuxt/{entry.74866e06.js → entry.741e99b6.js} +26 -26
- package/dist/client/_nuxt/{error-404.d663cd65.js → error-404.e1c8b413.js} +1 -1
- package/dist/client/_nuxt/{error-500.8c184504.js → error-500.56ec434a.js} +1 -1
- package/dist/client/index.html +4 -4
- package/dist/module.d.mts +2 -2
- package/dist/module.d.ts +2 -2
- package/dist/module.json +1 -1
- package/dist/module.mjs +25 -14
- package/dist/runtime/composables/defineOgImageComponent.d.ts +1 -1
- package/dist/runtime/composables/defineOgImageComponent.mjs +1 -1
- package/dist/runtime/core/bindings/resvg/stackblitz.d.ts +40 -0
- package/dist/runtime/core/bindings/resvg/stackblitz.mjs +6 -0
- package/dist/runtime/core/bindings/satori/stackblitz.d.ts +6 -0
- package/dist/runtime/core/bindings/satori/stackblitz.mjs +13 -0
- package/dist/runtime/core/bindings/satori/wasm.mjs +9 -2
- package/dist/runtime/core/utils/wasm.d.ts +2 -0
- package/dist/runtime/core/utils/wasm.mjs +6 -0
- package/package.json +5 -5
- package/dist/client/_nuxt/builds/meta/2f3b82b2-c809-4818-a70e-0a9fa0dde8cb.json +0 -1
|
@@ -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.741e99b6.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.741e99b6.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};
|
package/dist/client/index.html
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
<head><meta charset="utf-8">
|
|
4
4
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
5
5
|
<link rel="stylesheet" href="/__nuxt-og-image/_nuxt/entry.f47d0628.css">
|
|
6
|
-
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-og-image/_nuxt/entry.
|
|
6
|
+
<link rel="modulepreload" as="script" crossorigin href="/__nuxt-og-image/_nuxt/entry.741e99b6.js">
|
|
7
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.
|
|
8
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-404.e1c8b413.js">
|
|
9
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.
|
|
11
|
-
<script type="module" src="/__nuxt-og-image/_nuxt/entry.
|
|
10
|
+
<link rel="prefetch" as="script" crossorigin href="/__nuxt-og-image/_nuxt/error-500.56ec434a.js">
|
|
11
|
+
<script type="module" src="/__nuxt-og-image/_nuxt/entry.741e99b6.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
14
|
<script>window.__NUXT__={};window.__NUXT__.config={public:{},app:{baseURL:"/__nuxt-og-image",buildAssetsDir:"/_nuxt/",cdnURL:""}}</script></body>
|
package/dist/module.d.mts
CHANGED
|
@@ -90,8 +90,8 @@ interface RuntimeCompatibilitySchema {
|
|
|
90
90
|
bindings: {
|
|
91
91
|
chromium: 'node' | false;
|
|
92
92
|
['css-inline']: 'node' | false;
|
|
93
|
-
resvg: 'node' | 'wasm' | false;
|
|
94
|
-
satori: 'node' | 'wasm' | false;
|
|
93
|
+
resvg: 'node' | 'wasm' | 'stackblitz' | false;
|
|
94
|
+
satori: 'node' | 'wasm' | 'stackblitz' | false;
|
|
95
95
|
sharp: 'node' | false;
|
|
96
96
|
};
|
|
97
97
|
wasm?: WasmOptions;
|
package/dist/module.d.ts
CHANGED
|
@@ -90,8 +90,8 @@ interface RuntimeCompatibilitySchema {
|
|
|
90
90
|
bindings: {
|
|
91
91
|
chromium: 'node' | false;
|
|
92
92
|
['css-inline']: 'node' | false;
|
|
93
|
-
resvg: 'node' | 'wasm' | false;
|
|
94
|
-
satori: 'node' | 'wasm' | false;
|
|
93
|
+
resvg: 'node' | 'wasm' | 'stackblitz' | false;
|
|
94
|
+
satori: 'node' | 'wasm' | 'stackblitz' | false;
|
|
95
95
|
sharp: 'node' | false;
|
|
96
96
|
};
|
|
97
97
|
wasm?: WasmOptions;
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { onDevToolsInitialized, extendServerRpc } from '@nuxt/devtools-kit';
|
|
|
11
11
|
import { readFile, writeFile } from 'node:fs/promises';
|
|
12
12
|
import { createHash } from 'node:crypto';
|
|
13
13
|
|
|
14
|
-
const version = "3.0.0-beta.
|
|
14
|
+
const version = "3.0.0-beta.33";
|
|
15
15
|
|
|
16
16
|
const autodetectableProviders = {
|
|
17
17
|
azure_static: "azure",
|
|
@@ -65,15 +65,9 @@ const RuntimeCompatibility = {
|
|
|
65
65
|
bindings: {
|
|
66
66
|
"chromium": false,
|
|
67
67
|
"css-inline": false,
|
|
68
|
-
"resvg": "
|
|
69
|
-
"satori": "
|
|
68
|
+
"resvg": "stackblitz",
|
|
69
|
+
"satori": "stackblitz",
|
|
70
70
|
"sharp": false
|
|
71
|
-
},
|
|
72
|
-
wasm: {
|
|
73
|
-
rollup: {
|
|
74
|
-
targetEnv: "auto-inline",
|
|
75
|
-
sync: ["@resvg/resvg-wasm/index_bg.wasm"]
|
|
76
|
-
}
|
|
77
71
|
}
|
|
78
72
|
},
|
|
79
73
|
"aws-lambda": awsLambda,
|
|
@@ -93,6 +87,7 @@ const RuntimeCompatibility = {
|
|
|
93
87
|
}
|
|
94
88
|
}
|
|
95
89
|
},
|
|
90
|
+
"firebase": awsLambda,
|
|
96
91
|
"vercel": awsLambda,
|
|
97
92
|
"vercel-edge": {
|
|
98
93
|
bindings: {
|
|
@@ -228,9 +223,15 @@ function setupDevToolsUI(options, resolve, nuxt = useNuxt()) {
|
|
|
228
223
|
rpc.broadcast.refreshRouteData(path).catch(() => {
|
|
229
224
|
});
|
|
230
225
|
}
|
|
231
|
-
if (options.componentDirs.some((dir) => path.includes(dir)))
|
|
232
|
-
|
|
233
|
-
|
|
226
|
+
if (options.componentDirs.some((dir) => path.includes(dir))) {
|
|
227
|
+
if (e === "change") {
|
|
228
|
+
rpc.broadcast.refresh().catch(() => {
|
|
229
|
+
});
|
|
230
|
+
} else {
|
|
231
|
+
rpc.broadcast.refreshGlobalData().catch(() => {
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
234
235
|
});
|
|
235
236
|
});
|
|
236
237
|
nuxt.hook("devtools:customTabs", (tabs) => {
|
|
@@ -382,8 +383,18 @@ const module = defineNuxtModule({
|
|
|
382
383
|
await installNuxtSiteConfig();
|
|
383
384
|
if (hasNuxtModule("@nuxt/content"))
|
|
384
385
|
addServerPlugin(resolve("./runtime/nitro/plugins/nuxt-content"));
|
|
385
|
-
if (
|
|
386
|
-
config.fonts =
|
|
386
|
+
if (preset !== "stackblitz" && config.fonts) {
|
|
387
|
+
config.fonts = config.fonts.map((f) => {
|
|
388
|
+
if (typeof f === "string" || !f.path) {
|
|
389
|
+
logger.warn(`The ${typeof f === "string" ? f : `${f.name}:${f.weight}`} font was skipped because remote fonts are not available in StackBlitz, please use a local font.`);
|
|
390
|
+
return false;
|
|
391
|
+
}
|
|
392
|
+
return f;
|
|
393
|
+
}).filter(Boolean);
|
|
394
|
+
} else {
|
|
395
|
+
if (!config.fonts.length)
|
|
396
|
+
config.fonts = ["Inter:400", "Inter:700"];
|
|
397
|
+
}
|
|
387
398
|
nuxt.options.experimental.componentIslands = true;
|
|
388
399
|
addServerHandler({
|
|
389
400
|
lazy: true,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ExtractComponentProps, OgImageOptions } from '../types';
|
|
2
2
|
import type { OgImageComponents } from '#nuxt-og-image/components';
|
|
3
|
-
export declare function defineOgImageComponent<T extends keyof OgImageComponents>(component: T, props
|
|
3
|
+
export declare function defineOgImageComponent<T extends keyof OgImageComponents>(component: T, props?: Partial<ExtractComponentProps<OgImageComponents[T]>>, options?: OgImageOptions): void;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
initWasmPromise: Promise<void>;
|
|
3
|
+
Resvg: new (svg: string | Uint8Array, options?: import("@resvg/resvg-wasm").ResvgRenderOptions | undefined) => {
|
|
4
|
+
free(): void;
|
|
5
|
+
render(): {
|
|
6
|
+
free(): void;
|
|
7
|
+
asPng(): Uint8Array;
|
|
8
|
+
readonly height: number;
|
|
9
|
+
readonly pixels: Uint8Array;
|
|
10
|
+
readonly width: number;
|
|
11
|
+
};
|
|
12
|
+
toString(): string;
|
|
13
|
+
innerBBox(): {
|
|
14
|
+
free(): void;
|
|
15
|
+
height: number;
|
|
16
|
+
width: number;
|
|
17
|
+
x: number;
|
|
18
|
+
y: number;
|
|
19
|
+
} | undefined;
|
|
20
|
+
getBBox(): {
|
|
21
|
+
free(): void;
|
|
22
|
+
height: number;
|
|
23
|
+
width: number;
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
} | undefined;
|
|
27
|
+
cropByBBox(bbox: {
|
|
28
|
+
free(): void;
|
|
29
|
+
height: number;
|
|
30
|
+
width: number;
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
}): void;
|
|
34
|
+
imagesToResolve(): any[];
|
|
35
|
+
resolveImage(href: string, buffer: Uint8Array): void;
|
|
36
|
+
readonly height: number;
|
|
37
|
+
readonly width: number;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import _satori, { init } from "satori/wasm";
|
|
2
|
+
import initYoga from "yoga-wasm-web";
|
|
3
|
+
import { readWasmFile } from "../../utils/wasm.mjs";
|
|
4
|
+
const wasm = readWasmFile("yoga-wasm-web/dist/yoga.wasm").then(async (yoga) => await initYoga(yoga));
|
|
5
|
+
export default {
|
|
6
|
+
initWasmPromise: new Promise((resolve) => {
|
|
7
|
+
wasm.then((yoga) => {
|
|
8
|
+
init(yoga);
|
|
9
|
+
resolve();
|
|
10
|
+
});
|
|
11
|
+
}),
|
|
12
|
+
satori: _satori
|
|
13
|
+
};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import _satori
|
|
1
|
+
import _satori from "satori/wasm";
|
|
2
2
|
import initYoga from "yoga-wasm-web";
|
|
3
|
+
import { init } from "satori";
|
|
3
4
|
import { importWasm } from "../../utils/wasm.mjs";
|
|
5
|
+
const wasm = importWasm(import("yoga-wasm-web/dist/yoga.wasm")).then(async (yoga) => await initYoga(yoga));
|
|
4
6
|
export default {
|
|
5
|
-
initWasmPromise:
|
|
7
|
+
initWasmPromise: new Promise((resolve) => {
|
|
8
|
+
wasm.then((yoga) => {
|
|
9
|
+
init(yoga);
|
|
10
|
+
resolve();
|
|
11
|
+
});
|
|
12
|
+
}),
|
|
6
13
|
satori: _satori
|
|
7
14
|
};
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { resolvePath } from "mlly";
|
|
1
3
|
export async function importWasm(input) {
|
|
2
4
|
const _input = await input;
|
|
3
5
|
const _module = _input.default || _input;
|
|
@@ -8,3 +10,7 @@ export async function importWasm(input) {
|
|
|
8
10
|
}
|
|
9
11
|
return _module;
|
|
10
12
|
}
|
|
13
|
+
export async function readWasmFile(input) {
|
|
14
|
+
const path = await resolvePath(input);
|
|
15
|
+
return readFile(path);
|
|
16
|
+
}
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-og-image",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.0-beta.
|
|
4
|
+
"version": "3.0.0-beta.33",
|
|
5
5
|
"packageManager": "pnpm@8.11.0",
|
|
6
6
|
"description": "Enlightened OG Image generation for Nuxt.",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"funding": "https://github.com/sponsors/harlan-zw",
|
|
9
|
-
"homepage": "https://github.com/harlan-zw/nuxt-og-image#readme",
|
|
10
7
|
"author": {
|
|
11
8
|
"website": "https://harlanzw.com",
|
|
12
9
|
"name": "Harlan Wilton",
|
|
13
10
|
"url": "harlan@harlanzw.com"
|
|
14
11
|
},
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"funding": "https://github.com/sponsors/harlan-zw",
|
|
14
|
+
"homepage": "https://github.com/harlan-zw/nuxt-og-image#readme",
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
17
|
"url": "git+https://github.com/harlan-zw/nuxt-og-image.git"
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"yoga-wasm-web": "^0.3.3"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@antfu/eslint-config": "2.2.
|
|
68
|
+
"@antfu/eslint-config": "2.2.2",
|
|
69
69
|
"@img/sharp-linux-x64": "0.33.0",
|
|
70
70
|
"@nuxt/content": "^2.9.0",
|
|
71
71
|
"@nuxt/devtools": "1.0.4",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"id":"2f3b82b2-c809-4818-a70e-0a9fa0dde8cb","timestamp":1701677182094,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|