@vue-pdf-viewer/shared 1.0.1-rc.3 → 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 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
@@ -41,3 +41,4 @@ export const DEFAULT_FREE_TEXT_FONT_COLORS = {
41
41
  [FreeTextFontColor.Yellow]: "Yellow",
42
42
  [FreeTextFontColor.Green]: "Green",
43
43
  };
44
+ export const EDITOR_PREFIX = "pdfjs_internal_editor_";
@@ -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
+ }
@@ -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/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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue-pdf-viewer/shared",
3
3
  "private": false,
4
- "version": "1.0.1-rc.3",
4
+ "version": "1.1.0-beta.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",