@vue-pdf-viewer/shared 1.2.0-rc.3 → 1.2.0-rc.5
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 +35 -3
- package/dist/const.js +55 -22
- package/dist/enumerators.d.ts +2 -23
- package/dist/enumerators.js +3 -25
- package/dist/types.d.ts +25 -1
- package/package.json +1 -1
package/dist/const.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type InjectionKey, type Reactive, type ComputedRef } from "vue";
|
|
2
2
|
import type { LocaleKey, Localization, PluginContext } from "./index";
|
|
3
|
-
import { EventAnnotation, EventCore
|
|
3
|
+
import { EventAnnotation, EventCore } from "./enumerators";
|
|
4
4
|
export declare const PLUGIN_ID: {
|
|
5
5
|
ANNOTATIONS: string;
|
|
6
6
|
};
|
|
@@ -9,6 +9,38 @@ export declare const SYMBOL_SHARED_UI: InjectionKey<Reactive<PluginContext["shar
|
|
|
9
9
|
export declare const SYMBOL_LOCALIZATION: InjectionKey<ComputedRef<Localization> | undefined>;
|
|
10
10
|
export declare const EVENT_ANNOTATION: typeof EventAnnotation;
|
|
11
11
|
export declare const EVENT_CORE: typeof EventCore;
|
|
12
|
-
export declare const
|
|
13
|
-
|
|
12
|
+
export declare const BASIC_COLOR: {
|
|
13
|
+
readonly Black: "#000000";
|
|
14
|
+
readonly DarkGray: "#444444";
|
|
15
|
+
readonly Gray: "#696969";
|
|
16
|
+
readonly LightGray: "#9C9C9C";
|
|
17
|
+
readonly LightestGray: "#CDCDCD";
|
|
18
|
+
readonly White: "#FFFFFF";
|
|
19
|
+
};
|
|
20
|
+
export declare const FREE_TEXT_FONT_COLOR: {
|
|
21
|
+
readonly Purple: "#7862FF";
|
|
22
|
+
readonly Blue: "#1777FF";
|
|
23
|
+
readonly Red: "#F66365";
|
|
24
|
+
readonly Orange: "#F67E63";
|
|
25
|
+
readonly Yellow: "#F5C463";
|
|
26
|
+
readonly Green: "#48BB77";
|
|
27
|
+
readonly Black: "#000000";
|
|
28
|
+
readonly DarkGray: "#444444";
|
|
29
|
+
readonly Gray: "#696969";
|
|
30
|
+
readonly LightGray: "#9C9C9C";
|
|
31
|
+
readonly LightestGray: "#CDCDCD";
|
|
32
|
+
readonly White: "#FFFFFF";
|
|
33
|
+
};
|
|
34
|
+
export declare const HIGHLIGHT_COLOR: {
|
|
35
|
+
readonly Purple: "#CAAAFF";
|
|
36
|
+
readonly Cyan: "#65EDE9";
|
|
37
|
+
readonly Red: "#FFACAC";
|
|
38
|
+
readonly Orange: "#FFBD82";
|
|
39
|
+
readonly Yellow: "#FCE244";
|
|
40
|
+
readonly Green: "#A0F751";
|
|
41
|
+
};
|
|
42
|
+
export declare const DEFAULT_HIGHLIGHT_COLOR: Record<(typeof HIGHLIGHT_COLOR)[keyof typeof HIGHLIGHT_COLOR], string>;
|
|
43
|
+
export declare const DEFAULT_FREE_TEXT_FONT_COLOR: Record<(typeof FREE_TEXT_FONT_COLOR)[keyof typeof FREE_TEXT_FONT_COLOR], string>;
|
|
44
|
+
export declare const DEFAULT_STRIKETHROUGH_COLOR: Record<(typeof HIGHLIGHT_COLOR)[keyof typeof HIGHLIGHT_COLOR] & (typeof FREE_TEXT_FONT_COLOR)[keyof typeof FREE_TEXT_FONT_COLOR], string>;
|
|
45
|
+
export declare const DEFAULT_UNDERLINE_COLOR: Record<(typeof HIGHLIGHT_COLOR)[keyof typeof HIGHLIGHT_COLOR] & (typeof FREE_TEXT_FONT_COLOR)[keyof typeof FREE_TEXT_FONT_COLOR], string>;
|
|
14
46
|
export declare const EDITOR_PREFIX: "pdfjs_internal_editor_";
|
package/dist/const.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*
|
|
11
11
|
* For commercial licensing inquiries, contact: david@vue-pdf-viewer.dev
|
|
12
12
|
*/
|
|
13
|
-
import { EventAnnotation, EventCore
|
|
13
|
+
import { EventAnnotation, EventCore } from "./enumerators";
|
|
14
14
|
import en from "./locales/en_US.json";
|
|
15
15
|
import cn from "./locales/zh_CN.json";
|
|
16
16
|
import it from "./locales/it_IT.json";
|
|
@@ -31,26 +31,59 @@ export const SYMBOL_SHARED_UI = Symbol("VPV Shared UIs");
|
|
|
31
31
|
export const SYMBOL_LOCALIZATION = Symbol("VPV Current Localization");
|
|
32
32
|
export const EVENT_ANNOTATION = EventAnnotation;
|
|
33
33
|
export const EVENT_CORE = EventCore;
|
|
34
|
-
export const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
};
|
|
42
|
-
export const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
34
|
+
export const BASIC_COLOR = {
|
|
35
|
+
Black: "#000000",
|
|
36
|
+
DarkGray: "#444444",
|
|
37
|
+
Gray: "#696969",
|
|
38
|
+
LightGray: "#9C9C9C",
|
|
39
|
+
LightestGray: "#CDCDCD",
|
|
40
|
+
White: "#FFFFFF",
|
|
41
|
+
};
|
|
42
|
+
export const FREE_TEXT_FONT_COLOR = {
|
|
43
|
+
...BASIC_COLOR,
|
|
44
|
+
Purple: "#7862FF",
|
|
45
|
+
Blue: "#1777FF",
|
|
46
|
+
Red: "#F66365",
|
|
47
|
+
Orange: "#F67E63",
|
|
48
|
+
Yellow: "#F5C463",
|
|
49
|
+
Green: "#48BB77",
|
|
50
|
+
};
|
|
51
|
+
export const HIGHLIGHT_COLOR = {
|
|
52
|
+
Purple: "#CAAAFF",
|
|
53
|
+
Cyan: "#65EDE9",
|
|
54
|
+
Red: "#FFACAC",
|
|
55
|
+
Orange: "#FFBD82",
|
|
56
|
+
Yellow: "#FCE244",
|
|
57
|
+
Green: "#A0F751",
|
|
58
|
+
};
|
|
59
|
+
export const DEFAULT_HIGHLIGHT_COLOR = {
|
|
60
|
+
[HIGHLIGHT_COLOR.Purple]: "Purple",
|
|
61
|
+
[HIGHLIGHT_COLOR.Cyan]: "Cyan",
|
|
62
|
+
[HIGHLIGHT_COLOR.Red]: "Red",
|
|
63
|
+
[HIGHLIGHT_COLOR.Orange]: "Orange",
|
|
64
|
+
[HIGHLIGHT_COLOR.Yellow]: "Yellow",
|
|
65
|
+
[HIGHLIGHT_COLOR.Green]: "Green",
|
|
66
|
+
};
|
|
67
|
+
export const DEFAULT_FREE_TEXT_FONT_COLOR = {
|
|
68
|
+
[FREE_TEXT_FONT_COLOR.Black]: "Black",
|
|
69
|
+
[FREE_TEXT_FONT_COLOR.DarkGray]: "Dark Gray",
|
|
70
|
+
[FREE_TEXT_FONT_COLOR.Gray]: "Gray",
|
|
71
|
+
[FREE_TEXT_FONT_COLOR.LightGray]: "Light Gray",
|
|
72
|
+
[FREE_TEXT_FONT_COLOR.LightestGray]: "Lightest Gray",
|
|
73
|
+
[FREE_TEXT_FONT_COLOR.White]: "White",
|
|
74
|
+
[FREE_TEXT_FONT_COLOR.Purple]: "Purple",
|
|
75
|
+
[FREE_TEXT_FONT_COLOR.Blue]: "Blue",
|
|
76
|
+
[FREE_TEXT_FONT_COLOR.Red]: "Red",
|
|
77
|
+
[FREE_TEXT_FONT_COLOR.Orange]: "Orange",
|
|
78
|
+
[FREE_TEXT_FONT_COLOR.Yellow]: "Yellow",
|
|
79
|
+
[FREE_TEXT_FONT_COLOR.Green]: "Green",
|
|
80
|
+
};
|
|
81
|
+
export const DEFAULT_STRIKETHROUGH_COLOR = {
|
|
82
|
+
...DEFAULT_HIGHLIGHT_COLOR,
|
|
83
|
+
...DEFAULT_FREE_TEXT_FONT_COLOR,
|
|
84
|
+
};
|
|
85
|
+
export const DEFAULT_UNDERLINE_COLOR = {
|
|
86
|
+
...DEFAULT_HIGHLIGHT_COLOR,
|
|
87
|
+
...DEFAULT_FREE_TEXT_FONT_COLOR,
|
|
55
88
|
};
|
|
56
89
|
export const EDITOR_PREFIX = "pdfjs_internal_editor_";
|
package/dist/enumerators.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export declare enum EventAnnotation {
|
|
2
|
-
|
|
2
|
+
textSelection = "vpv:annotation:textSelection",
|
|
3
3
|
freeText = "vpv:annotation:freeText",
|
|
4
4
|
signature = "vpv:annotation:signature",
|
|
5
5
|
image = "vpv:annotation:image",
|
|
6
|
+
highlight = "vpv:annotation:highlight",
|
|
6
7
|
underline = "vpv:annotation:underline",
|
|
7
8
|
strikeout = "vpv:annotation:strikeout"
|
|
8
9
|
}
|
|
@@ -13,28 +14,6 @@ export declare enum EventCore {
|
|
|
13
14
|
AnnotationMounted = "vpv:annotation:mounted",
|
|
14
15
|
Rotate = "vpv:rotate"
|
|
15
16
|
}
|
|
16
|
-
export declare enum HighlightColor {
|
|
17
|
-
Purple = "#CAAAFF",
|
|
18
|
-
Cyan = "#65EDE9",
|
|
19
|
-
Red = "#FFACAC",
|
|
20
|
-
Orange = "#FFBD82",
|
|
21
|
-
Yellow = "#FCE244",
|
|
22
|
-
Green = "#A0F751"
|
|
23
|
-
}
|
|
24
|
-
export declare enum FreeTextFontColor {
|
|
25
|
-
Black = "#000000",
|
|
26
|
-
DarkGray = "#444444",
|
|
27
|
-
Gray = "#696969",
|
|
28
|
-
LightGray = "#9C9C9C",
|
|
29
|
-
LightestGray = "#CDCDCD",
|
|
30
|
-
White = "#FFFFFF",
|
|
31
|
-
Purple = "#7862FF",
|
|
32
|
-
Blue = "#1777FF",
|
|
33
|
-
Red = "#F66365",
|
|
34
|
-
Orange = "#F67E63",
|
|
35
|
-
Yellow = "#F5C463",
|
|
36
|
-
Green = "#48BB77"
|
|
37
|
-
}
|
|
38
17
|
export declare enum AnnotationType {
|
|
39
18
|
Text = 1,
|
|
40
19
|
Link = 2,
|
package/dist/enumerators.js
CHANGED
|
@@ -12,10 +12,12 @@
|
|
|
12
12
|
*/
|
|
13
13
|
export var EventAnnotation;
|
|
14
14
|
(function (EventAnnotation) {
|
|
15
|
-
EventAnnotation["
|
|
15
|
+
EventAnnotation["textSelection"] = "vpv:annotation:textSelection";
|
|
16
16
|
EventAnnotation["freeText"] = "vpv:annotation:freeText";
|
|
17
17
|
EventAnnotation["signature"] = "vpv:annotation:signature";
|
|
18
18
|
EventAnnotation["image"] = "vpv:annotation:image";
|
|
19
|
+
// TODO: Remove events that depends on textSelection
|
|
20
|
+
EventAnnotation["highlight"] = "vpv:annotation:highlight";
|
|
19
21
|
EventAnnotation["underline"] = "vpv:annotation:underline";
|
|
20
22
|
EventAnnotation["strikeout"] = "vpv:annotation:strikeout";
|
|
21
23
|
})(EventAnnotation || (EventAnnotation = {}));
|
|
@@ -27,30 +29,6 @@ export var EventCore;
|
|
|
27
29
|
EventCore["AnnotationMounted"] = "vpv:annotation:mounted";
|
|
28
30
|
EventCore["Rotate"] = "vpv:rotate";
|
|
29
31
|
})(EventCore || (EventCore = {}));
|
|
30
|
-
export var HighlightColor;
|
|
31
|
-
(function (HighlightColor) {
|
|
32
|
-
HighlightColor["Purple"] = "#CAAAFF";
|
|
33
|
-
HighlightColor["Cyan"] = "#65EDE9";
|
|
34
|
-
HighlightColor["Red"] = "#FFACAC";
|
|
35
|
-
HighlightColor["Orange"] = "#FFBD82";
|
|
36
|
-
HighlightColor["Yellow"] = "#FCE244";
|
|
37
|
-
HighlightColor["Green"] = "#A0F751";
|
|
38
|
-
})(HighlightColor || (HighlightColor = {}));
|
|
39
|
-
export var FreeTextFontColor;
|
|
40
|
-
(function (FreeTextFontColor) {
|
|
41
|
-
FreeTextFontColor["Black"] = "#000000";
|
|
42
|
-
FreeTextFontColor["DarkGray"] = "#444444";
|
|
43
|
-
FreeTextFontColor["Gray"] = "#696969";
|
|
44
|
-
FreeTextFontColor["LightGray"] = "#9C9C9C";
|
|
45
|
-
FreeTextFontColor["LightestGray"] = "#CDCDCD";
|
|
46
|
-
FreeTextFontColor["White"] = "#FFFFFF";
|
|
47
|
-
FreeTextFontColor["Purple"] = "#7862FF";
|
|
48
|
-
FreeTextFontColor["Blue"] = "#1777FF";
|
|
49
|
-
FreeTextFontColor["Red"] = "#F66365";
|
|
50
|
-
FreeTextFontColor["Orange"] = "#F67E63";
|
|
51
|
-
FreeTextFontColor["Yellow"] = "#F5C463";
|
|
52
|
-
FreeTextFontColor["Green"] = "#48BB77";
|
|
53
|
-
})(FreeTextFontColor || (FreeTextFontColor = {}));
|
|
54
32
|
export var AnnotationType;
|
|
55
33
|
(function (AnnotationType) {
|
|
56
34
|
AnnotationType[AnnotationType["Text"] = 1] = "Text";
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Component, ComponentInternalInstance, ComputedRef } from "vue";
|
|
1
|
+
import type { Component, ComponentInternalInstance, ComputedRef, VNode } from "vue";
|
|
2
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 = {
|
|
@@ -159,6 +159,30 @@ export type AnnotationHighlightColors = (AnnotationColors & {
|
|
|
159
159
|
export type AnnotationStrikethroughColors = AnnotationHighlightColors;
|
|
160
160
|
export type AnnotationUnderlineColors = AnnotationHighlightColors;
|
|
161
161
|
export type AnnotationFreeTextFontColors = AnnotationHighlightColors;
|
|
162
|
+
export interface AnnotationToolOption {
|
|
163
|
+
icon?: Component | VNode | string;
|
|
164
|
+
component?: Component;
|
|
165
|
+
}
|
|
166
|
+
export interface HighlightToolOption extends AnnotationToolOption {
|
|
167
|
+
colors?: AnnotationHighlightColors;
|
|
168
|
+
}
|
|
169
|
+
export interface StrikethroughToolOption extends AnnotationToolOption {
|
|
170
|
+
colors?: AnnotationStrikethroughColors;
|
|
171
|
+
}
|
|
172
|
+
export interface UnderlineToolOption extends AnnotationToolOption {
|
|
173
|
+
colors?: AnnotationUnderlineColors;
|
|
174
|
+
}
|
|
175
|
+
export interface TextSelectionOption extends AnnotationToolOption {
|
|
176
|
+
highlight?: HighlightToolOption | boolean;
|
|
177
|
+
strikethrough?: StrikethroughToolOption | boolean;
|
|
178
|
+
underline?: UnderlineToolOption | boolean;
|
|
179
|
+
}
|
|
180
|
+
export interface FreeTextOption extends AnnotationToolOption {
|
|
181
|
+
fontColors?: AnnotationFreeTextFontColors;
|
|
182
|
+
fontSizes?: number[];
|
|
183
|
+
}
|
|
184
|
+
export interface ImageOption extends AnnotationToolOption {
|
|
185
|
+
}
|
|
162
186
|
export type VPVEvent = EventAnnotation | EventCore;
|
|
163
187
|
export interface AnnotationAttachment {
|
|
164
188
|
content: Uint8Array;
|