@pdfme/ui 5.1.5 → 5.1.6-dev.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": "5.1.5",
3
+ "version": "5.1.6-dev.2",
4
4
  "sideEffects": false,
5
5
  "author": "hand-dot",
6
6
  "license": "MIT",
@@ -43,7 +43,7 @@
43
43
  "antd": "^5.9.4",
44
44
  "form-render": "^2.2.16",
45
45
  "hotkeys-js": "^3.8.7",
46
- "pdfjs-dist": "^3.11.174",
46
+ "pdfjs-dist": "^4.8.69",
47
47
  "react": "^16.14.0",
48
48
  "react-dom": "^16.14.0",
49
49
  "react-moveable": "^0.30.3",
@@ -3,7 +3,7 @@ import {Dict, Mode, ZOOM, UIRenderProps, SchemaForUI, BasePdf, Schema, Plugin, U
3
3
  import { theme as antdTheme } from 'antd';
4
4
  import { SELECTABLE_CLASSNAME } from '../constants';
5
5
  import { PluginsRegistry, OptionsContext, I18nContext } from '../contexts';
6
- import * as pdfJs from 'pdfjs-dist/legacy/build/pdf.js';
6
+ import * as pdfJs from 'pdfjs-dist';
7
7
 
8
8
  type RendererProps = Omit<
9
9
  UIRenderProps<Schema>,
package/src/helper.ts CHANGED
@@ -1,7 +1,4 @@
1
- // Update pdfjs-dist. (might be able to reduce the bundle size.)
2
- // @ts-ignore
3
- import PDFJSWorker from 'pdfjs-dist/legacy/build/pdf.worker.entry.js';
4
- import { getDocument, GlobalWorkerOptions } from 'pdfjs-dist/legacy/build/pdf.js';
1
+ import { getDocument, GlobalWorkerOptions, version } from 'pdfjs-dist';
5
2
  import hotkeys from 'hotkeys-js';
6
3
  import {
7
4
  cloneDeep,
@@ -18,7 +15,7 @@ import {
18
15
  } from '@pdfme/common';
19
16
  import { RULER_HEIGHT } from './constants.js';
20
17
 
21
- GlobalWorkerOptions.workerSrc = PDFJSWorker;
18
+ GlobalWorkerOptions.workerSrc = `https://unpkg.com/pdfjs-dist@${version}/build/pdf.worker.min.mjs`;
22
19
 
23
20
  export const uuid = () =>
24
21
  'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {