@vue-pdf-viewer/shared 1.0.1-rc.2 → 1.1.0-beta.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 +1 -0
- package/dist/enumerators.d.ts +46 -1
- package/dist/enumerators.js +47 -0
- package/dist/locales/en_US.json +6 -2
- package/dist/locales/it_IT.json +4 -0
- package/dist/locales/pt_PT.json +4 -0
- package/dist/locales/th_TH.json +4 -0
- package/dist/locales/zh_CN.json +4 -0
- package/dist/types.d.ts +71 -1
- 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
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
|
@@ -4,9 +4,14 @@ export var EventAnnotation;
|
|
|
4
4
|
EventAnnotation["freeText"] = "vpv:annotation:freeText";
|
|
5
5
|
EventAnnotation["signature"] = "vpv:annotation:signature";
|
|
6
6
|
EventAnnotation["image"] = "vpv:annotation:image";
|
|
7
|
+
EventAnnotation["underline"] = "vpv:annotation:underline";
|
|
8
|
+
EventAnnotation["strikeout"] = "vpv:annotation:strikeout";
|
|
7
9
|
})(EventAnnotation || (EventAnnotation = {}));
|
|
8
10
|
export var EventCore;
|
|
9
11
|
(function (EventCore) {
|
|
12
|
+
EventCore["AnnotationCreated"] = "vpv:annotation:created";
|
|
13
|
+
EventCore["AnnotationUpdated"] = "vpv:annotation:updated";
|
|
14
|
+
EventCore["AnnotationDeleted"] = "vpv:annotation:deleted";
|
|
10
15
|
EventCore["AnnotationMounted"] = "vpv:annotation:mounted";
|
|
11
16
|
EventCore["Rotate"] = "vpv:rotate";
|
|
12
17
|
})(EventCore || (EventCore = {}));
|
|
@@ -34,3 +39,45 @@ export var FreeTextFontColor;
|
|
|
34
39
|
FreeTextFontColor["Yellow"] = "#F5C463";
|
|
35
40
|
FreeTextFontColor["Green"] = "#48BB77";
|
|
36
41
|
})(FreeTextFontColor || (FreeTextFontColor = {}));
|
|
42
|
+
export var AnnotationType;
|
|
43
|
+
(function (AnnotationType) {
|
|
44
|
+
AnnotationType[AnnotationType["Text"] = 1] = "Text";
|
|
45
|
+
AnnotationType[AnnotationType["Link"] = 2] = "Link";
|
|
46
|
+
AnnotationType[AnnotationType["FreeText"] = 3] = "FreeText";
|
|
47
|
+
AnnotationType[AnnotationType["Line"] = 4] = "Line";
|
|
48
|
+
AnnotationType[AnnotationType["Square"] = 5] = "Square";
|
|
49
|
+
AnnotationType[AnnotationType["Circle"] = 6] = "Circle";
|
|
50
|
+
AnnotationType[AnnotationType["Polygon"] = 7] = "Polygon";
|
|
51
|
+
AnnotationType[AnnotationType["Polyline"] = 8] = "Polyline";
|
|
52
|
+
AnnotationType[AnnotationType["Highlight"] = 9] = "Highlight";
|
|
53
|
+
AnnotationType[AnnotationType["Underline"] = 10] = "Underline";
|
|
54
|
+
AnnotationType[AnnotationType["Squiggly"] = 11] = "Squiggly";
|
|
55
|
+
AnnotationType[AnnotationType["StrikeOut"] = 12] = "StrikeOut";
|
|
56
|
+
AnnotationType[AnnotationType["Stamp"] = 13] = "Stamp";
|
|
57
|
+
AnnotationType[AnnotationType["Caret"] = 14] = "Caret";
|
|
58
|
+
AnnotationType[AnnotationType["Ink"] = 15] = "Ink";
|
|
59
|
+
AnnotationType[AnnotationType["Popup"] = 16] = "Popup";
|
|
60
|
+
AnnotationType[AnnotationType["FileAttachment"] = 17] = "FileAttachment";
|
|
61
|
+
AnnotationType[AnnotationType["Sound"] = 18] = "Sound";
|
|
62
|
+
AnnotationType[AnnotationType["Movie"] = 19] = "Movie";
|
|
63
|
+
AnnotationType[AnnotationType["Widget"] = 20] = "Widget";
|
|
64
|
+
AnnotationType[AnnotationType["Screen"] = 21] = "Screen";
|
|
65
|
+
AnnotationType[AnnotationType["PrinterMark"] = 22] = "PrinterMark";
|
|
66
|
+
AnnotationType[AnnotationType["TrapNet"] = 23] = "TrapNet";
|
|
67
|
+
AnnotationType[AnnotationType["Watermark"] = 24] = "Watermark";
|
|
68
|
+
AnnotationType[AnnotationType["ThreeD"] = 25] = "ThreeD";
|
|
69
|
+
AnnotationType[AnnotationType["Redact"] = 26] = "Redact";
|
|
70
|
+
})(AnnotationType || (AnnotationType = {}));
|
|
71
|
+
export var AnnotationFlag;
|
|
72
|
+
(function (AnnotationFlag) {
|
|
73
|
+
AnnotationFlag[AnnotationFlag["INVISIBLE"] = 1] = "INVISIBLE";
|
|
74
|
+
AnnotationFlag[AnnotationFlag["HIDDEN"] = 2] = "HIDDEN";
|
|
75
|
+
AnnotationFlag[AnnotationFlag["PRINT"] = 4] = "PRINT";
|
|
76
|
+
AnnotationFlag[AnnotationFlag["NOZOOM"] = 8] = "NOZOOM";
|
|
77
|
+
AnnotationFlag[AnnotationFlag["NOROTATE"] = 16] = "NOROTATE";
|
|
78
|
+
AnnotationFlag[AnnotationFlag["NOVIEW"] = 32] = "NOVIEW";
|
|
79
|
+
AnnotationFlag[AnnotationFlag["READONLY"] = 64] = "READONLY";
|
|
80
|
+
AnnotationFlag[AnnotationFlag["LOCKED"] = 128] = "LOCKED";
|
|
81
|
+
AnnotationFlag[AnnotationFlag["TOGGLENOVIEW"] = 256] = "TOGGLENOVIEW";
|
|
82
|
+
AnnotationFlag[AnnotationFlag["LOCKEDCONTENTS"] = 512] = "LOCKEDCONTENTS";
|
|
83
|
+
})(AnnotationFlag || (AnnotationFlag = {}));
|
package/dist/locales/en_US.json
CHANGED
|
@@ -78,8 +78,12 @@
|
|
|
78
78
|
"passwordConfirmLabel": "Submit",
|
|
79
79
|
"passwordError": "Incorrect password",
|
|
80
80
|
"dragDropFileMessage": "Drag and drop the PDF file here",
|
|
81
|
-
"commentPanelLabel": "View
|
|
82
|
-
"commentPanelTooltip": "View
|
|
81
|
+
"commentPanelLabel": "View comments",
|
|
82
|
+
"commentPanelTooltip": "View comments",
|
|
83
|
+
"commentPageSuffix": "",
|
|
84
|
+
"commentPagePrefix": "Page",
|
|
85
|
+
"commentLabel": "Comments",
|
|
86
|
+
"commentHideTooltip": "Hide comments",
|
|
83
87
|
"annotationLabel": "Annotation tools",
|
|
84
88
|
"annotationToggleShowTooltip": "Show annotation tools",
|
|
85
89
|
"annotationToggleHideTooltip": "Hide annotation tools",
|
package/dist/locales/it_IT.json
CHANGED
|
@@ -80,6 +80,10 @@
|
|
|
80
80
|
"dragDropFileMessage": "Trascina e rilascia il file PDF qui",
|
|
81
81
|
"commentPanelLabel": "Visualizza commenti",
|
|
82
82
|
"commentPanelTooltip": "Visualizza commenti",
|
|
83
|
+
"commentPageSuffix": "",
|
|
84
|
+
"commentPagePrefix": "Pagina",
|
|
85
|
+
"commentLabel": "Commenti",
|
|
86
|
+
"commentHideTooltip": "Nascondi commenti",
|
|
83
87
|
"annotationLabel": "Strumenti annotazione",
|
|
84
88
|
"annotationToggleShowTooltip": "Mostra strumenti annotazione",
|
|
85
89
|
"annotationToggleHideTooltip": "Nascondi strumenti annotazione",
|
package/dist/locales/pt_PT.json
CHANGED
|
@@ -80,6 +80,10 @@
|
|
|
80
80
|
"dragDropFileMessage": "Arraste e solte o arquivo PDF aqui",
|
|
81
81
|
"commentPanelLabel": "Ver comentários",
|
|
82
82
|
"commentPanelTooltip": "Ver comentários",
|
|
83
|
+
"commentPageSuffix": "",
|
|
84
|
+
"commentPagePrefix": "Página",
|
|
85
|
+
"commentLabel": "Comentários",
|
|
86
|
+
"commentHideTooltip": "Ocultar comentários",
|
|
83
87
|
"annotationLabel": "Ferramentas de anotação",
|
|
84
88
|
"annotationToggleShowTooltip": "Mostrar ferramentas de anotação",
|
|
85
89
|
"annotationToggleHideTooltip": "Ocultar ferramentas de anotação",
|
package/dist/locales/th_TH.json
CHANGED
|
@@ -80,6 +80,10 @@
|
|
|
80
80
|
"dragDropFileMessage": "ลากและวางไฟล์ PDF ที่นี่",
|
|
81
81
|
"commentPanelLabel": "ดูความคิดเห็น",
|
|
82
82
|
"commentPanelTooltip": "ดูความคิดเห็น",
|
|
83
|
+
"commentPagePrefix": "หน้า",
|
|
84
|
+
"commentPageSuffix": "",
|
|
85
|
+
"commentLabel": "ความคิดเห็น",
|
|
86
|
+
"commentHideTooltip": "ซ่อนความคิดเห็น",
|
|
83
87
|
"annotationLabel": "เครื่องมือการออกแบบ",
|
|
84
88
|
"annotationToggleShowTooltip": "แสดงเครื่องมือการออกแบบ",
|
|
85
89
|
"annotationToggleHideTooltip": "ซ่อนเครื่องมือการออกแบบ",
|
package/dist/locales/zh_CN.json
CHANGED
|
@@ -80,6 +80,10 @@
|
|
|
80
80
|
"dragDropFileMessage": "将PDF文件拖放到这里",
|
|
81
81
|
"commentPanelLabel": "查看评论",
|
|
82
82
|
"commentPanelTooltip": "查看评论",
|
|
83
|
+
"commentPagePrefix": "第",
|
|
84
|
+
"commentPageSuffix": "页",
|
|
85
|
+
"commentLabel": "评论",
|
|
86
|
+
"commentHideTooltip": "隐藏评论",
|
|
83
87
|
"annotationLabel": "注释工具",
|
|
84
88
|
"annotationToggleShowTooltip": "显示注释工具",
|
|
85
89
|
"annotationToggleHideTooltip": "隐藏注释工具",
|
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;
|
|
@@ -28,6 +28,11 @@ export type Localization = {
|
|
|
28
28
|
downloadFileLabel: string;
|
|
29
29
|
downloadFileTooltip: string;
|
|
30
30
|
commentPanelTooltip: string;
|
|
31
|
+
commentPanelLabel: string;
|
|
32
|
+
commentPageSuffix: string;
|
|
33
|
+
commentPagePrefix: string;
|
|
34
|
+
commentLabel: string;
|
|
35
|
+
commentHideTooltip: string;
|
|
31
36
|
printLabel: string;
|
|
32
37
|
printTooltip: string;
|
|
33
38
|
printLoadingMessage: string;
|
|
@@ -143,3 +148,68 @@ export type AnnotationFreeTextFontColors = (AnnotationColors & {
|
|
|
143
148
|
length: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
144
149
|
}) | null;
|
|
145
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
|
+
}
|