takumi-pdf 0.8.0 → 0.9.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.
@@ -0,0 +1,4 @@
1
+ const { join } = require("node:path");
2
+ const { pathToFileURL } = require("node:url");
3
+
4
+ module.exports = pathToFileURL(join(__dirname, "../pkg/takumi_pdf_wasm_bg.wasm"));
@@ -0,0 +1,3 @@
1
+ declare const url: URL;
2
+
3
+ export = url;
@@ -0,0 +1,3 @@
1
+ declare const url: URL;
2
+
3
+ export default url;
@@ -0,0 +1 @@
1
+ export default new URL("../pkg/takumi_pdf_wasm_bg.wasm", import.meta.url);
package/dist/export.cjs CHANGED
@@ -141,6 +141,12 @@ function __wbg_get_imports() {
141
141
  __wbg_Number_9a4e0ecb0fa16705: function(arg0) {
142
142
  return Number(getObject(arg0));
143
143
  },
144
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
145
+ const ptr1 = passStringToWasm0(String(getObject(arg1)), wasm.__wbindgen_export, wasm.__wbindgen_export2);
146
+ const len1 = WASM_VECTOR_LEN;
147
+ getDataViewMemory0().setInt32(arg0 + 4, len1, true);
148
+ getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
149
+ },
144
150
  __wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f: function(arg0, arg1) {
145
151
  const v = getObject(arg1);
146
152
  const ret = typeof v === "bigint" ? v : void 0;
package/dist/export.d.cts CHANGED
@@ -59,14 +59,22 @@ type ViewportInput = {
59
59
  width: number;
60
60
  height?: number;
61
61
  };
62
- /** A page size: a preset name (case-insensitive) or explicit {@link Dimensions}. */
63
- type PageSize = "a4" | "letter" | Dimensions;
64
- /** A page margin in CSS px: one number for all sides, or per-side values (missing sides are zero). */
65
- type PageMargin = number | {
66
- top?: number;
67
- right?: number;
68
- bottom?: number;
69
- left?: number;
62
+ /** A page keyword CSS Paged Media defines, matched case-insensitively. Portrait. */
63
+ type PageSizeName = "a3" | "a4" | "a5" | "b4" | "b5" | "jis-b4" | "jis-b5" | "ledger" | "legal" | "letter";
64
+ /** A page size: a preset name or explicit {@link Dimensions}. */
65
+ type PageSize = PageSizeName | Dimensions;
66
+ /**
67
+ * One side of a page margin: a length in CSS px, or `"auto"` to fit the band
68
+ * that draws on that side. `"auto"` never goes below the default 48, and the
69
+ * left and right sides hold no band, so they land on it.
70
+ */
71
+ type PageMarginSide = number | "auto";
72
+ /** A page margin: one value for all sides, or per-side values (missing sides are zero). */
73
+ type PageMargin = PageMarginSide | {
74
+ top?: PageMarginSide;
75
+ right?: PageMarginSide;
76
+ bottom?: PageMarginSide;
77
+ left?: PageMarginSide;
70
78
  };
71
79
  /**
72
80
  * Paged output (the default): content flows across pages of `size`, like
@@ -80,7 +88,7 @@ type PagedOptions = {
80
88
  size?: PageSize;
81
89
  /** Swaps the page's width and height, including explicit sizes. */
82
90
  landscape?: boolean;
83
- /** Page margin. Defaults to a uniform 48 (half an inch). */
91
+ /** Page margin. Defaults to `"auto"` on every side. */
84
92
  margin?: PageMargin;
85
93
  /**
86
94
  * Band repeated at the top of every page. Nodes with the `pageNumber` or
@@ -301,4 +309,4 @@ declare function render(node: NodeInput, options?: RenderOptions): Promise<Uint8
301
309
  /** Measures with a lazily created shared {@link PdfRenderer}. */
302
310
  declare function measure(node: NodeInput, options?: MeasureOptions): Promise<MeasuredSize>;
303
311
  //#endregion
304
- export { ArchivalAttachment, Attachment, Dimensions, type FontLoader, type ImagesInput, MeasureOptions, MeasuredSize, NodeInput, PageMargin, PageSize, PdfMetadata, PdfRenderer, RenderOptions, ViewportInput, XmpProperty, XmpSchema, __wbg_init as default, initSync, measure, render };
312
+ export { ArchivalAttachment, Attachment, Dimensions, type FontLoader, type ImagesInput, MeasureOptions, MeasuredSize, NodeInput, PageMargin, PageMarginSide, PageSize, PageSizeName, PdfMetadata, PdfRenderer, RenderOptions, ViewportInput, XmpProperty, XmpSchema, __wbg_init as default, initSync, measure, render };
package/dist/export.d.mts CHANGED
@@ -59,14 +59,22 @@ type ViewportInput = {
59
59
  width: number;
60
60
  height?: number;
61
61
  };
62
- /** A page size: a preset name (case-insensitive) or explicit {@link Dimensions}. */
63
- type PageSize = "a4" | "letter" | Dimensions;
64
- /** A page margin in CSS px: one number for all sides, or per-side values (missing sides are zero). */
65
- type PageMargin = number | {
66
- top?: number;
67
- right?: number;
68
- bottom?: number;
69
- left?: number;
62
+ /** A page keyword CSS Paged Media defines, matched case-insensitively. Portrait. */
63
+ type PageSizeName = "a3" | "a4" | "a5" | "b4" | "b5" | "jis-b4" | "jis-b5" | "ledger" | "legal" | "letter";
64
+ /** A page size: a preset name or explicit {@link Dimensions}. */
65
+ type PageSize = PageSizeName | Dimensions;
66
+ /**
67
+ * One side of a page margin: a length in CSS px, or `"auto"` to fit the band
68
+ * that draws on that side. `"auto"` never goes below the default 48, and the
69
+ * left and right sides hold no band, so they land on it.
70
+ */
71
+ type PageMarginSide = number | "auto";
72
+ /** A page margin: one value for all sides, or per-side values (missing sides are zero). */
73
+ type PageMargin = PageMarginSide | {
74
+ top?: PageMarginSide;
75
+ right?: PageMarginSide;
76
+ bottom?: PageMarginSide;
77
+ left?: PageMarginSide;
70
78
  };
71
79
  /**
72
80
  * Paged output (the default): content flows across pages of `size`, like
@@ -80,7 +88,7 @@ type PagedOptions = {
80
88
  size?: PageSize;
81
89
  /** Swaps the page's width and height, including explicit sizes. */
82
90
  landscape?: boolean;
83
- /** Page margin. Defaults to a uniform 48 (half an inch). */
91
+ /** Page margin. Defaults to `"auto"` on every side. */
84
92
  margin?: PageMargin;
85
93
  /**
86
94
  * Band repeated at the top of every page. Nodes with the `pageNumber` or
@@ -301,4 +309,4 @@ declare function render(node: NodeInput, options?: RenderOptions): Promise<Uint8
301
309
  /** Measures with a lazily created shared {@link PdfRenderer}. */
302
310
  declare function measure(node: NodeInput, options?: MeasureOptions): Promise<MeasuredSize>;
303
311
  //#endregion
304
- export { ArchivalAttachment, Attachment, Dimensions, type FontLoader, type ImagesInput, MeasureOptions, MeasuredSize, NodeInput, PageMargin, PageSize, PdfMetadata, PdfRenderer, RenderOptions, ViewportInput, XmpProperty, XmpSchema, __wbg_init as default, initSync, measure, render };
312
+ export { ArchivalAttachment, Attachment, Dimensions, type FontLoader, type ImagesInput, MeasureOptions, MeasuredSize, NodeInput, PageMargin, PageMarginSide, PageSize, PageSizeName, PdfMetadata, PdfRenderer, RenderOptions, ViewportInput, XmpProperty, XmpSchema, __wbg_init as default, initSync, measure, render };
package/dist/export.mjs CHANGED
@@ -137,6 +137,12 @@ function __wbg_get_imports() {
137
137
  __wbg_Number_9a4e0ecb0fa16705: function(arg0) {
138
138
  return Number(getObject(arg0));
139
139
  },
140
+ __wbg_String_8564e559799eccda: function(arg0, arg1) {
141
+ const ptr1 = passStringToWasm0(String(getObject(arg1)), wasm.__wbindgen_export, wasm.__wbindgen_export2);
142
+ const len1 = WASM_VECTOR_LEN;
143
+ getDataViewMemory0().setInt32(arg0 + 4, len1, true);
144
+ getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
145
+ },
140
146
  __wbg___wbindgen_bigint_get_as_i64_d968e41184ae354f: function(arg0, arg1) {
141
147
  const v = getObject(arg1);
142
148
  const ret = typeof v === "bigint" ? v : void 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "takumi-pdf",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Render paged PDFs from JSX, HTML, and CSS. No headless browser.",
5
5
  "keywords": [
6
6
  "chromium-free",
@@ -59,6 +59,22 @@
59
59
  "types": "./bundlers/node.d.ts",
60
60
  "default": "./bundlers/next.mjs"
61
61
  },
62
+ "webpack": {
63
+ "node": {
64
+ "require": {
65
+ "types": "./bundlers/node.d.cts",
66
+ "default": "./bundlers/node.cjs"
67
+ },
68
+ "default": {
69
+ "types": "./bundlers/node.d.ts",
70
+ "default": "./bundlers/node.mjs"
71
+ }
72
+ },
73
+ "default": {
74
+ "types": "./bundlers/node.d.ts",
75
+ "default": "./bundlers/vite.mjs"
76
+ }
77
+ },
62
78
  "module": {
63
79
  "types": "./bundlers/node.d.ts",
64
80
  "default": "./bundlers/vite.mjs"
@@ -78,6 +94,10 @@
78
94
  "default": "./bundlers/vite.mjs"
79
95
  }
80
96
  },
97
+ "./next": {
98
+ "types": "./bundlers/node.d.ts",
99
+ "default": "./bundlers/next.mjs"
100
+ },
81
101
  "./no-init": {
82
102
  "import": {
83
103
  "types": "./dist/export.d.mts",
@@ -91,6 +111,16 @@
91
111
  "./takumi_pdf_wasm_bg.wasm": {
92
112
  "types": "./pkg/takumi_pdf_wasm_bg.wasm.d.ts",
93
113
  "default": "./pkg/takumi_pdf_wasm_bg.wasm"
114
+ },
115
+ "./wasm-url": {
116
+ "import": {
117
+ "types": "./bundlers/wasm-url.d.ts",
118
+ "default": "./bundlers/wasm-url.mjs"
119
+ },
120
+ "require": {
121
+ "types": "./bundlers/wasm-url.d.cts",
122
+ "default": "./bundlers/wasm-url.cjs"
123
+ }
94
124
  }
95
125
  },
96
126
  "scripts": {
@@ -100,7 +130,7 @@
100
130
  "publish-lint": "attw --pack . && publint --strict ."
101
131
  },
102
132
  "dependencies": {
103
- "@takumi-rs/helpers": "2.8.0"
133
+ "@takumi-rs/helpers": "2.9.0"
104
134
  },
105
135
  "devDependencies": {
106
136
  "@types/bun": "^1.3.14",
Binary file