nuxt-og-image 2.0.0-beta.9 → 2.0.0
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 +18 -517
- package/dist/client/200.html +2 -2
- package/dist/client/404.html +2 -2
- package/dist/client/_nuxt/IconCSS.48ffa50d.js +1 -0
- package/dist/client/_nuxt/IconCSS.b41b9663.css +1 -0
- package/dist/client/_nuxt/ImageLoader.51157bac.js +1 -0
- package/dist/client/_nuxt/ImageLoader.7571516f.css +1 -0
- package/dist/client/_nuxt/entry.1311cc29.css +1 -0
- package/dist/client/_nuxt/entry.74c20cae.js +143 -0
- package/dist/client/_nuxt/{error-404.02537f9e.js → error-404.102f7671.js} +1 -1
- package/dist/client/_nuxt/error-404.f3dd5020.css +1 -0
- package/dist/client/_nuxt/error-500.06915589.css +1 -0
- package/dist/client/_nuxt/{error-500.a60bf0b5.js → error-500.f8617a9a.js} +1 -1
- package/dist/client/_nuxt/index.212ef337.js +1 -0
- package/dist/client/_nuxt/index.ffbea0a9.css +1 -0
- package/dist/client/_nuxt/options.fa4f11fe.js +1 -0
- package/dist/client/_nuxt/png.eb47fcca.js +1 -0
- package/dist/client/_nuxt/{shiki.aace8ca2.js → shiki.b89869e1.js} +1 -1
- package/dist/client/_nuxt/svg.04901249.js +1 -0
- package/dist/client/_nuxt/vnodes.b05f3d68.js +1 -0
- package/dist/client/index.html +2 -2
- package/dist/client/options/index.html +2 -2
- package/dist/client/png/index.html +2 -2
- package/dist/client/svg/index.html +2 -2
- package/dist/client/vnodes/index.html +2 -2
- package/dist/module.d.ts +101 -11
- package/dist/module.json +2 -2
- package/dist/module.mjs +375 -115
- package/dist/runtime/browserUtil.d.ts +1 -0
- package/dist/runtime/browserUtil.mjs +7 -5
- package/dist/runtime/components/{OgImageDynamic.d.ts → OgImage/Cached.d.ts} +2 -2
- package/dist/runtime/components/OgImage/Cached.mjs +10 -0
- package/dist/runtime/components/OgImage/Dynamic.d.ts +8 -0
- package/dist/runtime/components/{OgImageDynamic.mjs → OgImage/Dynamic.mjs} +3 -3
- package/dist/runtime/components/{OgImageScreenshot.d.ts → OgImage/Screenshot.d.ts} +2 -2
- package/dist/runtime/components/{OgImageScreenshot.mjs → OgImage/Screenshot.mjs} +2 -2
- package/dist/runtime/components/OgImage/Static.d.ts +8 -0
- package/dist/runtime/components/{OgImageStatic.mjs → OgImage/Static.mjs} +3 -3
- package/dist/runtime/components/{OgImageStatic.d.ts → OgImage/WithoutCache.d.ts} +2 -2
- package/dist/runtime/components/OgImage/WithoutCache.mjs +10 -0
- package/dist/runtime/components/OgImage/index.d.ts +5 -0
- package/dist/runtime/components/OgImage/index.mjs +10 -0
- package/dist/runtime/components/OgImageTemplate/Fallback.vue +156 -0
- package/dist/runtime/composables/defineOgImage.d.ts +12 -4
- package/dist/runtime/composables/defineOgImage.mjs +31 -49
- package/dist/runtime/composables/util.d.ts +2 -0
- package/dist/runtime/composables/util.mjs +26 -0
- package/dist/runtime/nitro/middleware/og.png.mjs +54 -8
- package/dist/runtime/nitro/plugins/prerender.d.ts +3 -0
- package/dist/runtime/nitro/plugins/prerender.mjs +28 -0
- package/dist/runtime/nitro/providers/browser/lambda.d.ts +1 -1
- package/dist/runtime/nitro/providers/browser/lambda.mjs +3 -3
- package/dist/runtime/nitro/providers/browser/{node.mjs → playwright.mjs} +0 -9
- package/dist/runtime/nitro/providers/browser/universal.d.ts +1 -0
- package/dist/runtime/nitro/providers/browser/universal.mjs +33 -0
- package/dist/runtime/nitro/providers/png/resvg-node.d.ts +4 -0
- package/dist/runtime/nitro/providers/png/resvg-node.mjs +6 -0
- package/dist/runtime/nitro/providers/png/resvg-wasm.d.ts +3 -0
- package/dist/runtime/nitro/providers/png/resvg-wasm.mjs +11 -0
- package/dist/runtime/nitro/providers/{svg2png/universal.d.ts → png/svg2png.d.ts} +2 -3
- package/dist/runtime/nitro/providers/png/svg2png.mjs +11 -0
- package/dist/runtime/nitro/providers/satori/{webworker.d.ts → yoga-wasm.d.ts} +2 -3
- package/dist/runtime/nitro/providers/satori/{webworker.mjs → yoga-wasm.mjs} +4 -5
- package/dist/runtime/nitro/renderers/browser.d.ts +2 -2
- package/dist/runtime/nitro/renderers/browser.mjs +14 -12
- package/dist/runtime/nitro/renderers/satori/index.d.ts +2 -2
- package/dist/runtime/nitro/renderers/satori/index.mjs +27 -32
- package/dist/runtime/nitro/renderers/satori/plugins/emojis.d.ts +1 -1
- package/dist/runtime/nitro/renderers/satori/plugins/emojis.mjs +19 -6
- package/dist/runtime/nitro/renderers/satori/plugins/encoding.d.ts +1 -1
- package/dist/runtime/nitro/renderers/satori/plugins/encoding.mjs +5 -7
- package/dist/runtime/nitro/renderers/satori/plugins/flex.d.ts +1 -1
- package/dist/runtime/nitro/renderers/satori/plugins/flex.mjs +8 -10
- package/dist/runtime/nitro/renderers/satori/plugins/imageSrc.d.ts +1 -1
- package/dist/runtime/nitro/renderers/satori/plugins/imageSrc.mjs +45 -13
- package/dist/runtime/nitro/renderers/satori/plugins/twClasses.d.ts +1 -1
- package/dist/runtime/nitro/renderers/satori/plugins/twClasses.mjs +5 -7
- package/dist/runtime/nitro/renderers/satori/utils.d.ts +4 -5
- package/dist/runtime/nitro/renderers/satori/utils.mjs +28 -17
- package/dist/runtime/nitro/routes/debug.d.ts +8 -0
- package/dist/runtime/nitro/routes/debug.mjs +14 -0
- package/dist/runtime/nitro/routes/font.mjs +2 -2
- package/dist/runtime/nitro/routes/html.mjs +100 -26
- package/dist/runtime/nitro/routes/options.d.ts +2 -2
- package/dist/runtime/nitro/routes/options.mjs +21 -20
- package/dist/runtime/nitro/routes/svg.mjs +2 -2
- package/dist/runtime/nitro/routes/vnode.mjs +2 -2
- package/dist/runtime/nitro/utils-pure.d.ts +0 -1
- package/dist/runtime/nitro/utils-pure.mjs +1 -4
- package/dist/runtime/nitro/utils.d.ts +11 -11
- package/dist/runtime/nitro/utils.mjs +67 -53
- package/dist/runtime/public-assets/__nuxt_og_image__/browser-provider-not-supported.png +0 -0
- package/dist/runtime/public-assets-optional/resvg/resvg.wasm +0 -0
- package/dist/types.d.ts +6 -0
- package/package.json +38 -27
- package/dist/client/_nuxt/IconCSS.ef0613e7.js +0 -1
- package/dist/client/_nuxt/ImageLoader.a4418cab.js +0 -1
- package/dist/client/_nuxt/entry.09f25aaf.css +0 -1
- package/dist/client/_nuxt/entry.fc9150b0.js +0 -5
- package/dist/client/_nuxt/error-404.1469f10f.css +0 -1
- package/dist/client/_nuxt/error-500.92b94fae.css +0 -1
- package/dist/client/_nuxt/error-component.8148b615.js +0 -3
- package/dist/client/_nuxt/index.80f38ec7.js +0 -1
- package/dist/client/_nuxt/options.cc3fd02b.js +0 -1
- package/dist/client/_nuxt/png.62758167.js +0 -1
- package/dist/client/_nuxt/svg.853cdaad.js +0 -1
- package/dist/client/_nuxt/vnodes.69b24963.js +0 -1
- package/dist/runtime/components/OgImageBasic.island.vue +0 -92
- package/dist/runtime/nitro/providers/svg2png/universal.mjs +0 -9
- /package/dist/runtime/nitro/providers/browser/{node.d.ts → playwright.d.ts} +0 -0
- /package/dist/runtime/nitro/providers/satori/{node.d.ts → default.d.ts} +0 -0
- /package/dist/runtime/nitro/providers/satori/{node.mjs → default.mjs} +0 -0
- /package/dist/runtime/{public-assets → public-assets-optional/inter-font}/inter-latin-ext-400-normal.woff +0 -0
- /package/dist/runtime/{public-assets → public-assets-optional/inter-font}/inter-latin-ext-700-normal.woff +0 -0
- /package/dist/runtime/{public-assets → public-assets-optional/svg2png}/svg2png.wasm +0 -0
- /package/dist/runtime/{public-assets → public-assets-optional/yoga}/yoga.wasm +0 -0
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { computed } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = defineProps({
|
|
5
|
-
path: String,
|
|
6
|
-
title: {
|
|
7
|
-
type: String,
|
|
8
|
-
default: 'Og Image Template',
|
|
9
|
-
},
|
|
10
|
-
description: {
|
|
11
|
-
type: String,
|
|
12
|
-
default: 'Set a description to change me.',
|
|
13
|
-
},
|
|
14
|
-
background: {
|
|
15
|
-
type: String,
|
|
16
|
-
default: 'linear-gradient(to bottom, #dbf4ff, #fff1f1)',
|
|
17
|
-
},
|
|
18
|
-
color: {
|
|
19
|
-
type: String,
|
|
20
|
-
},
|
|
21
|
-
padding: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: '0 100px',
|
|
24
|
-
},
|
|
25
|
-
titleFontSize: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: '60px',
|
|
28
|
-
},
|
|
29
|
-
descriptionFontSize: {
|
|
30
|
-
type: String,
|
|
31
|
-
default: '26px',
|
|
32
|
-
},
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
const containerAttrs = computed(() => {
|
|
36
|
-
const isBackgroundTw = props.background?.startsWith('bg-')
|
|
37
|
-
const isColorTw = props.color?.startsWith('text-')
|
|
38
|
-
|
|
39
|
-
const classes = [
|
|
40
|
-
'w-full',
|
|
41
|
-
'h-full',
|
|
42
|
-
'flex',
|
|
43
|
-
'items-center',
|
|
44
|
-
'justify-center',
|
|
45
|
-
]
|
|
46
|
-
const styles: Record<string, any> = {
|
|
47
|
-
padding: props.padding,
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
if (isBackgroundTw)
|
|
51
|
-
classes.push(props.background)
|
|
52
|
-
else if (props.background)
|
|
53
|
-
styles.background = props.background
|
|
54
|
-
|
|
55
|
-
if (isColorTw)
|
|
56
|
-
classes.push(props.color)
|
|
57
|
-
else
|
|
58
|
-
styles.color = props.color
|
|
59
|
-
return { class: classes, style: styles }
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
const titleAttrs = computed(() => {
|
|
63
|
-
const classes = []
|
|
64
|
-
const styles = {
|
|
65
|
-
fontWeight: 'bold',
|
|
66
|
-
marginBottom: '20px',
|
|
67
|
-
fontSize: props.titleFontSize,
|
|
68
|
-
}
|
|
69
|
-
return { class: classes, style: styles }
|
|
70
|
-
})
|
|
71
|
-
|
|
72
|
-
const descriptionAttrs = computed(() => {
|
|
73
|
-
const classes = []
|
|
74
|
-
const styles = {
|
|
75
|
-
fontSize: props.descriptionFontSize,
|
|
76
|
-
}
|
|
77
|
-
return { class: classes, style: styles }
|
|
78
|
-
})
|
|
79
|
-
</script>
|
|
80
|
-
|
|
81
|
-
<template>
|
|
82
|
-
<div v-bind="containerAttrs">
|
|
83
|
-
<div class="flex flex-col w-full">
|
|
84
|
-
<div v-bind="titleAttrs">
|
|
85
|
-
{{ title || 'Null Title' }}
|
|
86
|
-
</div>
|
|
87
|
-
<div v-if="description" v-bind="descriptionAttrs">
|
|
88
|
-
{{ description }}
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
</template>
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { initialize, svg2png } from "svg2png-wasm";
|
|
2
|
-
import { wasmLoader } from "../../utils.mjs";
|
|
3
|
-
export default async function(svg, options) {
|
|
4
|
-
const loader = wasmLoader("/* NUXT_OG_IMAGE_SVG2PNG_WASM */", "/svg2png.wasm", options.baseUrl);
|
|
5
|
-
if (!await loader.loaded())
|
|
6
|
-
await initialize(await loader.load()).catch(() => {
|
|
7
|
-
});
|
|
8
|
-
return await svg2png(svg, options);
|
|
9
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|