@pdfme/ui 3.2.1 → 3.2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pdfme/ui",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "sideEffects": false,
5
5
  "author": "hand-dot",
6
6
  "license": "MIT",
@@ -21,13 +21,12 @@
21
21
  "bugs": {
22
22
  "url": "https://github.com/pdfme/pdfme/issues"
23
23
  },
24
- "type": "module",
25
- "main": "dist/index.js",
26
- "module": "dist/index.js",
24
+ "main": "dist/index.umd.js",
25
+ "module": "dist/index.es.js",
27
26
  "types": "dist/types/index.d.ts",
28
27
  "scripts": {
29
28
  "dev": "npm-run-all --parallel devBuild:watch devBuildType:watch",
30
- "devBuild:watch": "esbuild src/index.ts --bundle --outfile=dist/index.js --format=esm --watch",
29
+ "devBuild:watch": "esbuild src/index.ts --bundle --outfile=dist/index.es.js --format=esm --watch",
31
30
  "devBuildType:watch": "tsc --emitDeclarationOnly --watch",
32
31
  "build": "vite build && tsc --emitDeclarationOnly",
33
32
  "clean": "rimraf dist",
@@ -44,7 +43,7 @@
44
43
  "antd": "^5.9.4",
45
44
  "form-render": "^2.2.16",
46
45
  "hotkeys-js": "^3.8.7",
47
- "pdfjs-dist": "^4.0.189",
46
+ "pdfjs-dist": "^3.11.174",
48
47
  "react": "^16.14.0",
49
48
  "react-dom": "^16.14.0",
50
49
  "react-moveable": "^0.30.3",
@@ -67,7 +66,6 @@
67
66
  "process": "^0.11.10",
68
67
  "vite": "^5.0.0",
69
68
  "vite-plugin-css-injected-by-js": "^3.3.0",
70
- "vite-plugin-top-level-await": "^1.3.1",
71
69
  "vite-tsconfig-paths": "^4.2.1"
72
70
  },
73
71
  "peerDependencies": {
@@ -87,8 +85,8 @@
87
85
  "^form-render/es/": "form-render/lib/",
88
86
  "^rc-picker/es/": "rc-picker/lib/",
89
87
  "^lodash-es$": "lodash",
90
- "^pdfjs-dist$": "<rootDir>/__mocks__/pdfjs-dist.js",
91
- "^pdfjs-dist/build/pdf.worker.mjs$": "<rootDir>/__mocks__/pdfjs-dist.js"
88
+ "^pdfjs-dist/legacy/build/pdf.js$": "<rootDir>/__mocks__/pdfjs-dist.js",
89
+ "^pdfjs-dist/legacy/build/pdf.worker.entry.js$": "<rootDir>/__mocks__/pdfjs-dist.js"
92
90
  },
93
91
  "resolver": "ts-jest-resolver",
94
92
  "moduleFileExtensions": [
package/src/helper.ts CHANGED
@@ -1,7 +1,8 @@
1
- import { getDocument, GlobalWorkerOptions } from 'pdfjs-dist';
1
+ // TODO Update pdfjs-dist. (might be able to reduce the bundle size.)
2
2
  // @ts-ignore
3
- import * as pdfWorker from 'pdfjs-dist/build/pdf.worker.mjs';
4
- GlobalWorkerOptions.workerSrc = pdfWorker;
3
+ import PDFJSWorker from 'pdfjs-dist/legacy/build/pdf.worker.entry.js';
4
+ import { getDocument, GlobalWorkerOptions } from 'pdfjs-dist/legacy/build/pdf.js';
5
+ GlobalWorkerOptions.workerSrc = PDFJSWorker;
5
6
 
6
7
  import hotkeys from 'hotkeys-js';
7
8
  import {
package/vite.config.ts CHANGED
@@ -1,25 +1,15 @@
1
1
  import { defineConfig } from 'vite';
2
2
  import react from '@vitejs/plugin-react';
3
3
  import tsconfigPaths from 'vite-tsconfig-paths';
4
- import topLevelAwait from 'vite-plugin-top-level-await';
5
- import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js'
4
+ import cssInjectedByJsPlugin from 'vite-plugin-css-injected-by-js';
6
5
 
7
6
  export default defineConfig({
8
- plugins: [
9
- react(),
10
- tsconfigPaths({root: '.'}),
11
- topLevelAwait({
12
- promiseExportName: '__tla',
13
- promiseImportName: (i) => `__tla_${i}`,
14
- }),
15
- cssInjectedByJsPlugin(),
16
- ],
7
+ plugins: [react(), tsconfigPaths({ root: '.' }), cssInjectedByJsPlugin()],
17
8
  build: {
18
9
  lib: {
19
10
  entry: 'src/index.ts',
20
11
  name: '@pdfme/ui',
21
- fileName: () => `index.js`,
22
- formats: ['es'],
12
+ fileName: (format) => `index.${format}.js`,
23
13
  },
24
14
  },
25
15
  optimizeDeps: {
@@ -1 +0,0 @@
1
- const e={};export{e as default};