nuxt-og-image 3.0.0-beta.10 → 3.0.0-beta.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/200.html +5 -5
- package/dist/client/404.html +5 -5
- package/dist/client/_nuxt/{IconCSS.389cad49.js → IconCSS.59f1542b.js} +1 -1
- package/dist/client/_nuxt/IconCSS.7e8f1f7b.css +1 -0
- package/dist/client/_nuxt/builds/latest.json +1 -1
- package/dist/client/_nuxt/builds/meta/4222eee5-f71e-4425-9403-92637db48893.json +1 -0
- package/dist/client/_nuxt/entry.03caefbf.js +137 -0
- package/dist/client/_nuxt/entry.3a009184.css +1 -0
- package/dist/client/_nuxt/{error-404.91508473.js → error-404.8bab7a15.js} +1 -1
- package/dist/client/_nuxt/{error-500.b66f3aae.js → error-500.b72200bc.js} +1 -1
- package/dist/client/index.html +5 -5
- package/dist/module.d.mts +40 -23
- package/dist/module.d.ts +40 -23
- package/dist/module.json +2 -2
- package/dist/module.mjs +68 -53
- package/dist/runtime/cache.d.ts +7 -10
- package/dist/runtime/cache.mjs +38 -26
- package/dist/runtime/components/OgImage/OgImage.d.ts +5 -0
- package/dist/runtime/components/OgImage/{index.mjs → OgImage.mjs} +1 -1
- package/dist/runtime/components/OgImage/Screenshot.d.ts +3 -4
- package/dist/runtime/components/OgImage/Screenshot.mjs +1 -1
- package/dist/runtime/components/Templates/Official/SimpleBlog.vue +1 -0
- package/dist/runtime/composables/defineOgImage.d.ts +2 -23
- package/dist/runtime/composables/defineOgImage.mjs +32 -115
- package/dist/runtime/composables/defineOgImageComponent.d.ts +3 -0
- package/dist/runtime/composables/defineOgImageComponent.mjs +8 -0
- package/dist/runtime/composables/defineOgImagePageScreenshot.d.ts +2 -0
- package/dist/runtime/composables/defineOgImagePageScreenshot.mjs +14 -0
- package/dist/runtime/core/bindings/css-inline/node.d.ts +2 -5
- package/dist/runtime/core/bindings/css-inline/node.mjs +2 -10
- package/dist/runtime/core/bindings/resvg/wasm.mjs +2 -5
- package/dist/runtime/core/bindings/satori/wasm.mjs +7 -0
- package/dist/runtime/core/cache/emojis.d.ts +1 -0
- package/dist/runtime/core/cache/emojis.mjs +5 -0
- package/dist/runtime/core/cache/htmlPayload.d.ts +5 -0
- package/dist/runtime/core/cache/htmlPayload.mjs +6 -0
- package/dist/runtime/core/cache/prerender.d.ts +1 -1
- package/dist/runtime/core/font/fetch.d.ts +2 -3
- package/dist/runtime/core/font/fetch.mjs +10 -4
- package/dist/runtime/core/html/applyEmojis.d.ts +3 -0
- package/dist/runtime/core/html/applyEmojis.mjs +37 -0
- package/dist/runtime/core/html/applyInlineCss.d.ts +3 -0
- package/dist/runtime/core/html/applyInlineCss.mjs +32 -0
- package/dist/runtime/core/html/devIframeTemplate.d.ts +2 -0
- package/dist/runtime/core/html/{fetch.mjs → devIframeTemplate.mjs} +8 -31
- package/dist/runtime/core/html/fetchIsland.d.ts +3 -0
- package/dist/runtime/core/html/fetchIsland.mjs +17 -0
- package/dist/runtime/core/options/fetch.d.ts +1 -1
- package/dist/runtime/core/options/fetch.mjs +10 -5
- package/dist/runtime/core/options/normalise.d.ts +2 -2
- package/dist/runtime/core/renderers/chromium/index.mjs +6 -7
- package/dist/runtime/core/renderers/chromium/screenshot.d.ts +2 -3
- package/dist/runtime/core/renderers/chromium/screenshot.mjs +5 -4
- package/dist/runtime/core/renderers/satori/fonts.d.ts +2 -2
- package/dist/runtime/core/renderers/satori/fonts.mjs +2 -2
- package/dist/runtime/core/renderers/satori/index.d.ts +2 -3
- package/dist/runtime/core/renderers/satori/index.mjs +21 -18
- package/dist/runtime/core/renderers/satori/instances.d.ts +3 -0
- package/dist/runtime/core/renderers/satori/instances.mjs +15 -0
- package/dist/runtime/core/renderers/satori/plugins/emojis.mjs +15 -13
- package/dist/runtime/core/renderers/satori/plugins/imageSrc.mjs +8 -4
- package/dist/runtime/core/renderers/satori/utils.d.ts +2 -3
- package/dist/runtime/core/renderers/satori/vnodes.d.ts +2 -3
- package/dist/runtime/core/renderers/satori/vnodes.mjs +14 -6
- package/dist/runtime/core/utils/resolveRendererContext.d.ts +2 -6
- package/dist/runtime/core/utils/resolveRendererContext.mjs +34 -21
- package/dist/runtime/core/utils/wasm.d.ts +1 -0
- package/dist/runtime/core/utils/wasm.mjs +6 -0
- package/dist/runtime/nitro/plugins/nuxt-content.mjs +2 -2
- package/dist/runtime/nitro/plugins/prerender.mjs +2 -2
- package/dist/runtime/nuxt/plugins/nuxt-content-canonical-urls.mjs +1 -1
- package/dist/runtime/nuxt/plugins/route-rule-og-image.server.mjs +14 -47
- package/dist/runtime/nuxt/utils.d.ts +2 -0
- package/dist/runtime/nuxt/utils.mjs +55 -0
- package/dist/runtime/server/routes/__og-image__/debug.json.d.ts +0 -2
- package/dist/runtime/server/routes/__og-image__/debug.json.mjs +2 -7
- package/dist/runtime/server/routes/__og-image__/image.mjs +86 -0
- package/dist/runtime/types.d.ts +57 -24
- package/dist/runtime/utils.d.ts +3 -0
- package/dist/runtime/utils.mjs +11 -0
- package/package.json +17 -32
- package/virtual.d.ts +49 -0
- package/dist/client/_nuxt/IconCSS.8f429b14.css +0 -1
- package/dist/client/_nuxt/builds/meta/3185e4a0-6b15-4476-b2f3-85ef31d35fc6.json +0 -1
- package/dist/client/_nuxt/entry.434c2c45.css +0 -1
- package/dist/client/_nuxt/entry.e62f04d6.js +0 -137
- package/dist/client/grid.png +0 -0
- package/dist/runtime/components/OgImage/Cached.d.ts +0 -5
- package/dist/runtime/components/OgImage/Cached.mjs +0 -10
- package/dist/runtime/components/OgImage/Dynamic.d.ts +0 -8
- package/dist/runtime/components/OgImage/Dynamic.mjs +0 -10
- package/dist/runtime/components/OgImage/Static.d.ts +0 -8
- package/dist/runtime/components/OgImage/Static.mjs +0 -10
- package/dist/runtime/components/OgImage/WithoutCache.d.ts +0 -5
- package/dist/runtime/components/OgImage/WithoutCache.mjs +0 -10
- package/dist/runtime/components/OgImage/index.d.ts +0 -5
- package/dist/runtime/core/bindings/css-inline/mock.d.ts +0 -5
- package/dist/runtime/core/bindings/css-inline/mock.mjs +0 -3
- package/dist/runtime/core/bindings/satori/yoga-wasm.mjs +0 -7
- package/dist/runtime/core/bindings/sharp/wasm.d.ts +0 -2
- package/dist/runtime/core/bindings/sharp/wasm.mjs +0 -2
- package/dist/runtime/core/html/fetch.d.ts +0 -3
- package/dist/runtime/server/routes/__og-image__/image-[path]-og.[extension].mjs +0 -45
- package/dist/runtime/utilts.d.ts +0 -2
- package/dist/runtime/utilts.mjs +0 -8
- /package/dist/runtime/core/bindings/satori/{yoga-wasm.d.ts → wasm.d.ts} +0 -0
- /package/dist/runtime/server/routes/__og-image__/{image-[path]-og.[extension].d.ts → image.d.ts} +0 -0
package/dist/client/grid.png
DELETED
|
Binary file
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { OgImageOptions } from '../../types';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<OgImageOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<OgImageOptions>>, {
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
}, {}>;
|
|
5
|
-
export default _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from "vue";
|
|
2
|
-
import { defineOgImageCached } from "#imports";
|
|
3
|
-
export default defineComponent({
|
|
4
|
-
name: "OgImageCached",
|
|
5
|
-
async setup(_, { attrs }) {
|
|
6
|
-
if (import.meta.server)
|
|
7
|
-
await defineOgImageCached(attrs);
|
|
8
|
-
return () => null;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { OgImageOptions } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Use OgImageWithoutCache
|
|
4
|
-
*/
|
|
5
|
-
declare const _default: import("vue").DefineComponent<OgImageOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<OgImageOptions>>, {
|
|
6
|
-
[x: string]: any;
|
|
7
|
-
}, {}>;
|
|
8
|
-
export default _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from "vue";
|
|
2
|
-
import { defineOgImageWithoutCache } from "#imports";
|
|
3
|
-
export default defineComponent({
|
|
4
|
-
name: "OgImageDynamic",
|
|
5
|
-
async setup(_, { attrs }) {
|
|
6
|
-
if (import.meta.server)
|
|
7
|
-
await defineOgImageWithoutCache(attrs);
|
|
8
|
-
return () => null;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { OgImageOptions } from '../../types';
|
|
2
|
-
/**
|
|
3
|
-
* @deprecated Use OgImageCached instead
|
|
4
|
-
*/
|
|
5
|
-
declare const _default: import("vue").DefineComponent<OgImageOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<OgImageOptions>>, {
|
|
6
|
-
[x: string]: any;
|
|
7
|
-
}, {}>;
|
|
8
|
-
export default _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from "vue";
|
|
2
|
-
import { defineOgImageCached } from "#imports";
|
|
3
|
-
export default defineComponent({
|
|
4
|
-
name: "OgImageStatic",
|
|
5
|
-
async setup(_, { attrs }) {
|
|
6
|
-
if (import.meta.server)
|
|
7
|
-
await defineOgImageCached(attrs);
|
|
8
|
-
return () => null;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { OgImageOptions } from '../../types';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<OgImageOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<OgImageOptions>>, {
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
}, {}>;
|
|
5
|
-
export default _default;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { defineComponent } from "vue";
|
|
2
|
-
import { defineOgImageWithoutCache } from "#imports";
|
|
3
|
-
export default defineComponent({
|
|
4
|
-
name: "OgImageWithoutCache",
|
|
5
|
-
async setup(_, { attrs }) {
|
|
6
|
-
if (import.meta.server)
|
|
7
|
-
defineOgImageWithoutCache(attrs);
|
|
8
|
-
return () => null;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { OgImageOptions } from '../../types';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<OgImageOptions, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<OgImageOptions>>, {
|
|
3
|
-
[x: string]: any;
|
|
4
|
-
}, {}>;
|
|
5
|
-
export default _default;
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { H3Error, createError, defineEventHandler, setHeader } from "h3";
|
|
2
|
-
import { resolveRendererContext } from "../../../core/utils/resolveRendererContext.mjs";
|
|
3
|
-
import { fetchHTML } from "../../../core/html/fetch.mjs";
|
|
4
|
-
import { useSiteConfig } from "#imports";
|
|
5
|
-
export default defineEventHandler(async (e) => {
|
|
6
|
-
const ctx = await resolveRendererContext(e);
|
|
7
|
-
if (ctx instanceof H3Error)
|
|
8
|
-
return ctx;
|
|
9
|
-
const { extension, options, renderer } = ctx;
|
|
10
|
-
if (!options.cacheTtl || import.meta.dev) {
|
|
11
|
-
setHeader(e, "Cache-Control", "no-cache, no-store, must-revalidate");
|
|
12
|
-
setHeader(e, "Pragma", "no-cache");
|
|
13
|
-
setHeader(e, "Expires", "0");
|
|
14
|
-
}
|
|
15
|
-
switch (extension) {
|
|
16
|
-
case "html":
|
|
17
|
-
setHeader(e, "Content-Type", `text/html`);
|
|
18
|
-
return fetchHTML(e, options);
|
|
19
|
-
case "json":
|
|
20
|
-
setHeader(e, "Content-Type", "application/json");
|
|
21
|
-
return {
|
|
22
|
-
...ctx,
|
|
23
|
-
siteConfig: useSiteConfig(e),
|
|
24
|
-
vnodes: options.renderer === "satori" ? await renderer.createImage(e, { ...options, extension: "json" }) : void 0
|
|
25
|
-
};
|
|
26
|
-
case "svg":
|
|
27
|
-
case "png":
|
|
28
|
-
case "jpeg":
|
|
29
|
-
case "jpg":
|
|
30
|
-
if (!renderer.supportedFormats.includes(options.extension)) {
|
|
31
|
-
return createError({
|
|
32
|
-
statusCode: 400,
|
|
33
|
-
statusMessage: `Generating ${options.extension}'s with ${renderer.name} is not supported.`
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
setHeader(e, "Content-Type", `image/${options.extension === "svg" ? "svg+xml" : options.extension}`);
|
|
37
|
-
break;
|
|
38
|
-
default:
|
|
39
|
-
return createError({
|
|
40
|
-
statusCode: 400,
|
|
41
|
-
statusMessage: `Invalid request for og.${options.extension}.`
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
return renderer.createImage(e, options);
|
|
45
|
-
});
|
package/dist/runtime/utilts.d.ts
DELETED
package/dist/runtime/utilts.mjs
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { joinURL } from "ufo";
|
|
2
|
-
export function getOgImagePath(pagePath, extension = "png") {
|
|
3
|
-
return joinURL("/__og-image__/image", pagePath, `og.${extension}`);
|
|
4
|
-
}
|
|
5
|
-
export function isInternalRoute(path) {
|
|
6
|
-
const lastSegment = path.split("/").pop() || path;
|
|
7
|
-
return lastSegment.includes(".") || path.startsWith("/__") || path.startsWith("@");
|
|
8
|
-
}
|
|
File without changes
|
/package/dist/runtime/server/routes/__og-image__/{image-[path]-og.[extension].d.ts → image.d.ts}
RENAMED
|
File without changes
|