nuxt-og-image 3.0.0-rc.53 → 3.0.0-rc.55
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 +1 -9
- package/dist/client/200.html +122 -95
- package/dist/client/404.html +122 -95
- package/dist/client/_nuxt/{3Yx8WcR-.js → B3g-KkBK.js} +1 -1
- package/dist/client/_nuxt/B474tPdy.js +66 -0
- package/dist/client/_nuxt/B6E6ObS_.js +8 -0
- package/dist/client/_nuxt/{B6nY7VDA.js → B6bHXiXE.js} +1 -1
- package/dist/client/_nuxt/B7rNE5kf.js +1 -0
- package/dist/client/_nuxt/BEjL32p1.js +5754 -0
- package/dist/client/_nuxt/BJn7Ek5W.js +1 -0
- package/dist/client/_nuxt/BVGdgKAv.js +1 -0
- package/dist/client/_nuxt/{wORFcijT.js → BXR915QZ.js} +1 -1
- package/dist/client/_nuxt/{DCj4DH6i.js → BYdKNJ10.js} +1 -1
- package/dist/client/_nuxt/BZfs-ost.js +1 -0
- package/dist/client/_nuxt/{DCdPDLy4.js → BacI6-DX.js} +1 -1
- package/dist/client/_nuxt/{DCk2z-Tu.js → BdfWgkoX.js} +1 -1
- package/dist/client/_nuxt/Bfj2ThZ4.js +3 -0
- package/dist/client/_nuxt/{D6NljDpC.js → BigF1UXR.js} +1 -1
- package/dist/client/_nuxt/Bj0fF4lQ.js +1 -0
- package/dist/client/_nuxt/BmSZh3NL.js +1 -0
- package/dist/client/_nuxt/{DaCkt_J7.js → Br6ll-O0.js} +1 -1
- package/dist/client/_nuxt/BscxmKrE.js +8 -0
- package/dist/client/_nuxt/Buoqr_Oi.js +2 -0
- package/dist/client/_nuxt/BvCdDh2R.js +1 -0
- package/dist/client/_nuxt/BwXNTs7T.js +1 -0
- package/dist/client/_nuxt/{CQ1WWl9n.js → Bxkoe-BC.js} +1 -1
- package/dist/client/_nuxt/C2WjX3hy.js +1 -0
- package/dist/client/_nuxt/C3qJFuQy.js +3 -0
- package/dist/client/_nuxt/C3qUB5O8.js +301 -0
- package/dist/client/_nuxt/C6XIsc4F.js +1 -0
- package/dist/client/_nuxt/CA9nliXM.js +1 -0
- package/dist/client/_nuxt/{BsfQk1vf.js → CEfge3mM.js} +1 -1
- package/dist/client/_nuxt/CGmujMTu.js +1 -0
- package/dist/client/_nuxt/{CQTpvb7m.js → CHCTrc3a.js} +1 -1
- package/dist/client/_nuxt/{B9E_xdxs.js → CNkYXcD4.js} +1 -1
- package/dist/client/_nuxt/CO5hpdkB.js +1 -0
- package/dist/client/_nuxt/{DsudziMp.js → COIrKlfF.js} +1 -1
- package/dist/client/_nuxt/CO_xte_X.js +131 -0
- package/dist/client/_nuxt/{DZ3fVoEH.js → CSPeAESR.js} +1 -1
- package/dist/client/_nuxt/C_ZPRiAj.js +26 -0
- package/dist/client/_nuxt/{DCAtC51B.js → CarfVElc.js} +1 -1
- package/dist/client/_nuxt/{BgBwMnrY.js → CcYwH0AH.js} +1 -1
- package/dist/client/_nuxt/Cgl53LJQ.js +1 -0
- package/dist/client/_nuxt/{RgJsN3zu.js → ChMCFiS0.js} +1 -1
- package/dist/client/_nuxt/CiRxTSAc.js +1 -0
- package/dist/client/_nuxt/Cp2HGa90.js +353 -0
- package/dist/client/_nuxt/CpAANOdC.js +1 -0
- package/dist/client/_nuxt/{DfUNg_8t.js → CqYeW6XZ.js} +1 -1
- package/dist/client/_nuxt/{CL7Ixq1B.js → CrgTADc5.js} +1 -1
- package/dist/client/_nuxt/CuJfdYLG.js +1 -0
- package/dist/client/_nuxt/{DZWTOXyg.js → D0R5gFyj.js} +1 -1
- package/dist/client/_nuxt/{CRWwmX0L.js → D4FSFK-1.js} +1 -1
- package/dist/client/_nuxt/D71BffLY.js +1 -0
- package/dist/client/_nuxt/DAP_O-zg.js +1 -0
- package/dist/client/_nuxt/DAfrLhwG.js +1 -0
- package/dist/client/_nuxt/{crZ1QlHm.js → DDTaAggl.js} +1 -1
- package/dist/client/_nuxt/DG8tVHNj.js +6 -0
- package/dist/client/_nuxt/{Bd7iooY8.js → DGDuLtS6.js} +1 -1
- package/dist/client/_nuxt/{DIr-ordK.js → DGEpfOTx.js} +1 -1
- package/dist/client/_nuxt/{j8KhMG0x.js → DGxQkqYo.js} +1 -1
- package/dist/client/_nuxt/DKb4lQY2.js +1 -0
- package/dist/client/_nuxt/DOHBU7tp.js +1 -0
- package/dist/client/_nuxt/{CUVblut_.js → DR5YgmI2.js} +1 -1
- package/dist/client/_nuxt/DS9ZWoKD.js +1 -0
- package/dist/client/_nuxt/DVC_qXWv.js +1 -0
- package/dist/client/_nuxt/{D-pQtGOP.js → DVLwECkk.js} +1 -1
- package/dist/client/_nuxt/DZLoTQm4.js +1 -0
- package/dist/client/_nuxt/{ZQC2c-5V.js → D_T9yQUo.js} +3 -3
- package/dist/client/_nuxt/Dd6f7Z5P.js +1 -0
- package/dist/client/_nuxt/Dit6kIrv.js +11 -0
- package/dist/client/_nuxt/{DXpYegZJ.js → Djqq6n-7.js} +1 -1
- package/dist/client/_nuxt/Dkb1Nx48.js +1 -0
- package/dist/client/_nuxt/{DywwDckn.js → Du6_OKDb.js} +1 -1
- package/dist/client/_nuxt/FJDVp-XM.js +1 -0
- package/dist/client/_nuxt/{IHMnEr_d.js → G-Jz5hiA.js} +1 -1
- package/dist/client/_nuxt/{NL97_oaV.js → GPY1wEXZ.js} +1 -1
- package/dist/client/_nuxt/HrnDn_2Q.js +1 -0
- package/dist/client/_nuxt/IconCSS.ml_PwIMm.css +1 -0
- package/dist/client/_nuxt/{CPHkTjfH.js → JgH_6NEN.js} +1 -1
- package/dist/client/_nuxt/KPqz0Sb3.js +1 -0
- package/dist/client/_nuxt/Ksn5IXup.js +1 -0
- package/dist/client/_nuxt/{wPLeKH6q.js → Lpdzc9s2.js} +1 -1
- package/dist/client/_nuxt/MS3qTAOR.js +1 -0
- package/dist/client/_nuxt/VQMr7AbF.js +1 -0
- package/dist/client/_nuxt/{BILqrcpa.js → YdT6Gj0u.js} +1 -1
- package/dist/client/_nuxt/alpzPJ78.js +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/9c44c5bc-d169-48e8-9ee0-e1d453302bef.json +1 -0
- package/dist/client/_nuxt/cW9vKj3g.js +1 -0
- package/dist/client/_nuxt/{Bdb36Id5.js → dIHJ9UdL.js} +1 -1
- package/dist/client/_nuxt/entry.B6GrRE4Z.css +1 -0
- package/dist/client/_nuxt/error-404.23TGmWF7.css +1 -0
- package/dist/client/_nuxt/error-500.DAazy6YX.css +1 -0
- package/dist/client/_nuxt/{doGI2cFk.js → wKgfcFVx.js} +1 -1
- package/dist/client/_nuxt/xtV5iK4E.js +1 -0
- package/dist/client/_nuxt/zhgf4ixb.js +40 -0
- package/dist/module.d.mts +2 -106
- package/dist/module.d.ts +2 -106
- package/dist/module.json +3 -3
- package/dist/module.mjs +18 -9
- package/dist/runtime/nitro/og-image/bindings/chromium/{on-demand.mjs → on-demand.js} +1 -2
- package/dist/runtime/nitro/og-image/bindings/css-inline/{wasm-fs.mjs → wasm-fs.js} +1 -1
- package/dist/runtime/nitro/og-image/bindings/resvg/wasm-fs.d.ts +1 -1
- package/dist/runtime/nitro/og-image/bindings/resvg/{wasm-fs.mjs → wasm-fs.js} +1 -1
- package/dist/runtime/nitro/og-image/bindings/resvg/wasm.d.ts +1 -1
- package/dist/runtime/nitro/og-image/bindings/satori/{wasm-fs.mjs → wasm-fs.js} +1 -1
- package/dist/runtime/nitro/og-image/cache.d.ts +1 -1
- package/dist/runtime/nitro/og-image/chromium/renderer.d.ts +1 -1
- package/dist/runtime/nitro/og-image/chromium/{renderer.mjs → renderer.js} +1 -1
- package/dist/runtime/nitro/og-image/chromium/screenshot.d.ts +1 -2
- package/dist/runtime/nitro/og-image/chromium/{screenshot.mjs → screenshot.js} +1 -1
- package/dist/runtime/nitro/og-image/context.d.ts +1 -1
- package/dist/runtime/nitro/og-image/{context.mjs → context.js} +6 -5
- package/dist/runtime/nitro/og-image/satori/font.d.ts +2 -2
- package/dist/runtime/nitro/og-image/satori/{font.mjs → font.js} +2 -2
- package/dist/runtime/nitro/og-image/satori/instances.d.ts +5 -3
- package/dist/runtime/nitro/og-image/satori/plugins/{classes.mjs → classes.js} +1 -1
- package/dist/runtime/nitro/og-image/satori/plugins/{emojis.mjs → emojis.js} +1 -1
- package/dist/runtime/nitro/og-image/satori/plugins/{encoding.mjs → encoding.js} +2 -2
- package/dist/runtime/nitro/og-image/satori/plugins/{flex.mjs → flex.js} +1 -1
- package/dist/runtime/nitro/og-image/satori/plugins/{imageSrc.mjs → imageSrc.js} +8 -8
- package/dist/runtime/nitro/og-image/satori/plugins/{unocss.mjs → unocss.js} +1 -1
- package/dist/runtime/nitro/og-image/satori/renderer.d.ts +1 -1
- package/dist/runtime/nitro/og-image/satori/{renderer.mjs → renderer.js} +4 -4
- package/dist/runtime/nitro/og-image/satori/transforms/emojis.d.ts +2 -2
- package/dist/runtime/nitro/og-image/satori/transforms/inlineCss.d.ts +1 -1
- package/dist/runtime/nitro/og-image/satori/transforms/{inlineCss.mjs → inlineCss.js} +2 -2
- package/dist/runtime/nitro/og-image/satori/utils.d.ts +1 -1
- package/dist/runtime/nitro/og-image/satori/vnodes.d.ts +1 -1
- package/dist/runtime/nitro/og-image/satori/{vnodes.mjs → vnodes.js} +11 -11
- package/dist/runtime/nitro/og-image/templates/html.d.ts +1 -1
- package/dist/runtime/nitro/og-image/templates/{html.mjs → html.js} +3 -3
- package/dist/runtime/nitro/plugins/nuxt-content.d.ts +1 -1
- package/dist/runtime/nitro/plugins/{nuxt-content.mjs → nuxt-content.js} +1 -1
- package/dist/runtime/nitro/plugins/prerender.d.ts +1 -1
- package/dist/runtime/nitro/plugins/{prerender.mjs → prerender.js} +4 -4
- package/dist/runtime/nitro/routes/{debug.json.mjs → debug.json.js} +1 -1
- package/dist/runtime/nitro/routes/{font.mjs → font.js} +1 -1
- package/dist/runtime/nitro/routes/{image.mjs → image.js} +4 -4
- package/dist/runtime/nitro/util/cache.d.ts +2 -2
- package/dist/runtime/nitro/util/{cache.mjs → cache.js} +2 -1
- package/dist/runtime/nitro/util/{encoding.mjs → encoding.js} +1 -1
- package/dist/runtime/nitro/util/wasm.d.ts +0 -1
- package/dist/runtime/nuxt/components/OgImage/OgImage.d.ts +3 -3
- package/dist/runtime/nuxt/components/OgImage/OgImageScreenshot.d.ts +3 -3
- package/dist/runtime/nuxt/components/Templates/Community/Nuxt.vue +1 -1
- package/dist/runtime/nuxt/components/Templates/Community/NuxtSeo.vue +4 -4
- package/dist/runtime/nuxt/components/Templates/Community/Pergel.vue +1 -2
- package/dist/runtime/nuxt/composables/defineOgImage.d.ts +1 -1
- package/dist/runtime/nuxt/composables/{defineOgImage.mjs → defineOgImage.js} +3 -3
- package/dist/runtime/nuxt/composables/defineOgImageComponent.d.ts +1 -1
- package/dist/runtime/nuxt/composables/{defineOgImageComponent.mjs → defineOgImageComponent.js} +1 -1
- package/dist/runtime/nuxt/composables/defineOgImageScreenshot.d.ts +2 -2
- package/dist/runtime/nuxt/composables/mock.d.ts +4 -0
- package/dist/runtime/nuxt/plugins/og-image-canonical-urls.server.d.ts +1 -1
- package/dist/runtime/nuxt/plugins/{og-image-canonical-urls.server.mjs → og-image-canonical-urls.server.js} +1 -1
- package/dist/runtime/nuxt/plugins/route-rule-og-image.server.d.ts +1 -1
- package/dist/runtime/nuxt/plugins/{route-rule-og-image.server.mjs → route-rule-og-image.server.js} +2 -2
- package/dist/runtime/nuxt/utils.d.ts +1 -1
- package/dist/runtime/nuxt/{utils.mjs → utils.js} +1 -1
- package/dist/runtime/pure.d.ts +1 -1
- package/dist/runtime/shared.d.ts +2 -2
- package/dist/runtime/{shared.mjs → shared.js} +1 -1
- package/dist/runtime/types.d.ts +2 -0
- package/dist/types.d.mts +2 -9
- package/dist/types.d.ts +2 -9
- package/package.json +46 -44
- package/dist/client/_nuxt/-hLHpAOl.js +0 -1
- package/dist/client/_nuxt/B561T8eW.js +0 -1
- package/dist/client/_nuxt/BBv1LFm6.js +0 -6
- package/dist/client/_nuxt/BIMuYTWL.js +0 -3
- package/dist/client/_nuxt/BSyl5yf0.js +0 -1
- package/dist/client/_nuxt/Bsp1M94H.js +0 -1
- package/dist/client/_nuxt/BswfO-CF.js +0 -1
- package/dist/client/_nuxt/Bz4xi2rU.js +0 -1
- package/dist/client/_nuxt/CGQbO34C.js +0 -1
- package/dist/client/_nuxt/CoEqzGFw.js +0 -44
- package/dist/client/_nuxt/CudBhkk3.js +0 -1
- package/dist/client/_nuxt/D4LhxNOI.js +0 -1
- package/dist/client/_nuxt/D4k753MY.js +0 -1
- package/dist/client/_nuxt/DFF-wSSt.js +0 -8
- package/dist/client/_nuxt/Dk5M0e7R.js +0 -135
- package/dist/client/_nuxt/DnhXxWz-.js +0 -1
- package/dist/client/_nuxt/Dszwcx0o.js +0 -1
- package/dist/client/_nuxt/Dz2Ca8U2.js +0 -1
- package/dist/client/_nuxt/DzPyIVdT.js +0 -9
- package/dist/client/_nuxt/IconCSS.DI_jUTCX.css +0 -1
- package/dist/client/_nuxt/TQ9oWRfF.js +0 -1
- package/dist/client/_nuxt/WoBtJUue.js +0 -1
- package/dist/client/_nuxt/bmJ2objS.js +0 -1
- package/dist/client/_nuxt/builds/meta/7e516fcf-301f-4df9-8a57-a4bd3951d194.json +0 -1
- package/dist/client/_nuxt/entry.CyZsr2dM.css +0 -1
- package/dist/client/_nuxt/error-404.BRldFSII.css +0 -1
- package/dist/client/_nuxt/error-500.D8yw_IbC.css +0 -1
- package/dist/client/index.html +0 -239
- /package/dist/runtime/nitro/og-image/bindings/chromium/{chrome-launcher.mjs → chrome-launcher.js} +0 -0
- /package/dist/runtime/nitro/og-image/bindings/chromium/{playwright.mjs → playwright.js} +0 -0
- /package/dist/runtime/nitro/og-image/bindings/css-inline/{node.mjs → node.js} +0 -0
- /package/dist/runtime/nitro/og-image/bindings/css-inline/{wasm.mjs → wasm.js} +0 -0
- /package/dist/runtime/nitro/og-image/bindings/resvg/{node.mjs → node.js} +0 -0
- /package/dist/runtime/nitro/og-image/bindings/resvg/{wasm.mjs → wasm.js} +0 -0
- /package/dist/runtime/nitro/og-image/bindings/satori/{node.mjs → node.js} +0 -0
- /package/dist/runtime/nitro/og-image/bindings/satori/{wasm.mjs → wasm.js} +0 -0
- /package/dist/runtime/nitro/og-image/bindings/sharp/{node.mjs → node.js} +0 -0
- /package/dist/runtime/nitro/og-image/{cache.mjs → cache.js} +0 -0
- /package/dist/runtime/nitro/og-image/{instances.mjs → instances.js} +0 -0
- /package/dist/runtime/nitro/og-image/satori/{instances.mjs → instances.js} +0 -0
- /package/dist/runtime/nitro/og-image/satori/transforms/{emojis.mjs → emojis.js} +0 -0
- /package/dist/runtime/nitro/og-image/satori/{utils.mjs → utils.js} +0 -0
- /package/dist/runtime/nitro/util/{kit.mjs → kit.js} +0 -0
- /package/dist/runtime/nitro/util/{wasm.mjs → wasm.js} +0 -0
- /package/dist/runtime/nuxt/components/OgImage/{OgImage.mjs → OgImage.js} +0 -0
- /package/dist/runtime/nuxt/components/OgImage/{OgImageScreenshot.mjs → OgImageScreenshot.js} +0 -0
- /package/dist/runtime/nuxt/composables/{defineOgImageScreenshot.mjs → defineOgImageScreenshot.js} +0 -0
- /package/dist/runtime/nuxt/composables/{mock.mjs → mock.js} +0 -0
- /package/dist/runtime/{pure.mjs → pure.js} +0 -0
- /package/dist/runtime/{types.mjs → types.js} +0 -0
|
@@ -3,11 +3,11 @@ import { createError, getQuery } from "h3";
|
|
|
3
3
|
import { defu } from "defu";
|
|
4
4
|
import { normalizeKey } from "unstorage";
|
|
5
5
|
import { hash } from "ohash";
|
|
6
|
-
import { separateProps, useOgImageRuntimeConfig } from "../../shared.
|
|
7
|
-
import { createNitroRouteRuleMatcher } from "../util/kit.
|
|
8
|
-
import { decodeObjectHtmlEntities } from "../util/encoding.
|
|
9
|
-
import { htmlPayloadCache, prerenderOptionsCache } from "./cache.
|
|
10
|
-
import { useChromiumRenderer, useSatoriRenderer } from "./instances.
|
|
6
|
+
import { separateProps, useOgImageRuntimeConfig } from "../../shared.js";
|
|
7
|
+
import { createNitroRouteRuleMatcher } from "../util/kit.js";
|
|
8
|
+
import { decodeObjectHtmlEntities } from "../util/encoding.js";
|
|
9
|
+
import { htmlPayloadCache, prerenderOptionsCache } from "./cache.js";
|
|
10
|
+
import { useChromiumRenderer, useSatoriRenderer } from "./instances.js";
|
|
11
11
|
import { useNitroApp } from "#internal/nitro/app";
|
|
12
12
|
export function resolvePathCacheKey(e, path) {
|
|
13
13
|
const siteConfig = e.context.siteConfig.get();
|
|
@@ -95,6 +95,7 @@ export async function resolveContext(e) {
|
|
|
95
95
|
key,
|
|
96
96
|
renderer,
|
|
97
97
|
isDebugJsonPayload,
|
|
98
|
+
publicStoragePath: runtimeConfig.publicStoragePath,
|
|
98
99
|
extension,
|
|
99
100
|
basePath,
|
|
100
101
|
options,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { OgImageRenderEventContext, ResolvedFontConfig } from '../../../types';
|
|
2
|
-
export declare function loadFont({ e }: OgImageRenderEventContext, font: ResolvedFontConfig): Promise<ResolvedFontConfig>;
|
|
1
|
+
import type { OgImageRenderEventContext, ResolvedFontConfig } from '../../../types.js';
|
|
2
|
+
export declare function loadFont({ e, publicStoragePath }: OgImageRenderEventContext, font: ResolvedFontConfig): Promise<ResolvedFontConfig>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { prefixStorage } from "unstorage";
|
|
2
2
|
import { useNitroOrigin, useStorage } from "#imports";
|
|
3
3
|
const assets = prefixStorage(useStorage(), "/assets");
|
|
4
|
-
export async function loadFont({ e }, font) {
|
|
4
|
+
export async function loadFont({ e, publicStoragePath }, font) {
|
|
5
5
|
const { name, weight } = font;
|
|
6
6
|
if (font.data)
|
|
7
7
|
return font;
|
|
@@ -17,7 +17,7 @@ export async function loadFont({ e }, font) {
|
|
|
17
17
|
let data;
|
|
18
18
|
if (font.path) {
|
|
19
19
|
if (import.meta.dev || import.meta.prerender) {
|
|
20
|
-
const key =
|
|
20
|
+
const key = `${publicStoragePath}${font.path.replace("./", ":").replace("/", ":")}`;
|
|
21
21
|
if (await useStorage().hasItem(key))
|
|
22
22
|
data = await useStorage().getItemRaw(key);
|
|
23
23
|
} else {
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type _sharp from 'sharp';
|
|
1
2
|
import type _satori from 'satori';
|
|
2
|
-
|
|
3
|
+
import type _cssInline from '@css-inline/css-inline';
|
|
4
|
+
export declare function useResvg(): Promise<new (svg: Uint8Array | string, options?: import("@resvg/resvg-wasm").ResvgRenderOptions) => {
|
|
3
5
|
free(): void;
|
|
4
6
|
render(): {
|
|
5
7
|
free(): void;
|
|
@@ -36,5 +38,5 @@ export declare function useResvg(): Promise<new (svg: string | Uint8Array, optio
|
|
|
36
38
|
readonly width: number;
|
|
37
39
|
}>;
|
|
38
40
|
export declare function useSatori(): Promise<typeof _satori>;
|
|
39
|
-
export declare function useSharp(): Promise<
|
|
40
|
-
export declare function useCssInline(): Promise<
|
|
41
|
+
export declare function useSharp(): Promise<typeof _sharp>;
|
|
42
|
+
export declare function useCssInline(): Promise<typeof _cssInline>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineSatoriTransformer } from "../utils.
|
|
2
|
-
import { decodeHtml } from "../../../util/encoding.
|
|
1
|
+
import { defineSatoriTransformer } from "../utils.js";
|
|
2
|
+
import { decodeHtml } from "../../../util/encoding.js";
|
|
3
3
|
export default defineSatoriTransformer([
|
|
4
4
|
// clean up
|
|
5
5
|
{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineSatoriTransformer } from "../utils.
|
|
1
|
+
import { defineSatoriTransformer } from "../utils.js";
|
|
2
2
|
export default defineSatoriTransformer({
|
|
3
3
|
filter: (node) => node.type === "div" && (Array.isArray(node.props?.children) && node.props?.children.length >= 1) && (!node.props.style?.display && !node.props?.class?.includes("hidden")),
|
|
4
4
|
transform: (node) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { withBase } from "ufo";
|
|
2
2
|
import sizeOf from "image-size";
|
|
3
|
-
import { defineSatoriTransformer } from "../utils.
|
|
4
|
-
import { toBase64Image } from "../../../../pure.
|
|
3
|
+
import { defineSatoriTransformer } from "../utils.js";
|
|
4
|
+
import { toBase64Image } from "../../../../pure.js";
|
|
5
5
|
import { useNitroOrigin, useStorage } from "#imports";
|
|
6
|
-
async function resolveLocalFilePathImage(src) {
|
|
7
|
-
const key =
|
|
6
|
+
async function resolveLocalFilePathImage(publicStoragePath, src) {
|
|
7
|
+
const key = `${publicStoragePath}${src.replace("./", ":").replace("/", ":")}`;
|
|
8
8
|
if (await useStorage().hasItem(key))
|
|
9
9
|
return await useStorage().getItemRaw(key);
|
|
10
10
|
}
|
|
@@ -12,14 +12,14 @@ export default defineSatoriTransformer([
|
|
|
12
12
|
// fix <img src="">
|
|
13
13
|
{
|
|
14
14
|
filter: (node) => node.type === "img" && node.props?.src,
|
|
15
|
-
transform: async (node, { e }) => {
|
|
15
|
+
transform: async (node, { e, publicStoragePath }) => {
|
|
16
16
|
const src = node.props.src;
|
|
17
17
|
const isRelative = src.startsWith("/");
|
|
18
18
|
let dimensions;
|
|
19
19
|
let imageBuffer;
|
|
20
20
|
if (isRelative) {
|
|
21
21
|
if (import.meta.prerender || import.meta.dev) {
|
|
22
|
-
imageBuffer = await resolveLocalFilePathImage(src);
|
|
22
|
+
imageBuffer = await resolveLocalFilePathImage(publicStoragePath, src);
|
|
23
23
|
} else {
|
|
24
24
|
imageBuffer = await e.$fetch(src, {
|
|
25
25
|
baseURL: useNitroOrigin(e),
|
|
@@ -65,13 +65,13 @@ export default defineSatoriTransformer([
|
|
|
65
65
|
// fix style="background-image: url('')"
|
|
66
66
|
{
|
|
67
67
|
filter: (node) => node.props?.style?.backgroundImage?.includes("url("),
|
|
68
|
-
transform: async (node, { e }) => {
|
|
68
|
+
transform: async (node, { e, publicStoragePath }) => {
|
|
69
69
|
const backgroundImage = node.props.style.backgroundImage;
|
|
70
70
|
const src = backgroundImage.replace(/^url\(['"]?/, "").replace(/['"]?\)$/, "");
|
|
71
71
|
const isRelative = src?.startsWith("/");
|
|
72
72
|
if (isRelative) {
|
|
73
73
|
if (import.meta.prerender || import.meta.dev) {
|
|
74
|
-
const imageBuffer = await resolveLocalFilePathImage(src);
|
|
74
|
+
const imageBuffer = await resolveLocalFilePathImage(publicStoragePath, src);
|
|
75
75
|
if (imageBuffer) {
|
|
76
76
|
const base64 = toBase64Image(Buffer.from(imageBuffer));
|
|
77
77
|
node.props.style.backgroundImage = `url(${base64})`;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createGenerator } from "@unocss/core";
|
|
2
2
|
import presetWind from "@unocss/preset-wind";
|
|
3
|
-
import { defineSatoriTransformer } from "../utils.
|
|
3
|
+
import { defineSatoriTransformer } from "../utils.js";
|
|
4
4
|
import { theme } from "#nuxt-og-image/unocss-config.mjs";
|
|
5
5
|
const uno = createGenerator({ theme }, {
|
|
6
6
|
presets: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OgImageRenderEventContext, Renderer } from '../../../types';
|
|
1
|
+
import type { OgImageRenderEventContext, Renderer } from '../../../types.js';
|
|
2
2
|
export declare function createSvg(event: OgImageRenderEventContext): Promise<string>;
|
|
3
3
|
declare const SatoriRenderer: Renderer;
|
|
4
4
|
export default SatoriRenderer;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { defu } from "defu";
|
|
2
2
|
import { createStorage } from "unstorage";
|
|
3
3
|
import lruCacheDriver from "unstorage/drivers/lru-cache";
|
|
4
|
-
import { normaliseFontInput, useOgImageRuntimeConfig } from "../../../shared.
|
|
5
|
-
import { loadFont } from "./font.
|
|
6
|
-
import { createVNodes } from "./vnodes.
|
|
7
|
-
import { useResvg, useSatori, useSharp } from "./instances.
|
|
4
|
+
import { normaliseFontInput, useOgImageRuntimeConfig } from "../../../shared.js";
|
|
5
|
+
import { loadFont } from "./font.js";
|
|
6
|
+
import { createVNodes } from "./vnodes.js";
|
|
7
|
+
import { useResvg, useSatori, useSharp } from "./instances.js";
|
|
8
8
|
import { theme } from "#nuxt-og-image/unocss-config.mjs";
|
|
9
9
|
const fontPromises = {};
|
|
10
10
|
const fontCache = createStorage({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { NuxtIslandResponse } from 'nuxt/dist/core/runtime/nitro/renderer';
|
|
2
2
|
import type { Storage } from 'unstorage';
|
|
3
|
-
import type { OgImageRenderEventContext } from '../../../../types';
|
|
3
|
+
import type { OgImageRenderEventContext } from '../../../../types.js';
|
|
4
4
|
export declare const emojiCache: Storage<string>;
|
|
5
|
-
export declare function applyEmojis(ctx: OgImageRenderEventContext, island: NuxtIslandResponse): Promise<
|
|
5
|
+
export declare function applyEmojis(ctx: OgImageRenderEventContext, island: NuxtIslandResponse): Promise<any>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { NuxtIslandResponse } from 'nuxt/dist/core/runtime/nitro/renderer';
|
|
2
|
-
import type { OgImageRenderEventContext } from '../../../../types';
|
|
2
|
+
import type { OgImageRenderEventContext } from '../../../../types.js';
|
|
3
3
|
export declare function applyInlineCss({ e }: OgImageRenderEventContext, island: NuxtIslandResponse): Promise<boolean>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useCssInline } from "../instances.
|
|
1
|
+
import { useCssInline } from "../instances.js";
|
|
2
2
|
import { useNitroOrigin } from "#imports";
|
|
3
3
|
import cssInline from "#nuxt-og-image/bindings/css-inline";
|
|
4
4
|
export async function applyInlineCss({ e }, island) {
|
|
@@ -31,7 +31,7 @@ export async function applyInlineCss({ e }, island) {
|
|
|
31
31
|
loadRemoteStylesheets: false,
|
|
32
32
|
extraCss: css
|
|
33
33
|
});
|
|
34
|
-
const classes = css.match(/\.([
|
|
34
|
+
const classes = css.match(/\.([\w-]+)/g)?.map((c) => c.replace(".", ""));
|
|
35
35
|
if (classes)
|
|
36
36
|
html = html.replace(new RegExp(`class="(${classes.join("|")})"`, "g"), "");
|
|
37
37
|
island.html = html;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { OgImageRenderEventContext, SatoriTransformer, VNode } from '../../../types';
|
|
1
|
+
import type { OgImageRenderEventContext, SatoriTransformer, VNode } from '../../../types.js';
|
|
2
2
|
export declare function walkSatoriTree(e: OgImageRenderEventContext, node: VNode, plugins: (SatoriTransformer | SatoriTransformer[])[]): (void | Promise<void>)[];
|
|
3
3
|
export declare function defineSatoriTransformer(transformer: SatoriTransformer | SatoriTransformer[]): SatoriTransformer | SatoriTransformer[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { OgImageRenderEventContext, VNode } from '../../../types';
|
|
1
|
+
import type { OgImageRenderEventContext, VNode } from '../../../types.js';
|
|
2
2
|
export declare function createVNodes(ctx: OgImageRenderEventContext): Promise<VNode>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { html as convertHtmlToSatori } from "satori-html";
|
|
2
|
-
import { fetchIsland } from "../../util/kit.
|
|
3
|
-
import { htmlDecodeQuotes } from "../../util/encoding.
|
|
4
|
-
import { applyInlineCss } from "./transforms/inlineCss.
|
|
5
|
-
import { applyEmojis } from "./transforms/emojis.
|
|
6
|
-
import { walkSatoriTree } from "./utils.
|
|
7
|
-
import unocss from "./plugins/unocss.
|
|
8
|
-
import emojis from "./plugins/emojis.
|
|
9
|
-
import classes from "./plugins/classes.
|
|
10
|
-
import imageSrc from "./plugins/imageSrc.
|
|
11
|
-
import flex from "./plugins/flex.
|
|
12
|
-
import encoding from "./plugins/encoding.
|
|
2
|
+
import { fetchIsland } from "../../util/kit.js";
|
|
3
|
+
import { htmlDecodeQuotes } from "../../util/encoding.js";
|
|
4
|
+
import { applyInlineCss } from "./transforms/inlineCss.js";
|
|
5
|
+
import { applyEmojis } from "./transforms/emojis.js";
|
|
6
|
+
import { walkSatoriTree } from "./utils.js";
|
|
7
|
+
import unocss from "./plugins/unocss.js";
|
|
8
|
+
import emojis from "./plugins/emojis.js";
|
|
9
|
+
import classes from "./plugins/classes.js";
|
|
10
|
+
import imageSrc from "./plugins/imageSrc.js";
|
|
11
|
+
import flex from "./plugins/flex.js";
|
|
12
|
+
import encoding from "./plugins/encoding.js";
|
|
13
13
|
export async function createVNodes(ctx) {
|
|
14
14
|
let html = ctx.options.html;
|
|
15
15
|
if (!html) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { OgImageRenderEventContext } from '../../../types';
|
|
1
|
+
import type { OgImageRenderEventContext } from '../../../types.js';
|
|
2
2
|
export declare function html(ctx: OgImageRenderEventContext): Promise<string>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createHeadCore } from "@unhead/vue";
|
|
2
2
|
import { renderSSRHead } from "@unhead/ssr";
|
|
3
3
|
import { createError } from "h3";
|
|
4
|
-
import { normaliseFontInput, useOgImageRuntimeConfig } from "../../../shared.
|
|
5
|
-
import { fetchIsland } from "../../util/kit.
|
|
6
|
-
import { applyEmojis } from "../satori/transforms/emojis.
|
|
4
|
+
import { normaliseFontInput, useOgImageRuntimeConfig } from "../../../shared.js";
|
|
5
|
+
import { fetchIsland } from "../../util/kit.js";
|
|
6
|
+
import { applyEmojis } from "../satori/transforms/emojis.js";
|
|
7
7
|
import { theme } from "#nuxt-og-image/unocss-config.mjs";
|
|
8
8
|
export async function html(ctx) {
|
|
9
9
|
const { options } = ctx;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("nitropack
|
|
1
|
+
declare const _default: import("nitropack").NitroAppPlugin;
|
|
2
2
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineNitroPlugin } from "nitropack/dist/runtime/plugin";
|
|
2
2
|
import { defu } from "defu";
|
|
3
|
-
import { getOgImagePath, useOgImageRuntimeConfig } from "../../shared.
|
|
3
|
+
import { getOgImagePath, useOgImageRuntimeConfig } from "../../shared.js";
|
|
4
4
|
export default defineNitroPlugin((nitroApp) => {
|
|
5
5
|
const { isNuxtContentDocumentDriven, defaults } = useOgImageRuntimeConfig();
|
|
6
6
|
nitroApp.hooks.hook("content:file:afterParse", async (content) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: import("nitropack
|
|
1
|
+
declare const _default: import("nitropack").NitroAppPlugin;
|
|
2
2
|
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { parseURL } from "ufo";
|
|
2
2
|
import { defineNitroPlugin } from "nitropack/dist/runtime/plugin";
|
|
3
|
-
import { extractAndNormaliseOgImageOptions, resolvePathCacheKey } from "../og-image/context.
|
|
4
|
-
import { prerenderOptionsCache } from "../og-image/cache.
|
|
5
|
-
import { isInternalRoute } from "../../pure.
|
|
6
|
-
import { createNitroRouteRuleMatcher } from "../util/kit.
|
|
3
|
+
import { extractAndNormaliseOgImageOptions, resolvePathCacheKey } from "../og-image/context.js";
|
|
4
|
+
import { prerenderOptionsCache } from "../og-image/cache.js";
|
|
5
|
+
import { isInternalRoute } from "../../pure.js";
|
|
6
|
+
import { createNitroRouteRuleMatcher } from "../util/kit.js";
|
|
7
7
|
export default defineNitroPlugin(async (nitro) => {
|
|
8
8
|
if (!import.meta.prerender)
|
|
9
9
|
return;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineEventHandler, setHeader } from "h3";
|
|
2
|
-
import { useOgImageRuntimeConfig } from "../../shared.
|
|
2
|
+
import { useOgImageRuntimeConfig } from "../../shared.js";
|
|
3
3
|
import compatibility from "#nuxt-og-image/compatibility";
|
|
4
4
|
import { componentNames } from "#nuxt-og-image/component-names.mjs";
|
|
5
5
|
export default defineEventHandler(async (e) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createError, defineEventHandler, getQuery, proxyRequest, sendRedirect } from "h3";
|
|
2
2
|
import { parseURL } from "ufo";
|
|
3
|
-
import { normaliseFontInput, useOgImageRuntimeConfig } from "../../shared.
|
|
3
|
+
import { normaliseFontInput, useOgImageRuntimeConfig } from "../../shared.js";
|
|
4
4
|
export default defineEventHandler(async (e) => {
|
|
5
5
|
const path = parseURL(e.path).pathname;
|
|
6
6
|
const [_name, _weight] = path.split("/font/")[1].split(".")[0].split("/");
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { H3Error, createError, defineEventHandler, getQuery, setHeader } from "h3";
|
|
2
|
-
import { useOgImageBufferCache } from "../util/cache.
|
|
3
|
-
import { useOgImageRuntimeConfig } from "../../shared.
|
|
4
|
-
import { resolveContext } from "../og-image/context.
|
|
5
|
-
import { html } from "../og-image/templates/html.
|
|
2
|
+
import { useOgImageBufferCache } from "../util/cache.js";
|
|
3
|
+
import { useOgImageRuntimeConfig } from "../../shared.js";
|
|
4
|
+
import { resolveContext } from "../og-image/context.js";
|
|
5
|
+
import { html } from "../og-image/templates/html.js";
|
|
6
6
|
export default defineEventHandler(async (e) => {
|
|
7
7
|
const ctx = await resolveContext(e);
|
|
8
8
|
if (ctx instanceof H3Error)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type { OgImageRenderEventContext } from '../../types';
|
|
1
|
+
import type { H3Error } from 'h3';
|
|
2
|
+
import type { OgImageRenderEventContext } from '../../types.js';
|
|
3
3
|
export declare function useOgImageBufferCache(ctx: OgImageRenderEventContext, options: {
|
|
4
4
|
baseCacheKey: string | false;
|
|
5
5
|
cacheMaxAgeSeconds?: number;
|
|
@@ -34,8 +34,9 @@ export async function useOgImageBufferCache(ctx, options) {
|
|
|
34
34
|
modifiedTime: new Date(headers["last-modified"]),
|
|
35
35
|
etag: headers.etag,
|
|
36
36
|
maxAge
|
|
37
|
-
}))
|
|
37
|
+
})) {
|
|
38
38
|
return;
|
|
39
|
+
}
|
|
39
40
|
setHeaders(ctx.e, headers);
|
|
40
41
|
} else {
|
|
41
42
|
await cache.removeItem(key).catch(() => {
|
|
@@ -2,7 +2,7 @@ export function htmlDecodeQuotes(html) {
|
|
|
2
2
|
return html.replace(/"/g, '"').replace(/'/g, "'").replace(/'/g, "'");
|
|
3
3
|
}
|
|
4
4
|
export function decodeHtml(html) {
|
|
5
|
-
return html.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/¢/g, "\xA2").replace(/£/g, "\xA3").replace(/¥/g, "\xA5").replace(/€/g, "\u20AC").replace(/©/g, "\xA9").replace(/®/g, "\xAE").replace(/"/g, '"').replace(/'/g, "'").replace(/'/g, "'").replace(///g, "/").replace(/&#(
|
|
5
|
+
return html.replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&").replace(/¢/g, "\xA2").replace(/£/g, "\xA3").replace(/¥/g, "\xA5").replace(/€/g, "\u20AC").replace(/©/g, "\xA9").replace(/®/g, "\xAE").replace(/"/g, '"').replace(/'/g, "'").replace(/'/g, "'").replace(///g, "/").replace(/&#(\d+);/g, (full, int) => {
|
|
6
6
|
return String.fromCharCode(Number.parseInt(int));
|
|
7
7
|
});
|
|
8
8
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { OgImageOptions } from '../../../types';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<OgImageOptions<"NuxtSeo">, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OgImageOptions<"NuxtSeo">>, {
|
|
3
|
-
|
|
1
|
+
import type { OgImageOptions } from '../../../types.js';
|
|
2
|
+
declare const _default: import("@vue/runtime-core").DefineComponent<OgImageOptions<"NuxtSeo">, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<OgImageOptions<"NuxtSeo">>, {
|
|
3
|
+
[x: string]: unknown;
|
|
4
4
|
}, {}>;
|
|
5
5
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { OgImagePageScreenshotOptions } from '../../../types';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<OgImagePageScreenshotOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OgImagePageScreenshotOptions>, {
|
|
3
|
-
|
|
1
|
+
import type { OgImagePageScreenshotOptions } from '../../../types.js';
|
|
2
|
+
declare const _default: import("@vue/runtime-core").DefineComponent<OgImagePageScreenshotOptions, {}, {}, {}, {}, import("@vue/runtime-core").ComponentOptionsMixin, import("@vue/runtime-core").ComponentOptionsMixin, {}, string, import("@vue/runtime-core").PublicProps, Readonly<OgImagePageScreenshotOptions>, {
|
|
3
|
+
[x: string]: unknown;
|
|
4
4
|
}, {}>;
|
|
5
5
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
/**
|
|
3
3
|
* @credits NuxtLabs <https://nuxtlabs.com/>
|
|
4
|
-
* @see https://github.com/nuxt/nuxt.com/blob/main/components/OgImage/
|
|
4
|
+
* @see https://github.com/nuxt/nuxt.com/blob/main/components/OgImage/Docs.vue
|
|
5
5
|
*/
|
|
6
6
|
import { computed } from 'vue'
|
|
7
7
|
|
|
@@ -21,7 +21,7 @@ const props = withDefaults(defineProps<{
|
|
|
21
21
|
title: 'title',
|
|
22
22
|
})
|
|
23
23
|
|
|
24
|
-
const HexRegex = /^#([0-9a-f]{3}){1,2}$/i
|
|
24
|
+
const HexRegex = /^#(?:[0-9a-f]{3}){1,2}$/i
|
|
25
25
|
|
|
26
26
|
const runtimeConfig = useOgImageRuntimeConfig()
|
|
27
27
|
|
|
@@ -78,13 +78,13 @@ const IconComponent = runtimeConfig.hasNuxtIcon
|
|
|
78
78
|
? resolveComponent('Icon')
|
|
79
79
|
: defineComponent({
|
|
80
80
|
render() {
|
|
81
|
-
return h('div', 'missing nuxt
|
|
81
|
+
return h('div', 'missing @nuxt/icon')
|
|
82
82
|
},
|
|
83
83
|
})
|
|
84
84
|
if (typeof props.icon === 'string' && !runtimeConfig.hasNuxtIcon && process.dev) {
|
|
85
|
-
console.warn('Please install
|
|
85
|
+
console.warn('Please install `@nuxt/icon` to use icons with the fallback OG Image component.')
|
|
86
86
|
// eslint-disable-next-line no-console
|
|
87
|
-
console.log('\
|
|
87
|
+
console.log('\nnpx nuxi module add icon\n')
|
|
88
88
|
// create simple div renderer component
|
|
89
89
|
}
|
|
90
90
|
</script>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
/**
|
|
3
3
|
* @credits Pergel <https://nuxtlabs.com/>
|
|
4
|
-
* @see https://github.com/nuxt/nuxt.com/blob/main/components/OgImage/OgImageDocs.vue
|
|
5
4
|
*/
|
|
6
5
|
import { computed } from 'vue'
|
|
7
6
|
|
|
@@ -33,7 +32,7 @@ const title = computed(() => props.title.slice(0, 60))
|
|
|
33
32
|
|
|
34
33
|
<div class="w-[600px] pl-[100px]">
|
|
35
34
|
<p v-if="headline" class="uppercase text-[24px] text-[#FEC476] mb-4 font-semibold">
|
|
36
|
-
|
|
35
|
+
{{ headline }}
|
|
37
36
|
</p>
|
|
38
37
|
<h1 class="w-[600px] m-0 text-[75px] font-semibold mb-4 text-white flex items-center">
|
|
39
38
|
<span>{{ title }}</span>
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { DefineOgImageInput } from '../../types';
|
|
1
|
+
import type { DefineOgImageInput } from '../../types.js';
|
|
2
2
|
export declare function defineOgImage(_options?: DefineOgImageInput): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defu } from "defu";
|
|
2
2
|
import { appendHeader } from "h3";
|
|
3
|
-
import { getOgImagePath, separateProps, useOgImageRuntimeConfig } from "../../shared.
|
|
4
|
-
import { createOgImageMeta, normaliseOptions } from "../utils.
|
|
5
|
-
import { createNitroRouteRuleMatcher } from "../../nitro/util/kit.
|
|
3
|
+
import { getOgImagePath, separateProps, useOgImageRuntimeConfig } from "../../shared.js";
|
|
4
|
+
import { createOgImageMeta, normaliseOptions } from "../utils.js";
|
|
5
|
+
import { createNitroRouteRuleMatcher } from "../../nitro/util/kit.js";
|
|
6
6
|
import { useNuxtApp, useRequestEvent, useRoute } from "#imports";
|
|
7
7
|
export function defineOgImage(_options = {}) {
|
|
8
8
|
if (!import.meta.server)
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ExtractComponentProps, OgImageOptions } from '../../types';
|
|
1
|
+
import type { ExtractComponentProps, OgImageOptions } from '../../types.js';
|
|
2
2
|
import type { OgImageComponents } from '#nuxt-og-image/components';
|
|
3
3
|
export declare function defineOgImageComponent<T extends keyof OgImageComponents>(component: T, props?: Partial<ExtractComponentProps<OgImageComponents[T]>>, options?: OgImageOptions): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { OgImagePageScreenshotOptions } from '../../types';
|
|
2
|
-
export declare function defineOgImageScreenshot(options?: OgImagePageScreenshotOptions):
|
|
1
|
+
import type { OgImagePageScreenshotOptions } from '../../types.js';
|
|
2
|
+
export declare function defineOgImageScreenshot(options?: OgImagePageScreenshotOptions): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { DefineOgImageInput, ExtractComponentProps, OgImageOptions, OgImagePageScreenshotOptions } from '../../types.js';
|
|
2
|
+
export declare function defineOgImage(_options?: DefineOgImageInput): void;
|
|
3
|
+
export declare function defineOgImageComponent<T extends keyof OgImageComponents>(component: T, props?: Partial<ExtractComponentProps<OgImageComponents[T]>>, options?: OgImageOptions): void;
|
|
4
|
+
export declare function defineOgImageScreenshot(options?: OgImagePageScreenshotOptions): void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
|
|
2
2
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parseURL } from "ufo";
|
|
2
2
|
import { toValue } from "vue";
|
|
3
3
|
import { defu } from "defu";
|
|
4
|
-
import { isInternalRoute, separateProps } from "../../pure.
|
|
4
|
+
import { isInternalRoute, separateProps } from "../../pure.js";
|
|
5
5
|
import { defineNuxtPlugin, useRequestEvent, withSiteUrl } from "#imports";
|
|
6
6
|
export default defineNuxtPlugin({
|
|
7
7
|
setup(nuxtApp) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default:
|
|
1
|
+
declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
|
|
2
2
|
export default _default;
|
package/dist/runtime/nuxt/plugins/{route-rule-og-image.server.mjs → route-rule-og-image.server.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defu } from "defu";
|
|
2
2
|
import { parseURL, withoutBase } from "ufo";
|
|
3
3
|
import { createRouter as createRadixRouter, toRouteMatcher } from "radix3";
|
|
4
|
-
import { getOgImagePath, isInternalRoute, useOgImageRuntimeConfig } from "../../shared.
|
|
5
|
-
import { createOgImageMeta, normaliseOptions } from "../utils.
|
|
4
|
+
import { getOgImagePath, isInternalRoute, useOgImageRuntimeConfig } from "../../shared.js";
|
|
5
|
+
import { createOgImageMeta, normaliseOptions } from "../utils.js";
|
|
6
6
|
import { defineNuxtPlugin, useRequestEvent } from "#imports";
|
|
7
7
|
export default defineNuxtPlugin((nuxtApp) => {
|
|
8
8
|
nuxtApp.hooks.hook("app:rendered", async (ctx) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { NuxtSSRContext } from 'nuxt/app';
|
|
2
|
-
import type { DefineOgImageInput, OgImageOptions, OgImagePrebuilt } from '../types';
|
|
2
|
+
import type { DefineOgImageInput, OgImageOptions, OgImagePrebuilt } from '../types.js';
|
|
3
3
|
export declare function createOgImageMeta(src: string | null, input: OgImageOptions | OgImagePrebuilt, resolvedOptions: OgImageOptions, ssrContext: NuxtSSRContext): void;
|
|
4
4
|
export declare function normaliseOptions(_options: DefineOgImageInput): OgImageOptions | OgImagePrebuilt;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defu } from "defu";
|
|
2
2
|
import { withQuery } from "ufo";
|
|
3
|
-
import { getExtension, separateProps } from "../shared.
|
|
3
|
+
import { getExtension, separateProps } from "../shared.js";
|
|
4
4
|
import { unref, useServerHead } from "#imports";
|
|
5
5
|
import { componentNames } from "#build/nuxt-og-image/components.mjs";
|
|
6
6
|
export function createOgImageMeta(src, input, resolvedOptions, ssrContext) {
|
package/dist/runtime/pure.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { InputFontConfig, OgImageOptions, ResolvedFontConfig } from './types';
|
|
1
|
+
import type { InputFontConfig, OgImageOptions, ResolvedFontConfig } from './types.js';
|
|
2
2
|
export declare function toBase64Image(data: string | ArrayBuffer): string;
|
|
3
3
|
export declare function isInternalRoute(path: string): boolean;
|
|
4
4
|
export declare function separateProps(options: OgImageOptions | undefined, ignoreKeys?: string[]): {
|
package/dist/runtime/shared.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OgImageOptions, OgImageRuntimeConfig } from './types';
|
|
2
|
-
export * from './pure';
|
|
1
|
+
import type { OgImageOptions, OgImageRuntimeConfig } from './types.js';
|
|
2
|
+
export * from './pure.js';
|
|
3
3
|
export declare function getOgImagePath(pagePath: string, _options?: Partial<OgImageOptions>): string;
|
|
4
4
|
export declare function useOgImageRuntimeConfig(): OgImageRuntimeConfig;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { joinURL } from "ufo";
|
|
2
2
|
import { defu } from "defu";
|
|
3
3
|
import { useRuntimeConfig } from "#imports";
|
|
4
|
-
export * from "./pure.
|
|
4
|
+
export * from "./pure.js";
|
|
5
5
|
export function getOgImagePath(pagePath, _options) {
|
|
6
6
|
const baseURL = useRuntimeConfig().app.baseURL;
|
|
7
7
|
const options = defu(_options, useOgImageRuntimeConfig().defaults);
|
package/dist/runtime/types.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export interface OgImageRenderEventContext {
|
|
|
14
14
|
renderer: Renderer;
|
|
15
15
|
options: OgImageOptions;
|
|
16
16
|
isDebugJsonPayload: boolean;
|
|
17
|
+
publicStoragePath: string;
|
|
17
18
|
_nitro: NitroApp;
|
|
18
19
|
}
|
|
19
20
|
export type IconifyEmojiIconSets = 'twemoji' | 'noto' | 'fluent-emoji' | 'fluent-emoji-flat' | 'fluent-emoji-high-contrast' | 'noto-v1' | 'emojione' | 'emojione-monotone' | 'emojione-v1' | 'streamline-emojis' | 'openmoji';
|
|
@@ -22,6 +23,7 @@ export interface OgImageRuntimeConfig {
|
|
|
22
23
|
satoriOptions: SatoriOptions;
|
|
23
24
|
resvgOptions: ResvgRenderOptions;
|
|
24
25
|
sharpOptions: SharpOptions;
|
|
26
|
+
publicStoragePath: string;
|
|
25
27
|
defaults: OgImageOptions;
|
|
26
28
|
debug: boolean;
|
|
27
29
|
baseCacheKey: string;
|