@vue-pdf-viewer/viewer 1.5.0-beta.2 → 1.5.0-beta.20

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.
Files changed (86) hide show
  1. package/dist/assets/arrow-up.bfb87c81.svg +3 -0
  2. package/dist/assets/check.001dcbd1.svg +7 -0
  3. package/dist/assets/chevron-down.affe596c.svg +7 -0
  4. package/dist/assets/clear.c423e636.svg +10 -0
  5. package/dist/assets/close.790ea275.svg +3 -0
  6. package/dist/assets/download.5502266f.svg +7 -0
  7. package/dist/assets/drag-icon-dark.23f11bfa.svg +93 -0
  8. package/dist/assets/drag-icon.5f93aec6.svg +130 -0
  9. package/dist/assets/ellipsis-vertical.0b64b40c.svg +7 -0
  10. package/dist/assets/file.6b4c29ed.svg +7 -0
  11. package/dist/assets/first-page.00620c16.svg +3 -0
  12. package/dist/assets/fullscreen.0b32986a.svg +5 -0
  13. package/dist/assets/hand.d2bf7c6f.svg +7 -0
  14. package/dist/assets/info.0efaa487.svg +3 -0
  15. package/dist/assets/last-page.953677ef.svg +3 -0
  16. package/dist/assets/loader.bdf4866e.png +0 -0
  17. package/dist/assets/magnifier.fcd65955.svg +7 -0
  18. package/dist/assets/moon.ac440dac.svg +7 -0
  19. package/dist/assets/page-view-dual.cf5781a5.svg +7 -0
  20. package/dist/assets/page-view-single.77744c56.svg +7 -0
  21. package/dist/assets/pointer.c583fdee.svg +7 -0
  22. package/dist/assets/printer.9827c97c.svg +7 -0
  23. package/dist/assets/rotate-counter-clockwise.3255dbde.svg +7 -0
  24. package/dist/assets/scrolling-horizontal.72cf7abd.svg +7 -0
  25. package/dist/assets/scrolling-page.4f38d9a0.svg +7 -0
  26. package/dist/assets/scrolling-vertical.b5afa9a8.svg +7 -0
  27. package/dist/assets/scrolling-wrapped.3de3be7b.svg +7 -0
  28. package/dist/assets/sun.b38bccba.svg +7 -0
  29. package/dist/assets/thumbnail.74bd1ac8.svg +10 -0
  30. package/dist/assets/watermark.51b1f7e3.webp +0 -0
  31. package/dist/assets/zoom-in.ba8615b9.svg +7 -0
  32. package/dist/assets/zoom-out.b03b35fb.svg +7 -0
  33. package/dist/index.js +6524 -6159
  34. package/dist/index.umd.cjs +11 -11
  35. package/dist/types/components/LayerCanvas.vue.d.ts +2 -2
  36. package/dist/types/components/LayerTextSearchHighlight.vue.d.ts +2 -0
  37. package/dist/types/components/ToolMenuOthers.vue.d.ts +9 -32
  38. package/dist/types/components/ToolPrint.vue.d.ts +9 -44
  39. package/dist/types/components/VPdfPage.vue.d.ts +3 -2
  40. package/dist/types/components/VPdfViewer.vue.d.ts +61 -18
  41. package/dist/types/components/ui/popover/PopoverContent.vue.d.ts +3 -3
  42. package/dist/types/composables/useLicense.d.ts +17 -3
  43. package/dist/types/composables/usePdfPagesSizes.d.ts +1 -1
  44. package/dist/types/composables/usePdfProperties.d.ts +1 -1
  45. package/dist/types/composables/usePrintControl.d.ts +21 -0
  46. package/dist/types/composables/usePrintProcess.d.ts +3 -3
  47. package/dist/types/composables/useRenderTask.d.ts +1 -1
  48. package/dist/types/composables/useVisibilities.d.ts +1 -1
  49. package/dist/types/const.d.ts +64 -16
  50. package/dist/types/index.d.ts +1 -1
  51. package/dist/types/utils/enumerators.d.ts +5 -0
  52. package/dist/types/utils/promiseWithResolvers.d.ts +7 -0
  53. package/dist/types/utils/types.d.ts +30 -7
  54. package/dist/types/utils/uiViewer.d.ts +3 -1
  55. package/package.json +5 -10
  56. package/dist/arrow-up-CZcWar0V.js +0 -20
  57. package/dist/check-BDQ_1xOK.js +0 -21
  58. package/dist/chevron-down-BGvKkqoz.js +0 -21
  59. package/dist/clear-BdBsR989.js +0 -31
  60. package/dist/close-CbywujCY.js +0 -20
  61. package/dist/download-DwxdC2cz.js +0 -21
  62. package/dist/drag-icon-CJSwJaYj.js +0 -18
  63. package/dist/drag-icon-dark-DslxK0op.js +0 -17
  64. package/dist/ellipsis-vertical-DU4RrfN8.js +0 -21
  65. package/dist/file-CKOtlAnB.js +0 -21
  66. package/dist/first-page-D2sUix1F.js +0 -20
  67. package/dist/fullscreen-CDD3D91y.js +0 -21
  68. package/dist/hand-BdufQ7PJ.js +0 -21
  69. package/dist/info-CnzWbChw.js +0 -20
  70. package/dist/last-page-BlLcdVDC.js +0 -20
  71. package/dist/magnifier-D5effak1.js +0 -21
  72. package/dist/moon-jjKfhCeP.js +0 -21
  73. package/dist/page-view-dual-DzyLa1r0.js +0 -21
  74. package/dist/page-view-single-CAQXbP-i.js +0 -21
  75. package/dist/pointer-CosfQ2Bj.js +0 -21
  76. package/dist/printer-CZndb-XY.js +0 -21
  77. package/dist/rotate-counter-clockwise-BnC8SAwc.js +0 -21
  78. package/dist/scrolling-horizontal-D1qDwmpQ.js +0 -23
  79. package/dist/scrolling-page-lV73lZIc.js +0 -23
  80. package/dist/scrolling-vertical-DzrChdnV.js +0 -23
  81. package/dist/scrolling-wrapped-CvhUpxbI.js +0 -23
  82. package/dist/sun-f_yo-49i.js +0 -21
  83. package/dist/thumbnail-BrLTlvMi.js +0 -21
  84. package/dist/types/composables/usePrint.d.ts +0 -8
  85. package/dist/zoom-in-MHWLskY5.js +0 -21
  86. package/dist/zoom-out-BOe91xpp.js +0 -21
@@ -0,0 +1,7 @@
1
+ type Resolve = (value: unknown) => void;
2
+ export declare function promiseWithResolvers<T = void>(): {
3
+ promise: Promise<T>;
4
+ resolve: Resolve;
5
+ reject: (reason?: any) => void;
6
+ };
7
+ export {};
@@ -1,8 +1,8 @@
1
- import { ComputedRef, MaybeRef, PropType, Ref, ShallowRef } from 'vue';
1
+ import { ComputedRef, MaybeRef, PropType, Reactive, Ref, ShallowRef } from 'vue';
2
2
  import type { PageViewport } from 'pdfjs-dist';
3
3
  import type { DocumentInitParameters, OnProgressParameters, PDFDataRangeTransport, TextContent, TypedArray, PDFPageProxy, PDFDocumentProxy } from 'pdfjs-dist/types/src/display/api';
4
4
  import type { Metadata } from 'pdfjs-dist/types/src/display/metadata';
5
- import { ZoomLevel, ViewMode, ScrollMode, VPVAnnotationType } from './enumerators';
5
+ import { ZoomLevel, ViewMode, ScrollMode, VPVAnnotationType, LicenseType } from './enumerators';
6
6
  export interface VirtualRange {
7
7
  start: number;
8
8
  end: number;
@@ -327,8 +327,11 @@ export interface ToolbarOptions {
327
327
  pageViewSwitchable: boolean;
328
328
  }
329
329
  export interface License {
330
+ isValidating: boolean;
331
+ isValidated: boolean;
330
332
  isValidKey: boolean;
331
333
  licenseKey: string | null;
334
+ type: LicenseType;
332
335
  }
333
336
  export type VPVSrc = Omit<PDFSrc, 'DocumentInitParameters' | 'PDFDataRangeTransport'>;
334
337
  export interface VPdfViewerProps {
@@ -387,7 +390,7 @@ export interface VPdfViewerProps {
387
390
  * localization json data
388
391
  */
389
392
  localization?: Record<string, Localization>;
390
- afterCanvasLoaded?: Record<number, any>;
393
+ afterCanvasLoaded?: Record<number, CanvasLoadedCallback>;
391
394
  }
392
395
  export interface HighlightMatchPosition {
393
396
  matchIdx: number;
@@ -464,7 +467,7 @@ export interface HighlightMatchPosition {
464
467
  matchIdx: number;
465
468
  pageIdx: number;
466
469
  }
467
- export interface AfterLoadedViewport {
470
+ export interface ViewportDimensions {
468
471
  width: number;
469
472
  height: number;
470
473
  canvasWidth: number;
@@ -472,7 +475,7 @@ export interface AfterLoadedViewport {
472
475
  widthRatio: number;
473
476
  heightRatio: number;
474
477
  }
475
- export type AfterLoadedCallback = (element: HTMLCanvasElement, viewport: AfterLoadedViewport) => void;
478
+ export type CanvasLoadedCallback = (element: HTMLCanvasElement, viewport: ViewportDimensions) => void;
476
479
  export declare const VPVBaseProps: {
477
480
  readonly src: {
478
481
  readonly type: PropType<string | VPVSrc>;
@@ -529,7 +532,7 @@ export declare const VPVBaseProps: {
529
532
  readonly default: undefined;
530
533
  };
531
534
  readonly afterCanvasLoaded: {
532
- readonly type: PropType<Record<number, AfterLoadedCallback>>;
535
+ readonly type: PropType<Record<number, CanvasLoadedCallback>>;
533
536
  readonly default: undefined;
534
537
  };
535
538
  };
@@ -566,8 +569,28 @@ export interface SearchControl {
566
569
  nextSearchMatch: () => void;
567
570
  prevSearchMatch: () => void;
568
571
  }
572
+ export interface PreparePrintProgress {
573
+ loadedPages: number;
574
+ totalPages: number;
575
+ percentage: number;
576
+ }
577
+ export interface PrintControl {
578
+ print(options?: {
579
+ visibleDefaultProgress: boolean;
580
+ }): Awaited<void>;
581
+ cancel(): void;
582
+ onProgress?: (progress: PreparePrintProgress) => void;
583
+ onError?: (error: Error) => void;
584
+ onComplete?: () => void;
585
+ }
569
586
  export interface VPVInstance {
570
- searchControl: SearchControl;
587
+ printControl: ComputedRef<Reactive<PrintControl> | undefined>;
588
+ searchControl: ComputedRef<SearchControl | undefined>;
589
+ pageControl: ComputedRef<PageControl | undefined>;
590
+ }
591
+ export interface PageControl {
571
592
  goToPage: (page: number) => void;
593
+ currentPage: number;
594
+ totalPages: number;
572
595
  }
573
596
  export {};
@@ -1,2 +1,4 @@
1
- import { Offset } from './types';
1
+ import type { PageViewport } from 'pdfjs-dist';
2
+ import type { Offset } from './types';
2
3
  export declare const calculateOffset: (children: HTMLElement, parent: HTMLElement) => Offset;
4
+ export declare const transformLayer: (element: HTMLElement, viewport: PageViewport) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue-pdf-viewer/viewer",
3
3
  "private": false,
4
- "version": "1.5.0-beta.2",
4
+ "version": "1.5.0-beta.20",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
7
7
  "module": "./dist/index.js",
@@ -34,19 +34,13 @@
34
34
  "require": "./dist/index.umd.cjs",
35
35
  "types": "./dist/types/index.d.ts"
36
36
  },
37
- "./dist/index.essential.mjs": {
38
- "import": "./dist/index.essential.mjs",
39
- "types": "./dist/types/index.essential.d.ts"
40
- },
41
- "./dist/style/index.css": {
42
- "import": "./dist/style/index.css",
43
- "require": "./dist/style/index.css"
44
- }
37
+ "./assets/images": "./dist/assets/images/"
45
38
  },
46
39
  "style": "./dist/style/index.css",
47
40
  "types": "./dist/types/index.d.ts",
48
41
  "files": [
49
- "dist"
42
+ "dist",
43
+ "dist/assets/images/"
50
44
  ],
51
45
  "scripts": {
52
46
  "dev": "vite",
@@ -71,6 +65,7 @@
71
65
  "vue": "^3.2.37"
72
66
  },
73
67
  "devDependencies": {
68
+ "@laynezh/vite-plugin-lib-assets": "^0.5.24",
74
69
  "@rollup/rollup-darwin-x64": "^4.19.1",
75
70
  "@types/node": "^20.11.30",
76
71
  "@typescript-eslint/eslint-plugin": "^7.8.0",
@@ -1,20 +0,0 @@
1
- import { openBlock as e, createElementBlock as t, createElementVNode as o } from "vue";
2
- const n = {
3
- xmlns: "http://www.w3.org/2000/svg",
4
- width: "20",
5
- height: "20",
6
- fill: "none"
7
- }, r = /* @__PURE__ */ o("path", {
8
- fill: "currentColor",
9
- d: "M16.692 12.942a.625.625 0 0 1-.884 0L10 7.134l-5.808 5.808a.625.625 0 1 1-.884-.884l6.25-6.25a.625.625 0 0 1 .884 0l6.25 6.25a.623.623 0 0 1 0 .884"
10
- }, null, -1), l = [
11
- r
12
- ];
13
- function c(a, s) {
14
- return e(), t("svg", n, [...l]);
15
- }
16
- const h = { render: c };
17
- export {
18
- h as default,
19
- c as render
20
- };
@@ -1,21 +0,0 @@
1
- import { openBlock as e, createElementBlock as t, createElementVNode as o } from "vue";
2
- const n = {
3
- xmlns: "http://www.w3.org/2000/svg",
4
- width: "1em",
5
- height: "1em",
6
- fill: "none",
7
- viewBox: "0 0 16 17"
8
- }, c = /* @__PURE__ */ o("path", {
9
- fill: "currentColor",
10
- d: "m14.354 5.354-8 8a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 0 1 .708-.708L6 12.293l7.646-7.647a.5.5 0 0 1 .708.708"
11
- }, null, -1), l = [
12
- c
13
- ];
14
- function r(s, h) {
15
- return e(), t("svg", n, [...l]);
16
- }
17
- const a = { render: r };
18
- export {
19
- a as default,
20
- r as render
21
- };
@@ -1,21 +0,0 @@
1
- import { openBlock as e, createElementBlock as t, createElementVNode as o } from "vue";
2
- const n = {
3
- xmlns: "http://www.w3.org/2000/svg",
4
- width: "1em",
5
- height: "1em",
6
- fill: "none",
7
- viewBox: "0 0 20 20"
8
- }, r = /* @__PURE__ */ o("path", {
9
- fill: "currentColor",
10
- d: "m16.692 7.942-6.25 6.25a.625.625 0 0 1-.884 0l-6.25-6.25a.625.625 0 0 1 .884-.884L10 12.866l5.808-5.808a.625.625 0 0 1 .884.884"
11
- }, null, -1), l = [
12
- r
13
- ];
14
- function c(s, h) {
15
- return e(), t("svg", n, [...l]);
16
- }
17
- const a = { render: c };
18
- export {
19
- a as default,
20
- c as render
21
- };
@@ -1,31 +0,0 @@
1
- import { openBlock as t, createElementBlock as l, createElementVNode as e } from "vue";
2
- const o = {
3
- xmlns: "http://www.w3.org/2000/svg",
4
- width: "1em",
5
- height: "1em",
6
- fill: "none",
7
- viewBox: "0 0 12 12"
8
- }, c = /* @__PURE__ */ e("g", { "clip-path": "url(#a)" }, [
9
- /* @__PURE__ */ e("path", {
10
- fill: "currentColor",
11
- d: "M6 .75a5.25 5.25 0 1 0 0 10.5A5.25 5.25 0 0 0 6 .75m1.938 7.245-.773-.004L6 6.602 4.836 7.99l-.774.003a.093.093 0 0 1-.094-.093q0-.035.022-.061l1.525-1.817L3.99 4.207a.094.094 0 0 1 .071-.155l.775.004L6 5.445l1.164-1.388.773-.003c.052 0 .094.04.094.093a.1.1 0 0 1-.022.061L6.486 6.023 8.01 7.84a.094.094 0 0 1-.071.155"
12
- })
13
- ], -1), n = /* @__PURE__ */ e("defs", null, [
14
- /* @__PURE__ */ e("clipPath", { id: "a" }, [
15
- /* @__PURE__ */ e("path", {
16
- fill: "#fff",
17
- d: "M0 0h12v12H0z"
18
- })
19
- ])
20
- ], -1), a = [
21
- c,
22
- n
23
- ];
24
- function r(i, h) {
25
- return t(), l("svg", o, [...a]);
26
- }
27
- const d = { render: r };
28
- export {
29
- d as default,
30
- r as render
31
- };
@@ -1,20 +0,0 @@
1
- import { openBlock as e, createElementBlock as t, createElementVNode as o } from "vue";
2
- const n = {
3
- xmlns: "http://www.w3.org/2000/svg",
4
- width: "20",
5
- height: "20",
6
- fill: "none"
7
- }, l = /* @__PURE__ */ o("path", {
8
- fill: "currentColor",
9
- d: "M16.067 15.183a.625.625 0 1 1-.884.884L10 10.884l-5.183 5.183a.626.626 0 0 1-.884-.884L9.116 10 3.933 4.817a.625.625 0 0 1 .884-.884L10 9.116l5.183-5.183a.625.625 0 1 1 .884.884L10.884 10z"
10
- }, null, -1), r = [
11
- l
12
- ];
13
- function c(s, a) {
14
- return e(), t("svg", n, [...r]);
15
- }
16
- const h = { render: c };
17
- export {
18
- h as default,
19
- c as render
20
- };
@@ -1,21 +0,0 @@
1
- import { openBlock as e, createElementBlock as t, createElementVNode as o } from "vue";
2
- const n = {
3
- xmlns: "http://www.w3.org/2000/svg",
4
- width: "1em",
5
- height: "1em",
6
- fill: "none",
7
- viewBox: "0 0 20 20"
8
- }, l = /* @__PURE__ */ o("path", {
9
- fill: "currentColor",
10
- d: "M17.5 11.875v4.375a1.25 1.25 0 0 1-1.25 1.25H3.75a1.25 1.25 0 0 1-1.25-1.25v-4.375a.625.625 0 1 1 1.25 0v4.375h12.5v-4.375a.624.624 0 1 1 1.25 0m-7.942.442a.626.626 0 0 0 .884 0l3.125-3.125a.624.624 0 1 0-.884-.884l-2.058 2.058V3.125a.625.625 0 1 0-1.25 0v7.241L7.317 8.308a.625.625 0 0 0-.884.884z"
11
- }, null, -1), a = [
12
- l
13
- ];
14
- function r(c, d) {
15
- return e(), t("svg", n, [...a]);
16
- }
17
- const h = { render: r };
18
- export {
19
- h as default,
20
- r as render
21
- };