@vue-pdf-viewer/shared 1.0.1-rc.3 → 1.1.0-rc.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.
- package/dist/const.d.ts +1 -0
- package/dist/const.js +14 -0
- package/dist/enumerators.d.ts +46 -1
- package/dist/enumerators.js +60 -0
- package/dist/types.d.ts +66 -1
- package/dist/types.js +0 -2
- package/dist/utils.js +13 -0
- package/package.json +1 -1
package/dist/const.d.ts
CHANGED
|
@@ -11,3 +11,4 @@ export declare const EVENT_ANNOTATION: typeof EventAnnotation;
|
|
|
11
11
|
export declare const EVENT_CORE: typeof EventCore;
|
|
12
12
|
export declare const DEFAULT_HIGHLIGHT_COLORS: Record<HighlightColor, string>;
|
|
13
13
|
export declare const DEFAULT_FREE_TEXT_FONT_COLORS: Record<FreeTextFontColor, string>;
|
|
14
|
+
export declare const EDITOR_PREFIX: "pdfjs_internal_editor_";
|
package/dist/const.js
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2025 Vue PDF Viewer
|
|
3
|
+
*
|
|
4
|
+
* This file is part of Vue PDF Viewer
|
|
5
|
+
*
|
|
6
|
+
* Vue PDF Viewer is distributed under a Commercial License Agreement.
|
|
7
|
+
* Last updated: 5 August, 2025
|
|
8
|
+
*
|
|
9
|
+
* For licensing terms and conditions, please visit:
|
|
10
|
+
* https://www.vue-pdf-viewer.dev/license-agreement
|
|
11
|
+
*
|
|
12
|
+
* For commercial licensing inquiries, contact: david@vue-pdf-viewer.dev
|
|
13
|
+
*/
|
|
1
14
|
import { EventAnnotation, EventCore, FreeTextFontColor, HighlightColor, } from "./enumerators";
|
|
2
15
|
import en from "./locales/en_US.json";
|
|
3
16
|
import cn from "./locales/zh_CN.json";
|
|
@@ -41,3 +54,4 @@ export const DEFAULT_FREE_TEXT_FONT_COLORS = {
|
|
|
41
54
|
[FreeTextFontColor.Yellow]: "Yellow",
|
|
42
55
|
[FreeTextFontColor.Green]: "Green",
|
|
43
56
|
};
|
|
57
|
+
export const EDITOR_PREFIX = "pdfjs_internal_editor_";
|
package/dist/enumerators.d.ts
CHANGED
|
@@ -2,9 +2,14 @@ export declare enum EventAnnotation {
|
|
|
2
2
|
highlight = "vpv:annotation:highlight",
|
|
3
3
|
freeText = "vpv:annotation:freeText",
|
|
4
4
|
signature = "vpv:annotation:signature",
|
|
5
|
-
image = "vpv:annotation:image"
|
|
5
|
+
image = "vpv:annotation:image",
|
|
6
|
+
underline = "vpv:annotation:underline",
|
|
7
|
+
strikeout = "vpv:annotation:strikeout"
|
|
6
8
|
}
|
|
7
9
|
export declare enum EventCore {
|
|
10
|
+
AnnotationCreated = "vpv:annotation:created",
|
|
11
|
+
AnnotationUpdated = "vpv:annotation:updated",
|
|
12
|
+
AnnotationDeleted = "vpv:annotation:deleted",
|
|
8
13
|
AnnotationMounted = "vpv:annotation:mounted",
|
|
9
14
|
Rotate = "vpv:rotate"
|
|
10
15
|
}
|
|
@@ -30,3 +35,43 @@ export declare enum FreeTextFontColor {
|
|
|
30
35
|
Yellow = "#F5C463",
|
|
31
36
|
Green = "#48BB77"
|
|
32
37
|
}
|
|
38
|
+
export declare enum AnnotationType {
|
|
39
|
+
Text = 1,
|
|
40
|
+
Link = 2,
|
|
41
|
+
FreeText = 3,
|
|
42
|
+
Line = 4,
|
|
43
|
+
Square = 5,
|
|
44
|
+
Circle = 6,
|
|
45
|
+
Polygon = 7,
|
|
46
|
+
Polyline = 8,
|
|
47
|
+
Highlight = 9,
|
|
48
|
+
Underline = 10,
|
|
49
|
+
Squiggly = 11,
|
|
50
|
+
StrikeOut = 12,
|
|
51
|
+
Stamp = 13,
|
|
52
|
+
Caret = 14,
|
|
53
|
+
Ink = 15,
|
|
54
|
+
Popup = 16,
|
|
55
|
+
FileAttachment = 17,
|
|
56
|
+
Sound = 18,
|
|
57
|
+
Movie = 19,
|
|
58
|
+
Widget = 20,
|
|
59
|
+
Screen = 21,
|
|
60
|
+
PrinterMark = 22,
|
|
61
|
+
TrapNet = 23,
|
|
62
|
+
Watermark = 24,
|
|
63
|
+
ThreeD = 25,
|
|
64
|
+
Redact = 26
|
|
65
|
+
}
|
|
66
|
+
export declare enum AnnotationFlag {
|
|
67
|
+
INVISIBLE = 1,
|
|
68
|
+
HIDDEN = 2,
|
|
69
|
+
PRINT = 4,
|
|
70
|
+
NOZOOM = 8,
|
|
71
|
+
NOROTATE = 16,
|
|
72
|
+
NOVIEW = 32,
|
|
73
|
+
READONLY = 64,
|
|
74
|
+
LOCKED = 128,
|
|
75
|
+
TOGGLENOVIEW = 256,
|
|
76
|
+
LOCKEDCONTENTS = 512
|
|
77
|
+
}
|
package/dist/enumerators.js
CHANGED
|
@@ -1,12 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2025 Vue PDF Viewer
|
|
3
|
+
*
|
|
4
|
+
* This file is part of Vue PDF Viewer
|
|
5
|
+
*
|
|
6
|
+
* Vue PDF Viewer is distributed under a Commercial License Agreement.
|
|
7
|
+
* Last updated: 5 August, 2025
|
|
8
|
+
*
|
|
9
|
+
* For licensing terms and conditions, please visit:
|
|
10
|
+
* https://www.vue-pdf-viewer.dev/license-agreement
|
|
11
|
+
*
|
|
12
|
+
* For commercial licensing inquiries, contact: david@vue-pdf-viewer.dev
|
|
13
|
+
*/
|
|
1
14
|
export var EventAnnotation;
|
|
2
15
|
(function (EventAnnotation) {
|
|
3
16
|
EventAnnotation["highlight"] = "vpv:annotation:highlight";
|
|
4
17
|
EventAnnotation["freeText"] = "vpv:annotation:freeText";
|
|
5
18
|
EventAnnotation["signature"] = "vpv:annotation:signature";
|
|
6
19
|
EventAnnotation["image"] = "vpv:annotation:image";
|
|
20
|
+
EventAnnotation["underline"] = "vpv:annotation:underline";
|
|
21
|
+
EventAnnotation["strikeout"] = "vpv:annotation:strikeout";
|
|
7
22
|
})(EventAnnotation || (EventAnnotation = {}));
|
|
8
23
|
export var EventCore;
|
|
9
24
|
(function (EventCore) {
|
|
25
|
+
EventCore["AnnotationCreated"] = "vpv:annotation:created";
|
|
26
|
+
EventCore["AnnotationUpdated"] = "vpv:annotation:updated";
|
|
27
|
+
EventCore["AnnotationDeleted"] = "vpv:annotation:deleted";
|
|
10
28
|
EventCore["AnnotationMounted"] = "vpv:annotation:mounted";
|
|
11
29
|
EventCore["Rotate"] = "vpv:rotate";
|
|
12
30
|
})(EventCore || (EventCore = {}));
|
|
@@ -34,3 +52,45 @@ export var FreeTextFontColor;
|
|
|
34
52
|
FreeTextFontColor["Yellow"] = "#F5C463";
|
|
35
53
|
FreeTextFontColor["Green"] = "#48BB77";
|
|
36
54
|
})(FreeTextFontColor || (FreeTextFontColor = {}));
|
|
55
|
+
export var AnnotationType;
|
|
56
|
+
(function (AnnotationType) {
|
|
57
|
+
AnnotationType[AnnotationType["Text"] = 1] = "Text";
|
|
58
|
+
AnnotationType[AnnotationType["Link"] = 2] = "Link";
|
|
59
|
+
AnnotationType[AnnotationType["FreeText"] = 3] = "FreeText";
|
|
60
|
+
AnnotationType[AnnotationType["Line"] = 4] = "Line";
|
|
61
|
+
AnnotationType[AnnotationType["Square"] = 5] = "Square";
|
|
62
|
+
AnnotationType[AnnotationType["Circle"] = 6] = "Circle";
|
|
63
|
+
AnnotationType[AnnotationType["Polygon"] = 7] = "Polygon";
|
|
64
|
+
AnnotationType[AnnotationType["Polyline"] = 8] = "Polyline";
|
|
65
|
+
AnnotationType[AnnotationType["Highlight"] = 9] = "Highlight";
|
|
66
|
+
AnnotationType[AnnotationType["Underline"] = 10] = "Underline";
|
|
67
|
+
AnnotationType[AnnotationType["Squiggly"] = 11] = "Squiggly";
|
|
68
|
+
AnnotationType[AnnotationType["StrikeOut"] = 12] = "StrikeOut";
|
|
69
|
+
AnnotationType[AnnotationType["Stamp"] = 13] = "Stamp";
|
|
70
|
+
AnnotationType[AnnotationType["Caret"] = 14] = "Caret";
|
|
71
|
+
AnnotationType[AnnotationType["Ink"] = 15] = "Ink";
|
|
72
|
+
AnnotationType[AnnotationType["Popup"] = 16] = "Popup";
|
|
73
|
+
AnnotationType[AnnotationType["FileAttachment"] = 17] = "FileAttachment";
|
|
74
|
+
AnnotationType[AnnotationType["Sound"] = 18] = "Sound";
|
|
75
|
+
AnnotationType[AnnotationType["Movie"] = 19] = "Movie";
|
|
76
|
+
AnnotationType[AnnotationType["Widget"] = 20] = "Widget";
|
|
77
|
+
AnnotationType[AnnotationType["Screen"] = 21] = "Screen";
|
|
78
|
+
AnnotationType[AnnotationType["PrinterMark"] = 22] = "PrinterMark";
|
|
79
|
+
AnnotationType[AnnotationType["TrapNet"] = 23] = "TrapNet";
|
|
80
|
+
AnnotationType[AnnotationType["Watermark"] = 24] = "Watermark";
|
|
81
|
+
AnnotationType[AnnotationType["ThreeD"] = 25] = "ThreeD";
|
|
82
|
+
AnnotationType[AnnotationType["Redact"] = 26] = "Redact";
|
|
83
|
+
})(AnnotationType || (AnnotationType = {}));
|
|
84
|
+
export var AnnotationFlag;
|
|
85
|
+
(function (AnnotationFlag) {
|
|
86
|
+
AnnotationFlag[AnnotationFlag["INVISIBLE"] = 1] = "INVISIBLE";
|
|
87
|
+
AnnotationFlag[AnnotationFlag["HIDDEN"] = 2] = "HIDDEN";
|
|
88
|
+
AnnotationFlag[AnnotationFlag["PRINT"] = 4] = "PRINT";
|
|
89
|
+
AnnotationFlag[AnnotationFlag["NOZOOM"] = 8] = "NOZOOM";
|
|
90
|
+
AnnotationFlag[AnnotationFlag["NOROTATE"] = 16] = "NOROTATE";
|
|
91
|
+
AnnotationFlag[AnnotationFlag["NOVIEW"] = 32] = "NOVIEW";
|
|
92
|
+
AnnotationFlag[AnnotationFlag["READONLY"] = 64] = "READONLY";
|
|
93
|
+
AnnotationFlag[AnnotationFlag["LOCKED"] = 128] = "LOCKED";
|
|
94
|
+
AnnotationFlag[AnnotationFlag["TOGGLENOVIEW"] = 256] = "TOGGLENOVIEW";
|
|
95
|
+
AnnotationFlag[AnnotationFlag["LOCKEDCONTENTS"] = 512] = "LOCKEDCONTENTS";
|
|
96
|
+
})(AnnotationFlag || (AnnotationFlag = {}));
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Component, ComponentInternalInstance, ComputedRef } from "vue";
|
|
2
|
-
import { EventAnnotation, EventCore } from "./enumerators";
|
|
2
|
+
import { AnnotationFlag, AnnotationType, EventAnnotation, EventCore } from "./enumerators";
|
|
3
3
|
export type LocaleKey = "en_US" | "zh_CN" | "it_IT" | "pt_PT" | "th_TH" | string;
|
|
4
4
|
export type Localization = {
|
|
5
5
|
searchButtonTooltip: string;
|
|
@@ -148,3 +148,68 @@ export type AnnotationFreeTextFontColors = (AnnotationColors & {
|
|
|
148
148
|
length: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
149
149
|
}) | null;
|
|
150
150
|
export type VPVEvent = EventAnnotation | EventCore;
|
|
151
|
+
export interface AnnotationAttachment {
|
|
152
|
+
content: Uint8Array;
|
|
153
|
+
filename: string;
|
|
154
|
+
}
|
|
155
|
+
export interface AnnotationBorderStyle {
|
|
156
|
+
dashArray: number[];
|
|
157
|
+
horizontalCornerRadius: number;
|
|
158
|
+
style: number;
|
|
159
|
+
verticalCornerRadius: number;
|
|
160
|
+
width: number;
|
|
161
|
+
rawWidth: number;
|
|
162
|
+
}
|
|
163
|
+
export interface AnnotationStringObj {
|
|
164
|
+
dir: string;
|
|
165
|
+
str: string;
|
|
166
|
+
}
|
|
167
|
+
export type OutlineName = {
|
|
168
|
+
name: string;
|
|
169
|
+
};
|
|
170
|
+
export type OutlineRef = {
|
|
171
|
+
gen: number;
|
|
172
|
+
num: number;
|
|
173
|
+
};
|
|
174
|
+
export type OutlineDestinations = [
|
|
175
|
+
OutlineRef | number,
|
|
176
|
+
OutlineName,
|
|
177
|
+
...any[]
|
|
178
|
+
];
|
|
179
|
+
export type LinkAction = "FirstPage" | "LastPage" | "NextPage" | "PrevPage" | "GoBack" | "GoForward";
|
|
180
|
+
export interface Annotation {
|
|
181
|
+
id: string | null;
|
|
182
|
+
annotationType: AnnotationType;
|
|
183
|
+
rotation: number;
|
|
184
|
+
rect: number[];
|
|
185
|
+
annotationFlags?: AnnotationFlag;
|
|
186
|
+
borderStyle?: AnnotationBorderStyle;
|
|
187
|
+
color?: Uint8ClampedArray | null;
|
|
188
|
+
creationDate?: string | null;
|
|
189
|
+
backgroundColor?: Uint8ClampedArray | null;
|
|
190
|
+
borderColor?: Uint8ClampedArray | null;
|
|
191
|
+
contentsObj?: AnnotationStringObj;
|
|
192
|
+
hasOwnCanvas?: boolean;
|
|
193
|
+
hasAppearance?: boolean;
|
|
194
|
+
modificationDate?: string | null;
|
|
195
|
+
quadPoints?: Float32Array;
|
|
196
|
+
subtype?: string;
|
|
197
|
+
noRotate?: boolean;
|
|
198
|
+
noHTML?: boolean;
|
|
199
|
+
isEditable?: boolean;
|
|
200
|
+
structParent?: number;
|
|
201
|
+
titleObj?: AnnotationStringObj;
|
|
202
|
+
opacity?: number;
|
|
203
|
+
file?: AnnotationAttachment;
|
|
204
|
+
dest?: OutlineDestinations;
|
|
205
|
+
url?: string;
|
|
206
|
+
unsafeUrl?: string;
|
|
207
|
+
action?: LinkAction;
|
|
208
|
+
newWindow?: boolean;
|
|
209
|
+
pageIndex?: number;
|
|
210
|
+
deleted?: boolean;
|
|
211
|
+
noView?: boolean;
|
|
212
|
+
noPrint?: boolean;
|
|
213
|
+
fontSize?: number;
|
|
214
|
+
contents?: string;
|
|
215
|
+
}
|
package/dist/types.js
CHANGED
package/dist/utils.js
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2021-2025 Vue PDF Viewer
|
|
3
|
+
*
|
|
4
|
+
* This file is part of Vue PDF Viewer
|
|
5
|
+
*
|
|
6
|
+
* Vue PDF Viewer is distributed under a Commercial License Agreement.
|
|
7
|
+
* Last updated: 5 August, 2025
|
|
8
|
+
*
|
|
9
|
+
* For licensing terms and conditions, please visit:
|
|
10
|
+
* https://www.vue-pdf-viewer.dev/license-agreement
|
|
11
|
+
*
|
|
12
|
+
* For commercial licensing inquiries, contact: david@vue-pdf-viewer.dev
|
|
13
|
+
*/
|
|
1
14
|
export const getEventName = (instanceId, event) => {
|
|
2
15
|
return `${instanceId}-${event}`;
|
|
3
16
|
};
|