takumi-pdf 0.11.0 → 0.11.2
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 +5 -2
- package/dist/export.d.cts +0 -5
- package/dist/export.d.mts +0 -5
- package/dist/primitives.d.cts +5 -0
- package/dist/primitives.d.mts +5 -0
- package/package.json +2 -2
- package/pkg/takumi_pdf_wasm_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -30,7 +30,8 @@ bun add takumi-pdf
|
|
|
30
30
|
```tsx
|
|
31
31
|
import { writeFile } from "node:fs/promises";
|
|
32
32
|
import { googleFonts } from "@takumi-rs/helpers";
|
|
33
|
-
import {
|
|
33
|
+
import { render } from "takumi-pdf";
|
|
34
|
+
import { PageNumber, TotalPages } from "takumi-pdf/primitives";
|
|
34
35
|
|
|
35
36
|
const pdf = await render(
|
|
36
37
|
<main tw="flex flex-col gap-4">
|
|
@@ -77,7 +78,8 @@ const pdf = await render(report, {
|
|
|
77
78
|
Headers and footers repeat on every page. `<PageNumber />` and `<TotalPages />` place the counters; the `format` prop picks a CSS counter style.
|
|
78
79
|
|
|
79
80
|
```tsx
|
|
80
|
-
import {
|
|
81
|
+
import { render } from "takumi-pdf";
|
|
82
|
+
import { PageNumber, TotalPages } from "takumi-pdf/primitives";
|
|
81
83
|
|
|
82
84
|
const pdf = await render(report, {
|
|
83
85
|
footer: (
|
|
@@ -123,6 +125,7 @@ Pass a font URL, font bytes, or the `googleFonts` helper. Registered fonts are d
|
|
|
123
125
|
|
|
124
126
|
```tsx
|
|
125
127
|
import { googleFonts } from "@takumi-rs/helpers";
|
|
128
|
+
import { render } from "takumi-pdf";
|
|
126
129
|
|
|
127
130
|
const pdf = await render(doc, {
|
|
128
131
|
fonts: [...(await googleFonts(["Inter"])), { name: "Brand Sans", weight: 700, data: fontBytes }],
|
package/dist/export.d.cts
CHANGED
|
@@ -43,11 +43,6 @@ declare function __wbg_init(module_or_path?: {
|
|
|
43
43
|
} | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region src/export.d.ts
|
|
46
|
-
declare module "react" {
|
|
47
|
-
interface DOMAttributes<T> {
|
|
48
|
-
tw?: string;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
46
|
/** A document input: a takumi node tree, JSX, or an HTML string. */
|
|
52
47
|
type NodeInput = Node | ReactNode | ReactElementLike | string;
|
|
53
48
|
/** Explicit dimensions in CSS px (96 dpi). */
|
package/dist/export.d.mts
CHANGED
|
@@ -43,11 +43,6 @@ declare function __wbg_init(module_or_path?: {
|
|
|
43
43
|
} | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
44
44
|
//#endregion
|
|
45
45
|
//#region src/export.d.ts
|
|
46
|
-
declare module "react" {
|
|
47
|
-
interface DOMAttributes<T> {
|
|
48
|
-
tw?: string;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
46
|
/** A document input: a takumi node tree, JSX, or an HTML string. */
|
|
52
47
|
type NodeInput = Node | ReactNode | ReactElementLike | string;
|
|
53
48
|
/** Explicit dimensions in CSS px (96 dpi). */
|
package/dist/primitives.d.cts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { CSSProperties, ReactElement } from "react";
|
|
2
2
|
//#region src/primitives.d.ts
|
|
3
|
+
declare module "react" {
|
|
4
|
+
interface DOMAttributes<T> {
|
|
5
|
+
tw?: string;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
3
8
|
/**
|
|
4
9
|
* A `@counter-style` name the page counters can format in, matching the set
|
|
5
10
|
* the renderer's `@counter-style` substitution knows.
|
package/dist/primitives.d.mts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { CSSProperties, ReactElement } from "react";
|
|
2
2
|
//#region src/primitives.d.ts
|
|
3
|
+
declare module "react" {
|
|
4
|
+
interface DOMAttributes<T> {
|
|
5
|
+
tw?: string;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
3
8
|
/**
|
|
4
9
|
* A `@counter-style` name the page counters can format in, matching the set
|
|
5
10
|
* the renderer's `@counter-style` substitution knows.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "takumi-pdf",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
4
4
|
"description": "Render paged PDFs from JSX, HTML, and CSS. No headless browser.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"chromium-free",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"publish-lint": "attw --pack . && publint --strict ."
|
|
140
140
|
},
|
|
141
141
|
"dependencies": {
|
|
142
|
-
"@takumi-rs/helpers": "2.
|
|
142
|
+
"@takumi-rs/helpers": "2.11.0"
|
|
143
143
|
},
|
|
144
144
|
"devDependencies": {
|
|
145
145
|
"@types/bun": "^1.3.14",
|
|
Binary file
|