satori 0.35.2 → 0.37.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 +58 -18
- package/dist/experimental.cjs +6 -7
- package/dist/experimental.cjs.map +1 -1
- package/dist/experimental.d.cts +2 -2
- package/dist/experimental.d.ts +2 -2
- package/dist/experimental.js +6 -7
- package/dist/experimental.js.map +1 -1
- package/dist/index.cjs +6 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -7
- package/dist/index.js.map +1 -1
- package/dist/standalone.cjs +6 -7
- package/dist/standalone.cjs.map +1 -1
- package/dist/standalone.d.cts +13 -4
- package/dist/standalone.d.ts +13 -4
- package/dist/standalone.js +6 -7
- package/dist/standalone.js.map +1 -1
- package/dist/{satori-dd73c891.d.ts → wasm-3bdd7431.d.ts} +13 -4
- package/layout.wasm +0 -0
- package/package.json +5 -5
- package/yoga.wasm +0 -0
|
@@ -133,10 +133,6 @@ interface TwConfig {
|
|
|
133
133
|
}>;
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
type InitInput = string | Request | URL | Response | BufferSource | Buffer | WebAssembly.Module | Promise<Response | BufferSource | Buffer | WebAssembly.Module>;
|
|
137
|
-
|
|
138
|
-
declare function init(input: InitInput): Promise<void>;
|
|
139
|
-
|
|
140
136
|
/**
|
|
141
137
|
* This module is used to calculate the layout of the current sub-tree.
|
|
142
138
|
*/
|
|
@@ -172,4 +168,17 @@ type SatoriOptions = ({
|
|
|
172
168
|
|
|
173
169
|
declare const satori: (element: ReactNode, options: SatoriOptions) => Promise<string>;
|
|
174
170
|
|
|
171
|
+
/**
|
|
172
|
+
* Loads the layout engine from a WebAssembly module provided by the user, for
|
|
173
|
+
* `satori/standalone`.
|
|
174
|
+
*/
|
|
175
|
+
|
|
176
|
+
type InitInput = string | Request | URL | Response | BufferSource | Buffer | WebAssembly.Module | Promise<Response | BufferSource | Buffer | WebAssembly.Module>;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Initializes `satori/standalone` with the `layout.wasm` module. The default
|
|
180
|
+
* build bundles it.
|
|
181
|
+
*/
|
|
182
|
+
declare function init(input: InitInput): Promise<void>;
|
|
183
|
+
|
|
175
184
|
export { FontOptions as F, Locale as L, SatoriOptions as S, Weight as W, FontStyle as a, SatoriNode as b, init as i, satori as s };
|
package/layout.wasm
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "satori",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "Enlightened library to convert HTML and CSS to SVG.",
|
|
5
5
|
"module": "./dist/index.js",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"license": "MPL-2.0",
|
|
17
17
|
"files": [
|
|
18
18
|
"dist/**",
|
|
19
|
-
"
|
|
19
|
+
"layout.wasm"
|
|
20
20
|
],
|
|
21
21
|
"imports": {
|
|
22
22
|
"#satori/jsx/jsx-runtime": "./src/jsx/jsx-runtime.ts",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"exports": {
|
|
26
26
|
"./package.json": "./package.json",
|
|
27
|
-
"./
|
|
27
|
+
"./layout.wasm": "./layout.wasm",
|
|
28
28
|
".": {
|
|
29
29
|
"import": "./dist/index.js",
|
|
30
30
|
"require": "./dist/index.cjs"
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"dev": "pnpm run dev:default",
|
|
71
71
|
"dev:default": "NODE_ENV=development tsup src/index.ts --watch --ignore-watch playground",
|
|
72
72
|
"dev:playground": "turbo dev --filter=satori-playground...",
|
|
73
|
+
"build:wasm": "node scripts/build-layout-wasm.mjs",
|
|
73
74
|
"build": "pnpm run build:default && pnpm run build:standalone && pnpm run test:browser-build",
|
|
74
75
|
"build:default": "NODE_ENV=production tsup",
|
|
75
76
|
"build:standalone": "NODE_ENV=production SATORI_STANDALONE=1 tsup",
|
|
@@ -146,8 +147,7 @@
|
|
|
146
147
|
"harfbuzzjs": "0.10.0",
|
|
147
148
|
"linebreak": "^1.1.0",
|
|
148
149
|
"parse-css-color": "^0.2.1",
|
|
149
|
-
"postcss-value-parser": "^4.2.0"
|
|
150
|
-
"yoga-layout": "^3.2.1"
|
|
150
|
+
"postcss-value-parser": "^4.2.0"
|
|
151
151
|
},
|
|
152
152
|
"packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319",
|
|
153
153
|
"engines": {
|
package/yoga.wasm
DELETED
|
Binary file
|