@jsonpdf/renderer 0.1.0-alpha.1 → 0.1.0-alpha.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jsonpdf/renderer",
3
- "version": "0.1.0-alpha.1",
3
+ "version": "0.1.0-alpha.3",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -18,9 +18,9 @@
18
18
  "@pdf-lib/fontkit": "^1.1.1",
19
19
  "liquidjs": "^10.24.0",
20
20
  "pdf-lib": "^1.17.1",
21
- "@jsonpdf/core": "0.1.0-alpha.1",
22
- "@jsonpdf/template": "0.1.0-alpha.1",
23
- "@jsonpdf/plugins": "0.1.0-alpha.1"
21
+ "@jsonpdf/core": "0.1.0-alpha.3",
22
+ "@jsonpdf/plugins": "0.1.0-alpha.3",
23
+ "@jsonpdf/template": "0.1.0-alpha.3"
24
24
  },
25
25
  "scripts": {
26
26
  "build": "tsc --build",
@@ -1,8 +0,0 @@
1
- /**
2
- * Load font bytes from a source path or URL.
3
- *
4
- * - HTTP/HTTPS URLs are fetched via fetch() with a 30s timeout
5
- * - file:// URLs and local paths are handled by the platform-specific readFileBytes
6
- */
7
- export declare function loadFontBytes(src: string): Promise<Uint8Array>;
8
- //# sourceMappingURL=font-loader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"font-loader.d.ts","sourceRoot":"","sources":["../src/font-loader.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,wBAAsB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAkBpE"}
@@ -1,29 +0,0 @@
1
- import { readFileBytes } from '@jsonpdf/plugins';
2
- /** Default fetch timeout in milliseconds (30 seconds). */
3
- const FETCH_TIMEOUT_MS = 30_000;
4
- /**
5
- * Load font bytes from a source path or URL.
6
- *
7
- * - HTTP/HTTPS URLs are fetched via fetch() with a 30s timeout
8
- * - file:// URLs and local paths are handled by the platform-specific readFileBytes
9
- */
10
- export async function loadFontBytes(src) {
11
- if (src.startsWith('http://') || src.startsWith('https://')) {
12
- const controller = new AbortController();
13
- const timeoutId = setTimeout(() => {
14
- controller.abort();
15
- }, FETCH_TIMEOUT_MS);
16
- try {
17
- const response = await fetch(src, { signal: controller.signal });
18
- if (!response.ok) {
19
- throw new Error(`Failed to fetch font: ${String(response.status)} ${response.statusText}`);
20
- }
21
- return new Uint8Array(await response.arrayBuffer());
22
- }
23
- finally {
24
- clearTimeout(timeoutId);
25
- }
26
- }
27
- return readFileBytes(src);
28
- }
29
- //# sourceMappingURL=font-loader.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"font-loader.js","sourceRoot":"","sources":["../src/font-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,0DAA0D;AAC1D,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAEhC;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,GAAW;IAC7C,IAAI,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;QAC5D,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,MAAM,SAAS,GAAG,UAAU,CAAC,GAAG,EAAE;YAChC,UAAU,CAAC,KAAK,EAAE,CAAC;QACrB,CAAC,EAAE,gBAAgB,CAAC,CAAC;QACrB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC,CAAC;YACjE,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;gBACjB,MAAM,IAAI,KAAK,CAAC,yBAAyB,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;YAC7F,CAAC;YACD,OAAO,IAAI,UAAU,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;QACtD,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,SAAS,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC;AAC5B,CAAC"}