satoru-render 0.0.11 → 0.0.13
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 +9 -0
- package/dist/core.js +2 -0
- package/dist/jsx.d.ts +2 -0
- package/dist/jsx.js +2 -0
- package/dist/preact.d.ts +10 -0
- package/dist/preact.js +13 -0
- package/dist/satoru-single.js +0 -0
- package/dist/satoru.wasm +0 -0
- package/dist/tailwind.d.ts +1 -0
- package/dist/tailwind.js +6 -0
- package/dist/web-workers.js +4 -2
- package/package.json +34 -4
package/README.md
CHANGED
|
@@ -12,6 +12,15 @@ By combining the **Skia** graphics engine with a custom **litehtml** layout core
|
|
|
12
12
|
|
|
13
13
|

|
|
14
14
|
|
|
15
|
+
## Example
|
|
16
|
+
|
|
17
|
+
- Cloudflare Workers
|
|
18
|
+
https://github.com/SoraKumo001/satoru-cloudflare-ogp
|
|
19
|
+
- Deno Deploy
|
|
20
|
+
https://github.com/SoraKumo001/satoru-deno-ogp-image
|
|
21
|
+
- Next.js(Vercel)
|
|
22
|
+
https://github.com/SoraKumo001/next-satoru
|
|
23
|
+
|
|
15
24
|
---
|
|
16
25
|
|
|
17
26
|
## ✨ Key Features
|
package/dist/core.js
CHANGED
|
@@ -5,6 +5,8 @@ export const DEFAULT_FONT_MAP = {
|
|
|
5
5
|
monospace: "https://cdn.jsdelivr.net/npm/@fontsource/m-plus-1-code/files/m-plus-1-code-japanese-400-normal.woff2",
|
|
6
6
|
cursive: "https://cdn.jsdelivr.net/npm/@fontsource/yuji-syuku/files/yuji-syuku-japanese-400-normal.woff2",
|
|
7
7
|
fantasy: "https://cdn.jsdelivr.net/npm/@fontsource/reggae-one/files/reggae-one-japanese-400-normal.woff2",
|
|
8
|
+
emoji: "https://cdn.jsdelivr.net/npm/@fontsource/noto-color-emoji/files/noto-color-emoji-emoji-400-normal.woff2",
|
|
9
|
+
"Noto Color Emoji": "https://cdn.jsdelivr.net/npm/@fontsource/noto-color-emoji/files/noto-color-emoji-emoji-400-normal.woff2",
|
|
8
10
|
};
|
|
9
11
|
export async function resolveGoogleFonts(resource, userAgent) {
|
|
10
12
|
if (!resource.url.startsWith("provider:google-fonts"))
|
package/dist/jsx.d.ts
ADDED
package/dist/jsx.js
ADDED
package/dist/preact.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { h, type VNode } from "preact";
|
|
2
|
+
export { h };
|
|
3
|
+
/**
|
|
4
|
+
* Converts a React element to a static HTML string.
|
|
5
|
+
* This is a thin wrapper around react-dom/server's renderToStaticMarkup.
|
|
6
|
+
*
|
|
7
|
+
* @param element - The React element to convert.
|
|
8
|
+
* @returns The resulting HTML string.
|
|
9
|
+
*/
|
|
10
|
+
export declare function toHtml(element: VNode): string;
|
package/dist/preact.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { h } from "preact";
|
|
2
|
+
import render from "preact-render-to-string";
|
|
3
|
+
export { h };
|
|
4
|
+
/**
|
|
5
|
+
* Converts a React element to a static HTML string.
|
|
6
|
+
* This is a thin wrapper around react-dom/server's renderToStaticMarkup.
|
|
7
|
+
*
|
|
8
|
+
* @param element - The React element to convert.
|
|
9
|
+
* @returns The resulting HTML string.
|
|
10
|
+
*/
|
|
11
|
+
export function toHtml(element) {
|
|
12
|
+
return render(element);
|
|
13
|
+
}
|
package/dist/satoru-single.js
CHANGED
|
Binary file
|
package/dist/satoru.wasm
CHANGED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createCSS: (html: string) => Promise<string>;
|
package/dist/tailwind.js
ADDED