@drvillo/react-browser-e-signing 0.1.2 → 0.2.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 @@
1
+ export declare function getPdfWorkerSrc(): string
@@ -0,0 +1,3 @@
1
+ export function getPdfWorkerSrc() {
2
+ return new URL('./pdf.worker.min.mjs', import.meta.url).href
3
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drvillo/react-browser-e-signing",
3
- "version": "0.1.2",
3
+ "version": "0.2.0",
4
4
  "description": "React PDF e-signing in the browser — fields, handwriting, pdf-lib",
5
5
  "repository": {
6
6
  "type": "git",
@@ -19,7 +19,12 @@
19
19
  "import": "./dist/index.js",
20
20
  "types": "./dist/index.d.ts"
21
21
  },
22
- "./styles.css": "./dist/styles.css"
22
+ "./styles.css": "./dist/styles.css",
23
+ "./worker": {
24
+ "import": "./dist/worker.mjs",
25
+ "types": "./dist/worker.d.mts"
26
+ },
27
+ "./pdf.worker.min.mjs": "./dist/pdf.worker.min.mjs"
23
28
  },
24
29
  "files": [
25
30
  "dist"
@@ -27,15 +32,16 @@
27
32
  "scripts": {
28
33
  "postinstall": "pnpm run install:browsers",
29
34
  "install:browsers": "playwright install chromium",
30
- "build": "tsup",
35
+ "build": "tsup && node scripts/copy-dist-assets.mjs",
31
36
  "dev": "tsup --watch",
32
- "demo": "vite",
33
- "demo:build": "vite build",
37
+ "demo": "node scripts/sync-worker-to-dev.mjs && vite",
38
+ "demo:build": "node scripts/sync-worker-to-dev.mjs && vite build",
34
39
  "test": "pnpm run test:unit && pnpm run test:browser",
35
40
  "test:unit": "vitest run --config vitest.config.ts",
36
41
  "test:browser": "vitest run --config vitest.browser.config.ts",
37
42
  "typecheck": "tsc --noEmit",
38
- "prepublishOnly": "npm run build",
43
+ "verify:worker": "node scripts/verify-worker.mjs",
44
+ "prepublishOnly": "npm run build && npm run verify:worker",
39
45
  "publish:npm": "npm publish"
40
46
  },
41
47
  "keywords": [
@@ -66,6 +72,7 @@
66
72
  "@vitejs/plugin-react": "^5.0.2",
67
73
  "@vitest/browser-playwright": "^4.0.0",
68
74
  "happy-dom": "^20.0.0",
75
+ "pdfjs-dist": "4.8.69",
69
76
  "playwright": "^1.55.0",
70
77
  "react": "^19.1.1",
71
78
  "react-dom": "^19.1.1",