@vue-pdf-viewer/viewer 3.0.0-alpha.0 → 3.0.0-alpha.10

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/{annotation-circle-tIpRci60.js → annotation-circle-COOiYsJg.js} +2 -2
  2. package/dist/annotation-font-Dz5-utxy.js +21 -0
  3. package/dist/annotation-font-style-italic-DrQU7N-a.js +21 -0
  4. package/dist/annotation-font-style-underline-D7zPcuK6.js +21 -0
  5. package/dist/annotation-font-weight-bold-Ba2Ix8G4.js +23 -0
  6. package/dist/{annotation-freetext-zmKZ4GuW.js → annotation-freetext-dvsFpAZu.js} +2 -2
  7. package/dist/{annotation-highlight-CBhenBLo.js → annotation-highlight-DfO5AU26.js} +2 -2
  8. package/dist/{annotation-ink-Cr5tjD8f.js → annotation-ink-Dq1T0COO.js} +2 -2
  9. package/dist/{annotation-line-CBubP1QZ.js → annotation-line-mbXXKVam.js} +2 -2
  10. package/dist/{annotation-link-DI9mj24Y.js → annotation-link-DHPTdWez.js} +2 -2
  11. package/dist/{annotation-signature-DQVfU7hJ.js → annotation-signature-4ci2KImE.js} +2 -2
  12. package/dist/{annotation-square-_rIuUCHT.js → annotation-square-SQ7oqcEq.js} +2 -2
  13. package/dist/{annotation-squiggly-DfLrUnSa.js → annotation-squiggly-B7fWFNAK.js} +2 -2
  14. package/dist/{annotation-stamp-B5gaCO0X.js → annotation-stamp-BkEskP5J.js} +2 -2
  15. package/dist/{annotation-strikeout-Cn_VHn_N.js → annotation-strikeout-C-bSOcHc.js} +2 -2
  16. package/dist/{annotation-text-pKHfDK_Q.js → annotation-text-BgsMjKeI.js} +2 -2
  17. package/dist/{annotation-underline-BDgmfJQk.js → annotation-underline-Be5qs13j.js} +2 -2
  18. package/dist/{arrow-up-DhoV0HvK.js → arrow-up-vWNs2knA.js} +2 -2
  19. package/dist/{check-BRo7Q5UG.js → check-BkaH7nrH.js} +2 -2
  20. package/dist/{chevron-down-BEs3P7KI.js → chevron-down-BSFTOkiu.js} +2 -2
  21. package/dist/{clear-DP391aEz.js → clear-CasZmBPr.js} +2 -2
  22. package/dist/{close-CnbAWKuA.js → close-BgsD04zx.js} +2 -2
  23. package/dist/{comment-panel-BkFw3FUB.js → comment-panel-B-sIKcBp.js} +2 -2
  24. package/dist/{download-C45QpUvK.js → download-DCHGUHXx.js} +2 -2
  25. package/dist/{drag-icon-CpENKa0y.js → drag-icon-D-z1P6O_.js} +2 -2
  26. package/dist/{drag-icon-dark-B0sqKXav.js → drag-icon-dark-DXDxQjnW.js} +2 -2
  27. package/dist/{ellipsis-vertical-X1VRRfZe.js → ellipsis-vertical-Cjbi7utY.js} +2 -2
  28. package/dist/{empty-comment-dark-DdPeDeR5.js → empty-comment-dark-CrZRt0Hl.js} +2 -2
  29. package/dist/{empty-comment-light-Dgc1r5xv.js → empty-comment-light-BVPUX2pA.js} +2 -2
  30. package/dist/{file-C2gjRcLU.js → file-BD05gONj.js} +2 -2
  31. package/dist/{first-page-32lvRrjG.js → first-page-DihCXIQm.js} +2 -2
  32. package/dist/{fullscreen-Cuegwls4.js → fullscreen-BmHQQPIs.js} +2 -2
  33. package/dist/{hand-BvbzlDGf.js → hand-B1v6mSWQ.js} +2 -2
  34. package/dist/index.js +16311 -13305
  35. package/dist/index.umd.cjs +32 -22
  36. package/dist/{info-2-wEcru0.js → info-DXpOTVKn.js} +2 -2
  37. package/dist/{last-page-DDJIJ2gp.js → last-page-DIN17z_8.js} +2 -2
  38. package/dist/{magnifier-shuB09Te.js → magnifier-Dep29X1B.js} +2 -2
  39. package/dist/{moon-Cf7pmsnw.js → moon-Dw-MII-V.js} +2 -2
  40. package/dist/{page-view-dual-f5-I0-4D.js → page-view-dual-DCLg-YkG.js} +2 -2
  41. package/dist/{page-view-single-DTduusoS.js → page-view-single-CWOhdavX.js} +2 -2
  42. package/dist/{pointer-CdvbhXLR.js → pointer-jfdFDx4z.js} +2 -2
  43. package/dist/{printer-ERNx1Q88.js → printer-B8qbXO9F.js} +2 -2
  44. package/dist/{rotate-counter-clockwise-CEN3P8nT.js → rotate-counter-clockwise-DFl9ijSR.js} +2 -2
  45. package/dist/{scrolling-horizontal-CdariRpO.js → scrolling-horizontal-JO2P2O-8.js} +2 -2
  46. package/dist/{scrolling-page-wFZlGv_K.js → scrolling-page-y5Rrmrnm.js} +2 -2
  47. package/dist/{scrolling-vertical-B1Doxmyt.js → scrolling-vertical-D9MCCss9.js} +2 -2
  48. package/dist/{scrolling-wrapped-BBipRQ-N.js → scrolling-wrapped-CYbEHLH6.js} +2 -2
  49. package/dist/{sun-C0fX-A5U.js → sun-BhyBd5LA.js} +2 -2
  50. package/dist/{thumbnail-HzftUNEp.js → thumbnail-BMmN_jSl.js} +2 -2
  51. package/dist/{trash-BTydaFkw.js → trash-Deie-RCt.js} +2 -2
  52. package/dist/types/components/FreeTextPanel.vue.d.ts +16 -0
  53. package/dist/types/components/FreeTextPanelFontColors.vue.d.ts +2 -0
  54. package/dist/types/components/FreeTextPanelFontFamilySelector.vue.d.ts +2 -0
  55. package/dist/types/components/FreeTextPanelFontSizeSelector.vue.d.ts +2 -0
  56. package/dist/types/components/FreeTextPanelTextStyle.vue.d.ts +2 -0
  57. package/dist/types/components/LayerAnnotationEditorFreeText.vue.d.ts +34 -0
  58. package/dist/types/components/LayerAnnotationEditorFreeTextItem.vue.d.ts +27 -0
  59. package/dist/types/components/VPdfViewer.vue.d.ts +7 -3
  60. package/dist/types/components/ui/select/Select.vue.d.ts +28 -0
  61. package/dist/types/components/ui/select/SelectContent.vue.d.ts +52 -0
  62. package/dist/types/components/ui/select/SelectGroup.vue.d.ts +35 -0
  63. package/dist/types/components/ui/select/SelectItem.vue.d.ts +35 -0
  64. package/dist/types/components/ui/select/SelectItemText.vue.d.ts +28 -0
  65. package/dist/types/components/ui/select/SelectLabel.vue.d.ts +35 -0
  66. package/dist/types/components/ui/select/SelectScrollDownButton.vue.d.ts +35 -0
  67. package/dist/types/components/ui/select/SelectScrollUpButton.vue.d.ts +35 -0
  68. package/dist/types/components/ui/select/SelectSeparator.vue.d.ts +17 -0
  69. package/dist/types/components/ui/select/SelectTrigger.vue.d.ts +35 -0
  70. package/dist/types/components/ui/select/SelectValue.vue.d.ts +28 -0
  71. package/dist/types/components/ui/select/index.d.ts +11 -0
  72. package/dist/types/components/ui/toast/use-toast.d.ts +24 -24
  73. package/dist/types/composables/useAnnotationFreeText.d.ts +468 -0
  74. package/dist/types/composables/useCommandHistory.d.ts +6 -0
  75. package/dist/types/composables/usePlugins.d.ts +24 -24
  76. package/dist/types/const.d.ts +23 -2
  77. package/dist/types/utils/annotation-display.d.ts +4 -0
  78. package/dist/types/utils/annotation-free-text.d.ts +4 -0
  79. package/dist/types/utils/annotation-highlight.d.ts +12 -0
  80. package/dist/types/utils/enumerators.d.ts +2 -1
  81. package/dist/types/utils/historyManager.d.ts +55 -0
  82. package/dist/types/utils/types.d.ts +12 -0
  83. package/dist/{zoom-in-CPqqALGr.js → zoom-in-qogh-J7e.js} +2 -2
  84. package/dist/{zoom-out-BpilF8O_.js → zoom-out-BFzERV6_.js} +2 -2
  85. package/package.json +18 -13
  86. /package/dist/types/components/{HighlightColorButton.vue.d.ts → ColorButton.vue.d.ts} +0 -0
@@ -0,0 +1,55 @@
1
+ interface Command extends CommandHistory {
2
+ mustExec: boolean;
3
+ overwriteIfSameType?: boolean;
4
+ keepUndo?: boolean;
5
+ }
6
+ interface CommandHistory {
7
+ cmd: Function;
8
+ undo: Function;
9
+ post: Function;
10
+ type: number;
11
+ }
12
+ export declare class HistoryManager {
13
+ commandHistory: CommandHistory[] | null;
14
+ locked: boolean;
15
+ maxSize: number;
16
+ position: number;
17
+ constructor(maxSize?: number);
18
+ /**
19
+ * @typedef {Object} addOptions
20
+ * @property {function} cmd
21
+ * @property {function} undo
22
+ * @property {function} [post]
23
+ * @property {boolean} mustExec
24
+ * @property {number} type
25
+ * @property {boolean} overwriteIfSameType
26
+ * @property {boolean} keepUndo
27
+ */
28
+ /**
29
+ * Add a new couple of commands to be used in case of redo/undo.
30
+ * @param {addOptions} options
31
+ */
32
+ add({ cmd, undo, post, mustExec, type, overwriteIfSameType, keepUndo }: Command): void;
33
+ /**
34
+ * Undo the last command.
35
+ */
36
+ undo(): void;
37
+ /**
38
+ * Redo the last command.
39
+ */
40
+ redo(): void;
41
+ /**
42
+ * Check if there is something to undo.
43
+ * @returns {boolean}
44
+ */
45
+ hasSomethingToUndo(): boolean;
46
+ /**
47
+ * Check if there is something to redo.
48
+ * @returns {boolean}
49
+ */
50
+ hasSomethingToRedo(): boolean;
51
+ cleanType(type: number): void;
52
+ destroy(): void;
53
+ reset(): void;
54
+ }
55
+ export {};
@@ -712,4 +712,16 @@ export interface AnnotationStamp extends Annotation {
712
712
  bitmapId?: string;
713
713
  bitmap?: ImageData;
714
714
  }
715
+ export interface FreeTextAppearance {
716
+ fontColor: Uint8ClampedArray;
717
+ fontName: string;
718
+ fontSize: number;
719
+ }
720
+ export interface AnnotationFreeText extends Annotation {
721
+ defaultAppearanceData?: FreeTextAppearance;
722
+ pageIndex?: number;
723
+ color?: Uint8ClampedArray;
724
+ fontSize?: number;
725
+ value?: string;
726
+ }
715
727
  export {};
@@ -1,4 +1,4 @@
1
- import { createElementBlock as t, openBlock as o, createElementVNode as n } from "vue";
1
+ import { openBlock as t, createElementBlock as o, createElementVNode as n } from "vue";
2
2
  const l = {
3
3
  xmlns: "http://www.w3.org/2000/svg",
4
4
  width: "1em",
@@ -7,7 +7,7 @@ const l = {
7
7
  viewBox: "0 0 20 20"
8
8
  };
9
9
  function r(a, e) {
10
- return o(), t("svg", l, e[0] || (e[0] = [
10
+ return t(), o("svg", l, e[0] || (e[0] = [
11
11
  n("path", {
12
12
  fill: "currentColor",
13
13
  d: "M11.875 8.75a.625.625 0 0 1-.625.625H9.375v1.875a.625.625 0 0 1-1.25 0V9.375H6.25a.625.625 0 0 1 0-1.25h1.875V6.25a.625.625 0 0 1 1.25 0v1.875h1.875a.625.625 0 0 1 .625.625m6.067 9.192a.623.623 0 0 1-.884 0l-3.911-3.911a6.884 6.884 0 1 1 .883-.884l3.912 3.91a.625.625 0 0 1 0 .885M8.75 14.375A5.625 5.625 0 1 0 3.125 8.75a5.63 5.63 0 0 0 5.625 5.625"
@@ -1,4 +1,4 @@
1
- import { createElementBlock as t, openBlock as o, createElementVNode as l } from "vue";
1
+ import { openBlock as t, createElementBlock as o, createElementVNode as l } from "vue";
2
2
  const n = {
3
3
  xmlns: "http://www.w3.org/2000/svg",
4
4
  width: "1em",
@@ -7,7 +7,7 @@ const n = {
7
7
  viewBox: "0 0 20 20"
8
8
  };
9
9
  function r(a, e) {
10
- return o(), t("svg", n, e[0] || (e[0] = [
10
+ return t(), o("svg", n, e[0] || (e[0] = [
11
11
  l("path", {
12
12
  fill: "currentColor",
13
13
  d: "M11.875 8.75a.625.625 0 0 1-.625.625h-5a.625.625 0 0 1 0-1.25h5a.625.625 0 0 1 .625.625m6.067 9.192a.623.623 0 0 1-.884 0l-3.911-3.911a6.884 6.884 0 1 1 .883-.884l3.912 3.91a.625.625 0 0 1 0 .885M8.75 14.375A5.625 5.625 0 1 0 3.125 8.75a5.63 5.63 0 0 0 5.625 5.625"
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@vue-pdf-viewer/viewer",
3
3
  "private": false,
4
- "version": "3.0.0-alpha.0",
4
+ "version": "3.0.0-alpha.10",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
7
7
  "module": "./dist/index.js",
8
- "description": "The PDF Viewer component for Vue 3 and Nuxt",
8
+ "description": "A vue-pdf-viewer component for Vue and Nuxt. Suitable for vue-pdf document.",
9
9
  "keywords": [
10
10
  "component",
11
11
  "frontend",
@@ -19,7 +19,11 @@
19
19
  "vue component",
20
20
  "vue pdf",
21
21
  "vue pdf viewer",
22
- "web component"
22
+ "web component",
23
+ "vue-pdf",
24
+ "vue-pdf-viewer ",
25
+ "pdf-viewer",
26
+ "nuxt-pdf"
23
27
  ],
24
28
  "author": "Vue PDF Viewer <david@vue-pdf-viewer.dev>",
25
29
  "license": "See license section",
@@ -50,16 +54,15 @@
50
54
  "build": "vite build",
51
55
  "preview": "vite preview",
52
56
  "test": "vitest",
53
- "prepublishOnly": "bun run build",
57
+ "prepublishOnly": "bun run vite build && bun run postbuild",
54
58
  "shadcn:add": "bunx shadcn-vue@latest add",
55
- "prepare": "husky",
56
- "plug": "bun run postbuild && vite build"
59
+ "prepare": "husky"
57
60
  },
58
61
  "dependencies": {
59
- "@vue-pdf-viewer/shared": "0.0.0-alpha.0",
60
- "@vueuse/core": "13.3.0",
62
+ "@vue-pdf-viewer/shared": "1.0.0-alpha.3",
63
+ "@vueuse/core": "^13.6.0",
61
64
  "pdfjs-dist": "4.10.38",
62
- "reka-ui": "^2.4.0",
65
+ "reka-ui": "^2.4.1",
63
66
  "vite-plugin-css-injected-by-js": "^3.5.1"
64
67
  },
65
68
  "peerDependencies": {
@@ -74,7 +77,7 @@
74
77
  "@typescript-eslint/parser": "^7.8.0",
75
78
  "@unocss/reset": "^0.61.7",
76
79
  "@vitejs/plugin-vue": "^3.1.0",
77
- "@vitest/browser": "^1.5.0",
80
+ "@vitest/browser": "^3.2.4",
78
81
  "@vue/eslint-config-prettier": "^9.0.0",
79
82
  "@vue/eslint-config-typescript": "^13.0.0",
80
83
  "@vue/test-utils": "^2.4.5",
@@ -87,9 +90,10 @@
87
90
  "happy-dom": "^14.7.1",
88
91
  "husky": "^9.1.4",
89
92
  "jest": "^29.7.0",
90
- "jsdom": "^24.0.0",
93
+ "jsdom": "^26.1.0",
91
94
  "lint-staged": "^15.2.5",
92
95
  "lucide-vue-next": "^0.367.0",
96
+ "playwright": "^1.54.2",
93
97
  "prettier": "3.2.5",
94
98
  "radix-vue": "^1.6.2",
95
99
  "sass": "^1.75.0",
@@ -101,7 +105,8 @@
101
105
  "vite": "^5.2.8",
102
106
  "vite-plugin-node-polyfills": "^0.21.0",
103
107
  "vite-svg-loader": "^5.1.0",
104
- "vitest": "^1.4.0",
108
+ "vitest": "^3.2.4",
109
+ "vitest-browser-vue": "^1.1.0",
105
110
  "vue": "^3.5.14",
106
111
  "vue-tsc": "^0.40.4",
107
112
  "webdriverio": "^8.36.0"
@@ -113,4 +118,4 @@
113
118
  "pnpm": ">=8.8.0",
114
119
  "yarn": ">=1.20.0"
115
120
  }
116
- }
121
+ }