nuxt-og-image 2.0.0-beta.7 → 2.0.0-beta.71
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 +312 -97
- package/dist/client/200.html +2 -2
- package/dist/client/404.html +2 -2
- package/dist/client/_nuxt/IconCSS.0f60f096.js +1 -0
- package/dist/client/_nuxt/IconCSS.b41b9663.css +1 -0
- package/dist/client/_nuxt/ImageLoader.7571516f.css +1 -0
- package/dist/client/_nuxt/ImageLoader.87552e43.js +1 -0
- package/dist/client/_nuxt/entry.07d246ba.js +143 -0
- package/dist/client/_nuxt/entry.1311cc29.css +1 -0
- package/dist/client/_nuxt/{error-404.1ff52902.js → error-404.23b0054d.js} +1 -1
- package/dist/client/_nuxt/error-404.f3dd5020.css +1 -0
- package/dist/client/_nuxt/error-500.06915589.css +1 -0
- package/dist/client/_nuxt/{error-500.f7d30da5.js → error-500.6db75894.js} +1 -1
- package/dist/client/_nuxt/index.a32ee818.js +1 -0
- package/dist/client/_nuxt/index.ffbea0a9.css +1 -0
- package/dist/client/_nuxt/options.9bea558a.js +1 -0
- package/dist/client/_nuxt/png.d8e4cfeb.js +1 -0
- package/dist/client/_nuxt/{shiki.3a930bb8.js → shiki.aaf0d7e1.js} +1 -1
- package/dist/client/_nuxt/svg.43caac0d.js +1 -0
- package/dist/client/_nuxt/vnodes.574f3876.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/client/options/index.html +2 -2
- package/dist/client/png/index.html +2 -2
- package/dist/client/svg/index.html +2 -2
- package/dist/client/vnodes/index.html +2 -2
- package/dist/module.d.ts +101 -11
- package/dist/module.json +2 -2
- package/dist/module.mjs +394 -134
- package/dist/runtime/browserUtil.d.ts +1 -0
- package/dist/runtime/browserUtil.mjs +10 -5
- package/dist/runtime/components/{OgImageDynamic.d.ts → OgImage/Cached.d.ts} +2 -2
- package/dist/runtime/components/OgImage/Cached.mjs +10 -0
- package/dist/runtime/components/OgImage/Dynamic.d.ts +8 -0
- package/dist/runtime/components/{OgImageDynamic.mjs → OgImage/Dynamic.mjs} +3 -3
- package/dist/runtime/components/{OgImageScreenshot.d.ts → OgImage/Screenshot.d.ts} +2 -2
- package/dist/runtime/components/{OgImageScreenshot.mjs → OgImage/Screenshot.mjs} +2 -2
- package/dist/runtime/components/OgImage/Static.d.ts +8 -0
- package/dist/runtime/components/{OgImageStatic.mjs → OgImage/Static.mjs} +3 -3
- package/dist/runtime/components/{OgImageStatic.d.ts → OgImage/WithoutCache.d.ts} +2 -2
- package/dist/runtime/components/OgImage/WithoutCache.mjs +10 -0
- package/dist/runtime/components/OgImage/index.d.ts +5 -0
- package/dist/runtime/components/OgImage/index.mjs +10 -0
- package/dist/runtime/components/OgImageTemplate/Fallback.vue +170 -0
- package/dist/runtime/composables/defineOgImage.d.ts +12 -4
- package/dist/runtime/composables/defineOgImage.mjs +31 -49
- package/dist/runtime/composables/util.d.ts +2 -0
- package/dist/runtime/composables/util.mjs +26 -0
- package/dist/runtime/nitro/middleware/og.png.mjs +54 -8
- package/dist/runtime/nitro/middleware/playground.mjs +4 -3
- package/dist/runtime/nitro/plugins/prerender.d.ts +3 -0
- package/dist/runtime/nitro/plugins/prerender.mjs +28 -0
- package/dist/runtime/nitro/providers/browser/lambda.d.ts +1 -1
- package/dist/runtime/nitro/providers/browser/lambda.mjs +3 -3
- package/dist/runtime/nitro/providers/browser/{node.mjs → playwright.mjs} +0 -9
- package/dist/runtime/nitro/providers/browser/universal.d.ts +1 -0
- package/dist/runtime/nitro/providers/browser/universal.mjs +33 -0
- package/dist/runtime/nitro/providers/png/resvg-node.d.ts +4 -0
- package/dist/runtime/nitro/providers/png/resvg-node.mjs +6 -0
- package/dist/runtime/nitro/providers/png/resvg-wasm.d.ts +3 -0
- package/dist/runtime/nitro/providers/png/resvg-wasm.mjs +11 -0
- package/dist/runtime/nitro/providers/{svg2png/universal.d.ts → png/svg2png.d.ts} +2 -3
- package/dist/runtime/nitro/providers/png/svg2png.mjs +11 -0
- package/dist/runtime/nitro/providers/satori/{webworker.d.ts → yoga-wasm.d.ts} +2 -3
- package/dist/runtime/nitro/providers/satori/{webworker.mjs → yoga-wasm.mjs} +4 -5
- package/dist/runtime/nitro/renderers/browser.d.ts +2 -2
- package/dist/runtime/nitro/renderers/browser.mjs +14 -10
- package/dist/runtime/nitro/renderers/satori/index.d.ts +2 -2
- package/dist/runtime/nitro/renderers/satori/index.mjs +27 -32
- package/dist/runtime/nitro/renderers/satori/plugins/emojis.d.ts +1 -1
- package/dist/runtime/nitro/renderers/satori/plugins/emojis.mjs +19 -6
- package/dist/runtime/nitro/renderers/satori/plugins/encoding.d.ts +1 -1
- package/dist/runtime/nitro/renderers/satori/plugins/encoding.mjs +5 -7
- package/dist/runtime/nitro/renderers/satori/plugins/flex.d.ts +1 -1
- package/dist/runtime/nitro/renderers/satori/plugins/flex.mjs +8 -10
- package/dist/runtime/nitro/renderers/satori/plugins/imageSrc.d.ts +1 -1
- package/dist/runtime/nitro/renderers/satori/plugins/imageSrc.mjs +45 -13
- package/dist/runtime/nitro/renderers/satori/plugins/twClasses.d.ts +1 -1
- package/dist/runtime/nitro/renderers/satori/plugins/twClasses.mjs +5 -7
- package/dist/runtime/nitro/renderers/satori/utils.d.ts +4 -5
- package/dist/runtime/nitro/renderers/satori/utils.mjs +28 -17
- package/dist/runtime/nitro/routes/debug.d.ts +8 -0
- package/dist/runtime/nitro/routes/debug.mjs +14 -0
- package/dist/runtime/nitro/routes/font.mjs +2 -2
- package/dist/runtime/nitro/routes/html.mjs +102 -27
- package/dist/runtime/nitro/routes/options.d.ts +2 -2
- package/dist/runtime/nitro/routes/options.mjs +25 -22
- package/dist/runtime/nitro/routes/svg.mjs +5 -3
- package/dist/runtime/nitro/routes/vnode.mjs +5 -3
- package/dist/runtime/nitro/utils-pure.d.ts +2 -2
- package/dist/runtime/nitro/utils-pure.mjs +1 -4
- package/dist/runtime/nitro/utils.d.ts +11 -11
- package/dist/runtime/nitro/utils.mjs +69 -54
- package/dist/runtime/public-assets/__nuxt_og_image__/browser-provider-not-supported.png +0 -0
- package/dist/runtime/public-assets-optional/resvg/resvg.wasm +0 -0
- package/dist/types.d.ts +6 -0
- package/package.json +39 -27
- package/dist/client/_nuxt/IconCSS.a041aca0.js +0 -1
- package/dist/client/_nuxt/ImageLoader.9bf39d71.js +0 -1
- package/dist/client/_nuxt/entry.74018bda.js +0 -5
- package/dist/client/_nuxt/entry.7a8c1ab2.css +0 -1
- package/dist/client/_nuxt/error-404.1469f10f.css +0 -1
- package/dist/client/_nuxt/error-500.92b94fae.css +0 -1
- package/dist/client/_nuxt/error-component.cf7543e5.js +0 -3
- package/dist/client/_nuxt/index.3f356409.js +0 -1
- package/dist/client/_nuxt/options.56a3e5f9.js +0 -1
- package/dist/client/_nuxt/png.37f3e77b.js +0 -1
- package/dist/client/_nuxt/svg.186c6bd1.js +0 -1
- package/dist/client/_nuxt/vnodes.a799f183.js +0 -1
- package/dist/runtime/components/OgImageBasic.island.vue +0 -92
- package/dist/runtime/nitro/providers/svg2png/universal.mjs +0 -9
- /package/dist/runtime/nitro/providers/browser/{node.d.ts → playwright.d.ts} +0 -0
- /package/dist/runtime/nitro/providers/satori/{node.d.ts → default.d.ts} +0 -0
- /package/dist/runtime/nitro/providers/satori/{node.mjs → default.mjs} +0 -0
- /package/dist/runtime/{public-assets → public-assets-optional/inter-font}/inter-latin-ext-400-normal.woff +0 -0
- /package/dist/runtime/{public-assets → public-assets-optional/inter-font}/inter-latin-ext-700-normal.woff +0 -0
- /package/dist/runtime/{public-assets → public-assets-optional/svg2png}/svg2png.wasm +0 -0
- /package/dist/runtime/{public-assets → public-assets-optional/yoga}/yoga.wasm +0 -0
package/dist/module.d.ts
CHANGED
|
@@ -24,30 +24,120 @@ interface ScreenshotOptions {
|
|
|
24
24
|
}
|
|
25
25
|
interface OgImageOptions extends Partial<ScreenshotOptions> {
|
|
26
26
|
provider?: 'browser' | 'satori';
|
|
27
|
-
static?: boolean;
|
|
28
27
|
title?: string;
|
|
29
28
|
description?: string;
|
|
30
29
|
component?: string | null;
|
|
31
30
|
alt?: string;
|
|
31
|
+
cache?: boolean;
|
|
32
|
+
cacheKey?: string;
|
|
33
|
+
cacheTtl?: number;
|
|
34
|
+
/**
|
|
35
|
+
* @deprecated Use `cache` instead
|
|
36
|
+
*/
|
|
37
|
+
static?: boolean;
|
|
32
38
|
[key: string]: any;
|
|
33
39
|
}
|
|
40
|
+
interface FontConfig {
|
|
41
|
+
name: string;
|
|
42
|
+
weight: number;
|
|
43
|
+
path?: string;
|
|
44
|
+
}
|
|
45
|
+
type InputFontConfig = (`${string}:${number}` | FontConfig);
|
|
34
46
|
|
|
35
47
|
interface ModuleOptions {
|
|
36
48
|
/**
|
|
37
|
-
*
|
|
38
|
-
*
|
|
49
|
+
* Whether the og:image images should be generated.
|
|
50
|
+
*
|
|
51
|
+
* @default true
|
|
52
|
+
*/
|
|
53
|
+
enabled: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Default data used within the payload to generate the OG Image.
|
|
56
|
+
*
|
|
57
|
+
* You can use this to change the default template, image sizing and more.
|
|
58
|
+
*
|
|
59
|
+
* @default { component: 'OgImageTemplateFallback', width: 1200, height: 630, cache: true, cacheTtl: 24 * 60 * 60 * 1000 }
|
|
39
60
|
*/
|
|
40
|
-
host?: string;
|
|
41
|
-
siteUrl: string;
|
|
42
61
|
defaults: OgImageOptions;
|
|
43
|
-
|
|
62
|
+
/**
|
|
63
|
+
* Fonts to use when rendering the og:image.
|
|
64
|
+
*
|
|
65
|
+
* @example ['Roboto:400,700', { path: 'path/to/font.ttf', weight: 400, name: 'MyFont' }]
|
|
66
|
+
*/
|
|
67
|
+
fonts: InputFontConfig[];
|
|
68
|
+
/**
|
|
69
|
+
* Options to pass to satori.
|
|
70
|
+
*
|
|
71
|
+
* @see https://github.com/vercel/satori/blob/main/src/satori.ts#L18
|
|
72
|
+
*/
|
|
44
73
|
satoriOptions: Partial<SatoriOptions>;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
74
|
+
/**
|
|
75
|
+
* Should the playground at <path>/__og_image__ be enabled in development.
|
|
76
|
+
*
|
|
77
|
+
* @default true
|
|
78
|
+
*/
|
|
50
79
|
playground: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Include Satori runtime.
|
|
82
|
+
*
|
|
83
|
+
* @default true
|
|
84
|
+
*/
|
|
85
|
+
runtimeSatori: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Include the Browser runtime.
|
|
88
|
+
* This will need to be manually enabled for production environments.
|
|
89
|
+
*
|
|
90
|
+
* @default `process.dev`
|
|
91
|
+
*/
|
|
92
|
+
runtimeBrowser: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Enables debug logs and a debug endpoint.
|
|
95
|
+
*
|
|
96
|
+
* @false false
|
|
97
|
+
*/
|
|
98
|
+
debug: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Modify the cache behavior.
|
|
101
|
+
*
|
|
102
|
+
* Passing a boolean will enable or disable the runtime cache with the default options.
|
|
103
|
+
*
|
|
104
|
+
* Providing a record will allow you to configure the runtime cache fully.
|
|
105
|
+
*
|
|
106
|
+
* @default true
|
|
107
|
+
* @see https://nitro.unjs.io/guide/storage#mountpoints
|
|
108
|
+
* @example { driver: 'redis', host: 'localhost', port: 6379, password: 'password' }
|
|
109
|
+
*/
|
|
110
|
+
runtimeCacheStorage: boolean | (Record<string, any> & {
|
|
111
|
+
driver: string;
|
|
112
|
+
});
|
|
113
|
+
/**
|
|
114
|
+
* Extra component directories that should be used to resolve components.
|
|
115
|
+
*
|
|
116
|
+
* @default ['OgImage', 'OgImageTemplate']
|
|
117
|
+
*/
|
|
118
|
+
componentDirs: string[];
|
|
119
|
+
/**
|
|
120
|
+
* The url of your site.
|
|
121
|
+
* Used to generate absolute URLs for the og:image.
|
|
122
|
+
*
|
|
123
|
+
* Note: This is only required when prerendering your site.
|
|
124
|
+
*
|
|
125
|
+
* @deprecated Provide `url` through site config instead: `{ site: { url: <value> }}`.
|
|
126
|
+
* This is powered by the `nuxt-site-config` module.
|
|
127
|
+
* @see https://github.com/harlan-zw/nuxt-site-config
|
|
128
|
+
*/
|
|
129
|
+
host?: string;
|
|
130
|
+
/**
|
|
131
|
+
* The url of your site.
|
|
132
|
+
* Used to generate absolute URLs for the og:image.
|
|
133
|
+
*
|
|
134
|
+
* Note: This is only required when prerendering your site.
|
|
135
|
+
*
|
|
136
|
+
* @deprecated Provide `url` through site config instead: `{ site: { url: <value> }}`.
|
|
137
|
+
* This is powered by the `nuxt-site-config` module.
|
|
138
|
+
* @see https://github.com/harlan-zw/nuxt-site-config
|
|
139
|
+
*/
|
|
140
|
+
siteUrl?: string;
|
|
51
141
|
}
|
|
52
142
|
interface ModuleHooks {
|
|
53
143
|
'og-image:config': (config: ModuleOptions) => Promise<void> | void;
|