nuxt-og-image 3.0.0-rc.53 → 3.0.0-rc.54
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 +116 -92
- package/dist/client/404.html +116 -92
- package/dist/client/_nuxt/{DZWTOXyg.js → 8m94Rtva.js} +1 -1
- package/dist/client/_nuxt/{3Yx8WcR-.js → B3g-KkBK.js} +1 -1
- 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/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/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/{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/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/{CRWwmX0L.js → DCjyzNN-.js} +1 -1
- 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/{D-pQtGOP.js → DVLwECkk.js} +1 -1
- package/dist/client/_nuxt/{B561T8eW.js → DZD3AlMl.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/HFCcX1lU.js +131 -0
- package/dist/client/_nuxt/HrnDn_2Q.js +1 -0
- package/dist/client/_nuxt/IconCSS.MLh-peQH.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/{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/ce5d759a-31b3-43b6-b457-16195d8e8276.json +1 -0
- package/dist/client/_nuxt/{Bdb36Id5.js → dIHJ9UdL.js} +1 -1
- package/dist/client/_nuxt/entry.DVnILh1U.css +1 -0
- package/dist/client/_nuxt/error-404.DEDgGDo3.css +1 -0
- package/dist/client/_nuxt/error-500.D8jWTpMJ.css +1 -0
- package/dist/client/_nuxt/{crZ1QlHm.js → kb-FbsIp.js} +1 -1
- package/dist/client/_nuxt/o8H-iTt6.js +6 -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/client/index.html +116 -92
- package/dist/module.d.mts +2 -106
- package/dist/module.d.ts +2 -106
- package/dist/module.json +3 -3
- package/dist/module.mjs +12 -6
- 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.mjs → wasm-fs.js} +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 -1
- 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 +4 -2
- 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 +0 -10
- 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/nuxt/components/OgImage/OgImage.d.ts +1 -1
- package/dist/runtime/nuxt/components/OgImage/OgImageScreenshot.d.ts +1 -1
- package/dist/runtime/nuxt/components/Templates/Community/NuxtSeo.vue +1 -1
- 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/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 +0 -161
- package/dist/types.d.mts +2 -9
- package/dist/types.d.ts +2 -9
- package/package.json +38 -40
- package/dist/client/_nuxt/-hLHpAOl.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/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/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
package/dist/module.mjs
CHANGED
|
@@ -441,7 +441,7 @@ const module = defineNuxtModule({
|
|
|
441
441
|
meta: {
|
|
442
442
|
name: "nuxt-og-image",
|
|
443
443
|
compatibility: {
|
|
444
|
-
nuxt: "
|
|
444
|
+
nuxt: ">=3.10.3",
|
|
445
445
|
bridge: false
|
|
446
446
|
},
|
|
447
447
|
configKey: "ogImage"
|
|
@@ -484,10 +484,12 @@ const module = defineNuxtModule({
|
|
|
484
484
|
nuxt.options.build.transpile.push(resolve("./runtime"));
|
|
485
485
|
const preset = resolveNitroPreset(nuxt.options.nitro);
|
|
486
486
|
const targetCompatibility = getPresetNitroPresetCompatibility(preset);
|
|
487
|
-
|
|
487
|
+
let isUsingSharp = false;
|
|
488
488
|
const userConfiguredExtension = config.defaults.extension;
|
|
489
489
|
const hasConfiguredJpegs = userConfiguredExtension && ["jpeg", "jpg"].includes(userConfiguredExtension);
|
|
490
|
-
if (hasConfiguredJpegs && config.defaults.renderer !== "chromium") {
|
|
490
|
+
if (!!config.sharpOptions || hasConfiguredJpegs && config.defaults.renderer !== "chromium") {
|
|
491
|
+
isUsingSharp = true;
|
|
492
|
+
const hasSharpDependency = !!await tryResolveModule("sharp");
|
|
491
493
|
if (hasSharpDependency && !targetCompatibility.sharp) {
|
|
492
494
|
logger.warn(`Rendering JPEGs requires sharp which does not work with ${preset}. Images will be rendered as PNG at runtime.`);
|
|
493
495
|
config.compatibility = defu(config.compatibility, {
|
|
@@ -498,7 +500,8 @@ const module = defineNuxtModule({
|
|
|
498
500
|
await ensureDependencies(["sharp"]);
|
|
499
501
|
logger.warn("Support for `sharp` is limited so check the compatibility guide.");
|
|
500
502
|
}
|
|
501
|
-
}
|
|
503
|
+
}
|
|
504
|
+
if (!isUsingSharp) {
|
|
502
505
|
config.compatibility = defu(config.compatibility, {
|
|
503
506
|
runtime: { sharp: false },
|
|
504
507
|
dev: { sharp: false },
|
|
@@ -642,8 +645,9 @@ const module = defineNuxtModule({
|
|
|
642
645
|
components.forEach((component) => {
|
|
643
646
|
let valid = false;
|
|
644
647
|
config.componentDirs.forEach((dir) => {
|
|
645
|
-
if (component.pascalName.startsWith(dir) || component.kebabName.startsWith(dir) || component.shortPath.includes(`/${dir}/`))
|
|
648
|
+
if (component.pascalName.startsWith(dir) || component.kebabName.startsWith(dir) || component.shortPath.includes(`/${dir}/`)) {
|
|
646
649
|
valid = true;
|
|
650
|
+
}
|
|
647
651
|
});
|
|
648
652
|
if (component.filePath.includes(resolve("./runtime/nuxt/components/Templates")))
|
|
649
653
|
valid = true;
|
|
@@ -744,12 +748,14 @@ declare module '#nuxt-og-image/unocss-config' {
|
|
|
744
748
|
colorPreference = colorModeOptions.fallback;
|
|
745
749
|
if (!colorPreference || colorPreference === "system")
|
|
746
750
|
colorPreference = "light";
|
|
751
|
+
const publicDirAbs = nuxt.options.alias[nuxt.options.dir.public];
|
|
747
752
|
const runtimeConfig = {
|
|
748
753
|
version,
|
|
749
754
|
// binding options
|
|
750
755
|
satoriOptions: config.satoriOptions || {},
|
|
751
756
|
resvgOptions: config.resvgOptions || {},
|
|
752
|
-
sharpOptions: config.sharpOptions || {},
|
|
757
|
+
sharpOptions: config.sharpOptions === true ? {} : config.sharpOptions || {},
|
|
758
|
+
publicStoragePath: `root${publicDirAbs.replace(nuxt.options.rootDir, "").replaceAll("/", ":")}`,
|
|
753
759
|
defaults: config.defaults,
|
|
754
760
|
debug: config.debug,
|
|
755
761
|
// avoid adding credentials
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { execa } from "execa";
|
|
2
|
-
import terminate from "terminate";
|
|
3
2
|
import { createConsola } from "consola";
|
|
4
3
|
import playwrightCore from "playwright-core";
|
|
5
4
|
let installedChromium = false;
|
|
@@ -22,7 +21,7 @@ export async function createBrowser() {
|
|
|
22
21
|
resolve(true);
|
|
23
22
|
});
|
|
24
23
|
}).then(() => {
|
|
25
|
-
installChromeProcess.
|
|
24
|
+
installChromeProcess.kill();
|
|
26
25
|
logger.info("Installed Chromium install for og:image generation.");
|
|
27
26
|
_resolve();
|
|
28
27
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { initWasm, inline } from "@css-inline/css-inline-wasm";
|
|
2
|
-
import { readWasmFile } from "../../../util/wasm.
|
|
2
|
+
import { readWasmFile } from "../../../util/wasm.js";
|
|
3
3
|
export default {
|
|
4
4
|
initWasmPromise: initWasm(readWasmFile("@css-inline/css-inline-wasm/index_bg.wasm")),
|
|
5
5
|
cssInline: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Resvg as _Resvg, initWasm } from "@resvg/resvg-wasm";
|
|
2
|
-
import { readWasmFile } from "../../../util/wasm.
|
|
2
|
+
import { readWasmFile } from "../../../util/wasm.js";
|
|
3
3
|
export default {
|
|
4
4
|
initWasmPromise: initWasm(readWasmFile("@resvg/resvg-wasm/index_bg.wasm")),
|
|
5
5
|
Resvg: _Resvg
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _satori, { init } from "satori/wasm";
|
|
2
2
|
import initYoga from "yoga-wasm-web";
|
|
3
|
-
import { readWasmFile } from "../../../util/wasm.
|
|
3
|
+
import { readWasmFile } from "../../../util/wasm.js";
|
|
4
4
|
const wasm = readWasmFile("yoga-wasm-web/dist/yoga.wasm").then(async (yoga) => await initYoga(yoga));
|
|
5
5
|
export default {
|
|
6
6
|
initWasmPromise: new Promise((resolve) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { Buffer } from 'node:buffer';
|
|
3
3
|
import type { Browser } from 'playwright-core';
|
|
4
|
-
import type { OgImageRenderEventContext } from '../../../types';
|
|
4
|
+
import type { OgImageRenderEventContext } from '../../../types.js';
|
|
5
5
|
export declare function createScreenshot({ basePath, e, options, extension }: OgImageRenderEventContext, browser: Browser): Promise<Buffer>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { joinURL, withQuery } from "ufo";
|
|
2
|
-
import { useOgImageRuntimeConfig } from "../../../shared.
|
|
2
|
+
import { useOgImageRuntimeConfig } from "../../../shared.js";
|
|
3
3
|
import { useNitroOrigin } from "#imports";
|
|
4
4
|
export async function createScreenshot({ basePath, e, options, extension }, browser) {
|
|
5
5
|
const { colorPreference } = useOgImageRuntimeConfig();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { H3Error, H3Event } from 'h3';
|
|
2
|
-
import type { OgImageOptions, OgImageRenderEventContext } from '../../types';
|
|
2
|
+
import type { OgImageOptions, OgImageRenderEventContext } from '../../types.js';
|
|
3
3
|
export declare function resolvePathCacheKey(e: H3Event, path?: string): string;
|
|
4
4
|
export declare function resolveContext(e: H3Event): Promise<H3Error | OgImageRenderEventContext>;
|
|
5
5
|
export declare function extractAndNormaliseOgImageOptions(html: string): OgImageOptions | false;
|
|
@@ -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,4 +1,6 @@
|
|
|
1
|
+
import type _sharp from 'sharp';
|
|
1
2
|
import type _satori from 'satori';
|
|
3
|
+
import type _cssInline from '@css-inline/css-inline';
|
|
2
4
|
export declare function useResvg(): Promise<new (svg: string | Uint8Array, options?: import("@resvg/resvg-wasm").ResvgRenderOptions | undefined) => {
|
|
3
5
|
free(): void;
|
|
4
6
|
render(): {
|
|
@@ -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/runtime/plugin").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/runtime/plugin").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,10 +0,0 @@
|
|
|
1
|
-
import { type H3Error } from 'h3';
|
|
2
|
-
import type { OgImageRenderEventContext } from '../../types';
|
|
3
|
-
export declare function useOgImageBufferCache(ctx: OgImageRenderEventContext, options: {
|
|
4
|
-
baseCacheKey: string | false;
|
|
5
|
-
cacheMaxAgeSeconds?: number;
|
|
6
|
-
}): Promise<void | H3Error | {
|
|
7
|
-
cachedItem: false | BufferSource;
|
|
8
|
-
enabled: boolean;
|
|
9
|
-
update: (image: BufferSource) => Promise<void>;
|
|
10
|
-
}>;
|
|
@@ -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,4 +1,4 @@
|
|
|
1
|
-
import type { OgImageOptions } from '../../../types';
|
|
1
|
+
import type { OgImageOptions } from '../../../types.js';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<OgImageOptions<"NuxtSeo">, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OgImageOptions<"NuxtSeo">>, {
|
|
3
3
|
props?: any;
|
|
4
4
|
}, {}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OgImagePageScreenshotOptions } from '../../../types';
|
|
1
|
+
import type { OgImagePageScreenshotOptions } from '../../../types.js';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<OgImagePageScreenshotOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<OgImagePageScreenshotOptions>, {
|
|
3
3
|
props?: any;
|
|
4
4
|
}, {}>;
|
|
@@ -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;
|
|
@@ -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;
|