@vercel/og 0.5.19 → 0.6.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/dist/figma/index.d.ts +7 -0
- package/dist/index.edge.d.ts +2 -1
- package/dist/index.edge.js +196 -2
- package/dist/index.edge.js.map +1 -1
- package/dist/index.edge.types.d.ts +2 -0
- package/dist/index.node.d.ts +2 -1
- package/dist/index.node.js +195 -1
- package/dist/index.node.js.map +1 -1
- package/dist/index.node.types.d.ts +2 -0
- package/dist/resvg.wasm +0 -0
- package/dist/types.d.ts +53 -0
- package/package.json +2 -2
package/dist/resvg.wasm
CHANGED
|
Binary file
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
+
/// <reference types="react" />
|
|
3
|
+
/// <reference types="node" />
|
|
2
4
|
import type { SatoriOptions } from 'satori';
|
|
3
5
|
import type { EmojiType } from './emoji';
|
|
4
6
|
import type { OutgoingHttpHeader } from 'http';
|
|
@@ -46,6 +48,57 @@ export declare type ImageResponseNodeOptions = ImageOptions & {
|
|
|
46
48
|
headers?: OutgoingHttpHeader[];
|
|
47
49
|
};
|
|
48
50
|
export declare type ImageResponseOptions = ImageOptions & ConstructorParameters<typeof Response>[1];
|
|
51
|
+
export interface FigmaImageResponseProps {
|
|
52
|
+
/**
|
|
53
|
+
* Link to the Figma template frame.
|
|
54
|
+
*
|
|
55
|
+
* You can get the URL in Figma by right-clicking a frame and selecting "Copy link".
|
|
56
|
+
* @example https://www.figma.com/file/QjGNQixWnhu300e1Xzdl2y/OG-Images?type=design&node-id=11356-2443&mode=design&t=yLROd7ro8mP1PxMY-4
|
|
57
|
+
*/
|
|
58
|
+
url: string;
|
|
59
|
+
/**
|
|
60
|
+
* A mapping between Figma layer name and the value you want to replace it with.
|
|
61
|
+
*
|
|
62
|
+
* @example Sets Figma text layer named "Title" to "How to create OG Images"
|
|
63
|
+
* ```js
|
|
64
|
+
* { "Title": "How to create OG Images" }
|
|
65
|
+
* ```
|
|
66
|
+
*
|
|
67
|
+
* @example Sets multiple Figma text layers and provides custom styles
|
|
68
|
+
* ```js
|
|
69
|
+
* {
|
|
70
|
+
* "Title": { value: "How to create OG Images", props: { color: "red", centerHorizontally: true } },
|
|
71
|
+
* "Description": { value: "A short story", props: { centerHorizontally: true } },
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* `centerHorizontally` centers text layer horizontally.
|
|
76
|
+
*/
|
|
77
|
+
template: Record<string, FigmaComplexTemplate | string>;
|
|
78
|
+
/**
|
|
79
|
+
* The font names must match the font names in Figma.
|
|
80
|
+
*/
|
|
81
|
+
fonts?: FontOptions[];
|
|
82
|
+
/**
|
|
83
|
+
* The same as {@link ImageResponseOptions} except `width` and `height`. `width` and `height` are automatically set from the Figma frame's size.
|
|
84
|
+
*/
|
|
85
|
+
imageResponseOptions?: Omit<ImageResponseOptions, 'width' | 'height'>;
|
|
86
|
+
}
|
|
87
|
+
export interface FigmaComplexTemplate {
|
|
88
|
+
value: string;
|
|
89
|
+
props?: {
|
|
90
|
+
centerHorizontally?: boolean;
|
|
91
|
+
} & React.CSSProperties;
|
|
92
|
+
}
|
|
93
|
+
declare type Weight = 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
94
|
+
declare type Style = 'normal' | 'italic';
|
|
95
|
+
interface FontOptions {
|
|
96
|
+
data: Buffer | ArrayBuffer;
|
|
97
|
+
name: string;
|
|
98
|
+
weight?: Weight;
|
|
99
|
+
style?: Style;
|
|
100
|
+
lang?: string;
|
|
101
|
+
}
|
|
49
102
|
declare module 'react' {
|
|
50
103
|
interface HTMLAttributes<T> {
|
|
51
104
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/og",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Generate Open Graph Images dynamically from HTML/CSS without a browser",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.node.js",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
],
|
|
59
59
|
"license": "MPL-2.0",
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@resvg/resvg-wasm": "2.
|
|
61
|
+
"@resvg/resvg-wasm": "2.6.0",
|
|
62
62
|
"satori": "0.10.9",
|
|
63
63
|
"yoga-wasm-web": "0.3.3"
|
|
64
64
|
},
|