satoru-render 0.0.12 → 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/dist/jsx.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import h from "vhtml";
2
+ export { h };
package/dist/jsx.js ADDED
@@ -0,0 +1,2 @@
1
+ import h from "vhtml";
2
+ export { h };
@@ -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
+ }
Binary file
package/dist/satoru.wasm CHANGED
Binary file
@@ -0,0 +1 @@
1
+ export declare const createCSS: (html: string) => Promise<string>;
@@ -0,0 +1,6 @@
1
+ import { createGenerator } from "@unocss/core";
2
+ import presetUno from "@unocss/preset-wind4";
3
+ export const createCSS = async (html) => {
4
+ const uno = await createGenerator({ presets: [presetUno()] });
5
+ return uno.generate(html).then((v) => v.css);
6
+ };